developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 1 | From 7c009a478fec002ec626163eff2c686b14bc9aa5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Allen Ye <allen.ye@mediatek.com> |
| 3 | Date: Thu, 23 May 2024 11:07:25 +0800 |
| 4 | Subject: [PATCH 096/126] mtk: hostapd: Remove BPCC and ML ie in per-sta |
| 5 | profile of ML probe response |
| 6 | |
| 7 | wifi7 cert testplan request DUT do not bring BPCC in STA info of |
| 8 | per-sta profile of ML probe response. |
| 9 | The standard defined not bring ML ie in per-sta profile. |
| 10 | |
| 11 | Signed-off-by: Allen Ye <allen.ye@mediatek.com> |
| 12 | --- |
| 13 | src/ap/beacon.c | 2 +- |
| 14 | src/ap/ieee802_11_eht.c | 21 +++++++++++---------- |
| 15 | 2 files changed, 12 insertions(+), 11 deletions(-) |
| 16 | |
| 17 | diff --git a/src/ap/beacon.c b/src/ap/beacon.c |
| 18 | index 59db8be8d..1ffe2fb56 100644 |
| 19 | --- a/src/ap/beacon.c |
| 20 | +++ b/src/ap/beacon.c |
| 21 | @@ -929,7 +929,7 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd, |
| 22 | struct hostapd_data *ml_elem_ap = |
| 23 | params->mld_ap ? params->mld_ap : hapd; |
| 24 | |
| 25 | - if (ml_elem_ap->conf->mld_ap) |
| 26 | + if (!params->is_ml_sta_info && ml_elem_ap->conf->mld_ap) |
| 27 | pos = hostapd_eid_eht_ml_beacon( |
| 28 | ml_elem_ap, params->mld_info, |
| 29 | pos, !!params->mld_ap); |
| 30 | diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c |
| 31 | index 7c328799a..02e85194c 100644 |
| 32 | --- a/src/ap/ieee802_11_eht.c |
| 33 | +++ b/src/ap/ieee802_11_eht.c |
| 34 | @@ -545,8 +545,8 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd, |
| 35 | * beacon interval (2) + TSF offset (8) + DTIM info (2) + BSS |
| 36 | * parameters change counter (1) + station profile length. |
| 37 | */ |
| 38 | -#define EHT_ML_STA_INFO_LEN 22 |
| 39 | - size_t total_len = EHT_ML_STA_INFO_LEN + |
| 40 | + size_t sta_info_len = include_mld_id ? 21 : 22; |
| 41 | + size_t total_len = sta_info_len + |
| 42 | link->resp_sta_profile_len; |
| 43 | |
| 44 | /* Skip the local one */ |
| 45 | @@ -574,14 +574,16 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd, |
| 46 | EHT_PER_STA_CTRL_COMPLETE_PROFILE_MSK | |
| 47 | EHT_PER_STA_CTRL_TSF_OFFSET_PRESENT_MSK | |
| 48 | EHT_PER_STA_CTRL_BEACON_INTERVAL_PRESENT_MSK | |
| 49 | - EHT_PER_STA_CTRL_DTIM_INFO_PRESENT_MSK | |
| 50 | - EHT_PER_STA_CTRL_BSS_PARAM_CNT_PRESENT_MSK; |
| 51 | + EHT_PER_STA_CTRL_DTIM_INFO_PRESENT_MSK; |
| 52 | + |
| 53 | + if (!include_mld_id) |
| 54 | + control |= EHT_PER_STA_CTRL_BSS_PARAM_CNT_PRESENT_MSK; |
| 55 | wpabuf_put_le16(buf, control); |
| 56 | |
| 57 | /* STA Info */ |
| 58 | |
| 59 | /* STA Info Length */ |
| 60 | - wpabuf_put_u8(buf, EHT_ML_STA_INFO_LEN - 2); |
| 61 | + wpabuf_put_u8(buf, sta_info_len - 2); |
| 62 | wpabuf_put_data(buf, link->local_addr, ETH_ALEN); |
| 63 | wpabuf_put_le16(buf, link_bss->iconf->beacon_int); |
| 64 | |
| 65 | @@ -597,7 +599,8 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd, |
| 66 | wpabuf_put_u8(buf, link_bss->conf->dtim_period); |
| 67 | |
| 68 | /* BSS Parameters Change Count */ |
| 69 | - wpabuf_put_u8(buf, link_bss->eht_mld_bss_param_change); |
| 70 | + if (!include_mld_id) |
| 71 | + wpabuf_put_u8(buf, link_bss->eht_mld_bss_param_change); |
| 72 | |
| 73 | if (!link->resp_sta_profile) |
| 74 | continue; |
| 75 | @@ -613,8 +616,7 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd, |
| 76 | ptr = link->resp_sta_profile; |
| 77 | len = link->resp_sta_profile_len; |
| 78 | |
| 79 | - slice_len = 255 - EHT_ML_STA_INFO_LEN; |
| 80 | - |
| 81 | + slice_len = 255 - sta_info_len; |
| 82 | wpabuf_put_data(buf, ptr, slice_len); |
| 83 | len -= slice_len; |
| 84 | ptr += slice_len; |
| 85 | @@ -764,7 +766,7 @@ static size_t hostapd_eid_eht_ml_len(struct mld_info *info, |
| 86 | for (link_id = 0; info && link_id < ARRAY_SIZE(info->links); |
| 87 | link_id++) { |
| 88 | struct mld_link_info *link; |
| 89 | - size_t sta_len = EHT_ML_STA_INFO_LEN; |
| 90 | + size_t sta_len = include_mld_id ? 21 : 22; |
| 91 | |
| 92 | link = &info->links[link_id]; |
| 93 | if (!link->valid) |
| 94 | @@ -789,7 +791,6 @@ static size_t hostapd_eid_eht_ml_len(struct mld_info *info, |
| 95 | return len; |
| 96 | } |
| 97 | #undef EHT_ML_COMMON_INFO_LEN |
| 98 | -#undef EHT_ML_STA_INFO_LEN |
| 99 | |
| 100 | |
| 101 | u8 * hostapd_eid_eht_ml_beacon(struct hostapd_data *hapd, |
| 102 | -- |
| 103 | 2.18.0 |
| 104 | |