Search Linux Wireless

Re: [compat-masters] Backported MQ requirement on 802.11n for older kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 11, 2008 at 07:49:15AM -0700, Luis R. Rodriguez wrote:
> 
> OK the issue is very likely that the compat_autoconf.h is leaving
> CONFIG_MAC80211_QOS enabled as the script used to generate it detects
> all ^CONFIG_FOO options. I'm working on this, should have a patch soon
> for you to review.

Issue fixed and pushed out. compat-wireless is on 4.5 now.

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@xxxxxxxxxxx>
---
 Makefile                       |    2 +-
 config.mk                      |   33 ++++++++++++++++++++++------
 scripts/gen-compat-autoconf.sh |   46 ++++++++++++++++++++++++++++++++++++++++
 3 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 */"
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux