diff options
author | Luis R. Rodriguez <mcgrof@winlab.rutgers.edu> | 2007-11-13 20:03:59 -0500 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@winlab.rutgers.edu> | 2007-11-13 20:03:59 -0500 |
commit | d435321e4b07f935ac79809e8b2612f9f7f9d7ba (patch) | |
tree | 472418e6c8f3fe97ddf28718876e8791292074b1 | |
parent | 11628fff3f75e4b9c7d9de11eea9b046907b3551 (diff) | |
download | compat-wireless-2.6-old-d435321e4b07f935ac79809e8b2612f9f7f9d7ba.tar.gz |
Add athload. This lets users pick and choose quickly which driver they want loaded,
either MadWifi or ath5k.
Usage:
athload ath5k
athload madwifi
Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | README | 4 | ||||
-rwxr-xr-x | scripts/admin-update.sh | 2 | ||||
-rwxr-xr-x | scripts/athenable | 3 | ||||
-rwxr-xr-x | scripts/athload | 50 | ||||
-rwxr-xr-x | scripts/load.sh | 5 | ||||
-rwxr-xr-x | scripts/madwifi-unload | 3 |
7 files changed, 67 insertions, 4 deletions
@@ -68,6 +68,10 @@ install: @# This needs testing before we add it @#modprobe -l iwl4965 @modprobe -l zd1211rw-mac80211 + @install scripts/madwifi-unload /usr/sbin/ + @# This is to allow switching between drivers without blacklisting + @install scripts/athenable /usr/sbin/ + @install scripts/athload /usr/sbin/ @echo uninstall: @@ -96,11 +96,11 @@ disable the MadWifi driver without blacklisting it which could cause issues with users later. If you would like to enable MadWifi at a later time and disable ath5k you can run: - sudo ./scripts/athenable madwifi + sudo athload madwifi To revert back to ath5k you can run: - sudo ./scripts/athenable ath5k + sudo athload ath5k Why? ---- diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh index 6c9d4d9..6beca23 100755 --- a/scripts/admin-update.sh +++ b/scripts/admin-update.sh @@ -1,4 +1,6 @@ #!/bin/bash +# +# Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu> # # Use this to update compat-wireless-2.6 to the lates wireless-2.6.git tree you have. # diff --git a/scripts/athenable b/scripts/athenable index 684d451..8d033b2 100755 --- a/scripts/athenable +++ b/scripts/athenable @@ -1,4 +1,7 @@ #!/bin/bash +# +# Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu> +# # Makes sure either ath5k or MadWifi are ready to be used. This allows # us to choose any driver without blacklisting each other. diff --git a/scripts/athload b/scripts/athload new file mode 100755 index 0000000..4713dea --- /dev/null +++ b/scripts/athload @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu> +# +# Loads ath5k or madwifi + +if [[ $UID -ne 0 ]]; then + echo "Run with root privileges" + exit +fi + + +USAGE="Usage: $0 [ ath5k | madwifi ]" + +# Default behavior: unload MadWifi and load ath5k +if [ $# -eq 0 ]; then + ./scripts/athenable ath5k + exit +elif [ $# -ne 1 ]; then + echo "$USAGE" + exit +fi + +MODULE=$1 +if [ "$MODULE" == "ath5k" ]; then + ./scripts/madwifi-unload + ./scripts/athenable ath5k + modprobe ath5k + CHECK=`modprobe -l ath5k` + if [ ! -z $CHECK ]; then + echo "ath5k loaded successfully" + fi +elif [ "$MODULE" == "madwifi" ]; then + CHECK=`modprobe -l ath5k` + if [ ! -z $CHECK ]; then + echo "ath5k currently loaded, going to try to unload the module..." + modprobe -r --ignore-remove ath5k + fi + ./scripts/athenable madwifi + # MadWifi may be loaded, but it doesn't mean devices + # currently available were picked up + ./scripts/madwifi-unload 2>&1 > /dev/null + modprobe ath_pci + CHECK=`modprobe -l ath_pci` + if [ ! -z $CHECK ]; then + echo "MadWifi loaded successfully!" + fi +else + echo "$USAGE" + exit +fi diff --git a/scripts/load.sh b/scripts/load.sh index 3b19a17..8e2c5dd 100755 --- a/scripts/load.sh +++ b/scripts/load.sh @@ -1,7 +1,8 @@ #!/bin/bash -MODULES="ath5k iwl3945 zd1211rw-mac80211" +MODULES="iwl3945 zd1211rw-mac80211" for i in $MODULES; do echo Loading $i... modprobe $i done - +# For ath5k we must be sure to unload MadWifi first +athload ath5k diff --git a/scripts/madwifi-unload b/scripts/madwifi-unload index 5f033bf..0cde286 100755 --- a/scripts/madwifi-unload +++ b/scripts/madwifi-unload @@ -1,4 +1,7 @@ #!/bin/sh +# Copyright 2006 Kel Modderman <kelrin@tpg.com.au> +# +# Taken from madwifi scripts. This unloads madwifi : ${PATTERN='\(ath_.*\|wlan_.*\|wlan\)$'} : ${MAX_TRIES=10} |