SUNRPC: clean up rpc_call_async/rpc_call_sync/rpc_run_task
[safe/jmp/linux-2.6] / net / appletalk / aarp.c
index 54640c0..5ef6a23 100644 (file)
  *
  */
 
-#include <linux/config.h>
 #include <linux/if_arp.h>
 #include <net/sock.h>
 #include <net/datalink.h>
 #include <net/psnap.h>
 #include <linux/atalk.h>
+#include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
@@ -118,7 +118,9 @@ static void __aarp_send_query(struct aarp_entry *a)
 
        /* Set up the buffer */
        skb_reserve(skb, dev->hard_header_len + aarp_dl->header_length);
-       skb->nh.raw      = skb->h.raw = skb_put(skb, sizeof(*eah));
+       skb_reset_network_header(skb);
+       skb_reset_transport_header(skb);
+       skb_put(skb, sizeof(*eah));
        skb->protocol    = htons(ETH_P_ATALK);
        skb->dev         = dev;
        eah              = aarp_hdr(skb);
@@ -163,7 +165,9 @@ static void aarp_send_reply(struct net_device *dev, struct atalk_addr *us,
 
        /* Set up the buffer */
        skb_reserve(skb, dev->hard_header_len + aarp_dl->header_length);
-       skb->nh.raw      = skb->h.raw = skb_put(skb, sizeof(*eah));
+       skb_reset_network_header(skb);
+       skb_reset_transport_header(skb);
+       skb_put(skb, sizeof(*eah));
        skb->protocol    = htons(ETH_P_ATALK);
        skb->dev         = dev;
        eah              = aarp_hdr(skb);
@@ -212,7 +216,9 @@ static void aarp_send_probe(struct net_device *dev, struct atalk_addr *us)
 
        /* Set up the buffer */
        skb_reserve(skb, dev->hard_header_len + aarp_dl->header_length);
-       skb->nh.raw      = skb->h.raw = skb_put(skb, sizeof(*eah));
+       skb_reset_network_header(skb);
+       skb_reset_transport_header(skb);
+       skb_put(skb, sizeof(*eah));
        skb->protocol    = htons(ETH_P_ATALK);
        skb->dev         = dev;
        eah              = aarp_hdr(skb);
@@ -462,8 +468,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 +515,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)
@@ -541,7 +545,7 @@ int aarp_send_ddp(struct net_device *dev, struct sk_buff *skb,
        int hash;
        struct aarp_entry *a;
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        /* Check for LocalTalk first */
        if (dev->type == ARPHRD_LOCALTLK) {
@@ -565,7 +569,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 +703,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;
@@ -897,7 +901,7 @@ struct aarp_iter_state {
 
 /*
  * Get the aarp entry that is in the chain described
- * by the iterator. 
+ * by the iterator.
  * If pos is set then skip till that index.
  * pos = 1 is the first entry
  */
@@ -907,7 +911,7 @@ static struct aarp_entry *iter_next(struct aarp_iter_state *iter, loff_t *pos)
        struct aarp_entry **table = iter->table;
        loff_t off = 0;
        struct aarp_entry *entry;
-       
+
  rescan:
        while(ct < AARP_HASH_SIZE) {
                for (entry = table[ct]; entry; entry = entry->next) {
@@ -952,9 +956,9 @@ static void *aarp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
        ++*pos;
 
        /* first line after header */
-       if (v == SEQ_START_TOKEN) 
+       if (v == SEQ_START_TOKEN)
                entry = iter_next(iter, NULL);
-               
+
        /* next entry in current bucket */
        else if (entry->next)
                entry = entry->next;
@@ -988,7 +992,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v)
        unsigned long now = jiffies;
 
        if (v == SEQ_START_TOKEN)
-               seq_puts(seq, 
+               seq_puts(seq,
                         "Address  Interface   Hardware Address"
                         "   Expires LastSend  Retry Status\n");
        else {
@@ -1016,7 +1020,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v)
                           : (iter->table == unresolved) ? "unresolved"
                           : (iter->table == proxies) ? "proxies"
                           : "unknown");
-       }                                
+       }
        return 0;
 }
 
@@ -1032,7 +1036,7 @@ static int aarp_seq_open(struct inode *inode, struct file *file)
        struct seq_file *seq;
        int rc = -ENOMEM;
        struct aarp_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL);
-       
+
        if (!s)
                goto out;
 
@@ -1050,7 +1054,7 @@ out_kfree:
        goto out;
 }
 
-struct file_operations atalk_seq_arp_fops = {
+const struct file_operations atalk_seq_arp_fops = {
        .owner          = THIS_MODULE,
        .open           = aarp_seq_open,
        .read           = seq_read,