diff --git a/components/mlme/core/inc/wlan_mlme_main.h b/components/mlme/core/inc/wlan_mlme_main.h index e8f737e36234..6ca723f46d27 100644 --- a/components/mlme/core/inc/wlan_mlme_main.h +++ b/components/mlme/core/inc/wlan_mlme_main.h @@ -250,6 +250,7 @@ struct mscs_req_info { * @last_delba_sent_time: Last delba sent time to handle back to back delba * requests from some IOT APs * @ba_2k_jump_iot_ap: This is set to true if connected to the ba 2k jump IOT AP + * @bad_htc_he_iot_ap: Set to true if connected to AP who can't decode htc he */ struct mlme_legacy_priv { bool chan_switch_in_progress; @@ -287,6 +288,7 @@ struct mlme_legacy_priv { #endif qdf_time_t last_delba_sent_time; bool ba_2k_jump_iot_ap; + bool bad_htc_he_iot_ap; }; diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index 7851e656e301..0ea9aaf61de4 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -3137,6 +3137,25 @@ wlan_mlme_set_ba_2k_jump_iot_ap(struct wlan_objmgr_vdev *vdev, bool found); bool wlan_mlme_is_ba_2k_jump_iot_ap(struct wlan_objmgr_vdev *vdev); +/** + * wlan_mlme_set_bad_htc_he_iot_ap() - Set a flag if bad htc he IOT AP is found + * @vdev: vdev pointer + * @found: Carries the value true if bad htc he AP is found + * + * Return: QDF Status + */ +QDF_STATUS +wlan_mlme_set_bad_htc_he_iot_ap(struct wlan_objmgr_vdev *vdev, bool found); + +/** + * wlan_mlme_is_bad_htc_he_iot_ap() - Check if bad htc he IOT AP is found + * @vdev: vdev pointer + * + * Return: true if bad htc he IOT AP is found + */ +bool +wlan_mlme_is_bad_htc_he_iot_ap(struct wlan_objmgr_vdev *vdev); + /** * wlan_mlme_set_last_delba_sent_time() - Cache the last delba sent ts * @vdev: vdev pointer diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index 5024c8e277ba..30d066587860 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -4815,6 +4815,36 @@ bool wlan_mlme_is_ba_2k_jump_iot_ap(struct wlan_objmgr_vdev *vdev) return mlme_priv->ba_2k_jump_iot_ap; } +QDF_STATUS +wlan_mlme_set_bad_htc_he_iot_ap(struct wlan_objmgr_vdev *vdev, bool found) +{ + struct mlme_legacy_priv *mlme_priv; + + mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev); + if (!mlme_priv) { + mlme_legacy_err("vdev legacy private object is NULL"); + return QDF_STATUS_E_FAILURE; + } + + mlme_priv->bad_htc_he_iot_ap = found; + mlme_legacy_debug("set bad htc he iot ap: %d", found); + + return QDF_STATUS_SUCCESS; +} + +bool wlan_mlme_is_bad_htc_he_iot_ap(struct wlan_objmgr_vdev *vdev) +{ + struct mlme_legacy_priv *mlme_priv; + + mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev); + if (!mlme_priv) { + mlme_legacy_err("vdev legacy private object is NULL"); + return false; + } + + return mlme_priv->bad_htc_he_iot_ap; +} + QDF_STATUS wlan_mlme_set_last_delba_sent_time(struct wlan_objmgr_vdev *vdev, qdf_time_t delba_sent_time) diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h index 60573d8f66eb..a3f9e9f778ff 100644 --- a/core/mac/inc/sir_mac_prot_def.h +++ b/core/mac/inc/sir_mac_prot_def.h @@ -341,6 +341,10 @@ #define SIR_MAC_BA_2K_JUMP_AP_VENDOR_OUI "\x00\x14\x6C" #define SIR_MAC_BA_2K_JUMP_AP_VENDOR_OUI_LEN 3 +#define SIR_MAC_BAD_HTC_HE_VENDOR_OUI1 "\x00\x50\xF2\x11" +#define SIR_MAC_BAD_HTC_HE_VENDOR_OUI2 "\x00\x50\xF2\x12" +#define SIR_MAC_BAD_HTC_HE_VENDOR_OUI_LEN 4 + /* Maximum allowable size of a beacon and probe rsp frame */ #define SIR_MAX_BEACON_SIZE 512 #define SIR_MAX_PROBE_RESP_SIZE 512 diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 03fb74205362..455240bb9cd5 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -7061,6 +7061,11 @@ void lim_intersect_ap_he_caps(struct pe_session *session, struct bss_params *add lim_intersect_he_caps(rcvd_he, peer_he, session); add_bss->staContext.he_capable = true; + + if (wlan_mlme_is_bad_htc_he_iot_ap(session->vdev)) { + peer_he->htc_he = 0; + pe_debug("disable ht control in he cap for iot ap"); + } } void lim_add_bss_he_cap(struct bss_params *add_bss, tpSirAssocRsp assoc_rsp) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 94ce68c8cd61..4407c676a5e4 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -15103,6 +15103,26 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, wlan_mlme_set_ba_2k_jump_iot_ap(vdev, is_vendor_ap_present); + is_vendor_ap_present = wlan_get_vendor_ie_ptr_from_oui + (SIR_MAC_BAD_HTC_HE_VENDOR_OUI1, + SIR_MAC_BAD_HTC_HE_VENDOR_OUI_LEN, + vendor_ap_search_attr.ie_data, + vendor_ap_search_attr.ie_length); + + is_vendor_ap_present = + is_vendor_ap_present && + wlan_get_vendor_ie_ptr_from_oui + (SIR_MAC_BAD_HTC_HE_VENDOR_OUI2, + SIR_MAC_BAD_HTC_HE_VENDOR_OUI_LEN, + vendor_ap_search_attr.ie_data, + vendor_ap_search_attr.ie_length); + /* + * For SAP with special OUI, if DUT STA connect with + * htc he enabled, SAP can't decode data pkt from DUT. + */ + wlan_mlme_set_bad_htc_he_iot_ap(vdev, + is_vendor_ap_present); + wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID); }