Sfoglia il codice sorgente

qcacld-3.0: Avoid using struct csr_roam_session in lim

struct csr_roam_session is used in LIM in func
lim_get_session_by_macaddr to get if SA is same as one of the vdev.

struct csr_roam_session should not be used by LIM, so raise change
to used vdev obj manager to find a vdev with same MAC address.

Change-Id: I13bf65a65023a2a8dc82013e2668a075883c111a
CRs-Fixed: 2544552
Abhishek Singh 5 anni fa
parent
commit
623603404e

+ 9 - 3
core/mac/src/pe/lim/lim_process_auth_frame.c

@@ -581,9 +581,15 @@ static void lim_process_auth_frame_type1(struct mac_context *mac_ctx,
 	if (lim_is_auth_algo_supported(mac_ctx,
 			(tAniAuthType) rx_auth_frm_body->authAlgoNumber,
 			pe_session)) {
-
-		if (lim_get_session_by_macaddr(mac_ctx, mac_hdr->sa)) {
-
+		struct wlan_objmgr_vdev *vdev;
+
+		vdev =
+		  wlan_objmgr_get_vdev_by_macaddr_from_pdev(mac_ctx->pdev,
+							    mac_hdr->sa,
+							    WLAN_LEGACY_MAC_ID);
+		/* SA is same as any of the device vdev, return failure */
+		if (vdev) {
+			wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
 			auth_frame->authAlgoNumber =
 				rx_auth_frm_body->authAlgoNumber;
 			auth_frame->authTransactionSeqNumber =

+ 0 - 31
core/mac/src/pe/lim/lim_utils.c

@@ -7530,37 +7530,6 @@ void lim_decrement_pending_mgmt_count(struct mac_context *mac_ctx)
 	qdf_spin_unlock(&mac_ctx->sys.bbt_mgmt_lock);
 }
 
-struct csr_roam_session *lim_get_session_by_macaddr(struct mac_context *mac_ctx,
-		tSirMacAddr self_mac)
-{
-	int i = 0;
-	struct csr_roam_session *session;
-
-	if (!mac_ctx || !self_mac) {
-		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,
-			  FL("Invalid arguments"));
-		return NULL;
-	}
-
-	for (i = 0; i < mac_ctx->sme.max_intf_count; i++) {
-		session = CSR_GET_SESSION(mac_ctx, i);
-		if (!session)
-			continue;
-		else if (!qdf_mem_cmp(&session->self_mac_addr,
-				      self_mac, sizeof(tSirMacAddr))) {
-
-			QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
-				  FL("session %d exists with mac address "
-				  QDF_MAC_ADDR_STR), session->sessionId,
-				  QDF_MAC_ADDR_ARRAY(self_mac));
-
-			return session;
-		}
-	}
-
-	return NULL;
-}
-
 bool lim_check_if_vendor_oui_match(struct mac_context *mac_ctx,
 					uint8_t *oui, uint8_t oui_len,
 			       uint8_t *ie, uint8_t ie_len)

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

@@ -375,18 +375,6 @@ lim_assoc_rej_get_remaining_delta(struct sir_rssi_disallow_lst *node);
 QDF_STATUS
 lim_rem_blacklist_entry_with_lowest_delta(qdf_list_t *list);
 
-/**
- * lim_get_session_by_macaddr() - api to find session based on MAC
- * @mac_ctx: Pointer to global mac structure.
- * @self_mac: MAC address.
- *
- * This function is used to get session for given MAC address.
- *
- * Return: session pointer if exists, NULL otherwise.
- */
-struct csr_roam_session *lim_get_session_by_macaddr(struct mac_context *mac_ctx,
-		tSirMacAddr self_mac);
-
 static inline enum band_info lim_get_rf_band(uint8_t channel)
 {
 	if ((channel >= SIR_11A_CHANNEL_BEGIN) &&