18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: BSD-3-Clause-Clear */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef ATH11K_DP_H 78c2ecf20Sopenharmony_ci#define ATH11K_DP_H 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#include "hal_rx.h" 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#define MAX_RXDMA_PER_PDEV 2 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_cistruct ath11k_base; 148c2ecf20Sopenharmony_cistruct ath11k_peer; 158c2ecf20Sopenharmony_cistruct ath11k_dp; 168c2ecf20Sopenharmony_cistruct ath11k_vif; 178c2ecf20Sopenharmony_cistruct hal_tcl_status_ring; 188c2ecf20Sopenharmony_cistruct ath11k_ext_irq_grp; 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_cistruct dp_rx_tid { 218c2ecf20Sopenharmony_ci u8 tid; 228c2ecf20Sopenharmony_ci u32 *vaddr; 238c2ecf20Sopenharmony_ci dma_addr_t paddr; 248c2ecf20Sopenharmony_ci u32 size; 258c2ecf20Sopenharmony_ci u32 ba_win_sz; 268c2ecf20Sopenharmony_ci bool active; 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci /* Info related to rx fragments */ 298c2ecf20Sopenharmony_ci u32 cur_sn; 308c2ecf20Sopenharmony_ci u16 last_frag_no; 318c2ecf20Sopenharmony_ci u16 rx_frag_bitmap; 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci struct sk_buff_head rx_frags; 348c2ecf20Sopenharmony_ci struct hal_reo_dest_ring *dst_ring_desc; 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci /* Timer info related to fragments */ 378c2ecf20Sopenharmony_ci struct timer_list frag_timer; 388c2ecf20Sopenharmony_ci struct ath11k_base *ab; 398c2ecf20Sopenharmony_ci}; 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci#define DP_REO_DESC_FREE_THRESHOLD 64 428c2ecf20Sopenharmony_ci#define DP_REO_DESC_FREE_TIMEOUT_MS 1000 438c2ecf20Sopenharmony_ci#define DP_MON_SERVICE_BUDGET 128 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_cistruct dp_reo_cache_flush_elem { 468c2ecf20Sopenharmony_ci struct list_head list; 478c2ecf20Sopenharmony_ci struct dp_rx_tid data; 488c2ecf20Sopenharmony_ci unsigned long ts; 498c2ecf20Sopenharmony_ci}; 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_cistruct dp_reo_cmd { 528c2ecf20Sopenharmony_ci struct list_head list; 538c2ecf20Sopenharmony_ci struct dp_rx_tid data; 548c2ecf20Sopenharmony_ci int cmd_num; 558c2ecf20Sopenharmony_ci void (*handler)(struct ath11k_dp *, void *, 568c2ecf20Sopenharmony_ci enum hal_reo_cmd_status status); 578c2ecf20Sopenharmony_ci}; 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_cistruct dp_srng { 608c2ecf20Sopenharmony_ci u32 *vaddr_unaligned; 618c2ecf20Sopenharmony_ci u32 *vaddr; 628c2ecf20Sopenharmony_ci dma_addr_t paddr_unaligned; 638c2ecf20Sopenharmony_ci dma_addr_t paddr; 648c2ecf20Sopenharmony_ci int size; 658c2ecf20Sopenharmony_ci u32 ring_id; 668c2ecf20Sopenharmony_ci}; 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_cistruct dp_rxdma_ring { 698c2ecf20Sopenharmony_ci struct dp_srng refill_buf_ring; 708c2ecf20Sopenharmony_ci struct idr bufs_idr; 718c2ecf20Sopenharmony_ci /* Protects bufs_idr */ 728c2ecf20Sopenharmony_ci spinlock_t idr_lock; 738c2ecf20Sopenharmony_ci int bufs_max; 748c2ecf20Sopenharmony_ci}; 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci#define ATH11K_TX_COMPL_NEXT(x) (((x) + 1) % DP_TX_COMP_RING_SIZE) 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_cistruct dp_tx_ring { 798c2ecf20Sopenharmony_ci u8 tcl_data_ring_id; 808c2ecf20Sopenharmony_ci struct dp_srng tcl_data_ring; 818c2ecf20Sopenharmony_ci struct dp_srng tcl_comp_ring; 828c2ecf20Sopenharmony_ci struct idr txbuf_idr; 838c2ecf20Sopenharmony_ci /* Protects txbuf_idr and num_pending */ 848c2ecf20Sopenharmony_ci spinlock_t tx_idr_lock; 858c2ecf20Sopenharmony_ci struct hal_wbm_release_ring *tx_status; 868c2ecf20Sopenharmony_ci int tx_status_head; 878c2ecf20Sopenharmony_ci int tx_status_tail; 888c2ecf20Sopenharmony_ci}; 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_cistruct ath11k_pdev_mon_stats { 918c2ecf20Sopenharmony_ci u32 status_ppdu_state; 928c2ecf20Sopenharmony_ci u32 status_ppdu_start; 938c2ecf20Sopenharmony_ci u32 status_ppdu_end; 948c2ecf20Sopenharmony_ci u32 status_ppdu_compl; 958c2ecf20Sopenharmony_ci u32 status_ppdu_start_mis; 968c2ecf20Sopenharmony_ci u32 status_ppdu_end_mis; 978c2ecf20Sopenharmony_ci u32 status_ppdu_done; 988c2ecf20Sopenharmony_ci u32 dest_ppdu_done; 998c2ecf20Sopenharmony_ci u32 dest_mpdu_done; 1008c2ecf20Sopenharmony_ci u32 dest_mpdu_drop; 1018c2ecf20Sopenharmony_ci u32 dup_mon_linkdesc_cnt; 1028c2ecf20Sopenharmony_ci u32 dup_mon_buf_cnt; 1038c2ecf20Sopenharmony_ci}; 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_cistruct dp_link_desc_bank { 1068c2ecf20Sopenharmony_ci void *vaddr_unaligned; 1078c2ecf20Sopenharmony_ci void *vaddr; 1088c2ecf20Sopenharmony_ci dma_addr_t paddr_unaligned; 1098c2ecf20Sopenharmony_ci dma_addr_t paddr; 1108c2ecf20Sopenharmony_ci u32 size; 1118c2ecf20Sopenharmony_ci}; 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_ci/* Size to enforce scatter idle list mode */ 1148c2ecf20Sopenharmony_ci#define DP_LINK_DESC_ALLOC_SIZE_THRESH 0x200000 1158c2ecf20Sopenharmony_ci#define DP_LINK_DESC_BANKS_MAX 8 1168c2ecf20Sopenharmony_ci 1178c2ecf20Sopenharmony_ci#define DP_RX_DESC_COOKIE_INDEX_MAX 0x3ffff 1188c2ecf20Sopenharmony_ci#define DP_RX_DESC_COOKIE_POOL_ID_MAX 0x1c0000 1198c2ecf20Sopenharmony_ci#define DP_RX_DESC_COOKIE_MAX \ 1208c2ecf20Sopenharmony_ci (DP_RX_DESC_COOKIE_INDEX_MAX | DP_RX_DESC_COOKIE_POOL_ID_MAX) 1218c2ecf20Sopenharmony_ci#define DP_NOT_PPDU_ID_WRAP_AROUND 20000 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_cienum ath11k_dp_ppdu_state { 1248c2ecf20Sopenharmony_ci DP_PPDU_STATUS_START, 1258c2ecf20Sopenharmony_ci DP_PPDU_STATUS_DONE, 1268c2ecf20Sopenharmony_ci}; 1278c2ecf20Sopenharmony_ci 1288c2ecf20Sopenharmony_cistruct ath11k_mon_data { 1298c2ecf20Sopenharmony_ci struct dp_link_desc_bank link_desc_banks[DP_LINK_DESC_BANKS_MAX]; 1308c2ecf20Sopenharmony_ci struct hal_rx_mon_ppdu_info mon_ppdu_info; 1318c2ecf20Sopenharmony_ci 1328c2ecf20Sopenharmony_ci u32 mon_ppdu_status; 1338c2ecf20Sopenharmony_ci u32 mon_last_buf_cookie; 1348c2ecf20Sopenharmony_ci u64 mon_last_linkdesc_paddr; 1358c2ecf20Sopenharmony_ci u16 chan_noise_floor; 1368c2ecf20Sopenharmony_ci 1378c2ecf20Sopenharmony_ci struct ath11k_pdev_mon_stats rx_mon_stats; 1388c2ecf20Sopenharmony_ci /* lock for monitor data */ 1398c2ecf20Sopenharmony_ci spinlock_t mon_lock; 1408c2ecf20Sopenharmony_ci struct sk_buff_head rx_status_q; 1418c2ecf20Sopenharmony_ci}; 1428c2ecf20Sopenharmony_ci 1438c2ecf20Sopenharmony_cistruct ath11k_pdev_dp { 1448c2ecf20Sopenharmony_ci u32 mac_id; 1458c2ecf20Sopenharmony_ci atomic_t num_tx_pending; 1468c2ecf20Sopenharmony_ci wait_queue_head_t tx_empty_waitq; 1478c2ecf20Sopenharmony_ci struct dp_rxdma_ring rx_refill_buf_ring; 1488c2ecf20Sopenharmony_ci struct dp_srng rx_mac_buf_ring[MAX_RXDMA_PER_PDEV]; 1498c2ecf20Sopenharmony_ci struct dp_srng rxdma_err_dst_ring[MAX_RXDMA_PER_PDEV]; 1508c2ecf20Sopenharmony_ci struct dp_srng rxdma_mon_dst_ring; 1518c2ecf20Sopenharmony_ci struct dp_srng rxdma_mon_desc_ring; 1528c2ecf20Sopenharmony_ci 1538c2ecf20Sopenharmony_ci struct dp_rxdma_ring rxdma_mon_buf_ring; 1548c2ecf20Sopenharmony_ci struct dp_rxdma_ring rx_mon_status_refill_ring[MAX_RXDMA_PER_PDEV]; 1558c2ecf20Sopenharmony_ci struct ieee80211_rx_status rx_status; 1568c2ecf20Sopenharmony_ci struct ath11k_mon_data mon_data; 1578c2ecf20Sopenharmony_ci}; 1588c2ecf20Sopenharmony_ci 1598c2ecf20Sopenharmony_ci#define DP_NUM_CLIENTS_MAX 64 1608c2ecf20Sopenharmony_ci#define DP_AVG_TIDS_PER_CLIENT 2 1618c2ecf20Sopenharmony_ci#define DP_NUM_TIDS_MAX (DP_NUM_CLIENTS_MAX * DP_AVG_TIDS_PER_CLIENT) 1628c2ecf20Sopenharmony_ci#define DP_AVG_MSDUS_PER_FLOW 128 1638c2ecf20Sopenharmony_ci#define DP_AVG_FLOWS_PER_TID 2 1648c2ecf20Sopenharmony_ci#define DP_AVG_MPDUS_PER_TID_MAX 128 1658c2ecf20Sopenharmony_ci#define DP_AVG_MSDUS_PER_MPDU 4 1668c2ecf20Sopenharmony_ci 1678c2ecf20Sopenharmony_ci#define DP_RX_HASH_ENABLE 1 /* Enable hash based Rx steering */ 1688c2ecf20Sopenharmony_ci 1698c2ecf20Sopenharmony_ci#define DP_BA_WIN_SZ_MAX 256 1708c2ecf20Sopenharmony_ci 1718c2ecf20Sopenharmony_ci#define DP_TCL_NUM_RING_MAX 3 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_ci#define DP_IDLE_SCATTER_BUFS_MAX 16 1748c2ecf20Sopenharmony_ci 1758c2ecf20Sopenharmony_ci#define DP_WBM_RELEASE_RING_SIZE 64 1768c2ecf20Sopenharmony_ci#define DP_TCL_DATA_RING_SIZE 512 1778c2ecf20Sopenharmony_ci#define DP_TX_COMP_RING_SIZE 32768 1788c2ecf20Sopenharmony_ci#define DP_TX_IDR_SIZE DP_TX_COMP_RING_SIZE 1798c2ecf20Sopenharmony_ci#define DP_TCL_CMD_RING_SIZE 32 1808c2ecf20Sopenharmony_ci#define DP_TCL_STATUS_RING_SIZE 32 1818c2ecf20Sopenharmony_ci#define DP_REO_DST_RING_MAX 4 1828c2ecf20Sopenharmony_ci#define DP_REO_DST_RING_SIZE 2048 1838c2ecf20Sopenharmony_ci#define DP_REO_REINJECT_RING_SIZE 32 1848c2ecf20Sopenharmony_ci#define DP_RX_RELEASE_RING_SIZE 1024 1858c2ecf20Sopenharmony_ci#define DP_REO_EXCEPTION_RING_SIZE 128 1868c2ecf20Sopenharmony_ci#define DP_REO_CMD_RING_SIZE 128 1878c2ecf20Sopenharmony_ci#define DP_REO_STATUS_RING_SIZE 2048 1888c2ecf20Sopenharmony_ci#define DP_RXDMA_BUF_RING_SIZE 4096 1898c2ecf20Sopenharmony_ci#define DP_RXDMA_REFILL_RING_SIZE 2048 1908c2ecf20Sopenharmony_ci#define DP_RXDMA_ERR_DST_RING_SIZE 1024 1918c2ecf20Sopenharmony_ci#define DP_RXDMA_MON_STATUS_RING_SIZE 1024 1928c2ecf20Sopenharmony_ci#define DP_RXDMA_MONITOR_BUF_RING_SIZE 4096 1938c2ecf20Sopenharmony_ci#define DP_RXDMA_MONITOR_DST_RING_SIZE 2048 1948c2ecf20Sopenharmony_ci#define DP_RXDMA_MONITOR_DESC_RING_SIZE 4096 1958c2ecf20Sopenharmony_ci 1968c2ecf20Sopenharmony_ci#define DP_RX_BUFFER_SIZE 2048 1978c2ecf20Sopenharmony_ci#define DP_RX_BUFFER_ALIGN_SIZE 128 1988c2ecf20Sopenharmony_ci 1998c2ecf20Sopenharmony_ci#define DP_RXDMA_BUF_COOKIE_BUF_ID GENMASK(17, 0) 2008c2ecf20Sopenharmony_ci#define DP_RXDMA_BUF_COOKIE_PDEV_ID GENMASK(20, 18) 2018c2ecf20Sopenharmony_ci 2028c2ecf20Sopenharmony_ci#define DP_HW2SW_MACID(mac_id) ((mac_id) ? ((mac_id) - 1) : 0) 2038c2ecf20Sopenharmony_ci#define DP_SW2HW_MACID(mac_id) ((mac_id) + 1) 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ci#define DP_TX_DESC_ID_MAC_ID GENMASK(1, 0) 2068c2ecf20Sopenharmony_ci#define DP_TX_DESC_ID_MSDU_ID GENMASK(18, 2) 2078c2ecf20Sopenharmony_ci#define DP_TX_DESC_ID_POOL_ID GENMASK(20, 19) 2088c2ecf20Sopenharmony_ci 2098c2ecf20Sopenharmony_ci#define ATH11K_SHADOW_DP_TIMER_INTERVAL 20 2108c2ecf20Sopenharmony_ci#define ATH11K_SHADOW_CTRL_TIMER_INTERVAL 10 2118c2ecf20Sopenharmony_ci 2128c2ecf20Sopenharmony_cistruct ath11k_hp_update_timer { 2138c2ecf20Sopenharmony_ci struct timer_list timer; 2148c2ecf20Sopenharmony_ci bool started; 2158c2ecf20Sopenharmony_ci bool init; 2168c2ecf20Sopenharmony_ci u32 tx_num; 2178c2ecf20Sopenharmony_ci u32 timer_tx_num; 2188c2ecf20Sopenharmony_ci u32 ring_id; 2198c2ecf20Sopenharmony_ci u32 interval; 2208c2ecf20Sopenharmony_ci struct ath11k_base *ab; 2218c2ecf20Sopenharmony_ci}; 2228c2ecf20Sopenharmony_ci 2238c2ecf20Sopenharmony_cistruct ath11k_dp { 2248c2ecf20Sopenharmony_ci struct ath11k_base *ab; 2258c2ecf20Sopenharmony_ci enum ath11k_htc_ep_id eid; 2268c2ecf20Sopenharmony_ci struct completion htt_tgt_version_received; 2278c2ecf20Sopenharmony_ci u8 htt_tgt_ver_major; 2288c2ecf20Sopenharmony_ci u8 htt_tgt_ver_minor; 2298c2ecf20Sopenharmony_ci struct dp_link_desc_bank link_desc_banks[DP_LINK_DESC_BANKS_MAX]; 2308c2ecf20Sopenharmony_ci struct dp_srng wbm_idle_ring; 2318c2ecf20Sopenharmony_ci struct dp_srng wbm_desc_rel_ring; 2328c2ecf20Sopenharmony_ci struct dp_srng tcl_cmd_ring; 2338c2ecf20Sopenharmony_ci struct dp_srng tcl_status_ring; 2348c2ecf20Sopenharmony_ci struct dp_srng reo_reinject_ring; 2358c2ecf20Sopenharmony_ci struct dp_srng rx_rel_ring; 2368c2ecf20Sopenharmony_ci struct dp_srng reo_except_ring; 2378c2ecf20Sopenharmony_ci struct dp_srng reo_cmd_ring; 2388c2ecf20Sopenharmony_ci struct dp_srng reo_status_ring; 2398c2ecf20Sopenharmony_ci struct dp_srng reo_dst_ring[DP_REO_DST_RING_MAX]; 2408c2ecf20Sopenharmony_ci struct dp_tx_ring tx_ring[DP_TCL_NUM_RING_MAX]; 2418c2ecf20Sopenharmony_ci struct hal_wbm_idle_scatter_list scatter_list[DP_IDLE_SCATTER_BUFS_MAX]; 2428c2ecf20Sopenharmony_ci struct list_head reo_cmd_list; 2438c2ecf20Sopenharmony_ci struct list_head reo_cmd_cache_flush_list; 2448c2ecf20Sopenharmony_ci u32 reo_cmd_cache_flush_count; 2458c2ecf20Sopenharmony_ci /** 2468c2ecf20Sopenharmony_ci * protects access to below fields, 2478c2ecf20Sopenharmony_ci * - reo_cmd_list 2488c2ecf20Sopenharmony_ci * - reo_cmd_cache_flush_list 2498c2ecf20Sopenharmony_ci * - reo_cmd_cache_flush_count 2508c2ecf20Sopenharmony_ci */ 2518c2ecf20Sopenharmony_ci spinlock_t reo_cmd_lock; 2528c2ecf20Sopenharmony_ci struct ath11k_hp_update_timer reo_cmd_timer; 2538c2ecf20Sopenharmony_ci struct ath11k_hp_update_timer tx_ring_timer[DP_TCL_NUM_RING_MAX]; 2548c2ecf20Sopenharmony_ci}; 2558c2ecf20Sopenharmony_ci 2568c2ecf20Sopenharmony_ci/* HTT definitions */ 2578c2ecf20Sopenharmony_ci 2588c2ecf20Sopenharmony_ci#define HTT_TCL_META_DATA_TYPE BIT(0) 2598c2ecf20Sopenharmony_ci#define HTT_TCL_META_DATA_VALID_HTT BIT(1) 2608c2ecf20Sopenharmony_ci 2618c2ecf20Sopenharmony_ci/* vdev meta data */ 2628c2ecf20Sopenharmony_ci#define HTT_TCL_META_DATA_VDEV_ID GENMASK(9, 2) 2638c2ecf20Sopenharmony_ci#define HTT_TCL_META_DATA_PDEV_ID GENMASK(11, 10) 2648c2ecf20Sopenharmony_ci#define HTT_TCL_META_DATA_HOST_INSPECTED BIT(12) 2658c2ecf20Sopenharmony_ci 2668c2ecf20Sopenharmony_ci/* peer meta data */ 2678c2ecf20Sopenharmony_ci#define HTT_TCL_META_DATA_PEER_ID GENMASK(15, 2) 2688c2ecf20Sopenharmony_ci 2698c2ecf20Sopenharmony_ci#define HTT_TX_WBM_COMP_STATUS_OFFSET 8 2708c2ecf20Sopenharmony_ci 2718c2ecf20Sopenharmony_ci/* HTT tx completion is overlayed in wbm_release_ring */ 2728c2ecf20Sopenharmony_ci#define HTT_TX_WBM_COMP_INFO0_STATUS GENMASK(12, 9) 2738c2ecf20Sopenharmony_ci#define HTT_TX_WBM_COMP_INFO0_REINJECT_REASON GENMASK(16, 13) 2748c2ecf20Sopenharmony_ci#define HTT_TX_WBM_COMP_INFO0_REINJECT_REASON GENMASK(16, 13) 2758c2ecf20Sopenharmony_ci 2768c2ecf20Sopenharmony_ci#define HTT_TX_WBM_COMP_INFO1_ACK_RSSI GENMASK(31, 24) 2778c2ecf20Sopenharmony_ci 2788c2ecf20Sopenharmony_cistruct htt_tx_wbm_completion { 2798c2ecf20Sopenharmony_ci u32 info0; 2808c2ecf20Sopenharmony_ci u32 info1; 2818c2ecf20Sopenharmony_ci u32 info2; 2828c2ecf20Sopenharmony_ci u32 info3; 2838c2ecf20Sopenharmony_ci} __packed; 2848c2ecf20Sopenharmony_ci 2858c2ecf20Sopenharmony_cienum htt_h2t_msg_type { 2868c2ecf20Sopenharmony_ci HTT_H2T_MSG_TYPE_VERSION_REQ = 0, 2878c2ecf20Sopenharmony_ci HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb, 2888c2ecf20Sopenharmony_ci HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc, 2898c2ecf20Sopenharmony_ci HTT_H2T_MSG_TYPE_EXT_STATS_CFG = 0x10, 2908c2ecf20Sopenharmony_ci HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11, 2918c2ecf20Sopenharmony_ci}; 2928c2ecf20Sopenharmony_ci 2938c2ecf20Sopenharmony_ci#define HTT_VER_REQ_INFO_MSG_ID GENMASK(7, 0) 2948c2ecf20Sopenharmony_ci 2958c2ecf20Sopenharmony_cistruct htt_ver_req_cmd { 2968c2ecf20Sopenharmony_ci u32 ver_reg_info; 2978c2ecf20Sopenharmony_ci} __packed; 2988c2ecf20Sopenharmony_ci 2998c2ecf20Sopenharmony_cienum htt_srng_ring_type { 3008c2ecf20Sopenharmony_ci HTT_HW_TO_SW_RING, 3018c2ecf20Sopenharmony_ci HTT_SW_TO_HW_RING, 3028c2ecf20Sopenharmony_ci HTT_SW_TO_SW_RING, 3038c2ecf20Sopenharmony_ci}; 3048c2ecf20Sopenharmony_ci 3058c2ecf20Sopenharmony_cienum htt_srng_ring_id { 3068c2ecf20Sopenharmony_ci HTT_RXDMA_HOST_BUF_RING, 3078c2ecf20Sopenharmony_ci HTT_RXDMA_MONITOR_STATUS_RING, 3088c2ecf20Sopenharmony_ci HTT_RXDMA_MONITOR_BUF_RING, 3098c2ecf20Sopenharmony_ci HTT_RXDMA_MONITOR_DESC_RING, 3108c2ecf20Sopenharmony_ci HTT_RXDMA_MONITOR_DEST_RING, 3118c2ecf20Sopenharmony_ci HTT_HOST1_TO_FW_RXBUF_RING, 3128c2ecf20Sopenharmony_ci HTT_HOST2_TO_FW_RXBUF_RING, 3138c2ecf20Sopenharmony_ci HTT_RXDMA_NON_MONITOR_DEST_RING, 3148c2ecf20Sopenharmony_ci}; 3158c2ecf20Sopenharmony_ci 3168c2ecf20Sopenharmony_ci/* host -> target HTT_SRING_SETUP message 3178c2ecf20Sopenharmony_ci * 3188c2ecf20Sopenharmony_ci * After target is booted up, Host can send SRING setup message for 3198c2ecf20Sopenharmony_ci * each host facing LMAC SRING. Target setups up HW registers based 3208c2ecf20Sopenharmony_ci * on setup message and confirms back to Host if response_required is set. 3218c2ecf20Sopenharmony_ci * Host should wait for confirmation message before sending new SRING 3228c2ecf20Sopenharmony_ci * setup message 3238c2ecf20Sopenharmony_ci * 3248c2ecf20Sopenharmony_ci * The message would appear as follows: 3258c2ecf20Sopenharmony_ci * 3268c2ecf20Sopenharmony_ci * |31 24|23 20|19|18 16|15|14 8|7 0| 3278c2ecf20Sopenharmony_ci * |--------------- +-----------------+----------------+------------------| 3288c2ecf20Sopenharmony_ci * | ring_type | ring_id | pdev_id | msg_type | 3298c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 3308c2ecf20Sopenharmony_ci * | ring_base_addr_lo | 3318c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 3328c2ecf20Sopenharmony_ci * | ring_base_addr_hi | 3338c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 3348c2ecf20Sopenharmony_ci * |ring_misc_cfg_flag|ring_entry_size| ring_size | 3358c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 3368c2ecf20Sopenharmony_ci * | ring_head_offset32_remote_addr_lo | 3378c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 3388c2ecf20Sopenharmony_ci * | ring_head_offset32_remote_addr_hi | 3398c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 3408c2ecf20Sopenharmony_ci * | ring_tail_offset32_remote_addr_lo | 3418c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 3428c2ecf20Sopenharmony_ci * | ring_tail_offset32_remote_addr_hi | 3438c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 3448c2ecf20Sopenharmony_ci * | ring_msi_addr_lo | 3458c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 3468c2ecf20Sopenharmony_ci * | ring_msi_addr_hi | 3478c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 3488c2ecf20Sopenharmony_ci * | ring_msi_data | 3498c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 3508c2ecf20Sopenharmony_ci * | intr_timer_th |IM| intr_batch_counter_th | 3518c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 3528c2ecf20Sopenharmony_ci * | reserved |RR|PTCF| intr_low_threshold | 3538c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 3548c2ecf20Sopenharmony_ci * Where 3558c2ecf20Sopenharmony_ci * IM = sw_intr_mode 3568c2ecf20Sopenharmony_ci * RR = response_required 3578c2ecf20Sopenharmony_ci * PTCF = prefetch_timer_cfg 3588c2ecf20Sopenharmony_ci * 3598c2ecf20Sopenharmony_ci * The message is interpreted as follows: 3608c2ecf20Sopenharmony_ci * dword0 - b'0:7 - msg_type: This will be set to 3618c2ecf20Sopenharmony_ci * HTT_H2T_MSG_TYPE_SRING_SETUP 3628c2ecf20Sopenharmony_ci * b'8:15 - pdev_id: 3638c2ecf20Sopenharmony_ci * 0 (for rings at SOC/UMAC level), 3648c2ecf20Sopenharmony_ci * 1/2/3 mac id (for rings at LMAC level) 3658c2ecf20Sopenharmony_ci * b'16:23 - ring_id: identify which ring is to setup, 3668c2ecf20Sopenharmony_ci * more details can be got from enum htt_srng_ring_id 3678c2ecf20Sopenharmony_ci * b'24:31 - ring_type: identify type of host rings, 3688c2ecf20Sopenharmony_ci * more details can be got from enum htt_srng_ring_type 3698c2ecf20Sopenharmony_ci * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address 3708c2ecf20Sopenharmony_ci * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address 3718c2ecf20Sopenharmony_ci * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words 3728c2ecf20Sopenharmony_ci * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units 3738c2ecf20Sopenharmony_ci * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and 3748c2ecf20Sopenharmony_ci * SW_TO_HW_RING. 3758c2ecf20Sopenharmony_ci * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs. 3768c2ecf20Sopenharmony_ci * dword4 - b'0:31 - ring_head_off32_remote_addr_lo: 3778c2ecf20Sopenharmony_ci * Lower 32 bits of memory address of the remote variable 3788c2ecf20Sopenharmony_ci * storing the 4-byte word offset that identifies the head 3798c2ecf20Sopenharmony_ci * element within the ring. 3808c2ecf20Sopenharmony_ci * (The head offset variable has type u32.) 3818c2ecf20Sopenharmony_ci * Valid for HW_TO_SW and SW_TO_SW rings. 3828c2ecf20Sopenharmony_ci * dword5 - b'0:31 - ring_head_off32_remote_addr_hi: 3838c2ecf20Sopenharmony_ci * Upper 32 bits of memory address of the remote variable 3848c2ecf20Sopenharmony_ci * storing the 4-byte word offset that identifies the head 3858c2ecf20Sopenharmony_ci * element within the ring. 3868c2ecf20Sopenharmony_ci * (The head offset variable has type u32.) 3878c2ecf20Sopenharmony_ci * Valid for HW_TO_SW and SW_TO_SW rings. 3888c2ecf20Sopenharmony_ci * dword6 - b'0:31 - ring_tail_off32_remote_addr_lo: 3898c2ecf20Sopenharmony_ci * Lower 32 bits of memory address of the remote variable 3908c2ecf20Sopenharmony_ci * storing the 4-byte word offset that identifies the tail 3918c2ecf20Sopenharmony_ci * element within the ring. 3928c2ecf20Sopenharmony_ci * (The tail offset variable has type u32.) 3938c2ecf20Sopenharmony_ci * Valid for HW_TO_SW and SW_TO_SW rings. 3948c2ecf20Sopenharmony_ci * dword7 - b'0:31 - ring_tail_off32_remote_addr_hi: 3958c2ecf20Sopenharmony_ci * Upper 32 bits of memory address of the remote variable 3968c2ecf20Sopenharmony_ci * storing the 4-byte word offset that identifies the tail 3978c2ecf20Sopenharmony_ci * element within the ring. 3988c2ecf20Sopenharmony_ci * (The tail offset variable has type u32.) 3998c2ecf20Sopenharmony_ci * Valid for HW_TO_SW and SW_TO_SW rings. 4008c2ecf20Sopenharmony_ci * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address 4018c2ecf20Sopenharmony_ci * valid only for HW_TO_SW_RING and SW_TO_HW_RING 4028c2ecf20Sopenharmony_ci * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address 4038c2ecf20Sopenharmony_ci * valid only for HW_TO_SW_RING and SW_TO_HW_RING 4048c2ecf20Sopenharmony_ci * dword10 - b'0:31 - ring_msi_data: MSI data 4058c2ecf20Sopenharmony_ci * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs 4068c2ecf20Sopenharmony_ci * valid only for HW_TO_SW_RING and SW_TO_HW_RING 4078c2ecf20Sopenharmony_ci * dword11 - b'0:14 - intr_batch_counter_th: 4088c2ecf20Sopenharmony_ci * batch counter threshold is in units of 4-byte words. 4098c2ecf20Sopenharmony_ci * HW internally maintains and increments batch count. 4108c2ecf20Sopenharmony_ci * (see SRING spec for detail description). 4118c2ecf20Sopenharmony_ci * When batch count reaches threshold value, an interrupt 4128c2ecf20Sopenharmony_ci * is generated by HW. 4138c2ecf20Sopenharmony_ci * b'15 - sw_intr_mode: 4148c2ecf20Sopenharmony_ci * This configuration shall be static. 4158c2ecf20Sopenharmony_ci * Only programmed at power up. 4168c2ecf20Sopenharmony_ci * 0: generate pulse style sw interrupts 4178c2ecf20Sopenharmony_ci * 1: generate level style sw interrupts 4188c2ecf20Sopenharmony_ci * b'16:31 - intr_timer_th: 4198c2ecf20Sopenharmony_ci * The timer init value when timer is idle or is 4208c2ecf20Sopenharmony_ci * initialized to start downcounting. 4218c2ecf20Sopenharmony_ci * In 8us units (to cover a range of 0 to 524 ms) 4228c2ecf20Sopenharmony_ci * dword12 - b'0:15 - intr_low_threshold: 4238c2ecf20Sopenharmony_ci * Used only by Consumer ring to generate ring_sw_int_p. 4248c2ecf20Sopenharmony_ci * Ring entries low threshold water mark, that is used 4258c2ecf20Sopenharmony_ci * in combination with the interrupt timer as well as 4268c2ecf20Sopenharmony_ci * the the clearing of the level interrupt. 4278c2ecf20Sopenharmony_ci * b'16:18 - prefetch_timer_cfg: 4288c2ecf20Sopenharmony_ci * Used only by Consumer ring to set timer mode to 4298c2ecf20Sopenharmony_ci * support Application prefetch handling. 4308c2ecf20Sopenharmony_ci * The external tail offset/pointer will be updated 4318c2ecf20Sopenharmony_ci * at following intervals: 4328c2ecf20Sopenharmony_ci * 3'b000: (Prefetch feature disabled; used only for debug) 4338c2ecf20Sopenharmony_ci * 3'b001: 1 usec 4348c2ecf20Sopenharmony_ci * 3'b010: 4 usec 4358c2ecf20Sopenharmony_ci * 3'b011: 8 usec (default) 4368c2ecf20Sopenharmony_ci * 3'b100: 16 usec 4378c2ecf20Sopenharmony_ci * Others: Reserverd 4388c2ecf20Sopenharmony_ci * b'19 - response_required: 4398c2ecf20Sopenharmony_ci * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response 4408c2ecf20Sopenharmony_ci * b'20:31 - reserved: reserved for future use 4418c2ecf20Sopenharmony_ci */ 4428c2ecf20Sopenharmony_ci 4438c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INFO0_MSG_TYPE GENMASK(7, 0) 4448c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INFO0_PDEV_ID GENMASK(15, 8) 4458c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INFO0_RING_ID GENMASK(23, 16) 4468c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INFO0_RING_TYPE GENMASK(31, 24) 4478c2ecf20Sopenharmony_ci 4488c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INFO1_RING_SIZE GENMASK(15, 0) 4498c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INFO1_RING_ENTRY_SIZE GENMASK(23, 16) 4508c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INFO1_RING_LOOP_CNT_DIS BIT(25) 4518c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INFO1_RING_FLAGS_MSI_SWAP BIT(27) 4528c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INFO1_RING_FLAGS_HOST_FW_SWAP BIT(28) 4538c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INFO1_RING_FLAGS_TLV_SWAP BIT(29) 4548c2ecf20Sopenharmony_ci 4558c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INTR_INFO_BATCH_COUNTER_THRESH GENMASK(14, 0) 4568c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INTR_INFO_SW_INTR_MODE BIT(15) 4578c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INTR_INFO_INTR_TIMER_THRESH GENMASK(31, 16) 4588c2ecf20Sopenharmony_ci 4598c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INFO2_INTR_LOW_THRESH GENMASK(15, 0) 4608c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INFO2_PRE_FETCH_TIMER_CFG BIT(16) 4618c2ecf20Sopenharmony_ci#define HTT_SRNG_SETUP_CMD_INFO2_RESPONSE_REQUIRED BIT(19) 4628c2ecf20Sopenharmony_ci 4638c2ecf20Sopenharmony_cistruct htt_srng_setup_cmd { 4648c2ecf20Sopenharmony_ci u32 info0; 4658c2ecf20Sopenharmony_ci u32 ring_base_addr_lo; 4668c2ecf20Sopenharmony_ci u32 ring_base_addr_hi; 4678c2ecf20Sopenharmony_ci u32 info1; 4688c2ecf20Sopenharmony_ci u32 ring_head_off32_remote_addr_lo; 4698c2ecf20Sopenharmony_ci u32 ring_head_off32_remote_addr_hi; 4708c2ecf20Sopenharmony_ci u32 ring_tail_off32_remote_addr_lo; 4718c2ecf20Sopenharmony_ci u32 ring_tail_off32_remote_addr_hi; 4728c2ecf20Sopenharmony_ci u32 ring_msi_addr_lo; 4738c2ecf20Sopenharmony_ci u32 ring_msi_addr_hi; 4748c2ecf20Sopenharmony_ci u32 msi_data; 4758c2ecf20Sopenharmony_ci u32 intr_info; 4768c2ecf20Sopenharmony_ci u32 info2; 4778c2ecf20Sopenharmony_ci} __packed; 4788c2ecf20Sopenharmony_ci 4798c2ecf20Sopenharmony_ci/* host -> target FW PPDU_STATS config message 4808c2ecf20Sopenharmony_ci * 4818c2ecf20Sopenharmony_ci * @details 4828c2ecf20Sopenharmony_ci * The following field definitions describe the format of the HTT host 4838c2ecf20Sopenharmony_ci * to target FW for PPDU_STATS_CFG msg. 4848c2ecf20Sopenharmony_ci * The message allows the host to configure the PPDU_STATS_IND messages 4858c2ecf20Sopenharmony_ci * produced by the target. 4868c2ecf20Sopenharmony_ci * 4878c2ecf20Sopenharmony_ci * |31 24|23 16|15 8|7 0| 4888c2ecf20Sopenharmony_ci * |-----------------------------------------------------------| 4898c2ecf20Sopenharmony_ci * | REQ bit mask | pdev_mask | msg type | 4908c2ecf20Sopenharmony_ci * |-----------------------------------------------------------| 4918c2ecf20Sopenharmony_ci * Header fields: 4928c2ecf20Sopenharmony_ci * - MSG_TYPE 4938c2ecf20Sopenharmony_ci * Bits 7:0 4948c2ecf20Sopenharmony_ci * Purpose: identifies this is a req to configure ppdu_stats_ind from target 4958c2ecf20Sopenharmony_ci * Value: 0x11 4968c2ecf20Sopenharmony_ci * - PDEV_MASK 4978c2ecf20Sopenharmony_ci * Bits 8:15 4988c2ecf20Sopenharmony_ci * Purpose: identifies which pdevs this PPDU stats configuration applies to 4998c2ecf20Sopenharmony_ci * Value: This is a overloaded field, refer to usage and interpretation of 5008c2ecf20Sopenharmony_ci * PDEV in interface document. 5018c2ecf20Sopenharmony_ci * Bit 8 : Reserved for SOC stats 5028c2ecf20Sopenharmony_ci * Bit 9 - 15 : Indicates PDEV_MASK in DBDC 5038c2ecf20Sopenharmony_ci * Indicates MACID_MASK in DBS 5048c2ecf20Sopenharmony_ci * - REQ_TLV_BIT_MASK 5058c2ecf20Sopenharmony_ci * Bits 16:31 5068c2ecf20Sopenharmony_ci * Purpose: each set bit indicates the corresponding PPDU stats TLV type 5078c2ecf20Sopenharmony_ci * needs to be included in the target's PPDU_STATS_IND messages. 5088c2ecf20Sopenharmony_ci * Value: refer htt_ppdu_stats_tlv_tag_t <<<??? 5098c2ecf20Sopenharmony_ci * 5108c2ecf20Sopenharmony_ci */ 5118c2ecf20Sopenharmony_ci 5128c2ecf20Sopenharmony_cistruct htt_ppdu_stats_cfg_cmd { 5138c2ecf20Sopenharmony_ci u32 msg; 5148c2ecf20Sopenharmony_ci} __packed; 5158c2ecf20Sopenharmony_ci 5168c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_CFG_MSG_TYPE GENMASK(7, 0) 5178c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_CFG_SOC_STATS BIT(8) 5188c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_CFG_PDEV_ID GENMASK(15, 9) 5198c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_CFG_TLV_TYPE_BITMASK GENMASK(31, 16) 5208c2ecf20Sopenharmony_ci 5218c2ecf20Sopenharmony_cienum htt_ppdu_stats_tag_type { 5228c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_COMMON, 5238c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_USR_COMMON, 5248c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_USR_RATE, 5258c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_USR_MPDU_ENQ_BITMAP_64, 5268c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_USR_MPDU_ENQ_BITMAP_256, 5278c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_SCH_CMD_STATUS, 5288c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_USR_COMPLTN_COMMON, 5298c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_USR_COMPLTN_BA_BITMAP_64, 5308c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_USR_COMPLTN_BA_BITMAP_256, 5318c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_USR_COMPLTN_ACK_BA_STATUS, 5328c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_USR_COMPLTN_FLUSH, 5338c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_USR_COMMON_ARRAY, 5348c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_INFO, 5358c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_TX_MGMTCTRL_PAYLOAD, 5368c2ecf20Sopenharmony_ci 5378c2ecf20Sopenharmony_ci /* New TLV's are added above to this line */ 5388c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_MAX, 5398c2ecf20Sopenharmony_ci}; 5408c2ecf20Sopenharmony_ci 5418c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_TAG_DEFAULT (BIT(HTT_PPDU_STATS_TAG_COMMON) \ 5428c2ecf20Sopenharmony_ci | BIT(HTT_PPDU_STATS_TAG_USR_COMMON) \ 5438c2ecf20Sopenharmony_ci | BIT(HTT_PPDU_STATS_TAG_USR_RATE) \ 5448c2ecf20Sopenharmony_ci | BIT(HTT_PPDU_STATS_TAG_SCH_CMD_STATUS) \ 5458c2ecf20Sopenharmony_ci | BIT(HTT_PPDU_STATS_TAG_USR_COMPLTN_COMMON) \ 5468c2ecf20Sopenharmony_ci | BIT(HTT_PPDU_STATS_TAG_USR_COMPLTN_ACK_BA_STATUS) \ 5478c2ecf20Sopenharmony_ci | BIT(HTT_PPDU_STATS_TAG_USR_COMPLTN_FLUSH) \ 5488c2ecf20Sopenharmony_ci | BIT(HTT_PPDU_STATS_TAG_USR_COMMON_ARRAY)) 5498c2ecf20Sopenharmony_ci 5508c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_TAG_PKTLOG (BIT(HTT_PPDU_STATS_TAG_USR_MPDU_ENQ_BITMAP_64) | \ 5518c2ecf20Sopenharmony_ci BIT(HTT_PPDU_STATS_TAG_USR_MPDU_ENQ_BITMAP_256) | \ 5528c2ecf20Sopenharmony_ci BIT(HTT_PPDU_STATS_TAG_USR_COMPLTN_BA_BITMAP_64) | \ 5538c2ecf20Sopenharmony_ci BIT(HTT_PPDU_STATS_TAG_USR_COMPLTN_BA_BITMAP_256) | \ 5548c2ecf20Sopenharmony_ci BIT(HTT_PPDU_STATS_TAG_INFO) | \ 5558c2ecf20Sopenharmony_ci BIT(HTT_PPDU_STATS_TAG_TX_MGMTCTRL_PAYLOAD) | \ 5568c2ecf20Sopenharmony_ci HTT_PPDU_STATS_TAG_DEFAULT) 5578c2ecf20Sopenharmony_ci 5588c2ecf20Sopenharmony_ci/* HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message 5598c2ecf20Sopenharmony_ci * 5608c2ecf20Sopenharmony_ci * details: 5618c2ecf20Sopenharmony_ci * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to 5628c2ecf20Sopenharmony_ci * configure RXDMA rings. 5638c2ecf20Sopenharmony_ci * The configuration is per ring based and includes both packet subtypes 5648c2ecf20Sopenharmony_ci * and PPDU/MPDU TLVs. 5658c2ecf20Sopenharmony_ci * 5668c2ecf20Sopenharmony_ci * The message would appear as follows: 5678c2ecf20Sopenharmony_ci * 5688c2ecf20Sopenharmony_ci * |31 26|25|24|23 16|15 8|7 0| 5698c2ecf20Sopenharmony_ci * |-----------------+----------------+----------------+---------------| 5708c2ecf20Sopenharmony_ci * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type | 5718c2ecf20Sopenharmony_ci * |-------------------------------------------------------------------| 5728c2ecf20Sopenharmony_ci * | rsvd2 | ring_buffer_size | 5738c2ecf20Sopenharmony_ci * |-------------------------------------------------------------------| 5748c2ecf20Sopenharmony_ci * | packet_type_enable_flags_0 | 5758c2ecf20Sopenharmony_ci * |-------------------------------------------------------------------| 5768c2ecf20Sopenharmony_ci * | packet_type_enable_flags_1 | 5778c2ecf20Sopenharmony_ci * |-------------------------------------------------------------------| 5788c2ecf20Sopenharmony_ci * | packet_type_enable_flags_2 | 5798c2ecf20Sopenharmony_ci * |-------------------------------------------------------------------| 5808c2ecf20Sopenharmony_ci * | packet_type_enable_flags_3 | 5818c2ecf20Sopenharmony_ci * |-------------------------------------------------------------------| 5828c2ecf20Sopenharmony_ci * | tlv_filter_in_flags | 5838c2ecf20Sopenharmony_ci * |-------------------------------------------------------------------| 5848c2ecf20Sopenharmony_ci * Where: 5858c2ecf20Sopenharmony_ci * PS = pkt_swap 5868c2ecf20Sopenharmony_ci * SS = status_swap 5878c2ecf20Sopenharmony_ci * The message is interpreted as follows: 5888c2ecf20Sopenharmony_ci * dword0 - b'0:7 - msg_type: This will be set to 5898c2ecf20Sopenharmony_ci * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG 5908c2ecf20Sopenharmony_ci * b'8:15 - pdev_id: 5918c2ecf20Sopenharmony_ci * 0 (for rings at SOC/UMAC level), 5928c2ecf20Sopenharmony_ci * 1/2/3 mac id (for rings at LMAC level) 5938c2ecf20Sopenharmony_ci * b'16:23 - ring_id : Identify the ring to configure. 5948c2ecf20Sopenharmony_ci * More details can be got from enum htt_srng_ring_id 5958c2ecf20Sopenharmony_ci * b'24 - status_swap: 1 is to swap status TLV 5968c2ecf20Sopenharmony_ci * b'25 - pkt_swap: 1 is to swap packet TLV 5978c2ecf20Sopenharmony_ci * b'26:31 - rsvd1: reserved for future use 5988c2ecf20Sopenharmony_ci * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring, 5998c2ecf20Sopenharmony_ci * in byte units. 6008c2ecf20Sopenharmony_ci * Valid only for HW_TO_SW_RING and SW_TO_HW_RING 6018c2ecf20Sopenharmony_ci * - b'16:31 - rsvd2: Reserved for future use 6028c2ecf20Sopenharmony_ci * dword2 - b'0:31 - packet_type_enable_flags_0: 6038c2ecf20Sopenharmony_ci * Enable MGMT packet from 0b0000 to 0b1001 6048c2ecf20Sopenharmony_ci * bits from low to high: FP, MD, MO - 3 bits 6058c2ecf20Sopenharmony_ci * FP: Filter_Pass 6068c2ecf20Sopenharmony_ci * MD: Monitor_Direct 6078c2ecf20Sopenharmony_ci * MO: Monitor_Other 6088c2ecf20Sopenharmony_ci * 10 mgmt subtypes * 3 bits -> 30 bits 6098c2ecf20Sopenharmony_ci * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs 6108c2ecf20Sopenharmony_ci * dword3 - b'0:31 - packet_type_enable_flags_1: 6118c2ecf20Sopenharmony_ci * Enable MGMT packet from 0b1010 to 0b1111 6128c2ecf20Sopenharmony_ci * bits from low to high: FP, MD, MO - 3 bits 6138c2ecf20Sopenharmony_ci * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs 6148c2ecf20Sopenharmony_ci * dword4 - b'0:31 - packet_type_enable_flags_2: 6158c2ecf20Sopenharmony_ci * Enable CTRL packet from 0b0000 to 0b1001 6168c2ecf20Sopenharmony_ci * bits from low to high: FP, MD, MO - 3 bits 6178c2ecf20Sopenharmony_ci * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs 6188c2ecf20Sopenharmony_ci * dword5 - b'0:31 - packet_type_enable_flags_3: 6198c2ecf20Sopenharmony_ci * Enable CTRL packet from 0b1010 to 0b1111, 6208c2ecf20Sopenharmony_ci * MCAST_DATA, UCAST_DATA, NULL_DATA 6218c2ecf20Sopenharmony_ci * bits from low to high: FP, MD, MO - 3 bits 6228c2ecf20Sopenharmony_ci * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs 6238c2ecf20Sopenharmony_ci * dword6 - b'0:31 - tlv_filter_in_flags: 6248c2ecf20Sopenharmony_ci * Filter in Attention/MPDU/PPDU/Header/User tlvs 6258c2ecf20Sopenharmony_ci * Refer to CFG_TLV_FILTER_IN_FLAG defs 6268c2ecf20Sopenharmony_ci */ 6278c2ecf20Sopenharmony_ci 6288c2ecf20Sopenharmony_ci#define HTT_RX_RING_SELECTION_CFG_CMD_INFO0_MSG_TYPE GENMASK(7, 0) 6298c2ecf20Sopenharmony_ci#define HTT_RX_RING_SELECTION_CFG_CMD_INFO0_PDEV_ID GENMASK(15, 8) 6308c2ecf20Sopenharmony_ci#define HTT_RX_RING_SELECTION_CFG_CMD_INFO0_RING_ID GENMASK(23, 16) 6318c2ecf20Sopenharmony_ci#define HTT_RX_RING_SELECTION_CFG_CMD_INFO0_SS BIT(24) 6328c2ecf20Sopenharmony_ci#define HTT_RX_RING_SELECTION_CFG_CMD_INFO0_PS BIT(25) 6338c2ecf20Sopenharmony_ci 6348c2ecf20Sopenharmony_ci#define HTT_RX_RING_SELECTION_CFG_CMD_INFO1_BUF_SIZE GENMASK(15, 0) 6358c2ecf20Sopenharmony_ci 6368c2ecf20Sopenharmony_cienum htt_rx_filter_tlv_flags { 6378c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_MPDU_START = BIT(0), 6388c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_MSDU_START = BIT(1), 6398c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_RX_PACKET = BIT(2), 6408c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_MSDU_END = BIT(3), 6418c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_MPDU_END = BIT(4), 6428c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PACKET_HEADER = BIT(5), 6438c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PER_MSDU_HEADER = BIT(6), 6448c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_ATTENTION = BIT(7), 6458c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_START = BIT(8), 6468c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_END = BIT(9), 6478c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_END_USER_STATS = BIT(10), 6488c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_END_USER_STATS_EXT = BIT(11), 6498c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_END_STATUS_DONE = BIT(12), 6508c2ecf20Sopenharmony_ci}; 6518c2ecf20Sopenharmony_ci 6528c2ecf20Sopenharmony_cienum htt_rx_mgmt_pkt_filter_tlv_flags0 { 6538c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_ASSOC_REQ = BIT(0), 6548c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_ASSOC_REQ = BIT(1), 6558c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_ASSOC_REQ = BIT(2), 6568c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_ASSOC_RESP = BIT(3), 6578c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_ASSOC_RESP = BIT(4), 6588c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_ASSOC_RESP = BIT(5), 6598c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_REASSOC_REQ = BIT(6), 6608c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_REASSOC_REQ = BIT(7), 6618c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_REASSOC_REQ = BIT(8), 6628c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_REASSOC_RESP = BIT(9), 6638c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_REASSOC_RESP = BIT(10), 6648c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_REASSOC_RESP = BIT(11), 6658c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_REQ = BIT(12), 6668c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_REQ = BIT(13), 6678c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_REQ = BIT(14), 6688c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_RESP = BIT(15), 6698c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_RESP = BIT(16), 6708c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_RESP = BIT(17), 6718c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_TIMING_ADV = BIT(18), 6728c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_TIMING_ADV = BIT(19), 6738c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_TIMING_ADV = BIT(20), 6748c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_RESERVED_7 = BIT(21), 6758c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_RESERVED_7 = BIT(22), 6768c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_RESERVED_7 = BIT(23), 6778c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_BEACON = BIT(24), 6788c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_BEACON = BIT(25), 6798c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_BEACON = BIT(26), 6808c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_ATIM = BIT(27), 6818c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_ATIM = BIT(28), 6828c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_ATIM = BIT(29), 6838c2ecf20Sopenharmony_ci}; 6848c2ecf20Sopenharmony_ci 6858c2ecf20Sopenharmony_cienum htt_rx_mgmt_pkt_filter_tlv_flags1 { 6868c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS1_DISASSOC = BIT(0), 6878c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS1_DISASSOC = BIT(1), 6888c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS1_DISASSOC = BIT(2), 6898c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS1_AUTH = BIT(3), 6908c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS1_AUTH = BIT(4), 6918c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS1_AUTH = BIT(5), 6928c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS1_DEAUTH = BIT(6), 6938c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS1_DEAUTH = BIT(7), 6948c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS1_DEAUTH = BIT(8), 6958c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS1_ACTION = BIT(9), 6968c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS1_ACTION = BIT(10), 6978c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS1_ACTION = BIT(11), 6988c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS1_ACTION_NOACK = BIT(12), 6998c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS1_ACTION_NOACK = BIT(13), 7008c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS1_ACTION_NOACK = BIT(14), 7018c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS1_RESERVED_15 = BIT(15), 7028c2ecf20Sopenharmony_ci HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS1_RESERVED_15 = BIT(16), 7038c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS1_RESERVED_15 = BIT(17), 7048c2ecf20Sopenharmony_ci}; 7058c2ecf20Sopenharmony_ci 7068c2ecf20Sopenharmony_cienum htt_rx_ctrl_pkt_filter_tlv_flags2 { 7078c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_1 = BIT(0), 7088c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_1 = BIT(1), 7098c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_1 = BIT(2), 7108c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_2 = BIT(3), 7118c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_2 = BIT(4), 7128c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_2 = BIT(5), 7138c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_TRIGGER = BIT(6), 7148c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_TRIGGER = BIT(7), 7158c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_TRIGGER = BIT(8), 7168c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_4 = BIT(9), 7178c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_4 = BIT(10), 7188c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_4 = BIT(11), 7198c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_BF_REP_POLL = BIT(12), 7208c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_BF_REP_POLL = BIT(13), 7218c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_BF_REP_POLL = BIT(14), 7228c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_VHT_NDP = BIT(15), 7238c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_VHT_NDP = BIT(16), 7248c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_VHT_NDP = BIT(17), 7258c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_FRAME_EXT = BIT(18), 7268c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_FRAME_EXT = BIT(19), 7278c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_FRAME_EXT = BIT(20), 7288c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_WRAPPER = BIT(21), 7298c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_WRAPPER = BIT(22), 7308c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_WRAPPER = BIT(23), 7318c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_BAR = BIT(24), 7328c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS2_BAR = BIT(25), 7338c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_BAR = BIT(26), 7348c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_BA = BIT(27), 7358c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS2_BA = BIT(28), 7368c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_BA = BIT(29), 7378c2ecf20Sopenharmony_ci}; 7388c2ecf20Sopenharmony_ci 7398c2ecf20Sopenharmony_cienum htt_rx_ctrl_pkt_filter_tlv_flags3 { 7408c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS3_PSPOLL = BIT(0), 7418c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS3_PSPOLL = BIT(1), 7428c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS3_PSPOLL = BIT(2), 7438c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS3_RTS = BIT(3), 7448c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS3_RTS = BIT(4), 7458c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS3_RTS = BIT(5), 7468c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS3_CTS = BIT(6), 7478c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS3_CTS = BIT(7), 7488c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS3_CTS = BIT(8), 7498c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS3_ACK = BIT(9), 7508c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS3_ACK = BIT(10), 7518c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS3_ACK = BIT(11), 7528c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS3_CFEND = BIT(12), 7538c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS3_CFEND = BIT(13), 7548c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS3_CFEND = BIT(14), 7558c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS3_CFEND_ACK = BIT(15), 7568c2ecf20Sopenharmony_ci HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS3_CFEND_ACK = BIT(16), 7578c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS3_CFEND_ACK = BIT(17), 7588c2ecf20Sopenharmony_ci}; 7598c2ecf20Sopenharmony_ci 7608c2ecf20Sopenharmony_cienum htt_rx_data_pkt_filter_tlv_flasg3 { 7618c2ecf20Sopenharmony_ci HTT_RX_FP_DATA_PKT_FILTER_TLV_FLASG3_MCAST = BIT(18), 7628c2ecf20Sopenharmony_ci HTT_RX_MD_DATA_PKT_FILTER_TLV_FLASG3_MCAST = BIT(19), 7638c2ecf20Sopenharmony_ci HTT_RX_MO_DATA_PKT_FILTER_TLV_FLASG3_MCAST = BIT(20), 7648c2ecf20Sopenharmony_ci HTT_RX_FP_DATA_PKT_FILTER_TLV_FLASG3_UCAST = BIT(21), 7658c2ecf20Sopenharmony_ci HTT_RX_MD_DATA_PKT_FILTER_TLV_FLASG3_UCAST = BIT(22), 7668c2ecf20Sopenharmony_ci HTT_RX_MO_DATA_PKT_FILTER_TLV_FLASG3_UCAST = BIT(23), 7678c2ecf20Sopenharmony_ci HTT_RX_FP_DATA_PKT_FILTER_TLV_FLASG3_NULL_DATA = BIT(24), 7688c2ecf20Sopenharmony_ci HTT_RX_MD_DATA_PKT_FILTER_TLV_FLASG3_NULL_DATA = BIT(25), 7698c2ecf20Sopenharmony_ci HTT_RX_MO_DATA_PKT_FILTER_TLV_FLASG3_NULL_DATA = BIT(26), 7708c2ecf20Sopenharmony_ci}; 7718c2ecf20Sopenharmony_ci 7728c2ecf20Sopenharmony_ci#define HTT_RX_FP_MGMT_FILTER_FLAGS0 \ 7738c2ecf20Sopenharmony_ci (HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_ASSOC_REQ \ 7748c2ecf20Sopenharmony_ci | HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_ASSOC_RESP \ 7758c2ecf20Sopenharmony_ci | HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_REASSOC_REQ \ 7768c2ecf20Sopenharmony_ci | HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_REASSOC_RESP \ 7778c2ecf20Sopenharmony_ci | HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_REQ \ 7788c2ecf20Sopenharmony_ci | HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_RESP \ 7798c2ecf20Sopenharmony_ci | HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_TIMING_ADV \ 7808c2ecf20Sopenharmony_ci | HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_BEACON \ 7818c2ecf20Sopenharmony_ci | HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_ATIM) 7828c2ecf20Sopenharmony_ci 7838c2ecf20Sopenharmony_ci#define HTT_RX_MD_MGMT_FILTER_FLAGS0 \ 7848c2ecf20Sopenharmony_ci (HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_ASSOC_REQ \ 7858c2ecf20Sopenharmony_ci | HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_ASSOC_RESP \ 7868c2ecf20Sopenharmony_ci | HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_REASSOC_REQ \ 7878c2ecf20Sopenharmony_ci | HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_REASSOC_RESP \ 7888c2ecf20Sopenharmony_ci | HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_REQ \ 7898c2ecf20Sopenharmony_ci | HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_RESP \ 7908c2ecf20Sopenharmony_ci | HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_TIMING_ADV \ 7918c2ecf20Sopenharmony_ci | HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_BEACON \ 7928c2ecf20Sopenharmony_ci | HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS0_ATIM) 7938c2ecf20Sopenharmony_ci 7948c2ecf20Sopenharmony_ci#define HTT_RX_MO_MGMT_FILTER_FLAGS0 \ 7958c2ecf20Sopenharmony_ci (HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_ASSOC_REQ \ 7968c2ecf20Sopenharmony_ci | HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_ASSOC_RESP \ 7978c2ecf20Sopenharmony_ci | HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_REASSOC_REQ \ 7988c2ecf20Sopenharmony_ci | HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_REASSOC_RESP \ 7998c2ecf20Sopenharmony_ci | HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_REQ \ 8008c2ecf20Sopenharmony_ci | HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_RESP \ 8018c2ecf20Sopenharmony_ci | HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_PROBE_TIMING_ADV \ 8028c2ecf20Sopenharmony_ci | HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_BEACON \ 8038c2ecf20Sopenharmony_ci | HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_ATIM) 8048c2ecf20Sopenharmony_ci 8058c2ecf20Sopenharmony_ci#define HTT_RX_FP_MGMT_FILTER_FLAGS1 (HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS1_DISASSOC \ 8068c2ecf20Sopenharmony_ci | HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS1_AUTH \ 8078c2ecf20Sopenharmony_ci | HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS1_DEAUTH \ 8088c2ecf20Sopenharmony_ci | HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS1_ACTION \ 8098c2ecf20Sopenharmony_ci | HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS1_ACTION_NOACK) 8108c2ecf20Sopenharmony_ci 8118c2ecf20Sopenharmony_ci#define HTT_RX_MD_MGMT_FILTER_FLAGS1 (HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS1_DISASSOC \ 8128c2ecf20Sopenharmony_ci | HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS1_AUTH \ 8138c2ecf20Sopenharmony_ci | HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS1_DEAUTH \ 8148c2ecf20Sopenharmony_ci | HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS1_ACTION \ 8158c2ecf20Sopenharmony_ci | HTT_RX_MD_MGMT_PKT_FILTER_TLV_FLAGS1_ACTION_NOACK) 8168c2ecf20Sopenharmony_ci 8178c2ecf20Sopenharmony_ci#define HTT_RX_MO_MGMT_FILTER_FLAGS1 (HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS1_DISASSOC \ 8188c2ecf20Sopenharmony_ci | HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS1_AUTH \ 8198c2ecf20Sopenharmony_ci | HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS1_DEAUTH \ 8208c2ecf20Sopenharmony_ci | HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS1_ACTION \ 8218c2ecf20Sopenharmony_ci | HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS1_ACTION_NOACK) 8228c2ecf20Sopenharmony_ci 8238c2ecf20Sopenharmony_ci#define HTT_RX_FP_CTRL_FILTER_FLASG2 (HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_WRAPPER \ 8248c2ecf20Sopenharmony_ci | HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_BAR \ 8258c2ecf20Sopenharmony_ci | HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_BA) 8268c2ecf20Sopenharmony_ci 8278c2ecf20Sopenharmony_ci#define HTT_RX_MD_CTRL_FILTER_FLASG2 (HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_WRAPPER \ 8288c2ecf20Sopenharmony_ci | HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS2_BAR \ 8298c2ecf20Sopenharmony_ci | HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS2_BA) 8308c2ecf20Sopenharmony_ci 8318c2ecf20Sopenharmony_ci#define HTT_RX_MO_CTRL_FILTER_FLASG2 (HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_WRAPPER \ 8328c2ecf20Sopenharmony_ci | HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_BAR \ 8338c2ecf20Sopenharmony_ci | HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_BA) 8348c2ecf20Sopenharmony_ci 8358c2ecf20Sopenharmony_ci#define HTT_RX_FP_CTRL_FILTER_FLASG3 (HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS3_PSPOLL \ 8368c2ecf20Sopenharmony_ci | HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS3_RTS \ 8378c2ecf20Sopenharmony_ci | HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS3_CTS \ 8388c2ecf20Sopenharmony_ci | HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS3_ACK \ 8398c2ecf20Sopenharmony_ci | HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS3_CFEND \ 8408c2ecf20Sopenharmony_ci | HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS3_CFEND_ACK) 8418c2ecf20Sopenharmony_ci 8428c2ecf20Sopenharmony_ci#define HTT_RX_MD_CTRL_FILTER_FLASG3 (HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS3_PSPOLL \ 8438c2ecf20Sopenharmony_ci | HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS3_RTS \ 8448c2ecf20Sopenharmony_ci | HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS3_CTS \ 8458c2ecf20Sopenharmony_ci | HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS3_ACK \ 8468c2ecf20Sopenharmony_ci | HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS3_CFEND \ 8478c2ecf20Sopenharmony_ci | HTT_RX_MD_CTRL_PKT_FILTER_TLV_FLAGS3_CFEND_ACK) 8488c2ecf20Sopenharmony_ci 8498c2ecf20Sopenharmony_ci#define HTT_RX_MO_CTRL_FILTER_FLASG3 (HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS3_PSPOLL \ 8508c2ecf20Sopenharmony_ci | HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS3_RTS \ 8518c2ecf20Sopenharmony_ci | HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS3_CTS \ 8528c2ecf20Sopenharmony_ci | HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS3_ACK \ 8538c2ecf20Sopenharmony_ci | HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS3_CFEND \ 8548c2ecf20Sopenharmony_ci | HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS3_CFEND_ACK) 8558c2ecf20Sopenharmony_ci 8568c2ecf20Sopenharmony_ci#define HTT_RX_FP_DATA_FILTER_FLASG3 (HTT_RX_FP_DATA_PKT_FILTER_TLV_FLASG3_MCAST \ 8578c2ecf20Sopenharmony_ci | HTT_RX_FP_DATA_PKT_FILTER_TLV_FLASG3_UCAST \ 8588c2ecf20Sopenharmony_ci | HTT_RX_FP_DATA_PKT_FILTER_TLV_FLASG3_NULL_DATA) 8598c2ecf20Sopenharmony_ci 8608c2ecf20Sopenharmony_ci#define HTT_RX_MD_DATA_FILTER_FLASG3 (HTT_RX_MD_DATA_PKT_FILTER_TLV_FLASG3_MCAST \ 8618c2ecf20Sopenharmony_ci | HTT_RX_MD_DATA_PKT_FILTER_TLV_FLASG3_UCAST \ 8628c2ecf20Sopenharmony_ci | HTT_RX_MD_DATA_PKT_FILTER_TLV_FLASG3_NULL_DATA) 8638c2ecf20Sopenharmony_ci 8648c2ecf20Sopenharmony_ci#define HTT_RX_MO_DATA_FILTER_FLASG3 (HTT_RX_MO_DATA_PKT_FILTER_TLV_FLASG3_MCAST \ 8658c2ecf20Sopenharmony_ci | HTT_RX_MO_DATA_PKT_FILTER_TLV_FLASG3_UCAST \ 8668c2ecf20Sopenharmony_ci | HTT_RX_MO_DATA_PKT_FILTER_TLV_FLASG3_NULL_DATA) 8678c2ecf20Sopenharmony_ci 8688c2ecf20Sopenharmony_ci#define HTT_RX_MON_FP_MGMT_FILTER_FLAGS0 \ 8698c2ecf20Sopenharmony_ci (HTT_RX_FP_MGMT_FILTER_FLAGS0 | \ 8708c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS0_RESERVED_7) 8718c2ecf20Sopenharmony_ci 8728c2ecf20Sopenharmony_ci#define HTT_RX_MON_MO_MGMT_FILTER_FLAGS0 \ 8738c2ecf20Sopenharmony_ci (HTT_RX_MO_MGMT_FILTER_FLAGS0 | \ 8748c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS0_RESERVED_7) 8758c2ecf20Sopenharmony_ci 8768c2ecf20Sopenharmony_ci#define HTT_RX_MON_FP_MGMT_FILTER_FLAGS1 \ 8778c2ecf20Sopenharmony_ci (HTT_RX_FP_MGMT_FILTER_FLAGS1 | \ 8788c2ecf20Sopenharmony_ci HTT_RX_FP_MGMT_PKT_FILTER_TLV_FLAGS1_RESERVED_15) 8798c2ecf20Sopenharmony_ci 8808c2ecf20Sopenharmony_ci#define HTT_RX_MON_MO_MGMT_FILTER_FLAGS1 \ 8818c2ecf20Sopenharmony_ci (HTT_RX_MO_MGMT_FILTER_FLAGS1 | \ 8828c2ecf20Sopenharmony_ci HTT_RX_MO_MGMT_PKT_FILTER_TLV_FLAGS1_RESERVED_15) 8838c2ecf20Sopenharmony_ci 8848c2ecf20Sopenharmony_ci#define HTT_RX_MON_FP_CTRL_FILTER_FLASG2 \ 8858c2ecf20Sopenharmony_ci (HTT_RX_FP_CTRL_FILTER_FLASG2 | \ 8868c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_1 | \ 8878c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_2 | \ 8888c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_TRIGGER | \ 8898c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_4 | \ 8908c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_BF_REP_POLL | \ 8918c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_VHT_NDP | \ 8928c2ecf20Sopenharmony_ci HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_FRAME_EXT) 8938c2ecf20Sopenharmony_ci 8948c2ecf20Sopenharmony_ci#define HTT_RX_MON_MO_CTRL_FILTER_FLASG2 \ 8958c2ecf20Sopenharmony_ci (HTT_RX_MO_CTRL_FILTER_FLASG2 | \ 8968c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_1 | \ 8978c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_2 | \ 8988c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_TRIGGER | \ 8998c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_RESERVED_4 | \ 9008c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_BF_REP_POLL | \ 9018c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_VHT_NDP | \ 9028c2ecf20Sopenharmony_ci HTT_RX_MO_CTRL_PKT_FILTER_TLV_FLAGS2_CTRL_FRAME_EXT) 9038c2ecf20Sopenharmony_ci 9048c2ecf20Sopenharmony_ci#define HTT_RX_MON_FP_CTRL_FILTER_FLASG3 HTT_RX_FP_CTRL_FILTER_FLASG3 9058c2ecf20Sopenharmony_ci 9068c2ecf20Sopenharmony_ci#define HTT_RX_MON_MO_CTRL_FILTER_FLASG3 HTT_RX_MO_CTRL_FILTER_FLASG3 9078c2ecf20Sopenharmony_ci 9088c2ecf20Sopenharmony_ci#define HTT_RX_MON_FP_DATA_FILTER_FLASG3 HTT_RX_FP_DATA_FILTER_FLASG3 9098c2ecf20Sopenharmony_ci 9108c2ecf20Sopenharmony_ci#define HTT_RX_MON_MO_DATA_FILTER_FLASG3 HTT_RX_MO_DATA_FILTER_FLASG3 9118c2ecf20Sopenharmony_ci 9128c2ecf20Sopenharmony_ci#define HTT_RX_MON_FILTER_TLV_FLAGS \ 9138c2ecf20Sopenharmony_ci (HTT_RX_FILTER_TLV_FLAGS_MPDU_START | \ 9148c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_START | \ 9158c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_END | \ 9168c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_END_USER_STATS | \ 9178c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_END_USER_STATS_EXT | \ 9188c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_END_STATUS_DONE) 9198c2ecf20Sopenharmony_ci 9208c2ecf20Sopenharmony_ci#define HTT_RX_MON_FILTER_TLV_FLAGS_MON_STATUS_RING \ 9218c2ecf20Sopenharmony_ci (HTT_RX_FILTER_TLV_FLAGS_MPDU_START | \ 9228c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_START | \ 9238c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_END | \ 9248c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_END_USER_STATS | \ 9258c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_END_USER_STATS_EXT | \ 9268c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PPDU_END_STATUS_DONE) 9278c2ecf20Sopenharmony_ci 9288c2ecf20Sopenharmony_ci#define HTT_RX_MON_FILTER_TLV_FLAGS_MON_BUF_RING \ 9298c2ecf20Sopenharmony_ci (HTT_RX_FILTER_TLV_FLAGS_MPDU_START | \ 9308c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_MSDU_START | \ 9318c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_RX_PACKET | \ 9328c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_MSDU_END | \ 9338c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_MPDU_END | \ 9348c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PACKET_HEADER | \ 9358c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_PER_MSDU_HEADER | \ 9368c2ecf20Sopenharmony_ci HTT_RX_FILTER_TLV_FLAGS_ATTENTION) 9378c2ecf20Sopenharmony_ci 9388c2ecf20Sopenharmony_cistruct htt_rx_ring_selection_cfg_cmd { 9398c2ecf20Sopenharmony_ci u32 info0; 9408c2ecf20Sopenharmony_ci u32 info1; 9418c2ecf20Sopenharmony_ci u32 pkt_type_en_flags0; 9428c2ecf20Sopenharmony_ci u32 pkt_type_en_flags1; 9438c2ecf20Sopenharmony_ci u32 pkt_type_en_flags2; 9448c2ecf20Sopenharmony_ci u32 pkt_type_en_flags3; 9458c2ecf20Sopenharmony_ci u32 rx_filter_tlv; 9468c2ecf20Sopenharmony_ci} __packed; 9478c2ecf20Sopenharmony_ci 9488c2ecf20Sopenharmony_cistruct htt_rx_ring_tlv_filter { 9498c2ecf20Sopenharmony_ci u32 rx_filter; /* see htt_rx_filter_tlv_flags */ 9508c2ecf20Sopenharmony_ci u32 pkt_filter_flags0; /* MGMT */ 9518c2ecf20Sopenharmony_ci u32 pkt_filter_flags1; /* MGMT */ 9528c2ecf20Sopenharmony_ci u32 pkt_filter_flags2; /* CTRL */ 9538c2ecf20Sopenharmony_ci u32 pkt_filter_flags3; /* DATA */ 9548c2ecf20Sopenharmony_ci}; 9558c2ecf20Sopenharmony_ci 9568c2ecf20Sopenharmony_ci/* HTT message target->host */ 9578c2ecf20Sopenharmony_ci 9588c2ecf20Sopenharmony_cienum htt_t2h_msg_type { 9598c2ecf20Sopenharmony_ci HTT_T2H_MSG_TYPE_VERSION_CONF, 9608c2ecf20Sopenharmony_ci HTT_T2H_MSG_TYPE_PEER_MAP = 0x3, 9618c2ecf20Sopenharmony_ci HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4, 9628c2ecf20Sopenharmony_ci HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5, 9638c2ecf20Sopenharmony_ci HTT_T2H_MSG_TYPE_PKTLOG = 0x8, 9648c2ecf20Sopenharmony_ci HTT_T2H_MSG_TYPE_SEC_IND = 0xb, 9658c2ecf20Sopenharmony_ci HTT_T2H_MSG_TYPE_PEER_MAP2 = 0x1e, 9668c2ecf20Sopenharmony_ci HTT_T2H_MSG_TYPE_PEER_UNMAP2 = 0x1f, 9678c2ecf20Sopenharmony_ci HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d, 9688c2ecf20Sopenharmony_ci HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c, 9698c2ecf20Sopenharmony_ci HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24, 9708c2ecf20Sopenharmony_ci}; 9718c2ecf20Sopenharmony_ci 9728c2ecf20Sopenharmony_ci#define HTT_TARGET_VERSION_MAJOR 3 9738c2ecf20Sopenharmony_ci 9748c2ecf20Sopenharmony_ci#define HTT_T2H_MSG_TYPE GENMASK(7, 0) 9758c2ecf20Sopenharmony_ci#define HTT_T2H_VERSION_CONF_MINOR GENMASK(15, 8) 9768c2ecf20Sopenharmony_ci#define HTT_T2H_VERSION_CONF_MAJOR GENMASK(23, 16) 9778c2ecf20Sopenharmony_ci 9788c2ecf20Sopenharmony_cistruct htt_t2h_version_conf_msg { 9798c2ecf20Sopenharmony_ci u32 version; 9808c2ecf20Sopenharmony_ci} __packed; 9818c2ecf20Sopenharmony_ci 9828c2ecf20Sopenharmony_ci#define HTT_T2H_PEER_MAP_INFO_VDEV_ID GENMASK(15, 8) 9838c2ecf20Sopenharmony_ci#define HTT_T2H_PEER_MAP_INFO_PEER_ID GENMASK(31, 16) 9848c2ecf20Sopenharmony_ci#define HTT_T2H_PEER_MAP_INFO1_MAC_ADDR_H16 GENMASK(15, 0) 9858c2ecf20Sopenharmony_ci#define HTT_T2H_PEER_MAP_INFO1_HW_PEER_ID GENMASK(31, 16) 9868c2ecf20Sopenharmony_ci#define HTT_T2H_PEER_MAP_INFO2_AST_HASH_VAL GENMASK(15, 0) 9878c2ecf20Sopenharmony_ci#define HTT_T2H_PEER_MAP_INFO2_NEXT_HOP_M BIT(16) 9888c2ecf20Sopenharmony_ci#define HTT_T2H_PEER_MAP_INFO2_NEXT_HOP_S 16 9898c2ecf20Sopenharmony_ci 9908c2ecf20Sopenharmony_cistruct htt_t2h_peer_map_event { 9918c2ecf20Sopenharmony_ci u32 info; 9928c2ecf20Sopenharmony_ci u32 mac_addr_l32; 9938c2ecf20Sopenharmony_ci u32 info1; 9948c2ecf20Sopenharmony_ci u32 info2; 9958c2ecf20Sopenharmony_ci} __packed; 9968c2ecf20Sopenharmony_ci 9978c2ecf20Sopenharmony_ci#define HTT_T2H_PEER_UNMAP_INFO_VDEV_ID HTT_T2H_PEER_MAP_INFO_VDEV_ID 9988c2ecf20Sopenharmony_ci#define HTT_T2H_PEER_UNMAP_INFO_PEER_ID HTT_T2H_PEER_MAP_INFO_PEER_ID 9998c2ecf20Sopenharmony_ci#define HTT_T2H_PEER_UNMAP_INFO1_MAC_ADDR_H16 \ 10008c2ecf20Sopenharmony_ci HTT_T2H_PEER_MAP_INFO1_MAC_ADDR_H16 10018c2ecf20Sopenharmony_ci#define HTT_T2H_PEER_MAP_INFO1_NEXT_HOP_M HTT_T2H_PEER_MAP_INFO2_NEXT_HOP_M 10028c2ecf20Sopenharmony_ci#define HTT_T2H_PEER_MAP_INFO1_NEXT_HOP_S HTT_T2H_PEER_MAP_INFO2_NEXT_HOP_S 10038c2ecf20Sopenharmony_ci 10048c2ecf20Sopenharmony_cistruct htt_t2h_peer_unmap_event { 10058c2ecf20Sopenharmony_ci u32 info; 10068c2ecf20Sopenharmony_ci u32 mac_addr_l32; 10078c2ecf20Sopenharmony_ci u32 info1; 10088c2ecf20Sopenharmony_ci} __packed; 10098c2ecf20Sopenharmony_ci 10108c2ecf20Sopenharmony_cistruct htt_resp_msg { 10118c2ecf20Sopenharmony_ci union { 10128c2ecf20Sopenharmony_ci struct htt_t2h_version_conf_msg version_msg; 10138c2ecf20Sopenharmony_ci struct htt_t2h_peer_map_event peer_map_ev; 10148c2ecf20Sopenharmony_ci struct htt_t2h_peer_unmap_event peer_unmap_ev; 10158c2ecf20Sopenharmony_ci }; 10168c2ecf20Sopenharmony_ci} __packed; 10178c2ecf20Sopenharmony_ci 10188c2ecf20Sopenharmony_ci#define HTT_BACKPRESSURE_EVENT_PDEV_ID_M GENMASK(15, 8) 10198c2ecf20Sopenharmony_ci#define HTT_BACKPRESSURE_EVENT_RING_TYPE_M GENMASK(23, 16) 10208c2ecf20Sopenharmony_ci#define HTT_BACKPRESSURE_EVENT_RING_ID_M GENMASK(31, 24) 10218c2ecf20Sopenharmony_ci 10228c2ecf20Sopenharmony_ci#define HTT_BACKPRESSURE_EVENT_HP_M GENMASK(15, 0) 10238c2ecf20Sopenharmony_ci#define HTT_BACKPRESSURE_EVENT_TP_M GENMASK(31, 16) 10248c2ecf20Sopenharmony_ci 10258c2ecf20Sopenharmony_ci#define HTT_BACKPRESSURE_UMAC_RING_TYPE 0 10268c2ecf20Sopenharmony_ci#define HTT_BACKPRESSURE_LMAC_RING_TYPE 1 10278c2ecf20Sopenharmony_ci 10288c2ecf20Sopenharmony_cienum htt_backpressure_umac_ringid { 10298c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_REO_REO2SW1_RING, 10308c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_REO_REO2SW2_RING, 10318c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_REO_REO2SW3_RING, 10328c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_REO_REO2SW4_RING, 10338c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING, 10348c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_REO_REO2TCL_RING, 10358c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_REO_REO2FW_RING, 10368c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_REO_REO_RELEASE_RING, 10378c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING, 10388c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_TCL_TCL2TQM_RING, 10398c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING, 10408c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_WBM_REO_RELEASE_RING, 10418c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING, 10428c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING, 10438c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING, 10448c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING, 10458c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_REO_REO_CMD_RING, 10468c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_REO_REO_STATUS_RING, 10478c2ecf20Sopenharmony_ci HTT_SW_UMAC_RING_IDX_MAX, 10488c2ecf20Sopenharmony_ci}; 10498c2ecf20Sopenharmony_ci 10508c2ecf20Sopenharmony_cienum htt_backpressure_lmac_ringid { 10518c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_FW2RXDMA_BUF_RING, 10528c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING, 10538c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_FW2RXDMA_LINK_RING, 10548c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_SW2RXDMA_BUF_RING, 10558c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING, 10568c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_RXDMA2FW_RING, 10578c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_RXDMA2SW_RING, 10588c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_RXDMA2RELEASE_RING, 10598c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_RXDMA2REO_RING, 10608c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_MONITOR_STATUS_RING, 10618c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_MONITOR_BUF_RING, 10628c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_MONITOR_DESC_RING, 10638c2ecf20Sopenharmony_ci HTT_SW_RING_IDX_MONITOR_DEST_RING, 10648c2ecf20Sopenharmony_ci HTT_SW_LMAC_RING_IDX_MAX, 10658c2ecf20Sopenharmony_ci}; 10668c2ecf20Sopenharmony_ci 10678c2ecf20Sopenharmony_ci/* ppdu stats 10688c2ecf20Sopenharmony_ci * 10698c2ecf20Sopenharmony_ci * @details 10708c2ecf20Sopenharmony_ci * The following field definitions describe the format of the HTT target 10718c2ecf20Sopenharmony_ci * to host ppdu stats indication message. 10728c2ecf20Sopenharmony_ci * 10738c2ecf20Sopenharmony_ci * 10748c2ecf20Sopenharmony_ci * |31 16|15 12|11 10|9 8|7 0 | 10758c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 10768c2ecf20Sopenharmony_ci * | payload_size | rsvd |pdev_id|mac_id | msg type | 10778c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 10788c2ecf20Sopenharmony_ci * | ppdu_id | 10798c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 10808c2ecf20Sopenharmony_ci * | Timestamp in us | 10818c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 10828c2ecf20Sopenharmony_ci * | reserved | 10838c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 10848c2ecf20Sopenharmony_ci * | type-specific stats info | 10858c2ecf20Sopenharmony_ci * | (see htt_ppdu_stats.h) | 10868c2ecf20Sopenharmony_ci * |----------------------------------------------------------------------| 10878c2ecf20Sopenharmony_ci * Header fields: 10888c2ecf20Sopenharmony_ci * - MSG_TYPE 10898c2ecf20Sopenharmony_ci * Bits 7:0 10908c2ecf20Sopenharmony_ci * Purpose: Identifies this is a PPDU STATS indication 10918c2ecf20Sopenharmony_ci * message. 10928c2ecf20Sopenharmony_ci * Value: 0x1d 10938c2ecf20Sopenharmony_ci * - mac_id 10948c2ecf20Sopenharmony_ci * Bits 9:8 10958c2ecf20Sopenharmony_ci * Purpose: mac_id of this ppdu_id 10968c2ecf20Sopenharmony_ci * Value: 0-3 10978c2ecf20Sopenharmony_ci * - pdev_id 10988c2ecf20Sopenharmony_ci * Bits 11:10 10998c2ecf20Sopenharmony_ci * Purpose: pdev_id of this ppdu_id 11008c2ecf20Sopenharmony_ci * Value: 0-3 11018c2ecf20Sopenharmony_ci * 0 (for rings at SOC level), 11028c2ecf20Sopenharmony_ci * 1/2/3 PDEV -> 0/1/2 11038c2ecf20Sopenharmony_ci * - payload_size 11048c2ecf20Sopenharmony_ci * Bits 31:16 11058c2ecf20Sopenharmony_ci * Purpose: total tlv size 11068c2ecf20Sopenharmony_ci * Value: payload_size in bytes 11078c2ecf20Sopenharmony_ci */ 11088c2ecf20Sopenharmony_ci 11098c2ecf20Sopenharmony_ci#define HTT_T2H_PPDU_STATS_INFO_PDEV_ID GENMASK(11, 10) 11108c2ecf20Sopenharmony_ci#define HTT_T2H_PPDU_STATS_INFO_PAYLOAD_SIZE GENMASK(31, 16) 11118c2ecf20Sopenharmony_ci 11128c2ecf20Sopenharmony_cistruct ath11k_htt_ppdu_stats_msg { 11138c2ecf20Sopenharmony_ci u32 info; 11148c2ecf20Sopenharmony_ci u32 ppdu_id; 11158c2ecf20Sopenharmony_ci u32 timestamp; 11168c2ecf20Sopenharmony_ci u32 rsvd; 11178c2ecf20Sopenharmony_ci u8 data[0]; 11188c2ecf20Sopenharmony_ci} __packed; 11198c2ecf20Sopenharmony_ci 11208c2ecf20Sopenharmony_cistruct htt_tlv { 11218c2ecf20Sopenharmony_ci u32 header; 11228c2ecf20Sopenharmony_ci u8 value[0]; 11238c2ecf20Sopenharmony_ci} __packed; 11248c2ecf20Sopenharmony_ci 11258c2ecf20Sopenharmony_ci#define HTT_TLV_TAG GENMASK(11, 0) 11268c2ecf20Sopenharmony_ci#define HTT_TLV_LEN GENMASK(23, 12) 11278c2ecf20Sopenharmony_ci 11288c2ecf20Sopenharmony_cienum HTT_PPDU_STATS_BW { 11298c2ecf20Sopenharmony_ci HTT_PPDU_STATS_BANDWIDTH_5MHZ = 0, 11308c2ecf20Sopenharmony_ci HTT_PPDU_STATS_BANDWIDTH_10MHZ = 1, 11318c2ecf20Sopenharmony_ci HTT_PPDU_STATS_BANDWIDTH_20MHZ = 2, 11328c2ecf20Sopenharmony_ci HTT_PPDU_STATS_BANDWIDTH_40MHZ = 3, 11338c2ecf20Sopenharmony_ci HTT_PPDU_STATS_BANDWIDTH_80MHZ = 4, 11348c2ecf20Sopenharmony_ci HTT_PPDU_STATS_BANDWIDTH_160MHZ = 5, /* includes 80+80 */ 11358c2ecf20Sopenharmony_ci HTT_PPDU_STATS_BANDWIDTH_DYN = 6, 11368c2ecf20Sopenharmony_ci}; 11378c2ecf20Sopenharmony_ci 11388c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_CMN_FLAGS_FRAME_TYPE_M GENMASK(7, 0) 11398c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_CMN_FLAGS_QUEUE_TYPE_M GENMASK(15, 8) 11408c2ecf20Sopenharmony_ci/* bw - HTT_PPDU_STATS_BW */ 11418c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_CMN_FLAGS_BW_M GENMASK(19, 16) 11428c2ecf20Sopenharmony_ci 11438c2ecf20Sopenharmony_cistruct htt_ppdu_stats_common { 11448c2ecf20Sopenharmony_ci u32 ppdu_id; 11458c2ecf20Sopenharmony_ci u16 sched_cmdid; 11468c2ecf20Sopenharmony_ci u8 ring_id; 11478c2ecf20Sopenharmony_ci u8 num_users; 11488c2ecf20Sopenharmony_ci u32 flags; /* %HTT_PPDU_STATS_COMMON_FLAGS_*/ 11498c2ecf20Sopenharmony_ci u32 chain_mask; 11508c2ecf20Sopenharmony_ci u32 fes_duration_us; /* frame exchange sequence */ 11518c2ecf20Sopenharmony_ci u32 ppdu_sch_eval_start_tstmp_us; 11528c2ecf20Sopenharmony_ci u32 ppdu_sch_end_tstmp_us; 11538c2ecf20Sopenharmony_ci u32 ppdu_start_tstmp_us; 11548c2ecf20Sopenharmony_ci /* BIT [15 : 0] - phy mode (WLAN_PHY_MODE) with which ppdu was transmitted 11558c2ecf20Sopenharmony_ci * BIT [31 : 16] - bandwidth (in MHz) with which ppdu was transmitted 11568c2ecf20Sopenharmony_ci */ 11578c2ecf20Sopenharmony_ci u16 phy_mode; 11588c2ecf20Sopenharmony_ci u16 bw_mhz; 11598c2ecf20Sopenharmony_ci} __packed; 11608c2ecf20Sopenharmony_ci 11618c2ecf20Sopenharmony_cienum htt_ppdu_stats_gi { 11628c2ecf20Sopenharmony_ci HTT_PPDU_STATS_SGI_0_8_US, 11638c2ecf20Sopenharmony_ci HTT_PPDU_STATS_SGI_0_4_US, 11648c2ecf20Sopenharmony_ci HTT_PPDU_STATS_SGI_1_6_US, 11658c2ecf20Sopenharmony_ci HTT_PPDU_STATS_SGI_3_2_US, 11668c2ecf20Sopenharmony_ci}; 11678c2ecf20Sopenharmony_ci 11688c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_INFO0_USER_POS_M GENMASK(3, 0) 11698c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_INFO0_MU_GROUP_ID_M GENMASK(11, 4) 11708c2ecf20Sopenharmony_ci 11718c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_INFO1_RESP_TYPE_VALD_M BIT(0) 11728c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_INFO1_PPDU_TYPE_M GENMASK(5, 1) 11738c2ecf20Sopenharmony_ci 11748c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_FLAGS_LTF_SIZE_M GENMASK(1, 0) 11758c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_FLAGS_STBC_M BIT(2) 11768c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_FLAGS_HE_RE_M BIT(3) 11778c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_FLAGS_TXBF_M GENMASK(7, 4) 11788c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_FLAGS_BW_M GENMASK(11, 8) 11798c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_FLAGS_NSS_M GENMASK(15, 12) 11808c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_FLAGS_MCS_M GENMASK(19, 16) 11818c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_FLAGS_PREAMBLE_M GENMASK(23, 20) 11828c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_FLAGS_GI_M GENMASK(27, 24) 11838c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_FLAGS_DCM_M BIT(28) 11848c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_FLAGS_LDPC_M BIT(29) 11858c2ecf20Sopenharmony_ci 11868c2ecf20Sopenharmony_ci#define HTT_USR_RATE_PREAMBLE(_val) \ 11878c2ecf20Sopenharmony_ci FIELD_GET(HTT_PPDU_STATS_USER_RATE_FLAGS_PREAMBLE_M, _val) 11888c2ecf20Sopenharmony_ci#define HTT_USR_RATE_BW(_val) \ 11898c2ecf20Sopenharmony_ci FIELD_GET(HTT_PPDU_STATS_USER_RATE_FLAGS_BW_M, _val) 11908c2ecf20Sopenharmony_ci#define HTT_USR_RATE_NSS(_val) \ 11918c2ecf20Sopenharmony_ci FIELD_GET(HTT_PPDU_STATS_USER_RATE_FLAGS_NSS_M, _val) 11928c2ecf20Sopenharmony_ci#define HTT_USR_RATE_MCS(_val) \ 11938c2ecf20Sopenharmony_ci FIELD_GET(HTT_PPDU_STATS_USER_RATE_FLAGS_MCS_M, _val) 11948c2ecf20Sopenharmony_ci#define HTT_USR_RATE_GI(_val) \ 11958c2ecf20Sopenharmony_ci FIELD_GET(HTT_PPDU_STATS_USER_RATE_FLAGS_GI_M, _val) 11968c2ecf20Sopenharmony_ci#define HTT_USR_RATE_DCM(_val) \ 11978c2ecf20Sopenharmony_ci FIELD_GET(HTT_PPDU_STATS_USER_RATE_FLAGS_DCM_M, _val) 11988c2ecf20Sopenharmony_ci 11998c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_LTF_SIZE_M GENMASK(1, 0) 12008c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_STBC_M BIT(2) 12018c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_HE_RE_M BIT(3) 12028c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_TXBF_M GENMASK(7, 4) 12038c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_BW_M GENMASK(11, 8) 12048c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_NSS_M GENMASK(15, 12) 12058c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_MCS_M GENMASK(19, 16) 12068c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_PREAMBLE_M GENMASK(23, 20) 12078c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_GI_M GENMASK(27, 24) 12088c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_DCM_M BIT(28) 12098c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_LDPC_M BIT(29) 12108c2ecf20Sopenharmony_ci 12118c2ecf20Sopenharmony_cistruct htt_ppdu_stats_user_rate { 12128c2ecf20Sopenharmony_ci u8 tid_num; 12138c2ecf20Sopenharmony_ci u8 reserved0; 12148c2ecf20Sopenharmony_ci u16 sw_peer_id; 12158c2ecf20Sopenharmony_ci u32 info0; /* %HTT_PPDU_STATS_USER_RATE_INFO0_*/ 12168c2ecf20Sopenharmony_ci u16 ru_end; 12178c2ecf20Sopenharmony_ci u16 ru_start; 12188c2ecf20Sopenharmony_ci u16 resp_ru_end; 12198c2ecf20Sopenharmony_ci u16 resp_ru_start; 12208c2ecf20Sopenharmony_ci u32 info1; /* %HTT_PPDU_STATS_USER_RATE_INFO1_ */ 12218c2ecf20Sopenharmony_ci u32 rate_flags; /* %HTT_PPDU_STATS_USER_RATE_FLAGS_ */ 12228c2ecf20Sopenharmony_ci /* Note: resp_rate_info is only valid for if resp_type is UL */ 12238c2ecf20Sopenharmony_ci u32 resp_rate_flags; /* %HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_ */ 12248c2ecf20Sopenharmony_ci} __packed; 12258c2ecf20Sopenharmony_ci 12268c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_TX_INFO_FLAGS_RATECODE_M GENMASK(7, 0) 12278c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_TX_INFO_FLAGS_IS_AMPDU_M BIT(8) 12288c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_TX_INFO_FLAGS_BA_ACK_FAILED_M GENMASK(10, 9) 12298c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_TX_INFO_FLAGS_BW_M GENMASK(13, 11) 12308c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_TX_INFO_FLAGS_SGI_M BIT(14) 12318c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_TX_INFO_FLAGS_PEERID_M GENMASK(31, 16) 12328c2ecf20Sopenharmony_ci 12338c2ecf20Sopenharmony_ci#define HTT_TX_INFO_IS_AMSDU(_flags) \ 12348c2ecf20Sopenharmony_ci FIELD_GET(HTT_PPDU_STATS_TX_INFO_FLAGS_IS_AMPDU_M, _flags) 12358c2ecf20Sopenharmony_ci#define HTT_TX_INFO_BA_ACK_FAILED(_flags) \ 12368c2ecf20Sopenharmony_ci FIELD_GET(HTT_PPDU_STATS_TX_INFO_FLAGS_BA_ACK_FAILED_M, _flags) 12378c2ecf20Sopenharmony_ci#define HTT_TX_INFO_RATECODE(_flags) \ 12388c2ecf20Sopenharmony_ci FIELD_GET(HTT_PPDU_STATS_TX_INFO_FLAGS_RATECODE_M, _flags) 12398c2ecf20Sopenharmony_ci#define HTT_TX_INFO_PEERID(_flags) \ 12408c2ecf20Sopenharmony_ci FIELD_GET(HTT_PPDU_STATS_TX_INFO_FLAGS_PEERID_M, _flags) 12418c2ecf20Sopenharmony_ci 12428c2ecf20Sopenharmony_cistruct htt_tx_ppdu_stats_info { 12438c2ecf20Sopenharmony_ci struct htt_tlv tlv_hdr; 12448c2ecf20Sopenharmony_ci u32 tx_success_bytes; 12458c2ecf20Sopenharmony_ci u32 tx_retry_bytes; 12468c2ecf20Sopenharmony_ci u32 tx_failed_bytes; 12478c2ecf20Sopenharmony_ci u32 flags; /* %HTT_PPDU_STATS_TX_INFO_FLAGS_ */ 12488c2ecf20Sopenharmony_ci u16 tx_success_msdus; 12498c2ecf20Sopenharmony_ci u16 tx_retry_msdus; 12508c2ecf20Sopenharmony_ci u16 tx_failed_msdus; 12518c2ecf20Sopenharmony_ci u16 tx_duration; /* united in us */ 12528c2ecf20Sopenharmony_ci} __packed; 12538c2ecf20Sopenharmony_ci 12548c2ecf20Sopenharmony_cienum htt_ppdu_stats_usr_compln_status { 12558c2ecf20Sopenharmony_ci HTT_PPDU_STATS_USER_STATUS_OK, 12568c2ecf20Sopenharmony_ci HTT_PPDU_STATS_USER_STATUS_FILTERED, 12578c2ecf20Sopenharmony_ci HTT_PPDU_STATS_USER_STATUS_RESP_TIMEOUT, 12588c2ecf20Sopenharmony_ci HTT_PPDU_STATS_USER_STATUS_RESP_MISMATCH, 12598c2ecf20Sopenharmony_ci HTT_PPDU_STATS_USER_STATUS_ABORT, 12608c2ecf20Sopenharmony_ci}; 12618c2ecf20Sopenharmony_ci 12628c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USR_CMPLTN_CMN_FLAGS_LONG_RETRY_M GENMASK(3, 0) 12638c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USR_CMPLTN_CMN_FLAGS_SHORT_RETRY_M GENMASK(7, 4) 12648c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USR_CMPLTN_CMN_FLAGS_IS_AMPDU_M BIT(8) 12658c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_USR_CMPLTN_CMN_FLAGS_RESP_TYPE_M GENMASK(12, 9) 12668c2ecf20Sopenharmony_ci 12678c2ecf20Sopenharmony_ci#define HTT_USR_CMPLTN_IS_AMPDU(_val) \ 12688c2ecf20Sopenharmony_ci FIELD_GET(HTT_PPDU_STATS_USR_CMPLTN_CMN_FLAGS_IS_AMPDU_M, _val) 12698c2ecf20Sopenharmony_ci#define HTT_USR_CMPLTN_LONG_RETRY(_val) \ 12708c2ecf20Sopenharmony_ci FIELD_GET(HTT_PPDU_STATS_USR_CMPLTN_CMN_FLAGS_LONG_RETRY_M, _val) 12718c2ecf20Sopenharmony_ci#define HTT_USR_CMPLTN_SHORT_RETRY(_val) \ 12728c2ecf20Sopenharmony_ci FIELD_GET(HTT_PPDU_STATS_USR_CMPLTN_CMN_FLAGS_SHORT_RETRY_M, _val) 12738c2ecf20Sopenharmony_ci 12748c2ecf20Sopenharmony_cistruct htt_ppdu_stats_usr_cmpltn_cmn { 12758c2ecf20Sopenharmony_ci u8 status; 12768c2ecf20Sopenharmony_ci u8 tid_num; 12778c2ecf20Sopenharmony_ci u16 sw_peer_id; 12788c2ecf20Sopenharmony_ci /* RSSI value of last ack packet (units = dB above noise floor) */ 12798c2ecf20Sopenharmony_ci u32 ack_rssi; 12808c2ecf20Sopenharmony_ci u16 mpdu_tried; 12818c2ecf20Sopenharmony_ci u16 mpdu_success; 12828c2ecf20Sopenharmony_ci u32 flags; /* %HTT_PPDU_STATS_USR_CMPLTN_CMN_FLAGS_LONG_RETRIES*/ 12838c2ecf20Sopenharmony_ci} __packed; 12848c2ecf20Sopenharmony_ci 12858c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_ACK_BA_INFO_NUM_MPDU_M GENMASK(8, 0) 12868c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_ACK_BA_INFO_NUM_MSDU_M GENMASK(24, 9) 12878c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_ACK_BA_INFO_TID_NUM GENMASK(31, 25) 12888c2ecf20Sopenharmony_ci 12898c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_NON_QOS_TID 16 12908c2ecf20Sopenharmony_ci 12918c2ecf20Sopenharmony_cistruct htt_ppdu_stats_usr_cmpltn_ack_ba_status { 12928c2ecf20Sopenharmony_ci u32 ppdu_id; 12938c2ecf20Sopenharmony_ci u16 sw_peer_id; 12948c2ecf20Sopenharmony_ci u16 reserved0; 12958c2ecf20Sopenharmony_ci u32 info; /* %HTT_PPDU_STATS_USR_CMPLTN_CMN_INFO_ */ 12968c2ecf20Sopenharmony_ci u16 current_seq; 12978c2ecf20Sopenharmony_ci u16 start_seq; 12988c2ecf20Sopenharmony_ci u32 success_bytes; 12998c2ecf20Sopenharmony_ci} __packed; 13008c2ecf20Sopenharmony_ci 13018c2ecf20Sopenharmony_cistruct htt_ppdu_stats_usr_cmn_array { 13028c2ecf20Sopenharmony_ci struct htt_tlv tlv_hdr; 13038c2ecf20Sopenharmony_ci u32 num_ppdu_stats; 13048c2ecf20Sopenharmony_ci /* tx_ppdu_stats_info is filled by multiple struct htt_tx_ppdu_stats_info 13058c2ecf20Sopenharmony_ci * elements. 13068c2ecf20Sopenharmony_ci * tx_ppdu_stats_info is variable length, with length = 13078c2ecf20Sopenharmony_ci * number_of_ppdu_stats * sizeof (struct htt_tx_ppdu_stats_info) 13088c2ecf20Sopenharmony_ci */ 13098c2ecf20Sopenharmony_ci struct htt_tx_ppdu_stats_info tx_ppdu_info[0]; 13108c2ecf20Sopenharmony_ci} __packed; 13118c2ecf20Sopenharmony_ci 13128c2ecf20Sopenharmony_cistruct htt_ppdu_user_stats { 13138c2ecf20Sopenharmony_ci u16 peer_id; 13148c2ecf20Sopenharmony_ci u32 tlv_flags; 13158c2ecf20Sopenharmony_ci bool is_valid_peer_id; 13168c2ecf20Sopenharmony_ci struct htt_ppdu_stats_user_rate rate; 13178c2ecf20Sopenharmony_ci struct htt_ppdu_stats_usr_cmpltn_cmn cmpltn_cmn; 13188c2ecf20Sopenharmony_ci struct htt_ppdu_stats_usr_cmpltn_ack_ba_status ack_ba; 13198c2ecf20Sopenharmony_ci}; 13208c2ecf20Sopenharmony_ci 13218c2ecf20Sopenharmony_ci#define HTT_PPDU_STATS_MAX_USERS 8 13228c2ecf20Sopenharmony_ci#define HTT_PPDU_DESC_MAX_DEPTH 16 13238c2ecf20Sopenharmony_ci 13248c2ecf20Sopenharmony_cistruct htt_ppdu_stats { 13258c2ecf20Sopenharmony_ci struct htt_ppdu_stats_common common; 13268c2ecf20Sopenharmony_ci struct htt_ppdu_user_stats user_stats[HTT_PPDU_STATS_MAX_USERS]; 13278c2ecf20Sopenharmony_ci}; 13288c2ecf20Sopenharmony_ci 13298c2ecf20Sopenharmony_cistruct htt_ppdu_stats_info { 13308c2ecf20Sopenharmony_ci u32 ppdu_id; 13318c2ecf20Sopenharmony_ci struct htt_ppdu_stats ppdu_stats; 13328c2ecf20Sopenharmony_ci struct list_head list; 13338c2ecf20Sopenharmony_ci}; 13348c2ecf20Sopenharmony_ci 13358c2ecf20Sopenharmony_ci/** 13368c2ecf20Sopenharmony_ci * @brief target -> host packet log message 13378c2ecf20Sopenharmony_ci * 13388c2ecf20Sopenharmony_ci * @details 13398c2ecf20Sopenharmony_ci * The following field definitions describe the format of the packet log 13408c2ecf20Sopenharmony_ci * message sent from the target to the host. 13418c2ecf20Sopenharmony_ci * The message consists of a 4-octet header,followed by a variable number 13428c2ecf20Sopenharmony_ci * of 32-bit character values. 13438c2ecf20Sopenharmony_ci * 13448c2ecf20Sopenharmony_ci * |31 16|15 12|11 10|9 8|7 0| 13458c2ecf20Sopenharmony_ci * |------------------------------------------------------------------| 13468c2ecf20Sopenharmony_ci * | payload_size | rsvd |pdev_id|mac_id| msg type | 13478c2ecf20Sopenharmony_ci * |------------------------------------------------------------------| 13488c2ecf20Sopenharmony_ci * | payload | 13498c2ecf20Sopenharmony_ci * |------------------------------------------------------------------| 13508c2ecf20Sopenharmony_ci * - MSG_TYPE 13518c2ecf20Sopenharmony_ci * Bits 7:0 13528c2ecf20Sopenharmony_ci * Purpose: identifies this as a pktlog message 13538c2ecf20Sopenharmony_ci * Value: HTT_T2H_MSG_TYPE_PKTLOG 13548c2ecf20Sopenharmony_ci * - mac_id 13558c2ecf20Sopenharmony_ci * Bits 9:8 13568c2ecf20Sopenharmony_ci * Purpose: identifies which MAC/PHY instance generated this pktlog info 13578c2ecf20Sopenharmony_ci * Value: 0-3 13588c2ecf20Sopenharmony_ci * - pdev_id 13598c2ecf20Sopenharmony_ci * Bits 11:10 13608c2ecf20Sopenharmony_ci * Purpose: pdev_id 13618c2ecf20Sopenharmony_ci * Value: 0-3 13628c2ecf20Sopenharmony_ci * 0 (for rings at SOC level), 13638c2ecf20Sopenharmony_ci * 1/2/3 PDEV -> 0/1/2 13648c2ecf20Sopenharmony_ci * - payload_size 13658c2ecf20Sopenharmony_ci * Bits 31:16 13668c2ecf20Sopenharmony_ci * Purpose: explicitly specify the payload size 13678c2ecf20Sopenharmony_ci * Value: payload size in bytes (payload size is a multiple of 4 bytes) 13688c2ecf20Sopenharmony_ci */ 13698c2ecf20Sopenharmony_cistruct htt_pktlog_msg { 13708c2ecf20Sopenharmony_ci u32 hdr; 13718c2ecf20Sopenharmony_ci u8 payload[0]; 13728c2ecf20Sopenharmony_ci}; 13738c2ecf20Sopenharmony_ci 13748c2ecf20Sopenharmony_ci/** 13758c2ecf20Sopenharmony_ci * @brief host -> target FW extended statistics retrieve 13768c2ecf20Sopenharmony_ci * 13778c2ecf20Sopenharmony_ci * @details 13788c2ecf20Sopenharmony_ci * The following field definitions describe the format of the HTT host 13798c2ecf20Sopenharmony_ci * to target FW extended stats retrieve message. 13808c2ecf20Sopenharmony_ci * The message specifies the type of stats the host wants to retrieve. 13818c2ecf20Sopenharmony_ci * 13828c2ecf20Sopenharmony_ci * |31 24|23 16|15 8|7 0| 13838c2ecf20Sopenharmony_ci * |-----------------------------------------------------------| 13848c2ecf20Sopenharmony_ci * | reserved | stats type | pdev_mask | msg type | 13858c2ecf20Sopenharmony_ci * |-----------------------------------------------------------| 13868c2ecf20Sopenharmony_ci * | config param [0] | 13878c2ecf20Sopenharmony_ci * |-----------------------------------------------------------| 13888c2ecf20Sopenharmony_ci * | config param [1] | 13898c2ecf20Sopenharmony_ci * |-----------------------------------------------------------| 13908c2ecf20Sopenharmony_ci * | config param [2] | 13918c2ecf20Sopenharmony_ci * |-----------------------------------------------------------| 13928c2ecf20Sopenharmony_ci * | config param [3] | 13938c2ecf20Sopenharmony_ci * |-----------------------------------------------------------| 13948c2ecf20Sopenharmony_ci * | reserved | 13958c2ecf20Sopenharmony_ci * |-----------------------------------------------------------| 13968c2ecf20Sopenharmony_ci * | cookie LSBs | 13978c2ecf20Sopenharmony_ci * |-----------------------------------------------------------| 13988c2ecf20Sopenharmony_ci * | cookie MSBs | 13998c2ecf20Sopenharmony_ci * |-----------------------------------------------------------| 14008c2ecf20Sopenharmony_ci * Header fields: 14018c2ecf20Sopenharmony_ci * - MSG_TYPE 14028c2ecf20Sopenharmony_ci * Bits 7:0 14038c2ecf20Sopenharmony_ci * Purpose: identifies this is a extended stats upload request message 14048c2ecf20Sopenharmony_ci * Value: 0x10 14058c2ecf20Sopenharmony_ci * - PDEV_MASK 14068c2ecf20Sopenharmony_ci * Bits 8:15 14078c2ecf20Sopenharmony_ci * Purpose: identifies the mask of PDEVs to retrieve stats from 14088c2ecf20Sopenharmony_ci * Value: This is a overloaded field, refer to usage and interpretation of 14098c2ecf20Sopenharmony_ci * PDEV in interface document. 14108c2ecf20Sopenharmony_ci * Bit 8 : Reserved for SOC stats 14118c2ecf20Sopenharmony_ci * Bit 9 - 15 : Indicates PDEV_MASK in DBDC 14128c2ecf20Sopenharmony_ci * Indicates MACID_MASK in DBS 14138c2ecf20Sopenharmony_ci * - STATS_TYPE 14148c2ecf20Sopenharmony_ci * Bits 23:16 14158c2ecf20Sopenharmony_ci * Purpose: identifies which FW statistics to upload 14168c2ecf20Sopenharmony_ci * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h) 14178c2ecf20Sopenharmony_ci * - Reserved 14188c2ecf20Sopenharmony_ci * Bits 31:24 14198c2ecf20Sopenharmony_ci * - CONFIG_PARAM [0] 14208c2ecf20Sopenharmony_ci * Bits 31:0 14218c2ecf20Sopenharmony_ci * Purpose: give an opaque configuration value to the specified stats type 14228c2ecf20Sopenharmony_ci * Value: stats-type specific configuration value 14238c2ecf20Sopenharmony_ci * Refer to htt_stats.h for interpretation for each stats sub_type 14248c2ecf20Sopenharmony_ci * - CONFIG_PARAM [1] 14258c2ecf20Sopenharmony_ci * Bits 31:0 14268c2ecf20Sopenharmony_ci * Purpose: give an opaque configuration value to the specified stats type 14278c2ecf20Sopenharmony_ci * Value: stats-type specific configuration value 14288c2ecf20Sopenharmony_ci * Refer to htt_stats.h for interpretation for each stats sub_type 14298c2ecf20Sopenharmony_ci * - CONFIG_PARAM [2] 14308c2ecf20Sopenharmony_ci * Bits 31:0 14318c2ecf20Sopenharmony_ci * Purpose: give an opaque configuration value to the specified stats type 14328c2ecf20Sopenharmony_ci * Value: stats-type specific configuration value 14338c2ecf20Sopenharmony_ci * Refer to htt_stats.h for interpretation for each stats sub_type 14348c2ecf20Sopenharmony_ci * - CONFIG_PARAM [3] 14358c2ecf20Sopenharmony_ci * Bits 31:0 14368c2ecf20Sopenharmony_ci * Purpose: give an opaque configuration value to the specified stats type 14378c2ecf20Sopenharmony_ci * Value: stats-type specific configuration value 14388c2ecf20Sopenharmony_ci * Refer to htt_stats.h for interpretation for each stats sub_type 14398c2ecf20Sopenharmony_ci * - Reserved [31:0] for future use. 14408c2ecf20Sopenharmony_ci * - COOKIE_LSBS 14418c2ecf20Sopenharmony_ci * Bits 31:0 14428c2ecf20Sopenharmony_ci * Purpose: Provide a mechanism to match a target->host stats confirmation 14438c2ecf20Sopenharmony_ci * message with its preceding host->target stats request message. 14448c2ecf20Sopenharmony_ci * Value: LSBs of the opaque cookie specified by the host-side requestor 14458c2ecf20Sopenharmony_ci * - COOKIE_MSBS 14468c2ecf20Sopenharmony_ci * Bits 31:0 14478c2ecf20Sopenharmony_ci * Purpose: Provide a mechanism to match a target->host stats confirmation 14488c2ecf20Sopenharmony_ci * message with its preceding host->target stats request message. 14498c2ecf20Sopenharmony_ci * Value: MSBs of the opaque cookie specified by the host-side requestor 14508c2ecf20Sopenharmony_ci */ 14518c2ecf20Sopenharmony_ci 14528c2ecf20Sopenharmony_cistruct htt_ext_stats_cfg_hdr { 14538c2ecf20Sopenharmony_ci u8 msg_type; 14548c2ecf20Sopenharmony_ci u8 pdev_mask; 14558c2ecf20Sopenharmony_ci u8 stats_type; 14568c2ecf20Sopenharmony_ci u8 reserved; 14578c2ecf20Sopenharmony_ci} __packed; 14588c2ecf20Sopenharmony_ci 14598c2ecf20Sopenharmony_cistruct htt_ext_stats_cfg_cmd { 14608c2ecf20Sopenharmony_ci struct htt_ext_stats_cfg_hdr hdr; 14618c2ecf20Sopenharmony_ci u32 cfg_param0; 14628c2ecf20Sopenharmony_ci u32 cfg_param1; 14638c2ecf20Sopenharmony_ci u32 cfg_param2; 14648c2ecf20Sopenharmony_ci u32 cfg_param3; 14658c2ecf20Sopenharmony_ci u32 reserved; 14668c2ecf20Sopenharmony_ci u32 cookie_lsb; 14678c2ecf20Sopenharmony_ci u32 cookie_msb; 14688c2ecf20Sopenharmony_ci} __packed; 14698c2ecf20Sopenharmony_ci 14708c2ecf20Sopenharmony_ci/* htt stats config default params */ 14718c2ecf20Sopenharmony_ci#define HTT_STAT_DEFAULT_RESET_START_OFFSET 0 14728c2ecf20Sopenharmony_ci#define HTT_STAT_DEFAULT_CFG0_ALL_HWQS 0xffffffff 14738c2ecf20Sopenharmony_ci#define HTT_STAT_DEFAULT_CFG0_ALL_TXQS 0xffffffff 14748c2ecf20Sopenharmony_ci#define HTT_STAT_DEFAULT_CFG0_ALL_CMDQS 0xffff 14758c2ecf20Sopenharmony_ci#define HTT_STAT_DEFAULT_CFG0_ALL_RINGS 0xffff 14768c2ecf20Sopenharmony_ci#define HTT_STAT_DEFAULT_CFG0_ACTIVE_PEERS 0xff 14778c2ecf20Sopenharmony_ci#define HTT_STAT_DEFAULT_CFG0_CCA_CUMULATIVE 0x00 14788c2ecf20Sopenharmony_ci#define HTT_STAT_DEFAULT_CFG0_ACTIVE_VDEVS 0x00 14798c2ecf20Sopenharmony_ci 14808c2ecf20Sopenharmony_ci/* HTT_DBG_EXT_STATS_PEER_INFO 14818c2ecf20Sopenharmony_ci * PARAMS: 14828c2ecf20Sopenharmony_ci * @config_param0: 14838c2ecf20Sopenharmony_ci * [Bit0] - [0] for sw_peer_id, [1] for mac_addr based request 14848c2ecf20Sopenharmony_ci * [Bit15 : Bit 1] htt_peer_stats_req_mode_t 14858c2ecf20Sopenharmony_ci * [Bit31 : Bit16] sw_peer_id 14868c2ecf20Sopenharmony_ci * @config_param1: 14878c2ecf20Sopenharmony_ci * peer_stats_req_type_mask:32 (enum htt_peer_stats_tlv_enum) 14888c2ecf20Sopenharmony_ci * 0 bit htt_peer_stats_cmn_tlv 14898c2ecf20Sopenharmony_ci * 1 bit htt_peer_details_tlv 14908c2ecf20Sopenharmony_ci * 2 bit htt_tx_peer_rate_stats_tlv 14918c2ecf20Sopenharmony_ci * 3 bit htt_rx_peer_rate_stats_tlv 14928c2ecf20Sopenharmony_ci * 4 bit htt_tx_tid_stats_tlv/htt_tx_tid_stats_v1_tlv 14938c2ecf20Sopenharmony_ci * 5 bit htt_rx_tid_stats_tlv 14948c2ecf20Sopenharmony_ci * 6 bit htt_msdu_flow_stats_tlv 14958c2ecf20Sopenharmony_ci * @config_param2: [Bit31 : Bit0] mac_addr31to0 14968c2ecf20Sopenharmony_ci * @config_param3: [Bit15 : Bit0] mac_addr47to32 14978c2ecf20Sopenharmony_ci * [Bit31 : Bit16] reserved 14988c2ecf20Sopenharmony_ci */ 14998c2ecf20Sopenharmony_ci#define HTT_STAT_PEER_INFO_MAC_ADDR BIT(0) 15008c2ecf20Sopenharmony_ci#define HTT_STAT_DEFAULT_PEER_REQ_TYPE 0x7f 15018c2ecf20Sopenharmony_ci 15028c2ecf20Sopenharmony_ci/* Used to set different configs to the specified stats type.*/ 15038c2ecf20Sopenharmony_cistruct htt_ext_stats_cfg_params { 15048c2ecf20Sopenharmony_ci u32 cfg0; 15058c2ecf20Sopenharmony_ci u32 cfg1; 15068c2ecf20Sopenharmony_ci u32 cfg2; 15078c2ecf20Sopenharmony_ci u32 cfg3; 15088c2ecf20Sopenharmony_ci}; 15098c2ecf20Sopenharmony_ci 15108c2ecf20Sopenharmony_ci/** 15118c2ecf20Sopenharmony_ci * @brief target -> host extended statistics upload 15128c2ecf20Sopenharmony_ci * 15138c2ecf20Sopenharmony_ci * @details 15148c2ecf20Sopenharmony_ci * The following field definitions describe the format of the HTT target 15158c2ecf20Sopenharmony_ci * to host stats upload confirmation message. 15168c2ecf20Sopenharmony_ci * The message contains a cookie echoed from the HTT host->target stats 15178c2ecf20Sopenharmony_ci * upload request, which identifies which request the confirmation is 15188c2ecf20Sopenharmony_ci * for, and a single stats can span over multiple HTT stats indication 15198c2ecf20Sopenharmony_ci * due to the HTT message size limitation so every HTT ext stats indication 15208c2ecf20Sopenharmony_ci * will have tag-length-value stats information elements. 15218c2ecf20Sopenharmony_ci * The tag-length header for each HTT stats IND message also includes a 15228c2ecf20Sopenharmony_ci * status field, to indicate whether the request for the stat type in 15238c2ecf20Sopenharmony_ci * question was fully met, partially met, unable to be met, or invalid 15248c2ecf20Sopenharmony_ci * (if the stat type in question is disabled in the target). 15258c2ecf20Sopenharmony_ci * A Done bit 1's indicate the end of the of stats info elements. 15268c2ecf20Sopenharmony_ci * 15278c2ecf20Sopenharmony_ci * 15288c2ecf20Sopenharmony_ci * |31 16|15 12|11|10 8|7 5|4 0| 15298c2ecf20Sopenharmony_ci * |--------------------------------------------------------------| 15308c2ecf20Sopenharmony_ci * | reserved | msg type | 15318c2ecf20Sopenharmony_ci * |--------------------------------------------------------------| 15328c2ecf20Sopenharmony_ci * | cookie LSBs | 15338c2ecf20Sopenharmony_ci * |--------------------------------------------------------------| 15348c2ecf20Sopenharmony_ci * | cookie MSBs | 15358c2ecf20Sopenharmony_ci * |--------------------------------------------------------------| 15368c2ecf20Sopenharmony_ci * | stats entry length | rsvd | D| S | stat type | 15378c2ecf20Sopenharmony_ci * |--------------------------------------------------------------| 15388c2ecf20Sopenharmony_ci * | type-specific stats info | 15398c2ecf20Sopenharmony_ci * | (see htt_stats.h) | 15408c2ecf20Sopenharmony_ci * |--------------------------------------------------------------| 15418c2ecf20Sopenharmony_ci * Header fields: 15428c2ecf20Sopenharmony_ci * - MSG_TYPE 15438c2ecf20Sopenharmony_ci * Bits 7:0 15448c2ecf20Sopenharmony_ci * Purpose: Identifies this is a extended statistics upload confirmation 15458c2ecf20Sopenharmony_ci * message. 15468c2ecf20Sopenharmony_ci * Value: 0x1c 15478c2ecf20Sopenharmony_ci * - COOKIE_LSBS 15488c2ecf20Sopenharmony_ci * Bits 31:0 15498c2ecf20Sopenharmony_ci * Purpose: Provide a mechanism to match a target->host stats confirmation 15508c2ecf20Sopenharmony_ci * message with its preceding host->target stats request message. 15518c2ecf20Sopenharmony_ci * Value: LSBs of the opaque cookie specified by the host-side requestor 15528c2ecf20Sopenharmony_ci * - COOKIE_MSBS 15538c2ecf20Sopenharmony_ci * Bits 31:0 15548c2ecf20Sopenharmony_ci * Purpose: Provide a mechanism to match a target->host stats confirmation 15558c2ecf20Sopenharmony_ci * message with its preceding host->target stats request message. 15568c2ecf20Sopenharmony_ci * Value: MSBs of the opaque cookie specified by the host-side requestor 15578c2ecf20Sopenharmony_ci * 15588c2ecf20Sopenharmony_ci * Stats Information Element tag-length header fields: 15598c2ecf20Sopenharmony_ci * - STAT_TYPE 15608c2ecf20Sopenharmony_ci * Bits 7:0 15618c2ecf20Sopenharmony_ci * Purpose: identifies the type of statistics info held in the 15628c2ecf20Sopenharmony_ci * following information element 15638c2ecf20Sopenharmony_ci * Value: htt_dbg_ext_stats_type 15648c2ecf20Sopenharmony_ci * - STATUS 15658c2ecf20Sopenharmony_ci * Bits 10:8 15668c2ecf20Sopenharmony_ci * Purpose: indicate whether the requested stats are present 15678c2ecf20Sopenharmony_ci * Value: htt_dbg_ext_stats_status 15688c2ecf20Sopenharmony_ci * - DONE 15698c2ecf20Sopenharmony_ci * Bits 11 15708c2ecf20Sopenharmony_ci * Purpose: 15718c2ecf20Sopenharmony_ci * Indicates the completion of the stats entry, this will be the last 15728c2ecf20Sopenharmony_ci * stats conf HTT segment for the requested stats type. 15738c2ecf20Sopenharmony_ci * Value: 15748c2ecf20Sopenharmony_ci * 0 -> the stats retrieval is ongoing 15758c2ecf20Sopenharmony_ci * 1 -> the stats retrieval is complete 15768c2ecf20Sopenharmony_ci * - LENGTH 15778c2ecf20Sopenharmony_ci * Bits 31:16 15788c2ecf20Sopenharmony_ci * Purpose: indicate the stats information size 15798c2ecf20Sopenharmony_ci * Value: This field specifies the number of bytes of stats information 15808c2ecf20Sopenharmony_ci * that follows the element tag-length header. 15818c2ecf20Sopenharmony_ci * It is expected but not required that this length is a multiple of 15828c2ecf20Sopenharmony_ci * 4 bytes. 15838c2ecf20Sopenharmony_ci */ 15848c2ecf20Sopenharmony_ci 15858c2ecf20Sopenharmony_ci#define HTT_T2H_EXT_STATS_INFO1_DONE BIT(11) 15868c2ecf20Sopenharmony_ci#define HTT_T2H_EXT_STATS_INFO1_LENGTH GENMASK(31, 16) 15878c2ecf20Sopenharmony_ci 15888c2ecf20Sopenharmony_cistruct ath11k_htt_extd_stats_msg { 15898c2ecf20Sopenharmony_ci u32 info0; 15908c2ecf20Sopenharmony_ci u64 cookie; 15918c2ecf20Sopenharmony_ci u32 info1; 15928c2ecf20Sopenharmony_ci u8 data[0]; 15938c2ecf20Sopenharmony_ci} __packed; 15948c2ecf20Sopenharmony_ci 15958c2ecf20Sopenharmony_cistruct htt_mac_addr { 15968c2ecf20Sopenharmony_ci u32 mac_addr_l32; 15978c2ecf20Sopenharmony_ci u32 mac_addr_h16; 15988c2ecf20Sopenharmony_ci}; 15998c2ecf20Sopenharmony_ci 16008c2ecf20Sopenharmony_cistatic inline void ath11k_dp_get_mac_addr(u32 addr_l32, u16 addr_h16, u8 *addr) 16018c2ecf20Sopenharmony_ci{ 16028c2ecf20Sopenharmony_ci if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) { 16038c2ecf20Sopenharmony_ci addr_l32 = swab32(addr_l32); 16048c2ecf20Sopenharmony_ci addr_h16 = swab16(addr_h16); 16058c2ecf20Sopenharmony_ci } 16068c2ecf20Sopenharmony_ci 16078c2ecf20Sopenharmony_ci memcpy(addr, &addr_l32, 4); 16088c2ecf20Sopenharmony_ci memcpy(addr + 4, &addr_h16, ETH_ALEN - 4); 16098c2ecf20Sopenharmony_ci} 16108c2ecf20Sopenharmony_ci 16118c2ecf20Sopenharmony_ciint ath11k_dp_service_srng(struct ath11k_base *ab, 16128c2ecf20Sopenharmony_ci struct ath11k_ext_irq_grp *irq_grp, 16138c2ecf20Sopenharmony_ci int budget); 16148c2ecf20Sopenharmony_ciint ath11k_dp_htt_connect(struct ath11k_dp *dp); 16158c2ecf20Sopenharmony_civoid ath11k_dp_vdev_tx_attach(struct ath11k *ar, struct ath11k_vif *arvif); 16168c2ecf20Sopenharmony_civoid ath11k_dp_free(struct ath11k_base *ab); 16178c2ecf20Sopenharmony_ciint ath11k_dp_alloc(struct ath11k_base *ab); 16188c2ecf20Sopenharmony_ciint ath11k_dp_pdev_alloc(struct ath11k_base *ab); 16198c2ecf20Sopenharmony_civoid ath11k_dp_pdev_pre_alloc(struct ath11k_base *ab); 16208c2ecf20Sopenharmony_civoid ath11k_dp_pdev_free(struct ath11k_base *ab); 16218c2ecf20Sopenharmony_ciint ath11k_dp_tx_htt_srng_setup(struct ath11k_base *ab, u32 ring_id, 16228c2ecf20Sopenharmony_ci int mac_id, enum hal_ring_type ring_type); 16238c2ecf20Sopenharmony_ciint ath11k_dp_peer_setup(struct ath11k *ar, int vdev_id, const u8 *addr); 16248c2ecf20Sopenharmony_civoid ath11k_dp_peer_cleanup(struct ath11k *ar, int vdev_id, const u8 *addr); 16258c2ecf20Sopenharmony_civoid ath11k_dp_srng_cleanup(struct ath11k_base *ab, struct dp_srng *ring); 16268c2ecf20Sopenharmony_ciint ath11k_dp_srng_setup(struct ath11k_base *ab, struct dp_srng *ring, 16278c2ecf20Sopenharmony_ci enum hal_ring_type type, int ring_num, 16288c2ecf20Sopenharmony_ci int mac_id, int num_entries); 16298c2ecf20Sopenharmony_civoid ath11k_dp_link_desc_cleanup(struct ath11k_base *ab, 16308c2ecf20Sopenharmony_ci struct dp_link_desc_bank *desc_bank, 16318c2ecf20Sopenharmony_ci u32 ring_type, struct dp_srng *ring); 16328c2ecf20Sopenharmony_ciint ath11k_dp_link_desc_setup(struct ath11k_base *ab, 16338c2ecf20Sopenharmony_ci struct dp_link_desc_bank *link_desc_banks, 16348c2ecf20Sopenharmony_ci u32 ring_type, struct hal_srng *srng, 16358c2ecf20Sopenharmony_ci u32 n_link_desc); 16368c2ecf20Sopenharmony_civoid ath11k_dp_shadow_start_timer(struct ath11k_base *ab, 16378c2ecf20Sopenharmony_ci struct hal_srng *srng, 16388c2ecf20Sopenharmony_ci struct ath11k_hp_update_timer *update_timer); 16398c2ecf20Sopenharmony_civoid ath11k_dp_shadow_stop_timer(struct ath11k_base *ab, 16408c2ecf20Sopenharmony_ci struct ath11k_hp_update_timer *update_timer); 16418c2ecf20Sopenharmony_civoid ath11k_dp_shadow_init_timer(struct ath11k_base *ab, 16428c2ecf20Sopenharmony_ci struct ath11k_hp_update_timer *update_timer, 16438c2ecf20Sopenharmony_ci u32 interval, u32 ring_id); 16448c2ecf20Sopenharmony_ci 16458c2ecf20Sopenharmony_ci#endif 1646