2008-11-11 05:29:01

by Hin-Tak Leung

[permalink] [raw]
Subject: a couple of small bugs in compat-wireless

"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
---------------






2008-11-12 01:08:43

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: a couple of small bugs in compat-wireless -- libertas

On Tue, Nov 11, 2008 at 4:54 PM, Luis R. Rodriguez
<[email protected]> wrote:
> On Tue, Nov 11, 2008 at 03:12:33PM -0800, Luis Rodriguez wrote:
>> 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.
>
> OK for your issue you can try this patch.

This patch should actually be useless to you as you probably are just
downloading the tarball.. so just download the latest tarball, I just
regenerated it with the patches applied.

Luis

2008-11-11 23:12:41

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: a couple of small bugs in compat-wireless

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 <[email protected]>
[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 <[email protected]>
---
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 <[email protected]>
+#
+# 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 <[email protected]>
+#
+# 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


2008-11-12 00:54:23

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: a couple of small bugs in compat-wireless -- libertas

On Tue, Nov 11, 2008 at 03:12:33PM -0800, Luis Rodriguez wrote:
> 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.

OK for your issue you can try this patch. Essentially it adds
libertas_tf to compat-wireless but it will only compile if you
had it enabled in your kernel (which hopefully means you didn't
enable the old driver (CONFIG_LIBERTAS_USB).

Right now I don't see libertas_tf_usb driver being shipped or enabled
on FC10 or Ubuntu 8.10 so this follows the assumption that they did
the right thing, which I think they did as the thin firmware driver
is rather new.

diff --git a/Makefile b/Makefile
index 7383214..9cef559 100644
--- a/Makefile
+++ b/Makefile
@@ -113,6 +113,7 @@ install: uninstall modules
@$(MODPROBE) -l ieee80211
@$(MODPROBE) -l ieee80211_crypt
@$(MODPROBE) -l libertas_cs
+ @$(MODPROBE) -l libertas_tf
@$(MODPROBE) -l ub8xxx
@$(MODPROBE) -l p54_pci
@$(MODPROBE) -l p54_usb
@@ -172,6 +173,7 @@ uninstall:
@$(MODPROBE) -l ieee80211
@$(MODPROBE) -l ieee80211_crypt
@$(MODPROBE) -l libertas_cs
+ @$(MODPROBE) -l libertas_tf
@$(MODPROBE) -l mac80211
@$(MODPROBE) -l ub8xxx
@$(MODPROBE) -l p54pci
diff --git a/config.mk b/config.mk
index f2be511..68e8eec 100644
--- a/config.mk
+++ b/config.mk
@@ -230,9 +230,11 @@ CONFIG_SSB_PCICORE_HOSTMODE=n
# CONFIG_SSB_DRIVER_EXTIF=y

ifneq ($(CONFIG_USB),)
+ifneq ($(LIBERTAS_THINFIRM_USB),m)
CONFIG_LIBERTAS_USB=m
NEED_LIBERTAS=y
endif
+endif
ifneq ($(CONFIG_PCMCIA),)
CONFIG_LIBERTAS_CS=m
NEED_LIBERTAS=y
diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 6a66fbf..dc0a6e2 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -58,6 +58,7 @@ DRIVERS="$DRIVERS drivers/net/wireless/zd1211rw"
DRIVERS="$DRIVERS drivers/net/wireless/libertas"
DRIVERS="$DRIVERS drivers/net/wireless/p54"
DRIVERS="$DRIVERS drivers/net/wireless/rtl818x"
+DRIVERS="$DRIVERS drivers/net/wireless/libertas_tf"

# Drivers that belong the the wireless directory
DRIVER_FILES="adm8211.c adm8211.h"

2008-11-12 01:40:25

by Hin-Tak Leung

[permalink] [raw]
Subject: Re: a couple of small bugs in compat-wireless -- libertas

--- On Wed, 12/11/08, Luis R. Rodriguez <[email protected]> wrote:

> From: Luis R. Rodriguez <[email protected]>
<snipped>
> > OK for your issue you can try this patch.
>
> This patch should actually be useless to you as you
> probably are just
> downloading the tarball.. so just download the latest
> tarball, I just
> regenerated it with the patches applied.

Thanks for doing this - I actually do both: I have local git-clones of compat-wireless and and wireless-testing, which I use for checking out the "latest and greatest". However, to hunt down a regression which turned out to happen about 20 days ago, I had to roll back both of them and it was getting a bit painful to roll them back in sync, so I downloaded two whole months' worth of daily tarballs and bisected the "old fashion way" until I got within a day, then I read the tags off two daily snapshots and use the git-clone to spit out the 48 commits within that day. Some of the 48 are obviously irrelevant so it narrows it down to under 20 probables, and just a few obvious candidates. Then back to one of the snapshots and try out the obvious candidates; found the commit which breaks and verify that it breaks git-clone HEAD, etc. So it was going back and forth between the daily tarballs and the git-clones.

Thanks for compat-wireless - it takes about 1/2 hour to build a snapshot (I just worked out how to edit the Makefile to skip some bits I
don't need, so it has gone quicker), but it is better than building a whole new kernel... and the best thing about it is that I don't have to reboot, just losing connectivity briefly (hopefully) to swap and try new snapshots.

Hin-Tak