mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-05 04:25:05 +02:00
Allow changing country code for madwifi driver. Thanks alisonken1
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14148 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
c5d9fc516f
commit
6d7fed1607
@ -67,6 +67,15 @@ disable_atheros() (
|
|||||||
|
|
||||||
enable_atheros() {
|
enable_atheros() {
|
||||||
local device="$1"
|
local device="$1"
|
||||||
|
# Can only set the country code to one setting for the entire system. The last country code is the one that will be applied.
|
||||||
|
config_get country "$device" country
|
||||||
|
[ -z "$country" ] && country="0"
|
||||||
|
local cc="0"
|
||||||
|
[ -e /proc/sys/dev/$device/countrycode ] && cc="$(cat /proc/sys/dev/$device/countrycode)"
|
||||||
|
if [ ! "$cc" = "$country" ] ; then
|
||||||
|
rmmod ath_pci
|
||||||
|
insmod ath_pci countrycode=$country
|
||||||
|
fi
|
||||||
config_get channel "$device" channel
|
config_get channel "$device" channel
|
||||||
config_get vifs "$device" vifs
|
config_get vifs "$device" vifs
|
||||||
|
|
||||||
@ -278,10 +287,6 @@ enable_atheros() {
|
|||||||
|
|
||||||
ifconfig "$ifname" up
|
ifconfig "$ifname" up
|
||||||
|
|
||||||
# TXPower settings only work if device is up already
|
|
||||||
config_get txpwr "$vif" txpower
|
|
||||||
[ -n "$txpwr" ] && iwconfig "$ifname" txpower "${txpwr%%.*}"
|
|
||||||
|
|
||||||
local net_cfg bridge
|
local net_cfg bridge
|
||||||
net_cfg="$(find_net_config "$vif")"
|
net_cfg="$(find_net_config "$vif")"
|
||||||
[ -z "$net_cfg" ] || {
|
[ -z "$net_cfg" ] || {
|
||||||
@ -292,6 +297,11 @@ enable_atheros() {
|
|||||||
[ -n "$ssid" ] && iwconfig "$ifname" essid on
|
[ -n "$ssid" ] && iwconfig "$ifname" essid on
|
||||||
iwconfig "$ifname" essid "$ssid"
|
iwconfig "$ifname" essid "$ssid"
|
||||||
set_wifi_up "$vif" "$ifname"
|
set_wifi_up "$vif" "$ifname"
|
||||||
|
|
||||||
|
# TXPower settings only work if device is up already
|
||||||
|
config_get txpwr "$vif" txpower
|
||||||
|
[ -n "$txpwr" ] && iwconfig "$ifname" txpower "${txpwr%%.*}"
|
||||||
|
|
||||||
case "$mode" in
|
case "$mode" in
|
||||||
ap)
|
ap)
|
||||||
config_get_bool isolate "$vif" isolate 0
|
config_get_bool isolate "$vif" isolate 0
|
||||||
|
Loading…
Reference in New Issue
Block a user