diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-12-22 21:46:38 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-12-22 21:46:38 +0000 |
commit | 24ef2877d52689e9e875f1d812e7cb22e0a99fe9 (patch) | |
tree | c48439191906acb51113b71b448393a601c6b3cb /package/kernel | |
parent | d1f285d96c5c05be58bdaec1ae6d19548f7453ba (diff) | |
download | master-187ad058-24ef2877d52689e9e875f1d812e7cb22e0a99fe9.tar.gz master-187ad058-24ef2877d52689e9e875f1d812e7cb22e0a99fe9.tar.bz2 master-187ad058-24ef2877d52689e9e875f1d812e7cb22e0a99fe9.zip |
mac80211: fix HT mode selection for ad-hoc
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43769 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel')
-rw-r--r-- | package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index d8fa07e225..3a7ad3b142 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -88,7 +88,7 @@ mac80211_hostapd_setup_base() { [ "$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 @@ mac80211_setup_adhoc() { 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 @@ drv_mac80211_setup() { 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 .. |