Browse Source

Merge "qcacld-3.0: Add ecsa capability record"

Linux Build Service Account 7 years ago
parent
commit
5833b7c944

+ 2 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -752,6 +752,8 @@ typedef struct {
 
 	/** Rate Flags for this connection */
 	uint32_t  rate_flags;
+	/** Extended CSA */
+	uint8_t   ecsa_capable;
 } hdd_station_info_t;
 
 struct hdd_ap_ctx_s {

+ 16 - 12
core/hdd/src/wlan_hdd_hostapd.c

@@ -1186,6 +1186,9 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 			}
 		}
 
+		pHostapdAdapter->aStaInfo[staId].ecsa_capable = pSapEvent->
+			sapevt.sapStationAssocReassocCompleteEvent.ecsa_capable;
+
 		if (hdd_ipa_is_enabled(pHddCtx)) {
 			status = hdd_ipa_wlan_evt(pHostapdAdapter,
 					pHddApCtx->uBCStaId,
@@ -5127,18 +5130,19 @@ QDF_STATUS hdd_softap_get_sta_info(hdd_adapter_t *pAdapter, uint8_t *pBuf,
 	maxSta = hdd_ctx->config->maxNumberOfPeers;
 
 	for (i = 0; i <= maxSta; i++) {
-		if (pAdapter->aStaInfo[i].isUsed) {
-			len =
-				scnprintf(pBuf, buf_len,
-					  "%5d .%02x:%02x:%02x:%02x:%02x:%02x",
-					  pAdapter->aStaInfo[i].ucSTAId,
-					  pAdapter->aStaInfo[i].macAddrSTA.bytes[0],
-					  pAdapter->aStaInfo[i].macAddrSTA.bytes[1],
-					  pAdapter->aStaInfo[i].macAddrSTA.bytes[2],
-					  pAdapter->aStaInfo[i].macAddrSTA.bytes[3],
-					  pAdapter->aStaInfo[i].macAddrSTA.bytes[4],
-					  pAdapter->aStaInfo[i].macAddrSTA.
-					  bytes[5]);
+		hdd_station_info_t *sta_info_ptr = &pAdapter->aStaInfo[i];
+
+		if (sta_info_ptr->isUsed) {
+			len = scnprintf(pBuf, buf_len,
+					"%d %x:%x:%x:%x:%x:%x \t ecsa=%d\n",
+					sta_info_ptr->ucSTAId,
+					sta_info_ptr->macAddrSTA.bytes[0],
+					sta_info_ptr->macAddrSTA.bytes[1],
+					sta_info_ptr->macAddrSTA.bytes[2],
+					sta_info_ptr->macAddrSTA.bytes[3],
+					sta_info_ptr->macAddrSTA.bytes[4],
+					sta_info_ptr->macAddrSTA.bytes[5],
+					sta_info_ptr->ecsa_capable);
 			pBuf += len;
 			buf_len -= len;
 		}

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

@@ -1341,6 +1341,8 @@ typedef struct sSirSmeAssocInd {
 	uint8_t max_mcs_idx;
 	uint8_t rx_mcs_map;
 	uint8_t tx_mcs_map;
+	/* Extended CSA capability of station */
+	uint8_t ecsa_capable;
 } tSirSmeAssocInd, *tpSirSmeAssocInd;
 
 /* / Definition for Association confirm */

+ 2 - 0
core/mac/src/include/dph_global.h

@@ -265,6 +265,8 @@ typedef struct sDphHashNode {
 	int8_t del_sta_ctx_rssi;
 	bool sta_deletion_in_progress;
 	struct parsed_ies parsed_ies;
+	/* Flag indicating connected STA doesn't support ECSA */
+	uint8_t non_ecsa_capable;
 
 #ifdef WLAN_FEATURE_11AX
 	tDot11fIEvendor_he_cap he_config;

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

@@ -503,6 +503,8 @@ typedef struct sPESession       /* Added to Support BT-AMP */
 	bool ignore_assoc_disallowed;
 	bool send_p2p_conf_frame;
 	bool process_ho_fail;
+	/* Number of STAs that do not support ECSA capability */
+	uint8_t lim_non_ecsa_cap_num;
 #ifdef WLAN_FEATURE_11AX
 	bool he_capable;
 	tDot11fIEvendor_he_cap he_config;

+ 11 - 0
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -3031,6 +3031,17 @@ lim_delete_dph_hash_entry(tpAniSirGlobal mac_ctx, tSirMacAddr sta_addr,
 					sta_ds, &beacon_params, session_entry);
 		}
 
+		if (sta_ds->non_ecsa_capable) {
+			if (session_entry->lim_non_ecsa_cap_num == 0) {
+				pe_debug("NonECSA sta 0, id %d is ecsa",
+					 sta_id);
+			} else {
+				session_entry->lim_non_ecsa_cap_num--;
+				pe_debug("reducing the non ECSA num to %d",
+					 session_entry->lim_non_ecsa_cap_num);
+			}
+		}
+
 		if (LIM_IS_IBSS_ROLE(session_entry))
 			lim_ibss_decide_protection_on_delete(mac_ctx, sta_ds,
 				     &beacon_params, session_entry);

+ 11 - 0
core/mac/src/pe/lim/lim_process_assoc_req_frame.c

@@ -1368,6 +1368,13 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr,
 			(uint8_t) vht_caps->ldpcCodingCap;
 	}
 
+	if (assoc_req->ExtCap.present)
+		sta_ds->non_ecsa_capable =
+		    !((struct s_ext_cap *)assoc_req->ExtCap.bytes)->
+		    ext_chan_switch;
+	else
+		sta_ds->non_ecsa_capable = 1;
+
 	if (!assoc_req->wmeInfoPresent) {
 		sta_ds->mlmStaContext.htCapability = 0;
 		sta_ds->mlmStaContext.vhtCapability = 0;
@@ -2390,6 +2397,10 @@ void lim_send_mlm_assoc_ind(tpAniSirGlobal mac_ctx,
 			assoc_ind->max_mcs_idx = maxidx;
 		}
 		fill_mlm_assoc_ind_vht(assoc_req, sta_ds, assoc_ind);
+		if (assoc_req->ExtCap.present)
+			assoc_ind->ecsa_capable =
+			((struct s_ext_cap *)assoc_req->ExtCap.bytes)->
+			ext_chan_switch;
 
 		/* updates VHT information in assoc indication */
 		lim_fill_assoc_ind_vht_info(mac_ctx, session_entry, assoc_req,

+ 1 - 0
core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c

@@ -783,6 +783,7 @@ lim_fill_assoc_ind_params(tpAniSirGlobal mac_ctx,
 	sme_assoc_ind->max_mcs_idx = assoc_ind->max_mcs_idx;
 	sme_assoc_ind->rx_mcs_map = assoc_ind->rx_mcs_map;
 	sme_assoc_ind->tx_mcs_map = assoc_ind->tx_mcs_map;
+	sme_assoc_ind->ecsa_capable = assoc_ind->ecsa_capable;
 }
 
 /**

+ 3 - 0
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -1306,6 +1306,9 @@ lim_send_assoc_rsp_mgmt_frame(tpAniSirGlobal mac_ctx,
 			lim_decide_ap_protection(mac_ctx, peer_addr,
 				&beacon_params, pe_session);
 
+	if (LIM_IS_AP_ROLE(pe_session) && sta->non_ecsa_capable)
+		pe_session->lim_non_ecsa_cap_num++;
+
 	lim_update_short_preamble(mac_ctx, peer_addr, &beacon_params,
 		pe_session);
 	lim_update_short_slot_time(mac_ctx, peer_addr, &beacon_params,

+ 2 - 0
core/mac/src/pe/lim/lim_types.h

@@ -277,6 +277,7 @@ typedef struct sLimMlmAssocInd {
 	uint8_t max_mcs_idx;
 	uint8_t rx_mcs_map;
 	uint8_t tx_mcs_map;
+	uint8_t ecsa_capable;
 } tLimMlmAssocInd, *tpLimMlmAssocInd;
 
 typedef struct sLimMlmReassocReq {
@@ -314,6 +315,7 @@ typedef struct sLimMlmReassocInd {
 	uint8_t *beaconPtr;
 	uint32_t assocReqLength;
 	uint8_t *assocReqPtr;
+	uint8_t ecsa_capable;
 } tLimMlmReassocInd, *tpLimMlmReassocInd;
 
 typedef struct sLimMlmAuthCnf {

+ 2 - 0
core/sap/inc/sap_api.h

@@ -266,6 +266,7 @@ typedef struct sap_StationAssocIndication_s {
 	eCsrEncryptionType negotiatedUCEncryptionType;
 	eCsrEncryptionType negotiatedMCEncryptionType;
 	bool fAuthRequired;
+	uint8_t ecsa_capable;
 } tSap_StationAssocIndication;
 
 typedef struct sap_StationAssocReassocCompleteEvent_s {
@@ -298,6 +299,7 @@ typedef struct sap_StationAssocReassocCompleteEvent_s {
 	uint8_t max_mcs_idx;
 	uint8_t rx_mcs_map;
 	uint8_t tx_mcs_map;
+	uint8_t ecsa_capable;
 } tSap_StationAssocReassocCompleteEvent;
 
 typedef struct sap_StationDisassocCompleteEvent_s {

+ 2 - 0
core/sap/src/sap_fsm.c

@@ -2322,6 +2322,7 @@ QDF_STATUS sap_signal_hdd_event(ptSapContext sap_ctx,
 		assoc_ind->assocReqLength = csr_roaminfo->assocReqLength;
 		assoc_ind->assocReqPtr = csr_roaminfo->assocReqPtr;
 		assoc_ind->fWmmEnabled = csr_roaminfo->wmmEnabledSta;
+		assoc_ind->ecsa_capable = csr_roaminfo->ecsa_capable;
 		if (csr_roaminfo->u.pConnectedProfile != NULL) {
 			assoc_ind->negotiatedAuthType =
 				csr_roaminfo->u.pConnectedProfile->AuthType;
@@ -2462,6 +2463,7 @@ QDF_STATUS sap_signal_hdd_event(ptSapContext sap_ctx,
 		reassoc_complete->max_mcs_idx = csr_roaminfo->max_mcs_idx;
 		reassoc_complete->rx_mcs_map = csr_roaminfo->rx_mcs_map;
 		reassoc_complete->tx_mcs_map = csr_roaminfo->tx_mcs_map;
+		reassoc_complete->ecsa_capable = csr_roaminfo->ecsa_capable;
 		break;
 
 	case eSAP_STA_DISASSOC_EVENT:

+ 4 - 0
core/sme/inc/csr_api.h

@@ -1462,6 +1462,8 @@ typedef struct tagCsrRoamInfo {
 	uint8_t max_mcs_idx;
 	uint8_t rx_mcs_map;
 	uint8_t tx_mcs_map;
+	/* Extended capabilities of STA */
+	uint8_t ecsa_capable;
 } tCsrRoamInfo;
 
 typedef struct tagCsrFreqScanInfo {
@@ -1500,6 +1502,8 @@ typedef struct sSirSmeAssocIndToUpperLayerCnf {
 	uint8_t max_mcs_idx;
 	uint8_t rx_mcs_map;
 	uint8_t tx_mcs_map;
+	/* Extended capabilities of STA */
+	uint8_t              ecsa_capable;
 } tSirSmeAssocIndToUpperLayerCnf, *tpSirSmeAssocIndToUpperLayerCnf;
 
 typedef struct tagCsrSummaryStatsInfo {

+ 5 - 0
core/sme/src/csr/csr_api_roam.c

@@ -9868,6 +9868,7 @@ void csr_roam_joined_state_msg_processor(tpAniSirGlobal pMac, void *pMsgBuf)
 		pRoamInfo->max_mcs_idx = pUpperLayerAssocCnf->max_mcs_idx;
 		pRoamInfo->rx_mcs_map = pUpperLayerAssocCnf->rx_mcs_map;
 		pRoamInfo->tx_mcs_map = pUpperLayerAssocCnf->tx_mcs_map;
+		pRoamInfo->ecsa_capable = pUpperLayerAssocCnf->ecsa_capable;
 		if (CSR_IS_INFRA_AP(pRoamInfo->u.pConnectedProfile)) {
 			pMac->roam.roamSession[sessionId].connectState =
 				eCSR_ASSOC_STATE_TYPE_INFRA_CONNECTED;
@@ -10619,6 +10620,7 @@ csr_roam_chk_lnk_assoc_ind(tpAniSirGlobal mac_ctx, tSirSmeRsp *msg_ptr)
 		     sizeof(struct qdf_mac_addr));
 	roam_info_ptr->wmmEnabledSta = pAssocInd->wmmEnabledSta;
 	roam_info_ptr->timingMeasCap = pAssocInd->timingMeasCap;
+	roam_info_ptr->ecsa_capable = pAssocInd->ecsa_capable;
 	qdf_mem_copy(&roam_info_ptr->chan_info,
 		     &pAssocInd->chan_info,
 		     sizeof(tSirSmeChanInfo));
@@ -15278,6 +15280,9 @@ QDF_STATUS csr_send_assoc_ind_to_upper_layer_cnf_msg(tpAniSirGlobal pMac,
 		pBuf = (uint8_t *)&pMsg->tx_mcs_map;
 		*pBuf = pAssocInd->tx_mcs_map;
 
+		pBuf = (uint8_t *)&pMsg->ecsa_capable;
+		*pBuf = pAssocInd->ecsa_capable;
+
 		msgQ.type = eWNI_SME_UPPER_LAYER_ASSOC_CNF;
 		msgQ.bodyptr = pMsg;
 		msgQ.bodyval = 0;