2024-09-09 08:52:07 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Copyright 2007 Luis R. Rodriguez <lrodriguez@atheros.com>
|
|
|
|
#
|
|
|
|
# Makes sure either iwlagn (new) or iwl4965 (old)
|
|
|
|
# is enabled 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
|
|
|
|
|
|
|
|
IWL_NEW="iwlagn"
|
|
|
|
IWL_OLD="iwl4965"
|
|
|
|
|
|
|
|
# Appended to module file at the end when we want to ignore one
|
2024-09-09 08:57:42 +00:00
|
|
|
USAGE="Usage: $0 [ $IWL_NEW | $IWL_OLD ]"
|
2024-09-09 08:52:07 +00:00
|
|
|
|
|
|
|
function enable_iwlagn {
|
|
|
|
module_disable $IWL_OLD
|
|
|
|
for i in $IWL_NEW; do
|
|
|
|
module_enable $i
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
# Default behavior: disables the old iwl4965 driver and enables iwlagn
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
enable_iwlagn
|
|
|
|
exit
|
|
|
|
elif [ $# -ne 1 ]; then
|
|
|
|
echo "$USAGE"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
MODULE=$1
|
|
|
|
if [ "$MODULE" == "iwl4965" ]; then
|
|
|
|
module_disable $IWL_NEW
|
|
|
|
module_enable $IWL_OLD
|
|
|
|
elif [ "$MODULE" == "iwlagn" ]; then
|
|
|
|
enable_iwlagn
|
|
|
|
else
|
|
|
|
echo "$USAGE"
|
|
|
|
exit
|
|
|
|
fi
|