X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fappletalk%2Faarp.c;h=f3777ec5bcb988bc9d33cb332aa96dc0dbeebd7d;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=8383c1d581cde369abb04047c1951ab3512a2f57;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c index 8383c1d58..f3777ec5b 100644 --- a/net/appletalk/aarp.c +++ b/net/appletalk/aarp.c @@ -29,12 +29,12 @@ * */ -#include #include #include #include #include #include +#include #include #include #include @@ -77,7 +77,7 @@ static struct aarp_entry *proxies[AARP_HASH_SIZE]; static int unresolved_count; /* One lock protects it all. */ -static rwlock_t aarp_lock = RW_LOCK_UNLOCKED; +static DEFINE_RWLOCK(aarp_lock); /* Used to walk the list and purge/kick entries. */ static struct timer_list aarp_timer; @@ -199,7 +199,7 @@ static void aarp_send_reply(struct net_device *dev, struct atalk_addr *us, * aarp_proxy_probe_network. */ -void aarp_send_probe(struct net_device *dev, struct atalk_addr *us) +static void aarp_send_probe(struct net_device *dev, struct atalk_addr *us) { struct elapaarp *eah; int len = dev->hard_header_len + sizeof(*eah) + aarp_dl->header_length; @@ -429,7 +429,7 @@ static struct atalk_addr *__aarp_proxy_find(struct net_device *dev, * Probe a Phase 1 device or a device that requires its Net:Node to * be set via an ioctl. */ -void aarp_send_probe_phase1(struct atalk_iface *iface) +static void aarp_send_probe_phase1(struct atalk_iface *iface) { struct ifreq atreq; struct sockaddr_at *sa = (struct sockaddr_at *)&atreq.ifr_addr; @@ -462,8 +462,7 @@ void aarp_probe_network(struct atalk_iface *atif) aarp_send_probe(atif->dev, &atif->address); /* Defer 1/10th */ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ / 10); + msleep(100); if (atif->status & ATIF_PROBE_FAIL) break; @@ -510,9 +509,8 @@ int aarp_proxy_probe_network(struct atalk_iface *atif, struct atalk_addr *sa) aarp_send_probe(atif->dev, sa); /* Defer 1/10th */ - current->state = TASK_INTERRUPTIBLE; write_unlock_bh(&aarp_lock); - schedule_timeout(HZ / 10); + msleep(100); write_lock_bh(&aarp_lock); if (entry->status & ATIF_PROBE_FAIL) @@ -565,7 +563,7 @@ int aarp_send_ddp(struct net_device *dev, struct sk_buff *skb, * numbers we just happen to need. Now put the * length in the lower two. */ - *((__u16 *)skb->data) = htons(skb->len); + *((__be16 *)skb->data) = htons(skb->len); ft = 1; } /* @@ -699,7 +697,7 @@ static void __aarp_resolved(struct aarp_entry **list, struct aarp_entry *a, * frame. We currently only support Ethernet. */ static int aarp_rcv(struct sk_buff *skb, struct net_device *dev, - struct packet_type *pt) + struct packet_type *pt, struct net_device *orig_dev) { struct elapaarp *ea = aarp_hdr(skb); int hash, ret = 0;