wl1251: use DRIVER_NAME macro in wl1251_spi_driver
[pandora-wifi.git] / scripts / athenable
1 #!/bin/bash
2 #
3 # Copyright 2007        Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
4 #
5 # Makes sure either ath5k or MadWifi are ready to be used. This allows
6 # us to choose any driver without blacklisting each other.
7
8 . /usr/lib/compat-wireless/modlib.sh
9
10 if [[ $UID -ne 0 ]]; then
11         echo "Run with root privileges"
12         exit
13 fi
14
15 ATH5K="ath5k"
16 ATH9K="ath9k"
17 MADWIFI="ath_pci"
18 # Appended to module file at the end when we want to ignore one
19 IGNORE_SUFFIX=".ignore"
20 USAGE="Usage: $0 [ ath5k | madwifi ]"
21
22 # Default behavior: disables any MadWifi driver present and makes sure
23 # ath5k is enabled
24 if [ $# -eq 0 ]; then
25         module_disable $MADWIFI
26         module_enable $ATH5K
27         module_enable $ATH9K
28         exit
29 elif [ $# -ne 1 ]; then
30         echo "$USAGE"
31         exit
32 fi
33
34 MODULE=$1
35 if [ "$MODULE" == "ath5k" ]; then
36         module_disable $MADWIFI
37         module_enable $ATH5K
38         module_enable $ATH9K
39 elif [ "$MODULE" == "madwifi" ]; then
40         module_disable $ATH5K
41         module_disable $ATH9K
42         module_enable $MADWIFI
43 else
44         echo "$USAGE"
45         exit
46 fi