From 8b0b8a7e4c5d40d9fe04115839dc587791c22370 Mon Sep 17 00:00:00 2001 From: Bing Sun Date: Fri, 14 Jan 2022 16:12:42 +0800 Subject: [PATCH] qcacld-3.0: Cleanup EID 221 when populating assoc rsp mlo IE There are several IE with the same EID 221. If any 221 IE of reported link is different with reporting link, every 221 IE should be populated in per sta profile of mlo IE. Change-Id: Ia8f2d0f68829ccee558c64dbf5b58d4b9925b0ea CRs-Fixed: 3106339 --- .../src/sys/legacy/src/utils/src/parser_api.c | 226 +++++++++--------- 1 file changed, 117 insertions(+), 109 deletions(-) diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index e39c451b00..66d14341ef 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -6855,12 +6855,13 @@ QDF_STATUS populate_dot11f_assoc_rsp_mlo_ie(struct mac_context *mac_ctx, tDot11fIEmlo_ie *mlo_ie = &frm->mlo_ie; tpSirAssocReq assoc_req; tpSirAssocReq link_assoc_req; - const uint8_t *p2p_ie = NULL; + const uint8_t *reported_p2p_ie = NULL; uint8_t non_inher_ie_lists[255]; uint8_t non_inher_len; uint8_t non_inher_ext_len; uint8_t non_inher_ext_ie_lists[255]; - bool same_ie, vendor_vht_ie_pres; + bool same_ie, reported_vendor_vht_ie_pres; + bool reported_wmm_caps_pres, reported_wmm_param_pres; tDot11fIEvendor_vht_ie vendor_vht_ie; tpDphHashNode link_sta; tDot11fIESuppRates supp_rates; @@ -7004,22 +7005,6 @@ QDF_STATUS populate_dot11f_assoc_rsp_mlo_ie(struct mac_context *mac_ctx, DOT11F_EID_SUPPRATES; } - if ((ext_supp_rates.present && frm->ExtSuppRates.present && - qdf_mem_cmp(&ext_supp_rates, &frm->ExtSuppRates, - sizeof(ext_supp_rates))) || - (ext_supp_rates.present && !frm->ExtSuppRates.present)) { - sta_len_consumed = 0; - dot11f_pack_ie_ext_supp_rates( - mac_ctx, &ext_supp_rates, sta_data, - sta_len_left, - &sta_len_consumed); - sta_data += sta_len_consumed; - sta_len_left -= sta_len_consumed; - } else if (frm->SuppRates.present && !ext_supp_rates.present) { - non_inher_ie_lists[non_inher_len++] = - DOT11F_EID_EXTSUPPRATES; - } - if (link_session->limQosEnabled && link_sta->lleEnabled) { lle_mode = 1; if ((link_ie->link_edca.present && @@ -7043,53 +7028,6 @@ QDF_STATUS populate_dot11f_assoc_rsp_mlo_ie(struct mac_context *mac_ctx, } } - if (!lle_mode && link_session->limWmeEnabled && - sta->wmeEnabled) { - if ((link_ie->link_wmm_params.present && - frm->WMMParams.present && - qdf_mem_cmp(&link_ie->link_wmm_params, - &frm->WMMParams, - sizeof(link_ie->link_wmm_params))) || - (link_ie->link_wmm_params.present && - !frm->WMMParams.present)) { - sta_len_consumed = 0; - dot11f_pack_ie_wmm_params( - mac_ctx, - &link_ie->link_wmm_params, - sta_data, sta_len_left, - &sta_len_consumed); - sta_data += sta_len_consumed; - sta_len_left -= sta_len_consumed; - } else if (frm->WMMParams.present && - !link_ie->link_wmm_params.present) { - non_inher_ie_lists[non_inher_len++] = - DOT11F_EID_WMMPARAMS; - } - - if (sta->wsmEnabled) { - if ((link_ie->link_wmm_caps.present && - frm->WMMCaps.present && - qdf_mem_cmp(&link_ie->link_wmm_caps, - &frm->WMMCaps, - sizeof(frm->WMMCaps))) || - (link_ie->link_wmm_caps.present && - !frm->WMMCaps.present)) { - sta_len_consumed = 0; - dot11f_pack_ie_wmm_caps( - mac_ctx, - &link_ie->link_wmm_caps, - sta_data, sta_len_left, - &sta_len_consumed); - sta_data += sta_len_consumed; - sta_len_left -= sta_len_consumed; - } else if (frm->WMMCaps.present && - !link_ie->link_wmm_caps.present) { - non_inher_ie_lists[non_inher_len++] = - DOT11F_EID_WMMCAPS; - } - } - } - if ((link_ie->link_ht_cap.present && frm->HTCaps.present && qdf_mem_cmp(&link_ie->link_ht_cap, &frm->HTCaps, sizeof(tDot11fIEHTCaps))) || @@ -7105,6 +7043,22 @@ QDF_STATUS populate_dot11f_assoc_rsp_mlo_ie(struct mac_context *mac_ctx, non_inher_ie_lists[non_inher_len++] = DOT11F_EID_HTCAPS; } + if ((ext_supp_rates.present && frm->ExtSuppRates.present && + qdf_mem_cmp(&ext_supp_rates, &frm->ExtSuppRates, + sizeof(ext_supp_rates))) || + (ext_supp_rates.present && !frm->ExtSuppRates.present)) { + sta_len_consumed = 0; + dot11f_pack_ie_ext_supp_rates( + mac_ctx, &ext_supp_rates, sta_data, + sta_len_left, + &sta_len_consumed); + sta_data += sta_len_consumed; + sta_len_left -= sta_len_consumed; + } else if (frm->SuppRates.present && !ext_supp_rates.present) { + non_inher_ie_lists[non_inher_len++] = + DOT11F_EID_EXTSUPPRATES; + } + if ((link_ie->link_ht_info.present && frm->HTInfo.present && qdf_mem_cmp(&link_ie->link_ht_info, &frm->HTInfo, sizeof(tDot11fIEHTInfo))) || @@ -7172,37 +7126,37 @@ QDF_STATUS populate_dot11f_assoc_rsp_mlo_ie(struct mac_context *mac_ctx, non_inher_ie_lists[non_inher_len++] = DOT11F_EID_VHTOPERATION; } + /* Check every 221 EID whether it's the same with assoc link */ same_ie = false; // P2PAssocRes is different or not if (link_assoc_req) - p2p_ie = limGetP2pIEPtr( - mac_ctx, - link_assoc_req->addIE.addIEdata, - link_assoc_req->addIE.length); - if ((p2p_ie && frm->P2PAssocRes.present) || - (!p2p_ie && !frm->P2PAssocRes.present)) + reported_p2p_ie = limGetP2pIEPtr( + mac_ctx, + link_assoc_req->addIE.addIEdata, + link_assoc_req->addIE.length); + if ((reported_p2p_ie && frm->P2PAssocRes.present) || + (!reported_p2p_ie && !frm->P2PAssocRes.present)) same_ie = true; // vendor_vht_ie is different or not - vendor_vht_ie_pres = + reported_vendor_vht_ie_pres = link_session->vhtCapability && link_session->vendor_vht_sap && link_assoc_req && link_assoc_req->vendor_vht_ie.VHTCaps.present; if (same_ie && frm->vendor_vht_ie.VHTCaps.present && - vendor_vht_ie_pres) { + reported_vendor_vht_ie_pres) { if (qdf_mem_cmp(&link_ie->link_vht_cap, &frm->vendor_vht_ie.VHTCaps, - sizeof(tDot11fIEVHTCaps))) - same_ie = false; - else if (qdf_mem_cmp(&link_ie->link_vht_op, - &frm->vendor_vht_ie.VHTOperation, - sizeof(tDot11fIEVHTOperation))) + sizeof(tDot11fIEVHTCaps)) || + qdf_mem_cmp(&link_ie->link_vht_op, + &frm->vendor_vht_ie.VHTOperation, + sizeof(tDot11fIEVHTOperation))) same_ie = false; - } else if ((frm->vendor_vht_ie.VHTCaps.present && - !vendor_vht_ie_pres) || - (!frm->vendor_vht_ie.VHTCaps.present && - vendor_vht_ie_pres)) { + } else if (same_ie && ((frm->vendor_vht_ie.VHTCaps.present && + !reported_vendor_vht_ie_pres) || + (!frm->vendor_vht_ie.VHTCaps.present && + reported_vendor_vht_ie_pres))) { same_ie = false; } // qcn ie is different or not @@ -7211,10 +7165,46 @@ QDF_STATUS populate_dot11f_assoc_rsp_mlo_ie(struct mac_context *mac_ctx, if (qdf_mem_cmp(&link_ie->link_qcn_ie, &frm->qcn_ie, sizeof(tDot11fIEqcn_ie))) same_ie = false; - } else if ((link_ie->link_qcn_ie.present && - !frm->qcn_ie.present) || - (!link_ie->link_qcn_ie.present && - frm->qcn_ie.present)) { + } else if (same_ie && ((link_ie->link_qcn_ie.present && + !frm->qcn_ie.present) || + (!link_ie->link_qcn_ie.present && + frm->qcn_ie.present))) { + same_ie = false; + } + /* wmm param and wmm caps are different or not*/ + reported_wmm_caps_pres = false; + reported_wmm_param_pres = false; + if (!lle_mode && link_session->limWmeEnabled && + link_sta->wmeEnabled) { + if (link_ie->link_wmm_params.present) + reported_wmm_param_pres = true; + + if (link_sta->wsmEnabled && + link_ie->link_wmm_caps.present) + reported_wmm_caps_pres = true; + } + if (same_ie && reported_wmm_param_pres && + frm->WMMParams.present) { + if (qdf_mem_cmp(&link_ie->link_wmm_params, + &frm->WMMParams, + sizeof(link_ie->link_wmm_params))) + same_ie = false; + } else if (same_ie && ((reported_wmm_param_pres && + !frm->WMMParams.present) || + (!reported_wmm_param_pres && + frm->WMMParams.present))) { + same_ie = false; + } + if (same_ie && reported_wmm_caps_pres && + frm->WMMCaps.present) { + if (qdf_mem_cmp(&link_ie->link_wmm_caps, + &frm->WMMCaps, + sizeof(link_ie->link_wmm_caps))) + same_ie = false; + } else if (same_ie && ((reported_wmm_caps_pres && + !frm->WMMCaps.present) || + (!reported_wmm_caps_pres && + frm->WMMCaps.present))) { same_ie = false; } /* @@ -7222,7 +7212,7 @@ QDF_STATUS populate_dot11f_assoc_rsp_mlo_ie(struct mac_context *mac_ctx, * are the same with reporting assoc resp. */ if (!same_ie) { - if (p2p_ie) { + if (reported_p2p_ie) { populate_dot11_assoc_res_p2p_ie( mac_ctx, &sta_p2p_assoc_res, @@ -7235,7 +7225,7 @@ QDF_STATUS populate_dot11f_assoc_rsp_mlo_ie(struct mac_context *mac_ctx, sta_data += sta_len_consumed; sta_len_left -= sta_len_consumed; } - if (vendor_vht_ie_pres) { + if (reported_vendor_vht_ie_pres) { qdf_mem_zero(&vendor_vht_ie, sizeof(vendor_vht_ie)); vendor_vht_ie.present = 1; @@ -7263,17 +7253,35 @@ QDF_STATUS populate_dot11f_assoc_rsp_mlo_ie(struct mac_context *mac_ctx, &sta_len_consumed); sta_data += sta_len_consumed; sta_len_left -= sta_len_consumed; + if (reported_wmm_param_pres) { + sta_len_consumed = 0; + dot11f_pack_ie_wmm_params( + mac_ctx, + &link_ie->link_wmm_params, + sta_data, sta_len_left, + &sta_len_consumed); + sta_data += sta_len_consumed; + sta_len_left -= sta_len_consumed; + } + if (reported_wmm_caps_pres) { + sta_len_consumed = 0; + dot11f_pack_ie_wmm_caps( + mac_ctx, + &link_ie->link_wmm_caps, + sta_data, sta_len_left, + &sta_len_consumed); + sta_data += sta_len_consumed; + sta_len_left -= sta_len_consumed; + } /* * if there is no 221 IE in partner link * while there is such IE in current link * include 221 in the non inheritance IE lists */ - if (!p2p_ie && + if (!reported_p2p_ie && !link_ie->link_qcn_ie.present && - !vendor_vht_ie_pres && - (frm->P2PAssocRes.present || - frm->vendor_vht_ie.VHTCaps.present || - frm->qcn_ie.present)) + !reported_vendor_vht_ie_pres && + !reported_wmm_caps_pres && !reported_wmm_param_pres) non_inher_ie_lists[non_inher_len++] = DOT11F_EID_QCN_IE; } @@ -7329,22 +7337,6 @@ QDF_STATUS populate_dot11f_assoc_rsp_mlo_ie(struct mac_context *mac_ctx, non_inher_ext_ie_lists[non_inher_ext_len++] = WLAN_EXTN_ELEMID_HE_6G_CAP; } - if ((link_ie->link_eht_cap.present && frm->eht_cap.present && - qdf_mem_cmp(&link_ie->link_eht_cap, &frm->eht_cap, - sizeof(frm->eht_cap))) || - (link_ie->link_eht_cap.present && !frm->eht_cap.present)) { - sta_len_consumed = 0; - dot11f_pack_ie_eht_cap( - mac_ctx, &link_ie->link_eht_cap, - sta_data, sta_len_left, - &sta_len_consumed); - sta_data += sta_len_consumed; - sta_len_left -= sta_len_consumed; - } else if (frm->eht_cap.present && - !link_ie->link_eht_cap.present) { - non_inher_ext_ie_lists[non_inher_ext_len++] = - WLAN_EXTN_ELEMID_EHTCAP; - } if ((link_ie->link_eht_op.present && frm->eht_op.present && qdf_mem_cmp(&link_ie->link_eht_op, &frm->eht_op, sizeof(tDot11fIEeht_op))) || @@ -7361,6 +7353,22 @@ QDF_STATUS populate_dot11f_assoc_rsp_mlo_ie(struct mac_context *mac_ctx, non_inher_ext_ie_lists[non_inher_ext_len++] = WLAN_EXTN_ELEMID_EHTOP; } + if ((link_ie->link_eht_cap.present && frm->eht_cap.present && + qdf_mem_cmp(&link_ie->link_eht_cap, &frm->eht_cap, + sizeof(frm->eht_cap))) || + (link_ie->link_eht_cap.present && !frm->eht_cap.present)) { + sta_len_consumed = 0; + dot11f_pack_ie_eht_cap( + mac_ctx, &link_ie->link_eht_cap, + sta_data, sta_len_left, + &sta_len_consumed); + sta_data += sta_len_consumed; + sta_len_left -= sta_len_consumed; + } else if (frm->eht_cap.present && + !link_ie->link_eht_cap.present) { + non_inher_ext_ie_lists[non_inher_ext_len++] = + WLAN_EXTN_ELEMID_EHTCAP; + } populate_dot11f_non_inheritance(mac_ctx, &sta_non_inheritance, non_inher_ie_lists, non_inher_ext_ie_lists,