Browse Source

qcacld-3.0: Use intersection of AP's and self STBC capability

Use intersection of AP's and self STBC capability.

Change-Id: I98a5e3f424f7b5ca9c82c15e271aa9be901f4792
CRs-Fixed: 2207488
Arif Hussain 7 years ago
parent
commit
53cf569ad5

+ 58 - 4
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -2116,6 +2116,29 @@ static uint32_t lim_populate_vht_caps(tDot11fIEVHTCaps input_caps)
 	return vht_caps;
 }
 
+/**
+ * lim_update_he_stbc_capable() - Update stbc capable flag based on
+ * HE capability
+ * @add_sta_params: add sta related parameters
+ *
+ * Update stbc cpable flag based on HE capability
+ *
+ * Return: None
+ */
+#ifdef WLAN_FEATURE_11AX
+static void lim_update_he_stbc_capable(tpAddStaParams add_sta_params)
+{
+	if (add_sta_params &&
+	    add_sta_params->he_capable &&
+	    add_sta_params->stbc_capable)
+		add_sta_params->stbc_capable =
+			add_sta_params->he_config.rx_stbc_lt_80mhz;
+}
+#else
+static void lim_update_he_stbc_capable(tpAddStaParams add_sta_params)
+{}
+#endif
+
 /**
  * lim_add_sta()- called to add an STA context at hardware
  * @mac_ctx: pointer to global mac structure
@@ -2517,8 +2540,27 @@ lim_add_sta(tpAniSirGlobal mac_ctx,
 			add_sta_params->nwType = eSIR_11B_NW_TYPE;
 	}
 
-	msg_q.type = WMA_ADD_STA_REQ;
+	if (add_sta_params->htCapable && session_entry->htConfig.ht_tx_stbc) {
+		struct sDot11fIEHTCaps *ht_caps = (struct sDot11fIEHTCaps *)
+			&add_sta_params->ht_caps;
+		if (ht_caps->rxSTBC)
+			add_sta_params->stbc_capable = 1;
+		else
+			add_sta_params->stbc_capable = 0;
+	}
+
+	if (add_sta_params->vhtCapable && add_sta_params->stbc_capable) {
+		struct sDot11fIEVHTCaps *vht_caps = (struct sDot11fIEVHTCaps *)
+			&add_sta_params->vht_caps;
+		if (vht_caps->rxSTBC)
+			add_sta_params->stbc_capable = 1;
+		else
+			add_sta_params->stbc_capable = 0;
+	}
+
+	lim_update_he_stbc_capable(add_sta_params);
 
+	msg_q.type = WMA_ADD_STA_REQ;
 	msg_q.reserved = 0;
 	msg_q.bodyptr = add_sta_params;
 	msg_q.bodyval = 0;
@@ -3802,6 +3844,10 @@ tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
 				pAddBssParams->staContext.htCapable,
 				pAddBssParams->staContext.greenFieldCapable,
 				pAddBssParams->staContext.lsigTxopProtection);
+		if (psessionEntry->htConfig.ht_tx_stbc)
+			pAddBssParams->staContext.stbc_capable =
+				pAssocRsp->HTCaps.rxSTBC;
+
 		if (psessionEntry->vhtCapability &&
 				(IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps) ||
 				 IS_BSS_VHT_CAPABLE(pBeaconStruct->
@@ -3828,11 +3874,19 @@ tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
 			if ((vht_caps != NULL) && vht_caps->suBeamformeeCap &&
 				psessionEntry->vht_config.su_beam_former)
 				sta_context->enable_su_tx_bformer = 1;
+
+			if (vht_caps && pAddBssParams->staContext.stbc_capable)
+				pAddBssParams->staContext.stbc_capable =
+					vht_caps->rxSTBC;
 		}
 		if (lim_is_session_he_capable(psessionEntry) &&
-			pAssocRsp->he_cap.present)
-			lim_intersect_ap_he_caps(psessionEntry, pAddBssParams,
-					      NULL, pAssocRsp);
+		    pAssocRsp->he_cap.present) {
+			lim_intersect_ap_he_caps(psessionEntry,
+						 pAddBssParams,
+						 NULL,
+						 pAssocRsp);
+			lim_update_he_stbc_capable(&pAddBssParams->staContext);
+		}
 
 		if ((pAssocRsp->HTCaps.supportedChannelWidthSet) &&
 				(chanWidthSupp)) {

+ 22 - 0
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -539,6 +539,27 @@ lim_configure_ap_start_bss_session(tpAniSirGlobal mac_ctx, tpPESession session,
 
 }
 
+/**
+ * lim_clear_he_tx_stbc() - Clear tx stbc for a given session
+ * @session: Session
+ *
+ * Clear tx stbc for a given session
+ *
+ * Return: None
+ */
+#ifdef WLAN_FEATURE_11AX
+static void lim_clear_he_tx_stbc(tpPESession session)
+{
+	if (session) {
+		session->he_config.tx_stbc_lt_80mhz = 0;
+		session->he_config.tx_stbc_gt_80mhz = 0;
+	}
+}
+#else
+static void lim_clear_he_tx_stbc(tpPESession session)
+{}
+#endif
+
 /**
  * __lim_handle_sme_start_bss_request() - process SME_START_BSS_REQ message
  *@mac_ctx: Pointer to Global MAC structure
@@ -853,6 +874,7 @@ __lim_handle_sme_start_bss_request(tpAniSirGlobal mac_ctx, uint32_t *msg_buf)
 			session->vht_config.tx_stbc = 0;
 			session->vht_config.num_soundingdim = 0;
 			session->htConfig.ht_tx_stbc = 0;
+			lim_clear_he_tx_stbc(session);
 		}
 		/*
 		 * keep the RSN/WPA IE information in PE Session Entry

+ 2 - 0
core/wma/inc/wma_if.h

@@ -227,6 +227,7 @@ typedef struct sAniProbeRspStruct {
  * @atimIePresent: Peer Atim Info
  * @peerAtimWindowLength: peer ATIM Window length
  * @nss: Return the number of spatial streams supported
+ * @stbc_capable: stbc capable
  * @max_amsdu_num: Maximum number of MSDUs in a tx aggregate frame
  *
  * This structure contains parameter required for
@@ -329,6 +330,7 @@ typedef struct {
 	tDot11fIEhe_cap he_config;
 	tDot11fIEhe_op he_op;
 #endif
+	uint8_t stbc_capable;
 	uint8_t max_amsdu_num;
 } tAddStaParams, *tpAddStaParams;
 

+ 1 - 13
core/wma/src/wma_mgmt.c

@@ -1043,7 +1043,6 @@ QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
 	struct cdp_pdev *pdev;
 	struct peer_assoc_params *cmd;
 	int32_t ret, max_rates, i;
-	uint8_t rx_stbc, tx_stbc;
 	uint8_t *rate_pos;
 	wmi_rate_set peer_legacy_rates, peer_ht_rates;
 	uint32_t num_peer_11b_rates = 0;
@@ -1214,19 +1213,8 @@ QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
 	if (params->rmfEnabled)
 		cmd->peer_flags |= WMI_PEER_PMF;
 
-	rx_stbc = (params->ht_caps & IEEE80211_HTCAP_C_RXSTBC) >>
-		  IEEE80211_HTCAP_C_RXSTBC_S;
-	if (rx_stbc) {
+	if (params->stbc_capable)
 		cmd->peer_flags |= WMI_PEER_STBC;
-		cmd->peer_rate_caps |= (rx_stbc << WMI_RC_RX_STBC_FLAG_S);
-	}
-
-	tx_stbc = (params->ht_caps & IEEE80211_HTCAP_C_TXSTBC) >>
-		  IEEE80211_HTCAP_C_TXSTBC_S;
-	if (tx_stbc) {
-		cmd->peer_flags |= WMI_PEER_STBC;
-		cmd->peer_rate_caps |= (tx_stbc << WMI_RC_TX_STBC_FLAG_S);
-	}
 
 	if (params->htLdpcCapable || params->vhtLdpcCapable)
 		cmd->peer_flags |= WMI_PEER_LDPC;