wl1251: reduce eeprom read wait time
[pandora-wifi.git] / scripts / iwl-enable
1 #!/bin/bash
2 #
3 # Copyright 2007        Luis R. Rodriguez <lrodriguez@atheros.com>
4 #
5 # Makes sure either iwlagn (new) or iwl4965 (old)
6 # is enabled to be used. This allows us to choose any driver without 
7 # blacklisting each other.
8
9 . /usr/lib/compat-wireless/modlib.sh
10
11 if [[ $UID -ne 0 ]]; then
12         echo "Run with root privileges"
13         exit
14 fi
15
16 IWL_NEW="iwlagn"
17 IWL_OLD="iwl4965"
18
19 # Appended to module file at the end when we want to ignore one
20 USAGE="Usage: $0 [ $IWL_NEW | $IWL_OLD ]"
21
22 function enable_iwlagn {
23         module_disable $IWL_OLD
24         for i in $IWL_NEW; do
25                 module_enable $i
26         done
27 }
28
29 # Default behavior: disables the old iwl4965 driver and enables iwlagn
30 if [ $# -eq 0 ]; then
31         enable_iwlagn
32         exit
33 elif [ $# -ne 1 ]; then
34         echo "$USAGE"
35         exit
36 fi
37
38 MODULE=$1
39 if [ "$MODULE" == "iwl4965" ]; then
40         module_disable $IWL_NEW
41         module_enable $IWL_OLD
42 elif [ "$MODULE" == "iwlagn" ]; then
43         enable_iwlagn
44 else
45         echo "$USAGE"
46         exit
47 fi