Prechádzať zdrojové kódy

qcacld-3.0: Save operational rate to vdev mlme legacy object

For STA+P2P GO case, DUT sets operational rates when connecting to AP
as STA, and overwrites it when DUT forming P2P connection as P2P GO.
So, add this change to save operational rates to vdev mlme legacy
object, and avoid to overwrite for other inferfaces.

Change-Id: I2bfbecbc9bc50b8943b1e3de516782e70b125ce2
CRs-Fixed: 2773943
Wu Gao 4 rokov pred
rodič
commit
f4e2f4b9d7

+ 14 - 1
components/mlme/core/inc/wlan_mlme_main.h

@@ -165,6 +165,8 @@ struct wlan_mlme_roam {
  * @roam_reason_better_ap: roam due to better AP found
  * @better_ap_hb_failure_rssi: heartbeat failure AP RSSI
  * @fils_con_info: Pointer to fils connection info from csr roam profile
+ * @opr_rate_set: operational rates set
+ * @ext_opr_rate_set: extended operational rates set
  */
 struct mlme_legacy_priv {
 	bool chan_switch_in_progress;
@@ -190,10 +192,21 @@ struct mlme_legacy_priv {
 #ifdef WLAN_FEATURE_FILS_SK
 	struct wlan_fils_connection_info *fils_con_info;
 #endif
+	struct mlme_cfg_str opr_rate_set;
+	struct mlme_cfg_str ext_opr_rate_set;
 };
 
+
+/**
+ * mlme_init_rate_config() - initialize rate configuration of vdev
+ * @vdev_mlme: pointer to vdev mlme object
+ *
+ * Return: Success or Failure status
+ */
+QDF_STATUS mlme_init_rate_config(struct vdev_mlme_obj *vdev_mlme);
+
 /**
- * wma_get_peer_mic_len() - get mic hdr len and mic length for peer
+ * mlme_get_peer_mic_len() - get mic hdr len and mic length for peer
  * @psoc: psoc
  * @pdev_id: pdev id for the peer
  * @peer_mac: peer mac

+ 18 - 4
components/mlme/core/src/wlan_mlme_main.c

@@ -118,6 +118,24 @@ uint8_t *mlme_get_dynamic_oce_flags(struct wlan_objmgr_vdev *vdev)
 	return &mlme_priv->sta_dynamic_oce_value;
 }
 
+QDF_STATUS mlme_init_rate_config(struct vdev_mlme_obj *vdev_mlme)
+{
+	struct mlme_legacy_priv *mlme_priv;
+
+	mlme_priv = vdev_mlme->ext_vdev_ptr;
+	if (!mlme_priv) {
+		mlme_legacy_err("vdev legacy private object is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	mlme_priv->opr_rate_set.max_len = CFG_OPERATIONAL_RATE_SET_LEN;
+	mlme_priv->opr_rate_set.len = 0;
+	mlme_priv->ext_opr_rate_set.max_len = CFG_OPERATIONAL_RATE_SET_LEN;
+	mlme_priv->ext_opr_rate_set.len = 0;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 QDF_STATUS mlme_get_peer_mic_len(struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
 				 uint8_t *peer_mac, uint8_t *mic_len,
 				 uint8_t *mic_hdr_len)
@@ -887,10 +905,6 @@ static void mlme_init_rates_in_cfg(struct wlan_objmgr_psoc *psoc,
 			      rates->supported_11a.data,
 			      sizeof(rates->supported_11a.data),
 			      &rates->supported_11a.len);
-	rates->opr_rate_set.max_len = CFG_OPERATIONAL_RATE_SET_LEN;
-	rates->opr_rate_set.len = 0;
-	rates->ext_opr_rate_set.max_len = CFG_EXTENDED_OPERATIONAL_RATE_SET_LEN;
-	rates->ext_opr_rate_set.len = 0;
 	rates->supported_mcs_set.max_len = CFG_SUPPORTED_MCS_SET_LEN;
 	qdf_uint8_array_parse(cfg_default(CFG_SUPPORTED_MCS_SET),
 			      rates->supported_mcs_set.data,

+ 1 - 0
components/mlme/core/src/wlan_mlme_vdev_mgr_interface.c

@@ -1071,6 +1071,7 @@ QDF_STATUS vdevmgr_mlme_ext_hdl_create(struct vdev_mlme_obj *vdev_mlme)
 		return QDF_STATUS_E_NOMEM;
 	}
 
+	mlme_init_rate_config(vdev_mlme);
 	vdev_mlme->ext_vdev_ptr->fils_con_info = NULL;
 
 	sme_get_vdev_type_nss(wlan_vdev_mlme_get_opmode(vdev_mlme->vdev),

+ 44 - 0
components/mlme/dispatcher/inc/wlan_mlme_api.h

@@ -2950,4 +2950,48 @@ wlan_mlme_set_usr_disabled_roaming(struct wlan_objmgr_psoc *psoc, bool val);
  */
 QDF_STATUS
 wlan_mlme_get_usr_disabled_roaming(struct wlan_objmgr_psoc *psoc, bool *val);
+
+/**
+ * mlme_get_opr_rate() - get operational rate
+ * @vdev: vdev pointer
+ * @dst: pointer to get operational rate
+ * @len: length of operational rate
+ *
+ * Return: QDF_SUCCESS if success
+ */
+QDF_STATUS mlme_get_opr_rate(struct wlan_objmgr_vdev *vdev, uint8_t *dst,
+			     qdf_size_t *len);
+
+/**
+ * mlme_set_opr_rate() - set operational rate
+ * @vdev: vdev pointer
+ * @src: pointer to set operational rate
+ * @len: length of operational rate
+ *
+ * Return: QDF_SUCCESS if success
+ */
+QDF_STATUS mlme_set_opr_rate(struct wlan_objmgr_vdev *vdev, uint8_t *src,
+			     qdf_size_t len);
+
+/**
+ * mlme_get_ext_opr_rate() - get extended operational rate
+ * @vdev: vdev pointer
+ * @dst: pointer to get extended operational rate
+ * @len: length of extended operational rate
+ *
+ * Return: QDF_SUCCESS if success
+ */
+QDF_STATUS mlme_get_ext_opr_rate(struct wlan_objmgr_vdev *vdev, uint8_t *dst,
+				 qdf_size_t *len);
+
+/**
+ * mlme_set_ext_opr_rate() - set extended operational rate
+ * @vdev: vdev pointer
+ * @src: pointer to set extended operational rate
+ * @len: length of extended operational rate
+ *
+ * Return: QDF_SUCCESS if success
+ */
+QDF_STATUS mlme_set_ext_opr_rate(struct wlan_objmgr_vdev *vdev, uint8_t *src,
+				 qdf_size_t len);
 #endif /* _WLAN_MLME_API_H_ */

+ 0 - 4
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1009,8 +1009,6 @@ struct mlme_tgt_caps {
  * @disable_high_ht_mcs_2x2: disable high mcs for 2x2 info
  * @supported_11b: supported 11B rates
  * @supported_11a: supported 11A rates
- * @opr_rate_set: operational rates set
- * @ext_opr_rate_set: extended operational rates set
  * @supported_mcs_set: supported MCS set
  * @basic_mcs_set: basic MCS set
  * @current_mcs_set: current MCS set
@@ -1024,8 +1022,6 @@ struct wlan_mlme_rates {
 	uint8_t disable_high_ht_mcs_2x2;
 	struct mlme_cfg_str supported_11b;
 	struct mlme_cfg_str supported_11a;
-	struct mlme_cfg_str opr_rate_set;
-	struct mlme_cfg_str ext_opr_rate_set;
 	struct mlme_cfg_str supported_mcs_set;
 	struct mlme_cfg_str basic_mcs_set;
 	struct mlme_cfg_str current_mcs_set;

+ 16 - 10
components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -2723,26 +2723,32 @@ ucfg_mlme_set_11d_enabled(struct wlan_objmgr_psoc *psoc, bool value)
 }
 
 /**
- * ucfg_mlme_get_opr_rate_set() - Get operational rate set
- * @psoc: pointer to psoc object
+ * ucfg_mlme_get_opr_rate() - Get operational rate set
+ * @psoc: pointer to vdev object
  * @buf: buffer to get rates set
  * @len: length of the buffer
  * Return: QDF Status
  */
-QDF_STATUS
-ucfg_mlme_get_opr_rate_set(struct wlan_objmgr_psoc *psoc, uint8_t *buf,
-			   qdf_size_t *len);
+static inline QDF_STATUS
+ucfg_mlme_get_opr_rate(struct wlan_objmgr_vdev *vdev, uint8_t *buf,
+		       qdf_size_t *len)
+{
+	return mlme_get_opr_rate(vdev, buf, len);
+}
 
 /**
- * ucfg_mlme_get_ext_opr_rate_set() - Get operational rate set
- * @psoc: pointer to psoc object
+ * ucfg_mlme_get_ext_opr_rate() - Get extended operational rate set
+ * @psoc: pointer to vdev object
  * @buf: buffer to get rates set
  * @len: length of the buffer
  * Return: QDF Status
  */
-QDF_STATUS
-ucfg_mlme_get_ext_opr_rate_set(struct wlan_objmgr_psoc *psoc, uint8_t *buf,
-			       qdf_size_t *len);
+static inline QDF_STATUS
+ucfg_mlme_get_ext_opr_rate(struct wlan_objmgr_vdev *vdev, uint8_t *buf,
+			   qdf_size_t *len)
+{
+	return mlme_get_ext_opr_rate(vdev, buf, len);
+}
 
 /**
  * ucfg_mlme_get_supported_mcs_set() - Get Supported MCS set

+ 112 - 0
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -4514,3 +4514,115 @@ wlan_mlme_get_usr_disabled_roaming(struct wlan_objmgr_psoc *psoc, bool *val)
 
 	return QDF_STATUS_SUCCESS;
 }
+
+QDF_STATUS mlme_get_opr_rate(struct wlan_objmgr_vdev *vdev, uint8_t *dst,
+			     qdf_size_t *len)
+{
+	struct mlme_legacy_priv *mlme_priv;
+
+	if (!vdev || !dst || !len) {
+		mlme_legacy_err("invalid params");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		mlme_legacy_err("vdev legacy private object is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (*len < mlme_priv->opr_rate_set.len) {
+		mlme_legacy_err("Invalid len %zd, opr_rate len %zd",
+				*len, mlme_priv->opr_rate_set.len);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	*len = mlme_priv->opr_rate_set.len;
+	qdf_mem_copy(dst, mlme_priv->opr_rate_set.data, *len);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS mlme_set_opr_rate(struct wlan_objmgr_vdev *vdev, uint8_t *src,
+			     qdf_size_t len)
+{
+	struct mlme_legacy_priv *mlme_priv;
+
+	if (!vdev || !src) {
+		mlme_legacy_err("invalid params");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		mlme_legacy_err("vdev legacy private object is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (len > mlme_priv->opr_rate_set.max_len) {
+		mlme_legacy_err("Invalid len %zd (>%zd)", len,
+				mlme_priv->opr_rate_set.max_len);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	mlme_priv->opr_rate_set.len = len;
+	qdf_mem_copy(mlme_priv->opr_rate_set.data, src, len);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS mlme_get_ext_opr_rate(struct wlan_objmgr_vdev *vdev, uint8_t *dst,
+			     qdf_size_t *len)
+{
+	struct mlme_legacy_priv *mlme_priv;
+
+	if (!vdev || !dst || !len) {
+		mlme_legacy_err("invalid params");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		mlme_legacy_err("vdev legacy private object is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (*len < mlme_priv->ext_opr_rate_set.len) {
+		mlme_legacy_err("Invalid len %zd, ext_opr_rate len %zd",
+				*len, mlme_priv->ext_opr_rate_set.len);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	*len = mlme_priv->ext_opr_rate_set.len;
+	qdf_mem_copy(dst, mlme_priv->ext_opr_rate_set.data, *len);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS mlme_set_ext_opr_rate(struct wlan_objmgr_vdev *vdev, uint8_t *src,
+			     qdf_size_t len)
+{
+	struct mlme_legacy_priv *mlme_priv;
+
+	if (!vdev || !src) {
+		mlme_legacy_err("invalid params");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		mlme_legacy_err("vdev legacy private object is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (len > mlme_priv->ext_opr_rate_set.max_len) {
+		mlme_legacy_err("Invalid len %zd (>%zd)", len,
+				mlme_priv->ext_opr_rate_set.max_len);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	mlme_priv->ext_opr_rate_set.len = len;
+	qdf_mem_copy(mlme_priv->ext_opr_rate_set.data, src, len);
+
+	return QDF_STATUS_SUCCESS;
+}

+ 0 - 28
components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c

@@ -1087,34 +1087,6 @@ ucfg_mlme_is_ese_enabled(struct wlan_objmgr_psoc *psoc, bool *val)
 }
 #endif /* FEATURE_WLAN_ESE */
 
-QDF_STATUS
-ucfg_mlme_get_opr_rate_set(struct wlan_objmgr_psoc *psoc,
-			   uint8_t *buf, qdf_size_t *len)
-{
-	struct wlan_mlme_psoc_ext_obj *mlme_obj;
-
-	mlme_obj = mlme_get_psoc_ext_obj(psoc);
-	if (!mlme_obj)
-		return QDF_STATUS_E_INVAL;
-
-	return wlan_mlme_get_cfg_str(buf, &mlme_obj->cfg.rates.opr_rate_set,
-				     len);
-}
-
-QDF_STATUS
-ucfg_mlme_get_ext_opr_rate_set(struct wlan_objmgr_psoc *psoc,
-			       uint8_t *buf, qdf_size_t *len)
-{
-	struct wlan_mlme_psoc_ext_obj *mlme_obj;
-
-	mlme_obj = mlme_get_psoc_ext_obj(psoc);
-	if (!mlme_obj)
-		return QDF_STATUS_E_INVAL;
-
-	return wlan_mlme_get_cfg_str(buf, &mlme_obj->cfg.rates.ext_opr_rate_set,
-				     len);
-}
-
 QDF_STATUS
 ucfg_mlme_get_supported_mcs_set(struct wlan_objmgr_psoc *psoc,
 				uint8_t *buf, qdf_size_t *len)

+ 1 - 1
core/hdd/src/wlan_hdd_station_info.c

@@ -436,7 +436,7 @@ static void hdd_get_max_tx_bitrate(struct hdd_context *hdd_ctx,
 			tx_nss--;
 		}
 	}
-	if (hdd_report_max_rate(hdd_ctx->mac_handle, &sinfo.txrate,
+	if (hdd_report_max_rate(adapter, hdd_ctx->mac_handle, &sinfo.txrate,
 				sinfo.signal, tx_rate_flags, tx_mcs_index,
 				my_tx_rate, tx_nss)) {
 		hdd_sta_ctx->cache_conn_info.max_tx_bitrate = sinfo.txrate;

+ 21 - 8
core/hdd/src/wlan_hdd_stats.c

@@ -4551,7 +4551,8 @@ static void wlan_hdd_fill_os_rate_info(enum tx_rate_info rate_flags,
 		os_rate->flags |= RATE_INFO_FLAGS_SHORT_GI;
 }
 
-bool hdd_report_max_rate(mac_handle_t mac_handle,
+bool hdd_report_max_rate(struct hdd_adapter *adapter,
+			 mac_handle_t mac_handle,
 			 struct rate_info *rate,
 			 int8_t signal,
 			 enum tx_rate_info rate_flags,
@@ -4580,6 +4581,7 @@ bool hdd_report_max_rate(mac_handle_t mac_handle,
 	int link_speed_rssi_mid = 0;
 	int link_speed_rssi_low = 0;
 	uint32_t link_speed_rssi_report = 0;
+	struct wlan_objmgr_vdev *vdev;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	if (!hdd_ctx) {
@@ -4622,10 +4624,17 @@ bool hdd_report_max_rate(mac_handle_t mac_handle,
 
 	max_rate = 0;
 
+	vdev = hdd_objmgr_get_vdev(adapter);
+	if (!vdev) {
+		hdd_err("failed to get vdev");
+		return false;
+	}
+
 	/* Get Basic Rate Set */
-	if (0 != ucfg_mlme_get_opr_rate_set(hdd_ctx->psoc,
-					    operational_rates, &or_leng)) {
+	if (0 != ucfg_mlme_get_opr_rate(vdev, operational_rates,
+					&or_leng)) {
 		hdd_err("cfg get returned failure");
+		hdd_objmgr_put_vdev(vdev);
 		/*To keep GUI happy */
 		return false;
 	}
@@ -4647,14 +4656,16 @@ bool hdd_report_max_rate(mac_handle_t mac_handle,
 	}
 
 	/* Get Extended Rate Set */
-	if (0 != ucfg_mlme_get_ext_opr_rate_set(hdd_ctx->psoc,
-						extended_rates,
-						&er_leng)) {
+	if (0 != ucfg_mlme_get_ext_opr_rate(vdev, extended_rates,
+					    &er_leng)) {
 		hdd_err("cfg get returned failure");
+		hdd_objmgr_put_vdev(vdev);
 		/*To keep GUI happy */
 		return false;
 	}
 
+	hdd_objmgr_put_vdev(vdev);
+
 	for (i = 0; i < er_leng; i++) {
 		for (j = 0; j < ARRAY_SIZE(supported_data_rate); j++) {
 			if (supported_data_rate[j].beacon_rate_index ==
@@ -5099,14 +5110,16 @@ static int wlan_hdd_get_sta_stats(struct wiphy *wiphy,
 
 		hdd_check_and_update_nss(hdd_ctx, &tx_nss_max, &rx_nss_max);
 
-		tx_rate_calc = hdd_report_max_rate(mac_handle, &sinfo->txrate,
+		tx_rate_calc = hdd_report_max_rate(adapter, mac_handle,
+						   &sinfo->txrate,
 						   sinfo->signal,
 						   tx_rate_flags,
 						   tx_mcs_index,
 						   my_tx_rate,
 						   tx_nss_max);
 
-		rx_rate_calc = hdd_report_max_rate(mac_handle, &sinfo->rxrate,
+		rx_rate_calc = hdd_report_max_rate(adapter, mac_handle,
+						   &sinfo->rxrate,
 						   sinfo->signal,
 						   rx_rate_flags,
 						   rx_mcs_index,

+ 3 - 2
core/hdd/src/wlan_hdd_stats.h

@@ -493,7 +493,7 @@ void wlan_hdd_display_txrx_stats(struct hdd_context *hdd_ctx);
 /**
  * hdd_report_max_rate() - Fill the max rate stats in the station info structure
  * to be sent to the userspace.
- *
+ * @adapter: pointer to adapter
  * @mac_handle: The mac handle
  * @rate: The station_info tx/rx rate to be filled
  * @signal: signal from station_info
@@ -504,7 +504,8 @@ void wlan_hdd_display_txrx_stats(struct hdd_context *hdd_ctx);
  *
  * Return: True if fill is successful
  */
-bool hdd_report_max_rate(mac_handle_t mac_handle,
+bool hdd_report_max_rate(struct hdd_adapter *adapter,
+			 mac_handle_t mac_handle,
 			 struct rate_info *rate,
 			 int8_t signal,
 			 enum tx_rate_info rate_flags,

+ 7 - 4
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -620,10 +620,13 @@ populate_dot11f_ext_supp_rates(struct mac_context *mac, uint8_t nChannelNum,
 			pe_err("no session context exists while populating Operational Rate Set");
 		}
 	} else if (HIGHEST_24GHZ_CHANNEL_NUM >= nChannelNum) {
-		nRates = mac->mlme_cfg->rates.ext_opr_rate_set.len;
-		nsir_status = wlan_mlme_get_cfg_str(
-			rates,
-			&mac->mlme_cfg->rates.ext_opr_rate_set, &nRates);
+		if (!pe_session) {
+			pe_err("null pe_session");
+			return QDF_STATUS_E_INVAL;
+		}
+		nRates = WLAN_SUPPORTED_RATES_IE_MAX_LEN;
+		nsir_status = mlme_get_ext_opr_rate(pe_session->vdev, rates,
+						    &nRates);
 		if (QDF_IS_STATUS_ERROR(nsir_status)) {
 			nRates = 0;
 			pe_err("Failed to retrieve nItem from CFG status: %d",

+ 33 - 16
core/sme/src/csr/csr_api_roam.c

@@ -4672,7 +4672,8 @@ static QDF_STATUS csr_get_rate_set(struct mac_context *mac,
 static void csr_set_cfg_rate_set(struct mac_context *mac, eCsrPhyMode phyMode,
 				 struct csr_roam_profile *pProfile,
 				 struct bss_description *bss_desc,
-				 tDot11fBeaconIEs *pIes)
+				 tDot11fBeaconIEs *pIes,
+				 uint32_t session_id)
 {
 	int i;
 	uint8_t *pDstRate;
@@ -4686,6 +4687,7 @@ static void csr_set_cfg_rate_set(struct mac_context *mac, eCsrPhyMode phyMode,
 	qdf_size_t ExtendedOperationalRatesLength = 0;
 	uint8_t MCSRateIdxSet[SIZE_OF_SUPPORTED_MCS_SET];
 	qdf_size_t MCSRateLength = 0;
+	struct wlan_objmgr_vdev *vdev;
 
 	QDF_ASSERT(pIes);
 	if (pIes) {
@@ -4757,12 +4759,19 @@ static void csr_set_cfg_rate_set(struct mac_context *mac, eCsrPhyMode phyMode,
 			}
 		}
 		/* Set the operational rate set CFG variables... */
-		wlan_mlme_set_cfg_str(OperationalRates,
-				      &mac->mlme_cfg->rates.opr_rate_set,
-				      OperationalRatesLength);
-		wlan_mlme_set_cfg_str(ExtendedOperationalRates,
-				      &mac->mlme_cfg->rates.ext_opr_rate_set,
-				      ExtendedOperationalRatesLength);
+		vdev = wlan_objmgr_get_vdev_by_id_from_pdev(
+						mac->pdev, session_id,
+						WLAN_LEGACY_SME_ID);
+		if (vdev) {
+			mlme_set_opr_rate(vdev, OperationalRates,
+					  OperationalRatesLength);
+			mlme_set_ext_opr_rate(vdev, ExtendedOperationalRates,
+					      ExtendedOperationalRatesLength);
+			wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
+		} else {
+			sme_err("null vdev");
+		}
+
 		wlan_mlme_set_cfg_str(MCSRateIdxSet,
 				      &mac->mlme_cfg->rates.current_mcs_set,
 				      MCSRateLength);
@@ -4772,7 +4781,8 @@ static void csr_set_cfg_rate_set(struct mac_context *mac, eCsrPhyMode phyMode,
 }
 
 static void csr_set_cfg_rate_set_from_profile(struct mac_context *mac,
-					      struct csr_roam_profile *pProfile)
+					      struct csr_roam_profile *pProfile,
+					      uint32_t session_id)
 {
 	tSirMacRateSetIE DefaultSupportedRates11a = { WLAN_ELEMID_RATES,
 						      {8,
@@ -4800,6 +4810,7 @@ static void csr_set_cfg_rate_set_from_profile(struct mac_context *mac,
 				[CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX];
 	qdf_size_t ExtendedOperationalRatesLength = 0;
 	uint32_t bss_op_ch_freq = 0;
+	struct wlan_objmgr_vdev *vdev;
 
 	if (pProfile->ChannelInfo.freq_list)
 		bss_op_ch_freq = pProfile->ChannelInfo.freq_list[0];
@@ -4854,12 +4865,18 @@ static void csr_set_cfg_rate_set_from_profile(struct mac_context *mac,
 	}
 
 	/* Set the operational rate set CFG variables... */
-	wlan_mlme_set_cfg_str(OperationalRates,
-			      &mac->mlme_cfg->rates.opr_rate_set,
-			      OperationalRatesLength);
-	wlan_mlme_set_cfg_str(ExtendedOperationalRates,
-			      &mac->mlme_cfg->rates.ext_opr_rate_set,
-			      ExtendedOperationalRatesLength);
+	vdev = wlan_objmgr_get_vdev_by_id_from_pdev(mac->pdev,
+						    session_id,
+						    WLAN_LEGACY_SME_ID);
+	if (vdev) {
+		mlme_set_opr_rate(vdev, OperationalRates,
+				  OperationalRatesLength);
+		mlme_set_ext_opr_rate(vdev, ExtendedOperationalRates,
+				      ExtendedOperationalRatesLength);
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
+	} else {
+		sme_err("null vdev");
+	}
 }
 
 static void csr_roam_ccm_cfg_set_callback(struct mac_context *mac,
@@ -4956,9 +4973,9 @@ QDF_STATUS csr_roam_set_bss_config_cfg(struct mac_context *mac, uint32_t session
 	/* Fixed Rate */
 	if (bss_desc)
 		csr_set_cfg_rate_set(mac, (eCsrPhyMode) pProfile->phyMode,
-				     pProfile, bss_desc, pIes);
+				     pProfile, bss_desc, pIes, sessionId);
 	else
-		csr_set_cfg_rate_set_from_profile(mac, pProfile);
+		csr_set_cfg_rate_set_from_profile(mac, pProfile, sessionId);
 
 	mac->mlme_cfg->timeouts.join_failure_timeout =
 		pBssConfig->uJoinTimeOut;