Parcourir la source

qcacld-3.0: Cleanup sta index references in lim

Remove sta index references in lim since mac address
would be used instead of this index as part of the
sta index cleanup.

Change-Id: Ia7cbb94cf988a04506440ddaca6b1c302e13e852
CRs-Fixed: 2524509
Yeshwanth Sriram Guntuka il y a 5 ans
Parent
commit
d2a2291473

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

@@ -1587,7 +1587,6 @@ typedef struct sSmeIbssPeerInd {
 	uint8_t sessionId;
 	uint8_t sessionId;
 
 
 	struct qdf_mac_addr peer_addr;
 	struct qdf_mac_addr peer_addr;
-	uint16_t staId;
 
 
 	/* Beacon will be appended for new Peer indication. */
 	/* Beacon will be appended for new Peer indication. */
 } tSmeIbssPeerInd, *tpSmeIbssPeerInd;
 } tSmeIbssPeerInd, *tpSmeIbssPeerInd;

+ 2 - 46
core/mac/src/dph/dph_hash_table.c

@@ -158,44 +158,6 @@ static inline tpDphHashNode get_node(struct mac_context *mac, uint8_t assocId,
 	return &hash_table->pDphNodeArray[assocId];
 	return &hash_table->pDphNodeArray[assocId];
 }
 }
 
 
-/* --------------------------------------------------------------------- */
-/**
- * dph_lookup_assoc_id
- *
- * FUNCTION:
- * This function looks up assocID given the station Id. It traverses the complete table to do this.
- * Need to find an efficient way to do this.
- * LOGIC:
- *
- * ASSUMPTIONS:
- *
- * NOTE:
- *
- * @param mac pointer to global Mac structure.
- * @param staIdx station ID
- * @param *assocId pointer to associd to be returned by this function.
- * @return pointer to the dph node.
- */
-tpDphHashNode dph_lookup_assoc_id(struct mac_context *mac, uint16_t staIdx,
-				  uint16_t *assocId,
-				  struct dph_hash_table *hash_table)
-{
-	uint8_t i;
-
-	for (i = 0; i < hash_table->size; i++) {
-		if ((hash_table->pDphNodeArray[i].added) &&
-		    (hash_table->pDphNodeArray[i].staIndex == staIdx)) {
-			*assocId = i;
-			break;
-		}
-
-	}
-	if (i == hash_table->size)
-		return NULL;
-	return &hash_table->pDphNodeArray[i];
-
-}
-
 /** -------------------------------------------------------------
 /** -------------------------------------------------------------
    \fn dph_init_sta_state
    \fn dph_init_sta_state
    \brief Initialize STA state. this function saves the staId from the current entry in the DPH table with given assocId
    \brief Initialize STA state. this function saves the staId from the current entry in the DPH table with given assocId
@@ -209,11 +171,10 @@ tpDphHashNode dph_lookup_assoc_id(struct mac_context *mac, uint16_t staIdx,
    -------------------------------------------------------------*/
    -------------------------------------------------------------*/
 
 
 tpDphHashNode dph_init_sta_state(struct mac_context *mac, tSirMacAddr staAddr,
 tpDphHashNode dph_init_sta_state(struct mac_context *mac, tSirMacAddr staAddr,
-				 uint16_t assocId, uint8_t validStaIdx,
+				 uint16_t assocId,
 				 struct dph_hash_table *hash_table)
 				 struct dph_hash_table *hash_table)
 {
 {
 	tpDphHashNode sta, pnext;
 	tpDphHashNode sta, pnext;
-	uint16_t staIdx = STA_INVALID_IDX;
 
 
 	if (assocId >= hash_table->size) {
 	if (assocId >= hash_table->size) {
 		pe_err("Invalid Assoc Id %d", assocId);
 		pe_err("Invalid Assoc Id %d", assocId);
@@ -221,7 +182,6 @@ tpDphHashNode dph_init_sta_state(struct mac_context *mac, tSirMacAddr staAddr,
 	}
 	}
 
 
 	sta = get_node(mac, (uint8_t) assocId, hash_table);
 	sta = get_node(mac, (uint8_t) assocId, hash_table);
-	staIdx = sta->staIndex;
 	pnext = sta->next;
 	pnext = sta->next;
 
 
 	/* Clear the STA node except for the next pointer */
 	/* Clear the STA node except for the next pointer */
@@ -230,10 +190,6 @@ tpDphHashNode dph_init_sta_state(struct mac_context *mac, tSirMacAddr staAddr,
 
 
 	/* Initialize the assocId */
 	/* Initialize the assocId */
 	sta->assocId = assocId;
 	sta->assocId = assocId;
-	if (true == validStaIdx)
-		sta->staIndex = staIdx;
-	else
-		sta->staIndex = STA_INVALID_IDX;
 
 
 	/* Initialize STA mac address */
 	/* Initialize STA mac address */
 	qdf_mem_copy(sta->staAddr, staAddr, sizeof(tSirMacAddr));
 	qdf_mem_copy(sta->staAddr, staAddr, sizeof(tSirMacAddr));
@@ -304,7 +260,7 @@ tpDphHashNode dph_add_hash_entry(struct mac_context *mac, tSirMacAddr staAddr,
 		return NULL;
 		return NULL;
 	} else {
 	} else {
 		if (dph_init_sta_state
 		if (dph_init_sta_state
-			    (mac, staAddr, assocId, false, hash_table) == NULL) {
+			    (mac, staAddr, assocId, hash_table) == NULL) {
 			pe_err("could not Init STA id: %d", assocId);
 			pe_err("could not Init STA id: %d", assocId);
 			return NULL;
 			return NULL;
 		}
 		}

+ 2 - 5
core/mac/src/dph/dph_hash_table.h

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2011-2015, 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2015, 2017-2019 The Linux Foundation. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -57,9 +57,6 @@ struct dph_hash_table {
 tpDphHashNode dph_lookup_hash_entry(struct mac_context *mac, uint8_t staAddr[],
 tpDphHashNode dph_lookup_hash_entry(struct mac_context *mac, uint8_t staAddr[],
 				    uint16_t *pStaId,
 				    uint16_t *pStaId,
 				    struct dph_hash_table *hash_table);
 				    struct dph_hash_table *hash_table);
-tpDphHashNode dph_lookup_assoc_id(struct mac_context *mac, uint16_t staIdx,
-				  uint16_t *assocId,
-				  struct dph_hash_table *hash_table);
 
 
 /* Get a pointer to the hash node */
 /* Get a pointer to the hash node */
 tpDphHashNode dph_get_hash_entry(struct mac_context *mac, uint16_t staId,
 tpDphHashNode dph_get_hash_entry(struct mac_context *mac, uint16_t staId,
@@ -87,7 +84,7 @@ void dph_hash_table_init(struct mac_context *mac,
 /* Initialize STA state */
 /* Initialize STA state */
 tpDphHashNode dph_init_sta_state(struct mac_context *mac,
 tpDphHashNode dph_init_sta_state(struct mac_context *mac,
 				 tSirMacAddr staAddr,
 				 tSirMacAddr staAddr,
-				 uint16_t staId, uint8_t validStaIdx,
+				 uint16_t staId,
 				 struct dph_hash_table *hash_table);
 				 struct dph_hash_table *hash_table);
 
 
 #endif
 #endif

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

@@ -142,8 +142,6 @@ typedef struct sDphHashNode {
 	uint8_t htSupportedChannelWidthSet:1;
 	uint8_t htSupportedChannelWidthSet:1;
 	uint8_t htSecondaryChannelOffset:2;
 	uint8_t htSecondaryChannelOffset:2;
 	uint16_t assocId;       /* Association ID */
 	uint16_t assocId;       /* Association ID */
-	/* This is the real sta index generated by HAL */
-	uint16_t staIndex;
 	uint8_t staAddr[6];
 	uint8_t staAddr[6];
 	uint8_t staType;
 	uint8_t staType;
 
 

+ 0 - 3
core/mac/src/pe/include/lim_admit_control.h

@@ -74,20 +74,17 @@ lim_admit_control_delete_ts(struct mac_context *mac,
 QDF_STATUS lim_admit_control_init(struct mac_context *mac);
 QDF_STATUS lim_admit_control_init(struct mac_context *mac);
 #ifdef FEATURE_WLAN_ESE
 #ifdef FEATURE_WLAN_ESE
 QDF_STATUS lim_send_hal_msg_add_ts(struct mac_context *mac,
 QDF_STATUS lim_send_hal_msg_add_ts(struct mac_context *mac,
-				      uint16_t staIdx,
 				      uint8_t tspecIdx,
 				      uint8_t tspecIdx,
 				      struct mac_tspec_ie tspecIE,
 				      struct mac_tspec_ie tspecIE,
 				      uint8_t sessionId, uint16_t tsm_interval);
 				      uint8_t sessionId, uint16_t tsm_interval);
 #else
 #else
 QDF_STATUS lim_send_hal_msg_add_ts(struct mac_context *mac,
 QDF_STATUS lim_send_hal_msg_add_ts(struct mac_context *mac,
-				      uint16_t staIdx,
 				      uint8_t tspecIdx,
 				      uint8_t tspecIdx,
 				      struct mac_tspec_ie tspecIE,
 				      struct mac_tspec_ie tspecIE,
 				      uint8_t sessionId);
 				      uint8_t sessionId);
 #endif
 #endif
 
 
 QDF_STATUS lim_send_hal_msg_del_ts(struct mac_context *mac,
 QDF_STATUS lim_send_hal_msg_del_ts(struct mac_context *mac,
-				      uint16_t staIdx,
 				      uint8_t tspecIdx,
 				      uint8_t tspecIdx,
 				      struct delts_req_info delts,
 				      struct delts_req_info delts,
 				      uint8_t sessionId, uint8_t *bssId);
 				      uint8_t sessionId, uint8_t *bssId);

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

@@ -685,21 +685,6 @@ struct pe_session *pe_find_session_by_peer_sta(struct mac_context *mac, uint8_t
 struct pe_session *pe_find_session_by_session_id(struct mac_context *mac,
 struct pe_session *pe_find_session_by_session_id(struct mac_context *mac,
 					  uint8_t sessionId);
 					  uint8_t sessionId);
 
 
-/**
- * pe_find_session_by_bssid() - looks up the PE session given staid.
- *
- * @mac:          pointer to global adapter context
- * @staid:         StaId of the session
- * @sessionId:     session ID is returned here, if session is found.
- *
- * This function returns the session context and the session ID if the session
- * corresponding to the given StaId is found in the PE session table.
- *
- * Return: pointer to the session context or NULL if session is not found.
- */
-struct pe_session *pe_find_session_by_sta_id(struct mac_context *mac, uint8_t staid,
-				      uint8_t *sessionId);
-
 /**
 /**
  * pe_delete_session() - deletes the PE session given the session ID.
  * pe_delete_session() - deletes the PE session given the session ID.
  *
  *

+ 2 - 9
core/mac/src/pe/lim/lim_admit_control.c

@@ -793,7 +793,6 @@ QDF_STATUS lim_admit_control_init(struct mac_context *mac)
    \fn lim_send_hal_msg_add_ts
    \fn lim_send_hal_msg_add_ts
    \brief Send halMsg_AddTs to HAL
    \brief Send halMsg_AddTs to HAL
    \param   struct mac_context *mac
    \param   struct mac_context *mac
-   \param     uint16_t        staIdx
    \param     uint8_t         tspecIdx
    \param     uint8_t         tspecIdx
    \param       struct mac_tspec_ie tspecIE
    \param       struct mac_tspec_ie tspecIE
    \param       tSirTclasInfo   *tclasInfo
    \param       tSirTclasInfo   *tclasInfo
@@ -804,14 +803,12 @@ QDF_STATUS lim_admit_control_init(struct mac_context *mac)
 #ifdef FEATURE_WLAN_ESE
 #ifdef FEATURE_WLAN_ESE
 QDF_STATUS
 QDF_STATUS
 lim_send_hal_msg_add_ts(struct mac_context *mac,
 lim_send_hal_msg_add_ts(struct mac_context *mac,
-			uint16_t staIdx,
 			uint8_t tspecIdx,
 			uint8_t tspecIdx,
 			struct mac_tspec_ie tspecIE,
 			struct mac_tspec_ie tspecIE,
 			uint8_t sessionId, uint16_t tsm_interval)
 			uint8_t sessionId, uint16_t tsm_interval)
 #else
 #else
 QDF_STATUS
 QDF_STATUS
 lim_send_hal_msg_add_ts(struct mac_context *mac,
 lim_send_hal_msg_add_ts(struct mac_context *mac,
-			uint16_t staIdx,
 			uint8_t tspecIdx,
 			uint8_t tspecIdx,
 			struct mac_tspec_ie tspecIE,
 			struct mac_tspec_ie tspecIE,
 			uint8_t sessionId)
 			uint8_t sessionId)
@@ -832,7 +829,6 @@ lim_send_hal_msg_add_ts(struct mac_context *mac,
 	if (!pAddTsParam)
 	if (!pAddTsParam)
 		return QDF_STATUS_E_NOMEM;
 		return QDF_STATUS_E_NOMEM;
 
 
-	pAddTsParam->sta_idx = staIdx;
 	pAddTsParam->tspec_idx = tspecIdx;
 	pAddTsParam->tspec_idx = tspecIdx;
 	qdf_mem_copy(&pAddTsParam->tspec, &tspecIE,
 	qdf_mem_copy(&pAddTsParam->tspec, &tspecIE,
 		     sizeof(struct mac_tspec_ie));
 		     sizeof(struct mac_tspec_ie));
@@ -871,7 +867,6 @@ lim_send_hal_msg_add_ts(struct mac_context *mac,
    \fn lim_send_hal_msg_del_ts
    \fn lim_send_hal_msg_del_ts
    \brief Send halMsg_AddTs to HAL
    \brief Send halMsg_AddTs to HAL
    \param   struct mac_context *mac
    \param   struct mac_context *mac
-   \param     uint16_t        staIdx
    \param     uint8_t         tspecIdx
    \param     uint8_t         tspecIdx
    \param     tSirAddtsReqInfo addts
    \param     tSirAddtsReqInfo addts
    \return QDF_STATUS - status
    \return QDF_STATUS - status
@@ -879,7 +874,6 @@ lim_send_hal_msg_add_ts(struct mac_context *mac,
 
 
 QDF_STATUS
 QDF_STATUS
 lim_send_hal_msg_del_ts(struct mac_context *mac,
 lim_send_hal_msg_del_ts(struct mac_context *mac,
-			uint16_t staIdx,
 			uint8_t tspecIdx,
 			uint8_t tspecIdx,
 			struct delts_req_info delts,
 			struct delts_req_info delts,
 			uint8_t sessionId, uint8_t *bssId)
 			uint8_t sessionId, uint8_t *bssId)
@@ -897,7 +891,6 @@ lim_send_hal_msg_del_ts(struct mac_context *mac,
 	msg.bodyval = 0;
 	msg.bodyval = 0;
 
 
 	/* filling message parameters. */
 	/* filling message parameters. */
-	pDelTsParam->staIdx = staIdx;
 	pDelTsParam->tspecIdx = tspecIdx;
 	pDelTsParam->tspecIdx = tspecIdx;
 	qdf_mem_copy(&pDelTsParam->bssId, bssId, sizeof(tSirMacAddr));
 	qdf_mem_copy(&pDelTsParam->bssId, bssId, sizeof(tSirMacAddr));
 
 
@@ -999,8 +992,8 @@ void lim_process_hal_add_ts_rsp(struct mac_context *mac,
 
 
 		/* Delete TSPEC */
 		/* Delete TSPEC */
 		/* 090803: Pull the hash table from the session */
 		/* 090803: Pull the hash table from the session */
-		pSta = dph_lookup_assoc_id(mac, pAddTsRspMsg->sta_idx, &assocId,
-					   &pe_session->dph.dphHashTable);
+		pSta = dph_lookup_hash_entry(mac, peerMacAddr, &assocId,
+					     &pe_session->dph.dphHashTable);
 		if (pSta)
 		if (pSta)
 			lim_admit_control_delete_ts(mac, assocId,
 			lim_admit_control_delete_ts(mac, assocId,
 						    &pAddTsRspMsg->tspec.tsinfo,
 						    &pAddTsRspMsg->tspec.tsinfo,

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

@@ -2492,7 +2492,6 @@ pe_roam_synch_callback(struct mac_context *mac_ctx,
 
 
 	roam_sync_ind_ptr->join_rsp->vht_channel_width =
 	roam_sync_ind_ptr->join_rsp->vht_channel_width =
 					ft_session_ptr->ch_width;
 					ft_session_ptr->ch_width;
-	roam_sync_ind_ptr->join_rsp->staId = curr_sta_ds->staIndex;
 	roam_sync_ind_ptr->join_rsp->timingMeasCap = curr_sta_ds->timingMeasCap;
 	roam_sync_ind_ptr->join_rsp->timingMeasCap = curr_sta_ds->timingMeasCap;
 	roam_sync_ind_ptr->join_rsp->nss = curr_sta_ds->nss;
 	roam_sync_ind_ptr->join_rsp->nss = curr_sta_ds->nss;
 	roam_sync_ind_ptr->join_rsp->max_rate_flags =
 	roam_sync_ind_ptr->join_rsp->max_rate_flags =

+ 7 - 5
core/mac/src/pe/lim/lim_ft.c

@@ -845,18 +845,20 @@ void lim_process_ft_aggr_qos_rsp(struct mac_context *mac,
 		if ((((1 << i) & pAggrQosRspMsg->tspecIdx)) &&
 		if ((((1 << i) & pAggrQosRspMsg->tspecIdx)) &&
 		    (pAggrQosRspMsg->status[i] != QDF_STATUS_SUCCESS)) {
 		    (pAggrQosRspMsg->status[i] != QDF_STATUS_SUCCESS)) {
 			sir_copy_mac_addr(peerMacAddr, pe_session->bssId);
 			sir_copy_mac_addr(peerMacAddr, pe_session->bssId);
-			addTsParam.sta_idx = pAggrQosRspMsg->staIdx;
 			addTsParam.pe_session_id = pAggrQosRspMsg->sessionId;
 			addTsParam.pe_session_id = pAggrQosRspMsg->sessionId;
 			addTsParam.tspec = pAggrQosRspMsg->tspec[i];
 			addTsParam.tspec = pAggrQosRspMsg->tspec[i];
 			addTsParam.tspec_idx = pAggrQosRspMsg->tspecIdx;
 			addTsParam.tspec_idx = pAggrQosRspMsg->tspecIdx;
-			lim_send_delts_req_action_frame(mac, peerMacAddr, rspReqd,
+			lim_send_delts_req_action_frame(mac, peerMacAddr,
+							rspReqd,
 							&addTsParam.tspec.tsinfo,
 							&addTsParam.tspec.tsinfo,
 							&addTsParam.tspec,
 							&addTsParam.tspec,
 							pe_session);
 							pe_session);
 			pSta =
 			pSta =
-				dph_lookup_assoc_id(mac, addTsParam.sta_idx,
-						    &assocId,
-						    &pe_session->dph.dphHashTable);
+				dph_lookup_hash_entry(mac, peerMacAddr,
+						      &assocId,
+						      &pe_session->
+						      dph.dphHashTable);
+
 			if (pSta) {
 			if (pSta) {
 				lim_admit_control_delete_ts(mac, assocId,
 				lim_admit_control_delete_ts(mac, assocId,
 							    &addTsParam.tspec.
 							    &addTsParam.tspec.

+ 10 - 14
core/mac/src/pe/lim/lim_ibss_peer_mgmt.c

@@ -459,7 +459,7 @@ ibss_dph_entry_add(struct mac_context *mac,
 /* send a status change notification */
 /* send a status change notification */
 static void
 static void
 ibss_status_chg_notify(struct mac_context *mac, tSirMacAddr peerAddr,
 ibss_status_chg_notify(struct mac_context *mac, tSirMacAddr peerAddr,
-		       uint16_t staIndex, uint16_t status, uint8_t sessionId)
+		       uint16_t status, uint8_t sessionId)
 {
 {
 
 
 	tLimIbssPeerNode *peerNode;
 	tLimIbssPeerNode *peerNode;
@@ -476,7 +476,7 @@ ibss_status_chg_notify(struct mac_context *mac, tSirMacAddr peerAddr,
 		peerNode->beaconLen = 0;
 		peerNode->beaconLen = 0;
 	}
 	}
 
 
-	lim_send_sme_ibss_peer_ind(mac, peerAddr, staIndex,
+	lim_send_sme_ibss_peer_ind(mac, peerAddr,
 				   beacon, bcnLen, status, sessionId);
 				   beacon, bcnLen, status, sessionId);
 
 
 	if (beacon) {
 	if (beacon) {
@@ -672,7 +672,6 @@ void lim_ibss_delete_all_peers(struct mac_context *mac,
 		if (sta) {
 		if (sta) {
 
 
 			ibss_status_chg_notify(mac, pCurrNode->peerMacAddr,
 			ibss_status_chg_notify(mac, pCurrNode->peerMacAddr,
-					       sta->staIndex,
 					       eWNI_SME_IBSS_PEER_DEPARTED_IND,
 					       eWNI_SME_IBSS_PEER_DEPARTED_IND,
 					       pe_session->smeSessionId);
 					       pe_session->smeSessionId);
 			lim_del_sta(mac, sta, false, pe_session);
 			lim_del_sta(mac, sta, false, pe_session);
@@ -1009,6 +1008,7 @@ lim_ibss_search_and_delete_peer(struct mac_context *mac_ctx,
  * @mac_ptr: Pointer to Global MAC structure
  * @mac_ptr: Pointer to Global MAC structure
  * @session_entry: Session entry
  * @session_entry: Session entry
  * @mac_addr: Mac Address of the IBSS peer
  * @mac_addr: Mac Address of the IBSS peer
+ * @del_sta: del sta sent to firmware if true
  *
  *
  * This function is called delete IBSS peer.
  * This function is called delete IBSS peer.
  *
  *
@@ -1017,7 +1017,8 @@ lim_ibss_search_and_delete_peer(struct mac_context *mac_ctx,
  */
  */
 static void
 static void
 lim_ibss_delete_peer(struct mac_context *mac_ctx,
 lim_ibss_delete_peer(struct mac_context *mac_ctx,
-			struct pe_session *session_entry, tSirMacAddr mac_addr)
+			struct pe_session *session_entry, tSirMacAddr mac_addr,
+			bool del_sta)
 {
 {
 	tpDphHashNode sta = NULL;
 	tpDphHashNode sta = NULL;
 	uint16_t peer_idx = 0;
 	uint16_t peer_idx = 0;
@@ -1036,7 +1037,7 @@ lim_ibss_delete_peer(struct mac_context *mac_ctx,
 		return;
 		return;
 	}
 	}
 
 
-	if (STA_INVALID_IDX != sta->staIndex) {
+	if (del_sta) {
 		lim_del_sta(mac_ctx, sta,
 		lim_del_sta(mac_ctx, sta,
 			  true, session_entry);
 			  true, session_entry);
 	} else {
 	} else {
@@ -1098,7 +1099,6 @@ void lim_process_ibss_del_sta_rsp(struct mac_context *mac_ctx,
 
 
 	ibss_status_chg_notify(mac_ctx,
 	ibss_status_chg_notify(mac_ctx,
 		del_sta_params->staMac,
 		del_sta_params->staMac,
-		sta_ds->staIndex,
 		eWNI_SME_IBSS_PEER_DEPARTED_IND,
 		eWNI_SME_IBSS_PEER_DEPARTED_IND,
 		pe_session->smeSessionId);
 		pe_session->smeSessionId);
 
 
@@ -1139,7 +1139,7 @@ lim_ibss_add_sta_rsp(struct mac_context *mac, void *msg, struct pe_session *pe_s
 			pAddStaParams->status,
 			pAddStaParams->status,
 			QDF_MAC_ADDR_ARRAY(pAddStaParams->staMac));
 			QDF_MAC_ADDR_ARRAY(pAddStaParams->staMac));
 		lim_ibss_delete_peer(mac,
 		lim_ibss_delete_peer(mac,
-			pe_session, pAddStaParams->staMac);
+			pe_session, pAddStaParams->staMac, false);
 		qdf_mem_free(pAddStaParams);
 		qdf_mem_free(pAddStaParams);
 		return QDF_STATUS_E_FAILURE;
 		return QDF_STATUS_E_FAILURE;
 	}
 	}
@@ -1150,7 +1150,6 @@ lim_ibss_add_sta_rsp(struct mac_context *mac, void *msg, struct pe_session *pe_s
 	pe_debug("IBSS: sending IBSS_NEW_PEER msg to SME!");
 	pe_debug("IBSS: sending IBSS_NEW_PEER msg to SME!");
 
 
 	ibss_status_chg_notify(mac, pAddStaParams->staMac,
 	ibss_status_chg_notify(mac, pAddStaParams->staMac,
-			       sta->staIndex,
 			       eWNI_SME_IBSS_NEW_PEER_IND,
 			       eWNI_SME_IBSS_NEW_PEER_IND,
 			       pe_session->smeSessionId);
 			       pe_session->smeSessionId);
 
 
@@ -1335,7 +1334,7 @@ lim_ibss_coalesce(struct mac_context *mac,
 		pPeerNode = ibss_peer_find(mac, pHdr->sa);
 		pPeerNode = ibss_peer_find(mac, pHdr->sa);
 		if (pPeerNode) {
 		if (pPeerNode) {
 			lim_ibss_delete_peer(mac, pe_session,
 			lim_ibss_delete_peer(mac, pe_session,
-							  pHdr->sa);
+							  pHdr->sa, true);
 			pe_warn("Peer attempting to reconnect before HB timeout, deleted");
 			pe_warn("Peer attempting to reconnect before HB timeout, deleted");
 			return QDF_STATUS_E_INVAL;
 			return QDF_STATUS_E_INVAL;
 		}
 		}
@@ -1465,7 +1464,6 @@ void lim_ibss_heart_beat_handle(struct mac_context *mac_ctx, struct pe_session *
 	uint16_t peer_idx = 0;
 	uint16_t peer_idx = 0;
 	tpDphHashNode stads = 0;
 	tpDphHashNode stads = 0;
 	uint32_t threshold = 0;
 	uint32_t threshold = 0;
-	uint16_t sta_idx = 0;
 
 
 	/*
 	/*
 	 * MLM BSS is started and if PE in scanmode then MLM state will be
 	 * MLM BSS is started and if PE in scanmode then MLM state will be
@@ -1504,8 +1502,6 @@ void lim_ibss_heart_beat_handle(struct mac_context *mac_ctx, struct pe_session *
 					tempnode->peerMacAddr, &peer_idx,
 					tempnode->peerMacAddr, &peer_idx,
 					&session->dph.dphHashTable);
 					&session->dph.dphHashTable);
 			if (stads) {
 			if (stads) {
-				sta_idx = stads->staIndex;
-
 				(void)lim_del_sta(mac_ctx, stads, false,
 				(void)lim_del_sta(mac_ctx, stads, false,
 						  session);
 						  session);
 				lim_delete_dph_hash_entry(mac_ctx,
 				lim_delete_dph_hash_entry(mac_ctx,
@@ -1514,7 +1510,7 @@ void lim_ibss_heart_beat_handle(struct mac_context *mac_ctx, struct pe_session *
 						     session);
 						     session);
 				/* Send indication. */
 				/* Send indication. */
 				ibss_status_chg_notify(mac_ctx,
 				ibss_status_chg_notify(mac_ctx,
-					tempnode->peerMacAddr, sta_idx,
+					tempnode->peerMacAddr,
 					eWNI_SME_IBSS_PEER_DEPARTED_IND,
 					eWNI_SME_IBSS_PEER_DEPARTED_IND,
 					session->smeSessionId);
 					session->smeSessionId);
 			}
 			}
@@ -1638,7 +1634,7 @@ __lim_ibss_peer_inactivity_handler(struct mac_context *mac,
 	}
 	}
 
 
 	/* delete the peer for which heartbeat is observed */
 	/* delete the peer for which heartbeat is observed */
-	lim_ibss_delete_peer(mac, pe_session, ind->peer_addr.bytes);
+	lim_ibss_delete_peer(mac, pe_session, ind->peer_addr.bytes, true);
 }
 }
 
 
 /** -------------------------------------------------------------
 /** -------------------------------------------------------------

+ 6 - 18
core/mac/src/pe/lim/lim_link_monitoring_algo.c

@@ -61,15 +61,14 @@ static void lim_delete_sta_util(struct mac_context *mac_ctx, tpDeleteStaContext
 {
 {
 	tpDphHashNode stads;
 	tpDphHashNode stads;
 
 
-	pe_debug("Deleting station: staId: %d, reasonCode: %d",
-		msg->staId, msg->reasonCode);
+	pe_debug("Deleting station: reasonCode: %d", msg->reasonCode);
 
 
 	if (LIM_IS_IBSS_ROLE(session_entry)) {
 	if (LIM_IS_IBSS_ROLE(session_entry)) {
 		return;
 		return;
 	}
 	}
 
 
-	stads = dph_lookup_assoc_id(mac_ctx, msg->staId, &msg->assocId,
-				    &session_entry->dph.dphHashTable);
+	stads = dph_lookup_hash_entry(mac_ctx, msg->addr2, &msg->assocId,
+				      &session_entry->dph.dphHashTable);
 
 
 	if (!stads) {
 	if (!stads) {
 		pe_err("Invalid STA limSystemRole: %d",
 		pe_err("Invalid STA limSystemRole: %d",
@@ -78,17 +77,8 @@ static void lim_delete_sta_util(struct mac_context *mac_ctx, tpDeleteStaContext
 	}
 	}
 	stads->del_sta_ctx_rssi = msg->rssi;
 	stads->del_sta_ctx_rssi = msg->rssi;
 
 
-	/* check and see if same staId. This is to avoid the scenario
-	 * where we're trying to delete a staId we just added.
-	 */
-	if (stads->staIndex != msg->staId) {
-		pe_err("staid mismatch: %d vs %d", stads->staIndex, msg->staId);
-		return;
-	}
-
 	if (LIM_IS_AP_ROLE(session_entry)) {
 	if (LIM_IS_AP_ROLE(session_entry)) {
-		pe_debug("Delete Station staId: %d, assocId: %d",
-			msg->staId, msg->assocId);
+		pe_debug("Delete Station assocId: %d", msg->assocId);
 		/*
 		/*
 		 * Check if Deauth/Disassoc is triggered from Host.
 		 * Check if Deauth/Disassoc is triggered from Host.
 		 * If mlmState is in some transient state then
 		 * If mlmState is in some transient state then
@@ -102,8 +92,7 @@ static void lim_delete_sta_util(struct mac_context *mac_ctx, tpDeleteStaContext
 			eLIM_MLM_WT_ASSOC_CNF_STATE) &&
 			eLIM_MLM_WT_ASSOC_CNF_STATE) &&
 		      (stads->mlmStaContext.mlmState !=
 		      (stads->mlmStaContext.mlmState !=
 			eLIM_MLM_ASSOCIATED_STATE)))) {
 			eLIM_MLM_ASSOCIATED_STATE)))) {
-			pe_err("Inv Del STA staId: %d, assocId: %d",
-				msg->staId, msg->assocId);
+			pe_err("Inv Del STA assocId: %d", msg->assocId);
 			return;
 			return;
 		} else {
 		} else {
 			lim_send_disassoc_mgmt_frame(mac_ctx,
 			lim_send_disassoc_mgmt_frame(mac_ctx,
@@ -128,8 +117,7 @@ static void lim_delete_sta_util(struct mac_context *mac_ctx, tpDeleteStaContext
 		/* TearDownLink with AP */
 		/* TearDownLink with AP */
 		tLimMlmDeauthInd mlm_deauth_ind;
 		tLimMlmDeauthInd mlm_deauth_ind;
 
 
-		pe_debug("Delete Station (staId: %d, assocId: %d)",
-			msg->staId, msg->assocId);
+		pe_debug("Delete Station (assocId: %d)", msg->assocId);
 
 
 		if ((stads &&
 		if ((stads &&
 			((stads->mlmStaContext.mlmState !=
 			((stads->mlmStaContext.mlmState !=

+ 13 - 18
core/mac/src/pe/lim/lim_process_action_frame.c

@@ -502,9 +502,8 @@ static void __lim_process_operating_mode_action_frame(struct mac_context *mac_ct
 		operating_mode_frm->OperatingMode.chanWidth)) {
 		operating_mode_frm->OperatingMode.chanWidth)) {
 		uint32_t fw_vht_ch_wd = wma_get_vht_ch_width();
 		uint32_t fw_vht_ch_wd = wma_get_vht_ch_width();
 
 
-		pe_debug("received Chanwidth: %d staIdx: %d",
-			(operating_mode_frm->OperatingMode.chanWidth),
-			sta_ptr->staIndex);
+		pe_debug("received Chanwidth: %d",
+			 operating_mode_frm->OperatingMode.chanWidth);
 
 
 		pe_debug(" MAC: %0x:%0x:%0x:%0x:%0x:%0x",
 		pe_debug(" MAC: %0x:%0x:%0x:%0x:%0x:%0x",
 			mac_hdr->sa[0], mac_hdr->sa[1], mac_hdr->sa[2],
 			mac_hdr->sa[0], mac_hdr->sa[1], mac_hdr->sa[2],
@@ -568,10 +567,11 @@ end:
  *
  *
  * Return: none
  * Return: none
  */
  */
-static void __lim_process_gid_management_action_frame(struct mac_context *mac_ctx,
-			uint8_t *rx_pkt_info, struct pe_session *session)
+static void
+__lim_process_gid_management_action_frame(struct mac_context *mac_ctx,
+					  uint8_t *rx_pkt_info,
+					  struct pe_session *session)
 {
 {
-
 	uint8_t *body_ptr;
 	uint8_t *body_ptr;
 	uint16_t aid;
 	uint16_t aid;
 	uint32_t frame_len, status, membership = 0, usr_position = 0;
 	uint32_t frame_len, status, membership = 0, usr_position = 0;
@@ -609,8 +609,6 @@ static void __lim_process_gid_management_action_frame(struct mac_context *mac_ct
 		pe_err("Failed to get STA entry from hash table");
 		pe_err("Failed to get STA entry from hash table");
 		goto out;
 		goto out;
 	}
 	}
-	pe_debug("received Gid Management Action Frame staIdx: %d",
-		sta_ptr->staIndex);
 
 
 	pe_debug(" MAC: %0x:%0x:%0x:%0x:%0x:%0x",
 	pe_debug(" MAC: %0x:%0x:%0x:%0x:%0x:%0x",
 		mac_hdr->sa[0], mac_hdr->sa[1], mac_hdr->sa[2],
 		mac_hdr->sa[0], mac_hdr->sa[1], mac_hdr->sa[2],
@@ -620,8 +618,7 @@ static void __lim_process_gid_management_action_frame(struct mac_context *mac_ct
 	mem_upper = (uint32_t *) &vht_member_status->membershipStatusArray[4];
 	mem_upper = (uint32_t *) &vht_member_status->membershipStatusArray[4];
 
 
 	if (*mem_lower && *mem_upper) {
 	if (*mem_lower && *mem_upper) {
-		pe_err("rcved frame with mult group ID set, staIdx = %d",
-			sta_ptr->staIndex);
+		pe_err("rcved frame with mult group ID set");
 		goto out;
 		goto out;
 	}
 	}
 	if (*mem_lower) {
 	if (*mem_lower) {
@@ -630,8 +627,7 @@ static void __lim_process_gid_management_action_frame(struct mac_context *mac_ct
 		mem_cur = mem_upper;
 		mem_cur = mem_upper;
 		membership += sizeof(uint32_t);
 		membership += sizeof(uint32_t);
 	} else {
 	} else {
-		pe_err("rcved Gid frame with no group ID set, staIdx: %d",
-			sta_ptr->staIndex);
+		pe_err("rcved Gid frame with no group ID set");
 		goto out;
 		goto out;
 	}
 	}
 	while (!(*mem_cur & 1)) {
 	while (!(*mem_cur & 1)) {
@@ -639,8 +635,7 @@ static void __lim_process_gid_management_action_frame(struct mac_context *mac_ct
 		++membership;
 		++membership;
 	}
 	}
 	if (*mem_cur) {
 	if (*mem_cur) {
-		pe_err("rcved frame with mult group ID set, staIdx: %d",
-			sta_ptr->staIndex);
+		pe_err("rcved frame with mult group ID set");
 		goto out;
 		goto out;
 	}
 	}
 
 
@@ -855,12 +850,12 @@ static void __lim_process_add_ts_rsp(struct mac_context *mac_ctx,
 		((upToAc(addts.tspec.tsinfo.traffic.userPrio) < QCA_WLAN_AC_ALL))) {
 		((upToAc(addts.tspec.tsinfo.traffic.userPrio) < QCA_WLAN_AC_ALL))) {
 #ifdef FEATURE_WLAN_ESE
 #ifdef FEATURE_WLAN_ESE
 		retval = lim_send_hal_msg_add_ts(mac_ctx,
 		retval = lim_send_hal_msg_add_ts(mac_ctx,
-				sta_ptr->staIndex, tspec_info->idx,
+				tspec_info->idx,
 				addts.tspec, session->peSessionId,
 				addts.tspec, session->peSessionId,
 				addts.tsmIE.msmt_interval);
 				addts.tsmIE.msmt_interval);
 #else
 #else
 		retval = lim_send_hal_msg_add_ts(mac_ctx,
 		retval = lim_send_hal_msg_add_ts(mac_ctx,
-				sta_ptr->staIndex, tspec_info->idx,
+				tspec_info->idx,
 				addts.tspec, session->peSessionId);
 				addts.tspec, session->peSessionId);
 #endif
 #endif
 		if (QDF_STATUS_SUCCESS != retval) {
 		if (QDF_STATUS_SUCCESS != retval) {
@@ -979,7 +974,7 @@ static void __lim_process_del_ts_req(struct mac_context *mac_ctx,
 					SIR_MAC_ACCESSPOLICY_BOTH))){
 					SIR_MAC_ACCESSPOLICY_BOTH))){
 		/* send message to HAL to delete TS */
 		/* send message to HAL to delete TS */
 		if (QDF_STATUS_SUCCESS != lim_send_hal_msg_del_ts(mac_ctx,
 		if (QDF_STATUS_SUCCESS != lim_send_hal_msg_del_ts(mac_ctx,
-						sta_ptr->staIndex, tspec_idx,
+						tspec_idx,
 						delts, session->peSessionId,
 						delts, session->peSessionId,
 						session->bssId)) {
 						session->bssId)) {
 			pe_warn("DelTs with UP: %d failed ignoring request",
 			pe_warn("DelTs with UP: %d failed ignoring request",
@@ -1253,7 +1248,7 @@ __lim_process_sm_power_save_update(struct mac_context *mac, uint8_t *pRxPacketIn
 
 
 	/** Update in the HAL Station Table for the Update of the Protection Mode */
 	/** Update in the HAL Station Table for the Update of the Protection Mode */
 	pSta->htMIMOPSState = state;
 	pSta->htMIMOPSState = state;
-	lim_post_sm_state_update(mac, pSta->staIndex, pSta->htMIMOPSState,
+	lim_post_sm_state_update(mac, pSta->htMIMOPSState,
 				 pSta->staAddr, pe_session->smeSessionId);
 				 pSta->staAddr, pe_session->smeSessionId);
 }
 }
 
 

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

@@ -1350,8 +1350,8 @@ static bool lim_process_assoc_req_sta_ctx(struct mac_context *mac_ctx,
 		}
 		}
 
 
 		*update_ctx = true;
 		*update_ctx = true;
-		if (dph_init_sta_state(mac_ctx, hdr->sa, peer_idx, true,
-			&session->dph.dphHashTable) == NULL) {
+		if (dph_init_sta_state(mac_ctx, hdr->sa, peer_idx,
+				       &session->dph.dphHashTable) == NULL) {
 			pe_err("could not Init STAid: %d", peer_idx);
 			pe_err("could not Init STAid: %d", peer_idx);
 			return false;
 			return false;
 		}
 		}
@@ -2113,7 +2113,7 @@ send_ind_to_sme:
 		 * Update in the HAL Sta Table for the Update of the Protection
 		 * Update in the HAL Sta Table for the Update of the Protection
 		 * Mode
 		 * Mode
 		 */
 		 */
-		lim_post_sm_state_update(mac_ctx, sta_ds->staIndex,
+		lim_post_sm_state_update(mac_ctx,
 					 sta_ds->htMIMOPSState, sta_ds->staAddr,
 					 sta_ds->htMIMOPSState, sta_ds->staAddr,
 					 session->smeSessionId);
 					 session->smeSessionId);
 	}
 	}

+ 10 - 10
core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c

@@ -786,7 +786,7 @@ void lim_process_mlm_assoc_ind(struct mac_context *mac, uint32_t *msg_buf)
 
 
 		return;
 		return;
 	}
 	}
-	pSirSmeAssocInd->staId = sta->staIndex;
+
 	pSirSmeAssocInd->reassocReq = sta->mlmStaContext.subType;
 	pSirSmeAssocInd->reassocReq = sta->mlmStaContext.subType;
 	pSirSmeAssocInd->timingMeasCap = sta->timingMeasCap;
 	pSirSmeAssocInd->timingMeasCap = sta->timingMeasCap;
 	MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG,
 	MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG,
@@ -1755,20 +1755,20 @@ void lim_process_ap_mlm_del_sta_rsp(struct mac_context *mac_ctx,
 		goto end;
 		goto end;
 	}
 	}
 
 
-	pe_warn("AP received the DEL_STA_RSP for assocID: %X",
-		del_sta_params->assocId);
+	pe_warn("AP received the DEL_STA_RSP for assocID: %X sta mac "
+		QDF_MAC_ADDR_STR, del_sta_params->assocId,
+		QDF_MAC_ADDR_ARRAY(sta_ds->staAddr));
 	if ((eLIM_MLM_WT_DEL_STA_RSP_STATE != sta_ds->mlmStaContext.mlmState) &&
 	if ((eLIM_MLM_WT_DEL_STA_RSP_STATE != sta_ds->mlmStaContext.mlmState) &&
 	    (eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE !=
 	    (eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE !=
 	     sta_ds->mlmStaContext.mlmState)) {
 	     sta_ds->mlmStaContext.mlmState)) {
-		pe_err("Received unexpected WMA_DEL_STA_RSP in state %s for staId %d assocId %d",
-			lim_mlm_state_str(sta_ds->mlmStaContext.mlmState),
-			sta_ds->staIndex, sta_ds->assocId);
+		pe_err("Received unexpected WMA_DEL_STA_RSP in state %s for assocId %d",
+		       lim_mlm_state_str(sta_ds->mlmStaContext.mlmState),
+			sta_ds->assocId);
 		status_code = eSIR_SME_REFUSED;
 		status_code = eSIR_SME_REFUSED;
 		goto end;
 		goto end;
 	}
 	}
 
 
-	pe_debug("Deleted STA AssocID %d staId %d MAC",
-		sta_ds->assocId, sta_ds->staIndex);
+	pe_debug("Deleted STA AssocID %d", sta_ds->assocId);
 	lim_print_mac_addr(mac_ctx, sta_ds->staAddr, LOGD);
 	lim_print_mac_addr(mac_ctx, sta_ds->staAddr, LOGD);
 	if (eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE ==
 	if (eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE ==
 	    sta_ds->mlmStaContext.mlmState) {
 	    sta_ds->mlmStaContext.mlmState) {
@@ -1909,8 +1909,8 @@ void lim_process_ap_mlm_add_sta_rsp(struct mac_context *mac,
 	/* if the AssocRsp frame is not acknowledged, then keep alive timer will take care of the state */
 	/* if the AssocRsp frame is not acknowledged, then keep alive timer will take care of the state */
 	sta->valid = 1;
 	sta->valid = 1;
 	sta->mlmStaContext.mlmState = eLIM_MLM_WT_ASSOC_CNF_STATE;
 	sta->mlmStaContext.mlmState = eLIM_MLM_WT_ASSOC_CNF_STATE;
-	pe_debug("AddStaRsp Success.STA AssocID %d staId %d MAC",
-		sta->assocId, sta->staIndex);
+	pe_debug("AddStaRsp Success.STA AssocID %d sta mac" QDF_MAC_ADDR_STR,
+		 sta->assocId, QDF_MAC_ADDR_ARRAY(sta->staAddr));
 	lim_print_mac_addr(mac, sta->staAddr, LOGD);
 	lim_print_mac_addr(mac, sta->staAddr, LOGD);
 
 
 	/* For BTAMP-AP, the flow sequence shall be:
 	/* For BTAMP-AP, the flow sequence shall be:

+ 2 - 9
core/mac/src/pe/lim/lim_process_tdls.c

@@ -2648,9 +2648,8 @@ static QDF_STATUS lim_tdls_del_sta(struct mac_context *mac,
 		pe_debug("DEL STA peer MAC: "QDF_MAC_ADDR_STR,
 		pe_debug("DEL STA peer MAC: "QDF_MAC_ADDR_STR,
 			 QDF_MAC_ADDR_ARRAY(sta->staAddr));
 			 QDF_MAC_ADDR_ARRAY(sta->staAddr));
 
 
-		pe_debug("STA type: %x, sta idx: %x resp_reqd: %d",
+		pe_debug("STA type: %x, resp_reqd: %d",
 			 sta->staType,
 			 sta->staType,
-			 sta->staIndex,
 			 resp_reqd);
 			 resp_reqd);
 
 
 		status = lim_del_sta(mac, sta, resp_reqd, pe_session);
 		status = lim_del_sta(mac, sta, resp_reqd, pe_session);
@@ -2683,9 +2682,7 @@ static QDF_STATUS lim_send_sme_tdls_add_sta_rsp(struct mac_context *mac,
 
 
 	add_sta_rsp->session_id = sessionId;
 	add_sta_rsp->session_id = sessionId;
 	add_sta_rsp->status_code = status;
 	add_sta_rsp->status_code = status;
-	if (sta) {
-		add_sta_rsp->sta_id = sta->staIndex;
-	}
+
 	if (peerMac) {
 	if (peerMac) {
 		qdf_mem_copy(add_sta_rsp->peermac.bytes,
 		qdf_mem_copy(add_sta_rsp->peermac.bytes,
 			     (uint8_t *) peerMac, QDF_MAC_ADDR_SIZE);
 			     (uint8_t *) peerMac, QDF_MAC_ADDR_SIZE);
@@ -2945,10 +2942,6 @@ static QDF_STATUS lim_send_sme_tdls_del_sta_rsp(struct mac_context *mac,
 
 
 	del_sta_rsp->session_id = sessionId;
 	del_sta_rsp->session_id = sessionId;
 	del_sta_rsp->status_code = status;
 	del_sta_rsp->status_code = status;
-	if (sta) {
-		del_sta_rsp->sta_id = sta->staIndex;
-	} else
-		del_sta_rsp->sta_id = STA_INVALID_IDX;
 
 
 	qdf_copy_macaddr(&del_sta_rsp->peermac, &peerMac);
 	qdf_copy_macaddr(&del_sta_rsp->peermac, &peerMac);
 
 

+ 11 - 7
core/mac/src/pe/lim/lim_security_utils.h

@@ -49,17 +49,20 @@
 
 
 struct tLimPreAuthNode;
 struct tLimPreAuthNode;
 
 
-uint8_t lim_is_auth_algo_supported(struct mac_context *, tAniAuthType, struct pe_session *);
+uint8_t lim_is_auth_algo_supported(struct mac_context *, tAniAuthType,
+				   struct pe_session *);
 
 
 /* MAC based authentication related functions */
 /* MAC based authentication related functions */
 void lim_init_pre_auth_list(struct mac_context *);
 void lim_init_pre_auth_list(struct mac_context *);
 void lim_delete_pre_auth_list(struct mac_context *);
 void lim_delete_pre_auth_list(struct mac_context *);
-struct tLimPreAuthNode *lim_search_pre_auth_list(struct mac_context *, tSirMacAddr);
+struct tLimPreAuthNode *lim_search_pre_auth_list(struct mac_context *,
+						 tSirMacAddr);
 void lim_add_pre_auth_node(struct mac_context *, struct tLimPreAuthNode *);
 void lim_add_pre_auth_node(struct mac_context *, struct tLimPreAuthNode *);
 void lim_delete_pre_auth_node(struct mac_context *, tSirMacAddr);
 void lim_delete_pre_auth_node(struct mac_context *, tSirMacAddr);
-void lim_release_pre_auth_node(struct mac_context *mac, tpLimPreAuthNode pAuthNode);
+void lim_release_pre_auth_node(struct mac_context *mac,
+			       tpLimPreAuthNode pAuthNode);
 void lim_restore_from_auth_state(struct mac_context *,
 void lim_restore_from_auth_state(struct mac_context *,
-				 tSirResultCodes, uint16_t, struct pe_session *);
+				tSirResultCodes, uint16_t, struct pe_session *);
 uint8_t lim_delete_open_auth_pre_auth_node(struct mac_context *mac_ctx);
 uint8_t lim_delete_open_auth_pre_auth_node(struct mac_context *mac_ctx);
 
 
 /* Encryption/Decryption related functions */
 /* Encryption/Decryption related functions */
@@ -67,10 +70,11 @@ void lim_compute_crc32(uint8_t *, uint8_t *, uint16_t);
 void lim_rc4(uint8_t *, uint8_t *, uint8_t *, uint32_t, uint16_t);
 void lim_rc4(uint8_t *, uint8_t *, uint8_t *, uint32_t, uint16_t);
 void lim_encrypt_auth_frame(struct mac_context *, uint8_t, uint8_t *, uint8_t *,
 void lim_encrypt_auth_frame(struct mac_context *, uint8_t, uint8_t *, uint8_t *,
 			    uint8_t *, uint32_t);
 			    uint8_t *, uint32_t);
-uint8_t lim_decrypt_auth_frame(struct mac_context *, uint8_t *, uint8_t *, uint8_t *,
-			       uint32_t, uint16_t);
+uint8_t lim_decrypt_auth_frame(struct mac_context *, uint8_t *, uint8_t *,
+			       uint8_t *, uint32_t, uint16_t);
 
 
-void lim_send_set_bss_key_req(struct mac_context *, tLimMlmSetKeysReq *, struct pe_session *);
+void lim_send_set_bss_key_req(struct mac_context *, tLimMlmSetKeysReq *,
+			      struct pe_session *);
 void lim_send_set_sta_key_req(struct mac_context *, tLimMlmSetKeysReq *,
 void lim_send_set_sta_key_req(struct mac_context *, tLimMlmSetKeysReq *,
 			      uint8_t, struct pe_session *, bool sendRsp);
 			      uint8_t, struct pe_session *, bool sendRsp);
 void lim_post_sme_set_keys_cnf(struct mac_context *, tLimMlmSetKeysReq *,
 void lim_post_sme_set_keys_cnf(struct mac_context *, tLimMlmSetKeysReq *,

+ 0 - 7
core/mac/src/pe/lim/lim_send_sme_rsp_messages.c

@@ -443,8 +443,6 @@ void lim_send_sme_join_reassoc_rsp(struct mac_context *mac_ctx,
 			if (!sta_ds) {
 			if (!sta_ds) {
 				pe_err("Get Self Sta Entry fail");
 				pe_err("Get Self Sta Entry fail");
 			} else {
 			} else {
-				/* Pass the peer's staId */
-				sme_join_rsp->staId = sta_ds->staIndex;
 				sme_join_rsp->timingMeasCap =
 				sme_join_rsp->timingMeasCap =
 					sta_ds->timingMeasCap;
 					sta_ds->timingMeasCap;
 #ifdef FEATURE_WLAN_TDLS
 #ifdef FEATURE_WLAN_TDLS
@@ -813,8 +811,6 @@ lim_send_sme_disassoc_ind(struct mac_context *mac, tpDphHashNode sta,
 	qdf_mem_copy(pSirSmeDisassocInd->peer_macaddr.bytes, sta->staAddr,
 	qdf_mem_copy(pSirSmeDisassocInd->peer_macaddr.bytes, sta->staAddr,
 		     QDF_MAC_ADDR_SIZE);
 		     QDF_MAC_ADDR_SIZE);
 
 
-	pSirSmeDisassocInd->staId = sta->staIndex;
-
 	mmhMsg.type = eWNI_SME_DISASSOC_IND;
 	mmhMsg.type = eWNI_SME_DISASSOC_IND;
 	mmhMsg.bodyptr = pSirSmeDisassocInd;
 	mmhMsg.bodyptr = pSirSmeDisassocInd;
 	mmhMsg.bodyval = 0;
 	mmhMsg.bodyval = 0;
@@ -873,7 +869,6 @@ lim_send_sme_deauth_ind(struct mac_context *mac, tpDphHashNode sta,
 		     QDF_MAC_ADDR_SIZE);
 		     QDF_MAC_ADDR_SIZE);
 	pSirSmeDeauthInd->reasonCode = sta->mlmStaContext.disassocReason;
 	pSirSmeDeauthInd->reasonCode = sta->mlmStaContext.disassocReason;
 
 
-	pSirSmeDeauthInd->staId = sta->staIndex;
 	if (eSIR_MAC_PEER_STA_REQ_LEAVING_BSS_REASON ==
 	if (eSIR_MAC_PEER_STA_REQ_LEAVING_BSS_REASON ==
 		sta->mlmStaContext.disassocReason)
 		sta->mlmStaContext.disassocReason)
 		pSirSmeDeauthInd->rssi = sta->del_sta_ctx_rssi;
 		pSirSmeDeauthInd->rssi = sta->del_sta_ctx_rssi;
@@ -1399,7 +1394,6 @@ void lim_send_sme_pe_ese_tsm_rsp(struct mac_context *mac,
 void
 void
 lim_send_sme_ibss_peer_ind(struct mac_context *mac,
 lim_send_sme_ibss_peer_ind(struct mac_context *mac,
 			   tSirMacAddr peerMacAddr,
 			   tSirMacAddr peerMacAddr,
-			   uint16_t staIndex,
 			   uint8_t *beacon,
 			   uint8_t *beacon,
 			   uint16_t beaconLen, uint16_t msgType, uint8_t sessionId)
 			   uint16_t beaconLen, uint16_t msgType, uint8_t sessionId)
 {
 {
@@ -1412,7 +1406,6 @@ lim_send_sme_ibss_peer_ind(struct mac_context *mac,
 
 
 	qdf_mem_copy((uint8_t *) pNewPeerInd->peer_addr.bytes,
 	qdf_mem_copy((uint8_t *) pNewPeerInd->peer_addr.bytes,
 		     peerMacAddr, QDF_MAC_ADDR_SIZE);
 		     peerMacAddr, QDF_MAC_ADDR_SIZE);
-	pNewPeerInd->staId = staIndex;
 	pNewPeerInd->mesgLen = sizeof(tSmeIbssPeerInd) + beaconLen;
 	pNewPeerInd->mesgLen = sizeof(tSmeIbssPeerInd) + beaconLen;
 	pNewPeerInd->mesgType = msgType;
 	pNewPeerInd->mesgType = msgType;
 	pNewPeerInd->sessionId = sessionId;
 	pNewPeerInd->sessionId = sessionId;

+ 1 - 1
core/mac/src/pe/lim/lim_send_sme_rsp_messages.h

@@ -241,7 +241,7 @@ void lim_send_sme_pe_ese_tsm_rsp(struct mac_context *mac, tAniGetTsmStatsRsp *pS
  * Return: none
  * Return: none
  */
  */
 void lim_send_sme_ibss_peer_ind(struct mac_context *mac, tSirMacAddr peerMacAddr,
 void lim_send_sme_ibss_peer_ind(struct mac_context *mac, tSirMacAddr peerMacAddr,
-				uint16_t staIndex, uint8_t *beacon,
+				uint8_t *beacon,
 				uint16_t beaconLen, uint16_t msgType,
 				uint16_t beaconLen, uint16_t msgType,
 				uint8_t sessionId);
 				uint8_t sessionId);
 #else
 #else

+ 0 - 39
core/mac/src/pe/lim/lim_session.c

@@ -780,45 +780,6 @@ struct pe_session *pe_find_session_by_session_id(struct mac_context *mac,
 	return NULL;
 	return NULL;
 }
 }
 
 
-/**
- * pe_find_session_by_sta_id() - looks up the PE session given staid.
- * @mac_ctx:       pointer to global adapter context
- * @staid:         StaId of the session
- * @session_id:    session ID is returned here, if session is found.
- *
- * This function returns the session context and the session ID if the session
- * corresponding to the given StaId is found in the PE session table.
- *
- * Return: session pointer
- */
-struct pe_session *
-pe_find_session_by_sta_id(struct mac_context *mac_ctx,
-			  uint8_t staid,
-			  uint8_t *session_id)
-{
-	uint8_t i, j;
-	struct pe_session *session_ptr;
-	struct dph_hash_table *dph_ptr;
-
-	for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
-		if (!mac_ctx->lim.gpSession[i].valid)
-			continue;
-		session_ptr = &mac_ctx->lim.gpSession[i];
-		dph_ptr = &session_ptr->dph.dphHashTable;
-		for (j = 0; j < dph_ptr->size; j++) {
-			if (dph_ptr->pDphNodeArray[j].valid
-			    && dph_ptr->pDphNodeArray[j].added
-			    && staid == dph_ptr->pDphNodeArray[j].staIndex) {
-				*session_id = i;
-				return session_ptr;
-			}
-		}
-	}
-
-	pe_debug("Session lookup fails for StaId: %d", staid);
-	return NULL;
-}
-
 /**
 /**
  * pe_delete_session() - deletes the PE session given the session ID.
  * pe_delete_session() - deletes the PE session given the session ID.
  * @mac_ctx: pointer to global adapter context
  * @mac_ctx: pointer to global adapter context

+ 2 - 3
core/mac/src/pe/lim/lim_utils.c

@@ -4226,7 +4226,7 @@ lim_validate_delts_req(struct mac_context *mac_ctx, tpSirDeltsReq delts_req,
 	} else if (tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA) {
 	} else if (tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA) {
 		/* send message to HAL to delete TS */
 		/* send message to HAL to delete TS */
 		if (QDF_STATUS_SUCCESS !=
 		if (QDF_STATUS_SUCCESS !=
-			lim_send_hal_msg_del_ts(mac_ctx, sta->staIndex,
+			lim_send_hal_msg_del_ts(mac_ctx,
 						tspec_idx, delts_req->req,
 						tspec_idx, delts_req->req,
 						session->peSessionId,
 						session->peSessionId,
 						session->bssId)) {
 						session->bssId)) {
@@ -4257,7 +4257,7 @@ lim_validate_delts_req(struct mac_context *mac_ctx, tpSirDeltsReq delts_req,
  */
  */
 QDF_STATUS
 QDF_STATUS
 lim_post_sm_state_update(struct mac_context *mac,
 lim_post_sm_state_update(struct mac_context *mac,
-			 uint16_t staIdx, tSirMacHTMIMOPowerSaveState state,
+			 tSirMacHTMIMOPowerSaveState state,
 			 uint8_t *pPeerStaMac, uint8_t sessionId)
 			 uint8_t *pPeerStaMac, uint8_t sessionId)
 {
 {
 	QDF_STATUS retCode = QDF_STATUS_SUCCESS;
 	QDF_STATUS retCode = QDF_STATUS_SUCCESS;
@@ -4273,7 +4273,6 @@ lim_post_sm_state_update(struct mac_context *mac,
 		return QDF_STATUS_E_NOMEM;
 		return QDF_STATUS_E_NOMEM;
 
 
 	pMIMO_PSParams->htMIMOPSState = state;
 	pMIMO_PSParams->htMIMOPSState = state;
-	pMIMO_PSParams->staIdx = staIdx;
 	pMIMO_PSParams->fsendRsp = true;
 	pMIMO_PSParams->fsendRsp = true;
 	pMIMO_PSParams->sessionId = sessionId;
 	pMIMO_PSParams->sessionId = sessionId;
 	qdf_mem_copy(pMIMO_PSParams->peerMac, pPeerStaMac, sizeof(tSirMacAddr));
 	qdf_mem_copy(pMIMO_PSParams->peerMac, pPeerStaMac, sizeof(tSirMacAddr));

+ 0 - 1
core/mac/src/pe/lim/lim_utils.h

@@ -483,7 +483,6 @@ static inline uint32_t utils_power_xy(uint16_t base, uint16_t power)
 }
 }
 
 
 QDF_STATUS lim_post_sm_state_update(struct mac_context *mac,
 QDF_STATUS lim_post_sm_state_update(struct mac_context *mac,
-		uint16_t StaIdx,
 		tSirMacHTMIMOPowerSaveState MIMOPSState,
 		tSirMacHTMIMOPowerSaveState MIMOPSState,
 		uint8_t *pPeerStaMac, uint8_t sessionId);
 		uint8_t *pPeerStaMac, uint8_t sessionId);
 
 

+ 2 - 7
core/mac/src/pe/nan/nan_datapath.c

@@ -304,15 +304,10 @@ void lim_process_ndi_del_sta_rsp(struct mac_context *mac_ctx,
 		pe_err("DEL STA failed!");
 		pe_err("DEL STA failed!");
 		goto skip_event;
 		goto skip_event;
 	}
 	}
-	pe_info("Deleted STA AssocID %d staId %d MAC " QDF_MAC_ADDR_STR,
-		sta_ds->assocId, sta_ds->staIndex,
+	pe_info("Deleted STA AssocID %d MAC " QDF_MAC_ADDR_STR,
+		sta_ds->assocId,
 		QDF_MAC_ADDR_ARRAY(sta_ds->staAddr));
 		QDF_MAC_ADDR_ARRAY(sta_ds->staAddr));
 
 
-	/*
-	 * Copy peer info in del peer indication before
-	 * lim_delete_dph_hash_entry is called as this will be lost.
-	 */
-	peer_ind.sta_id = sta_ds->staIndex;
 	qdf_mem_copy(&peer_ind.peer_mac_addr.bytes,
 	qdf_mem_copy(&peer_ind.peer_mac_addr.bytes,
 		sta_ds->staAddr, sizeof(tSirMacAddr));
 		sta_ds->staAddr, sizeof(tSirMacAddr));
 	lim_release_peer_idx(mac_ctx, sta_ds->assocId, pe_session);
 	lim_release_peer_idx(mac_ctx, sta_ds->assocId, pe_session);

+ 4 - 4
core/mac/src/pe/sch/sch_beacon_process.c

@@ -576,8 +576,8 @@ sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds,
 			((oper_mode != bcn->OperatingMode.chanWidth) ||
 			((oper_mode != bcn->OperatingMode.chanWidth) ||
 			(sta_ds->vhtSupportedRxNss !=
 			(sta_ds->vhtSupportedRxNss !=
 			(bcn->OperatingMode.rxNSS + 1)))) {
 			(bcn->OperatingMode.rxNSS + 1)))) {
-			pe_debug("received OpMode Chanwidth %d, staIdx = %d",
-			       bcn->OperatingMode.chanWidth, sta_ds->staIndex);
+			pe_debug("received OpMode Chanwidth %d",
+				 bcn->OperatingMode.chanWidth);
 			pe_debug("MAC - %0x:%0x:%0x:%0x:%0x:%0x",
 			pe_debug("MAC - %0x:%0x:%0x:%0x:%0x:%0x",
 			       mac_hdr->sa[0], mac_hdr->sa[1],
 			       mac_hdr->sa[0], mac_hdr->sa[1],
 			       mac_hdr->sa[2], mac_hdr->sa[3],
 			       mac_hdr->sa[2], mac_hdr->sa[3],
@@ -645,8 +645,8 @@ sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds,
 
 
 	if (!skip_opmode_update &&
 	if (!skip_opmode_update &&
 	    (oper_mode != bcn->VHTOperation.chanWidth)) {
 	    (oper_mode != bcn->VHTOperation.chanWidth)) {
-		pe_debug("received VHTOP CHWidth %d staIdx = %d",
-		       bcn->VHTOperation.chanWidth, sta_ds->staIndex);
+		pe_debug("received VHTOP CHWidth %d",
+			 bcn->VHTOperation.chanWidth);
 		pe_debug("MAC - %0x:%0x:%0x:%0x:%0x:%0x",
 		pe_debug("MAC - %0x:%0x:%0x:%0x:%0x:%0x",
 		       mac_hdr->sa[0], mac_hdr->sa[1],
 		       mac_hdr->sa[0], mac_hdr->sa[1],
 		       mac_hdr->sa[2], mac_hdr->sa[3],
 		       mac_hdr->sa[2], mac_hdr->sa[3],

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

@@ -743,7 +743,6 @@ csr_roam_chk_lnk_ibss_new_peer_ind(struct mac_context *mac_ctx,
 				     sizeof(tSmeIbssPeerInd),
 				     sizeof(tSmeIbssPeerInd),
 				     roam_info->nBeaconLength);
 				     roam_info->nBeaconLength);
 		}
 		}
-		roam_info->staId = (uint8_t)pIbssPeerInd->staId;
 		roam_info->bss_desc = qdf_mem_malloc(
 		roam_info->bss_desc = qdf_mem_malloc(
 					session->pConnectBssDesc->length);
 					session->pConnectBssDesc->length);
 		if (!roam_info->bss_desc) {
 		if (!roam_info->bss_desc) {
@@ -812,7 +811,6 @@ csr_roam_chk_lnk_ibss_peer_departed_ind(struct mac_context *mac_ctx,
 		}
 		}
 #endif /* FEATURE_WLAN_DIAG_SUPPORT_CSR */
 #endif /* FEATURE_WLAN_DIAG_SUPPORT_CSR */
 		sme_debug("CSR: Peer departed notification from LIM");
 		sme_debug("CSR: Peer departed notification from LIM");
-		roam_info->staId = (uint8_t)pIbssPeerInd->staId;
 		qdf_copy_macaddr(&roam_info->peerMac, &pIbssPeerInd->peer_addr);
 		qdf_copy_macaddr(&roam_info->peerMac, &pIbssPeerInd->peer_addr);
 		csr_roam_call_callback(mac_ctx, sessionId, roam_info, 0,
 		csr_roam_call_callback(mac_ctx, sessionId, roam_info, 0,
 				       eCSR_ROAM_CONNECT_STATUS_UPDATE,
 				       eCSR_ROAM_CONNECT_STATUS_UPDATE,
@@ -10327,7 +10325,6 @@ void csr_roaming_state_msg_processor(struct mac_context *mac, void *msg_buf)
 		if (!roam_info)
 		if (!roam_info)
 			break;
 			break;
 
 
-		roam_info->staId = (uint8_t) pIbssPeerInd->staId;
 		qdf_copy_macaddr(&roam_info->peerMac, &pIbssPeerInd->peer_addr);
 		qdf_copy_macaddr(&roam_info->peerMac, &pIbssPeerInd->peer_addr);
 		csr_roam_call_callback(mac, pSmeRsp->sessionId, roam_info, 0,
 		csr_roam_call_callback(mac, pSmeRsp->sessionId, roam_info, 0,
 				       eCSR_ROAM_CONNECT_STATUS_UPDATE,
 				       eCSR_ROAM_CONNECT_STATUS_UPDATE,

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

@@ -415,7 +415,6 @@ typedef enum eSmpsModeValue {
 /**
 /**
  * struct tDeleteStaContext - params required for delete sta request
  * struct tDeleteStaContext - params required for delete sta request
  * @assocId: association id
  * @assocId: association id
- * @staId: station id
  * @bssId: mac address
  * @bssId: mac address
  * @addr2: mac address
  * @addr2: mac address
  * @reasonCode: reason code
  * @reasonCode: reason code
@@ -425,7 +424,6 @@ typedef struct {
 	bool is_tdls;
 	bool is_tdls;
 	uint8_t vdev_id;
 	uint8_t vdev_id;
 	uint16_t assocId;
 	uint16_t assocId;
-	uint16_t staId;
 	tSirMacAddr bssId;
 	tSirMacAddr bssId;
 	tSirMacAddr addr2;
 	tSirMacAddr addr2;
 	uint16_t reasonCode;
 	uint16_t reasonCode;
@@ -624,7 +622,6 @@ typedef struct {
 
 
 /**
 /**
  * struct tSetMIMOPS - MIMO power save related parameters
  * struct tSetMIMOPS - MIMO power save related parameters
- * @staIdx: station index
  * @htMIMOPSState: MIMO Power Save State
  * @htMIMOPSState: MIMO Power Save State
  * @status: response status
  * @status: response status
  * @fsendRsp: send response flag
  * @fsendRsp: send response flag
@@ -632,7 +629,6 @@ typedef struct {
  * @sessionId: session id
  * @sessionId: session id
  */
  */
 typedef struct sSet_MIMOPS {
 typedef struct sSet_MIMOPS {
-	uint16_t staIdx;
 	tSirMacHTMIMOPowerSaveState htMIMOPSState;
 	tSirMacHTMIMOPowerSaveState htMIMOPSState;
 	QDF_STATUS status;
 	QDF_STATUS status;
 	uint8_t fsendRsp;
 	uint8_t fsendRsp;

+ 0 - 1
core/wma/src/wma_features.c

@@ -2573,7 +2573,6 @@ static int wma_wake_event_piggybacked(
 
 
 		del_sta_ctx->is_tdls = false;
 		del_sta_ctx->is_tdls = false;
 		del_sta_ctx->vdev_id = event_param->fixed_param->vdev_id;
 		del_sta_ctx->vdev_id = event_param->fixed_param->vdev_id;
-		del_sta_ctx->staId = peer_id;
 		qdf_mem_copy(del_sta_ctx->addr2, bssid, QDF_MAC_ADDR_SIZE);
 		qdf_mem_copy(del_sta_ctx->addr2, bssid, QDF_MAC_ADDR_SIZE);
 		qdf_mem_copy(del_sta_ctx->bssId, bssid, QDF_MAC_ADDR_SIZE);
 		qdf_mem_copy(del_sta_ctx->bssId, bssid, QDF_MAC_ADDR_SIZE);
 		del_sta_ctx->reasonCode = HAL_DEL_STA_REASON_CODE_KEEP_ALIVE;
 		del_sta_ctx->reasonCode = HAL_DEL_STA_REASON_CODE_KEEP_ALIVE;

+ 0 - 2
core/wma/src/wma_mgmt.c

@@ -410,7 +410,6 @@ int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event,
 
 
 		del_sta_ctx->is_tdls = true;
 		del_sta_ctx->is_tdls = true;
 		del_sta_ctx->vdev_id = vdev_id;
 		del_sta_ctx->vdev_id = vdev_id;
-		del_sta_ctx->staId = peer_id;
 		qdf_mem_copy(del_sta_ctx->addr2, macaddr, QDF_MAC_ADDR_SIZE);
 		qdf_mem_copy(del_sta_ctx->addr2, macaddr, QDF_MAC_ADDR_SIZE);
 		qdf_mem_copy(del_sta_ctx->bssId, bssid,
 		qdf_mem_copy(del_sta_ctx->bssId, bssid,
 			     QDF_MAC_ADDR_SIZE);
 			     QDF_MAC_ADDR_SIZE);
@@ -496,7 +495,6 @@ int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event,
 
 
 	del_sta_ctx->is_tdls = false;
 	del_sta_ctx->is_tdls = false;
 	del_sta_ctx->vdev_id = vdev_id;
 	del_sta_ctx->vdev_id = vdev_id;
-	del_sta_ctx->staId = peer_id;
 	qdf_mem_copy(del_sta_ctx->addr2, macaddr, QDF_MAC_ADDR_SIZE);
 	qdf_mem_copy(del_sta_ctx->addr2, macaddr, QDF_MAC_ADDR_SIZE);
 	qdf_mem_copy(del_sta_ctx->bssId, addr, QDF_MAC_ADDR_SIZE);
 	qdf_mem_copy(del_sta_ctx->bssId, addr, QDF_MAC_ADDR_SIZE);
 	del_sta_ctx->reasonCode = HAL_DEL_STA_REASON_CODE_KEEP_ALIVE;
 	del_sta_ctx->reasonCode = HAL_DEL_STA_REASON_CODE_KEEP_ALIVE;