M7350/external/compat-wireless/scripts/athenable

47 lines
976 B
Plaintext
Raw Normal View History

2024-09-09 08:52:07 +00:00
#!/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.
2024-09-09 08:57:42 +00:00
. /usr/lib/compat-wireless/modlib.sh
2024-09-09 08:52:07 +00:00
if [[ $UID -ne 0 ]]; then
echo "Run with root privileges"
exit
fi
ATH5K="ath5k"
ATH9K="ath9k"
MADWIFI="ath_pci"
# Appended to module file at the end when we want to ignore one
IGNORE_SUFFIX=".ignore"
USAGE="Usage: $0 [ ath5k | madwifi ]"
# Default behavior: disables any MadWifi driver present and makes sure
# ath5k is enabled
if [ $# -eq 0 ]; then
module_disable $MADWIFI
module_enable $ATH5K
module_enable $ATH9K
exit
elif [ $# -ne 1 ]; then
echo "$USAGE"
exit
fi
MODULE=$1
if [ "$MODULE" == "ath5k" ]; then
module_disable $MADWIFI
module_enable $ATH5K
module_enable $ATH9K
elif [ "$MODULE" == "madwifi" ]; then
module_disable $ATH5K
module_disable $ATH9K
module_enable $MADWIFI
else
echo "$USAGE"
exit
fi