From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: Hin-Tak Leung <htl10@users.sourceforge.net>
Cc: "Luis R. Rodriguez" <mcgrof@winlab.rutgers.edu>,
"compat-masters@lists.madwifi.org"
<compat-masters@lists.madwifi.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: a couple of small bugs in compat-wireless
Date: Tue, 11 Nov 2008 15:12:33 -0800 [thread overview]
Message-ID: <20081111231233.GK14202@tesla> (raw)
In-Reply-To: <252423.50522.qm@web23105.mail.ird.yahoo.com>
On Mon, Nov 10, 2008 at 09:28:59PM -0800, Hin-Tak Leung wrote:
> "make unload" doesn't unload iwlagn, and iwlagn keeps mac80211 in the kernel, which results in make unload failing. Needs to include iwlagn
> in the unload list in script/unload.sh. Should be trivial to fix, and
> probably quicker "just do it" then having a patch from me :-).
>
> There is another annoyance - probably not strictly speaking a bug, but nonetheless, for some unexplainable reasons, I expect "make clean" to do the usual thing, and it doesn't - this is probably easy to fix by having an almost empty libertas_tf/Makefile ? (this shows an older compat-wireless , but current compat-wireless also seem to have this problem
> if I remember correctly):
> ---------------
> scripts/Makefile.clean:17: /tmp/compat-wireless-2008-10-23/drivers/net/wireless/libertas_tf/Makefile: No such file or directory
> make[4]: *** No rule to make target `/tmp/compat-wireless-2008-10-23/drivers/net/wireless/libertas_tf/Makefile'. Stop.
> make[3]: *** [/tmp/compat-wireless-2008-10-23/drivers/net/wireless/libertas_tf] Error 2
> make[2]: *** [/tmp/compat-wireless-2008-10-23/drivers/net/wireless] Error 2
> make[1]: *** [_clean_/tmp/compat-wireless-2008-10-23] Error 2
> make[1]: Leaving directory `/usr/src/kernels/2.6.27.5-92.fc10.x86_64'
> make: *** [clean] Error 2
> ---------------
Try this patch, but the issue you see is related to libertas... anyway,
I've added this patch I'll try to see what's wrong with libertas.
Luis
From: Luis R. Rodriguez <lrodriguez@atheros.com>
[PATCH] Add iwl-load, and make sure we disable iwl4965 upon install
We now has two drivers for different kernel releases for
the Intel 4965 device. To account for this we add a script
to allow us to disable and enable one or each other.
By default we disable iwl4965 as we are replacing it with
iwlagn.
If you want to enable iwl4965:
iwl-load iwl4965
If you want to enable iwlagn:
iwl-load iwlagn
By default we'll use iwlagn.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
Makefile | 14 ++++++++++++
scripts/iwl-enable | 47 ++++++++++++++++++++++++++++++++++++++++++
scripts/iwl-load | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 119 insertions(+), 0 deletions(-)
create mode 100755 scripts/iwl-enable
create mode 100755 scripts/iwl-load
diff --git a/Makefile b/Makefile
index c0ccbd5..7383214 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ export KLIB_BUILD ?= $(KLIB)/build
# Sometimes not available in the path
MODPROBE := /sbin/modprobe
MADWIFI=$(shell $(MODPROBE) -l ath_pci)
+OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
ifneq ($(KERNELRELEASE),)
@@ -67,8 +68,10 @@ install: uninstall modules
@# This is to allow switching between drivers without blacklisting
@install scripts/athenable /usr/sbin/
@install scripts/b43enable /usr/sbin/
+ @install scripts/iwl-enable /usr/sbin/
@install scripts/athload /usr/sbin/
@install scripts/b43load /usr/sbin/
+ @install scripts/iwl-load /usr/sbin/
@if [ ! -z $(MADWIFI) ]; then \
echo ;\
echo -n "Note: madwifi detected, we're going to disable it. " ;\
@@ -79,6 +82,15 @@ install: uninstall modules
/usr/sbin/athenable ath5k ;\
fi
@/sbin/depmod -ae
+ @if [ ! -z $(OLD_IWL) ]; then \
+ echo ;\
+ echo -n "Note: iwl4965 detected, we're going to disable it. " ;\
+ echo "If you would like to enable it later you can run:" ;\
+ echo " sudo iwl-load iwl4965" ;\
+ echo ;\
+ echo Running iwl-enable iwlagn...;\
+ /usr/sbin/iwl-enable iwlagn ;\
+ fi
@echo
@echo "Currently detected wireless subsystem modules:"
@echo
@@ -95,6 +107,7 @@ install: uninstall modules
@$(MODPROBE) -l ssb
@$(MODPROBE) -l iwl3945
@$(MODPROBE) -l iwl4965
+ @$(MODPROBE) -l iwlagn
@$(MODPROBE) -l ipw2100
@$(MODPROBE) -l ipw2200
@$(MODPROBE) -l ieee80211
@@ -153,6 +166,7 @@ uninstall:
@$(MODPROBE) -l rc80211_simple
@$(MODPROBE) -l iwl3945
@$(MODPROBE) -l iwl4965
+ @$(MODPROBE) -l iwlagn
@$(MODPROBE) -l ipw2100
@$(MODPROBE) -l ipw2200
@$(MODPROBE) -l ieee80211
diff --git a/scripts/iwl-enable b/scripts/iwl-enable
new file mode 100755
index 0000000..1236deb
--- /dev/null
+++ b/scripts/iwl-enable
@@ -0,0 +1,47 @@
+#!/bin/bash
+#
+# Copyright 2007 Luis R. Rodriguez <lrodriguez@atheros.com>
+#
+# Makes sure either iwlagn (new) or iwl4965 (old)
+# is enabled to be used. This allows us to choose any driver without
+# blacklisting each other.
+
+. /usr/lib/compat-wireless/modlib.sh
+
+if [[ $UID -ne 0 ]]; then
+ echo "Run with root privileges"
+ exit
+fi
+
+IWL_NEW="iwlagn"
+IWL_OLD="iwl4965"
+
+# Appended to module file at the end when we want to ignore one
+USAGE="Usage: $0 [ $IWL | $IWL_OLD ]"
+
+function enable_iwlagn {
+ module_disable $IWL_OLD
+ for i in $IWL_NEW; do
+ module_enable $i
+ done
+}
+
+# Default behavior: disables the old iwl4965 driver and enables iwlagn
+if [ $# -eq 0 ]; then
+ enable_iwlagn
+ exit
+elif [ $# -ne 1 ]; then
+ echo "$USAGE"
+ exit
+fi
+
+MODULE=$1
+if [ "$MODULE" == "iwl4954" ]; then
+ module_disable $IWL_NEW
+ module_enable $IWL_OLD
+elif [ "$MODULE" == "iwlagn" ]; then
+ enable_iwlagn
+else
+ echo "$USAGE"
+ exit
+fi
diff --git a/scripts/iwl-load b/scripts/iwl-load
new file mode 100755
index 0000000..96b6d89
--- /dev/null
+++ b/scripts/iwl-load
@@ -0,0 +1,58 @@
+#!/bin/bash
+# Copyright 2008 Luis R. Rodriguez <lrodriguez@atheros.com>
+#
+# Loads new Intel iwl (iwlagn) or the old ones (iwl4965)
+
+. /usr/lib/compat-wireless/modlib.sh
+
+IWL_OLD="iwl4965"
+IWL_NEW="iwlagn"
+
+if [[ $UID -ne 0 ]]; then
+ echo "Run with root privileges"
+ exit
+fi
+
+
+USAGE="Usage: $0 [ iwlagn | iwl4965 ]"
+
+# Default behavior: unload iwl4965 and load iwlagn
+if [ $# -eq 0 ]; then
+ 1=iwlagn
+elif [ $# -ne 1 ]; then
+ echo "$USAGE"
+ exit
+fi
+
+MODULE=$1
+if [ "$MODULE" == "iwlagn" ]; then
+ grep iwl4965 /proc/modules 2>&1 > /dev/null
+ if [ $? -eq 0 ]; then
+ echo Unloading $i...
+ modprobe -r --ignore-remove iwl4965
+ fi
+ # Enables both b43 and b43legacy
+ iwl-enable iwlagn
+ modprobe iwlagn
+ CHECK=`modprobe -l iwlagn`
+ if [ ! -z $CHECK ]; then
+ echo "iwlagn loaded successfully"
+ fi
+elif [ "$MODULE" == "iwl4965" ]; then
+ CHECK=`modprobe -l iwlagn`
+ if [ ! -z $CHECK ]; then
+ echo "iwlagn currently loaded, going to try to unload the module..."
+ modprobe -r --ignore-remove iwlagn
+ fi
+ iwl-enable iwl4965
+ # iwl4965 may be loaded already lets remove it first
+ modprobe -r --ignore-remov iwl4965 2>&1 > /dev/null
+ modprobe iwl4965
+ CHECK=`modprobe -l iwl4965`
+ if [ ! -z $CHECK ]; then
+ echo "iwl4965 loaded successfully!"
+ fi
+else
+ echo "$USAGE"
+ exit
+fi
--
1.5.6.rc2.15.g457bb.dirty
next prev parent reply other threads:[~2008-11-11 23:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-11 5:28 a couple of small bugs in compat-wireless Hin-Tak Leung
2008-11-11 23:12 ` Luis R. Rodriguez [this message]
2008-11-12 0:54 ` a couple of small bugs in compat-wireless -- libertas Luis R. Rodriguez
2008-11-12 1:02 ` Luis R. Rodriguez
2008-11-12 1:40 ` Hin-Tak Leung
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=20081111231233.GK14202@tesla \
--to=lrodriguez@atheros.com \
--cc=compat-masters@lists.madwifi.org \
--cc=htl10@users.sourceforge.net \
--cc=linux-wireless@vger.kernel.org \
--cc=mcgrof@winlab.rutgers.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.