developer | 832d3a7 | 2022-01-18 20:59:06 +0800 | [diff] [blame] | 1 | From 98cbf8b36d141112c7bc9e3a366ecc333b60ee90 Mon Sep 17 00:00:00 2001 |
| 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Tue, 18 Jan 2022 20:56:46 +0800 |
| 4 | Subject: [PATCH 2/2] AP Add user configuration for TWT responder role |
| 5 | |
| 6 | Change-Id: I4f669319eb72e37d22bd97901a0d418450f301c3 |
| 7 | --- |
| 8 | ...configuration-for-TWT-responder-role.patch | 87 +++++++++++++++++++ |
| 9 | 1 file changed, 87 insertions(+) |
| 10 | create mode 100644 package/network/services/hostapd/patches/905-AP-Add-user-configuration-for-TWT-responder-role.patch |
| 11 | |
| 12 | diff --git a/package/network/services/hostapd/patches/905-AP-Add-user-configuration-for-TWT-responder-role.patch b/package/network/services/hostapd/patches/905-AP-Add-user-configuration-for-TWT-responder-role.patch |
| 13 | new file mode 100644 |
| 14 | index 0000000..1ece165 |
| 15 | --- /dev/null |
| 16 | +++ b/package/network/services/hostapd/patches/905-AP-Add-user-configuration-for-TWT-responder-role.patch |
| 17 | @@ -0,0 +1,87 @@ |
| 18 | +From c0ce87b34e120d1bc79bdca349fa8211ecff3a71 Mon Sep 17 00:00:00 2001 |
| 19 | +From: Mohammad Asaad Akram <asadkrm@codeaurora.org> |
| 20 | +Date: Fri, 28 May 2021 09:47:38 +0530 |
| 21 | +Subject: [PATCH 1/7] AP: Add user configuration for TWT responder role |
| 22 | + |
| 23 | +Add user configuration he_twt_responder for enabling/disabling TWT |
| 24 | +responder role, in addition to checking the driver's capability. The |
| 25 | +default configuration is to enable TWT responder role when the driver |
| 26 | +supports this. |
| 27 | + |
| 28 | +Signed-off-by: Mohammad Asaad Akram <asadkrm@codeaurora.org> |
| 29 | +--- |
| 30 | + hostapd/config_file.c | 2 ++ |
| 31 | + hostapd/hostapd.conf | 5 +++++ |
| 32 | + src/ap/ap_config.c | 1 + |
| 33 | + src/ap/ap_config.h | 1 + |
| 34 | + src/ap/ieee802_11_he.c | 3 ++- |
| 35 | + 5 files changed, 11 insertions(+), 1 deletion(-) |
| 36 | + |
| 37 | +diff --git a/hostapd/config_file.c b/hostapd/config_file.c |
| 38 | +index 8f6281a..45aa809 100644 |
| 39 | +--- a/hostapd/config_file.c |
| 40 | ++++ b/hostapd/config_file.c |
| 41 | +@@ -3537,6 +3537,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, |
| 42 | + conf->he_op.he_default_pe_duration = atoi(pos); |
| 43 | + } else if (os_strcmp(buf, "he_twt_required") == 0) { |
| 44 | + conf->he_op.he_twt_required = atoi(pos); |
| 45 | ++ } else if (os_strcmp(buf, "he_twt_responder") == 0) { |
| 46 | ++ conf->he_op.he_twt_responder = atoi(pos); |
| 47 | + } else if (os_strcmp(buf, "he_rts_threshold") == 0) { |
| 48 | + conf->he_op.he_rts_threshold = atoi(pos); |
| 49 | + } else if (os_strcmp(buf, "he_basic_mcs_nss_set") == 0) { |
| 50 | +diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf |
| 51 | +index 0c951a9..77775fc 100644 |
| 52 | +--- a/hostapd/hostapd.conf |
| 53 | ++++ b/hostapd/hostapd.conf |
| 54 | +@@ -838,6 +838,11 @@ wmm_ac_vo_acm=0 |
| 55 | + # 1 = required |
| 56 | + #he_twt_required=0 |
| 57 | + |
| 58 | ++#he_twt_responder: Whether TWT (HE) responder is enabled |
| 59 | ++# 0 = disabled |
| 60 | ++# 1 = enabled if supported by the driver (default) |
| 61 | ++#he_twt_responder=1 |
| 62 | ++ |
| 63 | + #he_rts_threshold: Duration of STA transmission |
| 64 | + # 0 = not set (default) |
| 65 | + # unsigned integer = duration in units of 16 us |
| 66 | +diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c |
| 67 | +index ce281ac..59c356d 100644 |
| 68 | +--- a/src/ap/ap_config.c |
| 69 | ++++ b/src/ap/ap_config.c |
| 70 | +@@ -274,6 +274,7 @@ struct hostapd_config * hostapd_config_defaults(void) |
| 71 | + conf->he_op.he_bss_color_disabled = 1; |
| 72 | + conf->he_op.he_bss_color_partial = 0; |
| 73 | + conf->he_op.he_bss_color = 1; |
| 74 | ++ conf->he_op.he_twt_responder = 1; |
| 75 | + conf->he_6ghz_max_mpdu = 2; |
| 76 | + conf->he_6ghz_max_ampdu_len_exp = 7; |
| 77 | + conf->he_6ghz_rx_ant_pat = 1; |
| 78 | +diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h |
| 79 | +index ffc3c2c..28d199e 100644 |
| 80 | +--- a/src/ap/ap_config.h |
| 81 | ++++ b/src/ap/ap_config.h |
| 82 | +@@ -921,6 +921,7 @@ struct he_operation { |
| 83 | + u8 he_bss_color_partial; |
| 84 | + u8 he_default_pe_duration; |
| 85 | + u8 he_twt_required; |
| 86 | ++ u8 he_twt_responder; |
| 87 | + u16 he_rts_threshold; |
| 88 | + u16 he_basic_mcs_nss_set; |
| 89 | + }; |
| 90 | +diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c |
| 91 | +index 8ff3835..cbe5e63 100644 |
| 92 | +--- a/src/ap/ieee802_11_he.c |
| 93 | ++++ b/src/ap/ieee802_11_he.c |
| 94 | +@@ -514,5 +514,6 @@ int hostapd_get_he_twt_responder(struct hostapd_data *hapd, |
| 95 | + |
| 96 | + mac_cap = hapd->iface->current_mode->he_capab[mode].mac_cap; |
| 97 | + |
| 98 | +- return !!(mac_cap[HE_MAC_CAPAB_0] & HE_MACCAP_TWT_RESPONDER); |
| 99 | ++ return !!(mac_cap[HE_MAC_CAPAB_0] & HE_MACCAP_TWT_RESPONDER) && |
| 100 | ++ hapd->iface->conf->he_op.he_twt_responder; |
| 101 | + } |
| 102 | +-- |
| 103 | +2.29.2 |
| 104 | + |
| 105 | -- |
| 106 | 2.29.2 |
| 107 | |