blob: 17fab3bd33fe142fdcbea0096cadecd7a9a541d5 [file] [log] [blame]
From ed69c1fdd2d70538644460e299d5772a5528f3d9 Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Mon, 14 Nov 2022 14:44:47 +0800
Subject: [PATCH] master mac80211 generate hostapd setting from ap cap
Change-Id: I22cef6b7e1a99b1d589270c136a2e74e7a385e79
---
package/kernel/mac80211/Makefile | 3 +++
.../files/lib/netifd/wireless/mac80211.sh | 3 ---
.../kernel/mac80211/files/lib/wifi/mac80211.sh | 15 ++++++++++++++-
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index ec35bf67..ea7bf6e9 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -19,6 +19,7 @@ PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
+SOURCE_PATH:=./src
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_DRIVERS = \
@@ -296,6 +297,8 @@ define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(PKG_UNPACK)
$(Build/Patch)
+ $(CP) $(SOURCE_PATH)/net $(PKG_BUILD_DIR) 2>/dev/null || :
+ $(CP) $(SOURCE_PATH)/include $(PKG_BUILD_DIR) 2>/dev/null || :
rm -rf \
$(PKG_BUILD_DIR)/include/linux/ssb \
$(PKG_BUILD_DIR)/include/linux/bcma \
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index ed280521..a0550057 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -144,9 +144,6 @@ mac80211_hostapd_setup_base() {
json_get_values ht_capab_list ht_capab
json_get_values channel_list channels
- [ "$auto_channel" = 0 ] && [ -z "$channel_list" ] && \
- channel_list="$channel"
-
[ "$min_tx_power" -gt 0 ] && append base_cfg "min_tx_power=$min_tx_power"
set_default noscan 0
diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
index 3ecd9322..438bf929 100644
--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
@@ -120,6 +120,13 @@ get_band_defaults() {
mode_band="$band"
channel="$chan"
htmode="$mode"
+ if [ "$band" = "6g" ]
+ then
+ encryption=sae
+ key=12345678
+ else
+ encryption=none
+ fi
done
}
@@ -162,6 +169,8 @@ detect_mac80211() {
channel=""
htmode=""
ht_capab=""
+ encryption=""
+ key=""
get_band_defaults "$dev"
@@ -206,8 +215,12 @@ detect_mac80211() {
set wireless.default_${name}.network=lan
set wireless.default_${name}.mode=ap
set wireless.default_${name}.ssid=OpenWrt
- set wireless.default_${name}.encryption=none
+ set wireless.default_${name}.encryption=${encryption}
+
EOF
+ [ -n "$key" ] && {
+ uci -q set wireless.default_${name}.key=${key}
+ }
uci -q commit wireless
done
}
--
2.18.0