[OpenWrt-Devel,3/5] mac80211: add 802.11ad support
diff mbox series

Message ID 20191108181408.18272-4-freifunk@adrianschmutzler.de
State Under Review
Delegated to: Adrian Schmutzler
Headers show
Series
  • Add 802.11ad support
Related show

Commit Message

Adrian Schmutzler Nov. 8, 2019, 6:14 p.m. UTC
From: Robert Marko <robimarko@gmail.com>

This patch adds support for 802.11ad to mac80211.sh script.
It checks whether device supports 802.11ad Channel 1 and if so
configures it to channel 1 and ad hwmode.
htmode is not needed for 802.11ad.

Signed-off-by: Robert Marko <robimarko@gmail.com>
[rewrite if/else logic in mac80211.sh]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
---
 .../kernel/mac80211/files/lib/wifi/mac80211.sh | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

Patch
diff mbox series

diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
index be9c537926..c7aae31d35 100644
--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
@@ -75,18 +75,22 @@  detect_mac80211() {
 		config_foreach check_mac80211_device wifi-device
 		[ "$found" -gt 0 ] && continue
 
-		mode_band="g"
-		channel="11"
 		htmode=""
 		ht_capab=""
 
-		iw phy "$dev" info | grep -q 'Capabilities:' && htmode=HT20
-
-		iw phy "$dev" info | grep -q '5180 MHz' && {
+		if iw phy "$dev" info | grep -q '58320 MHz'; then
+			mode_band="ad"
+			channel="1"
+		elif iw phy "$dev" info | grep -q '5180 MHz'; then
 			mode_band="a"
 			channel="36"
-			iw phy "$dev" info | grep -q 'VHT Capabilities' && htmode="VHT80"
-		}
+			iw phy "$dev" info | grep -q 'Capabilities:' && htmode=HT20
+			iw phy "$dev" info | grep -q 'VHT Capabilities' && htmode=VHT80
+		else
+			mode_band="g"
+			channel="11"
+			iw phy "$dev" info | grep -q 'Capabilities:' && htmode=HT20
+		fi
 
 		[ -n "$htmode" ] && ht_capab="set wireless.radio${devidx}.htmode=$htmode"