2 # Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
4 # Loads new broadcom drivers (b43 and b43legacy) or the old ones (bcm43xx)
6 . /usr/lib/compat-wireless/modlib.sh
8 if [[ $UID -ne 0 ]]; then
9 echo "Run with root privileges"
14 USAGE="Usage: $0 [ b43 | bcm43xx ]"
16 # Default behavior: unload bcm43xx and load b43 and b43legacy
19 elif [ $# -ne 1 ]; then
25 if [ "$MODULE" == "b43" ]; then
26 grep bcm43xx /proc/modules 2>&1 > /dev/null
29 modprobe -r --ignore-remove bcm43xx
31 # Enables both b43 and b43legacy
35 CHECK=`modprobe -l b43`
36 if [ ! -z $CHECK ]; then
37 echo "b43 loaded successfully"
39 CHECK=`modprobe -l b43legacy`
40 if [ ! -z $CHECK ]; then
41 echo "b43legacy loaded successfully"
43 elif [ "$MODULE" == "bcm43xx" ]; then
44 CHECK=`modprobe -l b43`
45 if [ ! -z $CHECK ]; then
46 echo "b43 currently loaded, going to try to unload the module..."
47 modprobe -r --ignore-remove b43
49 CHECK=`modprobe -l b43legacy`
50 if [ ! -z $CHECK ]; then
51 echo "b43legacy currently loaded, going to try to unload the module..."
52 modprobe -r --ignore-remove b43legacy
55 # bcm43xx may be loaded already lets remove them first
56 modprobe -r --ignore-remov bcm43xx 2>&1 > /dev/null
58 CHECK=`modprobe -l bcm43xx`
59 if [ ! -z $CHECK ]; then
60 echo "bcm43xx loaded successfully!"