diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index 069781ec89..19843eab16 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -215,6 +215,16 @@ enum ol_txrx_peer_state { OL_TXRX_PEER_STATE_AUTH, /* authentication successful */ }; +/** + * struct ol_txrx_ast_type - AST entry type information + */ +enum cdp_txrx_ast_entry_type { + CDP_TXRX_AST_TYPE_NONE, /* static ast entry for connected peer */ + CDP_TXRX_AST_TYPE_STATIC,/* static ast entry for connected peer */ + CDP_TXRX_AST_TYPE_WDS, /* WDS peer ast entry type*/ + CDP_TXRX_AST_TYPE_MEC, /* Multicast echo ast entry type */ + CDP_TXRX_AST_TYPE_MAX +}; /** * struct cdp_sec_type - security type information diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index fe55a7669b..e1a610be4f 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -618,7 +618,8 @@ struct ol_if_ops { uint8_t (*rx_invalid_peer)(void *osif_pdev, void *msg); int (*peer_map_event)(void *ol_soc_handle, uint16_t peer_id, uint16_t hw_peer_id, - uint8_t vdev_id, uint8_t *peer_mac_addr); + uint8_t vdev_id, uint8_t *peer_mac_addr, + enum cdp_txrx_ast_entry_type peer_type); int (*peer_unmap_event)(void *ol_soc_handle, uint16_t peer_id); int (*get_dp_cfg_param)(void *ol_soc_handle, enum cdp_cfg_param_type param_num); diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 4201f8f68c..8d2350f8e2 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -1489,7 +1489,7 @@ static void dp_wds_aging_timer_fn(void *soc_hdl) /* * Do not expire static ast entries */ - if (ase->is_static) + if (ase->type == CDP_TXRX_AST_TYPE_STATIC) continue; if (ase->is_active) { diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c index 3f3afc26b6..9318276f05 100644 --- a/dp/wifi3.0/dp_peer.c +++ b/dp/wifi3.0/dp_peer.c @@ -354,17 +354,12 @@ static inline void dp_peer_map_ast(struct dp_soc *soc, uint8_t vdev_id) { struct dp_ast_entry *ast_entry; + enum cdp_txrx_ast_entry_type peer_type = CDP_TXRX_AST_TYPE_NONE; if (!peer) { return; } - if (soc->cdp_soc.ol_ops->peer_map_event) { - soc->cdp_soc.ol_ops->peer_map_event(soc->osif_soc, - peer->peer_ids[0], hw_peer_id, vdev_id, - mac_addr); - } - QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, "%s: peer %p ID %d vid %d mac %02x:%02x:%02x:%02x:%02x:%02x\n", __func__, peer, hw_peer_id, vdev_id, mac_addr[0], @@ -378,7 +373,14 @@ static inline void dp_peer_map_ast(struct dp_soc *soc, ast_entry->ast_idx = hw_peer_id; soc->ast_table[hw_peer_id] = ast_entry; ast_entry->is_active = TRUE; + peer_type = ast_entry->type; qdf_spin_unlock_bh(&soc->ast_lock); + if (soc->cdp_soc.ol_ops->peer_map_event) { + soc->cdp_soc.ol_ops->peer_map_event( + soc->osif_soc, peer->peer_ids[0], + hw_peer_id, vdev_id, + mac_addr, peer_type); + } return; } } @@ -417,7 +419,7 @@ int dp_peer_add_ast(struct dp_soc *soc, struct dp_peer *peer, /* If AST entry already exists , just return from here */ ast_entry = dp_peer_ast_hash_find(soc, mac_addr, 0); if (ast_entry) { - if (ast_entry->is_mec) + if (ast_entry->type == CDP_TXRX_AST_TYPE_MEC) ast_entry->is_active = TRUE; qdf_spin_unlock_bh(&soc->ast_lock); @@ -441,16 +443,15 @@ int dp_peer_add_ast(struct dp_soc *soc, struct dp_peer *peer, switch (is_self) { case 1: peer->self_ast_entry = ast_entry; - ast_entry->is_static = TRUE; + ast_entry->type = CDP_TXRX_AST_TYPE_STATIC; break; case 0: ast_entry->next_hop = 1; - ast_entry->is_static = FALSE; + ast_entry->type = CDP_TXRX_AST_TYPE_WDS; break; case 2: - ast_entry->is_mec = 1; ast_entry->next_hop = 1; - ast_entry->is_static = FALSE; + ast_entry->type = CDP_TXRX_AST_TYPE_MEC; break; default: QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, diff --git a/dp/wifi3.0/dp_rx_err.c b/dp/wifi3.0/dp_rx_err.c index 655f50ad4e..d3b57b1741 100644 --- a/dp/wifi3.0/dp_rx_err.c +++ b/dp/wifi3.0/dp_rx_err.c @@ -372,7 +372,8 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc, struct dp_rx_desc *rx_desc, ase = dp_peer_ast_hash_find(soc, &data[DP_MAC_ADDR_LEN], 0); if (ase) { - if (ase->is_mec || (ase->peer != peer)) { + if ((ase->type == CDP_TXRX_AST_TYPE_MEC) || + (ase->peer != peer)) { qdf_spin_unlock_bh(&soc->ast_lock); QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO, diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index 5ee5d28eb1..a3d17f4d9a 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -1684,7 +1684,7 @@ static inline void dp_tx_comp_free_buf(struct dp_soc *soc, * Return: none */ #ifdef FEATURE_WDS -static void dp_tx_mec_handler(struct dp_vdev *vdev, uint8_t *status) +void dp_tx_mec_handler(struct dp_vdev *vdev, uint8_t *status) { struct dp_soc *soc; diff --git a/dp/wifi3.0/dp_tx.h b/dp/wifi3.0/dp_tx.h index a2da02e1f5..e07bb03fca 100644 --- a/dp/wifi3.0/dp_tx.h +++ b/dp/wifi3.0/dp_tx.h @@ -149,6 +149,11 @@ uint32_t dp_tx_comp_handler(struct dp_soc *soc, uint32_t ring_id, int32_t dp_tx_prepare_send_me(struct dp_vdev *vdev, qdf_nbuf_t nbuf); + +#ifdef FEATURE_WDS +void dp_tx_mec_handler(struct dp_vdev *vdev, uint8_t *status); +#endif + /* TODO TX_FEATURE_NOT_YET */ static inline void dp_tx_comp_process_exception(struct dp_tx_desc_s *tx_desc) { diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index e26ea60264..40c381926f 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -515,8 +515,9 @@ union dp_align_mac_addr { * @next_hop: Set to 1 if this is for a WDS node * @is_active: flag to indicate active data traffic on this node * (used for aging out/expiry) - * @is_static: flag to indicate static entry (should not be expired) * @ase_list_elem: node in peer AST list + * @is_bss: flag to indicate if entry corresponds to bss peer + * @type: flag to indicate type of the entry(static/WDS/MEC) * @hash_list_elem: node in soc AST hash list (mac address used as hash) */ struct dp_ast_entry { @@ -526,9 +527,8 @@ struct dp_ast_entry { struct dp_peer *peer; bool next_hop; bool is_active; - bool is_static; - bool is_mec; bool is_bss; + enum cdp_txrx_ast_entry_type type; TAILQ_ENTRY(dp_ast_entry) ase_list_elem; TAILQ_ENTRY(dp_ast_entry) hash_list_elem; };