From 1ea7b9f065b15a4588d50c339ffa260e8b9ec155 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 4 Jan 2023 16:50:54 -0800 Subject: [PATCH] qcacmn: Fix dp/wifi3.0/dp_peer.* documentation The kernel-doc script identified a large number of documentation issues in dp/wifi3.0/dp_peer.[ch], so fix those issues. In addition, there are a number of instances where public functions have their implementation documented instead of having their interface documented, so move that documentation. Change-Id: I996764f93addfa270ef7aaedd2e23c71be287f77 CRs-Fixed: 3373168 --- dp/wifi3.0/dp_peer.c | 575 +++---------------------------------------- dp/wifi3.0/dp_peer.h | 517 ++++++++++++++++++++++++++++++-------- 2 files changed, 453 insertions(+), 639 deletions(-) diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c index c3b7342f3b..d7ab0cc378 100644 --- a/dp/wifi3.0/dp_peer.c +++ b/dp/wifi3.0/dp_peer.c @@ -52,11 +52,11 @@ struct reo_qdesc_event reo_qdesc_history[REO_QDESC_HISTORY_SIZE]; #ifdef FEATURE_AST #ifdef BYPASS_OL_OPS -/* +/** * dp_add_wds_entry_wrapper() - Add new AST entry for the wds station * @soc: DP soc structure pointer * @peer: dp peer structure - * @dest_mac: MAC address of ast node + * @dest_macaddr: MAC address of ast node * @flags: wds or hmwds * @type: type from enum cdp_txrx_ast_entry_type * @@ -83,7 +83,7 @@ static int dp_add_wds_entry_wrapper(struct dp_soc *soc, return qdf_status_to_os_return(status); } -/* +/** * dp_update_wds_entry_wrapper() - update an existing wds entry with new peer * @soc: DP soc structure pointer * @peer: dp peer structure @@ -111,7 +111,7 @@ static int dp_update_wds_entry_wrapper(struct dp_soc *soc, return qdf_status_to_os_return(status); } -/* +/** * dp_del_wds_entry_wrapper() - delete a WSD AST entry * @soc: DP soc structure pointer * @vdev_id: vdev_id @@ -341,7 +341,7 @@ QDF_STATUS dp_peer_ast_table_attach(struct dp_soc *soc) return QDF_STATUS_SUCCESS; /* success */ } -/* +/** * dp_peer_find_map_attach() - allocate memory for peer_id_to_obj_map * @soc: soc handle * @@ -393,18 +393,6 @@ dp_peer_find_hash_index(struct dp_soc *soc, return index; } -/* - * dp_peer_find_hash_find() - returns legacy or mlo link peer from - * peer_hash_table matching vdev_id and mac_address - * @soc: soc handle - * @peer_mac_addr: peer mac address - * @mac_addr_is_aligned: is mac addr aligned - * @vdev_id: vdev_id - * @mod_id: id of module requesting reference - * - * return: peer in sucsess - * NULL in failure - */ struct dp_peer *dp_peer_find_hash_find( struct dp_soc *soc, uint8_t *peer_mac_addr, int mac_addr_is_aligned, uint8_t vdev_id, @@ -447,7 +435,7 @@ struct dp_peer *dp_peer_find_hash_find( qdf_export_symbol(dp_peer_find_hash_find); #ifdef WLAN_FEATURE_11BE_MLO -/* +/** * dp_peer_find_hash_detach() - cleanup memory for peer_hash table * @soc: soc handle * @@ -465,7 +453,7 @@ static void dp_peer_find_hash_detach(struct dp_soc *soc) soc->arch_ops.mlo_peer_find_hash_detach(soc); } -/* +/** * dp_peer_find_hash_attach() - allocate memory for peer_hash table * @soc: soc handle * @@ -504,14 +492,6 @@ static QDF_STATUS dp_peer_find_hash_attach(struct dp_soc *soc) return QDF_STATUS_SUCCESS; } -/* - * dp_peer_find_hash_add() - add peer to peer_hash_table - * @soc: soc handle - * @peer: peer handle - * @peer_type: link or mld peer - * - * return: none - */ void dp_peer_find_hash_add(struct dp_soc *soc, struct dp_peer *peer) { unsigned index; @@ -547,13 +527,6 @@ void dp_peer_find_hash_add(struct dp_soc *soc, struct dp_peer *peer) } } -/* - * dp_peer_find_hash_remove() - remove peer from peer_hash_table - * @soc: soc handle - * @peer: peer handle - * - * return: none - */ void dp_peer_find_hash_remove(struct dp_soc *soc, struct dp_peer *peer) { unsigned index; @@ -676,14 +649,6 @@ void dp_peer_find_hash_remove(struct dp_soc *soc, struct dp_peer *peer) #endif/* WLAN_FEATURE_11BE_MLO */ -/* - * dp_peer_vdev_list_add() - add peer into vdev's peer list - * @soc: soc handle - * @vdev: vdev handle - * @peer: peer handle - * - * return: none - */ void dp_peer_vdev_list_add(struct dp_soc *soc, struct dp_vdev *vdev, struct dp_peer *peer) { @@ -709,14 +674,6 @@ void dp_peer_vdev_list_add(struct dp_soc *soc, struct dp_vdev *vdev, qdf_spin_unlock_bh(&vdev->peer_list_lock); } -/* - * dp_peer_vdev_list_remove() - remove peer from vdev's peer list - * @soc: SoC handle - * @vdev: VDEV handle - * @peer: peer handle - * - * Return: none - */ void dp_peer_vdev_list_remove(struct dp_soc *soc, struct dp_vdev *vdev, struct dp_peer *peer) { @@ -748,14 +705,6 @@ void dp_peer_vdev_list_remove(struct dp_soc *soc, struct dp_vdev *vdev, qdf_spin_unlock_bh(&vdev->peer_list_lock); } -/* - * dp_txrx_peer_attach_add() - Attach txrx_peer and add it to peer_id table - * @soc: SoC handle - * @peer: peer handle - * @txrx_peer: txrx peer handle - * - * Return: None - */ void dp_txrx_peer_attach_add(struct dp_soc *soc, struct dp_peer *peer, struct dp_txrx_peer *txrx_peer) @@ -777,14 +726,6 @@ void dp_txrx_peer_attach_add(struct dp_soc *soc, qdf_spin_unlock_bh(&soc->peer_map_lock); } -/* - * dp_peer_find_id_to_obj_add() - Add peer into peer_id table - * @soc: SoC handle - * @peer: peer handle - * @peer_id: peer_id - * - * Return: None - */ void dp_peer_find_id_to_obj_add(struct dp_soc *soc, struct dp_peer *peer, uint16_t peer_id) @@ -819,13 +760,6 @@ void dp_peer_find_id_to_obj_add(struct dp_soc *soc, qdf_spin_unlock_bh(&soc->peer_map_lock); } -/* - * dp_peer_find_id_to_obj_remove() - remove peer from peer_id table - * @soc: SoC handle - * @peer_id: peer_id - * - * Return: None - */ void dp_peer_find_id_to_obj_remove(struct dp_soc *soc, uint16_t peer_id) { @@ -843,12 +777,6 @@ void dp_peer_find_id_to_obj_remove(struct dp_soc *soc, } #ifdef FEATURE_MEC -/** - * dp_peer_mec_hash_attach() - Allocate and initialize MEC Hash Table - * @soc: SoC handle - * - * Return: QDF_STATUS - */ QDF_STATUS dp_peer_mec_hash_attach(struct dp_soc *soc) { int log2, hash_elems, i; @@ -879,6 +807,7 @@ QDF_STATUS dp_peer_mec_hash_attach(struct dp_soc *soc) /** * dp_peer_mec_hash_index() - Compute the MEC hash from MAC address * @soc: SoC handle + * @mac_addr: MAC address * * Return: MEC hash */ @@ -921,6 +850,7 @@ struct dp_mec_entry *dp_peer_mec_hash_find_by_pdevid(struct dp_soc *soc, /** * dp_peer_mec_hash_add() - Add MEC entry into hash table * @soc: SoC handle + * @mecentry: MEC entry * * This function adds the MEC entry into SoC MEC hash table * @@ -1023,12 +953,6 @@ void dp_peer_mec_free_list(struct dp_soc *soc, void *ptr) } } -/** - * dp_peer_mec_hash_detach() - Free MEC Hash table - * @soc: SoC handle - * - * Return: None - */ void dp_peer_mec_hash_detach(struct dp_soc *soc) { dp_peer_mec_flush_entries(soc); @@ -1058,8 +982,8 @@ void dp_peer_mec_hash_detach(struct dp_soc *soc) #ifdef FEATURE_AST #ifdef WLAN_FEATURE_11BE_MLO -/* - * dp_peer_exist_on_pdev - check if peer with mac address exist on pdev +/** + * dp_peer_exist_on_pdev() - check if peer with mac address exist on pdev * * @soc: Datapath SOC handle * @peer_mac_addr: peer mac address @@ -1144,12 +1068,6 @@ static bool dp_peer_exist_on_pdev(struct dp_soc *soc, } #endif /* WLAN_FEATURE_11BE_MLO */ -/* - * dp_peer_ast_hash_attach() - Allocate and initialize AST Hash Table - * @soc: SoC handle - * - * Return: QDF_STATUS - */ QDF_STATUS dp_peer_ast_hash_attach(struct dp_soc *soc) { int i, hash_elems, log2; @@ -1181,7 +1099,7 @@ QDF_STATUS dp_peer_ast_hash_attach(struct dp_soc *soc) return QDF_STATUS_SUCCESS; } -/* +/** * dp_peer_ast_cleanup() - cleanup the references * @soc: SoC handle * @ast: ast entry @@ -1208,12 +1126,6 @@ static inline void dp_peer_ast_cleanup(struct dp_soc *soc, } } -/* - * dp_peer_ast_hash_detach() - Free AST Hash table - * @soc: SoC handle - * - * Return: None - */ void dp_peer_ast_hash_detach(struct dp_soc *soc) { unsigned int index; @@ -1246,14 +1158,15 @@ void dp_peer_ast_hash_detach(struct dp_soc *soc) soc->ast_hash.bins = NULL; } -/* +/** * dp_peer_ast_hash_index() - Compute the AST hash from MAC address * @soc: SoC handle + * @mac_addr: MAC address * * Return: AST hash */ static inline uint32_t dp_peer_ast_hash_index(struct dp_soc *soc, - union dp_align_mac_addr *mac_addr) + union dp_align_mac_addr *mac_addr) { uint32_t index; @@ -1266,9 +1179,10 @@ static inline uint32_t dp_peer_ast_hash_index(struct dp_soc *soc, return index; } -/* +/** * dp_peer_ast_hash_add() - Add AST entry into hash table * @soc: SoC handle + * @ase: AST entry * * This function adds the AST entry into SoC AST hash table * It assumes caller has taken the ast lock to protect the access to this table @@ -1276,7 +1190,7 @@ static inline uint32_t dp_peer_ast_hash_index(struct dp_soc *soc, * Return: None */ static inline void dp_peer_ast_hash_add(struct dp_soc *soc, - struct dp_ast_entry *ase) + struct dp_ast_entry *ase) { uint32_t index; @@ -1284,15 +1198,6 @@ static inline void dp_peer_ast_hash_add(struct dp_soc *soc, TAILQ_INSERT_TAIL(&soc->ast_hash.bins[index], ase, hash_list_elem); } -/* - * dp_peer_ast_hash_remove() - Look up and remove AST entry from hash table - * @soc: SoC handle - * - * This function removes the AST entry from soc AST hash table - * It assumes caller has taken the ast lock to protect the access to this table - * - * Return: None - */ void dp_peer_ast_hash_remove(struct dp_soc *soc, struct dp_ast_entry *ase) { @@ -1323,15 +1228,6 @@ void dp_peer_ast_hash_remove(struct dp_soc *soc, TAILQ_REMOVE(&soc->ast_hash.bins[index], ase, hash_list_elem); } -/* - * dp_peer_ast_hash_find_by_vdevid() - Find AST entry by MAC address - * @soc: SoC handle - * - * 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_by_vdevid(struct dp_soc *soc, uint8_t *ast_mac_addr, uint8_t vdev_id) @@ -1355,15 +1251,6 @@ struct dp_ast_entry *dp_peer_ast_hash_find_by_vdevid(struct dp_soc *soc, return NULL; } -/* - * dp_peer_ast_hash_find_by_pdevid() - Find AST entry by MAC address - * @soc: SoC handle - * - * 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_by_pdevid(struct dp_soc *soc, uint8_t *ast_mac_addr, uint8_t pdev_id) @@ -1387,15 +1274,6 @@ struct dp_ast_entry *dp_peer_ast_hash_find_by_pdevid(struct dp_soc *soc, return NULL; } -/* - * dp_peer_ast_hash_find_soc() - Find AST entry by MAC address - * @soc: SoC handle - * - * 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(struct dp_soc *soc, uint8_t *ast_mac_addr) { @@ -1420,7 +1298,7 @@ struct dp_ast_entry *dp_peer_ast_hash_find_soc(struct dp_soc *soc, return NULL; } -/* +/** * dp_peer_host_add_map_ast() - Add ast entry with HW AST Index * @soc: SoC handle * @peer_id: peer id from firmware @@ -1561,7 +1439,7 @@ fail: return status; } -/* +/** * dp_peer_map_ast() - Map the ast entry with HW AST Index * @soc: SoC handle * @peer: peer to which ast node belongs @@ -1719,18 +1597,6 @@ void dp_peer_free_hmwds_cb(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, qdf_mem_free(cookie); } -/* - * dp_peer_add_ast() - Allocate and add AST entry into peer list - * @soc: SoC handle - * @peer: peer to which ast node belongs - * @mac_addr: MAC address of ast node - * @is_self: Is this base AST entry with peer mac address - * - * This API is used by WDS source port learning function to - * add a new AST entry into peer AST list - * - * Return: QDF_STATUS code - */ QDF_STATUS dp_peer_add_ast(struct dp_soc *soc, struct dp_peer *peer, uint8_t *mac_addr, @@ -1970,16 +1836,6 @@ add_ast_entry: qdf_export_symbol(dp_peer_add_ast); -/* - * dp_peer_free_ast_entry() - Free up the ast entry memory - * @soc: SoC handle - * @ast_entry: Address search entry - * - * This API is used to free up the memory associated with - * AST entry. - * - * Return: None - */ void dp_peer_free_ast_entry(struct dp_soc *soc, struct dp_ast_entry *ast_entry) { @@ -2001,17 +1857,6 @@ void dp_peer_free_ast_entry(struct dp_soc *soc, soc->num_ast_entries--; } -/* - * dp_peer_unlink_ast_entry() - Free up the ast entry memory - * @soc: SoC handle - * @ast_entry: Address search entry - * @peer: peer - * - * This API is used to remove/unlink AST entry from the peer list - * and hash list. - * - * Return: None - */ void dp_peer_unlink_ast_entry(struct dp_soc *soc, struct dp_ast_entry *ast_entry, struct dp_peer *peer) @@ -2048,17 +1893,6 @@ void dp_peer_unlink_ast_entry(struct dp_soc *soc, ast_entry->peer_id = HTT_INVALID_PEER; } -/* - * dp_peer_del_ast() - Delete and free AST entry - * @soc: SoC handle - * @ast_entry: AST entry of the node - * - * This function removes the AST entry from peer and soc tables - * It assumes caller has taken the ast lock to protect the access to these - * tables - * - * Return: None - */ void dp_peer_del_ast(struct dp_soc *soc, struct dp_ast_entry *ast_entry) { struct dp_peer *peer = NULL; @@ -2126,20 +1960,6 @@ end: dp_peer_unref_delete(peer, DP_MOD_ID_AST); } -/* - * dp_peer_update_ast() - Delete and free AST entry - * @soc: SoC handle - * @peer: peer to which ast node belongs - * @ast_entry: AST entry of the node - * @flags: wds or hmwds - * - * This function update the AST entry to the roamed peer and soc tables - * It assumes caller has taken the ast lock to protect the access to these - * tables - * - * Return: 0 if ast entry is updated successfully - * -1 failure - */ int dp_peer_update_ast(struct dp_soc *soc, struct dp_peer *peer, struct dp_ast_entry *ast_entry, uint32_t flags) { @@ -2204,45 +2024,18 @@ int dp_peer_update_ast(struct dp_soc *soc, struct dp_peer *peer, return ret; } -/* - * dp_peer_ast_get_pdev_id() - get pdev_id from the ast entry - * @soc: SoC handle - * @ast_entry: AST entry of the node - * - * This function gets the pdev_id from the ast entry. - * - * Return: (uint8_t) pdev_id - */ uint8_t dp_peer_ast_get_pdev_id(struct dp_soc *soc, struct dp_ast_entry *ast_entry) { return ast_entry->pdev_id; } -/* - * dp_peer_ast_get_next_hop() - get next_hop from the ast entry - * @soc: SoC handle - * @ast_entry: AST entry of the node - * - * This function gets the next hop from the ast entry. - * - * Return: (uint8_t) next_hop - */ uint8_t dp_peer_ast_get_next_hop(struct dp_soc *soc, struct dp_ast_entry *ast_entry) { return ast_entry->next_hop; } -/* - * dp_peer_ast_set_type() - set type from the ast entry - * @soc: SoC handle - * @ast_entry: AST entry of the node - * - * This function sets the type in the ast entry. - * - * Return: - */ void dp_peer_ast_set_type(struct dp_soc *soc, struct dp_ast_entry *ast_entry, enum cdp_txrx_ast_entry_type type) @@ -2461,7 +2254,7 @@ static uint32_t dp_peer_ast_free_wds_entries(struct dp_soc *soc, * dp_peer_clean_wds_entries() - Clean wds ast entries and compare * @soc: soc handle * @peer: peer handle - * @free_wds_count - number of wds entries freed by FW with peer delete + * @free_wds_count: number of wds entries freed by FW with peer delete * * Free all the wds ast entries associated with peer and compare with * the value received from firmware @@ -2617,12 +2410,6 @@ void dp_peer_ast_table_detach(struct dp_soc *soc) } } -/* - * dp_peer_find_map_detach() - cleanup memory for peer_id_to_obj_map - * @soc: soc handle - * - * return: none - */ void dp_peer_find_map_detach(struct dp_soc *soc) { if (soc->peer_id_to_obj_map) { @@ -2691,14 +2478,6 @@ map_detach: #endif #ifdef IPA_OFFLOAD -/* - * dp_peer_update_tid_stats_from_reo() - update rx pkt and byte count from reo - * @soc - soc handle - * @cb_ctxt - combination of peer_id and tid - * @reo_status - reo status - * - * return: void - */ void dp_peer_update_tid_stats_from_reo(struct dp_soc *soc, void *cb_ctxt, union hal_reo_status *reo_status) { @@ -2848,7 +2627,7 @@ void dp_peer_rx_reo_shared_qaddr_delete(struct dp_soc *soc, } #endif -/* +/** * dp_peer_find_add_id() - map peer_id with peer * @soc: soc handle * @peer_mac_addr: peer mac address @@ -3077,22 +2856,6 @@ dp_tx_ppeds_cfg_astidx_cache_mapping(struct dp_soc *soc, struct dp_vdev *vdev, } #endif -/** - * dp_rx_peer_map_handler() - handle peer map event from firmware - * @soc_handle - generic soc handle - * @peeri_id - peer_id from firmware - * @hw_peer_id - ast index for this peer - * @vdev_id - vdev ID - * @peer_mac_addr - mac address of the peer - * @ast_hash - ast hash value - * @is_wds - flag to indicate peer map event for WDS ast entry - * - * associate the peer_id that firmware provided with peer entry - * and update the ast table in the host with the hw_peer_id. - * - * Return: QDF_STATUS code - */ - QDF_STATUS dp_rx_peer_map_handler(struct dp_soc *soc, uint16_t peer_id, uint16_t hw_peer_id, uint8_t vdev_id, @@ -3228,17 +2991,6 @@ dp_rx_peer_map_handler(struct dp_soc *soc, uint16_t peer_id, return err; } -/** - * dp_rx_peer_unmap_handler() - handle peer unmap event from firmware - * @soc_handle - generic soc handle - * @peeri_id - peer_id from firmware - * @vdev_id - vdev ID - * @mac_addr - mac address of the peer or wds entry - * @is_wds - flag to indicate peer map event for WDS ast entry - * @free_wds_count - number of wds entries freed by FW with peer delete - * - * Return: none - */ void dp_rx_peer_unmap_handler(struct dp_soc *soc, uint16_t peer_id, uint8_t vdev_id, uint8_t *mac_addr, @@ -3443,7 +3195,7 @@ static bool dp_get_peer_vdev_roaming_in_progress(struct dp_peer *peer) #ifdef WLAN_FEATURE_11BE_MLO /** * dp_rx_tid_setup_allow() - check if rx_tid and reo queue desc - setup is necessary + * setup is necessary * @peer: DP peer handle * * Return: true - allow, false - disallow @@ -3536,11 +3288,11 @@ QDF_STATUS dp_rx_tid_update_wifi3(struct dp_peer *peer, int tid, uint32_t } #ifdef WLAN_DP_FEATURE_DEFERRED_REO_QDESC_DESTROY -/* +/** * dp_reo_desc_defer_free_enqueue() - enqueue REO QDESC to be freed into * the deferred list * @soc: Datapath soc handle - * @free_desc: REO DESC reference that needs to be freed + * @freedesc: REO DESC reference that needs to be freed * * Return: true if enqueued, else false */ @@ -3576,11 +3328,10 @@ static bool dp_reo_desc_defer_free_enqueue(struct dp_soc *soc, return true; } -/* +/** * dp_reo_desc_defer_free() - free the REO QDESC in the deferred list * based on time threshold * @soc: Datapath soc handle - * @free_desc: REO DESC reference that needs to be freed * * Return: true if enqueued, else false */ @@ -3624,7 +3375,7 @@ static void dp_reo_desc_defer_free(struct dp_soc *soc) } #endif /* !WLAN_DP_FEATURE_DEFERRED_REO_QDESC_DESTROY */ -/* +/** * dp_reo_desc_free() - Callback free reo descriptor memory after * HW cache flush * @@ -3686,15 +3437,6 @@ static inline int dp_reo_desc_addr_chk(qdf_dma_addr_t dma_addr) } #endif -/* - * dp_rx_tid_setup_wifi3() – Setup receive TID state - * @peer: Datapath peer handle - * @tid: TID - * @ba_window_size: BlockAck window size - * @start_seq: Starting sequence number - * - * Return: QDF_STATUS code - */ QDF_STATUS dp_rx_tid_setup_wifi3(struct dp_peer *peer, int tid, uint32_t ba_window_size, uint32_t start_seq) { @@ -3885,7 +3627,7 @@ void dp_reset_tid_q_setup(struct dp_soc *soc) } #endif #ifdef REO_DESC_DEFER_FREE -/* +/** * dp_reo_desc_clean_up() - If cmd to flush base desc fails add * desc back to freelist and defer the deletion * @@ -3903,7 +3645,7 @@ static void dp_reo_desc_clean_up(struct dp_soc *soc, (qdf_list_node_t *)desc); } -/* +/** * dp_reo_limit_clean_batch_sz() - Limit number REO CMD queued to cmd * ring in avoid of REO hang * @@ -3921,7 +3663,7 @@ static inline void dp_reo_limit_clean_batch_sz(uint32_t *list_size) } } #else -/* +/** * dp_reo_desc_clean_up() - If send cmd to REO inorder to flush * cache fails free the base REO desc anyway * @@ -3940,7 +3682,7 @@ static void dp_reo_desc_clean_up(struct dp_soc *soc, } } -/* +/** * dp_reo_limit_clean_batch_sz() - Limit number REO CMD queued to cmd * ring in avoid of REO hang * @@ -3951,7 +3693,7 @@ static inline void dp_reo_limit_clean_batch_sz(uint32_t *list_size) } #endif -/* +/** * dp_resend_update_reo_cmd() - Resend the UPDATE_REO_QUEUE * cmd and re-insert desc into free list if send fails. * @@ -4000,14 +3742,6 @@ dp_resend_update_reo_cmd(struct dp_soc *soc, return QDF_STATUS_SUCCESS; } -/* - * dp_rx_tid_delete_cb() - Callback to flush reo descriptor HW cache - * after deleting the entries (ie., setting valid=0) - * - * @soc: DP SOC handle - * @cb_ctxt: Callback context - * @reo_status: REO command status - */ void dp_rx_tid_delete_cb(struct dp_soc *soc, void *cb_ctxt, union hal_reo_status *reo_status) { @@ -4110,8 +3844,8 @@ void dp_rx_tid_delete_cb(struct dp_soc *soc, void *cb_ctxt, dp_reo_desc_defer_free(soc); } -/* - * dp_rx_tid_delete_wifi3() – Delete receive TID queue +/** + * dp_rx_tid_delete_wifi3() - Delete receive TID queue * @peer: Datapath peer handle * @tid: TID * @@ -4233,12 +3967,6 @@ static void dp_peer_rx_tids_init(struct dp_peer *peer) } #endif -/* - * dp_peer_rx_init() – Initialize receive TID state - * @pdev: Datapath pdev - * @peer: Datapath peer - * - */ void dp_peer_rx_init(struct dp_pdev *pdev, struct dp_peer *peer) { dp_peer_rx_tids_init(peer); @@ -4271,12 +3999,6 @@ void dp_peer_rx_init(struct dp_pdev *pdev, struct dp_peer *peer) cdp_sec_type_none; } -/* - * dp_peer_rx_cleanup() – Cleanup receive TID state - * @vdev: Datapath vdev - * @peer: Datapath peer - * - */ void dp_peer_rx_cleanup(struct dp_vdev *vdev, struct dp_peer *peer) { int tid; @@ -4318,12 +4040,6 @@ void dp_peer_rx_cleanup(struct dp_vdev *vdev, struct dp_peer *peer) #endif } -/* - * dp_peer_cleanup() – Cleanup peer information - * @vdev: Datapath vdev - * @peer: Datapath peer - * - */ void dp_peer_cleanup(struct dp_vdev *vdev, struct dp_peer *peer) { enum wlan_op_mode vdev_opmode; @@ -4359,7 +4075,8 @@ void dp_peer_cleanup(struct dp_vdev *vdev, struct dp_peer *peer) vdev_opmode); } -/* dp_teardown_256_ba_session() - Teardown sessions using 256 +/** + * dp_teardown_256_ba_sessions() - Teardown sessions using 256 * window size when a request with * 64 window size is received. * This is done as a WAR since HW can @@ -4415,16 +4132,6 @@ static void dp_teardown_256_ba_sessions(struct dp_peer *peer) } } -/* -* dp_rx_addba_resp_tx_completion_wifi3() – Update Rx Tid State -* -* @soc: Datapath soc handle -* @peer_mac: Datapath peer mac address -* @vdev_id: id of atapath vdev -* @tid: TID number -* @status: tx completion status -* Return: 0 on success, error code on failure -*/ int dp_addba_resp_tx_completion_wifi3(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac, uint16_t vdev_id, @@ -4517,18 +4224,6 @@ fail: return QDF_STATUS_E_FAILURE; } -/* -* dp_rx_addba_responsesetup_wifi3() – Process ADDBA request from peer -* -* @soc: Datapath soc handle -* @peer_mac: Datapath peer mac address -* @vdev_id: id of atapath vdev -* @tid: TID number -* @dialogtoken: output dialogtoken -* @statuscode: output dialogtoken -* @buffersize: Output BA window size -* @batimeout: Output BA timeout -*/ QDF_STATUS dp_addba_responsesetup_wifi3(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac, uint16_t vdev_id, uint8_t tid, @@ -4560,7 +4255,8 @@ dp_addba_responsesetup_wifi3(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac, return status; } -/* dp_check_ba_buffersize() - Check buffer size in request +/** + * dp_check_ba_buffersize() - Check buffer size in request * and latch onto this size based on * size used in first active session. * @peer: Datapath peer @@ -4611,7 +4307,7 @@ static void dp_check_ba_buffersize(struct dp_peer *peer, peer->kill_256_sessions = 1; } } else if (buffersize <= 1024) { - /** + /* * Above checks are only for HK V2 * Set incoming buffer size for others */ @@ -4661,20 +4357,6 @@ QDF_STATUS dp_rx_tid_update_ba_win_size(struct cdp_soc_t *cdp_soc, #define DP_RX_BA_SESSION_DISABLE 1 -/* - * dp_addba_requestprocess_wifi3() - Process ADDBA request from peer - * - * @soc: Datapath soc handle - * @peer_mac: Datapath peer mac address - * @vdev_id: id of atapath vdev - * @dialogtoken: dialogtoken from ADDBA frame - * @tid: TID number - * @batimeout: BA timeout - * @buffersize: BA window size - * @startseqnum: Start seq. number received in BA sequence control - * - * Return: 0 on success, error code on failure - */ int dp_addba_requestprocess_wifi3(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac, uint16_t vdev_id, @@ -4759,15 +4441,6 @@ fail: return status; } -/* -* dp_set_addba_response() – Set a user defined ADDBA response status code -* -* @soc: Datapath soc handle -* @peer_mac: Datapath peer mac address -* @vdev_id: id of atapath vdev -* @tid: TID number -* @statuscode: response status code to be set -*/ QDF_STATUS dp_set_addba_response(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac, uint16_t vdev_id, uint8_t tid, uint16_t statuscode) @@ -4792,16 +4465,6 @@ dp_set_addba_response(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac, return QDF_STATUS_SUCCESS; } -/* -* dp_rx_delba_process_wifi3() – Process DELBA from peer -* @soc: Datapath soc handle -* @peer_mac: Datapath peer mac address -* @vdev_id: id of atapath vdev -* @tid: TID number -* @reasoncode: Reason code received in DELBA frame -* -* Return: 0 on success, error code on failure -*/ int dp_delba_process_wifi3(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac, uint16_t vdev_id, int tid, uint16_t reasoncode) { @@ -4841,17 +4504,6 @@ fail: return status; } -/* - * dp_rx_delba_tx_completion_wifi3() – Send Delba Request - * - * @soc: Datapath soc handle - * @peer_mac: Datapath peer mac address - * @vdev_id: id of atapath vdev - * @tid: TID number - * @status: tx completion status - * Return: 0 on success, error code on failure - */ - int dp_delba_tx_completion_wifi3(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac, uint16_t vdev_id, uint8_t tid, int status) @@ -4910,18 +4562,6 @@ end: return ret; } -/** - * dp_set_pn_check_wifi3() - enable PN check in REO for security - * @soc: Datapath soc handle - * @peer_mac: Datapath peer mac address - * @vdev_id: id of atapath vdev - * @vdev: Datapath vdev - * @pdev - data path device instance - * @sec_type - security type - * @rx_pn - Receive pn starting number - * - */ - QDF_STATUS dp_set_pn_check_wifi3(struct cdp_soc_t *soc_t, uint8_t vdev_id, uint8_t *peer_mac, enum cdp_sec_type sec_type, @@ -5034,19 +4674,6 @@ dp_set_pn_check_wifi3(struct cdp_soc_t *soc_t, uint8_t vdev_id, return QDF_STATUS_SUCCESS; } - -/** - * dp_set_key_sec_type_wifi3() - set security mode of key - * @soc: Datapath soc handle - * @peer_mac: Datapath peer mac address - * @vdev_id: id of atapath vdev - * @vdev: Datapath vdev - * @pdev - data path device instance - * @sec_type - security type - * #is_unicast - key type - * - */ - QDF_STATUS dp_set_key_sec_type_wifi3(struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *peer_mac, enum cdp_sec_type sec_type, @@ -5153,17 +4780,6 @@ dp_rx_sec_ind_handler(struct dp_soc *soc, uint16_t peer_id, } #ifdef QCA_PEER_EXT_STATS -/* - * dp_peer_delay_stats_ctx_alloc() - Allocate peer delay - * stats content - * @soc: DP SoC context - * @txrx_peer: DP txrx peer context - * - * Allocate the peer delay stats context - * - * Return: QDF_STATUS_SUCCESS if allocation is - * successful - */ QDF_STATUS dp_peer_delay_stats_ctx_alloc(struct dp_soc *soc, struct dp_txrx_peer *txrx_peer) { @@ -5206,14 +4822,6 @@ QDF_STATUS dp_peer_delay_stats_ctx_alloc(struct dp_soc *soc, return QDF_STATUS_SUCCESS; } -/* - * dp_peer_delay_stats_ctx_dealloc() - Dealloc the peer delay stats context - * @txrx_peer: txrx DP peer context - * - * Free the peer delay stats context - * - * Return: Void - */ void dp_peer_delay_stats_ctx_dealloc(struct dp_soc *soc, struct dp_txrx_peer *txrx_peer) { @@ -5232,13 +4840,6 @@ void dp_peer_delay_stats_ctx_dealloc(struct dp_soc *soc, txrx_peer->delay_stats = NULL; } -/** - * dp_peer_delay_stats_ctx_clr() - Clear delay stats context of peer - * - * @txrx_peer: dp_txrx_peer handle - * - * Return: void - */ void dp_peer_delay_stats_ctx_clr(struct dp_txrx_peer *txrx_peer) { if (txrx_peer->delay_stats) @@ -5248,14 +4849,6 @@ void dp_peer_delay_stats_ctx_clr(struct dp_txrx_peer *txrx_peer) #endif #ifdef WLAN_PEER_JITTER -/** - * dp_peer_jitter_stats_ctx_alloc() - Allocate jitter stats context for peer - * - * @soc: Datapath pdev handle - * @txrx_peer: dp_txrx_peer handle - * - * Return: QDF_STATUS - */ QDF_STATUS dp_peer_jitter_stats_ctx_alloc(struct dp_pdev *pdev, struct dp_txrx_peer *txrx_peer) { @@ -5291,14 +4884,6 @@ QDF_STATUS dp_peer_jitter_stats_ctx_alloc(struct dp_pdev *pdev, return QDF_STATUS_SUCCESS; } -/** - * dp_peer_jitter_stats_ctx_dealloc() - Deallocate jitter stats context - * - * @pdev: Datapath pdev handle - * @txrx_peer: dp_txrx_peer handle - * - * Return: void - */ void dp_peer_jitter_stats_ctx_dealloc(struct dp_pdev *pdev, struct dp_txrx_peer *txrx_peer) { @@ -5316,13 +4901,6 @@ void dp_peer_jitter_stats_ctx_dealloc(struct dp_pdev *pdev, } } -/** - * dp_peer_jitter_stats_ctx_clr() - Clear jitter stats context of peer - * - * @txrx_peer: dp_txrx_peer handle - * - * Return: void - */ void dp_peer_jitter_stats_ctx_clr(struct dp_txrx_peer *txrx_peer) { struct cdp_peer_tid_stats *jitter_stats = NULL; @@ -5645,15 +5223,6 @@ dp_get_vdev_by_peer_addr(struct cdp_pdev *pdev_handle, return vdev; } -/** - * dp_get_vdev_for_peer() - Get virtual interface instance which peer belongs - * @peer - peer instance - * - * Get virtual interface instance which peer belongs - * - * Return: virtual interface instance pointer - * NULL in case cannot find - */ struct cdp_vdev *dp_get_vdev_for_peer(void *peer_handle) { struct dp_peer *peer = peer_handle; @@ -5662,15 +5231,6 @@ struct cdp_vdev *dp_get_vdev_for_peer(void *peer_handle) return (struct cdp_vdev *)peer->vdev; } -/** - * dp_peer_get_peer_mac_addr() - Get peer mac address - * @peer - peer instance - * - * Get peer mac address - * - * Return: peer mac address pointer - * NULL in case cannot find - */ uint8_t *dp_peer_get_peer_mac_addr(void *peer_handle) { struct dp_peer *peer = peer_handle; @@ -5709,14 +5269,6 @@ int dp_get_peer_state(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, return peer_state; } -/** - * dp_local_peer_id_pool_init() - local peer id pool alloc for physical device - * @pdev - data path device instance - * - * local peer id pool alloc for physical device - * - * Return: none - */ void dp_local_peer_id_pool_init(struct dp_pdev *pdev) { int i; @@ -5738,15 +5290,6 @@ void dp_local_peer_id_pool_init(struct dp_pdev *pdev) DP_TRACE(INFO, "Peer pool init"); } -/** - * dp_local_peer_id_alloc() - allocate local peer id - * @pdev - data path device instance - * @peer - new peer instance - * - * allocate local peer id - * - * Return: none - */ void dp_local_peer_id_alloc(struct dp_pdev *pdev, struct dp_peer *peer) { int i; @@ -5766,15 +5309,6 @@ void dp_local_peer_id_alloc(struct dp_pdev *pdev, struct dp_peer *peer) dp_info("peer %pK, local id %d", peer, peer->local_id); } -/** - * dp_local_peer_id_free() - remove local peer id - * @pdev - data path device instance - * @peer - peer instance should be removed - * - * remove local peer id - * - * Return: none - */ void dp_local_peer_id_free(struct dp_pdev *pdev, struct dp_peer *peer) { int i = peer->local_id; @@ -5928,14 +5462,6 @@ int dp_peer_get_rxtid_stats_ipa(struct dp_peer *peer, qdf_export_symbol(dp_peer_get_rxtid_stats_ipa); #endif -/** - * dp_peer_rxtid_stats: Retried Rx TID (REO queue) stats from HW - * @peer: DP peer handle - * @dp_stats_cmd_cb: REO command callback function - * @cb_ctxt: Callback context - * - * Return: count of tid stats cmd send succeeded - */ int dp_peer_rxtid_stats(struct dp_peer *peer, dp_rxtid_stats_cmd_cb dp_stats_cmd_cb, void *cb_ctxt) @@ -6023,14 +5549,6 @@ dp_set_michael_key(struct cdp_soc_t *soc, } -/** - * dp_vdev_bss_peer_ref_n_get: Get bss peer of a vdev - * @soc: DP soc - * @vdev: vdev - * @mod_id: id of module requesting reference - * - * Return: VDEV BSS peer - */ struct dp_peer *dp_vdev_bss_peer_ref_n_get(struct dp_soc *soc, struct dp_vdev *vdev, enum dp_mod_id mod_id) @@ -6057,14 +5575,6 @@ struct dp_peer *dp_vdev_bss_peer_ref_n_get(struct dp_soc *soc, return peer; } -/** - * dp_sta_vdev_self_peer_ref_n_get: Get self peer of sta vdev - * @soc: DP soc - * @vdev: vdev - * @mod_id: id of module requesting reference - * - * Return: VDEV self peer - */ struct dp_peer *dp_sta_vdev_self_peer_ref_n_get(struct dp_soc *soc, struct dp_vdev *vdev, enum dp_mod_id mod_id) @@ -6221,13 +5731,6 @@ fail: dp_peer_unref_delete(peer, DP_MOD_ID_CDP); } -/* - * dp_peer_find_by_id_valid - check if peer exists for given id - * @soc: core DP soc context - * @peer_id: peer id from peer object can be retrieved - * - * Return: true if peer exists of false otherwise - */ bool dp_peer_find_by_id_valid(struct dp_soc *soc, uint16_t peer_id) { struct dp_peer *peer = dp_peer_get_ref_by_id(soc, peer_id, diff --git a/dp/wifi3.0/dp_peer.h b/dp/wifi3.0/dp_peer.h index e65b2dbdea..6b88875fd5 100644 --- a/dp/wifi3.0/dp_peer.h +++ b/dp/wifi3.0/dp_peer.h @@ -69,13 +69,47 @@ struct ast_del_ctxt { typedef void dp_peer_iter_func(struct dp_soc *soc, struct dp_peer *peer, void *arg); +/** + * dp_peer_unref_delete() - unref and delete peer + * @peer: Datapath peer handle + * @id: ID of module releasing reference + * + */ void dp_peer_unref_delete(struct dp_peer *peer, enum dp_mod_id id); + +/** + * dp_txrx_peer_unref_delete() - unref and delete peer + * @handle: Datapath txrx ref handle + * @id: Module ID of the caller + * + */ void dp_txrx_peer_unref_delete(dp_txrx_ref_handle handle, enum dp_mod_id id); + +/** + * dp_peer_find_hash_find() - returns legacy or mlo link peer from + * peer_hash_table matching vdev_id and mac_address + * @soc: soc handle + * @peer_mac_addr: peer mac address + * @mac_addr_is_aligned: is mac addr aligned + * @vdev_id: vdev_id + * @mod_id: id of module requesting reference + * + * return: peer in success + * NULL in failure + */ struct dp_peer *dp_peer_find_hash_find(struct dp_soc *soc, uint8_t *peer_mac_addr, int mac_addr_is_aligned, uint8_t vdev_id, - enum dp_mod_id id); + enum dp_mod_id mod_id); + +/** + * dp_peer_find_by_id_valid - check if peer exists for given id + * @soc: core DP soc context + * @peer_id: peer id from peer object can be retrieved + * + * Return: true if peer exists of false otherwise + */ bool dp_peer_find_by_id_valid(struct dp_soc *soc, uint16_t peer_id); #ifdef DP_UMAC_HW_RESET_SUPPORT @@ -84,9 +118,9 @@ void dp_reset_tid_q_setup(struct dp_soc *soc); /** * dp_peer_get_ref() - Returns peer object given the peer id * - * @soc : core DP soc context - * @peer : DP peer - * @mod_id : id of module requesting the reference + * @soc: core DP soc context + * @peer: DP peer + * @mod_id: id of module requesting the reference * * Return: QDF_STATUS_SUCCESS if reference held successfully * else QDF_STATUS_E_INVAL @@ -108,9 +142,9 @@ QDF_STATUS dp_peer_get_ref(struct dp_soc *soc, /** * __dp_peer_get_ref_by_id() - Returns peer object given the peer id * - * @soc : core DP soc context - * @peer_id : peer id from peer object can be retrieved - * @mod_id : module id + * @soc: core DP soc context + * @peer_id: peer id from peer object can be retrieved + * @mod_id: module id * * Return: struct dp_peer*: Pointer to DP peer object */ @@ -139,9 +173,9 @@ __dp_peer_get_ref_by_id(struct dp_soc *soc, * dp_peer_get_ref_by_id() - Returns peer object given the peer id * if peer state is active * - * @soc : core DP soc context - * @peer_id : peer id from peer object can be retrieved - * @mod_id : ID of module requesting reference + * @soc: core DP soc context + * @peer_id: peer id from peer object can be retrieved + * @mod_id: ID of module requesting reference * * Return: struct dp_peer*: Pointer to DP peer object */ @@ -170,10 +204,10 @@ struct dp_peer *dp_peer_get_ref_by_id(struct dp_soc *soc, /** * dp_txrx_peer_get_ref_by_id() - Returns txrx peer object given the peer id * - * @soc : core DP soc context - * @peer_id : peer id from peer object can be retrieved - * @handle : reference handle - * @mod_id : ID of module requesting reference + * @soc: core DP soc context + * @peer_id: peer id from peer object can be retrieved + * @handle: reference handle + * @mod_id: ID of module requesting reference * * Return: struct dp_txrx_peer*: Pointer to txrx DP peer object */ @@ -227,10 +261,10 @@ dp_clear_peer_internal(struct dp_soc *soc, struct dp_peer *peer) /** * dp_vdev_iterate_peer() - API to iterate through vdev peer list * - * @vdev : DP vdev context - * @func : function to be called for each peer - * @arg : argument need to be passed to func - * @mod_id : module_id + * @vdev: DP vdev context + * @func: function to be called for each peer + * @arg: argument need to be passed to func + * @mod_id: module_id * * Return: void */ @@ -263,10 +297,10 @@ dp_vdev_iterate_peer(struct dp_vdev *vdev, dp_peer_iter_func *func, void *arg, /** * dp_pdev_iterate_peer() - API to iterate through all peers of pdev * - * @pdev : DP pdev context - * @func : function to be called for each peer - * @arg : argument need to be passed to func - * @mod_id : module_id + * @pdev: DP pdev context + * @func: function to be called for each peer + * @arg: argument need to be passed to func + * @mod_id: module_id * * Return: void */ @@ -288,10 +322,10 @@ dp_pdev_iterate_peer(struct dp_pdev *pdev, dp_peer_iter_func *func, void *arg, /** * dp_soc_iterate_peer() - API to iterate through all peers of soc * - * @soc : DP soc context - * @func : function to be called for each peer - * @arg : argument need to be passed to func - * @mod_id : module_id + * @soc: DP soc context + * @func: function to be called for each peer + * @arg: argument need to be passed to func + * @mod_id: module_id * * Return: void */ @@ -320,10 +354,10 @@ dp_soc_iterate_peer(struct dp_soc *soc, dp_peer_iter_func *func, void *arg, * As this API is allocating new memory it is suggested to use this * only when lock cannot be held * - * @vdev : DP vdev context - * @func : function to be called for each peer - * @arg : argument need to be passed to func - * @mod_id : module_id + * @vdev: DP vdev context + * @func: function to be called for each peer + * @arg: argument need to be passed to func + * @mod_id: module_id * * Return: void */ @@ -387,10 +421,10 @@ dp_vdev_iterate_peer_lock_safe(struct dp_vdev *vdev, * As this API is allocating new memory it is suggested to use this * only when lock cannot be held * - * @pdev : DP pdev context - * @func : function to be called for each peer - * @arg : argument need to be passed to func - * @mod_id : module_id + * @pdev: DP pdev context + * @func: function to be called for each peer + * @arg: argument need to be passed to func + * @mod_id: module_id * * Return: void */ @@ -468,10 +502,10 @@ dp_pdev_iterate_peer_lock_safe(struct dp_pdev *pdev, * As this API is allocating new memory it is suggested to use this * only when lock cannot be held * - * @soc : DP soc context - * @func : function to be called for each peer - * @arg : argument need to be passed to func - * @mod_id : module_id + * @soc: DP soc context + * @func: function to be called for each peer + * @arg: argument need to be passed to func + * @mod_id: module_id * * Return: void */ @@ -520,8 +554,8 @@ dp_soc_iterate_peer_lock_safe(struct dp_soc *soc, /** * dp_peer_state_cmp() - compare dp peer state * - * @peer : DP peer - * @state : state + * @peer: DP peer + * @state: state * * Return: true if state matches with peer state * false if it does not match @@ -539,11 +573,46 @@ dp_peer_state_cmp(struct dp_peer *peer, return is_status_equal; } +/** + * dp_print_ast_stats() - Dump AST table contents + * @soc: Datapath soc handle + * + * Return: void + */ void dp_print_ast_stats(struct dp_soc *soc); + +/** + * dp_rx_peer_map_handler() - handle peer map event from firmware + * @soc: generic soc handle + * @peer_id: peer_id from firmware + * @hw_peer_id: ast index for this peer + * @vdev_id: vdev ID + * @peer_mac_addr: mac address of the peer + * @ast_hash: ast hash value + * @is_wds: flag to indicate peer map event for WDS ast entry + * + * associate the peer_id that firmware provided with peer entry + * and update the ast table in the host with the hw_peer_id. + * + * Return: QDF_STATUS code + */ + QDF_STATUS dp_rx_peer_map_handler(struct dp_soc *soc, uint16_t peer_id, uint16_t hw_peer_id, uint8_t vdev_id, uint8_t *peer_mac_addr, uint16_t ast_hash, uint8_t is_wds); + +/** + * dp_rx_peer_unmap_handler() - handle peer unmap event from firmware + * @soc: generic soc handle + * @peer_id: peer_id from firmware + * @vdev_id: vdev ID + * @peer_mac_addr: mac address of the peer or wds entry + * @is_wds: flag to indicate peer map event for WDS ast entry + * @free_wds_count: number of wds entries freed by FW with peer delete + * + * Return: none + */ void dp_rx_peer_unmap_handler(struct dp_soc *soc, uint16_t peer_id, uint8_t vdev_id, uint8_t *peer_mac_addr, uint8_t is_wds, uint32_t free_wds_count); @@ -551,9 +620,9 @@ void dp_rx_peer_unmap_handler(struct dp_soc *soc, uint16_t peer_id, #ifdef DP_RX_UDP_OVER_PEER_ROAM /** * dp_rx_reset_roaming_peer() - Reset the roamed peer in vdev - * @soc - dp soc pointer - * @vdev_id - vdev id - * @peer_mac_addr - mac address of the peer + * @soc: dp soc pointer + * @vdev_id: vdev id + * @peer_mac_addr: mac address of the peer * * This function resets the roamed peer auth status and mac address * after peer map indication of same peer is received from firmware. @@ -572,11 +641,11 @@ static inline void dp_rx_reset_roaming_peer(struct dp_soc *soc, uint8_t vdev_id, #ifdef WLAN_FEATURE_11BE_MLO /** * dp_rx_mlo_peer_map_handler() - handle MLO peer map event from firmware - * @soc_handle - generic soc handle - * @peer_id - ML peer_id from firmware - * @peer_mac_addr - mac address of the peer - * @mlo_ast_flow_info: MLO AST flow info - * @mlo_link_info - MLO link info + * @soc: generic soc handle + * @peer_id: ML peer_id from firmware + * @peer_mac_addr: mac address of the peer + * @mlo_flow_info: MLO AST flow info + * @mlo_link_info: MLO link info * * associate the ML peer_id that firmware provided with peer entry * and update the ast table in the host with the hw_peer_id. @@ -591,8 +660,8 @@ dp_rx_mlo_peer_map_handler(struct dp_soc *soc, uint16_t peer_id, /** * dp_rx_mlo_peer_unmap_handler() - handle MLO peer unmap event from firmware - * @soc_handle - generic soc handle - * @peeri_id - peer_id from firmware + * @soc: generic soc handle + * @peer_id: peer_id from firmware * * Return: none */ @@ -609,36 +678,134 @@ QDF_STATUS dp_rx_delba_ind_handler(void *soc_handle, uint16_t peer_id, uint8_t dp_get_peer_mac_addr_frm_id(struct cdp_soc_t *soc_handle, uint16_t peer_id, uint8_t *peer_mac); +/** + * dp_peer_add_ast() - Allocate and add AST entry into peer list + * @soc: SoC handle + * @peer: peer to which ast node belongs + * @mac_addr: MAC address of ast node + * @type: AST entry type + * @flags: AST configuration flags + * + * This API is used by WDS source port learning function to + * add a new AST entry into peer AST list + * + * Return: QDF_STATUS code + */ QDF_STATUS dp_peer_add_ast(struct dp_soc *soc, struct dp_peer *peer, uint8_t *mac_addr, enum cdp_txrx_ast_entry_type type, uint32_t flags); +/** + * dp_peer_del_ast() - Delete and free AST entry + * @soc: SoC handle + * @ast_entry: AST entry of the node + * + * This function removes the AST entry from peer and soc tables + * It assumes caller has taken the ast lock to protect the access to these + * tables + * + * Return: None + */ void dp_peer_del_ast(struct dp_soc *soc, struct dp_ast_entry *ast_entry); void dp_peer_ast_unmap_handler(struct dp_soc *soc, struct dp_ast_entry *ast_entry); +/** + * dp_peer_update_ast() - Delete and free AST entry + * @soc: SoC handle + * @peer: peer to which ast node belongs + * @ast_entry: AST entry of the node + * @flags: wds or hmwds + * + * This function update the AST entry to the roamed peer and soc tables + * It assumes caller has taken the ast lock to protect the access to these + * tables + * + * Return: 0 if ast entry is updated successfully + * -1 failure + */ int dp_peer_update_ast(struct dp_soc *soc, struct dp_peer *peer, struct dp_ast_entry *ast_entry, uint32_t flags); +/** + * dp_peer_ast_hash_find_by_pdevid() - Find AST entry by MAC address + * @soc: SoC handle + * @ast_mac_addr: Mac address + * @pdev_id: pdev Id + * + * 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_by_pdevid(struct dp_soc *soc, uint8_t *ast_mac_addr, uint8_t pdev_id); +/** + * dp_peer_ast_hash_find_by_vdevid() - Find AST entry by MAC address + * @soc: SoC handle + * @ast_mac_addr: Mac address + * @vdev_id: vdev Id + * + * 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_by_vdevid(struct dp_soc *soc, uint8_t *ast_mac_addr, uint8_t vdev_id); +/** + * dp_peer_ast_hash_find_soc() - Find AST entry by MAC address + * @soc: SoC handle + * @ast_mac_addr: Mac address + * + * 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(struct dp_soc *soc, uint8_t *ast_mac_addr); +/** + * dp_peer_ast_get_pdev_id() - get pdev_id from the ast entry + * @soc: SoC handle + * @ast_entry: AST entry of the node + * + * This function gets the pdev_id from the ast entry. + * + * Return: (uint8_t) pdev_id + */ uint8_t dp_peer_ast_get_pdev_id(struct dp_soc *soc, struct dp_ast_entry *ast_entry); +/** + * dp_peer_ast_get_next_hop() - get next_hop from the ast entry + * @soc: SoC handle + * @ast_entry: AST entry of the node + * + * This function gets the next hop from the ast entry. + * + * Return: (uint8_t) next_hop + */ uint8_t dp_peer_ast_get_next_hop(struct dp_soc *soc, struct dp_ast_entry *ast_entry); +/** + * dp_peer_ast_set_type() - set type from the ast entry + * @soc: SoC handle + * @ast_entry: AST entry of the node + * @type: AST entry type + * + * This function sets the type in the ast entry. + * + * Return: + */ void dp_peer_ast_set_type(struct dp_soc *soc, struct dp_ast_entry *ast_entry, enum cdp_txrx_ast_entry_type type); @@ -658,12 +825,43 @@ void dp_peer_free_hmwds_cb(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, void *cookie, enum cdp_ast_free_status status); +/** + * dp_peer_ast_hash_remove() - Look up and remove AST entry from hash table + * @soc: SoC handle + * @ase: Address search entry + * + * This function removes the AST entry from soc AST hash table + * It assumes caller has taken the ast lock to protect the access to this table + * + * Return: None + */ void dp_peer_ast_hash_remove(struct dp_soc *soc, struct dp_ast_entry *ase); +/** + * dp_peer_free_ast_entry() - Free up the ast entry memory + * @soc: SoC handle + * @ast_entry: Address search entry + * + * This API is used to free up the memory associated with + * AST entry. + * + * Return: None + */ void dp_peer_free_ast_entry(struct dp_soc *soc, struct dp_ast_entry *ast_entry); +/** + * dp_peer_unlink_ast_entry() - Free up the ast entry memory + * @soc: SoC handle + * @ast_entry: Address search entry + * @peer: peer + * + * This API is used to remove/unlink AST entry from the peer list + * and hash list. + * + * Return: None + */ void dp_peer_unlink_ast_entry(struct dp_soc *soc, struct dp_ast_entry *ast_entry, struct dp_peer *peer); @@ -708,9 +906,11 @@ QDF_STATUS dp_peer_mec_add_entry(struct dp_soc *soc, uint8_t *mac_addr); /** - * dp_peer_mec_hash_find_by_pdevid() - Find MEC entry by MAC address + * dp_peer_mec_hash_find_by_pdevid() - Find MEC entry by PDEV Id * within pdev * @soc: SoC handle + * @pdev_id: pdev Id + * @mec_mac_addr: MAC address of mec node * * It assumes caller has taken the mec_lock to protect the access to * MEC hash table @@ -730,26 +930,26 @@ struct dp_mec_entry *dp_peer_mec_hash_find_by_pdevid(struct dp_soc *soc, } while (0) /** - * dp_peer_update_inactive_time - Update inactive time for peer + * dp_peer_update_inactive_time() - Update inactive time for peer * @pdev: pdev object * @tag_type: htt_tlv_tag type - * #tag_buf: buf message + * @tag_buf: buf message */ void dp_peer_update_inactive_time(struct dp_pdev *pdev, uint32_t tag_type, uint32_t *tag_buf); #ifndef QCA_MULTIPASS_SUPPORT +static inline /** - * dp_peer_set_vlan_id: set vlan_id for this peer + * dp_peer_set_vlan_id() - set vlan_id for this peer * @cdp_soc: soc handle * @vdev_id: id of vdev object * @peer_mac: mac address * @vlan_id: vlan id for peer * - * return: void + * Return: void */ -static inline void dp_peer_set_vlan_id(struct cdp_soc_t *cdp_soc, uint8_t vdev_id, uint8_t *peer_mac, uint16_t vlan_id) @@ -757,26 +957,26 @@ void dp_peer_set_vlan_id(struct cdp_soc_t *cdp_soc, } /** - * dp_set_vlan_groupkey: set vlan map for vdev - * @soc: pointer to soc + * dp_set_vlan_groupkey() - set vlan map for vdev + * @soc_hdl: pointer to soc * @vdev_id: id of vdev handle * @vlan_id: vlan_id * @group_key: group key for vlan * - * return: set success/failure + * Return: set success/failure */ static inline -QDF_STATUS dp_set_vlan_groupkey(struct cdp_soc_t *soc, uint8_t vdev_id, +QDF_STATUS dp_set_vlan_groupkey(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, uint16_t vlan_id, uint16_t group_key) { return QDF_STATUS_SUCCESS; } /** - * dp_peer_multipass_list_init: initialize multipass peer list + * dp_peer_multipass_list_init() - initialize multipass peer list * @vdev: pointer to vdev * - * return: void + * Return: void */ static inline void dp_peer_multipass_list_init(struct dp_vdev *vdev) @@ -784,10 +984,10 @@ void dp_peer_multipass_list_init(struct dp_vdev *vdev) } /** - * dp_peer_multipass_list_remove: remove peer from special peer list + * dp_peer_multipass_list_remove() - remove peer from special peer list * @peer: peer handle * - * return: void + * Return: void */ static inline void dp_peer_multipass_list_remove(struct dp_peer *peer) @@ -807,7 +1007,7 @@ void dp_peer_multipass_list_remove(struct dp_peer *peer); #ifndef QCA_PEER_MULTIQ_SUPPORT /** * dp_peer_reset_flowq_map() - reset peer flowq map table - * @peer - dp peer handle + * @peer: dp peer handle * * Return: none */ @@ -818,11 +1018,11 @@ void dp_peer_reset_flowq_map(struct dp_peer *peer) /** * dp_peer_ast_index_flow_queue_map_create() - create ast index flow queue map - * @soc - generic soc handle - * @is_wds - flag to indicate if peer is wds - * @peer_id - peer_id from htt peer map message - * @peer_mac_addr - mac address of the peer - * @ast_info - ast flow override information from peer map + * @soc_hdl: generic soc handle + * @is_wds: flag to indicate if peer is wds + * @peer_id: peer_id from htt peer map message + * @peer_mac_addr: mac address of the peer + * @ast_info: ast flow override information from peer map * * Return: none */ @@ -834,12 +1034,13 @@ void dp_peer_ast_index_flow_queue_map_create(void *soc_hdl, } #else void dp_peer_reset_flowq_map(struct dp_peer *peer); + void dp_peer_ast_index_flow_queue_map_create(void *soc_hdl, bool is_wds, uint16_t peer_id, uint8_t *peer_mac_addr, struct dp_ast_flow_override_info *ast_info); #endif -/* +/** * dp_rx_tid_delete_cb() - Callback to flush reo descriptor HW cache * after deleting the entries (ie., setting valid=0) * @@ -852,10 +1053,37 @@ void dp_rx_tid_delete_cb(struct dp_soc *soc, union hal_reo_status *reo_status); #ifdef QCA_PEER_EXT_STATS +/** + * dp_peer_delay_stats_ctx_alloc() - Allocate peer delay stats content + * @soc: DP SoC context + * @txrx_peer: DP txrx peer context + * + * Allocate the peer delay stats context + * + * Return: QDF_STATUS_SUCCESS if allocation is + * successful + */ QDF_STATUS dp_peer_delay_stats_ctx_alloc(struct dp_soc *soc, struct dp_txrx_peer *txrx_peer); + +/** + * dp_peer_delay_stats_ctx_dealloc() - Dealloc the peer delay stats context + * @soc: DP SoC context + * @txrx_peer: txrx DP peer context + * + * Free the peer delay stats context + * + * Return: Void + */ void dp_peer_delay_stats_ctx_dealloc(struct dp_soc *soc, struct dp_txrx_peer *txrx_peer); + +/** + * dp_peer_delay_stats_ctx_clr() - Clear delay stats context of peer + * @txrx_peer: dp_txrx_peer handle + * + * Return: void + */ void dp_peer_delay_stats_ctx_clr(struct dp_txrx_peer *txrx_peer); #else static inline @@ -878,12 +1106,32 @@ void dp_peer_delay_stats_ctx_clr(struct dp_txrx_peer *txrx_peer) #endif #ifdef WLAN_PEER_JITTER +/** + * dp_peer_jitter_stats_ctx_alloc() - Allocate jitter stats context for peer + * @pdev: Datapath pdev handle + * @txrx_peer: dp_txrx_peer handle + * + * Return: QDF_STATUS + */ QDF_STATUS dp_peer_jitter_stats_ctx_alloc(struct dp_pdev *pdev, struct dp_txrx_peer *txrx_peer); +/** + * dp_peer_jitter_stats_ctx_dealloc() - Deallocate jitter stats context + * @pdev: Datapath pdev handle + * @txrx_peer: dp_txrx_peer handle + * + * Return: void + */ void dp_peer_jitter_stats_ctx_dealloc(struct dp_pdev *pdev, struct dp_txrx_peer *txrx_peer); +/** + * dp_peer_jitter_stats_ctx_clr() - Clear jitter stats context of peer + * @txrx_peer: dp_txrx_peer handle + * + * Return: void + */ void dp_peer_jitter_stats_ctx_clr(struct dp_txrx_peer *txrx_peer); #else static inline @@ -936,28 +1184,82 @@ QDF_STATUS dp_peer_sawf_stats_ctx_free(struct dp_soc *soc, } #endif +/** + * dp_vdev_bss_peer_ref_n_get: Get bss peer of a vdev + * @soc: DP soc + * @vdev: vdev + * @mod_id: id of module requesting reference + * + * Return: VDEV BSS peer + */ struct dp_peer *dp_vdev_bss_peer_ref_n_get(struct dp_soc *soc, struct dp_vdev *vdev, enum dp_mod_id mod_id); + +/** + * dp_sta_vdev_self_peer_ref_n_get: Get self peer of sta vdev + * @soc: DP soc + * @vdev: vdev + * @mod_id: id of module requesting reference + * + * Return: VDEV self peer + */ struct dp_peer *dp_sta_vdev_self_peer_ref_n_get(struct dp_soc *soc, struct dp_vdev *vdev, enum dp_mod_id mod_id); void dp_peer_ast_table_detach(struct dp_soc *soc); + +/** + * dp_peer_find_map_detach() - cleanup memory for peer_id_to_obj_map + * @soc: soc handle + * + * Return: none + */ void dp_peer_find_map_detach(struct dp_soc *soc); + void dp_soc_wds_detach(struct dp_soc *soc); QDF_STATUS dp_peer_ast_table_attach(struct dp_soc *soc); + +/** + * dp_peer_ast_hash_attach() - Allocate and initialize AST Hash Table + * @soc: SoC handle + * + * Return: QDF_STATUS + */ QDF_STATUS dp_peer_ast_hash_attach(struct dp_soc *soc); + +/** + * dp_peer_mec_hash_attach() - Allocate and initialize MEC Hash Table + * @soc: SoC handle + * + * Return: QDF_STATUS + */ QDF_STATUS dp_peer_mec_hash_attach(struct dp_soc *soc); + void dp_soc_wds_attach(struct dp_soc *soc); + +/** + * dp_peer_mec_hash_detach() - Free MEC Hash table + * @soc: SoC handle + * + * Return: None + */ void dp_peer_mec_hash_detach(struct dp_soc *soc); + +/** + * dp_peer_ast_hash_detach() - Free AST Hash table + * @soc: SoC handle + * + * Return: None + */ void dp_peer_ast_hash_detach(struct dp_soc *soc); #ifdef FEATURE_AST -/* +/** * dp_peer_delete_ast_entries(): Delete all AST entries for a peer - * @soc - datapath soc handle - * @peer - datapath peer handle + * @soc: datapath soc handle + * @peer: datapath peer handle * * Delete the AST entries belonging to a peer */ @@ -982,6 +1284,14 @@ static inline void dp_peer_delete_ast_entries(struct dp_soc *soc, dp_peer_del_ast(soc, ast_entry); } +/** + * dp_print_peer_ast_entries() - Dump AST entries of peer + * @soc: Datapath soc handle + * @peer: Datapath peer + * @arg: argument to iterate function + * + * Return: void + */ void dp_print_peer_ast_entries(struct dp_soc *soc, struct dp_peer *peer, void *arg); #else @@ -1037,7 +1347,7 @@ static inline void dp_peer_mec_flush_entries(struct dp_soc *soc) #ifdef DUMP_REO_QUEUE_INFO_IN_DDR /** * dp_send_cache_flush_for_rx_tid() - Send cache flush cmd to REO per tid - * @soc : dp_soc handle + * @soc: dp_soc handle * @peer: peer * * This function is used to send cache flush cmd to reo and @@ -1051,7 +1361,7 @@ void dp_send_cache_flush_for_rx_tid( /** * dp_get_rx_reo_queue_info() - Handler to get rx tid info - * @soc : cdp_soc_t handle + * @soc_hdl: cdp_soc_t handle * @vdev_id: vdev id * * Handler to get rx tid info from DDR after h/w cache is @@ -1064,8 +1374,8 @@ void dp_get_rx_reo_queue_info( /** * dp_dump_rx_reo_queue_info() - Callback function to dump reo queue stats - * @soc : dp_soc handle - * @cb_ctxt - callback context + * @soc: dp_soc handle + * @cb_ctxt: callback context * @reo_status: vdev id * * This is the callback function registered after sending the reo cmd @@ -1177,7 +1487,7 @@ dp_link_peer_hash_find_by_chip_id(struct dp_soc *soc, } #endif -/* +/** * dp_mld_peer_find_hash_find() - returns mld peer from mld peer_hash_table * matching mac_address * @soc: soc handle @@ -1186,7 +1496,7 @@ dp_link_peer_hash_find_by_chip_id(struct dp_soc *soc, * @vdev_id: vdev_id * @mod_id: id of module requesting reference * - * return: peer in sucsess + * Return: peer in sucsess * NULL in failure */ static inline @@ -1206,7 +1516,7 @@ struct dp_peer *dp_mld_peer_find_hash_find(struct dp_soc *soc, /** * dp_peer_hash_find_wrapper() - find link peer or mld per according to - peer_type + * peer_type * @soc: DP SOC handle * @peer_info: peer information for hash find * @mod_id: ID of module requesting reference @@ -1241,7 +1551,7 @@ struct dp_peer *dp_peer_hash_find_wrapper(struct dp_soc *soc, /** * dp_link_peer_add_mld_peer() - add mld peer pointer to link peer, - increase mld peer ref_cnt + * increase mld peer ref_cnt * @link_peer: link peer pointer * @mld_peer: mld peer pointer * @@ -1258,7 +1568,7 @@ void dp_link_peer_add_mld_peer(struct dp_peer *link_peer, /** * dp_link_peer_del_mld_peer() - delete mld peer pointer from link peer, - decrease mld peer ref_cnt + * decrease mld peer ref_cnt * @link_peer: link peer pointer * * Return: None @@ -1403,7 +1713,7 @@ uint8_t dp_mld_peer_del_link_peer(struct dp_peer *mld_peer, /** * dp_get_link_peers_ref_from_mld_peer() - get link peers pointer and - increase link peers ref_cnt + * increase link peers ref_cnt * @soc: dp_soc handle * @mld_peer: dp mld peer pointer * @mld_link_peers: structure that hold links peers pointer array and number @@ -1521,7 +1831,7 @@ uint16_t dp_get_link_peer_id_by_lmac_id(struct dp_soc *soc, uint16_t peer_id, /** * dp_peer_get_tgt_peer_hash_find() - get dp_peer handle * @soc: soc handle - * @peer_mac_addr: peer mac address + * @peer_mac: peer mac address * @mac_addr_is_aligned: is mac addr aligned * @vdev_id: vdev_id * @mod_id: id of module requesting reference @@ -1529,7 +1839,7 @@ uint16_t dp_get_link_peer_id_by_lmac_id(struct dp_soc *soc, uint16_t peer_id, * for MLO connection, get corresponding MLD peer, * otherwise get link peer for non-MLO case. * - * return: peer in success + * Return: peer in success * NULL in failure */ static inline @@ -1570,14 +1880,14 @@ struct dp_peer *dp_peer_get_tgt_peer_hash_find(struct dp_soc *soc, /** * dp_peer_get_tgt_peer_by_id() - Returns target peer object given the peer id - * @soc : core DP soc context - * @peer_id : peer id from peer object can be retrieved - * @mod_id : ID of module requesting reference + * @soc: core DP soc context + * @peer_id: peer id from peer object can be retrieved + * @mod_id: ID of module requesting reference * * for MLO connection, get corresponding MLD peer, * otherwise get link peer for non-MLO case. * - * return: peer in success + * Return: peer in success * NULL in failure */ static inline @@ -1637,8 +1947,9 @@ void dp_peer_mlo_delete(struct dp_peer *peer) /** * dp_peer_mlo_setup() - create MLD peer and MLO related initialization * @soc: Soc handle + * @peer: DP peer handle * @vdev_id: Vdev ID - * @peer_setup_info: peer setup information for MLO + * @setup_info: peer setup information for MLO */ QDF_STATUS dp_peer_mlo_setup( struct dp_soc *soc, @@ -1747,10 +2058,10 @@ bool dp_peer_is_primary_link_peer(struct dp_peer *peer) /** * dp_tgt_txrx_peer_get_ref_by_id() - Gets tgt txrx peer for given the peer id * - * @soc : core DP soc context - * @peer_id : peer id from peer object can be retrieved - * @handle : reference handle - * @mod_id : ID of module requesting reference + * @soc: core DP soc context + * @peer_id: peer id from peer object can be retrieved + * @handle: reference handle + * @mod_id: ID of module requesting reference * * Return: struct dp_txrx_peer*: Pointer to txrx DP peer object */ @@ -1781,7 +2092,7 @@ dp_tgt_txrx_peer_get_ref_by_id(struct dp_soc *soc, /** * dp_print_mlo_ast_stats_be() - Print AST stats for MLO peers * - * @soc : core DP soc context + * @soc: core DP soc context * * Return: void */ @@ -1912,10 +2223,10 @@ bool dp_peer_is_primary_link_peer(struct dp_peer *peer) /** * dp_tgt_txrx_peer_get_ref_by_id() - Gets tgt txrx peer for given the peer id * - * @soc : core DP soc context - * @peer_id : peer id from peer object can be retrieved - * @handle : reference handle - * @mod_id : ID of module requesting reference + * @soc: core DP soc context + * @peer_id: peer id from peer object can be retrieved + * @handle: reference handle + * @mod_id: ID of module requesting reference * * Return: struct dp_txrx_peer*: Pointer to txrx DP peer object */ @@ -2041,9 +2352,9 @@ void dp_peer_rx_bufq_resources_deinit(struct dp_txrx_peer *txrx_peer) /** * dp_peer_update_state() - update dp peer state * - * @soc : core DP soc context - * @peer : DP peer - * @state : new state + * @soc: core DP soc context + * @peer: DP peer + * @state: new state * * Return: None */