wl1251: reduce eeprom read wait time
[pandora-wifi.git] / scripts / b43enable
1 #!/bin/bash
2 #
3 # Copyright 2007        Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
4 #
5 # Makes sure either b43, b43legacy (new mac80211 drivers) or bcm43xx 
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 B43S="b43 b43legacy"
17 B43_OLD="bcm43xx"
18 B43_PROP="wl"
19
20 # Appended to module file at the end when we want to ignore one
21 USAGE="Usage: $0 [ b43 | bcm43xx | wl ]"
22
23 function enable_b43 {
24         module_disable $B43_OLD
25         module_disable $B43_PROP
26         for i in $B43S; do
27                 module_enable $i
28         done
29 }
30
31 # Default behavior: disables the old bcm43xx driver and enables b43
32 # and b43legacy
33 if [ $# -eq 0 ]; then
34         enable_b43
35         exit
36 elif [ $# -ne 1 ]; then
37         echo "$USAGE"
38         exit
39 fi
40
41 MODULE=$1
42 if [ "$MODULE" == "bcm43xx" ]; then
43         for i in $B43S; do
44                 module_disable $i
45         done
46         module_disable $B43_PROP
47         module_enable $B43_OLD
48 elif [ "$MODULE" == "wl" ]; then
49         for i in $B43S; do
50                 module_disable $i
51         done
52         module_disable $B43_OLD
53         module_enable $B43_PROP
54 elif [ "$MODULE" == "b43" ]; then
55         enable_b43
56 else
57         echo "$USAGE"
58         exit
59 fi