Ver código fonte

qcacld-3.0: Move the logic to get HT and VHT caps in LIM

Move the logic to get HT and VHT caps in LIM from CSR also store
VHT and HT caps in vdev mlme instead of csr session.

Change-Id: I29b8e836a79a4a9eda5088c0eb2e0bf48d616de2
CRs-Fixed: 2807209
gaurank kathpalia 4 anos atrás
pai
commit
6ffb32a5d1

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

@@ -430,6 +430,18 @@ struct mlme_ht_capabilities_info {
 } qdf_packed;
 #endif
 
+/**
+ * struct wlan_ht_config - HT capabilities
+ * @ht_info: ht caps in bitwise
+ * @caps: uint32 caps
+ */
+struct wlan_ht_config {
+	union {
+		struct mlme_ht_capabilities_info ht_caps;
+		uint32_t caps;
+	};
+};
+
 /**
  * struct mlme_ht_param_info - HT AMPDU Parameters Info
  * @reserved: reserved bits
@@ -902,6 +914,54 @@ struct wlan_mlme_vht_caps {
 	struct mlme_vht_capabilities_info vht_cap_info;
 };
 
+/**
+ * struct wlan_vht_config - VHT capabilities
+ * @max_mpdu_len: MPDU length
+ * @supported_channel_widthset: channel width set
+ * @ldpc_coding: LDPC coding capability
+ * @shortgi80: short GI 80 support
+ * @shortgi160and80plus80: short Gi 160 & 80+80 support
+ * @tx_stbc; Tx STBC cap
+ * @tx_stbc: Rx STBC cap
+ * @su_beam_former: SU beam former cap
+ * @su_beam_formee: SU beam formee cap
+ * @csnof_beamformer_antSup: Antenna support for beamforming
+ * @num_soundingdim: Sound dimensions
+ * @mu_beam_former: MU beam former cap
+ * @mu_beam_formee: MU beam formee cap
+ * @vht_txops: TXOP power save
+ * @htc_vhtcap: HTC VHT capability
+ * @max_ampdu_lenexp: AMPDU length
+ * @vht_link_adapt: VHT link adapatation capable
+ */
+struct wlan_vht_config {
+	union {
+		struct {
+			uint32_t           max_mpdu_len:2;
+			uint32_t supported_channel_widthset:2;
+			uint32_t        ldpc_coding:1;
+			uint32_t         shortgi80:1;
+			uint32_t shortgi160and80plus80:1;
+			uint32_t               tx_stbc:1;
+			uint32_t               rx_stbc:3;
+			uint32_t      su_beam_former:1;
+			uint32_t      su_beam_formee:1;
+			uint32_t csnof_beamformer_antSup:3;
+			uint32_t       num_soundingdim:3;
+			uint32_t      mu_beam_former:1;
+			uint32_t      mu_beam_formee:1;
+			uint32_t            vht_txops:1;
+			uint32_t            htc_vhtcap:1;
+			uint32_t       max_ampdu_lenexp:3;
+			uint32_t        vht_link_adapt:2;
+			uint32_t         rx_antpattern:1;
+			uint32_t         tx_antpattern:1;
+			uint32_t  extended_nss_bw_supp:2;
+		};
+		uint32_t caps;
+	};
+};
+
 /**
  * struct wlan_mlme_qos - QOS TX/RX aggregation related CFG items
  * @tx_aggregation_size: TX aggr size in number of MPDUs

+ 0 - 67
core/mac/inc/sir_api.h

@@ -568,68 +568,6 @@ typedef enum eSirNwType {
 	eSIR_DONOT_USE_NW_TYPE = SIR_MAX_ENUM_SIZE
 } tSirNwType;
 
-/* HT configuration values */
-struct ht_config {
-	/* Enable/Disable receiving LDPC coded packets */
-	uint32_t ht_rx_ldpc:1;
-	/* Enable/Disable TX STBC */
-	uint32_t ht_tx_stbc:1;
-	/* Enable/Disable RX STBC */
-	uint32_t ht_rx_stbc:2;
-	/* Enable/Disable SGI */
-	uint32_t ht_sgi20:1;
-	uint32_t ht_sgi40:1;
-	uint32_t unused:27;
-};
-
-/**
- * struct sir_vht_config - VHT capabilities
- * @max_mpdu_len: MPDU length
- * @supported_channel_widthset: channel width set
- * @ldpc_coding: LDPC coding capability
- * @shortgi80: short GI 80 support
- * @shortgi160and80plus80: short Gi 160 & 80+80 support
- * @tx_stbc; Tx STBC cap
- * @tx_stbc: Rx STBC cap
- * @su_beam_former: SU beam former cap
- * @su_beam_formee: SU beam formee cap
- * @csnof_beamformer_antSup: Antenna support for beamforming
- * @num_soundingdim: Sound dimensions
- * @mu_beam_former: MU beam former cap
- * @mu_beam_formee: MU beam formee cap
- * @vht_txops: TXOP power save
- * @htc_vhtcap: HTC VHT capability
- * @max_ampdu_lenexp: AMPDU length
- * @vht_link_adapt: VHT link adapatation capable
- * @rx_antpattern: Rx Antenna pattern
- * @tx_antpattern: Tx Antenna pattern
- */
-struct sir_vht_config {
-	uint32_t           max_mpdu_len:2;
-	uint32_t supported_channel_widthset:2;
-	uint32_t        ldpc_coding:1;
-	uint32_t         shortgi80:1;
-	uint32_t shortgi160and80plus80:1;
-	uint32_t               tx_stbc:1;
-	uint32_t               rx_stbc:3;
-	uint32_t      su_beam_former:1;
-	uint32_t      su_beam_formee:1;
-	uint32_t csnof_beamformer_antSup:3;
-	uint32_t       num_soundingdim:3;
-	uint32_t      mu_beam_former:1;
-	uint32_t      mu_beam_formee:1;
-	uint32_t            vht_txops:1;
-	uint32_t            htc_vhtcap:1;
-	uint32_t       max_ampdu_lenexp:3;
-	uint32_t        vht_link_adapt:2;
-	uint32_t         rx_antpattern:1;
-	uint32_t         tx_antpattern:1;
-	uint32_t  extended_nss_bw_supp:2;
-	uint8_t  max_nsts_total:2;
-	uint8_t  vht_extended_nss_bw_cap:1;
-};
-
-
 struct add_ie_params {
 	uint16_t probeRespDataLen;
 	uint8_t *probeRespData_buff;
@@ -696,8 +634,6 @@ struct start_bss_req {
 	tSirNwType nwType;      /* Indicates 11a/b/g */
 	tSirMacRateSet operationalRateSet;      /* Has 11a or 11b rates */
 	tSirMacRateSet extendedRateSet; /* Has 11g rates */
-	struct ht_config ht_config;
-	struct sir_vht_config vht_config;
 #ifdef WLAN_FEATURE_11AX
 	tDot11fIEhe_cap he_config;
 #endif
@@ -971,7 +907,6 @@ struct join_req {
 	uint8_t vdev_id;
 	tSirMacSSid ssId;
 	tSirMacAddr self_mac_addr;        /* self Mac address */
-	enum bss_type bsstype;    /* add new type for BT-AMP STA and AP Modules */
 	uint8_t dot11mode;      /* to support BT-AMP */
 #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
 	uint8_t cc_switch_mode;
@@ -1020,8 +955,6 @@ struct join_req {
 	bool isFastRoamIniFeatureEnabled;
 
 	uint8_t txLdpcIniFeatureEnabled;
-	struct ht_config ht_config;
-	struct sir_vht_config vht_config;
 #ifdef WLAN_FEATURE_11AX
 	tDot11fIEhe_cap he_config;
 #endif

+ 2 - 2
core/mac/src/pe/include/lim_session.h

@@ -394,8 +394,8 @@ struct pe_session {
 	int8_t rssi;
 #endif
 	uint8_t max_amsdu_num;
-	struct ht_config ht_config;
-	struct sir_vht_config vht_config;
+	struct mlme_ht_capabilities_info ht_config;
+	struct wlan_vht_config vht_config;
 	/*
 	 * Place holder for StartBssReq message
 	 * received by SME state machine

+ 10 - 8
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -2480,7 +2480,7 @@ lim_add_sta(struct mac_context *mac_ctx,
 			add_sta_params->nwType = eSIR_11B_NW_TYPE;
 	}
 
-	if (add_sta_params->htCapable && session_entry->ht_config.ht_tx_stbc) {
+	if (add_sta_params->htCapable && session_entry->ht_config.tx_stbc) {
 		struct sDot11fIEHTCaps *ht_caps = (struct sDot11fIEHTCaps *)
 			&add_sta_params->ht_caps;
 		if (ht_caps->rxSTBC)
@@ -2762,8 +2762,10 @@ lim_add_sta_self(struct mac_context *mac, uint8_t updateSta,
 		pAddStaParams->maxAmpduSize =
 			lim_get_ht_capability(mac, eHT_MAX_RX_AMPDU_FACTOR,
 					      pe_session);
-		pAddStaParams->fShortGI20Mhz = pe_session->ht_config.ht_sgi20;
-		pAddStaParams->fShortGI40Mhz = pe_session->ht_config.ht_sgi40;
+		pAddStaParams->fShortGI20Mhz =
+			pe_session->ht_config.short_gi_20_mhz;
+		pAddStaParams->fShortGI40Mhz =
+			pe_session->ht_config.short_gi_40_mhz;
 	}
 	pAddStaParams->vhtCapable = pe_session->vhtCapability;
 	if (pAddStaParams->vhtCapable)
@@ -3552,7 +3554,7 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp
 	if (IS_DOT11_MODE_HT(pe_session->dot11mode)
 			&& pBeaconStruct->HTCaps.present) {
 		pAddBssParams->staContext.htCapable = 1;
-		if (pe_session->ht_config.ht_tx_stbc)
+		if (pe_session->ht_config.tx_stbc)
 			pAddBssParams->staContext.stbc_capable =
 				pAssocRsp->HTCaps.rxSTBC;
 
@@ -3648,14 +3650,14 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp
 		 * values are set as 0 in session entry then we will
 		 * hardcode this values to 0.
 		 */
-		if (pe_session->ht_config.ht_sgi20) {
+		if (pe_session->ht_config.short_gi_20_mhz) {
 			pAddBssParams->staContext.fShortGI20Mhz =
 				(uint8_t)pAssocRsp->HTCaps.shortGI20MHz;
 		} else {
 			pAddBssParams->staContext.fShortGI20Mhz = false;
 		}
 
-		if (pe_session->ht_config.ht_sgi40) {
+		if (pe_session->ht_config.short_gi_40_mhz) {
 			pAddBssParams->staContext.fShortGI40Mhz =
 				(uint8_t) pAssocRsp->HTCaps.shortGI40MHz;
 		} else {
@@ -4008,13 +4010,13 @@ QDF_STATUS lim_sta_send_add_bss_pre_assoc(struct mac_context *mac,
 		 * from AP supports. If these values are set as 0 in ini file
 		 * then we will hardcode this values to 0.
 		 */
-		if (pe_session->ht_config.ht_sgi20)
+		if (pe_session->ht_config.short_gi_20_mhz)
 			pAddBssParams->staContext.fShortGI20Mhz =
 				(uint8_t)pBeaconStruct->HTCaps.shortGI20MHz;
 		else
 			pAddBssParams->staContext.fShortGI20Mhz = false;
 
-		if (pe_session->ht_config.ht_sgi40)
+		if (pe_session->ht_config.short_gi_40_mhz)
 			pAddBssParams->staContext.fShortGI40Mhz =
 				(uint8_t) pBeaconStruct->HTCaps.shortGI40MHz;
 		else

+ 2 - 2
core/mac/src/pe/lim/lim_process_assoc_req_frame.c

@@ -1569,7 +1569,7 @@ static bool lim_update_sta_ds(struct mac_context *mac_ctx, tpSirMacMgmtHdr hdr,
 		/* assoc_req will be copied to session->parsedAssocReq later */
 		ht_cap_ie = ((uint8_t *) &assoc_req->HTCaps) + 1;
 
-		if (session->ht_config.ht_sgi20) {
+		if (session->ht_config.short_gi_20_mhz) {
 			sta_ds->htShortGI20Mhz =
 				(uint8_t)assoc_req->HTCaps.shortGI20MHz;
 		} else {
@@ -1578,7 +1578,7 @@ static bool lim_update_sta_ds(struct mac_context *mac_ctx, tpSirMacMgmtHdr hdr,
 			sta_ds->htShortGI20Mhz = 0;
 		}
 
-		if (session->ht_config.ht_sgi40) {
+		if (session->ht_config.short_gi_40_mhz) {
 			sta_ds->htShortGI40Mhz =
 				(uint8_t)assoc_req->HTCaps.shortGI40MHz;
 		} else {

+ 2 - 2
core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

@@ -101,13 +101,13 @@ static void lim_update_stads_htcap(struct mac_context *mac_ctx,
 		/* Check if we have support for gShortGI20Mhz and
 		 * gShortGI40Mhz from ini file
 		 */
-		if (session_entry->ht_config.ht_sgi20)
+		if (session_entry->ht_config.short_gi_20_mhz)
 			sta_ds->htShortGI20Mhz =
 			      (uint8_t)assoc_rsp->HTCaps.shortGI20MHz;
 		else
 			sta_ds->htShortGI20Mhz = false;
 
-		if (session_entry->ht_config.ht_sgi40)
+		if (session_entry->ht_config.short_gi_40_mhz)
 			sta_ds->htShortGI40Mhz =
 				      (uint8_t)assoc_rsp->HTCaps.shortGI40MHz;
 		else

+ 188 - 27
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -559,6 +559,72 @@ static inline bool lim_is_6g_allowed_sec(struct mac_context *mac,
 }
 #endif
 
+/**
+ * lim_set_ldpc_exception() - to set allow any LDPC exception permitted
+ * @mac_ctx: Pointer to mac context
+ * @vdev_mlme: vdev mlme
+ * @channel: Given channel number where connection will go
+ *
+ * This API will check if hardware allows LDPC to be enabled for provided
+ * channel and user has enabled the RX LDPC selection
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS lim_set_ldpc_exception(struct mac_context *mac_ctx,
+					 struct vdev_mlme_obj *vdev_mlme,
+					 uint32_t ch_freq)
+{
+	struct wlan_vht_config vht_config;
+	struct wlan_ht_config ht_caps;
+
+	vht_config.caps = vdev_mlme->proto.vht_info.caps;
+	ht_caps.caps = vdev_mlme->proto.ht_info.ht_caps;
+
+	if (mac_ctx->mlme_cfg->ht_caps.ht_cap_info.adv_coding_cap &&
+	    wma_is_rx_ldpc_supported_for_channel(ch_freq)) {
+		ht_caps.ht_caps.adv_coding_cap = 1;
+		vht_config.ldpc_coding = 1;
+		sme_debug("LDPC enable for ch freq[%d]", ch_freq);
+	} else {
+		ht_caps.ht_caps.adv_coding_cap = 0;
+		vht_config.ldpc_coding = 0;
+		sme_debug("LDPC disable for ch freq[%d]", ch_freq);
+	}
+	vdev_mlme->proto.vht_info.caps = vht_config.caps;
+	vdev_mlme->proto.ht_info.ht_caps = ht_caps.caps;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+static void lim_start_bss_update_ht_vht_caps(struct mac_context *mac_ctx,
+					     struct pe_session *session)
+{
+	struct vdev_mlme_obj *vdev_mlme;
+	struct wlan_vht_config vht_config;
+	uint8_t value = 0;
+	struct wlan_ht_config ht_caps;
+
+	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(session->vdev);
+	if (!vdev_mlme)
+		return;
+	if (!policy_mgr_is_dbs_enable(mac_ctx->psoc))
+		lim_set_ldpc_exception(mac_ctx, vdev_mlme,
+				       session->curr_op_freq);
+	vht_config.caps = vdev_mlme->proto.vht_info.caps;
+	value = mac_ctx->mlme_cfg->vht_caps.vht_cap_info.su_bformee;
+	vht_config.su_beam_formee =
+		value && mac_ctx->mlme_cfg->vht_caps.vht_cap_info.tx_bfee_sap;
+	value = MLME_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_FW_DEF;
+	vht_config.csnof_beamformer_antSup = value;
+	vht_config.mu_beam_formee = 0;
+
+	session->vht_config = vht_config;
+	ht_caps.caps = vdev_mlme->proto.ht_info.ht_caps;
+	session->ht_config = ht_caps.ht_caps;
+	pe_debug("HT capability 0x%x VHT capability 0x%x",
+		 ht_caps.caps, vht_config.caps);
+}
+
 /**
  * __lim_handle_sme_start_bss_request() - process SME_START_BSS_REQ message
  *@mac_ctx: Pointer to Global MAC structure
@@ -673,9 +739,9 @@ __lim_handle_sme_start_bss_request(struct mac_context *mac_ctx, uint32_t *msg_bu
 					assocRespDataLen);
 		}
 		/* Store the session related params in newly created session */
+		session->curr_op_freq = sme_start_bss_req->oper_ch_freq;
 		session->pLimStartBssReq = sme_start_bss_req;
-		session->ht_config = sme_start_bss_req->ht_config;
-		session->vht_config = sme_start_bss_req->vht_config;
+		lim_start_bss_update_ht_vht_caps(mac_ctx, session);
 
 		sir_copy_mac_addr(session->self_mac_addr,
 				  sme_start_bss_req->self_macaddr.bytes);
@@ -690,9 +756,6 @@ __lim_handle_sme_start_bss_request(struct mac_context *mac_ctx, uint32_t *msg_bu
 		session->beaconParams.beaconInterval =
 			sme_start_bss_req->beaconInterval;
 
-		/* Store the oper freq in session Table */
-		session->curr_op_freq = sme_start_bss_req->oper_ch_freq;
-
 		/* Update the phymode */
 		session->gLimPhyMode = sme_start_bss_req->nwType;
 
@@ -1100,6 +1163,114 @@ static QDF_STATUS lim_send_reassoc_req(struct pe_session *session,
 	return QDF_STATUS_SUCCESS;
 }
 
+static void lim_join_req_update_ht_vht_caps(struct mac_context *mac,
+					    struct pe_session *session,
+					    struct bss_description *bss_desc)
+{
+	struct vdev_mlme_obj *vdev_mlme;
+	struct wlan_vht_config vht_config;
+	uint8_t value, value1, *buf;
+	tDot11fBeaconIEs *bcn_ie;
+	uint32_t status, buf_len;
+	tDot11fIEVHTCaps *vht_caps = NULL;
+	uint8_t tx_bf_csn = 0;
+	struct wlan_ht_config ht_caps;
+
+	bcn_ie = qdf_mem_malloc(sizeof(*bcn_ie));
+	if (!bcn_ie)
+		return;
+
+	buf_len = lim_get_ielen_from_bss_description(bss_desc);
+	buf = (uint8_t *)bss_desc->ieFields;
+	status = dot11f_unpack_beacon_i_es(mac, buf, buf_len, bcn_ie, false);
+	if (DOT11F_FAILED(status)) {
+		pe_err("Failed to parse Beacon IEs (0x%08x, %d bytes):",
+			status, buf_len);
+		qdf_mem_free(bcn_ie);
+		return;
+	} else if (DOT11F_WARNED(status)) {
+		pe_debug("warnings (0x%08x, %d bytes):", status, buf_len);
+	}
+
+	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(session->vdev);
+	if (!vdev_mlme) {
+		qdf_mem_free(bcn_ie);
+		return;
+	}
+
+	lim_set_ldpc_exception(mac, vdev_mlme, session->curr_op_freq);
+	vht_config.caps = vdev_mlme->proto.vht_info.caps;
+
+	value = mac->mlme_cfg->vht_caps.vht_cap_info.su_bformee;
+	value1 = mac->mlme_cfg->vht_caps.vht_cap_info.tx_bfee_ant_supp;
+
+	vht_config.su_beam_formee = value;
+
+	if (bcn_ie->VHTCaps.present)
+		vht_caps = &bcn_ie->VHTCaps;
+	else if (bcn_ie->vendor_vht_ie.VHTCaps.present)
+		vht_caps = &bcn_ie->vendor_vht_ie.VHTCaps;
+	/* Set BF CSN value only if SU Bformee is enabled */
+	if (vht_caps && vht_config.su_beam_formee) {
+		tx_bf_csn = value1;
+		/*
+		 * Certain commercial AP display a bad behavior when
+		 * CSN value in  assoc request is more than AP's CSN.
+		 * Sending absolute self CSN value with such AP leads to
+		 * IOT issues. However this issue is observed only with
+		 * CSN cap of less than 4. To avoid such issues, take a
+		 * min of self and peer CSN while sending ASSOC request.
+		 */
+		if (bcn_ie->Vendor1IE.present &&
+		    vht_caps->csnofBeamformerAntSup < 4) {
+			if (vht_caps->csnofBeamformerAntSup)
+				tx_bf_csn = QDF_MIN(tx_bf_csn,
+					vht_caps->csnofBeamformerAntSup);
+		}
+	}
+	vht_config.csnof_beamformer_antSup = tx_bf_csn;
+
+	value = mac->mlme_cfg->vht_caps.vht_cap_info.su_bformer;
+	/*
+	 * Set SU Bformer only if SU Bformer is enabled in INI
+	 * and AP is SU Bformee capable
+	 */
+	if (value && !((IS_BSS_VHT_CAPABLE(bcn_ie->VHTCaps) &&
+	    bcn_ie->VHTCaps.suBeamformeeCap) ||
+	    (IS_BSS_VHT_CAPABLE(bcn_ie->vendor_vht_ie.VHTCaps) &&
+	    bcn_ie->vendor_vht_ie.VHTCaps.suBeamformeeCap)))
+		value = 0;
+
+	vht_config.su_beam_former = value;
+
+	/* Set num soundingdim value to 0 if SU Bformer is disabled */
+	if (!vht_config.su_beam_former)
+		vht_config.num_soundingdim = 0;
+
+	value = mac->mlme_cfg->vht_caps.vht_cap_info.enable_mu_bformee;
+	/*
+	 * Set MU Bformee only if SU Bformee is enabled and
+	 * MU Bformee is enabled in INI
+	 */
+	if (value && vht_config.su_beam_formee &&
+	    bcn_ie->VHTCaps.muBeamformerCap)
+		vht_config.mu_beam_formee = 1;
+	else
+		vht_config.mu_beam_formee = 0;
+
+	qdf_mem_free(bcn_ie);
+
+	if (IS_DOT11_MODE_VHT(session->dot11mode) &&
+	    session->opmode != QDF_STA_MODE)
+		vht_config.su_beam_formee = 0;
+
+	session->vht_config = vht_config;
+	ht_caps.caps = vdev_mlme->proto.ht_info.ht_caps;
+	session->ht_config = ht_caps.ht_caps;
+	pe_debug("HT capability 0x%x VHT capability 0x%x",
+		 ht_caps.caps, vht_config.caps);
+}
+
 /**
  * lim_send_ft_reassoc_req() - send vdev start request for ft_reassoc
  *@session: pe session
@@ -1360,9 +1531,11 @@ __lim_process_sme_join_req(struct mac_context *mac_ctx, void *msg_buf)
 		/* Store beaconInterval */
 		session->beaconParams.beaconInterval =
 			bss_desc->beaconInterval;
-
-		session->ht_config = sme_join_req->ht_config;
-		session->vht_config = sme_join_req->vht_config;
+		/* Copy oper freq to the session Table */
+		session->curr_op_freq = bss_desc->chan_freq;
+		/* Copy the dot 11 mode in to the session table */
+		session->dot11mode = sme_join_req->dot11mode;
+		lim_join_req_update_ht_vht_caps(mac_ctx, session, bss_desc);
 
 		/* Copying of bssId is already done, while creating session */
 		sir_copy_mac_addr(session->self_mac_addr,
@@ -1390,9 +1563,6 @@ __lim_process_sme_join_req(struct mac_context *mac_ctx, void *msg_buf)
 		else
 			session->isCiscoVendorAP = false;
 
-		/* Copy the dot 11 mode in to the session table */
-
-		session->dot11mode = sme_join_req->dot11mode;
 #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
 		session->cc_switch_mode = sme_join_req->cc_switch_mode;
 #endif
@@ -1409,18 +1579,9 @@ __lim_process_sme_join_req(struct mac_context *mac_ctx, void *msg_buf)
 		 * self and peer rates
 		 */
 		session->supported_nss_1x1 = true;
-
-		/* Copy oper freq to the session Table */
-		session->curr_op_freq = bss_desc->chan_freq;
 		session->vhtCapability =
 			IS_DOT11_MODE_VHT(session->dot11mode);
 		if (session->vhtCapability) {
-			if (session->opmode == QDF_STA_MODE) {
-				session->vht_config.su_beam_formee =
-					sme_join_req->vht_config.su_beam_formee;
-			} else {
-				session->vht_config.su_beam_formee = 0;
-			}
 			session->enableVhtpAid =
 				sme_join_req->enableVhtpAid;
 			session->enableVhtGid =
@@ -1799,9 +1960,9 @@ static void __lim_process_sme_reassoc_req(struct mac_context *mac_ctx,
 	if (session_entry->vhtCapability) {
 		if (session_entry->opmode == QDF_STA_MODE) {
 			session_entry->vht_config.su_beam_formee =
-				reassoc_req->vht_config.su_beam_formee;
+			    mac_ctx->mlme_cfg->vht_caps.vht_cap_info.su_bformee;
 		} else {
-			reassoc_req->vht_config.su_beam_formee = 0;
+			session_entry->vht_config.su_beam_formee = 0;
 		}
 		session_entry->enableVhtpAid =
 			reassoc_req->enableVhtpAid;
@@ -3499,19 +3660,19 @@ static void lim_process_sme_update_config(struct mac_context *mac_ctx,
 
 	switch (msg->capab) {
 	case WNI_CFG_HT_CAP_INFO_ADVANCE_CODING:
-		pe_session->ht_config.ht_rx_ldpc = msg->value;
+		pe_session->ht_config.adv_coding_cap = msg->value;
 		break;
 	case WNI_CFG_HT_CAP_INFO_TX_STBC:
-		pe_session->ht_config.ht_tx_stbc = msg->value;
+		pe_session->ht_config.tx_stbc = msg->value;
 		break;
 	case WNI_CFG_HT_CAP_INFO_RX_STBC:
-		pe_session->ht_config.ht_rx_stbc = msg->value;
+		pe_session->ht_config.rx_stbc = msg->value;
 		break;
 	case WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ:
-		pe_session->ht_config.ht_sgi20 = msg->value;
+		pe_session->ht_config.short_gi_20_mhz = msg->value;
 		break;
 	case WNI_CFG_HT_CAP_INFO_SHORT_GI_40MHZ:
-		pe_session->ht_config.ht_sgi40 = msg->value;
+		pe_session->ht_config.short_gi_40_mhz = msg->value;
 		break;
 	}
 

+ 6 - 6
core/mac/src/pe/lim/lim_utils.c

@@ -2210,20 +2210,20 @@ uint8_t lim_get_ht_capability(struct mac_context *mac,
 		break;
 
 	case eHT_RX_STBC:
-		retVal = (uint8_t) pe_session->ht_config.ht_rx_stbc;
+		retVal = (uint8_t) pe_session->ht_config.rx_stbc;
 		break;
 
 	case eHT_TX_STBC:
-		retVal = (uint8_t) pe_session->ht_config.ht_tx_stbc;
+		retVal = (uint8_t) pe_session->ht_config.tx_stbc;
 		break;
 
 	case eHT_SHORT_GI_40MHZ:
-		retVal = (uint8_t)(pe_session->ht_config.ht_sgi40) ?
+		retVal = (uint8_t)(pe_session->ht_config.short_gi_40_mhz) ?
 			mac->mlme_cfg->ht_caps.ht_cap_info.short_gi_40_mhz : 0;
 		break;
 
 	case eHT_SHORT_GI_20MHZ:
-		retVal = (uint8_t)(pe_session->ht_config.ht_sgi20) ?
+		retVal = (uint8_t)(pe_session->ht_config.short_gi_20_mhz) ?
 			mac->mlme_cfg->ht_caps.ht_cap_info.short_gi_20_mhz : 0;
 		break;
 
@@ -2241,7 +2241,7 @@ uint8_t lim_get_ht_capability(struct mac_context *mac,
 		break;
 
 	case eHT_ADVANCED_CODING:
-		retVal = (uint8_t) pe_session->ht_config.ht_rx_ldpc;
+		retVal = (uint8_t) pe_session->ht_config.adv_coding_cap;
 		break;
 
 	case eHT_MAX_RX_AMPDU_FACTOR:
@@ -6895,7 +6895,7 @@ void lim_update_usr_he_cap(struct mac_context *mac_ctx, struct pe_session *sessi
 	struct he_cap_network_endian *he_cap_from_ie;
 	uint8_t extracted_buff[DOT11F_IE_HE_CAP_MAX_LEN + 2];
 	QDF_STATUS status;
-	struct sir_vht_config *vht_cfg = &session->vht_config;
+	struct wlan_vht_config *vht_cfg = &session->vht_config;
 	qdf_mem_zero(extracted_buff, sizeof(extracted_buff));
 	status = lim_strip_ie(mac_ctx, add_ie->probeRespBCNData_buff,
 			&add_ie->probeRespBCNDataLen,

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

@@ -755,11 +755,11 @@ populate_dot11f_ht_caps(struct mac_context *mac,
 			pDot11f->supportedChannelWidthSet =
 				pe_session->htSupportedChannelWidthSet;
 
-		pDot11f->advCodingCap = pe_session->ht_config.ht_rx_ldpc;
-		pDot11f->txSTBC = pe_session->ht_config.ht_tx_stbc;
-		pDot11f->rxSTBC = pe_session->ht_config.ht_rx_stbc;
-		pDot11f->shortGI20MHz = pe_session->ht_config.ht_sgi20;
-		pDot11f->shortGI40MHz = pe_session->ht_config.ht_sgi40;
+		pDot11f->advCodingCap = pe_session->ht_config.adv_coding_cap;
+		pDot11f->txSTBC = pe_session->ht_config.tx_stbc;
+		pDot11f->rxSTBC = pe_session->ht_config.rx_stbc;
+		pDot11f->shortGI20MHz = pe_session->ht_config.short_gi_20_mhz;
+		pDot11f->shortGI40MHz = pe_session->ht_config.short_gi_40_mhz;
 	}
 
 	/* Ensure that shortGI40MHz is Disabled if supportedChannelWidthSet is
@@ -984,7 +984,7 @@ populate_dot11f_vht_caps(struct mac_context *mac,
 			return QDF_STATUS_SUCCESS;
 		}
 
-		if (pe_session->ht_config.ht_rx_ldpc)
+		if (pe_session->ht_config.adv_coding_cap)
 			pDot11f->ldpcCodingCap =
 				pe_session->vht_config.ldpc_coding;
 		if (pe_session->ch_width < CH_WIDTH_80MHZ) {
@@ -1002,10 +1002,10 @@ populate_dot11f_vht_caps(struct mac_context *mac,
 				pe_session->vht_config.shortgi160and80plus80;
 		}
 
-		if (pe_session->ht_config.ht_tx_stbc)
+		if (pe_session->ht_config.tx_stbc)
 			pDot11f->txSTBC = pe_session->vht_config.tx_stbc;
 
-		if (pe_session->ht_config.ht_rx_stbc)
+		if (pe_session->ht_config.rx_stbc)
 			pDot11f->rxSTBC = pe_session->vht_config.rx_stbc;
 
 		pDot11f->suBeamformeeCap =

+ 0 - 2
core/sme/inc/csr_internal.h

@@ -593,8 +593,6 @@ struct csr_roam_session {
 	tCsrEseCckmIe suppCckmIeInfo;
 #endif
 	uint8_t bRefAssocStartCnt;      /* Tracking assoc start indication */
-	struct ht_config ht_config;
-	struct sir_vht_config vht_config;
 #ifdef WLAN_FEATURE_11AX
 	tDot11fIEhe_cap he_config;
 	uint32_t he_sta_obsspd;

+ 71 - 20
core/sme/src/common/sme_api.c

@@ -8414,28 +8414,43 @@ QDF_STATUS sme_set_idle_powersave_config(bool value)
 	return QDF_STATUS_SUCCESS;
 }
 
-int16_t sme_get_ht_config(mac_handle_t mac_handle, uint8_t session_id,
+int16_t sme_get_ht_config(mac_handle_t mac_handle, uint8_t vdev_id,
 			  uint16_t ht_capab)
 {
 	struct mac_context *mac = MAC_CONTEXT(mac_handle);
-	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, session_id);
+	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, vdev_id);
+	struct wlan_objmgr_vdev *vdev;
+	struct vdev_mlme_obj *vdev_mlme;
+	struct wlan_ht_config ht_cap_info;
 
 	if (!pSession) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  "%s: pSession is NULL", __func__);
 		return -EIO;
 	}
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, vdev_id,
+						    WLAN_LEGACY_SME_ID);
+	if (!vdev)
+		return -EIO;
+	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
+	if (!vdev_mlme) {
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
+		return -EIO;
+	}
+	ht_cap_info.caps = vdev_mlme->proto.ht_info.ht_caps;
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
 	switch (ht_capab) {
 	case WNI_CFG_HT_CAP_INFO_ADVANCE_CODING:
-		return pSession->ht_config.ht_rx_ldpc;
+		return ht_cap_info.ht_caps.adv_coding_cap;
 	case WNI_CFG_HT_CAP_INFO_TX_STBC:
-		return pSession->ht_config.ht_tx_stbc;
+		return ht_cap_info.ht_caps.tx_stbc;
 	case WNI_CFG_HT_CAP_INFO_RX_STBC:
-		return pSession->ht_config.ht_rx_stbc;
+		return ht_cap_info.ht_caps.rx_stbc;
 	case WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ:
-		return pSession->ht_config.ht_sgi20;
+		return ht_cap_info.ht_caps.short_gi_20_mhz;
 	case WNI_CFG_HT_CAP_INFO_SHORT_GI_40MHZ:
-		return pSession->ht_config.ht_sgi40;
+		return ht_cap_info.ht_caps.short_gi_40_mhz;
 	default:
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  "invalid ht capability");
@@ -8443,11 +8458,14 @@ int16_t sme_get_ht_config(mac_handle_t mac_handle, uint8_t session_id,
 	}
 }
 
-int sme_update_ht_config(mac_handle_t mac_handle, uint8_t sessionId,
+int sme_update_ht_config(mac_handle_t mac_handle, uint8_t vdev_id,
 			 uint16_t htCapab, int value)
 {
 	struct mac_context *mac = MAC_CONTEXT(mac_handle);
-	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId);
+	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, vdev_id);
+	struct wlan_ht_config ht_cap_info;
+	struct wlan_objmgr_vdev *vdev;
+	struct vdev_mlme_obj *vdev_mlme;
 
 	if (!pSession) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
@@ -8455,33 +8473,45 @@ int sme_update_ht_config(mac_handle_t mac_handle, uint8_t sessionId,
 		return -EIO;
 	}
 
-	if (QDF_STATUS_SUCCESS != wma_set_htconfig(sessionId, htCapab, value)) {
+	if (QDF_STATUS_SUCCESS != wma_set_htconfig(vdev_id, htCapab, value)) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  "Failed to set ht capability in target");
 		return -EIO;
 	}
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, vdev_id,
+						    WLAN_LEGACY_SME_ID);
+	if (!vdev)
+		return -EIO;
+	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
+	if (!vdev_mlme) {
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
+		return -EIO;
+	}
+	ht_cap_info.caps = vdev_mlme->proto.ht_info.ht_caps;
 
 	switch (htCapab) {
 	case WNI_CFG_HT_CAP_INFO_ADVANCE_CODING:
-		pSession->ht_config.ht_rx_ldpc = value;
+		ht_cap_info.ht_caps.adv_coding_cap = value;
 		break;
 	case WNI_CFG_HT_CAP_INFO_TX_STBC:
-		pSession->ht_config.ht_tx_stbc = value;
+		ht_cap_info.ht_caps.tx_stbc = value;
 		break;
 	case WNI_CFG_HT_CAP_INFO_RX_STBC:
-		pSession->ht_config.ht_rx_stbc = value;
+		ht_cap_info.ht_caps.rx_stbc = value;
 		break;
 	case WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ:
 		value = value ? 1 : 0; /* HT SGI can be only 1 or 0 */
-		pSession->ht_config.ht_sgi20 = value;
+		ht_cap_info.ht_caps.short_gi_20_mhz = value;
 		break;
 	case WNI_CFG_HT_CAP_INFO_SHORT_GI_40MHZ:
 		value = value ? 1 : 0; /* HT SGI can be only 1 or 0 */
-		pSession->ht_config.ht_sgi40 = value;
+		ht_cap_info.ht_caps.short_gi_40_mhz = value;
 		break;
 	}
+	vdev_mlme->proto.ht_info.ht_caps = ht_cap_info.caps;
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
 
-	csr_roam_update_config(mac, sessionId, htCapab, value);
+	csr_roam_update_config(mac, vdev_id, htCapab, value);
 	return 0;
 }
 
@@ -11376,6 +11406,29 @@ QDF_STATUS sme_disable_uapsd_for_ac(sme_ac_enum_type ac, uint32_t sessionId)
 	return QDF_STATUS_SUCCESS;
 }
 
+static void sme_vdev_ht_tx_stbc(struct mac_context *mac_ctx,
+				bool ht_tx_stbc, uint8_t vdev_id)
+{
+	struct wlan_objmgr_vdev *vdev;
+	struct vdev_mlme_obj *vdev_mlme;
+	struct wlan_ht_config ht_cap_info;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac_ctx->psoc, vdev_id,
+						    WLAN_LEGACY_SME_ID);
+	if (!vdev)
+		return;
+	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
+	if (!vdev_mlme) {
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
+		return;
+	}
+	ht_cap_info.caps = vdev_mlme->proto.ht_info.ht_caps;
+
+	ht_cap_info.ht_caps.tx_stbc = ht_tx_stbc;
+	vdev_mlme->proto.ht_info.ht_caps = ht_cap_info.caps;
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
+}
+
 /**
  * sme_update_nss() - SME API to change the number for spatial streams
  * (1 or 2)
@@ -11393,7 +11446,6 @@ QDF_STATUS sme_update_nss(mac_handle_t mac_handle, uint8_t nss)
 	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
 	uint32_t i;
 	struct mlme_ht_capabilities_info *ht_cap_info;
-	struct csr_roam_session *csr_session;
 	struct mlme_vht_capabilities_info *vht_cap_info;
 
 	vht_cap_info = &mac_ctx->mlme_cfg->vht_caps.vht_cap_info;
@@ -11408,9 +11460,8 @@ QDF_STATUS sme_update_nss(mac_handle_t mac_handle, uint8_t nss)
 
 		for (i = 0; i < WLAN_MAX_VDEVS; i++) {
 			if (CSR_IS_SESSION_VALID(mac_ctx, i)) {
-				csr_session = &mac_ctx->roam.roamSession[i];
-				csr_session->ht_config.ht_tx_stbc =
-					ht_cap_info->tx_stbc;
+				sme_vdev_ht_tx_stbc(mac_ctx,
+						    ht_cap_info->tx_stbc, i);
 			}
 		}
 

+ 27 - 178
core/sme/src/csr/csr_api_roam.c

@@ -14498,46 +14498,6 @@ static void csr_add_supported_5Ghz_channels(struct mac_context *mac_ctx,
 	}
 }
 
-/**
- * csr_set_ldpc_exception() - to set allow any LDPC exception permitted
- * @mac_ctx: Pointer to mac context
- * @session: Pointer to SME/CSR session
- * @channel: Given channel number where connection will go
- * @usr_cfg_rx_ldpc: User provided RX LDPC setting
- *
- * This API will check if hardware allows LDPC to be enabled for provided
- * channel and user has enabled the RX LDPC selection
- *
- * Return: QDF_STATUS
- */
-static QDF_STATUS csr_set_ldpc_exception(struct mac_context *mac_ctx,
-			struct csr_roam_session *session, uint32_t ch_freq,
-			bool usr_cfg_rx_ldpc)
-{
-	if (!mac_ctx) {
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
-			"mac_ctx is NULL");
-		return QDF_STATUS_E_FAILURE;
-	}
-	if (!session) {
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
-			"session is NULL");
-		return QDF_STATUS_E_FAILURE;
-	}
-	if (usr_cfg_rx_ldpc && wma_is_rx_ldpc_supported_for_channel(ch_freq)) {
-		session->ht_config.ht_rx_ldpc = 1;
-		session->vht_config.ldpc_coding = 1;
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
-			"LDPC enable for ch freq[%d]", ch_freq);
-	} else {
-		session->ht_config.ht_rx_ldpc = 0;
-		session->vht_config.ldpc_coding = 0;
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
-			"LDPC disable for ch freq[%d]", ch_freq);
-	}
-	return QDF_STATUS_SUCCESS;
-}
-
 #ifdef WLAN_FEATURE_FILS_SK
 /*
  * csr_validate_and_update_fils_info: Copy fils connection info to join request
@@ -14906,9 +14866,8 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 	tSirMacRateSet OpRateSet;
 	tSirMacRateSet ExRateSet;
 	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId);
-	uint32_t dw_tmp, dot11mode = 0;
+	uint32_t dot11mode = 0;
 	uint8_t *wpaRsnIE = NULL;
-	uint8_t txBFCsnValue = 0;
 	struct join_req *csr_join_req;
 	tSirMacCapabilityInfo *pAP_capabilityInfo;
 	bool fTmp;
@@ -14917,12 +14876,9 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 	struct ps_params *ps_param = &ps_global_info->ps_params[sessionId];
 	uint8_t ese_config = 0;
 	tpCsrNeighborRoamControlInfo neigh_roam_info;
-	uint32_t value = 0, value1 = 0;
 	bool is_vendor_ap_present;
 	struct vdev_type_nss *vdev_type_nss;
 	struct action_oui_search_attr vendor_ap_search_attr;
-	tDot11fIEVHTCaps *vht_caps = NULL;
-	bool bvalue = 0;
 	enum csr_akm_type akm;
 	bool force_max_nss;
 	uint8_t ap_nss;
@@ -15026,10 +14982,6 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 			      pProfile->negotiatedMCEncryptionType,
 			      mac->scan.countryCodeCurrent[0],
 			      mac->scan.countryCodeCurrent[1]);
-		/* bsstype */
-		dw_tmp = csr_translate_bsstype_to_mac_type
-						(pProfile->BSSType);
-		csr_join_req->bsstype = dw_tmp;
 		/* dot11mode */
 		dot11mode =
 			csr_translate_to_wni_cfg_dot11_mode(mac,
@@ -15603,24 +15555,6 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 				(&pIes->Country.triplets[0]));
 			csr_apply_power2_current(mac);
 		}
-		/*
-		 * If RX LDPC has been disabled for 2.4GHz channels and enabled
-		 * for 5Ghz for STA like persona then here is how to handle
-		 * those cases (by now channel has been decided).
-		 */
-		if (eSIR_INFRASTRUCTURE_MODE == csr_join_req->bsstype ||
-		    !policy_mgr_is_dbs_enable(mac->psoc))
-			csr_set_ldpc_exception(mac, pSession,
-					       bss_freq,
-					       mac->mlme_cfg->ht_caps.
-					       ht_cap_info.adv_coding_cap);
-		csr_join_req->ht_config = pSession->ht_config;
-		csr_join_req->vht_config = pSession->vht_config;
-		sme_debug("ht capability 0x%x VHT capability 0x%x",
-			(unsigned int)(*(uint32_t *) &csr_join_req->ht_config),
-			(unsigned int)(*(uint32_t *) &csr_join_req->
-			vht_config));
-
 		if (IS_DOT11_MODE_HE(csr_join_req->dot11mode)) {
 			csr_join_req_copy_he_cap(csr_join_req, pSession);
 			/* change the HE caps like sts per band */
@@ -15630,64 +15564,6 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 							       bss_freq);
 		}
 
-		value = mac->mlme_cfg->vht_caps.vht_cap_info.su_bformee;
-		value1 = mac->mlme_cfg->vht_caps.vht_cap_info.tx_bfee_ant_supp;
-
-		csr_join_req->vht_config.su_beam_formee = value;
-
-		if (pIes->VHTCaps.present)
-			vht_caps = &pIes->VHTCaps;
-		else if (pIes->vendor_vht_ie.VHTCaps.present)
-			vht_caps = &pIes->vendor_vht_ie.VHTCaps;
-		/* Set BF CSN value only if SU Bformee is enabled */
-		if (vht_caps && csr_join_req->vht_config.su_beam_formee) {
-			txBFCsnValue = (uint8_t)value1;
-			/*
-			 * Certain commercial AP display a bad behavior when
-			 * CSN value in  assoc request is more than AP's CSN.
-			 * Sending absolute self CSN value with such AP leads to
-			 * IOT issues. However this issue is observed only with
-			 * CSN cap of less than 4. To avoid such issues, take a
-			 * min of self and peer CSN while sending ASSOC request.
-			 */
-			if (pIes->Vendor1IE.present &&
-					vht_caps->csnofBeamformerAntSup < 4) {
-				if (vht_caps->csnofBeamformerAntSup)
-					txBFCsnValue = QDF_MIN(txBFCsnValue,
-					  vht_caps->csnofBeamformerAntSup);
-			}
-		}
-		csr_join_req->vht_config.csnof_beamformer_antSup = txBFCsnValue;
-
-		bvalue = mac->mlme_cfg->vht_caps.vht_cap_info.su_bformer;
-		/*
-		 * Set SU Bformer only if SU Bformer is enabled in INI
-		 * and AP is SU Bformee capable
-		 */
-		if (bvalue && !((IS_BSS_VHT_CAPABLE(pIes->VHTCaps) &&
-		    pIes->VHTCaps.suBeamformeeCap) ||
-		    (IS_BSS_VHT_CAPABLE(pIes->vendor_vht_ie.VHTCaps) &&
-		     pIes->vendor_vht_ie.VHTCaps.suBeamformeeCap)))
-			bvalue = 0;
-
-		csr_join_req->vht_config.su_beam_former = bvalue;
-
-		/* Set num soundingdim value to 0 if SU Bformer is disabled */
-		if (!csr_join_req->vht_config.su_beam_former)
-			csr_join_req->vht_config.num_soundingdim = 0;
-
-		value =
-			mac->mlme_cfg->vht_caps.vht_cap_info.enable_mu_bformee;
-		/*
-		 * Set MU Bformee only if SU Bformee is enabled and
-		 * MU Bformee is enabled in INI
-		 */
-		if (value && csr_join_req->vht_config.su_beam_formee &&
-				pIes->VHTCaps.muBeamformerCap)
-			csr_join_req->vht_config.mu_beam_formee = 1;
-		else
-			csr_join_req->vht_config.mu_beam_formee = 0;
-
 		csr_join_req->enableVhtpAid =
 			mac->mlme_cfg->vht_caps.vht_cap_info.enable_paid;
 
@@ -16179,7 +16055,6 @@ QDF_STATUS csr_send_mb_start_bss_req_msg(struct mac_context *mac, uint32_t
 {
 	struct start_bss_req *pMsg;
 	uint16_t wTmp;
-	uint32_t value = 0;
 	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId);
 
 	if (!pSession) {
@@ -16242,31 +16117,6 @@ QDF_STATUS csr_send_mb_start_bss_req_msg(struct mac_context *mac, uint32_t
 	pMsg->bssPersona = pParam->bssPersona;
 	pMsg->txLdpcIniFeatureEnabled = mac->mlme_cfg->ht_caps.tx_ldpc_enable;
 
-	/*
-	 * If RX LDPC has been disabled for 2.4GHz channels and enabled
-	 * for 5Ghz for STA like persona then here is how to handle
-	 * those cases (by now channel has been decided).
-	 */
-	if (!policy_mgr_is_dbs_enable(mac->psoc))
-		csr_set_ldpc_exception(mac, pSession,
-				       pParam->operation_chan_freq,
-				       mac->mlme_cfg->ht_caps.
-				       ht_cap_info.adv_coding_cap);
-
-	pMsg->vht_config = pSession->vht_config;
-	pMsg->ht_config = pSession->ht_config;
-
-	value = mac->mlme_cfg->vht_caps.vht_cap_info.su_bformee;
-	pMsg->vht_config.su_beam_formee =
-		(uint8_t)value &&
-		(uint8_t)mac->mlme_cfg->vht_caps.vht_cap_info.tx_bfee_sap;
-	value = MLME_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_FW_DEF;
-	pMsg->vht_config.csnof_beamformer_antSup = (uint8_t)value;
-	pMsg->vht_config.mu_beam_formee = 0;
-
-	sme_debug("ht capability 0x%x VHT capability 0x%x",
-		  (*(uint32_t *) &pMsg->ht_config),
-		  (*(uint32_t *) &pMsg->vht_config));
 #ifdef WLAN_FEATURE_11W
 	pMsg->pmfCapable = pParam->mfpCapable;
 	pMsg->pmfRequired = pParam->mfpRequired;
@@ -16470,7 +16320,6 @@ QDF_STATUS csr_setup_vdev_session(struct vdev_mlme_obj *vdev_mlme)
 {
 	QDF_STATUS status;
 	uint32_t existing_session_id;
-	struct mlme_ht_capabilities_info *ht_cap_info;
 	struct csr_roam_session *session;
 	struct mlme_vht_capabilities_info *vht_cap_info;
 	u8 vdev_id;
@@ -16478,6 +16327,8 @@ QDF_STATUS csr_setup_vdev_session(struct vdev_mlme_obj *vdev_mlme)
 	mac_handle_t mac_handle;
 	struct mac_context *mac_ctx;
 	struct wlan_objmgr_vdev *vdev;
+	struct wlan_vht_config vht_config;
+	struct wlan_ht_config ht_cap;
 
 	mac_handle = cds_get_context(QDF_MODULE_ID_SME);
 	mac_ctx = MAC_CONTEXT(mac_handle);
@@ -16552,37 +16403,35 @@ QDF_STATUS csr_setup_vdev_session(struct vdev_mlme_obj *vdev_mlme)
 		return status;
 	}
 
-	ht_cap_info = &mac_ctx->mlme_cfg->ht_caps.ht_cap_info;
-	session->ht_config.ht_rx_ldpc = ht_cap_info->adv_coding_cap;
-	session->ht_config.ht_tx_stbc = ht_cap_info->tx_stbc;
-	session->ht_config.ht_rx_stbc = ht_cap_info->rx_stbc;
-	session->ht_config.ht_sgi20 = ht_cap_info->short_gi_20_mhz;
-	session->ht_config.ht_sgi40 = ht_cap_info->short_gi_40_mhz;
+	ht_cap.caps = 0;
+	vht_config.caps = 0;
+	ht_cap.ht_caps = mac_ctx->mlme_cfg->ht_caps.ht_cap_info;
+	vdev_mlme->proto.ht_info.ht_caps = ht_cap.caps;
 
-	session->vht_config.max_mpdu_len = vht_cap_info->ampdu_len;
-	session->vht_config.supported_channel_widthset =
+	vht_config.max_mpdu_len = vht_cap_info->ampdu_len;
+	vht_config.supported_channel_widthset =
 			vht_cap_info->supp_chan_width;
-	session->vht_config.ldpc_coding = vht_cap_info->ldpc_coding_cap;
-	session->vht_config.shortgi80 = vht_cap_info->short_gi_80mhz;
-	session->vht_config.shortgi160and80plus80 =
+	vht_config.ldpc_coding = vht_cap_info->ldpc_coding_cap;
+	vht_config.shortgi80 = vht_cap_info->short_gi_80mhz;
+	vht_config.shortgi160and80plus80 =
 			vht_cap_info->short_gi_160mhz;
-	session->vht_config.tx_stbc = vht_cap_info->tx_stbc;
-	session->vht_config.rx_stbc = vht_cap_info->rx_stbc;
-	session->vht_config.su_beam_former = vht_cap_info->su_bformer;
-	session->vht_config.su_beam_formee = vht_cap_info->su_bformee;
-	session->vht_config.csnof_beamformer_antSup =
+	vht_config.tx_stbc = vht_cap_info->tx_stbc;
+	vht_config.rx_stbc = vht_cap_info->rx_stbc;
+	vht_config.su_beam_former = vht_cap_info->su_bformer;
+	vht_config.su_beam_formee = vht_cap_info->su_bformee;
+	vht_config.csnof_beamformer_antSup =
 			vht_cap_info->tx_bfee_ant_supp;
-	session->vht_config.num_soundingdim = vht_cap_info->num_soundingdim;
-	session->vht_config.mu_beam_former = vht_cap_info->mu_bformer;
-	session->vht_config.mu_beam_formee = vht_cap_info->enable_mu_bformee;
-	session->vht_config.vht_txops = vht_cap_info->txop_ps;
-	session->vht_config.htc_vhtcap = vht_cap_info->htc_vhtc;
-	session->vht_config.rx_antpattern = vht_cap_info->rx_antpattern;
-	session->vht_config.tx_antpattern = vht_cap_info->tx_antpattern;
-
-	session->vht_config.max_ampdu_lenexp =
+	vht_config.num_soundingdim = vht_cap_info->num_soundingdim;
+	vht_config.mu_beam_former = vht_cap_info->mu_bformer;
+	vht_config.mu_beam_formee = vht_cap_info->enable_mu_bformee;
+	vht_config.vht_txops = vht_cap_info->txop_ps;
+	vht_config.htc_vhtcap = vht_cap_info->htc_vhtc;
+	vht_config.rx_antpattern = vht_cap_info->rx_antpattern;
+	vht_config.tx_antpattern = vht_cap_info->tx_antpattern;
+
+	vht_config.max_ampdu_lenexp =
 			vht_cap_info->ampdu_len_exponent;
-
+	vdev_mlme->proto.vht_info.caps = vht_config.caps;
 	csr_update_session_he_cap(mac_ctx, session);
 
 	/*