| The only other namespace change. Note that pach 01-netdev.patch |
| also has some other namespace changes there, look at that file |
| for the other changes. It'd be nice to figure out a way to |
| bring thise here cleanly and seprately but they touch the same |
| files... |
| |
| --- a/net/wireless/nl80211.c |
| +++ b/net/wireless/nl80211.c |
| @@ -6727,7 +6727,9 @@ static int nl80211_wiphy_netns(struct sk |
| if (!net_eq(wiphy_net(&rdev->wiphy), net)) |
| err = cfg80211_switch_netns(rdev, net); |
| |
| +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) |
| put_net(net); |
| +#endif |
| return err; |
| } |
| |
| --- a/net/wireless/core.c |
| +++ b/net/wireless/core.c |
| @@ -160,6 +160,7 @@ int cfg80211_dev_rename(struct cfg80211_ |
| return 0; |
| } |
| |
| +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) |
| int cfg80211_switch_netns(struct cfg80211_registered_device *rdev, |
| struct net *net) |
| { |
| @@ -204,6 +205,7 @@ int cfg80211_switch_netns(struct cfg8021 |
| |
| return 0; |
| } |
| +#endif |
| |
| static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data) |
| { |
| @@ -338,7 +340,9 @@ struct wiphy *wiphy_new(const struct cfg |
| rdev->wiphy.flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; |
| #endif |
| |
| +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) |
| wiphy_net_set(&rdev->wiphy, &init_net); |
| +#endif |
| |
| rdev->rfkill_ops.set_block = cfg80211_rfkill_set_block; |
| rdev->rfkill = rfkill_alloc(dev_name(&rdev->wiphy.dev), |
| @@ -891,8 +895,10 @@ static int cfg80211_netdev_notifier_call |
| wdev->identifier = ++rdev->wdev_id; |
| list_add_rcu(&wdev->list, &rdev->wdev_list); |
| rdev->devlist_generation++; |
| +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) |
| /* can only change netns with wiphy */ |
| dev->features |= NETIF_F_NETNS_LOCAL; |
| +#endif |
| |
| if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj, |
| "phy80211")) { |
| @@ -1051,6 +1057,7 @@ static struct notifier_block cfg80211_ne |
| .notifier_call = cfg80211_netdev_notifier_call, |
| }; |
| |
| +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) |
| static void __net_exit cfg80211_pernet_exit(struct net *net) |
| { |
| struct cfg80211_registered_device *rdev; |
| @@ -1068,14 +1075,17 @@ static void __net_exit cfg80211_pernet_e |
| static struct pernet_operations cfg80211_pernet_ops = { |
| .exit = cfg80211_pernet_exit, |
| }; |
| +#endif |
| |
| static int __init cfg80211_init(void) |
| { |
| int err; |
| |
| +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) |
| err = register_pernet_device(&cfg80211_pernet_ops); |
| if (err) |
| goto out_fail_pernet; |
| +#endif |
| |
| err = wiphy_sysfs_init(); |
| if (err) |
| @@ -1110,8 +1120,10 @@ out_fail_nl80211: |
| out_fail_notifier: |
| wiphy_sysfs_exit(); |
| out_fail_sysfs: |
| +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) |
| unregister_pernet_device(&cfg80211_pernet_ops); |
| out_fail_pernet: |
| +#endif |
| return err; |
| } |
| subsys_initcall(cfg80211_init); |
| @@ -1123,7 +1135,9 @@ static void __exit cfg80211_exit(void) |
| unregister_netdevice_notifier(&cfg80211_netdev_notifier); |
| wiphy_sysfs_exit(); |
| regulatory_exit(); |
| +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) |
| unregister_pernet_device(&cfg80211_pernet_ops); |
| +#endif |
| destroy_workqueue(cfg80211_wq); |
| } |
| module_exit(cfg80211_exit); |
| --- a/net/wireless/wext-core.c |
| +++ b/net/wireless/wext-core.c |
| @@ -367,6 +367,7 @@ static int __init wireless_nlevent_init( |
| subsys_initcall(wireless_nlevent_init); |
| |
| /* Process events generated by the wireless layer or the driver. */ |
| +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) |
| static void wireless_nlevent_process(struct work_struct *work) |
| { |
| struct sk_buff *skb; |
| @@ -382,6 +383,20 @@ static void wireless_nlevent_process(str |
| |
| rtnl_unlock(); |
| } |
| +#else |
| +static void wireless_nlevent_process(struct work_struct *work) |
| +{ |
| + struct sk_buff *skb; |
| + struct net *net; |
| + |
| + rtnl_lock(); |
| + |
| + while ((skb = skb_dequeue(&net->wext_nlevents))) |
| + rtnl_notify(skb, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); |
| + |
| + rtnl_unlock(); |
| +} |
| +#endif |
| |
| static DECLARE_WORK(wireless_nlevent_work, wireless_nlevent_process); |
| |
| --- a/net/wireless/wext-proc.c |
| +++ b/net/wireless/wext-proc.c |
| @@ -98,7 +98,11 @@ static void *wireless_dev_seq_start(stru |
| return SEQ_START_TOKEN; |
| |
| off = 1; |
| +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) |
| for_each_netdev(net, dev) |
| +#else |
| + for_each_netdev(net) |
| +#endif |
| if (off++ == *pos) |
| return dev; |
| return NULL; |