Author: nbd
Date: 2014-12-22 22:46:38 +0100 (Mon, 22 Dec 2014)
New Revision: 43769

Modified:
   trunk/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
Log:
mac80211: fix HT mode selection for ad-hoc

Signed-off-by: Felix Fietkau <[email protected]>

Modified: trunk/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
===================================================================
--- trunk/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh 
2014-12-22 20:47:10 UTC (rev 43768)
+++ trunk/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh 
2014-12-22 21:46:38 UTC (rev 43769)
@@ -88,7 +88,7 @@
 
        [ "$auto_channel" -gt 0 ] && channel=acs_survey
 
-       json_get_vars noscan htmode
+       json_get_vars noscan
        json_get_values ht_capab_list ht_capab
 
        ieee80211n=1
@@ -523,7 +523,36 @@
        mcval=
        [ -n "$mcast_rate" ] && hostapd_add_rate mcval "$mcast_rate"
 
-       iw dev "$ifname" ibss join "$ssid" $freq $htmode fixed-freq $bssid \
+       case "$htmode" in
+               VHT20|HT20) ibss_htmode=HT20;;
+               HT40*|VHT40|VHT80|VHT160)
+                       case "$hwmode" in
+                               a)
+                                       case "$(( ($channel / 4) % 2 ))" in
+                                               1) ibss_htmode="HT40+" ;;
+                                               0) ibss_htmode="HT40-";;
+                                       esac
+                               ;;
+                               *)
+                                       case "$htmode" in
+                                               HT40+) ibss_htmode="HT40+";;
+                                               HT40-) ibss_htmode="HT40-";;
+                                               *)
+                                                       if [ "$channel" -lt 7 
]; then
+                                                               
ibss_htmode="HT40+"
+                                                       else
+                                                               
ibss_htmode="HT40-"
+                                                       fi
+                                               ;;
+                                       esac
+                               ;;
+                       esac
+                       [ "$auto_channel" -gt 0 ] && ibss_htmode="HT40+"
+               ;;
+               *) ibss_htmode="" ;;
+       esac
+
+       iw dev "$ifname" ibss join "$ssid" $freq $ibss_htmode fixed-freq $bssid 
\
                ${beacon_int:+beacon-interval $beacon_int} \
                ${brstr:+basic-rates $brstr} \
                ${mcval:+mcast-rate $mcval} \
@@ -614,7 +643,7 @@
                country chanbw distance \
                txpower antenna_gain \
                rxantenna txantenna \
-               frag rts beacon_int
+               frag rts beacon_int htmode
        json_get_values basic_rate_list basic_rate
        json_select ..
 
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to