Linux-Wireless Archive mirror
 help / color / mirror / Atom feed
* [PATCH] compat-wireless: Handle name change from iwlagn to iwlwifi in 3.2
@ 2012-01-06 16:18 Don Fry
  2012-03-04  8:12 ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Don Fry @ 2012-01-06 16:18 UTC (permalink / raw
  To: mcgrof, linux-wireless

From: Don Fry <donald.h.fry@intel.com>

With linux-3.2 the iwlagn driver is renamed iwlwifi.  For some kernels
(like 3.1.5) this causes the non-compat iwlagn.ko to try and run against
the compat mac80211 resulting in a kernel oops.  This change prevents the
non-compat iwlagn.ko from being loaded.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
---
 Makefile            |   17 +++++++++++++++--
 scripts/iwl-enable  |   11 ++++++++++-
 scripts/unload.sh   |    2 +-
 scripts/wlunload.sh |    2 +-
 4 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index d3a9d93..d66ebe4 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,9 @@ 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)
+NEW_IWL=$(shell $(MODPROBE) -l iwlwifi)
+OLD_IWL=$(shell $(MODPROBE) -l iwlagn)
+ANCIENT_IWL=$(shell $(MODPROBE) -l iwl4965)
 
 DESTDIR?=
 
@@ -187,7 +189,7 @@ install-scripts:
 		echo Running athenable ath5k...;\
 		/usr/sbin/athenable ath5k ;\
 	fi
-	@if [ ! -z "$(OLD_IWL)" ] && [ -z "$(DESTDIR)" ]; then \
+	@if [ ! -z "$(ANCIENT_IWL)" ] && [ ! -z "$(OLD_IWL)" ] && [ -z "$(DESTDIR)" ]; 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:"  ;\
@@ -196,6 +198,15 @@ install-scripts:
 		echo Running iwl-enable iwlagn...;\
 		/usr/sbin/iwl-enable iwlagn ;\
 	fi
+	@if [ ! -z "$(NEW_IWL)" ] && [ ! -z "$(OLD_IWL)" ] && [ -z "$(DESTDIR)" ]; then \
+		echo ;\
+		echo -n "Note: iwlagn detected, we're going to disable it. "  ;\
+		echo "If you would like to enable it later you can run:"  ;\
+		echo "    sudo iwl-load iwlagn"  ;\
+		echo ;\
+		echo Running iwl-enable iwlwifi...;\
+		/usr/sbin/iwl-enable iwlwifi ;\
+	fi
 	@# If on distributions like Mandriva which like to
 	@# compress their modules this will find out and do
 	@# it for you. Reason is some old version of modutils
@@ -234,6 +245,7 @@ install-scripts:
 	@$(MODPROBE) -l ipw2200
 	@$(MODPROBE) -l iwl3945
 	@$(MODPROBE) -l iwlagn
+	@$(MODPROBE) -l iwlwifi
 	@$(MODPROBE) -l iwlcore
 	@$(MODPROBE) -l iwmc3200wifi
 	@$(MODPROBE) -l lib80211_crypt_ccmp
@@ -364,6 +376,7 @@ uninstall:
 	@$(MODPROBE) -l ipw2100
 	@$(MODPROBE) -l ipw2200
 	@$(MODPROBE) -l iwl3945
+	@$(MODPROBE) -l iwlwifi
 	@$(MODPROBE) -l iwlagn
 	@$(MODPROBE) -l iwlcore
 	@$(MODPROBE) -l iwmc3200wifi
diff --git a/scripts/iwl-enable b/scripts/iwl-enable
index 765195b..0737024 100755
--- a/scripts/iwl-enable
+++ b/scripts/iwl-enable
@@ -17,7 +17,14 @@ IWL_NEW="iwlagn"
 IWL_OLD="iwl4965"
 
 # Appended to module file at the end when we want to ignore one
-USAGE="Usage: $0 [ $IWL_NEW | $IWL_OLD ]"
+USAGE="Usage: $0 [ $IWL_NEW | $IWL_OLD | iwlwifi]"
+
+function enable_iwlwifi {
+	for i in $IWL_OLD $IWL_NEW; do
+		module_disable $i
+	done
+	module_enable iwlwifi
+}
 
 function enable_iwlagn {
 	module_disable $IWL_OLD
@@ -41,6 +48,8 @@ if [ "$MODULE" == "iwl4965" ]; then
 	module_enable $IWL_OLD
 elif [ "$MODULE" == "iwlagn" ]; then
 	enable_iwlagn
+elif [ "$MODULE" == "iwlwifi" ]; then
+	enable_iwlwifi
 else
 	echo "$USAGE"
 	exit
diff --git a/scripts/unload.sh b/scripts/unload.sh
index abc5e72..b791b6e 100755
--- a/scripts/unload.sh
+++ b/scripts/unload.sh
@@ -15,7 +15,7 @@ MODULES="$MODULES adm8211 zd1211rw"
 MODULES="$MODULES orinoco_cs orinoco_nortel orinoco_pci orinoco_plx"
 MODULES="$MODULES orinoco_tld orinoco_usb spectrum_cs orinoco"
 MODULES="$MODULES b43 b44 b43legacy brcm80211 ssb"
-MODULES="$MODULES iwl3945 iwlagn iwlcore"
+MODULES="$MODULES iwl3945 iwlwifi iwlagn iwlcore"
 MODULES="$MODULES ath9k ath9k_htc ath9k_common ath9k_hw "
 MODULES="$MODULES ath5k ath ath6kl ar9170usb carl9170"
 MODULES="$MODULES p54pci p54usb p54spi p54common"
diff --git a/scripts/wlunload.sh b/scripts/wlunload.sh
index cd6298d..c6c6af9 100755
--- a/scripts/wlunload.sh
+++ b/scripts/wlunload.sh
@@ -15,7 +15,7 @@ MODULES="$MODULES adm8211 zd1211rw"
 MODULES="$MODULES orinoco_cs orinoco_nortel orinoco_pci orinoco_plx"
 MODULES="$MODULES orinoco_tld orinoco_usb spectrum_cs orinoco"
 MODULES="$MODULES b43 b44 b43legacy brcm80211 ssb"
-MODULES="$MODULES iwl3945 iwlagn iwlcore"
+MODULES="$MODULES iwl3945 iwlwifi iwlagn iwlcore"
 MODULES="$MODULES ath9k ath9k_htc ath9k_common ath9k_hw "
 MODULES="$MODULES ath5k ath ath6kl ar9170usb carl9170"
 MODULES="$MODULES p54pci p54usb p54spi p54common"
-- 
1.7.4.4




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] compat-wireless: Handle name change from iwlagn to iwlwifi in 3.2
  2012-01-06 16:18 Don Fry
@ 2012-03-04  8:12 ` Johannes Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2012-03-04  8:12 UTC (permalink / raw
  To: Don Fry; +Cc: mcgrof, linux-wireless

On Fri, 2012-01-06 at 08:18 -0800, Don Fry wrote:
> From: Don Fry <donald.h.fry@intel.com>
> 
> With linux-3.2 the iwlagn driver is renamed iwlwifi.  For some kernels
> (like 3.1.5) this causes the non-compat iwlagn.ko to try and run against
> the compat mac80211 resulting in a kernel oops.  This change prevents the
> non-compat iwlagn.ko from being loaded.

Hey Luis, I don't see this in your tree, did you just miss it?

johannes


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] compat-wireless: Handle name change from iwlagn to iwlwifi in 3.2
@ 2012-03-06 23:23 Don Fry
  2012-03-06 23:47 ` Luis R. Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Don Fry @ 2012-03-06 23:23 UTC (permalink / raw
  To: mcgrof; +Cc: linux-wireless

From: Don Fry <donald.h.fry@intel.com>

With linux-3.2 the iwlagn driver is renamed iwlwifi.  For some kernels
(like 3.1.5) this causes the non-compat iwlagn.ko to try and run against
the compat mac80211 resulting in an oops.  This change prevents the
non-compat iwlagn.ko from being loaded.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
---
v2 based on today's compat-wireless
---
 Makefile            |   10 ++++++++++
 scripts/iwl-enable  |   11 ++++++++++-
 scripts/unload.sh   |    2 +-
 scripts/wlunload.sh |    2 +-
 4 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 6b6f097..204c63d 100644
--- a/Makefile
+++ b/Makefile
@@ -163,6 +163,16 @@ install-scripts:
 		echo Running iwl-enable iwlagn...;\
 		$(DESTDIR)/usr/sbin/iwl-enable iwlagn ;\
 	fi
+	@if [ $(shell modinfo iwlagn > /dev/null 2>&1 && echo 1) ] \
+	 && [ $(shell modinfo iwlwifi > /dev/null 2>&1 && echo 1) ]; then \
+		echo ;\
+		echo -n "Note: iwlagn detected, we're going to disable it. " ;\
+		echo "If you would like to enable it later you can run:"  ;\
+		echo "    sudo iwl-load iwlagn"  ;\
+		echo ;\
+		echo Running iwl-enable iwlwifi...;\
+		$(DESTDIR)/usr/sbin/iwl-enable iwlwifi ;\
+	fi
 	@if [ $(shell modinfo atl1c > /dev/null 2>&1 && echo 1) ]; then \
 		echo ;\
 		echo -n "Note: atl1c detected, we're going to disable it. "  ;\
diff --git a/scripts/iwl-enable b/scripts/iwl-enable
index 765195b..b18fdc2 100755
--- a/scripts/iwl-enable
+++ b/scripts/iwl-enable
@@ -17,7 +17,14 @@ IWL_NEW="iwlagn"
 IWL_OLD="iwl4965"
 
 # Appended to module file at the end when we want to ignore one
-USAGE="Usage: $0 [ $IWL_NEW | $IWL_OLD ]"
+USAGE="Usage: $0 [ $IWL_NEW | $IWL_OLD | iwlwifi ]"
+
+function enable_iwlwifi {
+	for i in $IWL_OLD $IWL_NEW; do
+		module_disable $i
+	done
+	module_enable iwlwifi
+}
 
 function enable_iwlagn {
 	module_disable $IWL_OLD
@@ -41,6 +48,8 @@ if [ "$MODULE" == "iwl4965" ]; then
 	module_enable $IWL_OLD
 elif [ "$MODULE" == "iwlagn" ]; then
 	enable_iwlagn
+elif [ "$MODULE" == "iwlwifi" ]; then
+	enable_iwlwifi
 else
 	echo "$USAGE"
 	exit
diff --git a/scripts/unload.sh b/scripts/unload.sh
index c659a70..fc7261d 100755
--- a/scripts/unload.sh
+++ b/scripts/unload.sh
@@ -15,7 +15,7 @@ MODULES="$MODULES adm8211 zd1211rw"
 MODULES="$MODULES orinoco_cs orinoco_nortel orinoco_pci orinoco_plx"
 MODULES="$MODULES orinoco_tld orinoco_usb spectrum_cs orinoco"
 MODULES="$MODULES b43 b44 b43legacy brcm80211 ssb"
-MODULES="$MODULES iwl3945 iwlagn iwlcore"
+MODULES="$MODULES iwl3945 iwlwifi iwlagn iwlcore"
 MODULES="$MODULES ath9k ath9k_htc ath9k_common ath9k_hw "
 MODULES="$MODULES ath5k ath ath6kl ar9170usb carl9170"
 MODULES="$MODULES p54pci p54usb p54spi p54common"
diff --git a/scripts/wlunload.sh b/scripts/wlunload.sh
index cd6298d..c6c6af9 100755
--- a/scripts/wlunload.sh
+++ b/scripts/wlunload.sh
@@ -15,7 +15,7 @@ MODULES="$MODULES adm8211 zd1211rw"
 MODULES="$MODULES orinoco_cs orinoco_nortel orinoco_pci orinoco_plx"
 MODULES="$MODULES orinoco_tld orinoco_usb spectrum_cs orinoco"
 MODULES="$MODULES b43 b44 b43legacy brcm80211 ssb"
-MODULES="$MODULES iwl3945 iwlagn iwlcore"
+MODULES="$MODULES iwl3945 iwlwifi iwlagn iwlcore"
 MODULES="$MODULES ath9k ath9k_htc ath9k_common ath9k_hw "
 MODULES="$MODULES ath5k ath ath6kl ar9170usb carl9170"
 MODULES="$MODULES p54pci p54usb p54spi p54common"
-- 
1.7.4.4




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] compat-wireless: Handle name change from iwlagn to iwlwifi in 3.2
  2012-03-06 23:23 [PATCH] compat-wireless: Handle name change from iwlagn to iwlwifi in 3.2 Don Fry
@ 2012-03-06 23:47 ` Luis R. Rodriguez
  0 siblings, 0 replies; 4+ messages in thread
From: Luis R. Rodriguez @ 2012-03-06 23:47 UTC (permalink / raw
  To: Don Fry; +Cc: linux-wireless

On Tue, Mar 6, 2012 at 3:23 PM, Don Fry <donald.h.fry@intel.com> wrote:
> From: Don Fry <donald.h.fry@intel.com>
>
> With linux-3.2 the iwlagn driver is renamed iwlwifi.  For some kernels
> (like 3.1.5) this causes the non-compat iwlagn.ko to try and run against
> the compat mac80211 resulting in an oops.  This change prevents the
> non-compat iwlagn.ko from being loaded.
>
> Signed-off-by: Don Fry <donald.h.fry@intel.com>

Applied and pushed, thanks!

  Luis

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-06 23:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-06 23:23 [PATCH] compat-wireless: Handle name change from iwlagn to iwlwifi in 3.2 Don Fry
2012-03-06 23:47 ` Luis R. Rodriguez
  -- strict thread matches above, loose matches on Subject: below --
2012-01-06 16:18 Don Fry
2012-03-04  8:12 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).