Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@gmail.com>
To: Tomas Winkler <tomasw@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	"John W. Linville" <linville@tuxdriver.com>,
	compat-masters@lists.madwifi.org,
	Tim Gardner <tim.gardner@canonical.com>,
	Ron Rindjunsky <ron.rindjunsky@intel.com>
Subject: Re: [compat-masters] Backported MQ requirement on 802.11n for older kernels
Date: Wed, 11 Jun 2008 16:02:32 -0400	[thread overview]
Message-ID: <20080611200232.GH17936@ruslug.rutgers.edu> (raw)
In-Reply-To: <43e72e890806110749q25a2490dm325f21554409925e@mail.gmail.com>

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@atheros.com>
---
 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


  reply	other threads:[~2008-06-11 20:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-08 15:55 Backported MQ requirement on 802.11n for older kernels Luis R. Rodriguez
2008-06-09  7:53 ` Ron Rindjunsky
2008-06-09  8:56   ` Johannes Berg
2008-06-09  9:01     ` Luis R. Rodriguez
2008-06-09 10:25       ` Luis R. Rodriguez
2008-06-10 23:57         ` [compat-masters] " Tomas Winkler
2008-06-11  4:32           ` Luis R. Rodriguez
2008-06-11  4:36             ` Luis R. Rodriguez
2008-06-11 11:03               ` Luis R. Rodriguez
2008-06-11 11:55                 ` Tomas Winkler
2008-06-11 12:56                   ` Luis R. Rodriguez
2008-06-11 12:12                 ` Johannes Berg
2008-06-11 12:58                   ` Luis R. Rodriguez
2008-06-11 13:27                     ` Tomas Winkler
2008-06-11 13:46                       ` Luis R. Rodriguez
2008-06-11 14:49                         ` Luis R. Rodriguez
2008-06-11 20:02                           ` Luis R. Rodriguez [this message]
2008-06-11 20:50                       ` Stefanik Gábor
2008-06-11 20:59                         ` Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080611200232.GH17936@ruslug.rutgers.edu \
    --to=mcgrof@gmail.com \
    --cc=compat-masters@lists.madwifi.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=ron.rindjunsky@intel.com \
    --cc=tim.gardner@canonical.com \
    --cc=tomasw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox