From f25fa12c7c53b7d0ce590b1578c0723c26ec7a55 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 6 Oct 2009 14:19:02 -0400 Subject: [PATCH] cfg80211: add wext handlers back to netdev for compat code The patch "wext: refactor" by Johannes Berg refactored wext code so that new kernels no longer get the wext handlers through struct netdevice, instead they get it through the struct wiphy which is cfg80211 specific. For old kernels this means you get not wext handlers anymore when backporting code, this adds the wext handler back to the netdevice wireless_handlers to let compat users use wext again. Signed-off-by: Luis R. Rodriguez --- .../10-add-wext-handlers-to-netdev.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 compat/patches/10-add-wext-handlers-to-netdev.patch diff --git a/compat/patches/10-add-wext-handlers-to-netdev.patch b/compat/patches/10-add-wext-handlers-to-netdev.patch new file mode 100644 index 000000000000..9172c2073515 --- /dev/null +++ b/compat/patches/10-add-wext-handlers-to-netdev.patch @@ -0,0 +1,26 @@ +The patch "wext: refactor" by Johannes Berg refactored +wext code so that new kernels no longer get the wext +handlers through struct netdevice, instead they get +it through the struct wiphy which is cfg80211 specific. + +For old kernels this means you get not wext handlers +anymore when backporting code, this adds the wext handler +back to the netdevice wireless_handlers to let compat +users use wext again. + +We only do this for kernels <= 2.6.32 as 2.6.33 will use +the struct wiphy wireless handler. + +--- a/net/wireless/core.c 2009-10-06 13:23:34.000000000 -0400 ++++ b/net/wireless/core.c 2009-10-06 13:25:31.000000000 -0400 +@@ -671,6 +671,10 @@ + wdev->sme_state = CFG80211_SME_IDLE; + mutex_unlock(&rdev->devlist_mtx); + #ifdef CONFIG_CFG80211_WEXT ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32)) ++ if (!dev->wireless_handlers) ++ dev->wireless_handlers = &cfg80211_wext_handler; ++#endif + wdev->wext.default_key = -1; + wdev->wext.default_mgmt_key = -1; + wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; -- 2.30.2