1 The patch "wext: refactor" by Johannes Berg refactored
2 wext code so that new kernels no longer get the wext
3 handlers through struct netdevice, instead they get
4 it through the struct wiphy which is cfg80211 specific.
6 For old kernels this means you get not wext handlers
7 anymore when backporting code, this adds the wext handler
8 back to the netdevice wireless_handlers to let compat
11 We only do this for kernels <= 2.6.32 as 2.6.33 will use
12 the struct wiphy wireless handler.
14 --- a/net/wireless/core.c
15 +++ b/net/wireless/core.c
16 @@ -701,6 +701,10 @@ static int cfg80211_netdev_notifier_call
17 wdev->sme_state = CFG80211_SME_IDLE;
18 mutex_unlock(&rdev->devlist_mtx);
19 #ifdef CONFIG_CFG80211_WEXT
20 +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32))
21 + if (!dev->wireless_handlers)
22 + dev->wireless_handlers = &cfg80211_wext_handler;
24 wdev->wext.default_key = -1;
25 wdev->wext.default_mgmt_key = -1;
26 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;