projects
/
openwrt
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keep track of the wifi interface state in /var/state/wireless
[openwrt/openwrt.git]
/
package
/
madwifi
/
files
/
lib
/
wifi
/
madwifi.sh
diff --git
a/package/madwifi/files/lib/wifi/madwifi.sh
b/package/madwifi/files/lib/wifi/madwifi.sh
index 2635699adb4e7141c20f9f3d7741ab3438218bf5..07a6cd78bf74b1285d527dd8bb4b90c237fd5559 100755
(executable)
--- a/
package/madwifi/files/lib/wifi/madwifi.sh
+++ b/
package/madwifi/files/lib/wifi/madwifi.sh
@@
-50,6
+50,7
@@
scan_atheros() {
disable_atheros() (
local device="$1"
disable_atheros() (
local device="$1"
+ set_wifi_down "$device"
# kill all running hostapd and wpa_supplicant processes that
# are running on atheros vifs
for pid in `pidof hostapd wpa_supplicant`; do
# kill all running hostapd and wpa_supplicant processes that
# are running on atheros vifs
for pid in `pidof hostapd wpa_supplicant`; do
@@
-73,7
+74,6
@@
enable_atheros() {
config_get channel "$device" channel
config_get vifs "$device" vifs
config_get channel "$device" channel
config_get vifs "$device" vifs
- disable_atheros "$device"
local first=1
for vif in $vifs; do
nosbeacon=
local first=1
for vif in $vifs; do
nosbeacon=
@@
-104,6
+104,7
@@
enable_atheros() {
esac
iwconfig "$ifname" channel 0 >/dev/null 2>/dev/null
ifconfig "$ifname" up
esac
iwconfig "$ifname" channel 0 >/dev/null 2>/dev/null
ifconfig "$ifname" up
+ sleep 1
iwpriv "$ifname" mode "$agmode"
iwpriv "$ifname" pureg "$pureg"
iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null
iwpriv "$ifname" mode "$agmode"
iwpriv "$ifname" pureg "$pureg"
iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null
@@
-183,6
+184,16
@@
enable_atheros() {
iwconfig "$ifname" txpower "${txpwr%%.*}"
fi
iwconfig "$ifname" txpower "${txpwr%%.*}"
fi
+ config_get frag "$vif" frag
+ if [ -n "$frag" ]; then
+ iwconfig "$ifname" frag "${frag%%.*}"
+ fi
+
+ config_get rts "$vif" rts
+ if [ -n "$rts" ]; then
+ iwconfig "$ifname" rts "${rts%%.*}"
+ fi
+
ifconfig "$ifname" up
iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null
ifconfig "$ifname" up
iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null
@@
-194,6
+205,7
@@
enable_atheros() {
start_net "$ifname" "$net_cfg"
}
iwconfig "$ifname" essid "$ssid"
start_net "$ifname" "$net_cfg"
}
iwconfig "$ifname" essid "$ssid"
+ set_wifi_up "$vif" "$ifname"
case "$mode" in
ap)
config_get_bool isolate "$vif" isolate 0
case "$mode" in
ap)
config_get_bool isolate "$vif" isolate 0
@@
-251,24
+263,16
@@
detect_atheros() {
config wifi-device $dev
option type atheros
option channel 5
config wifi-device $dev
option type atheros
option channel 5
-# option diversity 1
-# option txantenna 0
-# option rxantenna 0
-# option distance 2000
-# disable radio to prevent an open ap after reflashing:
- option disabled 1
+ # REMOVE THIS LINE TO ENABLE WIFI:
+ option disabled 1
config wifi-iface
option device $dev
option network lan
option mode ap
option ssid OpenWrt
config wifi-iface
option device $dev
option network lan
option mode ap
option ssid OpenWrt
- option hidden 0
-# option txpower 15
-# option bgscan enable
option encryption none
option encryption none
-
EOF
done
}
EOF
done
}