diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 281bfe44c04d..88677edee8f5 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -1266,7 +1266,8 @@ struct policy_mgr_sme_cbacks { QDF_STATUS (*sme_pdev_set_hw_mode)(struct policy_mgr_hw_mode msg); QDF_STATUS (*sme_pdev_set_pcl)(struct policy_mgr_pcl_list *msg); QDF_STATUS (*sme_nss_update_request)(uint32_t vdev_id, - uint8_t new_nss, policy_mgr_nss_update_cback cback, + uint8_t new_nss, uint8_t ch_width, + policy_mgr_nss_update_cback cback, uint8_t next_action, struct wlan_objmgr_psoc *psoc, enum policy_mgr_conn_update_reason reason, uint32_t original_vdev_id); diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c index 29cfeaa8b813..b22f581b1a13 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c @@ -2763,12 +2763,15 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, uint32_t vdev_id; uint32_t original_nss, ch_freq; struct policy_mgr_psoc_priv_obj *pm_ctx; + enum phy_ch_width ch_width = CH_WIDTH_MAX; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid Context"); return status; } + if (next_action == PM_DBS2 && band == POLICY_MGR_BAND_5) + ch_width = CH_WIDTH_40MHZ; count = policy_mgr_mode_specific_connection_count(psoc, PM_P2P_GO_MODE, list); @@ -2794,7 +2797,7 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, (band == POLICY_MGR_BAND_5 && WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq)))) { status = pm_ctx->sme_cbacks.sme_nss_update_request( - vdev_id, new_nss, + vdev_id, new_nss, ch_width, policy_mgr_nss_update_cb, next_action, psoc, reason, original_vdev_id); @@ -2828,7 +2831,7 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, (band == POLICY_MGR_BAND_5 && WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq)))) { status = pm_ctx->sme_cbacks.sme_nss_update_request( - vdev_id, new_nss, + vdev_id, new_nss, ch_width, policy_mgr_nss_update_cb, next_action, psoc, reason, original_vdev_id); diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 6678cfb21ddc..a514602a93da 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -4350,12 +4350,14 @@ struct cfg_action_frm_tb_ppdu { * @msgType: nss update msg type * @msgLen: length of the msg * @new_nss: new spatial stream value + * @ch_width: channel width - optional * @vdev_id: session id */ struct sir_nss_update_request { uint16_t msgType; uint16_t msgLen; uint8_t new_nss; + uint8_t ch_width; uint32_t vdev_id; }; 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 f365e4e3bc3a..924556cd8054 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 @@ -5898,6 +5898,11 @@ static void lim_process_nss_update_request(struct mac_context *mac_ctx, if ((nss_update_req_ptr->new_nss == NSS_1x1_MODE) && (session_entry->ch_width > CH_WIDTH_80MHZ)) session_entry->gLimOperatingMode.chanWidth = CH_WIDTH_80MHZ; + if (session_entry->gLimOperatingMode.chanWidth <= CH_WIDTH_160MHZ && + nss_update_req_ptr->ch_width < + session_entry->gLimOperatingMode.chanWidth) + session_entry->gLimOperatingMode.chanWidth = + nss_update_req_ptr->ch_width; pe_debug("ch width %d Rx NSS %d", session_entry->gLimOperatingMode.chanWidth, diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 2d2cdfc12f05..1599bee9ea58 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1707,7 +1707,7 @@ bool sme_is_any_session_in_connected_state(mac_handle_t mac_handle); QDF_STATUS sme_pdev_set_pcl(struct policy_mgr_pcl_list *msg); QDF_STATUS sme_pdev_set_hw_mode(struct policy_mgr_hw_mode msg); QDF_STATUS sme_nss_update_request(uint32_t vdev_id, - uint8_t new_nss, + uint8_t new_nss, uint8_t ch_width, policy_mgr_nss_update_cback cback, uint8_t next_action, struct wlan_objmgr_psoc *psoc, diff --git a/core/sme/inc/sme_inside.h b/core/sme/inc/sme_inside.h index e99dbd7c70aa..27b27ee21b56 100644 --- a/core/sme/inc/sme_inside.h +++ b/core/sme/inc/sme_inside.h @@ -61,6 +61,7 @@ typedef struct sGenericQosCmd { /** * struct s_nss_update_cmd - Format of nss update request * @new_nss: new nss value + * @ch_width: new channel width - optional * @session_id: Session ID * @set_hw_mode_cb: HDD nss update callback * @context: Adapter context @@ -70,6 +71,7 @@ typedef struct sGenericQosCmd { */ struct s_nss_update_cmd { uint32_t new_nss; + uint32_t ch_width; uint32_t session_id; void *nss_update_cb; void *context; diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 13cc5ee605ab..cd8adc947f9a 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -12374,6 +12374,7 @@ QDF_STATUS sme_pdev_set_hw_mode(struct policy_mgr_hw_mode msg) * @mac_handle: Handle returned by macOpen * @vdev_id: the session id * @new_nss: the new nss value + * @ch_width: channel width, optional value * @cback: hdd callback * @next_action: next action to happen at policy mgr after beacon update * @original_vdev_id: original request hwmode change vdev id @@ -12382,7 +12383,8 @@ QDF_STATUS sme_pdev_set_hw_mode(struct policy_mgr_hw_mode msg) * Return: QDF_STATUS_SUCCESS on successful posting */ QDF_STATUS sme_nss_update_request(uint32_t vdev_id, - uint8_t new_nss, policy_mgr_nss_update_cback cback, + uint8_t new_nss, uint8_t ch_width, + policy_mgr_nss_update_cback cback, uint8_t next_action, struct wlan_objmgr_psoc *psoc, enum policy_mgr_conn_update_reason reason, uint32_t original_vdev_id) @@ -12407,6 +12409,7 @@ QDF_STATUS sme_nss_update_request(uint32_t vdev_id, /* Sessionized modules may require this info */ cmd->sessionId = vdev_id; cmd->u.nss_update_cmd.new_nss = new_nss; + cmd->u.nss_update_cmd.ch_width = ch_width; cmd->u.nss_update_cmd.session_id = vdev_id; cmd->u.nss_update_cmd.nss_update_cb = cback; cmd->u.nss_update_cmd.context = psoc; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 67017b05150b..d8154b723fcc 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -21296,6 +21296,7 @@ void csr_process_nss_update_req(struct mac_context *mac, tSmeCmd *command) msg->msgLen = sizeof(*msg); msg->new_nss = command->u.nss_update_cmd.new_nss; + msg->ch_width = command->u.nss_update_cmd.ch_width; msg->vdev_id = command->u.nss_update_cmd.session_id; sme_debug("Posting eWNI_SME_NSS_UPDATE_REQ to PE");