瀏覽代碼

qcacmn: Add AST type for DP path

There is a hard-coded AST type number used for DP path, which will
cause poor readability. Fix this problem by using a pre-defined
constant type value.

CRs-Fixed: 2142975
Change-Id: I3520970bf59ea7152a0851cfdc3b8e7943ddbc19
chenguo 7 年之前
父節點
當前提交
85d964f48b
共有 6 個文件被更改,包括 22 次插入9 次删除
  1. 1 1
      dp/wifi3.0/dp_main.c
  2. 5 5
      dp/wifi3.0/dp_peer.c
  3. 1 1
      dp/wifi3.0/dp_peer.h
  4. 2 1
      dp/wifi3.0/dp_rx.h
  5. 1 1
      dp/wifi3.0/dp_tx.c
  6. 12 0
      dp/wifi3.0/dp_types.h

+ 1 - 1
dp/wifi3.0/dp_main.c

@@ -2949,7 +2949,7 @@ static void *dp_peer_create_wifi3(struct cdp_vdev *vdev_handle,
 	/* store provided params */
 	peer->vdev = vdev;
 
-	dp_peer_add_ast(soc, peer, peer_mac_addr, 1);
+	dp_peer_add_ast(soc, peer, peer_mac_addr, dp_ast_type_static);
 
 	qdf_spinlock_create(&peer->peer_info_lock);
 

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

@@ -409,7 +409,7 @@ static inline void dp_peer_map_ast(struct dp_soc *soc,
  *         1 if entry already exists or if allocation has failed
  */
 int dp_peer_add_ast(struct dp_soc *soc, struct dp_peer *peer,
-		uint8_t *mac_addr, uint8_t is_self)
+		uint8_t *mac_addr, enum dp_ast_type is_self)
 {
 	struct dp_ast_entry *ast_entry;
 
@@ -445,15 +445,15 @@ int dp_peer_add_ast(struct dp_soc *soc, struct dp_peer *peer,
 	ast_entry->peer = peer;
 
 	switch (is_self) {
-	case 1:
+	case dp_ast_type_static:
 		peer->self_ast_entry = ast_entry;
 		ast_entry->type = CDP_TXRX_AST_TYPE_STATIC;
 		break;
-	case 0:
+	case dp_ast_type_wds:
 		ast_entry->next_hop = 1;
 		ast_entry->type = CDP_TXRX_AST_TYPE_WDS;
 		break;
-	case 2:
+	case dp_ast_type_mec:
 		ast_entry->next_hop = 1;
 		ast_entry->type = CDP_TXRX_AST_TYPE_MEC;
 		break;
@@ -493,7 +493,7 @@ void dp_peer_del_ast(struct dp_soc *soc,
 }
 #else
 int dp_peer_add_ast(struct dp_soc *soc, struct dp_peer *peer,
-		uint8_t *mac_addr, uint8_t is_self)
+		uint8_t *mac_addr, enum dp_ast_type is_self)
 {
 	return 1;
 }

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

@@ -56,7 +56,7 @@ uint8_t dp_get_peer_mac_addr_frm_id(struct cdp_soc_t *soc_handle,
 
 
 int dp_peer_add_ast(struct dp_soc *soc, struct dp_peer *peer,
-		uint8_t *mac_addr, uint8_t is_self);
+		uint8_t *mac_addr, enum dp_ast_type is_self);
 void dp_peer_del_ast(struct dp_soc *soc,
 		struct dp_ast_entry *ast_entry);
 struct dp_ast_entry *dp_peer_ast_hash_find(struct dp_soc *soc,

+ 2 - 1
dp/wifi3.0/dp_rx.h

@@ -365,7 +365,8 @@ dp_rx_wds_srcport_learn(struct dp_soc *soc,
 		IEEE80211_ADDR_LEN);
 
 	if (qdf_unlikely(!hal_rx_msdu_end_sa_is_valid_get(rx_tlv_hdr))) {
-		if (!dp_peer_add_ast(soc, ta_peer, wds_src_mac, 0)) {
+		if (!dp_peer_add_ast(soc, ta_peer, wds_src_mac,
+							dp_ast_type_wds)) {
 			ret = soc->cdp_soc.ol_ops->peer_add_wds_entry(
 					ta_peer->vdev->pdev->osif_pdev,
 					wds_src_mac,

+ 1 - 1
dp/wifi3.0/dp_tx.c

@@ -2073,7 +2073,7 @@ void dp_tx_mec_handler(struct dp_vdev *vdev, uint8_t *status)
 					status[(DP_MAC_ADDR_LEN - 2) + i];
 
 	if (qdf_mem_cmp(mac_addr, vdev->mac_addr.raw, DP_MAC_ADDR_LEN) &&
-		!dp_peer_add_ast(soc, peer, mac_addr, 2)) {
+		!dp_peer_add_ast(soc, peer, mac_addr, dp_ast_type_mec)) {
 			soc->cdp_soc.ol_ops->peer_add_wds_entry(
 				vdev->pdev->osif_pdev,
 				mac_addr,

+ 12 - 0
dp/wifi3.0/dp_types.h

@@ -180,6 +180,18 @@ enum dp_tx_frm_type {
 	dp_tx_frm_raw,
 };
 
+/**
+ * enum dp_ast_type
+ * @dp_ast_type_wds: WDS peer AST type
+ * @dp_ast_type_static: static ast entry type
+ * @dp_ast_type_mec: Multicast echo ast entry type
+ */
+enum dp_ast_type {
+	dp_ast_type_wds = 0,
+	dp_ast_type_static,
+	dp_ast_type_mec,
+};
+
 /**
  * struct rx_desc_pool
  * @pool_size: number of RX descriptor in the pool