diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index f5a4f97fc923..a3989b890157 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -1017,6 +1017,7 @@ typedef struct sSirSmeJoinRsp { uint32_t assocReqLength; uint32_t assocRspLength; uint32_t parsedRicRspLen; + uint8_t uapsd_mask; #ifdef FEATURE_WLAN_ESE uint32_t tspecIeLen; #endif diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index c680d45d6455..1c6f44e1a2f0 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -508,7 +508,7 @@ lim_send_sme_join_reassoc_rsp(struct mac_context *mac_ctx, uint16_t msg_type, #endif lim_handle_join_rsp_status(mac_ctx, session_entry, result_code, sme_join_rsp); - + sme_join_rsp->uapsd_mask = session_entry->gUapsdPerAcBitmask; /* Send supported NSS 1x1 to SME */ sme_join_rsp->supported_nss_1x1 = session_entry->supported_nss_1x1; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index f5df77eab9f2..fd1a1206be2a 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -7054,6 +7054,8 @@ static void csr_roam_process_join_res(struct mac_context *mac_ctx, acm_mask = sme_qos_get_acm_mask(mac_ctx, bss_desc, NULL); #endif conn_profile->acm_mask = acm_mask; + conn_profile->modifyProfileFields.uapsd_mask = + join_rsp->uapsd_mask; /* * start UAPSD if uapsd_mask is not 0 because HDD will * configure for trigger frame It may be better to let QoS do @@ -14301,51 +14303,24 @@ csr_check_vendor_ap_3_present(struct mac_context *mac_ctx, uint8_t *ie, * csr_enable_twt() - Check if its allowed to enable twt for this session * @ie: pointer to beacon/probe resp ie's * - * TWT is allowed only if device is in 11ax mode or if QCN ie present. + * TWT is allowed only if device is in 11ax mode and peer supports + * TWT responder or if QCN ie present. * * Return: true or flase */ -static bool csr_enable_twt(tDot11fBeaconIEs *ie) +static bool csr_enable_twt(struct mac_context *mac_ctx, tDot11fBeaconIEs *ie) { - if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX)) - return true; - if (!ie) { - sme_debug("Beacon ie buffer is null"); - return false; - } - - return ie->QCN_IE.present; -} - -/** - * csr_enable_uapsd() - Used to disable uapsd if both twt and uapsd is enabled - * @mac_ctx: pointer to global mac structure - * @ie: pointer to beacon/probe resp ie's - * - * Return: true or flase - */ -static bool csr_enable_uapsd(struct mac_context *mac_ctx, tDot11fBeaconIEs *ie) -{ - /* In non-HE case, TWT is enabled only for Q2Q. - * So keed uAPSD enabled for non-Q2Q in this non-HE case. - */ - if (!csr_enable_twt(ie)) - return true; - - if (!ie) { - sme_debug("Beacon ie buffer is null"); + if ((IS_FEATURE_SUPPORTED_BY_FW(DOT11AX) || + mac_ctx->mlme_cfg->twt_cfg.is_twt_requestor_enabled) && ie && + (ie->QCN_IE.present || ie->he_cap.twt_responder)) { + sme_debug("TWT is supported, hence disable UAPSD; twt req supp: %d,twt respon supp: %d, QCN_IE: %d", + mac_ctx->mlme_cfg->twt_cfg.is_twt_requestor_enabled, + ie->he_cap.twt_responder, + ie->QCN_IE.present); return true; } - - if ((mac_ctx->mlme_cfg->twt_cfg.is_twt_requestor_enabled || - IS_FEATURE_SUPPORTED_BY_FW(DOT11AX)) && - ie->he_cap.twt_responder) { - sme_debug("twt supported, disable uapsd"); - return false; - } - - return true; + return false; } /** @@ -14633,8 +14608,8 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, (eCsrPhyMode) pProfile->phyMode, pBssDescription, pIes, &OpRateSet, &ExRateSet); - ps_param->uapsd_per_ac_bit_mask = - pProfile->uapsd_mask; + if (!csr_enable_twt(mac, pIes)) + ps_param->uapsd_per_ac_bit_mask = pProfile->uapsd_mask; if (QDF_IS_STATUS_SUCCESS(status)) { /* OperationalRateSet */ if (OpRateSet.numRates) { @@ -15148,8 +15123,8 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, csr_join_req->supportedChannels.channelList, &csr_join_req->supportedChannels.numChnl, false); - - if (csr_enable_uapsd(mac, pIes)) + /* Enable UAPSD only if TWT is not supported */ + if (!csr_enable_twt(mac, pIes)) csr_join_req->uapsdPerAcBitmask = pProfile->uapsd_mask; /* Move the entire BssDescription into the join request. */ qdf_mem_copy(&csr_join_req->bssDescription, pBssDescription, @@ -15204,7 +15179,8 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, csr_join_req->enable_bcast_probe_rsp = mac->mlme_cfg->oce.enable_bcast_probe_rsp; - csr_join_req->enable_session_twt_support = csr_enable_twt(pIes); + csr_join_req->enable_session_twt_support = csr_enable_twt(mac, + pIes); status = umac_send_mb_message_to_mac(csr_join_req); if (!QDF_IS_STATUS_SUCCESS(status)) { /*