compat-2.6: new netns compat work
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 28 Jul 2009 00:05:17 +0000 (17:05 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 28 Jul 2009 00:05:17 +0000 (17:05 -0700)
There is still more to go.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
compat/compat-2.6.32.h
compat/compat.diff

index 931fac2136a488823675a6a9d3762f55c631df73..3a1aecd5548e6500b55530569ccd032c0d462da6 100644 (file)
 #define SDIO_DEVICE_ID_INTEL_IWMC3200GPS       0x1405
 #define SDIO_DEVICE_ID_INTEL_IWMC3200BT                0x1406
 
+/*
+ * struct genl_multicast_group was made netns aware through
+ * patch "genetlink: make netns aware" by johannes, we just
+ * force this to always use the default init_net
+ */
+#define genl_info_net(x) &init_net
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) */
 
 #endif /* LINUX_26_32_COMPAT_H */
index bdf56695d24f32e47d62b5c9152912dab3cefa5a..d3f8e90e4702fc0f504ccc5102e2ab77375639c5 100644 (file)
 -      zd_chip_control_leds(&mac->chip, LED_OFF);
 +      zd_chip_control_leds(&mac->chip, ZD_LED_OFF);
  }
---- a/net/wireless/wext.c      2009-07-27 14:43:30.802074596 -0700
-+++ b/net/wireless/wext.c      2009-07-27 14:43:31.310065767 -0700
-@@ -1118,8 +1118,13 @@ static int wireless_process_ioctl(struct
-                       return private(dev, iwr, cmd, info, handler);
-       }
-       /* Old driver API : call driver ioctl handler */
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
-       if (dev->netdev_ops->ndo_do_ioctl)
-               return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
-+#else
-+      if (dev->do_ioctl)
-+              return dev->do_ioctl(dev, ifr, cmd);
-+#endif
-       return -EOPNOTSUPP;
- }
 --- a/drivers/net/wireless/libertas/defs.h     2009-07-08 14:04:29.692256519 -0700
 +++ b/drivers/net/wireless/libertas/defs.h     2009-07-08 14:03:26.712279246 -0700
 @@ -16,6 +16,14 @@
  
  #define LBS_DEB_ENTER 0x00000001
  #define LBS_DEB_LEAVE 0x00000002
+--- a/net/wireless/wext.c      2009-07-27 15:38:09.989056661 -0700
++++ b/net/wireless/wext.c      2009-07-27 16:05:06.681045663 -0700
+@@ -1118,8 +1118,13 @@
+                       return private(dev, iwr, cmd, info, handler);
+       }
+       /* Old driver API : call driver ioctl handler */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+       if (dev->netdev_ops->ndo_do_ioctl)
+               return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
++#else
++      if (dev->do_ioctl)
++              return dev->do_ioctl(dev, ifr, cmd);
++#endif
+       return -EOPNOTSUPP;
+ }
+@@ -1272,6 +1277,7 @@
+ }
+ #endif
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
+ static int __net_init wext_pernet_init(struct net *net)
+ {
+       skb_queue_head_init(&net->wext_nlevents);
+@@ -1315,6 +1321,29 @@
+ static DECLARE_WORK(wireless_nlevent_work, wireless_nlevent_process);
++#else
++/* Older kernels get the old way of doing stuff*/
++static struct sk_buff_head wireless_nlevent_queue;
++
++static int __init wireless_nlevent_init(void)
++{
++      skb_queue_head_init(&wireless_nlevent_queue);
++      return 0;
++}
++
++subsys_initcall(wireless_nlevent_init);
++
++static void wireless_nlevent_process(unsigned long data)
++{
++      struct sk_buff *skb;
++      while ((skb = skb_dequeue(&wireless_nlevent_queue)))
++              rtnl_notify(skb, &init_net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC);
++}
++
++static DECLARE_TASKLET(wireless_nlevent_tasklet, wireless_nlevent_process, 0);
++
++#endif
++
+ static struct nlmsghdr *rtnetlink_ifinfo_prep(struct net_device *dev,
+                                             struct sk_buff *skb)
+ {
+@@ -1525,8 +1554,13 @@
+       skb_shinfo(skb)->frag_list = compskb;
+ #endif
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
+       skb_queue_tail(&dev_net(dev)->wext_nlevents, skb);
+       schedule_work(&wireless_nlevent_work);
++#else
++      skb_queue_tail(&wireless_nlevent_queue, skb);
++      tasklet_schedule(&wireless_nlevent_tasklet);
++#endif
+ }
+ EXPORT_SYMBOL(wireless_send_event);