From 03d72d75b05a1355e435116efa90ffae76a409ea Mon Sep 17 00:00:00 2001 From: Will Huang Date: Fri, 3 Jan 2020 17:35:02 +0800 Subject: [PATCH] qcacld-3.0: Strip HE add ie when wep enabled Certification test case HE-4.2.2 enable both 11ax and wep for sap, we start sap as 11g mode as expected, but there is additional IEs from hostapd which has HE cap/op IEs fails the case. Strip these HE IEs from additional IE configure from hostapd when HE has been decided to disable when sap start in host driver. Change-Id: If1001255cc6528ab1a01d72d13f8376815aa5ebc CRs-Fixed: 2594834 --- .../src/pe/lim/lim_process_sme_req_messages.c | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 78d5102ae8..c2fe02f566 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -488,6 +488,42 @@ lim_send_start_vdev_req(struct pe_session *session, tLimMlmStartReq *mlm_start_r mlm_start_req); } +#ifdef WLAN_FEATURE_11AX +static void lim_strip_he_ies_from_add_ies(struct mac_context *mac_ctx, + struct pe_session *session) +{ + struct add_ie_params *add_ie = &session->add_ie_params; + QDF_STATUS status; + uint8_t he_cap_buff[DOT11F_IE_HE_CAP_MAX_LEN + 2]; + uint8_t he_op_buff[DOT11F_IE_HE_OP_MAX_LEN + 2]; + + qdf_mem_zero(he_cap_buff, sizeof(he_cap_buff)); + qdf_mem_zero(he_op_buff, sizeof(he_op_buff)); + + status = lim_strip_ie(mac_ctx, add_ie->probeRespBCNData_buff, + &add_ie->probeRespBCNDataLen, + DOT11F_EID_HE_CAP, ONE_BYTE, + HE_CAP_OUI_TYPE, (uint8_t)HE_CAP_OUI_SIZE, + he_cap_buff, DOT11F_IE_HE_CAP_MAX_LEN); + if (status != QDF_STATUS_SUCCESS) + pe_debug("Failed to strip HE cap IE status: %d", status); + + + status = lim_strip_ie(mac_ctx, add_ie->probeRespBCNData_buff, + &add_ie->probeRespBCNDataLen, + DOT11F_EID_HE_OP, ONE_BYTE, + HE_OP_OUI_TYPE, (uint8_t)HE_OP_OUI_SIZE, + he_op_buff, DOT11F_IE_HE_OP_MAX_LEN); + if (status != QDF_STATUS_SUCCESS) + pe_debug("Failed to strip HE op IE status: %d", status); +} +#else +static inline void lim_strip_he_ies_from_add_ies(struct mac_context *mac_ctx, + struct pe_session *session) +{ +} +#endif + /** * __lim_handle_sme_start_bss_request() - process SME_START_BSS_REQ message *@mac_ctx: Pointer to Global MAC structure @@ -652,6 +688,8 @@ __lim_handle_sme_start_bss_request(struct mac_context *mac_ctx, uint32_t *msg_bu session->curr_op_freq, session->dot11mode); ret_code = eSIR_SME_INVALID_PARAMETERS; goto free; + } else { + lim_strip_he_ies_from_add_ies(mac_ctx, session); } session->txLdpcIniFeatureEnabled =