developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 1 | From 6385f7196ddd1e05c4ea089e8076ab9f62794ac8 Mon Sep 17 00:00:00 2001 |
| 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Thu, 20 Oct 2022 10:55:22 +0800 |
| 4 | Subject: [PATCH] master: mac80211: generate hostapd setting from ap cap |
| 5 | |
| 6 | Change-Id: Iaae41c39b7d5c80470ea3e0ac58ac115bfe746ae |
| 7 | --- |
| 8 | .../files/lib/netifd/wireless/mac80211.sh | 3 --- |
| 9 | .../kernel/mac80211/files/lib/wifi/mac80211.sh | 15 ++++++++++++++- |
| 10 | 2 files changed, 14 insertions(+), 4 deletions(-) |
| 11 | |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 12 | diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 13 | index ed280521..a0550057 100644 |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 14 | --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh |
| 15 | +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 16 | @@ -144,9 +144,6 @@ mac80211_hostapd_setup_base() { |
| 17 | json_get_values ht_capab_list ht_capab |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 18 | json_get_values channel_list channels |
| 19 | |
| 20 | - [ "$auto_channel" = 0 ] && [ -z "$channel_list" ] && \ |
| 21 | - channel_list="$channel" |
| 22 | - |
developer | 9b3248d | 2022-07-06 00:44:05 +0800 | [diff] [blame] | 23 | [ "$min_tx_power" -gt 0 ] && append base_cfg "min_tx_power=$min_tx_power" |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 24 | |
developer | 9b3248d | 2022-07-06 00:44:05 +0800 | [diff] [blame] | 25 | set_default noscan 0 |
developer | 9b3248d | 2022-07-06 00:44:05 +0800 | [diff] [blame] | 26 | diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 27 | index 3ecd9322..438bf929 100644 |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 28 | --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh |
| 29 | +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 30 | @@ -120,6 +120,13 @@ get_band_defaults() { |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 31 | mode_band="$band" |
| 32 | channel="$chan" |
| 33 | htmode="$mode" |
| 34 | + if [ "$band" = "6g" ] |
| 35 | + then |
| 36 | + encryption=sae |
| 37 | + key=12345678 |
| 38 | + else |
| 39 | + encryption=none |
| 40 | + fi |
| 41 | done |
| 42 | } |
| 43 | |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 44 | @@ -162,6 +169,8 @@ detect_mac80211() { |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 45 | channel="" |
| 46 | htmode="" |
| 47 | ht_capab="" |
| 48 | + encryption="" |
| 49 | + key="" |
| 50 | |
| 51 | get_band_defaults "$dev" |
| 52 | |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 53 | @@ -206,8 +215,12 @@ detect_mac80211() { |
| 54 | set wireless.default_${name}.network=lan |
| 55 | set wireless.default_${name}.mode=ap |
| 56 | set wireless.default_${name}.ssid=OpenWrt |
| 57 | - set wireless.default_${name}.encryption=none |
| 58 | + set wireless.default_${name}.encryption=${encryption} |
| 59 | + |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 60 | EOF |
| 61 | + [ -n "$key" ] && { |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 62 | + uci -q set wireless.default_${name}.key=${key} |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 63 | + } |
| 64 | uci -q commit wireless |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 65 | done |
| 66 | } |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 67 | -- |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 68 | 2.18.0 |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 69 | |