X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=package%2Fmadwifi%2Ffiles%2Flib%2Fwifi%2Fmadwifi.sh;h=07a6cd78bf74b1285d527dd8bb4b90c237fd5559;hp=2635699adb4e7141c20f9f3d7741ab3438218bf5;hb=b13426e21b729e62de0f9c7cd8dd0e0c0bc900d6;hpb=47ecff5cf8e907af397624a3bf09ba2a293053a8 diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh index 2635699adb..07a6cd78bf 100755 --- 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" + 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 @@ -73,7 +74,6 @@ enable_atheros() { config_get channel "$device" channel config_get vifs "$device" vifs - disable_atheros "$device" 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 + sleep 1 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 + 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 @@ -194,6 +205,7 @@ enable_atheros() { 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 @@ -251,24 +263,16 @@ detect_atheros() { 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 - option hidden 0 -# option txpower 15 -# option bgscan enable option encryption none - EOF done }