diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 289913569fe0..642cf46314d4 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -6289,6 +6289,8 @@ wlan_hdd_wifi_test_config_policy[ .type = NLA_U8}, [QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_HE_FRAGMENTATION] = { .type = NLA_U8}, + [QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_WEP_TKIP_IN_HE] = { + .type = NLA_U8}, }; /** @@ -7268,9 +7270,18 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy, uint8_t cfg_val = 0; uint8_t set_val = 0; tSmeConfigParams *sme_config; + bool update_sme_cfg = false; ENTER_DEV(dev); + sme_config = qdf_mem_malloc(sizeof(*sme_config)); + if (!sme_config) { + hdd_err("mem alloc failed for sme_config"); + return -ENOMEM; + } + sme_get_config_param(hdd_ctx->hHal, sme_config); + + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { hdd_err("Command not allowed in FTM mode"); return -EPERM; @@ -7316,13 +7327,6 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy, if (tb[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_WMM_ENABLE]) { cfg_val = nla_get_u8(tb[ QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_WMM_ENABLE]); - sme_config = qdf_mem_malloc(sizeof(*sme_config)); - if (!sme_config) { - hdd_err("mem alloc failed for sme_config"); - return -ENOMEM; - } - qdf_mem_zero(sme_config, sizeof(*sme_config)); - sme_get_config_param(hdd_ctx->hHal, sme_config); if (!cfg_val) { sme_config->csrConfig.WMMSupportMode = hdd_to_csr_wmm_mode(HDD_WMM_USER_MODE_NO_QOS); @@ -7332,8 +7336,7 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy, hdd_to_csr_wmm_mode(hdd_ctx->config->WmmMode); hdd_debug("using wmm default value"); } - sme_update_config(hdd_ctx->hHal, sme_config); - qdf_mem_free(sme_config); + update_sme_cfg = true; } if (tb[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_SEND_ADDBA_REQ]) { @@ -7367,6 +7370,20 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy, adapter->session_id, set_val); } + if (tb[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_WEP_TKIP_IN_HE]) { + cfg_val = nla_get_u8(tb[ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_WEP_TKIP_IN_HE]); + sme_config->csrConfig.wep_tkip_in_he = cfg_val; + hdd_debug("Set WEP/TKIP allow in HE %d", cfg_val); + + update_sme_cfg = true; + } + + if (update_sme_cfg) + sme_update_config(hdd_ctx->hHal, sme_config); + + qdf_mem_free(sme_config); + return ret_val; } diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index c73b071a09e9..1ca7f8cbd697 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -1127,7 +1127,7 @@ typedef struct sSirSmeJoinReq { uint8_t enableHtSmps; uint8_t htSmps; bool send_smps_action; - + bool he_with_wep_tkip; uint8_t max_amsdu_num; bool isWMEenabled; bool isQosEnabled; diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index 9626154ef6cf..dc9bb138bce5 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -542,6 +542,7 @@ typedef struct sPESession /* Added to Support BT-AMP */ uint8_t ht_client_cnt; bool force_24ghz_in_ht20; bool ch_switch_in_progress; + bool he_with_wep_tkip; #ifdef WLAN_FEATURE_FILS_SK struct pe_fils_session *fils_info; struct qdf_mac_addr dst_mac; 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 2b895acbda48..d086b7aec81d 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 @@ -1347,6 +1347,7 @@ __lim_process_sme_join_req(tpAniSirGlobal mac_ctx, uint32_t *msg_buf) session->limWmeEnabled = sme_join_req->isWMEenabled; session->limQosEnabled = sme_join_req->isQosEnabled; session->wps_registration = sme_join_req->wps_registration; + session->he_with_wep_tkip = sme_join_req->he_with_wep_tkip; session->enable_bcast_probe_rsp = sme_join_req->enable_bcast_probe_rsp; diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index 832db87f98c4..325753fdd728 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1828,6 +1828,9 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, populate_dot11f_ht_caps(mac_ctx, pe_session, &frm->HTCaps); QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, &frm->HTCaps, sizeof(frm->HTCaps)); + } else if (pe_session->he_with_wep_tkip) { + pe_debug("Populate HT Caps in Assoc Request with WEP/TKIP"); + populate_dot11f_ht_caps(mac_ctx, NULL, &frm->HTCaps); } pe_debug("SupportedChnlWidth: %d, mimoPS: %d, GF: %d, short GI20:%d, shortGI40: %d, dsssCck: %d, AMPDU Param: %x", frm->HTCaps.supportedChannelWidthSet, @@ -1850,7 +1853,11 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, populate_dot11f_operating_mode(mac_ctx, &frm->OperatingMode, pe_session); } + } else if (pe_session->he_with_wep_tkip) { + pe_debug("Populate VHT IEs in Assoc Request with WEP/TKIP"); + populate_dot11f_vht_caps(mac_ctx, NULL, &frm->VHTCaps); } + if (!vht_enabled && pe_session->is_vendor_specific_vhtcaps) { pe_debug("Populate Vendor VHT IEs in Assoc Request"); @@ -1878,6 +1885,9 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, pe_debug("Populate HE IEs"); populate_dot11f_he_caps(mac_ctx, pe_session, &frm->he_cap); + } else if (pe_session->he_with_wep_tkip) { + pe_debug("Populate HE IEs in Assoc Request with WEP/TKIP"); + populate_dot11f_he_caps(mac_ctx, NULL, &frm->he_cap); } if (pe_session->pLimJoinReq->is11Rconnection) { diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 6fd52099e98d..fcb297d51dd1 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1354,6 +1354,7 @@ typedef struct tagCsrConfigParam { uint32_t btm_max_attempt_cnt; uint32_t btm_sticky_time; uint32_t offload_11k_enable_bitmask; + bool wep_tkip_in_he; struct csr_neighbor_report_offload_params neighbor_report_offload; } tCsrConfigParam; diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 871674fce056..dc3984a473d5 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -621,6 +621,7 @@ struct csr_config { uint32_t btm_max_attempt_cnt; uint32_t btm_sticky_time; uint32_t offload_11k_enable_bitmask; + bool wep_tkip_in_he; struct csr_neighbor_report_offload_params neighbor_report_offload; }; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 74486307c519..56b8e744353e 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -2591,6 +2591,7 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pMac->roam.configParam.AdHocChannel5G = pParam->AdHocChannel5G; pMac->roam.configParam.bandCapability = pParam->bandCapability; pMac->roam.configParam.cbChoice = pParam->cbChoice; + pMac->roam.configParam.wep_tkip_in_he = pParam->wep_tkip_in_he; pMac->roam.configParam.neighborRoamConfig. delay_before_vdev_stop = pParam->neighborRoamConfig.delay_before_vdev_stop; @@ -3205,6 +3206,7 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) #endif pParam->enable_tx_ldpc = cfg_params->tx_ldpc_enable; pParam->enable_rx_ldpc = cfg_params->rx_ldpc_enable; + pParam->wep_tkip_in_he = cfg_params->wep_tkip_in_he; pParam->disable_high_ht_mcs_2x2 = cfg_params->disable_high_ht_mcs_2x2; pParam->max_amsdu_num = cfg_params->max_amsdu_num; pParam->nSelect5GHzMargin = cfg_params->nSelect5GHzMargin; @@ -13131,7 +13133,8 @@ enum csr_cfgdot11mode curr_mode = mac_ctx->roam.configParam.uCfgDot11Mode; && (profile->EncryptionType.encryptionType[0] == eCSR_ENCRYPT_TYPE_NONE))) && ((eCSR_CFG_DOT11_MODE_11N == cfg_dot11_mode) || - (eCSR_CFG_DOT11_MODE_11AC == cfg_dot11_mode))) { + (eCSR_CFG_DOT11_MODE_11AC == cfg_dot11_mode) || + (eCSR_CFG_DOT11_MODE_11AX == cfg_dot11_mode))) { /* We cannot do 11n here */ if (WLAN_REG_IS_24GHZ_CH(opr_chn)) cfg_dot11_mode = eCSR_CFG_DOT11_MODE_11G; @@ -15279,6 +15282,10 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, } } + if (!CSR_IS_11n_ALLOWED(pProfile->negotiatedUCEncryptionType)) + csr_join_req->he_with_wep_tkip = + pMac->roam.configParam.wep_tkip_in_he; + csr_join_req->UCEncryptionType = csr_translate_encrypt_type_to_ed_type (pProfile->negotiatedUCEncryptionType);