Browse Source

qcacmn: add support for reset ast entry and table

Add support for reset ast entry and table, also send
ast entry type to upper layers in delete callback

Change-Id: I6b420fba5bab50519e8954a1e796b04bc0768ef8
CRs-fixed: 2384550
Chaithanya Garrepalli 6 years ago
parent
commit
267ae0e416
4 changed files with 50 additions and 25 deletions
  1. 4 2
      dp/inc/cdp_txrx_cmn.h
  2. 4 2
      dp/inc/cdp_txrx_ops.h
  3. 38 18
      dp/wifi3.0/dp_main.c
  4. 4 3
      dp/wifi3.0/dp_peer.c

+ 4 - 2
dp/inc/cdp_txrx_cmn.h

@@ -529,7 +529,8 @@ static inline int cdp_peer_add_ast
 }
 
 static inline void cdp_peer_reset_ast
-	(ol_txrx_soc_handle soc, uint8_t *wds_macaddr, void *vdev_hdl)
+	(ol_txrx_soc_handle soc, uint8_t *wds_macaddr, uint8_t *peer_macaddr,
+	 void *vdev_hdl)
 {
 
 	if (!soc || !soc->ops) {
@@ -542,7 +543,8 @@ static inline void cdp_peer_reset_ast
 	    !soc->ops->cmn_drv_ops->txrx_peer_reset_ast)
 		return;
 
-	soc->ops->cmn_drv_ops->txrx_peer_reset_ast(soc, wds_macaddr, vdev_hdl);
+	soc->ops->cmn_drv_ops->txrx_peer_reset_ast(soc, wds_macaddr,
+						   peer_macaddr, vdev_hdl);
 }
 
 static inline void cdp_peer_reset_ast_table

+ 4 - 2
dp/inc/cdp_txrx_ops.h

@@ -402,7 +402,8 @@ struct cdp_cmn_ops {
 			void *dp_txrx_handle);
 
 	void (*txrx_peer_reset_ast)
-		(ol_txrx_soc_handle soc, uint8_t *ast_macaddr, void *vdev_hdl);
+		(ol_txrx_soc_handle soc, uint8_t *ast_macaddr,
+		 uint8_t *peer_macaddr, void *vdev_hdl);
 
 	void (*txrx_peer_reset_ast_table)(ol_txrx_soc_handle soc,
 					  void *vdev_hdl);
@@ -882,7 +883,8 @@ struct ol_if_ops {
 			uint8_t *dest_macaddr, uint8_t *peer_macaddr,
 			uint32_t flags);
 	void (*peer_del_wds_entry)(void *ol_soc_handle,
-			uint8_t *wds_macaddr);
+				   uint8_t *wds_macaddr,
+				   uint8_t type);
 	QDF_STATUS
 	(*lro_hash_config)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
 			   struct cdp_lro_hash_config *rx_offld_hash);

+ 38 - 18
dp/wifi3.0/dp_main.c

@@ -565,25 +565,48 @@ static int dp_peer_update_ast_wifi3(struct cdp_soc_t *soc_hdl,
  * Return: None
  */
 static void dp_wds_reset_ast_wifi3(struct cdp_soc_t *soc_hdl,
-				   uint8_t *wds_macaddr, void *vdev_handle)
+				   uint8_t *wds_macaddr,
+				   uint8_t *peer_mac_addr,
+				   void *vdev_handle)
 {
 	struct dp_soc *soc = (struct dp_soc *)soc_hdl;
 	struct dp_ast_entry *ast_entry = NULL;
+	struct dp_ast_entry *tmp_ast_entry;
+	struct dp_peer *peer;
 	struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
+	struct dp_pdev *pdev;
 
-	qdf_spin_lock_bh(&soc->ast_lock);
-	ast_entry = dp_peer_ast_hash_find_by_pdevid(soc, wds_macaddr,
-						    vdev->pdev->pdev_id);
+	if (!vdev)
+		return;
 
-	if (ast_entry) {
-		if ((ast_entry->type != CDP_TXRX_AST_TYPE_STATIC) &&
-			(ast_entry->type != CDP_TXRX_AST_TYPE_SELF) &&
-			(ast_entry->type != CDP_TXRX_AST_TYPE_STA_BSS)) {
-			ast_entry->is_active = TRUE;
+	pdev = vdev->pdev;
+
+	if (peer_mac_addr) {
+		peer = dp_peer_find_hash_find(soc, peer_mac_addr,
+					      0, vdev->vdev_id);
+		if (!peer)
+			return;
+		qdf_spin_lock_bh(&soc->ast_lock);
+		DP_PEER_ITERATE_ASE_LIST(peer, ast_entry, tmp_ast_entry) {
+			if ((ast_entry->type == CDP_TXRX_AST_TYPE_WDS_HM) ||
+			    (ast_entry->type == CDP_TXRX_AST_TYPE_WDS_HM_SEC))
+				dp_peer_del_ast(soc, ast_entry);
 		}
-	}
+		qdf_spin_unlock_bh(&soc->ast_lock);
+		dp_peer_unref_delete(peer);
 
-	qdf_spin_unlock_bh(&soc->ast_lock);
+	} else if (wds_macaddr) {
+		qdf_spin_lock_bh(&soc->ast_lock);
+		ast_entry = dp_peer_ast_hash_find_by_pdevid(soc, wds_macaddr,
+							    pdev->pdev_id);
+
+		if (ast_entry) {
+			if ((ast_entry->type == CDP_TXRX_AST_TYPE_WDS_HM) ||
+			    (ast_entry->type == CDP_TXRX_AST_TYPE_WDS_HM_SEC))
+				dp_peer_del_ast(soc, ast_entry);
+		}
+		qdf_spin_unlock_bh(&soc->ast_lock);
+	}
 }
 
 /*
@@ -611,13 +634,10 @@ static void dp_wds_reset_ast_table_wifi3(struct cdp_soc_t  *soc_hdl,
 			DP_VDEV_ITERATE_PEER_LIST(vdev, peer) {
 				DP_PEER_ITERATE_ASE_LIST(peer, ase, temp_ase) {
 					if ((ase->type ==
-						CDP_TXRX_AST_TYPE_STATIC) ||
-						(ase->type ==
-						CDP_TXRX_AST_TYPE_SELF) ||
-						(ase->type ==
-						CDP_TXRX_AST_TYPE_STA_BSS))
-						continue;
-					ase->is_active = TRUE;
+						CDP_TXRX_AST_TYPE_WDS_HM) ||
+					    (ase->type ==
+						CDP_TXRX_AST_TYPE_WDS_HM_SEC))
+						dp_peer_del_ast(soc, ase);
 				}
 			}
 		}

+ 4 - 3
dp/wifi3.0/dp_peer.c

@@ -1012,10 +1012,11 @@ void dp_peer_ast_send_wds_del(struct dp_soc *soc,
 		  peer->vdev->vdev_id, ast_entry->mac_addr.raw,
 		  ast_entry->next_hop, ast_entry->peer->mac_addr.raw);
 
-	if (ast_entry->next_hop &&
-	    ast_entry->type != CDP_TXRX_AST_TYPE_WDS_HM_SEC)
+	if (ast_entry->next_hop) {
 		cdp_soc->ol_ops->peer_del_wds_entry(peer->vdev->osif_vdev,
-						    ast_entry->mac_addr.raw);
+						    ast_entry->mac_addr.raw,
+						    ast_entry->type);
+	}
 
 	ast_entry->delete_in_progress = true;
 }