| From 7c009a478fec002ec626163eff2c686b14bc9aa5 Mon Sep 17 00:00:00 2001 |
| From: Allen Ye <allen.ye@mediatek.com> |
| Date: Thu, 23 May 2024 11:07:25 +0800 |
| Subject: [PATCH 096/126] mtk: hostapd: Remove BPCC and ML ie in per-sta |
| profile of ML probe response |
| |
| wifi7 cert testplan request DUT do not bring BPCC in STA info of |
| per-sta profile of ML probe response. |
| The standard defined not bring ML ie in per-sta profile. |
| |
| Signed-off-by: Allen Ye <allen.ye@mediatek.com> |
| --- |
| src/ap/beacon.c | 2 +- |
| src/ap/ieee802_11_eht.c | 21 +++++++++++---------- |
| 2 files changed, 12 insertions(+), 11 deletions(-) |
| |
| diff --git a/src/ap/beacon.c b/src/ap/beacon.c |
| index 59db8be8d..1ffe2fb56 100644 |
| --- a/src/ap/beacon.c |
| +++ b/src/ap/beacon.c |
| @@ -929,7 +929,7 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd, |
| struct hostapd_data *ml_elem_ap = |
| params->mld_ap ? params->mld_ap : hapd; |
| |
| - if (ml_elem_ap->conf->mld_ap) |
| + if (!params->is_ml_sta_info && ml_elem_ap->conf->mld_ap) |
| pos = hostapd_eid_eht_ml_beacon( |
| ml_elem_ap, params->mld_info, |
| pos, !!params->mld_ap); |
| diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c |
| index 7c328799a..02e85194c 100644 |
| --- a/src/ap/ieee802_11_eht.c |
| +++ b/src/ap/ieee802_11_eht.c |
| @@ -545,8 +545,8 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd, |
| * beacon interval (2) + TSF offset (8) + DTIM info (2) + BSS |
| * parameters change counter (1) + station profile length. |
| */ |
| -#define EHT_ML_STA_INFO_LEN 22 |
| - size_t total_len = EHT_ML_STA_INFO_LEN + |
| + size_t sta_info_len = include_mld_id ? 21 : 22; |
| + size_t total_len = sta_info_len + |
| link->resp_sta_profile_len; |
| |
| /* Skip the local one */ |
| @@ -574,14 +574,16 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd, |
| EHT_PER_STA_CTRL_COMPLETE_PROFILE_MSK | |
| EHT_PER_STA_CTRL_TSF_OFFSET_PRESENT_MSK | |
| EHT_PER_STA_CTRL_BEACON_INTERVAL_PRESENT_MSK | |
| - EHT_PER_STA_CTRL_DTIM_INFO_PRESENT_MSK | |
| - EHT_PER_STA_CTRL_BSS_PARAM_CNT_PRESENT_MSK; |
| + EHT_PER_STA_CTRL_DTIM_INFO_PRESENT_MSK; |
| + |
| + if (!include_mld_id) |
| + control |= EHT_PER_STA_CTRL_BSS_PARAM_CNT_PRESENT_MSK; |
| wpabuf_put_le16(buf, control); |
| |
| /* STA Info */ |
| |
| /* STA Info Length */ |
| - wpabuf_put_u8(buf, EHT_ML_STA_INFO_LEN - 2); |
| + wpabuf_put_u8(buf, sta_info_len - 2); |
| wpabuf_put_data(buf, link->local_addr, ETH_ALEN); |
| wpabuf_put_le16(buf, link_bss->iconf->beacon_int); |
| |
| @@ -597,7 +599,8 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd, |
| wpabuf_put_u8(buf, link_bss->conf->dtim_period); |
| |
| /* BSS Parameters Change Count */ |
| - wpabuf_put_u8(buf, link_bss->eht_mld_bss_param_change); |
| + if (!include_mld_id) |
| + wpabuf_put_u8(buf, link_bss->eht_mld_bss_param_change); |
| |
| if (!link->resp_sta_profile) |
| continue; |
| @@ -613,8 +616,7 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd, |
| ptr = link->resp_sta_profile; |
| len = link->resp_sta_profile_len; |
| |
| - slice_len = 255 - EHT_ML_STA_INFO_LEN; |
| - |
| + slice_len = 255 - sta_info_len; |
| wpabuf_put_data(buf, ptr, slice_len); |
| len -= slice_len; |
| ptr += slice_len; |
| @@ -764,7 +766,7 @@ static size_t hostapd_eid_eht_ml_len(struct mld_info *info, |
| for (link_id = 0; info && link_id < ARRAY_SIZE(info->links); |
| link_id++) { |
| struct mld_link_info *link; |
| - size_t sta_len = EHT_ML_STA_INFO_LEN; |
| + size_t sta_len = include_mld_id ? 21 : 22; |
| |
| link = &info->links[link_id]; |
| if (!link->valid) |
| @@ -789,7 +791,6 @@ static size_t hostapd_eid_eht_ml_len(struct mld_info *info, |
| return len; |
| } |
| #undef EHT_ML_COMMON_INFO_LEN |
| -#undef EHT_ML_STA_INFO_LEN |
| |
| |
| u8 * hostapd_eid_eht_ml_beacon(struct hostapd_data *hapd, |
| -- |
| 2.18.0 |
| |