[OpenWrt-Devel] [PATCH] mac80211: netifd: Use a mask when using `iw set antenna`

Alexander Couzens lynxis at fe80.eu
Sat Mar 9 10:48:38 EST 2019


The keyword "all" is only supported by `iw set antenna` if
it's used as the only argument.
Convert "all" into a mask before calling `iw set antenna`.

Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 package/kernel/mac80211/Makefile                           | 2 +-
 .../kernel/mac80211/files/lib/netifd/wireless/mac80211.sh  | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index eedd3f9e8955..d68738aca51c 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 PKG_NAME:=mac80211
 
 PKG_VERSION:=4.19.23-1
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.23/
 PKG_HASH:=703e940b542eb56067fcd847a7c69398dcc9829f34472647eea4211cb2ab3b83
 
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index e7d442f8ef1a..e9389e34477b 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -781,11 +781,14 @@ drv_mac80211_setup() {
 		done
 	}
 
-	set_default rxantenna all
-	set_default txantenna all
+	set_default rxantenna 0xffffffff
+	set_default txantenna 0xffffffff
 	set_default distance 0
 	set_default antenna_gain 0
 
+	[ "$txantenna" = "all" ] && txantenna=0xffffffff
+	[ "$rxantenna" = "all" ] && rxantenna=0xffffffff
+
 	iw phy "$phy" set antenna $txantenna $rxantenna >/dev/null 2>&1
 	iw phy "$phy" set antenna_gain $antenna_gain
 	iw phy "$phy" set distance "$distance"
-- 
2.21.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list