瀏覽代碼

qcacmn: Add API to fetch ast entry by mac and ast type

Add API to fetch ast entry by mac and ast type

Change-Id: Ib8cfa5c269fd10c149804d02fcfae35e88c2a53f
CRs-Fixed: 3614965
Neha Bisht 1 年之前
父節點
當前提交
2e13c17be4
共有 3 個文件被更改,包括 56 次插入1 次删除
  1. 4 1
      dp/wifi3.0/be/dp_be.c
  2. 35 0
      dp/wifi3.0/dp_peer.c
  3. 17 0
      dp/wifi3.0/dp_peer.h

+ 4 - 1
dp/wifi3.0/be/dp_be.c

@@ -3894,7 +3894,10 @@ QDF_STATUS dp_htt_reo_migration(struct dp_soc *soc, uint16_t peer_id,
 
 	/* delete ast entry for current primary peer */
 	qdf_spin_lock_bh(&current_pr_soc->ast_lock);
-	ast_entry = dp_peer_ast_hash_find_soc(current_pr_soc, mld_peer->mac_addr.raw);
+	ast_entry = dp_peer_ast_hash_find_soc_by_type(
+				current_pr_soc,
+				mld_peer->mac_addr.raw,
+				CDP_TXRX_AST_TYPE_MLD);
 	if (!ast_entry) {
 		dp_htt_err("Invalid ast entry");
 		qdf_spin_unlock_bh(&current_pr_soc->ast_lock);

+ 35 - 0
dp/wifi3.0/dp_peer.c

@@ -1289,6 +1289,33 @@ struct dp_ast_entry *dp_peer_ast_hash_find_soc(struct dp_soc *soc,
 	return NULL;
 }
 
+struct dp_ast_entry *dp_peer_ast_hash_find_soc_by_type(
+					struct dp_soc *soc,
+					uint8_t *ast_mac_addr,
+					enum cdp_txrx_ast_entry_type type)
+{
+	union dp_align_mac_addr local_mac_addr_aligned, *mac_addr;
+	unsigned index;
+	struct dp_ast_entry *ase;
+
+	if (!soc->ast_hash.bins)
+		return NULL;
+
+	qdf_mem_copy(&local_mac_addr_aligned.raw[0],
+			ast_mac_addr, QDF_MAC_ADDR_SIZE);
+	mac_addr = &local_mac_addr_aligned;
+
+	index = dp_peer_ast_hash_index(soc, mac_addr);
+	TAILQ_FOREACH(ase, &soc->ast_hash.bins[index], hash_list_elem) {
+		if (dp_peer_find_mac_addr_cmp(mac_addr, &ase->mac_addr) == 0 &&
+		    ase->type == type) {
+			return ase;
+		}
+	}
+
+	return NULL;
+}
+
 /**
  * dp_peer_map_ipa_evt() - Send peer map event to IPA
  * @soc: SoC handle
@@ -2164,6 +2191,14 @@ struct dp_ast_entry *dp_peer_ast_hash_find_soc(struct dp_soc *soc,
 	return NULL;
 }
 
+struct dp_ast_entry *dp_peer_ast_hash_find_soc_by_type(
+					struct dp_soc *soc,
+					uint8_t *ast_mac_addr,
+					enum cdp_txrx_ast_entry_type type)
+{
+	return NULL;
+}
+
 static inline
 QDF_STATUS dp_peer_host_add_map_ast(struct dp_soc *soc, uint16_t peer_id,
 				    uint8_t *mac_addr, uint16_t hw_peer_id,

+ 17 - 0
dp/wifi3.0/dp_peer.h

@@ -896,6 +896,23 @@ struct dp_ast_entry *dp_peer_ast_hash_find_by_vdevid(struct dp_soc *soc,
 struct dp_ast_entry *dp_peer_ast_hash_find_soc(struct dp_soc *soc,
 					       uint8_t *ast_mac_addr);
 
+/**
+ * dp_peer_ast_hash_find_soc_by_type() - Find AST entry by MAC address
+ * and AST type
+ * @soc: SoC handle
+ * @ast_mac_addr: Mac address
+ * @type: AST entry type
+ *
+ * It assumes caller has taken the ast lock to protect the access to
+ * AST hash table
+ *
+ * Return: AST entry
+ */
+struct dp_ast_entry *dp_peer_ast_hash_find_soc_by_type(
+					struct dp_soc *soc,
+					uint8_t *ast_mac_addr,
+					enum cdp_txrx_ast_entry_type type);
+
 /**
  * dp_peer_ast_get_pdev_id() - get pdev_id from the ast entry
  * @soc: SoC handle