diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 0fdd147dc38b..1f0fcc54c67f 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -6665,10 +6665,19 @@ static int drv_cmd_set_antenna_mode(hdd_adapter_t *adapter, goto exit; } - hdd_info("Successfully switched to mode: %d x %d", mode, mode); - ret = 0; hdd_ctx->current_antenna_mode = mode; + /* Update the user requested nss in the mac context. + * This will be used in tdls protocol engine to form tdls + * Management frames. + */ + sme_update_user_configured_nss( + hdd_ctx->hHal, + hdd_ctx->current_antenna_mode); + hdd_info("Successfully switched to mode: %d x %d", + hdd_ctx->current_antenna_mode, + hdd_ctx->current_antenna_mode); + ret = 0; exit: hdd_info("Set antenna status: %d current mode: %d", ret, hdd_ctx->current_antenna_mode); diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index ec52065e6b7d..71d374198679 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -1084,6 +1084,7 @@ typedef struct sAniSirGlobal { bool first_scan_done; int8_t first_scan_bucket_threshold; enum auth_tx_ack_status auth_ack_status; + uint8_t user_configured_nss; } tAniSirGlobal; typedef enum { diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 95651285d9f1..30c679faac14 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -548,6 +548,7 @@ static void populate_dot11f_tdls_ht_vht_cap(tpAniSirGlobal pMac, else nss = pMac->vdev_type_nss_2g.tdls; + nss = QDF_MIN(nss, pMac->user_configured_nss); if (IS_DOT11_MODE_HT(selfDot11Mode)) { /* Include HT Capability IE */ populate_dot11f_ht_caps(pMac, NULL, htCap); @@ -2266,6 +2267,9 @@ lim_tdls_populate_matching_rate_set(tpAniSirGlobal mac_ctx, tpDphHashNode stads, nss = mac_ctx->vdev_type_nss_5g.tdls; else nss = mac_ctx->vdev_type_nss_2g.tdls; + + nss = QDF_MIN(nss, mac_ctx->user_configured_nss); + /* compute the matching MCS rate set, if peer is 11n capable and self mode is 11n */ #ifdef FEATURE_WLAN_TDLS if (stads->mlmStaContext.htCapability) diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 11557c7b237f..8656fe540dee 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -978,6 +978,7 @@ QDF_STATUS sme_register_mgmt_frame_ind_callback(tHalHandle hal, sir_mgmt_frame_ind_callback callback); QDF_STATUS sme_update_nss(tHalHandle h_hal, uint8_t nss); +void sme_update_user_configured_nss(tHalHandle hal, uint8_t nss); bool sme_is_any_session_in_connected_state(tHalHandle h_hal); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index e7c29daae95f..4495067bd178 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -14459,6 +14459,20 @@ QDF_STATUS sme_update_nss(tHalHandle h_hal, uint8_t nss) return status; } +/** + * sme_update_user_configured_nss() - sets the nss based on user request + * @hal: Pointer to HAL + * @nss: number of streams + * + * Return: None + */ +void sme_update_user_configured_nss(tHalHandle hal, uint8_t nss) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + + mac_ctx->user_configured_nss = nss; +} + /** * sme_set_rssi_threshold_breached_cb() - set rssi threshold breached callback * @hal: global hal handle