[OpenWrt-Devel] [PATCH] mac80211.sh: add support of VHT80 for mesh
Chun-Yeow Yeoh
yeohchunyeow at gmail.com
Fri May 6 12:35:17 EDT 2016
Add support of VHT80 setting for mesh interface
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow at gmail.com>
---
.../mac80211/files/lib/netifd/wireless/mac80211.sh | 33 +++++++++++-----------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index 02c195e..d680ac2 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -473,7 +473,7 @@ mac80211_prepare_vif() {
esac
case "$mode" in
- monitor|mesh)
+ monitor)
[ "$auto_channel" -gt 0 ] || iw dev "$ifname" set channel "$channel" $htmode
;;
esac
@@ -495,40 +495,40 @@ mac80211_setup_supplicant() {
wpa_supplicant_run "$ifname" ${hostapd_ctrl:+-H $hostapd_ctrl}
}
-mac80211_setup_adhoc_htmode() {
+mac80211_setup_bss_htmode() {
case "$htmode" in
- VHT20|HT20) ibss_htmode=HT20;;
+ VHT20|HT20) bss_htmode=HT20;;
HT40*|VHT40|VHT160)
case "$hwmode" in
a)
case "$(( ($channel / 4) % 2 ))" in
- 1) ibss_htmode="HT40+" ;;
- 0) ibss_htmode="HT40-";;
+ 1) bss_htmode="HT40+" ;;
+ 0) bss_htmode="HT40-";;
esac
;;
*)
case "$htmode" in
- HT40+) ibss_htmode="HT40+";;
- HT40-) ibss_htmode="HT40-";;
+ HT40+) bss_htmode="HT40+";;
+ HT40-) bss_htmode="HT40-";;
*)
if [ "$channel" -lt 7 ]; then
- ibss_htmode="HT40+"
+ bss_htmode="HT40+"
else
- ibss_htmode="HT40-"
+ bss_htmode="HT40-"
fi
;;
esac
;;
esac
- [ "$auto_channel" -gt 0 ] && ibss_htmode="HT40+"
+ [ "$auto_channel" -gt 0 ] && bss_htmode="HT40+"
;;
VHT80)
- ibss_htmode="80MHZ"
+ bss_htmode="80MHZ"
;;
NONE|NOHT)
- ibss_htmode="NOHT"
+ bss_htmode="NOHT"
;;
- *) ibss_htmode="" ;;
+ *) bss_htmode="" ;;
esac
}
@@ -566,7 +566,7 @@ mac80211_setup_adhoc() {
mcval=
[ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate"
- iw dev "$ifname" ibss join "$ssid" $freq $ibss_htmode fixed-freq $bssid \
+ iw dev "$ifname" ibss join "$ssid" $freq $bss_htmode fixed-freq $bssid \
${beacon_int:+beacon-interval $beacon_int} \
${brstr:+basic-rates $brstr} \
${mcval:+mcast-rate $mcval} \
@@ -612,7 +612,8 @@ mac80211_setup_vif() {
mcval=
[ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate"
- iw dev "$ifname" mesh join "$mesh_id" ${mcval:+mcast-rate $mcval}
+ mac80211_setup_bss_htmode
+ iw dev "$ifname" mesh join "$mesh_id" freq "$freq" "$bss_htmode" ${mcval:+mcast-rate $mcval}
fi
for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do
@@ -622,7 +623,7 @@ mac80211_setup_vif() {
;;
adhoc)
wireless_vif_parse_encryption
- mac80211_setup_adhoc_htmode
+ mac80211_setup_bss_htmode
if [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ]; then
mac80211_setup_supplicant || failed=1
else
--
2.3.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list