aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2008-06-11 12:50:10 -0700
committerLuis R. Rodriguez <lrodriguez@atheros.com>2008-06-11 12:50:10 -0700
commit0192aa6829db7bfd890396d06476daa006dd1976 (patch)
tree8cc48db34984c4ded53275a148c19efeda2f4f59
parent5e9e08524867f22c7bb4cf70303e1c7d3f839134 (diff)
downloadcompat-wireless-2.6-old-0192aa6829db7bfd890396d06476daa006dd1976.tar.gz
CONFIG_MAC80211_QOS is required for 802.11e (WME) and 802.11n (HT).
Also CONFIG_MAC80211_QOS won't be in kernels until 2.6.27, but it does have its requirements. It requires *both* CONFIG_NETDEVICES_MULTIQUEUE and CONFIG_NET_SCHED. Lets deal with these requirements and also handle them specially in the compat_autoconf.h This should fix some issues with unresolved symbols when CONFIG_MAC80211_QOS is disabled. The problem was compat_autoconf wasn't disabling it. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
-rw-r--r--Makefile2
-rw-r--r--config.mk33
-rwxr-xr-xscripts/gen-compat-autoconf.sh46
-rwxr-xr-xscripts/unload.sh3
4 files changed, 74 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index e905402..c14e45d 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ KMODPATH_ARG:= "INSTALL_MOD_PATH=$(KLIB)"
else
KLIB:= /lib/modules/$(shell uname -r)
endif
-KLIB_BUILD ?= $(KLIB)/build
+export KLIB_BUILD ?= $(KLIB)/build
# Sometimes not available in the path
MODPROBE := /sbin/modprobe
MADWIFI=$(shell $(MODPROBE) -l ath_pci)
diff --git a/config.mk b/config.mk
index 66a1244..905313d 100644
--- a/config.mk
+++ b/config.mk
@@ -17,23 +17,42 @@ endif
CONFIG_MAC80211=y
# Enable QOS for 2.6.22, we'll do some hacks here to enable it.
-# You will need this for HT support (802.11n).
+# You will need this for HT support (802.11n) and WME (802.11e).
# If you are >= 2.6.23 we'll only warn when you don't have MQ support
-# enabled, but maybe we should just exit, as I suspect everyone using
-# this package may want it enabled... hmm
+# or NET_SCHED enabled.
+#
+# We could consider just quiting if MQ and NET_SCHED is disabled
+# as I suspect all users of this package want 802.11e (WME) and
+# 802.11n (HT) support.
ifeq ($(shell test -e $(KLIB_BUILD)/Makefile && echo yes),yes)
KERNEL_SUBLEVEL = $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
ifeq ($(shell test $(KERNEL_SUBLEVEL) -lt 23 && echo yes),yes)
CONFIG_MAC80211_QOS=y
else
-ifeq ($(CONFIG_NETDEVICES_MULTIQUEUE),)
-$(warning "WARNING: You are running a kernel >= 2.6.23, you should enable CONFIG_NETDEVICES_MULTIQUEUE for 802.11n support")
-else
-CONFIG_MAC80211_QOS=y
+
+# we're in a kernel >= 2.6.23
+
+ifneq ($(KERNELRELEASE),) # This prevents a warning
+
+ifeq ($(CONFIG_NETDEVICES_MULTIQUEUE),) # checks MQ first
+ QOS_REQS_MISSING+=CONFIG_NETDEVICES_MULTIQUEUE
endif
+
+ifeq ($(CONFIG_NET_SCHED),)
+ QOS_REQS_MISSING+=CONFIG_NET_SCHED
endif
+
+ifeq ($(QOS_REQS_MISSING),) # if our dependencies match for MAC80211_QOS
+CONFIG_MAC80211_QOS=y
+else # Complain about our missing dependencies
+$(warning "WARNING: You are running a kernel >= 2.6.23, you should enable in it $(QOS_REQS_MISSING) for 802.11[ne] support")
endif
+endif # In build module mode
+
+endif # kernel release check
+endif # kernel Makefile check
+
CONFIG_MAC80211_RC_DEFAULT=pid
CONFIG_MAC80211_RC_PID=y
diff --git a/scripts/gen-compat-autoconf.sh b/scripts/gen-compat-autoconf.sh
index 173431f..57065a8 100755
--- a/scripts/gen-compat-autoconf.sh
+++ b/scripts/gen-compat-autoconf.sh
@@ -14,6 +14,7 @@
OLDEST_KERNEL_SUPPORTED="2.6.21"
COMPAT_RELEASE="compat-release"
KERNEL_RELEASE="git-describe"
+MULT_DEP_FILE=".compat_pivot_dep"
if [ $# -ne 1 ]; then
echo "Usage $0 config-file"
@@ -93,6 +94,28 @@ function define_config_dep {
echo "#endif /* $WARN_VAR */"
}
+# This handles options which have *multiple* dependencies from the kernel
+function define_config_multiple_deps {
+ VAR=$1
+ VALUE=$2
+ DEP_ARRAY=$3
+
+ # First, put all ifdefs
+ for i in $(cat $MULT_DEP_FILE); do
+ echo "#ifdef $i"
+ done
+
+ # Now put our option in the middle
+ define_config $VAR $VALUE
+
+ # Now close all ifdefs
+ # First, put all ifdefs
+ for i in $(cat $MULT_DEP_FILE); do
+ echo "#endif"
+ done
+
+}
+
function kernel_version_req {
VERSION=$(echo $1 | sed -e 's/\./,/g')
echo "#if (LINUX_VERSION_CODE < KERNEL_VERSION($VERSION))"
@@ -140,9 +163,32 @@ for i in $(grep '^CONFIG_' $COMPAT_CONFIG); do
CONFIG_USB_NET_RNDIS_HOST)
define_config_dep $VAR $VALUE CONFIG_USB_NET_CDCETHER
continue
+ ;;
+ # ignore this, we have a special hanlder for this at the botttom
+ # instead. We still need to keep this in config.mk to let Makefiles
+ # know its enabled so just ignore it here.
+ CONFIG_MAC80211_QOS)
+ continue
+ ;;
esac
# Any other module which can *definitely* be built as a module goes here
define_config $VAR $VALUE
done
+# Deal with special cases. CONFIG_MAC80211_QOS is such a case.
+# We handle this specially for different kernels we support.
+if [ -f $KLIB_BUILD/Makefile ]; then
+ SUBLEVEL=$(make -C $KLIB_BUILD kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
+ if [ $SUBLEVEL -le 22 ]; then
+ define_config CONFIG_MAC80211_QOS y
+ else # kernel >= 2.6.23
+ # CONFIG_MAC80211_QOS on these kernels requires
+ # CONFIG_NET_SCHED and CONFIG_NETDEVICES_MULTIQUEUE
+ rm -f $MULT_DEP_FILE
+ echo CONFIG_NET_SCHED >> $MULT_DEP_FILE
+ echo CONFIG_NETDEVICES_MULTIQUEUE >> $MULT_DEP_FILE
+ define_config_multiple_deps CONFIG_MAC80211_QOS y $ALL_DEPS
+ rm -f $MULT_DEP_FILE
+ fi
+fi
echo "#endif /* COMPAT_AUTOCONF_INCLUDED */"
diff --git a/scripts/unload.sh b/scripts/unload.sh
index 0ea082f..0090fd1 100755
--- a/scripts/unload.sh
+++ b/scripts/unload.sh
@@ -2,8 +2,7 @@
# The old stack drivers and the mac80211 rc80211_simple modules
# which is no longer on recent kernels (its internal)
-OLD_MODULES="iwlwifi_mac80211 rc80211_simple zd1211rw zd1211rw-mac80211"
-OLD_MODULES="$OLD_MODULES bcm43xx rndis_wext"
+OLD_MODULES="rc80211_simple zd1211rw zd1211rw-mac80211 bcm43xx rndis_wext"
MODULES="$OLD_MODULES"
MODULES="$MODULES ipw2100 ipw2200"
MODULES="$MODULES libertas_cs usb8xxx libertas"