Merge branch 'fixes-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
[sfrench/cifs-2.6.git] / drivers / net / wireless / strip.c
index f5ce1c6063d823ed52dead7b417179783c1a4fec..88efe1bae58f5333d933c93ec21ac0b6aa09c42b 100644 (file)
@@ -107,6 +107,7 @@ static const char StripVersion[] = "1.3A-STUART.CHESHIRE";
 #include <linux/serialP.h>
 #include <linux/rcupdate.h>
 #include <net/arp.h>
+#include <net/net_namespace.h>
 
 #include <linux/ip.h>
 #include <linux/tcp.h>
@@ -1630,8 +1631,8 @@ static void strip_IdleTask(unsigned long parameter)
  */
 
 static int strip_header(struct sk_buff *skb, struct net_device *dev,
-                       unsigned short type, void *daddr, void *saddr,
-                       unsigned len)
+                       unsigned short type, const void *daddr,
+                       const void *saddr, unsigned len)
 {
        struct strip *strip_info = netdev_priv(dev);
        STRIP_Header *header = (STRIP_Header *) skb_push(skb, sizeof(STRIP_Header));
@@ -1971,8 +1972,7 @@ static struct net_device *get_strip_dev(struct strip *strip_info)
                      sizeof(zero_address))) {
                struct net_device *dev;
                read_lock_bh(&dev_base_lock);
-               dev = dev_base;
-               while (dev) {
+               for_each_netdev(&init_net, dev) {
                        if (dev->type == strip_info->dev->type &&
                            !memcmp(dev->dev_addr,
                                    &strip_info->true_dev_addr,
@@ -1983,7 +1983,6 @@ static struct net_device *get_strip_dev(struct strip *strip_info)
                                read_unlock_bh(&dev_base_lock);
                                return (dev);
                        }
-                       dev = dev->next;
                }
                read_unlock_bh(&dev_base_lock);
        }
@@ -2009,7 +2008,7 @@ static void deliver_packet(struct strip *strip_info, STRIP_Header * header,
                       packetlen);
                skb->dev = get_strip_dev(strip_info);
                skb->protocol = header->protocol;
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
 
                /* Having put a fake header on the front of the sk_buff for the */
                /* benefit of tools like tcpdump, skb_pull now 'consumes' that  */
@@ -2498,6 +2497,11 @@ static int strip_close_low(struct net_device *dev)
        return 0;
 }
 
+static const struct header_ops strip_header_ops = {
+       .create = strip_header,
+       .rebuild = strip_rebuild_header,
+};
+
 /*
  * This routine is called by DDI when the
  * (dynamically assigned) device is registered
@@ -2509,8 +2513,6 @@ static void strip_dev_setup(struct net_device *dev)
         * Finish setting up the DEVICE info.
         */
 
-       SET_MODULE_OWNER(dev);
-
        dev->trans_start = 0;
        dev->last_rx = 0;
        dev->tx_queue_len = 30; /* Drop after 30 frames queued */
@@ -2534,8 +2536,8 @@ static void strip_dev_setup(struct net_device *dev)
        dev->open = strip_open_low;
        dev->stop = strip_close_low;
        dev->hard_start_xmit = strip_xmit;
-       dev->hard_header = strip_header;
-       dev->rebuild_header = strip_rebuild_header;
+       dev->header_ops = &strip_header_ops;
+
        dev->set_mac_address = strip_set_mac_address;
        dev->get_stats = strip_get_stats;
        dev->change_mtu = strip_change_mtu;
@@ -2573,7 +2575,7 @@ static struct strip *strip_alloc(void)
                return NULL;    /* If no more memory, return */
 
 
-       strip_info = dev->priv;
+       strip_info = netdev_priv(dev);
        strip_info->dev = dev;
 
        strip_info->magic = STRIP_MAGIC;
@@ -2733,16 +2735,8 @@ static int strip_ioctl(struct tty_struct *tty, struct file *file,
                        return -EFAULT;
                return set_mac_address(strip_info, &addr);
        }
-       /*
-        * Allow stty to read, but not set, the serial port
-        */
-
-       case TCGETS:
-       case TCGETA:
-               return n_tty_ioctl(tty, file, cmd, arg);
-               break;
        default:
-               return -ENOIOCTLCMD;
+               return tty_mode_ioctl(tty, file, cmd, arg);
                break;
        }
        return 0;
@@ -2789,7 +2783,7 @@ static int __init strip_init_driver(void)
        /*
         * Register the status file with /proc
         */
-       proc_net_fops_create("strip", S_IFREG | S_IRUGO, &strip_seq_fops);
+       proc_net_fops_create(&init_net, "strip", S_IFREG | S_IRUGO, &strip_seq_fops);
 
        return status;
 }
@@ -2811,7 +2805,7 @@ static void __exit strip_exit_driver(void)
        }
 
        /* Unregister with the /proc/net file here. */
-       proc_net_remove("strip");
+       proc_net_remove(&init_net, "strip");
 
        if ((i = tty_unregister_ldisc(N_STRIP)))
                printk(KERN_ERR "STRIP: can't unregister line discipline (err = %d)\n", i);