aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@winlab.rutgers.edu>2008-02-06 14:25:27 -0500
committerLuis R. Rodriguez <mcgrof@winlab.rutgers.edu>2008-02-06 14:25:27 -0500
commit7a8d1fe8dc582ef08a10f78853a0b3addee9fed5 (patch)
treea9f2d9b0f012283cc39961332a0f0d95b71b7d6e
parent5652a3e7718031f835f0e585c8e885d7b20f06c5 (diff)
downloadcompat-wireless-2.6-old-7a8d1fe8dc582ef08a10f78853a0b3addee9fed5.tar.gz
Enable support for 2.6.24, ath5k is fixed now, enable it, and improve compat_autoconf.h intelligence.
Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
-rw-r--r--config.mk4
-rwxr-xr-xscripts/gen-compat-autoconf.sh97
2 files changed, 86 insertions, 15 deletions
diff --git a/config.mk b/config.mk
index 622a0cc..58c3419 100644
--- a/config.mk
+++ b/config.mk
@@ -14,8 +14,8 @@ CONFIG_CFG80211=m
CONFIG_NL80211=y
# Drivers
-# Note: currently broken, needs updating after new mode changes
-CONFIG_ATH5K=n
+CONFIG_ATH5K=m
+CONFIG_ATH5K_DEBUG=n
CONFIG_IWL3945=m
CONFIG_IWL4965=m
CONFIG_ZD1211RW=m
diff --git a/scripts/gen-compat-autoconf.sh b/scripts/gen-compat-autoconf.sh
index e362978..2144b82 100755
--- a/scripts/gen-compat-autoconf.sh
+++ b/scripts/gen-compat-autoconf.sh
@@ -9,6 +9,9 @@
# XXX: consider using scripts/kconfig/confdata.c instead.
# On the downside this would require the user to have libc though.
+# This indicates which is the oldest kernel we support
+# Update this if you are adding support for older kernels.
+OLDEST_KERNEL_SUPPORTED="2.6.22"
COMPAT_RELEASE="compat-release"
KERNEL_RELEASE="git-describe"
@@ -33,6 +36,70 @@ CREL=$(cat $COMPAT_RELEASE)
KREL=$(cat $KERNEL_RELEASE)
DATE=$(date)
+# Defines a CONFIG_ option if not defined yet, this helps respect
+# linux/autoconf.h
+function define_config {
+ VAR=$1
+ VALUE=$2
+ echo "#ifndef $VAR"
+ case $VALUE in
+ n) # Do nothing
+ ;;
+ y)
+ echo "#define $VAR 1"
+ ;;
+ m)
+ echo "#define $VAR 1"
+ ;;
+ *) # Assume string
+ # XXX: add better checks to make sure what was on
+ # the right was indeed a string
+ echo "#define $VAR \"$VALUE\""
+ ;;
+ esac
+ echo "#endif /* $VAR */ "
+}
+
+# This deals with core compat-wireless kernel requirements.
+function define_config_req {
+ VAR=$1
+ echo "#ifndef $VAR"
+ echo -n "#error Compat-wireless requirement: $VAR must be enabled "
+ echo "in your kernel"
+ echo "#endif /* $VAR */"
+}
+
+# This handles modules which have dependencies from the kernel
+# which compat-wireless isn't providing yet either because
+# the dependency is not available as kernel module or
+# the module simply isn't provided by compat-wireless.
+function define_config_dep {
+ VAR=$1
+ VALUE=$2
+ DEP=$3
+ WARN_VAR="COMPAT_WARN_$VAR"
+ echo "#ifdef $DEP"
+ define_config $VAR $VALUE
+ echo "#else"
+ # XXX: figure out a way to warn only once
+ # define only once in case user tried to enable config option
+ # twice in config.mk
+ echo "#ifndef $WARN_VAR"
+ # Lets skip these for now.. they might be too annoying
+ #echo "#warning Skipping $VAR as $DEP was needed... "
+ #echo "#warning This just means $VAR won't be built and is not fatal."
+ echo "#define $WARN_VAR"
+ echo "#endif /* $VAR */"
+ echo "#endif /* $WARN_VAR */"
+}
+
+function kernel_version_req {
+ VERSION=$(echo $1 | sed -e 's/\./,/g')
+ echo "#if (LINUX_VERSION_CODE < KERNEL_VERSION($VERSION))"
+ echo "#error Compat-wireless requirement: Linux >= $VERSION"
+ echo "#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION($VERSION) */ "
+}
+
cat <<EOF
#ifndef COMPAT_AUTOCONF_INCLUDED
#define COMPAT_AUTOCONF_INCLUDED
@@ -46,27 +113,31 @@ cat <<EOF
#define COMPAT_KERNEL_RELEASE "$KREL"
EOF
+# Checks user is compiling against a kernel we support
+kernel_version_req $OLDEST_KERNEL_SUPPORTED
+
+# Handle core kernel wireless depenencies here
+define_config_req CONFIG_WIRELESS_EXT
+
# For each CONFIG_FOO=x option
for i in $(grep -v ^# $COMPAT_CONFIG | grep ^CONFIG_); do
# Get the element on the left of the "="
VAR=$(echo $i | cut -d"=" -f 1)
# Get the element on the right of the "="
VALUE=$(echo $i | cut -d"=" -f 2)
- case $VALUE in
- n) # Do nothing
- ;;
- y)
- echo "#define $VAR 1"
- ;;
- m)
- echo "#define $VAR 1"
- ;;
- *) # Assume string
- # XXX: add better checks to make sure what was on
- # the right was indeed a string
- echo "#define $VAR \"$VALUE\""
+
+ # Handle core kernel module depenencies here.
+ case $VAR in
+ CONFIG_USB_NET_RNDIS_WLAN)
+ define_config_dep $VAR $VALUE CONFIG_USB_NET_CDCETHER
+ continue
;;
+ CONFIG_USB_NET_RNDIS_HOST)
+ define_config_dep $VAR $VALUE CONFIG_USB_NET_CDCETHER
+ continue
esac
+ # Any other module which can *definitely* be built as a module goes here
+ define_config $VAR $VALUE
done
echo "#endif /* COMPAT_AUTOCONF_INCLUDED */"