compat-wireles: fix compilation when you have disabled CONFIG_CFG80211_WEXT
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Thu, 17 Jun 2010 20:28:58 +0000 (13:28 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Thu, 17 Jun 2010 20:28:58 +0000 (13:28 -0700)
commit75bb5106cc632665fdccb9abc13f35dbaf70df1e
tree8ec78f8ff30edbb269d0733bc9ccae51d77a331d
parent11542b55c55d78d886a4ab457655652258d755d0
compat-wireles: fix compilation when you have disabled CONFIG_CFG80211_WEXT

On newer kernels you can disable CONFIG_CFG80211_WEXT. If you try to
compile compat-wireless with CONFIG_CFG80211_WEXT disabled you get:

  CC [M]  /home/mcgrof/devel/compat-wireless-2.6/net/wireless/core.o
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/core.c: In function ‘cfg80211_netdev_notifier_call’:
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/core.c:703: error: ‘struct net_device’ has no member named ‘wireless_handlers’
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/core.c:704: error: ‘struct net_device’ has no member named ‘wireless_handlers’
make[3]: *** [/home/mcgrof/devel/compat-wireless-2.6/net/wireless/core.o] Error 1
make[2]: *** [/home/mcgrof/devel/compat-wireless-2.6/net/wireless] Error 2
make[1]: *** [_module_/home/mcgrof/devel/compat-wireless-2.6] Error 2

This is because we currently force CONFIG_CFG80211_WEXT to be enabled
on the compat_autoconf.h. Instead we should enable it conditionally
based on CONFIG_CFG80211_WEXT for older kernels and simply leave it
out for newer kernels, so we can respect your kernel config. For
newer kernels you cannot enable CONFIG_CFG80211_WEXT since
the net_device structure changes based on CONFIG_CFG80211_WEXT,
the wireless_handlers are not added to the net_device if you don't
have it enabled.

Reported-by: Mathieu Olivari <Mathieu.Olivari@Atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
config.mk
scripts/gen-compat-autoconf.sh