]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/atm/br2684.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6-omap-h63xx.git] / net / atm / br2684.c
index 83a1c1b1d6cd2901761d5bc67b96c9594df094ba..faa6aaf67563ff298121518ffc192655a85be2ab 100644 (file)
@@ -173,7 +173,7 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
        }
        skb_push(skb, minheadroom);
        if (brvcc->encaps == e_llc)
-               memcpy(skb->data, llc_oui_pid_pad, 10);
+               skb_copy_to_linear_data(skb, llc_oui_pid_pad, 10);
        else
                memset(skb->data, 0, 2);
 #endif /* FASTER_VERSION */
@@ -182,7 +182,7 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
        ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc;
        DPRINTK("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc, atmvcc->dev);
        if (!atm_may_send(atmvcc, skb->truesize)) {
-               /* we free this here for now, because we cannot know in a higher 
+               /* we free this here for now, because we cannot know in a higher
                        layer whether the skb point it supplied wasn't freed yet.
                        now, it always is.
                */
@@ -375,11 +375,11 @@ packet_fails_filter(__be16 type, struct br2684_vcc *brvcc, struct sk_buff *skb)
 {
        if (brvcc->filter.netmask == 0)
                return 0;                       /* no filter in place */
-       if (type == __constant_htons(ETH_P_IP) &&
+       if (type == htons(ETH_P_IP) &&
            (((struct iphdr *) (skb->data))->daddr & brvcc->filter.
             netmask) == brvcc->filter.prefix)
                return 0;
-       if (type == __constant_htons(ETH_P_ARP))
+       if (type == htons(ETH_P_ARP))
                return 0;
        /* TODO: we should probably filter ARPs too.. don't want to have
         *   them returning values that don't make sense, or is that ok?
@@ -458,7 +458,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
        /* FIXME: tcpdump shows that pointer to mac header is 2 bytes earlier,
           than should be. What else should I set? */
        skb_pull(skb, plen);
-       skb->mac.raw = ((char *) (skb->data)) - ETH_HLEN;
+       skb_set_mac_header(skb, -ETH_HLEN);
        skb->pkt_type = PACKET_HOST;
 #ifdef CONFIG_BR2684_FAST_TRANS
        skb->protocol = ((u16 *) skb->data)[-1];
@@ -699,28 +699,13 @@ static struct atm_ioctl br2684_ioctl_ops = {
 #ifdef CONFIG_PROC_FS
 static void *br2684_seq_start(struct seq_file *seq, loff_t *pos)
 {
-       loff_t offs = 0;
-       struct br2684_dev *brd;
-
        read_lock(&devs_lock);
-
-       list_for_each_entry(brd, &br2684_devs, br2684_devs) {
-               if (offs == *pos)
-                       return brd;
-               ++offs;
-       }
-       return NULL;
+       return seq_list_start(&br2684_devs, *pos);
 }
 
 static void *br2684_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 {
-       struct br2684_dev *brd = v;
-
-       ++*pos;
-
-       brd = list_entry(brd->br2684_devs.next, 
-                        struct br2684_dev, br2684_devs);
-       return (&brd->br2684_devs != &br2684_devs) ? brd : NULL;
+       return seq_list_next(v, &br2684_devs, pos);
 }
 
 static void br2684_seq_stop(struct seq_file *seq, void *v)
@@ -730,7 +715,8 @@ static void br2684_seq_stop(struct seq_file *seq, void *v)
 
 static int br2684_seq_show(struct seq_file *seq, void *v)
 {
-       const struct br2684_dev *brdev = v;
+       const struct br2684_dev *brdev = list_entry(v, struct br2684_dev,
+                       br2684_devs);
        const struct net_device *net_dev = brdev->net_dev;
        const struct br2684_vcc *brvcc;
 
@@ -772,7 +758,7 @@ static int br2684_seq_show(struct seq_file *seq, void *v)
        return 0;
 }
 
-static struct seq_operations br2684_seq_ops = {
+static const struct seq_operations br2684_seq_ops = {
        .start = br2684_seq_start,
        .next  = br2684_seq_next,
        .stop  = br2684_seq_stop,
@@ -784,7 +770,7 @@ static int br2684_proc_open(struct inode *inode, struct file *file)
        return seq_open(file, &br2684_seq_ops);
 }
 
-static struct file_operations br2684_proc_ops = {
+static const struct file_operations br2684_proc_ops = {
        .owner   = THIS_MODULE,
        .open    = br2684_proc_open,
        .read    = seq_read,