xref: /openbmc/linux/drivers/net/wireless/ath/ath11k/hal_desc.h (revision 7e24a55b2122746c2eef192296fc84624354f895)
1d5c65159SKalle Valo /* SPDX-License-Identifier: BSD-3-Clause-Clear */
2d5c65159SKalle Valo /*
3d5c65159SKalle Valo  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4*586c7fb1SJeff Johnson  * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
5d5c65159SKalle Valo  */
627143fa9SGovind Singh #include "core.h"
727143fa9SGovind Singh 
8d5c65159SKalle Valo #ifndef ATH11K_HAL_DESC_H
9d5c65159SKalle Valo #define ATH11K_HAL_DESC_H
10d5c65159SKalle Valo 
11d5c65159SKalle Valo #define BUFFER_ADDR_INFO0_ADDR         GENMASK(31, 0)
12d5c65159SKalle Valo 
13d5c65159SKalle Valo #define BUFFER_ADDR_INFO1_ADDR         GENMASK(7, 0)
14d5c65159SKalle Valo #define BUFFER_ADDR_INFO1_RET_BUF_MGR  GENMASK(10, 8)
15d5c65159SKalle Valo #define BUFFER_ADDR_INFO1_SW_COOKIE    GENMASK(31, 11)
16d5c65159SKalle Valo 
17d5c65159SKalle Valo struct ath11k_buffer_addr {
18d5c65159SKalle Valo 	u32 info0;
19d5c65159SKalle Valo 	u32 info1;
20d5c65159SKalle Valo } __packed;
21d5c65159SKalle Valo 
22d5c65159SKalle Valo /* ath11k_buffer_addr
23d5c65159SKalle Valo  *
24d5c65159SKalle Valo  * info0
25d5c65159SKalle Valo  *		Address (lower 32 bits) of the msdu buffer or msdu extension
26d5c65159SKalle Valo  *		descriptor or Link descriptor
27d5c65159SKalle Valo  *
28d5c65159SKalle Valo  * addr
29d5c65159SKalle Valo  *		Address (upper 8 bits) of the msdu buffer or msdu extension
30d5c65159SKalle Valo  *		descriptor or Link descriptor
31d5c65159SKalle Valo  *
32d5c65159SKalle Valo  * return_buffer_manager (RBM)
33d5c65159SKalle Valo  *		Consumer: WBM
34d5c65159SKalle Valo  *		Producer: SW/FW
35d5c65159SKalle Valo  *		Indicates to which buffer manager the buffer or MSDU_EXTENSION
36d5c65159SKalle Valo  *		descriptor or link descriptor that is being pointed to shall be
37d5c65159SKalle Valo  *		returned after the frame has been processed. It is used by WBM
38d5c65159SKalle Valo  *		for routing purposes.
39d5c65159SKalle Valo  *
40d5c65159SKalle Valo  *		Values are defined in enum %HAL_RX_BUF_RBM_
41d5c65159SKalle Valo  *
42d5c65159SKalle Valo  * sw_buffer_cookie
43d5c65159SKalle Valo  *		Cookie field exclusively used by SW. HW ignores the contents,
44d5c65159SKalle Valo  *		accept that it passes the programmed value on to other
45d5c65159SKalle Valo  *		descriptors together with the physical address.
46d5c65159SKalle Valo  *
47d5c65159SKalle Valo  *		Field can be used by SW to for example associate the buffers
48d5c65159SKalle Valo  *		physical address with the virtual address.
49d5c65159SKalle Valo  */
50d5c65159SKalle Valo 
51d5c65159SKalle Valo enum hal_tlv_tag {
52d5c65159SKalle Valo 	HAL_MACTX_CBF_START                    =   0 /* 0x0 */,
53d5c65159SKalle Valo 	HAL_PHYRX_DATA                         =   1 /* 0x1 */,
54d5c65159SKalle Valo 	HAL_PHYRX_CBF_DATA_RESP                =   2 /* 0x2 */,
55d5c65159SKalle Valo 	HAL_PHYRX_ABORT_REQUEST                =   3 /* 0x3 */,
56d5c65159SKalle Valo 	HAL_PHYRX_USER_ABORT_NOTIFICATION      =   4 /* 0x4 */,
57d5c65159SKalle Valo 	HAL_MACTX_DATA_RESP                    =   5 /* 0x5 */,
58d5c65159SKalle Valo 	HAL_MACTX_CBF_DATA                     =   6 /* 0x6 */,
59d5c65159SKalle Valo 	HAL_MACTX_CBF_DONE                     =   7 /* 0x7 */,
60d5c65159SKalle Valo 	HAL_MACRX_CBF_READ_REQUEST             =   8 /* 0x8 */,
61d5c65159SKalle Valo 	HAL_MACRX_CBF_DATA_REQUEST             =   9 /* 0x9 */,
62d5c65159SKalle Valo 	HAL_MACRX_EXPECT_NDP_RECEPTION         =  10 /* 0xa */,
63d5c65159SKalle Valo 	HAL_MACRX_FREEZE_CAPTURE_CHANNEL       =  11 /* 0xb */,
64d5c65159SKalle Valo 	HAL_MACRX_NDP_TIMEOUT                  =  12 /* 0xc */,
65d5c65159SKalle Valo 	HAL_MACRX_ABORT_ACK                    =  13 /* 0xd */,
66d5c65159SKalle Valo 	HAL_MACRX_REQ_IMPLICIT_FB              =  14 /* 0xe */,
67d5c65159SKalle Valo 	HAL_MACRX_CHAIN_MASK                   =  15 /* 0xf */,
68d5c65159SKalle Valo 	HAL_MACRX_NAP_USER                     =  16 /* 0x10 */,
69d5c65159SKalle Valo 	HAL_MACRX_ABORT_REQUEST                =  17 /* 0x11 */,
70d5c65159SKalle Valo 	HAL_PHYTX_OTHER_TRANSMIT_INFO16        =  18 /* 0x12 */,
71d5c65159SKalle Valo 	HAL_PHYTX_ABORT_ACK                    =  19 /* 0x13 */,
72d5c65159SKalle Valo 	HAL_PHYTX_ABORT_REQUEST                =  20 /* 0x14 */,
73d5c65159SKalle Valo 	HAL_PHYTX_PKT_END                      =  21 /* 0x15 */,
74d5c65159SKalle Valo 	HAL_PHYTX_PPDU_HEADER_INFO_REQUEST     =  22 /* 0x16 */,
75d5c65159SKalle Valo 	HAL_PHYTX_REQUEST_CTRL_INFO            =  23 /* 0x17 */,
76d5c65159SKalle Valo 	HAL_PHYTX_DATA_REQUEST                 =  24 /* 0x18 */,
77d5c65159SKalle Valo 	HAL_PHYTX_BF_CV_LOADING_DONE           =  25 /* 0x19 */,
78d5c65159SKalle Valo 	HAL_PHYTX_NAP_ACK                      =  26 /* 0x1a */,
79d5c65159SKalle Valo 	HAL_PHYTX_NAP_DONE                     =  27 /* 0x1b */,
80d5c65159SKalle Valo 	HAL_PHYTX_OFF_ACK                      =  28 /* 0x1c */,
81d5c65159SKalle Valo 	HAL_PHYTX_ON_ACK                       =  29 /* 0x1d */,
82d5c65159SKalle Valo 	HAL_PHYTX_SYNTH_OFF_ACK                =  30 /* 0x1e */,
83d5c65159SKalle Valo 	HAL_PHYTX_DEBUG16                      =  31 /* 0x1f */,
84d5c65159SKalle Valo 	HAL_MACTX_ABORT_REQUEST                =  32 /* 0x20 */,
85d5c65159SKalle Valo 	HAL_MACTX_ABORT_ACK                    =  33 /* 0x21 */,
86d5c65159SKalle Valo 	HAL_MACTX_PKT_END                      =  34 /* 0x22 */,
87d5c65159SKalle Valo 	HAL_MACTX_PRE_PHY_DESC                 =  35 /* 0x23 */,
88d5c65159SKalle Valo 	HAL_MACTX_BF_PARAMS_COMMON             =  36 /* 0x24 */,
89d5c65159SKalle Valo 	HAL_MACTX_BF_PARAMS_PER_USER           =  37 /* 0x25 */,
90d5c65159SKalle Valo 	HAL_MACTX_PREFETCH_CV                  =  38 /* 0x26 */,
91d5c65159SKalle Valo 	HAL_MACTX_USER_DESC_COMMON             =  39 /* 0x27 */,
92d5c65159SKalle Valo 	HAL_MACTX_USER_DESC_PER_USER           =  40 /* 0x28 */,
93d5c65159SKalle Valo 	HAL_EXAMPLE_USER_TLV_16                =  41 /* 0x29 */,
94d5c65159SKalle Valo 	HAL_EXAMPLE_TLV_16                     =  42 /* 0x2a */,
95d5c65159SKalle Valo 	HAL_MACTX_PHY_OFF                      =  43 /* 0x2b */,
96d5c65159SKalle Valo 	HAL_MACTX_PHY_ON                       =  44 /* 0x2c */,
97d5c65159SKalle Valo 	HAL_MACTX_SYNTH_OFF                    =  45 /* 0x2d */,
98d5c65159SKalle Valo 	HAL_MACTX_EXPECT_CBF_COMMON            =  46 /* 0x2e */,
99d5c65159SKalle Valo 	HAL_MACTX_EXPECT_CBF_PER_USER          =  47 /* 0x2f */,
100d5c65159SKalle Valo 	HAL_MACTX_PHY_DESC                     =  48 /* 0x30 */,
101d5c65159SKalle Valo 	HAL_MACTX_L_SIG_A                      =  49 /* 0x31 */,
102d5c65159SKalle Valo 	HAL_MACTX_L_SIG_B                      =  50 /* 0x32 */,
103d5c65159SKalle Valo 	HAL_MACTX_HT_SIG                       =  51 /* 0x33 */,
104d5c65159SKalle Valo 	HAL_MACTX_VHT_SIG_A                    =  52 /* 0x34 */,
105d5c65159SKalle Valo 	HAL_MACTX_VHT_SIG_B_SU20               =  53 /* 0x35 */,
106d5c65159SKalle Valo 	HAL_MACTX_VHT_SIG_B_SU40               =  54 /* 0x36 */,
107d5c65159SKalle Valo 	HAL_MACTX_VHT_SIG_B_SU80               =  55 /* 0x37 */,
108d5c65159SKalle Valo 	HAL_MACTX_VHT_SIG_B_SU160              =  56 /* 0x38 */,
109d5c65159SKalle Valo 	HAL_MACTX_VHT_SIG_B_MU20               =  57 /* 0x39 */,
110d5c65159SKalle Valo 	HAL_MACTX_VHT_SIG_B_MU40               =  58 /* 0x3a */,
111d5c65159SKalle Valo 	HAL_MACTX_VHT_SIG_B_MU80               =  59 /* 0x3b */,
112d5c65159SKalle Valo 	HAL_MACTX_VHT_SIG_B_MU160              =  60 /* 0x3c */,
113d5c65159SKalle Valo 	HAL_MACTX_SERVICE                      =  61 /* 0x3d */,
114d5c65159SKalle Valo 	HAL_MACTX_HE_SIG_A_SU                  =  62 /* 0x3e */,
115d5c65159SKalle Valo 	HAL_MACTX_HE_SIG_A_MU_DL               =  63 /* 0x3f */,
116d5c65159SKalle Valo 	HAL_MACTX_HE_SIG_A_MU_UL               =  64 /* 0x40 */,
117d5c65159SKalle Valo 	HAL_MACTX_HE_SIG_B1_MU                 =  65 /* 0x41 */,
118d5c65159SKalle Valo 	HAL_MACTX_HE_SIG_B2_MU                 =  66 /* 0x42 */,
119d5c65159SKalle Valo 	HAL_MACTX_HE_SIG_B2_OFDMA              =  67 /* 0x43 */,
120d5c65159SKalle Valo 	HAL_MACTX_DELETE_CV                    =  68 /* 0x44 */,
121d5c65159SKalle Valo 	HAL_MACTX_MU_UPLINK_COMMON             =  69 /* 0x45 */,
122d5c65159SKalle Valo 	HAL_MACTX_MU_UPLINK_USER_SETUP         =  70 /* 0x46 */,
123d5c65159SKalle Valo 	HAL_MACTX_OTHER_TRANSMIT_INFO          =  71 /* 0x47 */,
124d5c65159SKalle Valo 	HAL_MACTX_PHY_NAP                      =  72 /* 0x48 */,
125d5c65159SKalle Valo 	HAL_MACTX_DEBUG                        =  73 /* 0x49 */,
126d5c65159SKalle Valo 	HAL_PHYRX_ABORT_ACK                    =  74 /* 0x4a */,
127d5c65159SKalle Valo 	HAL_PHYRX_GENERATED_CBF_DETAILS        =  75 /* 0x4b */,
128d5c65159SKalle Valo 	HAL_PHYRX_RSSI_LEGACY                  =  76 /* 0x4c */,
129d5c65159SKalle Valo 	HAL_PHYRX_RSSI_HT                      =  77 /* 0x4d */,
130d5c65159SKalle Valo 	HAL_PHYRX_USER_INFO                    =  78 /* 0x4e */,
131d5c65159SKalle Valo 	HAL_PHYRX_PKT_END                      =  79 /* 0x4f */,
132d5c65159SKalle Valo 	HAL_PHYRX_DEBUG                        =  80 /* 0x50 */,
133d5c65159SKalle Valo 	HAL_PHYRX_CBF_TRANSFER_DONE            =  81 /* 0x51 */,
134d5c65159SKalle Valo 	HAL_PHYRX_CBF_TRANSFER_ABORT           =  82 /* 0x52 */,
135d5c65159SKalle Valo 	HAL_PHYRX_L_SIG_A                      =  83 /* 0x53 */,
136d5c65159SKalle Valo 	HAL_PHYRX_L_SIG_B                      =  84 /* 0x54 */,
137d5c65159SKalle Valo 	HAL_PHYRX_HT_SIG                       =  85 /* 0x55 */,
138d5c65159SKalle Valo 	HAL_PHYRX_VHT_SIG_A                    =  86 /* 0x56 */,
139d5c65159SKalle Valo 	HAL_PHYRX_VHT_SIG_B_SU20               =  87 /* 0x57 */,
140d5c65159SKalle Valo 	HAL_PHYRX_VHT_SIG_B_SU40               =  88 /* 0x58 */,
141d5c65159SKalle Valo 	HAL_PHYRX_VHT_SIG_B_SU80               =  89 /* 0x59 */,
142d5c65159SKalle Valo 	HAL_PHYRX_VHT_SIG_B_SU160              =  90 /* 0x5a */,
143d5c65159SKalle Valo 	HAL_PHYRX_VHT_SIG_B_MU20               =  91 /* 0x5b */,
144d5c65159SKalle Valo 	HAL_PHYRX_VHT_SIG_B_MU40               =  92 /* 0x5c */,
145d5c65159SKalle Valo 	HAL_PHYRX_VHT_SIG_B_MU80               =  93 /* 0x5d */,
146d5c65159SKalle Valo 	HAL_PHYRX_VHT_SIG_B_MU160              =  94 /* 0x5e */,
147d5c65159SKalle Valo 	HAL_PHYRX_HE_SIG_A_SU                  =  95 /* 0x5f */,
148d5c65159SKalle Valo 	HAL_PHYRX_HE_SIG_A_MU_DL               =  96 /* 0x60 */,
149d5c65159SKalle Valo 	HAL_PHYRX_HE_SIG_A_MU_UL               =  97 /* 0x61 */,
150d5c65159SKalle Valo 	HAL_PHYRX_HE_SIG_B1_MU                 =  98 /* 0x62 */,
151d5c65159SKalle Valo 	HAL_PHYRX_HE_SIG_B2_MU                 =  99 /* 0x63 */,
152d5c65159SKalle Valo 	HAL_PHYRX_HE_SIG_B2_OFDMA              = 100 /* 0x64 */,
153d5c65159SKalle Valo 	HAL_PHYRX_OTHER_RECEIVE_INFO           = 101 /* 0x65 */,
154d5c65159SKalle Valo 	HAL_PHYRX_COMMON_USER_INFO             = 102 /* 0x66 */,
155d5c65159SKalle Valo 	HAL_PHYRX_DATA_DONE                    = 103 /* 0x67 */,
156d5c65159SKalle Valo 	HAL_RECEIVE_RSSI_INFO                  = 104 /* 0x68 */,
157d5c65159SKalle Valo 	HAL_RECEIVE_USER_INFO                  = 105 /* 0x69 */,
158d5c65159SKalle Valo 	HAL_MIMO_CONTROL_INFO                  = 106 /* 0x6a */,
159d5c65159SKalle Valo 	HAL_RX_LOCATION_INFO                   = 107 /* 0x6b */,
160d5c65159SKalle Valo 	HAL_COEX_TX_REQ                        = 108 /* 0x6c */,
161d5c65159SKalle Valo 	HAL_DUMMY                              = 109 /* 0x6d */,
162d5c65159SKalle Valo 	HAL_RX_TIMING_OFFSET_INFO              = 110 /* 0x6e */,
163d5c65159SKalle Valo 	HAL_EXAMPLE_TLV_32_NAME                = 111 /* 0x6f */,
164d5c65159SKalle Valo 	HAL_MPDU_LIMIT                         = 112 /* 0x70 */,
165d5c65159SKalle Valo 	HAL_NA_LENGTH_END                      = 113 /* 0x71 */,
166d5c65159SKalle Valo 	HAL_OLE_BUF_STATUS                     = 114 /* 0x72 */,
167d5c65159SKalle Valo 	HAL_PCU_PPDU_SETUP_DONE                = 115 /* 0x73 */,
168d5c65159SKalle Valo 	HAL_PCU_PPDU_SETUP_END                 = 116 /* 0x74 */,
169d5c65159SKalle Valo 	HAL_PCU_PPDU_SETUP_INIT                = 117 /* 0x75 */,
170d5c65159SKalle Valo 	HAL_PCU_PPDU_SETUP_START               = 118 /* 0x76 */,
171d5c65159SKalle Valo 	HAL_PDG_FES_SETUP                      = 119 /* 0x77 */,
172d5c65159SKalle Valo 	HAL_PDG_RESPONSE                       = 120 /* 0x78 */,
173d5c65159SKalle Valo 	HAL_PDG_TX_REQ                         = 121 /* 0x79 */,
174d5c65159SKalle Valo 	HAL_SCH_WAIT_INSTR                     = 122 /* 0x7a */,
175d5c65159SKalle Valo 	HAL_SCHEDULER_TLV                      = 123 /* 0x7b */,
176d5c65159SKalle Valo 	HAL_TQM_FLOW_EMPTY_STATUS              = 124 /* 0x7c */,
177d5c65159SKalle Valo 	HAL_TQM_FLOW_NOT_EMPTY_STATUS          = 125 /* 0x7d */,
178d5c65159SKalle Valo 	HAL_TQM_GEN_MPDU_LENGTH_LIST           = 126 /* 0x7e */,
179d5c65159SKalle Valo 	HAL_TQM_GEN_MPDU_LENGTH_LIST_STATUS    = 127 /* 0x7f */,
180d5c65159SKalle Valo 	HAL_TQM_GEN_MPDUS                      = 128 /* 0x80 */,
181d5c65159SKalle Valo 	HAL_TQM_GEN_MPDUS_STATUS               = 129 /* 0x81 */,
182d5c65159SKalle Valo 	HAL_TQM_REMOVE_MPDU                    = 130 /* 0x82 */,
183d5c65159SKalle Valo 	HAL_TQM_REMOVE_MPDU_STATUS             = 131 /* 0x83 */,
184d5c65159SKalle Valo 	HAL_TQM_REMOVE_MSDU                    = 132 /* 0x84 */,
185d5c65159SKalle Valo 	HAL_TQM_REMOVE_MSDU_STATUS             = 133 /* 0x85 */,
186d5c65159SKalle Valo 	HAL_TQM_UPDATE_TX_MPDU_COUNT           = 134 /* 0x86 */,
187d5c65159SKalle Valo 	HAL_TQM_WRITE_CMD                      = 135 /* 0x87 */,
188d5c65159SKalle Valo 	HAL_OFDMA_TRIGGER_DETAILS              = 136 /* 0x88 */,
189d5c65159SKalle Valo 	HAL_TX_DATA                            = 137 /* 0x89 */,
190d5c65159SKalle Valo 	HAL_TX_FES_SETUP                       = 138 /* 0x8a */,
191d5c65159SKalle Valo 	HAL_RX_PACKET                          = 139 /* 0x8b */,
192d5c65159SKalle Valo 	HAL_EXPECTED_RESPONSE                  = 140 /* 0x8c */,
193d5c65159SKalle Valo 	HAL_TX_MPDU_END                        = 141 /* 0x8d */,
194d5c65159SKalle Valo 	HAL_TX_MPDU_START                      = 142 /* 0x8e */,
195d5c65159SKalle Valo 	HAL_TX_MSDU_END                        = 143 /* 0x8f */,
196d5c65159SKalle Valo 	HAL_TX_MSDU_START                      = 144 /* 0x90 */,
197d5c65159SKalle Valo 	HAL_TX_SW_MODE_SETUP                   = 145 /* 0x91 */,
198d5c65159SKalle Valo 	HAL_TXPCU_BUFFER_STATUS                = 146 /* 0x92 */,
199d5c65159SKalle Valo 	HAL_TXPCU_USER_BUFFER_STATUS           = 147 /* 0x93 */,
200d5c65159SKalle Valo 	HAL_DATA_TO_TIME_CONFIG                = 148 /* 0x94 */,
201d5c65159SKalle Valo 	HAL_EXAMPLE_USER_TLV_32                = 149 /* 0x95 */,
202d5c65159SKalle Valo 	HAL_MPDU_INFO                          = 150 /* 0x96 */,
203d5c65159SKalle Valo 	HAL_PDG_USER_SETUP                     = 151 /* 0x97 */,
204d5c65159SKalle Valo 	HAL_TX_11AH_SETUP                      = 152 /* 0x98 */,
205d5c65159SKalle Valo 	HAL_REO_UPDATE_RX_REO_QUEUE_STATUS     = 153 /* 0x99 */,
206d5c65159SKalle Valo 	HAL_TX_PEER_ENTRY                      = 154 /* 0x9a */,
207d5c65159SKalle Valo 	HAL_TX_RAW_OR_NATIVE_FRAME_SETUP       = 155 /* 0x9b */,
208d5c65159SKalle Valo 	HAL_EXAMPLE_STRUCT_NAME                = 156 /* 0x9c */,
209d5c65159SKalle Valo 	HAL_PCU_PPDU_SETUP_END_INFO            = 157 /* 0x9d */,
210d5c65159SKalle Valo 	HAL_PPDU_RATE_SETTING                  = 158 /* 0x9e */,
211d5c65159SKalle Valo 	HAL_PROT_RATE_SETTING                  = 159 /* 0x9f */,
212d5c65159SKalle Valo 	HAL_RX_MPDU_DETAILS                    = 160 /* 0xa0 */,
213d5c65159SKalle Valo 	HAL_EXAMPLE_USER_TLV_42                = 161 /* 0xa1 */,
214d5c65159SKalle Valo 	HAL_RX_MSDU_LINK                       = 162 /* 0xa2 */,
215d5c65159SKalle Valo 	HAL_RX_REO_QUEUE                       = 163 /* 0xa3 */,
216d5c65159SKalle Valo 	HAL_ADDR_SEARCH_ENTRY                  = 164 /* 0xa4 */,
217d5c65159SKalle Valo 	HAL_SCHEDULER_CMD                      = 165 /* 0xa5 */,
218d5c65159SKalle Valo 	HAL_TX_FLUSH                           = 166 /* 0xa6 */,
219d5c65159SKalle Valo 	HAL_TQM_ENTRANCE_RING                  = 167 /* 0xa7 */,
220d5c65159SKalle Valo 	HAL_TX_DATA_WORD                       = 168 /* 0xa8 */,
221d5c65159SKalle Valo 	HAL_TX_MPDU_DETAILS                    = 169 /* 0xa9 */,
222d5c65159SKalle Valo 	HAL_TX_MPDU_LINK                       = 170 /* 0xaa */,
223d5c65159SKalle Valo 	HAL_TX_MPDU_LINK_PTR                   = 171 /* 0xab */,
224d5c65159SKalle Valo 	HAL_TX_MPDU_QUEUE_HEAD                 = 172 /* 0xac */,
225d5c65159SKalle Valo 	HAL_TX_MPDU_QUEUE_EXT                  = 173 /* 0xad */,
226d5c65159SKalle Valo 	HAL_TX_MPDU_QUEUE_EXT_PTR              = 174 /* 0xae */,
227d5c65159SKalle Valo 	HAL_TX_MSDU_DETAILS                    = 175 /* 0xaf */,
228d5c65159SKalle Valo 	HAL_TX_MSDU_EXTENSION                  = 176 /* 0xb0 */,
229d5c65159SKalle Valo 	HAL_TX_MSDU_FLOW                       = 177 /* 0xb1 */,
230d5c65159SKalle Valo 	HAL_TX_MSDU_LINK                       = 178 /* 0xb2 */,
231d5c65159SKalle Valo 	HAL_TX_MSDU_LINK_ENTRY_PTR             = 179 /* 0xb3 */,
232d5c65159SKalle Valo 	HAL_RESPONSE_RATE_SETTING              = 180 /* 0xb4 */,
233d5c65159SKalle Valo 	HAL_TXPCU_BUFFER_BASICS                = 181 /* 0xb5 */,
234d5c65159SKalle Valo 	HAL_UNIFORM_DESCRIPTOR_HEADER          = 182 /* 0xb6 */,
235d5c65159SKalle Valo 	HAL_UNIFORM_TQM_CMD_HEADER             = 183 /* 0xb7 */,
236d5c65159SKalle Valo 	HAL_UNIFORM_TQM_STATUS_HEADER          = 184 /* 0xb8 */,
237d5c65159SKalle Valo 	HAL_USER_RATE_SETTING                  = 185 /* 0xb9 */,
238d5c65159SKalle Valo 	HAL_WBM_BUFFER_RING                    = 186 /* 0xba */,
239d5c65159SKalle Valo 	HAL_WBM_LINK_DESCRIPTOR_RING           = 187 /* 0xbb */,
240d5c65159SKalle Valo 	HAL_WBM_RELEASE_RING                   = 188 /* 0xbc */,
241d5c65159SKalle Valo 	HAL_TX_FLUSH_REQ                       = 189 /* 0xbd */,
242d5c65159SKalle Valo 	HAL_RX_MSDU_DETAILS                    = 190 /* 0xbe */,
243d5c65159SKalle Valo 	HAL_TQM_WRITE_CMD_STATUS               = 191 /* 0xbf */,
244d5c65159SKalle Valo 	HAL_TQM_GET_MPDU_QUEUE_STATS           = 192 /* 0xc0 */,
245d5c65159SKalle Valo 	HAL_TQM_GET_MSDU_FLOW_STATS            = 193 /* 0xc1 */,
246d5c65159SKalle Valo 	HAL_EXAMPLE_USER_CTLV_32               = 194 /* 0xc2 */,
247d5c65159SKalle Valo 	HAL_TX_FES_STATUS_START                = 195 /* 0xc3 */,
248d5c65159SKalle Valo 	HAL_TX_FES_STATUS_USER_PPDU            = 196 /* 0xc4 */,
249d5c65159SKalle Valo 	HAL_TX_FES_STATUS_USER_RESPONSE        = 197 /* 0xc5 */,
250d5c65159SKalle Valo 	HAL_TX_FES_STATUS_END                  = 198 /* 0xc6 */,
251d5c65159SKalle Valo 	HAL_RX_TRIG_INFO                       = 199 /* 0xc7 */,
252d5c65159SKalle Valo 	HAL_RXPCU_TX_SETUP_CLEAR               = 200 /* 0xc8 */,
253d5c65159SKalle Valo 	HAL_RX_FRAME_BITMAP_REQ                = 201 /* 0xc9 */,
254d5c65159SKalle Valo 	HAL_RX_FRAME_BITMAP_ACK                = 202 /* 0xca */,
255d5c65159SKalle Valo 	HAL_COEX_RX_STATUS                     = 203 /* 0xcb */,
256d5c65159SKalle Valo 	HAL_RX_START_PARAM                     = 204 /* 0xcc */,
257d5c65159SKalle Valo 	HAL_RX_PPDU_START                      = 205 /* 0xcd */,
258d5c65159SKalle Valo 	HAL_RX_PPDU_END                        = 206 /* 0xce */,
259d5c65159SKalle Valo 	HAL_RX_MPDU_START                      = 207 /* 0xcf */,
260d5c65159SKalle Valo 	HAL_RX_MPDU_END                        = 208 /* 0xd0 */,
261d5c65159SKalle Valo 	HAL_RX_MSDU_START                      = 209 /* 0xd1 */,
262d5c65159SKalle Valo 	HAL_RX_MSDU_END                        = 210 /* 0xd2 */,
263d5c65159SKalle Valo 	HAL_RX_ATTENTION                       = 211 /* 0xd3 */,
264d5c65159SKalle Valo 	HAL_RECEIVED_RESPONSE_INFO             = 212 /* 0xd4 */,
265d5c65159SKalle Valo 	HAL_RX_PHY_SLEEP                       = 213 /* 0xd5 */,
266d5c65159SKalle Valo 	HAL_RX_HEADER                          = 214 /* 0xd6 */,
267d5c65159SKalle Valo 	HAL_RX_PEER_ENTRY                      = 215 /* 0xd7 */,
268d5c65159SKalle Valo 	HAL_RX_FLUSH                           = 216 /* 0xd8 */,
269d5c65159SKalle Valo 	HAL_RX_RESPONSE_REQUIRED_INFO          = 217 /* 0xd9 */,
270d5c65159SKalle Valo 	HAL_RX_FRAMELESS_BAR_DETAILS           = 218 /* 0xda */,
271d5c65159SKalle Valo 	HAL_TQM_GET_MPDU_QUEUE_STATS_STATUS    = 219 /* 0xdb */,
272d5c65159SKalle Valo 	HAL_TQM_GET_MSDU_FLOW_STATS_STATUS     = 220 /* 0xdc */,
273d5c65159SKalle Valo 	HAL_TX_CBF_INFO                        = 221 /* 0xdd */,
274d5c65159SKalle Valo 	HAL_PCU_PPDU_SETUP_USER                = 222 /* 0xde */,
275d5c65159SKalle Valo 	HAL_RX_MPDU_PCU_START                  = 223 /* 0xdf */,
276d5c65159SKalle Valo 	HAL_RX_PM_INFO                         = 224 /* 0xe0 */,
277d5c65159SKalle Valo 	HAL_RX_USER_PPDU_END                   = 225 /* 0xe1 */,
278d5c65159SKalle Valo 	HAL_RX_PRE_PPDU_START                  = 226 /* 0xe2 */,
279d5c65159SKalle Valo 	HAL_RX_PREAMBLE                        = 227 /* 0xe3 */,
280d5c65159SKalle Valo 	HAL_TX_FES_SETUP_COMPLETE              = 228 /* 0xe4 */,
281d5c65159SKalle Valo 	HAL_TX_LAST_MPDU_FETCHED               = 229 /* 0xe5 */,
282d5c65159SKalle Valo 	HAL_TXDMA_STOP_REQUEST                 = 230 /* 0xe6 */,
283d5c65159SKalle Valo 	HAL_RXPCU_SETUP                        = 231 /* 0xe7 */,
284d5c65159SKalle Valo 	HAL_RXPCU_USER_SETUP                   = 232 /* 0xe8 */,
285d5c65159SKalle Valo 	HAL_TX_FES_STATUS_ACK_OR_BA            = 233 /* 0xe9 */,
286d5c65159SKalle Valo 	HAL_TQM_ACKED_MPDU                     = 234 /* 0xea */,
287d5c65159SKalle Valo 	HAL_COEX_TX_RESP                       = 235 /* 0xeb */,
288d5c65159SKalle Valo 	HAL_COEX_TX_STATUS                     = 236 /* 0xec */,
289d5c65159SKalle Valo 	HAL_MACTX_COEX_PHY_CTRL                = 237 /* 0xed */,
290d5c65159SKalle Valo 	HAL_COEX_STATUS_BROADCAST              = 238 /* 0xee */,
291d5c65159SKalle Valo 	HAL_RESPONSE_START_STATUS              = 239 /* 0xef */,
292d5c65159SKalle Valo 	HAL_RESPONSE_END_STATUS                = 240 /* 0xf0 */,
293d5c65159SKalle Valo 	HAL_CRYPTO_STATUS                      = 241 /* 0xf1 */,
294d5c65159SKalle Valo 	HAL_RECEIVED_TRIGGER_INFO              = 242 /* 0xf2 */,
295d5c65159SKalle Valo 	HAL_REO_ENTRANCE_RING                  = 243 /* 0xf3 */,
296d5c65159SKalle Valo 	HAL_RX_MPDU_LINK                       = 244 /* 0xf4 */,
297d5c65159SKalle Valo 	HAL_COEX_TX_STOP_CTRL                  = 245 /* 0xf5 */,
298d5c65159SKalle Valo 	HAL_RX_PPDU_ACK_REPORT                 = 246 /* 0xf6 */,
299d5c65159SKalle Valo 	HAL_RX_PPDU_NO_ACK_REPORT              = 247 /* 0xf7 */,
300d5c65159SKalle Valo 	HAL_SCH_COEX_STATUS                    = 248 /* 0xf8 */,
301d5c65159SKalle Valo 	HAL_SCHEDULER_COMMAND_STATUS           = 249 /* 0xf9 */,
302d5c65159SKalle Valo 	HAL_SCHEDULER_RX_PPDU_NO_RESPONSE_STATUS = 250 /* 0xfa */,
303d5c65159SKalle Valo 	HAL_TX_FES_STATUS_PROT                 = 251 /* 0xfb */,
304d5c65159SKalle Valo 	HAL_TX_FES_STATUS_START_PPDU           = 252 /* 0xfc */,
305d5c65159SKalle Valo 	HAL_TX_FES_STATUS_START_PROT           = 253 /* 0xfd */,
306d5c65159SKalle Valo 	HAL_TXPCU_PHYTX_DEBUG32                = 254 /* 0xfe */,
307d5c65159SKalle Valo 	HAL_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32  = 255 /* 0xff */,
308d5c65159SKalle Valo 	HAL_TX_MPDU_COUNT_TRANSFER_END         = 256 /* 0x100 */,
309d5c65159SKalle Valo 	HAL_WHO_ANCHOR_OFFSET                  = 257 /* 0x101 */,
310d5c65159SKalle Valo 	HAL_WHO_ANCHOR_VALUE                   = 258 /* 0x102 */,
311d5c65159SKalle Valo 	HAL_WHO_CCE_INFO                       = 259 /* 0x103 */,
312d5c65159SKalle Valo 	HAL_WHO_COMMIT                         = 260 /* 0x104 */,
313d5c65159SKalle Valo 	HAL_WHO_COMMIT_DONE                    = 261 /* 0x105 */,
314d5c65159SKalle Valo 	HAL_WHO_FLUSH                          = 262 /* 0x106 */,
315d5c65159SKalle Valo 	HAL_WHO_L2_LLC                         = 263 /* 0x107 */,
316d5c65159SKalle Valo 	HAL_WHO_L2_PAYLOAD                     = 264 /* 0x108 */,
317d5c65159SKalle Valo 	HAL_WHO_L3_CHECKSUM                    = 265 /* 0x109 */,
318d5c65159SKalle Valo 	HAL_WHO_L3_INFO                        = 266 /* 0x10a */,
319d5c65159SKalle Valo 	HAL_WHO_L4_CHECKSUM                    = 267 /* 0x10b */,
320d5c65159SKalle Valo 	HAL_WHO_L4_INFO                        = 268 /* 0x10c */,
321d5c65159SKalle Valo 	HAL_WHO_MSDU                           = 269 /* 0x10d */,
322d5c65159SKalle Valo 	HAL_WHO_MSDU_MISC                      = 270 /* 0x10e */,
323d5c65159SKalle Valo 	HAL_WHO_PACKET_DATA                    = 271 /* 0x10f */,
324d5c65159SKalle Valo 	HAL_WHO_PACKET_HDR                     = 272 /* 0x110 */,
325d5c65159SKalle Valo 	HAL_WHO_PPDU_END                       = 273 /* 0x111 */,
326d5c65159SKalle Valo 	HAL_WHO_PPDU_START                     = 274 /* 0x112 */,
327d5c65159SKalle Valo 	HAL_WHO_TSO                            = 275 /* 0x113 */,
328d5c65159SKalle Valo 	HAL_WHO_WMAC_HEADER_PV0                = 276 /* 0x114 */,
329d5c65159SKalle Valo 	HAL_WHO_WMAC_HEADER_PV1                = 277 /* 0x115 */,
330d5c65159SKalle Valo 	HAL_WHO_WMAC_IV                        = 278 /* 0x116 */,
331d5c65159SKalle Valo 	HAL_MPDU_INFO_END                      = 279 /* 0x117 */,
332d5c65159SKalle Valo 	HAL_MPDU_INFO_BITMAP                   = 280 /* 0x118 */,
333d5c65159SKalle Valo 	HAL_TX_QUEUE_EXTENSION                 = 281 /* 0x119 */,
334d5c65159SKalle Valo 	HAL_RX_PEER_ENTRY_DETAILS              = 282 /* 0x11a */,
335d5c65159SKalle Valo 	HAL_RX_REO_QUEUE_REFERENCE             = 283 /* 0x11b */,
336d5c65159SKalle Valo 	HAL_RX_REO_QUEUE_EXT                   = 284 /* 0x11c */,
337d5c65159SKalle Valo 	HAL_SCHEDULER_SELFGEN_RESPONSE_STATUS  = 285 /* 0x11d */,
338d5c65159SKalle Valo 	HAL_TQM_UPDATE_TX_MPDU_COUNT_STATUS    = 286 /* 0x11e */,
339d5c65159SKalle Valo 	HAL_TQM_ACKED_MPDU_STATUS              = 287 /* 0x11f */,
340d5c65159SKalle Valo 	HAL_TQM_ADD_MSDU_STATUS                = 288 /* 0x120 */,
341d5c65159SKalle Valo 	HAL_RX_MPDU_LINK_PTR                   = 289 /* 0x121 */,
342d5c65159SKalle Valo 	HAL_REO_DESTINATION_RING               = 290 /* 0x122 */,
343d5c65159SKalle Valo 	HAL_TQM_LIST_GEN_DONE                  = 291 /* 0x123 */,
344d5c65159SKalle Valo 	HAL_WHO_TERMINATE                      = 292 /* 0x124 */,
345d5c65159SKalle Valo 	HAL_TX_LAST_MPDU_END                   = 293 /* 0x125 */,
346d5c65159SKalle Valo 	HAL_TX_CV_DATA                         = 294 /* 0x126 */,
347d5c65159SKalle Valo 	HAL_TCL_ENTRANCE_FROM_PPE_RING         = 295 /* 0x127 */,
348d5c65159SKalle Valo 	HAL_PPDU_TX_END                        = 296 /* 0x128 */,
349d5c65159SKalle Valo 	HAL_PROT_TX_END                        = 297 /* 0x129 */,
350d5c65159SKalle Valo 	HAL_PDG_RESPONSE_RATE_SETTING          = 298 /* 0x12a */,
351d5c65159SKalle Valo 	HAL_MPDU_INFO_GLOBAL_END               = 299 /* 0x12b */,
352d5c65159SKalle Valo 	HAL_TQM_SCH_INSTR_GLOBAL_END           = 300 /* 0x12c */,
353d5c65159SKalle Valo 	HAL_RX_PPDU_END_USER_STATS             = 301 /* 0x12d */,
354d5c65159SKalle Valo 	HAL_RX_PPDU_END_USER_STATS_EXT         = 302 /* 0x12e */,
355d5c65159SKalle Valo 	HAL_NO_ACK_REPORT                      = 303 /* 0x12f */,
356d5c65159SKalle Valo 	HAL_ACK_REPORT                         = 304 /* 0x130 */,
357d5c65159SKalle Valo 	HAL_UNIFORM_REO_CMD_HEADER             = 305 /* 0x131 */,
358d5c65159SKalle Valo 	HAL_REO_GET_QUEUE_STATS                = 306 /* 0x132 */,
359d5c65159SKalle Valo 	HAL_REO_FLUSH_QUEUE                    = 307 /* 0x133 */,
360d5c65159SKalle Valo 	HAL_REO_FLUSH_CACHE                    = 308 /* 0x134 */,
361d5c65159SKalle Valo 	HAL_REO_UNBLOCK_CACHE                  = 309 /* 0x135 */,
362d5c65159SKalle Valo 	HAL_UNIFORM_REO_STATUS_HEADER          = 310 /* 0x136 */,
363d5c65159SKalle Valo 	HAL_REO_GET_QUEUE_STATS_STATUS         = 311 /* 0x137 */,
364d5c65159SKalle Valo 	HAL_REO_FLUSH_QUEUE_STATUS             = 312 /* 0x138 */,
365d5c65159SKalle Valo 	HAL_REO_FLUSH_CACHE_STATUS             = 313 /* 0x139 */,
366d5c65159SKalle Valo 	HAL_REO_UNBLOCK_CACHE_STATUS           = 314 /* 0x13a */,
367d5c65159SKalle Valo 	HAL_TQM_FLUSH_CACHE                    = 315 /* 0x13b */,
368d5c65159SKalle Valo 	HAL_TQM_UNBLOCK_CACHE                  = 316 /* 0x13c */,
369d5c65159SKalle Valo 	HAL_TQM_FLUSH_CACHE_STATUS             = 317 /* 0x13d */,
370d5c65159SKalle Valo 	HAL_TQM_UNBLOCK_CACHE_STATUS           = 318 /* 0x13e */,
371d5c65159SKalle Valo 	HAL_RX_PPDU_END_STATUS_DONE            = 319 /* 0x13f */,
372d5c65159SKalle Valo 	HAL_RX_STATUS_BUFFER_DONE              = 320 /* 0x140 */,
373d5c65159SKalle Valo 	HAL_BUFFER_ADDR_INFO                   = 321 /* 0x141 */,
374d5c65159SKalle Valo 	HAL_RX_MSDU_DESC_INFO                  = 322 /* 0x142 */,
375d5c65159SKalle Valo 	HAL_RX_MPDU_DESC_INFO                  = 323 /* 0x143 */,
376d5c65159SKalle Valo 	HAL_TCL_DATA_CMD                       = 324 /* 0x144 */,
377d5c65159SKalle Valo 	HAL_TCL_GSE_CMD                        = 325 /* 0x145 */,
378d5c65159SKalle Valo 	HAL_TCL_EXIT_BASE                      = 326 /* 0x146 */,
379d5c65159SKalle Valo 	HAL_TCL_COMPACT_EXIT_RING              = 327 /* 0x147 */,
380d5c65159SKalle Valo 	HAL_TCL_REGULAR_EXIT_RING              = 328 /* 0x148 */,
381d5c65159SKalle Valo 	HAL_TCL_EXTENDED_EXIT_RING             = 329 /* 0x149 */,
382d5c65159SKalle Valo 	HAL_UPLINK_COMMON_INFO                 = 330 /* 0x14a */,
383d5c65159SKalle Valo 	HAL_UPLINK_USER_SETUP_INFO             = 331 /* 0x14b */,
384d5c65159SKalle Valo 	HAL_TX_DATA_SYNC                       = 332 /* 0x14c */,
385d5c65159SKalle Valo 	HAL_PHYRX_CBF_READ_REQUEST_ACK         = 333 /* 0x14d */,
386d5c65159SKalle Valo 	HAL_TCL_STATUS_RING                    = 334 /* 0x14e */,
387d5c65159SKalle Valo 	HAL_TQM_GET_MPDU_HEAD_INFO             = 335 /* 0x14f */,
388d5c65159SKalle Valo 	HAL_TQM_SYNC_CMD                       = 336 /* 0x150 */,
389d5c65159SKalle Valo 	HAL_TQM_GET_MPDU_HEAD_INFO_STATUS      = 337 /* 0x151 */,
390d5c65159SKalle Valo 	HAL_TQM_SYNC_CMD_STATUS                = 338 /* 0x152 */,
391d5c65159SKalle Valo 	HAL_TQM_THRESHOLD_DROP_NOTIFICATION_STATUS = 339 /* 0x153 */,
392d5c65159SKalle Valo 	HAL_TQM_DESCRIPTOR_THRESHOLD_REACHED_STATUS = 340 /* 0x154 */,
393d5c65159SKalle Valo 	HAL_REO_FLUSH_TIMEOUT_LIST             = 341 /* 0x155 */,
394d5c65159SKalle Valo 	HAL_REO_FLUSH_TIMEOUT_LIST_STATUS      = 342 /* 0x156 */,
395d5c65159SKalle Valo 	HAL_REO_TO_PPE_RING                    = 343 /* 0x157 */,
396d5c65159SKalle Valo 	HAL_RX_MPDU_INFO                       = 344 /* 0x158 */,
397d5c65159SKalle Valo 	HAL_REO_DESCRIPTOR_THRESHOLD_REACHED_STATUS = 345 /* 0x159 */,
398d5c65159SKalle Valo 	HAL_SCHEDULER_RX_SIFS_RESPONSE_TRIGGER_STATUS = 346 /* 0x15a */,
399d5c65159SKalle Valo 	HAL_EXAMPLE_USER_TLV_32_NAME           = 347 /* 0x15b */,
400d5c65159SKalle Valo 	HAL_RX_PPDU_START_USER_INFO            = 348 /* 0x15c */,
401d5c65159SKalle Valo 	HAL_RX_RXPCU_CLASSIFICATION_OVERVIEW   = 349 /* 0x15d */,
402d5c65159SKalle Valo 	HAL_RX_RING_MASK                       = 350 /* 0x15e */,
403d5c65159SKalle Valo 	HAL_WHO_CLASSIFY_INFO                  = 351 /* 0x15f */,
404d5c65159SKalle Valo 	HAL_TXPT_CLASSIFY_INFO                 = 352 /* 0x160 */,
405d5c65159SKalle Valo 	HAL_RXPT_CLASSIFY_INFO                 = 353 /* 0x161 */,
406d5c65159SKalle Valo 	HAL_TX_FLOW_SEARCH_ENTRY               = 354 /* 0x162 */,
407d5c65159SKalle Valo 	HAL_RX_FLOW_SEARCH_ENTRY               = 355 /* 0x163 */,
408d5c65159SKalle Valo 	HAL_RECEIVED_TRIGGER_INFO_DETAILS      = 356 /* 0x164 */,
409d5c65159SKalle Valo 	HAL_COEX_MAC_NAP                       = 357 /* 0x165 */,
410d5c65159SKalle Valo 	HAL_MACRX_ABORT_REQUEST_INFO           = 358 /* 0x166 */,
411d5c65159SKalle Valo 	HAL_MACTX_ABORT_REQUEST_INFO           = 359 /* 0x167 */,
412d5c65159SKalle Valo 	HAL_PHYRX_ABORT_REQUEST_INFO           = 360 /* 0x168 */,
413d5c65159SKalle Valo 	HAL_PHYTX_ABORT_REQUEST_INFO           = 361 /* 0x169 */,
414d5c65159SKalle Valo 	HAL_RXPCU_PPDU_END_INFO                = 362 /* 0x16a */,
415d5c65159SKalle Valo 	HAL_WHO_MESH_CONTROL                   = 363 /* 0x16b */,
416d5c65159SKalle Valo 	HAL_L_SIG_A_INFO                       = 364 /* 0x16c */,
417d5c65159SKalle Valo 	HAL_L_SIG_B_INFO                       = 365 /* 0x16d */,
418d5c65159SKalle Valo 	HAL_HT_SIG_INFO                        = 366 /* 0x16e */,
419d5c65159SKalle Valo 	HAL_VHT_SIG_A_INFO                     = 367 /* 0x16f */,
420d5c65159SKalle Valo 	HAL_VHT_SIG_B_SU20_INFO                = 368 /* 0x170 */,
421d5c65159SKalle Valo 	HAL_VHT_SIG_B_SU40_INFO                = 369 /* 0x171 */,
422d5c65159SKalle Valo 	HAL_VHT_SIG_B_SU80_INFO                = 370 /* 0x172 */,
423d5c65159SKalle Valo 	HAL_VHT_SIG_B_SU160_INFO               = 371 /* 0x173 */,
424d5c65159SKalle Valo 	HAL_VHT_SIG_B_MU20_INFO                = 372 /* 0x174 */,
425d5c65159SKalle Valo 	HAL_VHT_SIG_B_MU40_INFO                = 373 /* 0x175 */,
426d5c65159SKalle Valo 	HAL_VHT_SIG_B_MU80_INFO                = 374 /* 0x176 */,
427d5c65159SKalle Valo 	HAL_VHT_SIG_B_MU160_INFO               = 375 /* 0x177 */,
428d5c65159SKalle Valo 	HAL_SERVICE_INFO                       = 376 /* 0x178 */,
429d5c65159SKalle Valo 	HAL_HE_SIG_A_SU_INFO                   = 377 /* 0x179 */,
430d5c65159SKalle Valo 	HAL_HE_SIG_A_MU_DL_INFO                = 378 /* 0x17a */,
431d5c65159SKalle Valo 	HAL_HE_SIG_A_MU_UL_INFO                = 379 /* 0x17b */,
432d5c65159SKalle Valo 	HAL_HE_SIG_B1_MU_INFO                  = 380 /* 0x17c */,
433d5c65159SKalle Valo 	HAL_HE_SIG_B2_MU_INFO                  = 381 /* 0x17d */,
434d5c65159SKalle Valo 	HAL_HE_SIG_B2_OFDMA_INFO               = 382 /* 0x17e */,
435d5c65159SKalle Valo 	HAL_PDG_SW_MODE_BW_START               = 383 /* 0x17f */,
436d5c65159SKalle Valo 	HAL_PDG_SW_MODE_BW_END                 = 384 /* 0x180 */,
437d5c65159SKalle Valo 	HAL_PDG_WAIT_FOR_MAC_REQUEST           = 385 /* 0x181 */,
438d5c65159SKalle Valo 	HAL_PDG_WAIT_FOR_PHY_REQUEST           = 386 /* 0x182 */,
439d5c65159SKalle Valo 	HAL_SCHEDULER_END                      = 387 /* 0x183 */,
440d5c65159SKalle Valo 	HAL_PEER_TABLE_ENTRY                   = 388 /* 0x184 */,
441d5c65159SKalle Valo 	HAL_SW_PEER_INFO                       = 389 /* 0x185 */,
442d5c65159SKalle Valo 	HAL_RXOLE_CCE_CLASSIFY_INFO            = 390 /* 0x186 */,
443d5c65159SKalle Valo 	HAL_TCL_CCE_CLASSIFY_INFO              = 391 /* 0x187 */,
444d5c65159SKalle Valo 	HAL_RXOLE_CCE_INFO                     = 392 /* 0x188 */,
445d5c65159SKalle Valo 	HAL_TCL_CCE_INFO                       = 393 /* 0x189 */,
446d5c65159SKalle Valo 	HAL_TCL_CCE_SUPERRULE                  = 394 /* 0x18a */,
447d5c65159SKalle Valo 	HAL_CCE_RULE                           = 395 /* 0x18b */,
448d5c65159SKalle Valo 	HAL_RX_PPDU_START_DROPPED              = 396 /* 0x18c */,
449d5c65159SKalle Valo 	HAL_RX_PPDU_END_DROPPED                = 397 /* 0x18d */,
450d5c65159SKalle Valo 	HAL_RX_PPDU_END_STATUS_DONE_DROPPED    = 398 /* 0x18e */,
451d5c65159SKalle Valo 	HAL_RX_MPDU_START_DROPPED              = 399 /* 0x18f */,
452d5c65159SKalle Valo 	HAL_RX_MSDU_START_DROPPED              = 400 /* 0x190 */,
453d5c65159SKalle Valo 	HAL_RX_MSDU_END_DROPPED                = 401 /* 0x191 */,
454d5c65159SKalle Valo 	HAL_RX_MPDU_END_DROPPED                = 402 /* 0x192 */,
455d5c65159SKalle Valo 	HAL_RX_ATTENTION_DROPPED               = 403 /* 0x193 */,
456d5c65159SKalle Valo 	HAL_TXPCU_USER_SETUP                   = 404 /* 0x194 */,
457d5c65159SKalle Valo 	HAL_RXPCU_USER_SETUP_EXT               = 405 /* 0x195 */,
458d5c65159SKalle Valo 	HAL_CE_SRC_DESC                        = 406 /* 0x196 */,
459d5c65159SKalle Valo 	HAL_CE_STAT_DESC                       = 407 /* 0x197 */,
460d5c65159SKalle Valo 	HAL_RXOLE_CCE_SUPERRULE                = 408 /* 0x198 */,
461d5c65159SKalle Valo 	HAL_TX_RATE_STATS_INFO                 = 409 /* 0x199 */,
462d5c65159SKalle Valo 	HAL_CMD_PART_0_END                     = 410 /* 0x19a */,
463d5c65159SKalle Valo 	HAL_MACTX_SYNTH_ON                     = 411 /* 0x19b */,
464d5c65159SKalle Valo 	HAL_SCH_CRITICAL_TLV_REFERENCE         = 412 /* 0x19c */,
465d5c65159SKalle Valo 	HAL_TQM_MPDU_GLOBAL_START              = 413 /* 0x19d */,
466d5c65159SKalle Valo 	HAL_EXAMPLE_TLV_32                     = 414 /* 0x19e */,
467d5c65159SKalle Valo 	HAL_TQM_UPDATE_TX_MSDU_FLOW            = 415 /* 0x19f */,
468d5c65159SKalle Valo 	HAL_TQM_UPDATE_TX_MPDU_QUEUE_HEAD      = 416 /* 0x1a0 */,
469d5c65159SKalle Valo 	HAL_TQM_UPDATE_TX_MSDU_FLOW_STATUS     = 417 /* 0x1a1 */,
470d5c65159SKalle Valo 	HAL_TQM_UPDATE_TX_MPDU_QUEUE_HEAD_STATUS = 418 /* 0x1a2 */,
471d5c65159SKalle Valo 	HAL_REO_UPDATE_RX_REO_QUEUE            = 419 /* 0x1a3 */,
472d5c65159SKalle Valo 	HAL_CE_DST_DESC			       = 420 /* 0x1a4 */,
473d5c65159SKalle Valo 	HAL_TLV_BASE                           = 511 /* 0x1ff */,
474d5c65159SKalle Valo };
475d5c65159SKalle Valo 
476d5c65159SKalle Valo #define HAL_TLV_HDR_TAG		GENMASK(9, 1)
477d5c65159SKalle Valo #define HAL_TLV_HDR_LEN		GENMASK(25, 10)
47801d2f285SPradeep Kumar Chitrapu #define HAL_TLV_USR_ID		GENMASK(31, 26)
479d5c65159SKalle Valo 
480d5c65159SKalle Valo #define HAL_TLV_ALIGN	4
481d5c65159SKalle Valo 
482d5c65159SKalle Valo struct hal_tlv_hdr {
483d5c65159SKalle Valo 	u32 tl;
48414dd3a71SGustavo A. R. Silva 	u8 value[];
485d5c65159SKalle Valo } __packed;
486d5c65159SKalle Valo 
487d5c65159SKalle Valo #define RX_MPDU_DESC_INFO0_MSDU_COUNT		GENMASK(7, 0)
488d5c65159SKalle Valo #define RX_MPDU_DESC_INFO0_SEQ_NUM		GENMASK(19, 8)
489d5c65159SKalle Valo #define RX_MPDU_DESC_INFO0_FRAG_FLAG		BIT(20)
490d5c65159SKalle Valo #define RX_MPDU_DESC_INFO0_MPDU_RETRY		BIT(21)
491d5c65159SKalle Valo #define RX_MPDU_DESC_INFO0_AMPDU_FLAG		BIT(22)
492d5c65159SKalle Valo #define RX_MPDU_DESC_INFO0_BAR_FRAME		BIT(23)
493d5c65159SKalle Valo #define RX_MPDU_DESC_INFO0_VALID_PN		BIT(24)
494d5c65159SKalle Valo #define RX_MPDU_DESC_INFO0_VALID_SA		BIT(25)
495d5c65159SKalle Valo #define RX_MPDU_DESC_INFO0_SA_IDX_TIMEOUT	BIT(26)
496d5c65159SKalle Valo #define RX_MPDU_DESC_INFO0_VALID_DA		BIT(27)
497d5c65159SKalle Valo #define RX_MPDU_DESC_INFO0_DA_MCBC		BIT(28)
498d5c65159SKalle Valo #define RX_MPDU_DESC_INFO0_DA_IDX_TIMEOUT	BIT(29)
499d5c65159SKalle Valo #define RX_MPDU_DESC_INFO0_RAW_MPDU		BIT(30)
500d5c65159SKalle Valo 
5012167fa60SSriram R #define RX_MPDU_DESC_META_DATA_PEER_ID		GENMASK(15, 0)
5022167fa60SSriram R 
503d5c65159SKalle Valo struct rx_mpdu_desc {
504d5c65159SKalle Valo 	u32 info0; /* %RX_MPDU_DESC_INFO */
505d5c65159SKalle Valo 	u32 meta_data;
506d5c65159SKalle Valo } __packed;
507d5c65159SKalle Valo 
508d5c65159SKalle Valo /* rx_mpdu_desc
509d5c65159SKalle Valo  *		Producer: RXDMA
510d5c65159SKalle Valo  *		Consumer: REO/SW/FW
511d5c65159SKalle Valo  *
512d5c65159SKalle Valo  * msdu_count
513d5c65159SKalle Valo  *		The number of MSDUs within the MPDU
514d5c65159SKalle Valo  *
515d5c65159SKalle Valo  * mpdu_sequence_number
516d5c65159SKalle Valo  *		The field can have two different meanings based on the setting
517d5c65159SKalle Valo  *		of field 'bar_frame'. If 'bar_frame' is set, it means the MPDU
518d5c65159SKalle Valo  *		start sequence number from the BAR frame otherwise it means
519d5c65159SKalle Valo  *		the MPDU sequence number of the received frame.
520d5c65159SKalle Valo  *
521d5c65159SKalle Valo  * fragment_flag
522d5c65159SKalle Valo  *		When set, this MPDU is a fragment and REO should forward this
523d5c65159SKalle Valo  *		fragment MPDU to the REO destination ring without any reorder
524d5c65159SKalle Valo  *		checks, pn checks or bitmap update. This implies that REO is
525d5c65159SKalle Valo  *		forwarding the pointer to the MSDU link descriptor.
526d5c65159SKalle Valo  *
527d5c65159SKalle Valo  * mpdu_retry_bit
528d5c65159SKalle Valo  *		The retry bit setting from the MPDU header of the received frame
529d5c65159SKalle Valo  *
530d5c65159SKalle Valo  * ampdu_flag
531d5c65159SKalle Valo  *		Indicates the MPDU was received as part of an A-MPDU.
532d5c65159SKalle Valo  *
533d5c65159SKalle Valo  * bar_frame
534d5c65159SKalle Valo  *		Indicates the received frame is a BAR frame. After processing,
535d5c65159SKalle Valo  *		this frame shall be pushed to SW or deleted.
536d5c65159SKalle Valo  *
537d5c65159SKalle Valo  * valid_pn
538d5c65159SKalle Valo  *		When not set, REO will not perform a PN sequence number check.
539d5c65159SKalle Valo  *
540d5c65159SKalle Valo  * valid_sa
541d5c65159SKalle Valo  *		Indicates OLE found a valid SA entry for all MSDUs in this MPDU.
542d5c65159SKalle Valo  *
543d5c65159SKalle Valo  * sa_idx_timeout
544d5c65159SKalle Valo  *		Indicates, at least 1 MSDU within the MPDU has an unsuccessful
545d5c65159SKalle Valo  *		MAC source address search due to the expiration of search timer.
546d5c65159SKalle Valo  *
547d5c65159SKalle Valo  * valid_da
548d5c65159SKalle Valo  *		When set, OLE found a valid DA entry for all MSDUs in this MPDU.
549d5c65159SKalle Valo  *
550d5c65159SKalle Valo  * da_mcbc
551d5c65159SKalle Valo  *		Field Only valid if valid_da is set. Indicates at least one of
552d5c65159SKalle Valo  *		the DA addresses is a Multicast or Broadcast address.
553d5c65159SKalle Valo  *
554d5c65159SKalle Valo  * da_idx_timeout
555d5c65159SKalle Valo  *		Indicates, at least 1 MSDU within the MPDU has an unsuccessful
556d5c65159SKalle Valo  *		MAC destination address search due to the expiration of search
557d5c65159SKalle Valo  *		timer.
558d5c65159SKalle Valo  *
559d5c65159SKalle Valo  * raw_mpdu
560d5c65159SKalle Valo  *		Field only valid when first_msdu_in_mpdu_flag is set. Indicates
561d5c65159SKalle Valo  *		the contents in the MSDU buffer contains a 'RAW' MPDU.
562d5c65159SKalle Valo  */
563d5c65159SKalle Valo 
564d5c65159SKalle Valo enum hal_rx_msdu_desc_reo_dest_ind {
565d5c65159SKalle Valo 	HAL_RX_MSDU_DESC_REO_DEST_IND_TCL,
566d5c65159SKalle Valo 	HAL_RX_MSDU_DESC_REO_DEST_IND_SW1,
567d5c65159SKalle Valo 	HAL_RX_MSDU_DESC_REO_DEST_IND_SW2,
568d5c65159SKalle Valo 	HAL_RX_MSDU_DESC_REO_DEST_IND_SW3,
569d5c65159SKalle Valo 	HAL_RX_MSDU_DESC_REO_DEST_IND_SW4,
570d5c65159SKalle Valo 	HAL_RX_MSDU_DESC_REO_DEST_IND_RELEASE,
571d5c65159SKalle Valo 	HAL_RX_MSDU_DESC_REO_DEST_IND_FW,
572d5c65159SKalle Valo };
573d5c65159SKalle Valo 
574d5c65159SKalle Valo #define RX_MSDU_DESC_INFO0_FIRST_MSDU_IN_MPDU	BIT(0)
575d5c65159SKalle Valo #define RX_MSDU_DESC_INFO0_LAST_MSDU_IN_MPDU	BIT(1)
576d5c65159SKalle Valo #define RX_MSDU_DESC_INFO0_MSDU_CONTINUATION	BIT(2)
577d5c65159SKalle Valo #define RX_MSDU_DESC_INFO0_MSDU_LENGTH		GENMASK(16, 3)
578d5c65159SKalle Valo #define RX_MSDU_DESC_INFO0_REO_DEST_IND		GENMASK(21, 17)
579d5c65159SKalle Valo #define RX_MSDU_DESC_INFO0_MSDU_DROP		BIT(22)
580d5c65159SKalle Valo #define RX_MSDU_DESC_INFO0_VALID_SA		BIT(23)
581d5c65159SKalle Valo #define RX_MSDU_DESC_INFO0_SA_IDX_TIMEOUT	BIT(24)
582d5c65159SKalle Valo #define RX_MSDU_DESC_INFO0_VALID_DA		BIT(25)
583d5c65159SKalle Valo #define RX_MSDU_DESC_INFO0_DA_MCBC		BIT(26)
584d5c65159SKalle Valo #define RX_MSDU_DESC_INFO0_DA_IDX_TIMEOUT	BIT(27)
585d5c65159SKalle Valo 
586d5c65159SKalle Valo #define HAL_RX_MSDU_PKT_LENGTH_GET(val)		\
587d5c65159SKalle Valo 	(FIELD_GET(RX_MSDU_DESC_INFO0_MSDU_LENGTH, (val)))
588d5c65159SKalle Valo 
589d5c65159SKalle Valo struct rx_msdu_desc {
590d5c65159SKalle Valo 	u32 info0;
591d5c65159SKalle Valo 	u32 rsvd0;
592d5c65159SKalle Valo } __packed;
593d5c65159SKalle Valo 
594d5c65159SKalle Valo /* rx_msdu_desc
595d5c65159SKalle Valo  *
596d5c65159SKalle Valo  * first_msdu_in_mpdu
597d5c65159SKalle Valo  *		Indicates first msdu in mpdu.
598d5c65159SKalle Valo  *
599d5c65159SKalle Valo  * last_msdu_in_mpdu
600d5c65159SKalle Valo  *		Indicates last msdu in mpdu. This flag can be true only when
601d5c65159SKalle Valo  *		'Msdu_continuation' set to 0. This implies that when an msdu
602d5c65159SKalle Valo  *		is spread out over multiple buffers and thus msdu_continuation
603d5c65159SKalle Valo  *		is set, only for the very last buffer of the msdu, can the
604d5c65159SKalle Valo  *		'last_msdu_in_mpdu' be set.
605d5c65159SKalle Valo  *
606d5c65159SKalle Valo  *		When both first_msdu_in_mpdu and last_msdu_in_mpdu are set,
607d5c65159SKalle Valo  *		the MPDU that this MSDU belongs to only contains a single MSDU.
608d5c65159SKalle Valo  *
609d5c65159SKalle Valo  * msdu_continuation
610d5c65159SKalle Valo  *		When set, this MSDU buffer was not able to hold the entire MSDU.
6113fecca0eSJeff Johnson  *		The next buffer will therefore contain additional information
612d5c65159SKalle Valo  *		related to this MSDU.
613d5c65159SKalle Valo  *
614d5c65159SKalle Valo  * msdu_length
615d5c65159SKalle Valo  *		Field is only valid in combination with the 'first_msdu_in_mpdu'
616d5c65159SKalle Valo  *		being set. Full MSDU length in bytes after decapsulation. This
617d5c65159SKalle Valo  *		field is still valid for MPDU frames without A-MSDU. It still
618d5c65159SKalle Valo  *		represents MSDU length after decapsulation Or in case of RAW
619d5c65159SKalle Valo  *		MPDUs, it indicates the length of the entire MPDU (without FCS
620d5c65159SKalle Valo  *		field).
621d5c65159SKalle Valo  *
622d5c65159SKalle Valo  * reo_destination_indication
623d5c65159SKalle Valo  *		The id of the reo exit ring where the msdu frame shall push
624d5c65159SKalle Valo  *		after (MPDU level) reordering has finished. Values are defined
625d5c65159SKalle Valo  *		in enum %HAL_RX_MSDU_DESC_REO_DEST_IND_.
626d5c65159SKalle Valo  *
627d5c65159SKalle Valo  * msdu_drop
628d5c65159SKalle Valo  *		Indicates that REO shall drop this MSDU and not forward it to
629d5c65159SKalle Valo  *		any other ring.
630d5c65159SKalle Valo  *
631d5c65159SKalle Valo  * valid_sa
632d5c65159SKalle Valo  *		Indicates OLE found a valid SA entry for this MSDU.
633d5c65159SKalle Valo  *
634d5c65159SKalle Valo  * sa_idx_timeout
635d5c65159SKalle Valo  *		Indicates, an unsuccessful MAC source address search due to
636d5c65159SKalle Valo  *		the expiration of search timer for this MSDU.
637d5c65159SKalle Valo  *
638d5c65159SKalle Valo  * valid_da
639d5c65159SKalle Valo  *		When set, OLE found a valid DA entry for this MSDU.
640d5c65159SKalle Valo  *
641d5c65159SKalle Valo  * da_mcbc
642d5c65159SKalle Valo  *		Field Only valid if valid_da is set. Indicates the DA address
643d5c65159SKalle Valo  *		is a Multicast or Broadcast address for this MSDU.
644d5c65159SKalle Valo  *
645d5c65159SKalle Valo  * da_idx_timeout
646d5c65159SKalle Valo  *		Indicates, an unsuccessful MAC destination address search due
6473fecca0eSJeff Johnson  *		to the expiration of search timer for this MSDU.
648d5c65159SKalle Valo  */
649d5c65159SKalle Valo 
650d5c65159SKalle Valo enum hal_reo_dest_ring_buffer_type {
651d5c65159SKalle Valo 	HAL_REO_DEST_RING_BUFFER_TYPE_MSDU,
652d5c65159SKalle Valo 	HAL_REO_DEST_RING_BUFFER_TYPE_LINK_DESC,
653d5c65159SKalle Valo };
654d5c65159SKalle Valo 
655d5c65159SKalle Valo enum hal_reo_dest_ring_push_reason {
656d5c65159SKalle Valo 	HAL_REO_DEST_RING_PUSH_REASON_ERR_DETECTED,
657d5c65159SKalle Valo 	HAL_REO_DEST_RING_PUSH_REASON_ROUTING_INSTRUCTION,
658d5c65159SKalle Valo };
659d5c65159SKalle Valo 
660d5c65159SKalle Valo enum hal_reo_dest_ring_error_code {
661d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_DESC_ADDR_ZERO,
662d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_DESC_INVALID,
663d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_AMPDU_IN_NON_BA,
664d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_NON_BA_DUPLICATE,
665d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_BA_DUPLICATE,
666d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_FRAME_2K_JUMP,
667d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_BAR_2K_JUMP,
668d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_FRAME_OOR,
669d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_BAR_OOR,
670d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_NO_BA_SESSION,
671d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_FRAME_SN_EQUALS_SSN,
672d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_PN_CHECK_FAILED,
673d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_2K_ERR_FLAG_SET,
674d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_PN_ERR_FLAG_SET,
675d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_DESC_BLOCKED,
676d5c65159SKalle Valo 	HAL_REO_DEST_RING_ERROR_CODE_MAX,
677d5c65159SKalle Valo };
678d5c65159SKalle Valo 
679d5c65159SKalle Valo #define HAL_REO_DEST_RING_INFO0_QUEUE_ADDR_HI		GENMASK(7, 0)
680d5c65159SKalle Valo #define HAL_REO_DEST_RING_INFO0_BUFFER_TYPE		BIT(8)
681d5c65159SKalle Valo #define HAL_REO_DEST_RING_INFO0_PUSH_REASON		GENMASK(10, 9)
682d5c65159SKalle Valo #define HAL_REO_DEST_RING_INFO0_ERROR_CODE		GENMASK(15, 11)
683d5c65159SKalle Valo #define HAL_REO_DEST_RING_INFO0_RX_QUEUE_NUM		GENMASK(31, 16)
684d5c65159SKalle Valo 
685d5c65159SKalle Valo #define HAL_REO_DEST_RING_INFO1_REORDER_INFO_VALID	BIT(0)
686d5c65159SKalle Valo #define HAL_REO_DEST_RING_INFO1_REORDER_OPCODE		GENMASK(4, 1)
687d5c65159SKalle Valo #define HAL_REO_DEST_RING_INFO1_REORDER_SLOT_IDX	GENMASK(12, 5)
688d5c65159SKalle Valo 
689d5c65159SKalle Valo #define HAL_REO_DEST_RING_INFO2_RING_ID			GENMASK(27, 20)
690d5c65159SKalle Valo #define HAL_REO_DEST_RING_INFO2_LOOPING_COUNT		GENMASK(31, 28)
691d5c65159SKalle Valo 
692d5c65159SKalle Valo struct hal_reo_dest_ring {
693d5c65159SKalle Valo 	struct ath11k_buffer_addr buf_addr_info;
694d5c65159SKalle Valo 	struct rx_mpdu_desc rx_mpdu_info;
695d5c65159SKalle Valo 	struct rx_msdu_desc rx_msdu_info;
696d5c65159SKalle Valo 	u32 queue_addr_lo;
697d5c65159SKalle Valo 	u32 info0; /* %HAL_REO_DEST_RING_INFO0_ */
698d5c65159SKalle Valo 	u32 info1; /* %HAL_REO_DEST_RING_INFO1_ */
699d5c65159SKalle Valo 	u32 rsvd0;
700d5c65159SKalle Valo 	u32 rsvd1;
701d5c65159SKalle Valo 	u32 rsvd2;
702d5c65159SKalle Valo 	u32 rsvd3;
703d5c65159SKalle Valo 	u32 rsvd4;
704d5c65159SKalle Valo 	u32 rsvd5;
705d5c65159SKalle Valo 	u32 info2; /* %HAL_REO_DEST_RING_INFO2_ */
706d5c65159SKalle Valo } __packed;
707d5c65159SKalle Valo 
708d5c65159SKalle Valo /* hal_reo_dest_ring
709d5c65159SKalle Valo  *
710d5c65159SKalle Valo  *		Producer: RXDMA
711d5c65159SKalle Valo  *		Consumer: REO/SW/FW
712d5c65159SKalle Valo  *
713d5c65159SKalle Valo  * buf_addr_info
714d5c65159SKalle Valo  *		Details of the physical address of a buffer or MSDU
715d5c65159SKalle Valo  *		link descriptor.
716d5c65159SKalle Valo  *
717d5c65159SKalle Valo  * rx_mpdu_info
718d5c65159SKalle Valo  *		General information related to the MPDU that is passed
719d5c65159SKalle Valo  *		on from REO entrance ring to the REO destination ring.
720d5c65159SKalle Valo  *
721d5c65159SKalle Valo  * rx_msdu_info
722d5c65159SKalle Valo  *		General information related to the MSDU that is passed
72316f283f0SKalle Valo  *		on from RXDMA all the way to the REO destination ring.
724d5c65159SKalle Valo  *
725d5c65159SKalle Valo  * queue_addr_lo
726d5c65159SKalle Valo  *		Address (lower 32 bits) of the REO queue descriptor.
727d5c65159SKalle Valo  *
728d5c65159SKalle Valo  * queue_addr_hi
729d5c65159SKalle Valo  *		Address (upper 8 bits) of the REO queue descriptor.
730d5c65159SKalle Valo  *
731d5c65159SKalle Valo  * buffer_type
732d5c65159SKalle Valo  *		Indicates the type of address provided in the buf_addr_info.
733d5c65159SKalle Valo  *		Values are defined in enum %HAL_REO_DEST_RING_BUFFER_TYPE_.
734d5c65159SKalle Valo  *
735d5c65159SKalle Valo  * push_reason
736d5c65159SKalle Valo  *		Reason for pushing this frame to this exit ring. Values are
737d5c65159SKalle Valo  *		defined in enum %HAL_REO_DEST_RING_PUSH_REASON_.
738d5c65159SKalle Valo  *
739d5c65159SKalle Valo  * error_code
740d5c65159SKalle Valo  *		Valid only when 'push_reason' is set. All error codes are
741d5c65159SKalle Valo  *		defined in enum %HAL_REO_DEST_RING_ERROR_CODE_.
742d5c65159SKalle Valo  *
743d5c65159SKalle Valo  * rx_queue_num
744d5c65159SKalle Valo  *		Indicates the REO MPDU reorder queue id from which this frame
745d5c65159SKalle Valo  *		originated.
746d5c65159SKalle Valo  *
747d5c65159SKalle Valo  * reorder_info_valid
748d5c65159SKalle Valo  *		When set, REO has been instructed to not perform the actual
749d5c65159SKalle Valo  *		re-ordering of frames for this queue, but just to insert
750d5c65159SKalle Valo  *		the reorder opcodes.
751d5c65159SKalle Valo  *
752d5c65159SKalle Valo  * reorder_opcode
753d5c65159SKalle Valo  *		Field is valid when 'reorder_info_valid' is set. This field is
754d5c65159SKalle Valo  *		always valid for debug purpose as well.
755d5c65159SKalle Valo  *
756d5c65159SKalle Valo  * reorder_slot_idx
757d5c65159SKalle Valo  *		Valid only when 'reorder_info_valid' is set.
758d5c65159SKalle Valo  *
759d5c65159SKalle Valo  * ring_id
760d5c65159SKalle Valo  *		The buffer pointer ring id.
761d5c65159SKalle Valo  *		0 - Idle ring
762d5c65159SKalle Valo  *		1 - N refers to other rings.
763d5c65159SKalle Valo  *
764d5c65159SKalle Valo  * looping_count
765d5c65159SKalle Valo  *		Indicates the number of times the producer of entries into
766d5c65159SKalle Valo  *		this ring has looped around the ring.
767d5c65159SKalle Valo  */
768d5c65159SKalle Valo 
769d5c65159SKalle Valo enum hal_reo_entr_rxdma_ecode {
770d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_OVERFLOW_ERR,
771d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_MPDU_LEN_ERR,
772d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_FCS_ERR,
773d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_DECRYPT_ERR,
774d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_TKIP_MIC_ERR,
775d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_UNECRYPTED_ERR,
776d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_MSDU_LEN_ERR,
777d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_MSDU_LIMIT_ERR,
778d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_WIFI_PARSE_ERR,
779d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_AMSDU_PARSE_ERR,
780d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_SA_TIMEOUT_ERR,
781d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_DA_TIMEOUT_ERR,
782d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_FLOW_TIMEOUT_ERR,
783d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_FLUSH_REQUEST_ERR,
784d5c65159SKalle Valo 	HAL_REO_ENTR_RING_RXDMA_ECODE_MAX,
785d5c65159SKalle Valo };
786d5c65159SKalle Valo 
787d5c65159SKalle Valo #define HAL_REO_ENTR_RING_INFO0_QUEUE_ADDR_HI		GENMASK(7, 0)
788d5c65159SKalle Valo #define HAL_REO_ENTR_RING_INFO0_MPDU_BYTE_COUNT		GENMASK(21, 8)
789d5c65159SKalle Valo #define HAL_REO_ENTR_RING_INFO0_DEST_IND		GENMASK(26, 22)
790d5c65159SKalle Valo #define HAL_REO_ENTR_RING_INFO0_FRAMELESS_BAR		BIT(27)
791d5c65159SKalle Valo 
792d5c65159SKalle Valo #define HAL_REO_ENTR_RING_INFO1_RXDMA_PUSH_REASON	GENMASK(1, 0)
793d5c65159SKalle Valo #define HAL_REO_ENTR_RING_INFO1_RXDMA_ERROR_CODE	GENMASK(6, 2)
794d5c65159SKalle Valo 
795d5c65159SKalle Valo struct hal_reo_entrance_ring {
796d5c65159SKalle Valo 	struct ath11k_buffer_addr buf_addr_info;
797d5c65159SKalle Valo 	struct rx_mpdu_desc rx_mpdu_info;
798d5c65159SKalle Valo 	u32 queue_addr_lo;
799d5c65159SKalle Valo 	u32 info0; /* %HAL_REO_ENTR_RING_INFO0_ */
800d5c65159SKalle Valo 	u32 info1; /* %HAL_REO_ENTR_RING_INFO1_ */
801d5c65159SKalle Valo 	u32 info2; /* %HAL_REO_DEST_RING_INFO2_ */
802d5c65159SKalle Valo 
803d5c65159SKalle Valo } __packed;
804d5c65159SKalle Valo 
805d5c65159SKalle Valo /* hal_reo_entrance_ring
806d5c65159SKalle Valo  *
807d5c65159SKalle Valo  *		Producer: RXDMA
808d5c65159SKalle Valo  *		Consumer: REO
809d5c65159SKalle Valo  *
810d5c65159SKalle Valo  * buf_addr_info
811d5c65159SKalle Valo  *		Details of the physical address of a buffer or MSDU
812d5c65159SKalle Valo  *		link descriptor.
813d5c65159SKalle Valo  *
814d5c65159SKalle Valo  * rx_mpdu_info
815d5c65159SKalle Valo  *		General information related to the MPDU that is passed
816d5c65159SKalle Valo  *		on from REO entrance ring to the REO destination ring.
817d5c65159SKalle Valo  *
818d5c65159SKalle Valo  * queue_addr_lo
819d5c65159SKalle Valo  *		Address (lower 32 bits) of the REO queue descriptor.
820d5c65159SKalle Valo  *
821d5c65159SKalle Valo  * queue_addr_hi
822d5c65159SKalle Valo  *		Address (upper 8 bits) of the REO queue descriptor.
823d5c65159SKalle Valo  *
824d5c65159SKalle Valo  * mpdu_byte_count
825d5c65159SKalle Valo  *		An approximation of the number of bytes received in this MPDU.
826d5c65159SKalle Valo  *		Used to keeps stats on the amount of data flowing
827d5c65159SKalle Valo  *		through a queue.
828d5c65159SKalle Valo  *
829d5c65159SKalle Valo  * reo_destination_indication
830d5c65159SKalle Valo  *		The id of the reo exit ring where the msdu frame shall push
831d5c65159SKalle Valo  *		after (MPDU level) reordering has finished. Values are defined
832d5c65159SKalle Valo  *		in enum %HAL_RX_MSDU_DESC_REO_DEST_IND_.
833d5c65159SKalle Valo  *
834d5c65159SKalle Valo  * frameless_bar
835d5c65159SKalle Valo  *		Indicates that this REO entrance ring struct contains BAR info
836d5c65159SKalle Valo  *		from a multi TID BAR frame. The original multi TID BAR frame
837d5c65159SKalle Valo  *		itself contained all the REO info for the first TID, but all
838d5c65159SKalle Valo  *		the subsequent TID info and their linkage to the REO descriptors
839d5c65159SKalle Valo  *		is passed down as 'frameless' BAR info.
840d5c65159SKalle Valo  *
841d5c65159SKalle Valo  *		The only fields valid in this descriptor when this bit is set
842d5c65159SKalle Valo  *		are queue_addr_lo, queue_addr_hi, mpdu_sequence_number,
843d5c65159SKalle Valo  *		bar_frame and peer_meta_data.
844d5c65159SKalle Valo  *
845d5c65159SKalle Valo  * rxdma_push_reason
846d5c65159SKalle Valo  *		Reason for pushing this frame to this exit ring. Values are
847d5c65159SKalle Valo  *		defined in enum %HAL_REO_DEST_RING_PUSH_REASON_.
848d5c65159SKalle Valo  *
849d5c65159SKalle Valo  * rxdma_error_code
850d5c65159SKalle Valo  *		Valid only when 'push_reason' is set. All error codes are
851d5c65159SKalle Valo  *		defined in enum %HAL_REO_ENTR_RING_RXDMA_ECODE_.
852d5c65159SKalle Valo  *
853d5c65159SKalle Valo  * ring_id
854d5c65159SKalle Valo  *		The buffer pointer ring id.
855d5c65159SKalle Valo  *		0 - Idle ring
856d5c65159SKalle Valo  *		1 - N refers to other rings.
857d5c65159SKalle Valo  *
858d5c65159SKalle Valo  * looping_count
859d5c65159SKalle Valo  *		Indicates the number of times the producer of entries into
860d5c65159SKalle Valo  *		this ring has looped around the ring.
861d5c65159SKalle Valo  */
862d5c65159SKalle Valo 
86388ee00d1SAnilkumar Kolli #define HAL_SW_MON_RING_INFO0_RXDMA_PUSH_REASON	GENMASK(1, 0)
86488ee00d1SAnilkumar Kolli #define HAL_SW_MON_RING_INFO0_RXDMA_ERROR_CODE	GENMASK(6, 2)
86588ee00d1SAnilkumar Kolli #define HAL_SW_MON_RING_INFO0_MPDU_FRAG_NUMBER	GENMASK(10, 7)
86688ee00d1SAnilkumar Kolli #define HAL_SW_MON_RING_INFO0_FRAMELESS_BAR	BIT(11)
86788ee00d1SAnilkumar Kolli #define HAL_SW_MON_RING_INFO0_STATUS_BUF_CNT	GENMASK(15, 12)
86888ee00d1SAnilkumar Kolli #define HAL_SW_MON_RING_INFO0_END_OF_PPDU	BIT(16)
86988ee00d1SAnilkumar Kolli 
87088ee00d1SAnilkumar Kolli #define HAL_SW_MON_RING_INFO1_PHY_PPDU_ID	GENMASK(15, 0)
87188ee00d1SAnilkumar Kolli #define HAL_SW_MON_RING_INFO1_RING_ID		GENMASK(27, 20)
87288ee00d1SAnilkumar Kolli #define HAL_SW_MON_RING_INFO1_LOOPING_COUNT	GENMASK(31, 28)
87388ee00d1SAnilkumar Kolli 
87488ee00d1SAnilkumar Kolli struct hal_sw_monitor_ring {
87588ee00d1SAnilkumar Kolli 	struct ath11k_buffer_addr buf_addr_info;
87688ee00d1SAnilkumar Kolli 	struct rx_mpdu_desc rx_mpdu_info;
87788ee00d1SAnilkumar Kolli 	struct ath11k_buffer_addr status_buf_addr_info;
87888ee00d1SAnilkumar Kolli 	u32 info0;
87988ee00d1SAnilkumar Kolli 	u32 info1;
88088ee00d1SAnilkumar Kolli } __packed;
88188ee00d1SAnilkumar Kolli 
882d5c65159SKalle Valo #define HAL_REO_CMD_HDR_INFO0_CMD_NUMBER	GENMASK(15, 0)
883d5c65159SKalle Valo #define HAL_REO_CMD_HDR_INFO0_STATUS_REQUIRED	BIT(16)
884d5c65159SKalle Valo 
885d5c65159SKalle Valo struct hal_reo_cmd_hdr {
886d5c65159SKalle Valo 	u32 info0;
887d5c65159SKalle Valo } __packed;
888d5c65159SKalle Valo 
889d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_INFO0_QUEUE_ADDR_HI	GENMASK(7, 0)
890d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_INFO0_CLEAR_STATS	BIT(8)
891d5c65159SKalle Valo 
892d5c65159SKalle Valo struct hal_reo_get_queue_stats {
893d5c65159SKalle Valo 	struct hal_reo_cmd_hdr cmd;
894d5c65159SKalle Valo 	u32 queue_addr_lo;
895d5c65159SKalle Valo 	u32 info0;
896d5c65159SKalle Valo 	u32 rsvd0[6];
897d5c65159SKalle Valo } __packed;
898d5c65159SKalle Valo 
899d5c65159SKalle Valo /* hal_reo_get_queue_stats
900d5c65159SKalle Valo  *		Producer: SW
901d5c65159SKalle Valo  *		Consumer: REO
902d5c65159SKalle Valo  *
903d5c65159SKalle Valo  * cmd
904d5c65159SKalle Valo  *		Details for command execution tracking purposes.
905d5c65159SKalle Valo  *
906d5c65159SKalle Valo  * queue_addr_lo
907d5c65159SKalle Valo  *		Address (lower 32 bits) of the REO queue descriptor.
908d5c65159SKalle Valo  *
909d5c65159SKalle Valo  * queue_addr_hi
910d5c65159SKalle Valo  *		Address (upper 8 bits) of the REO queue descriptor.
911d5c65159SKalle Valo  *
912d5c65159SKalle Valo  * clear_stats
913d5c65159SKalle Valo  *		Clear stats settings. When set, Clear the stats after
914d5c65159SKalle Valo  *		generating the status.
915d5c65159SKalle Valo  *
916d5c65159SKalle Valo  *		Following stats will be cleared.
917d5c65159SKalle Valo  *		Timeout_count
918d5c65159SKalle Valo  *		Forward_due_to_bar_count
919d5c65159SKalle Valo  *		Duplicate_count
920d5c65159SKalle Valo  *		Frames_in_order_count
921d5c65159SKalle Valo  *		BAR_received_count
922d5c65159SKalle Valo  *		MPDU_Frames_processed_count
923d5c65159SKalle Valo  *		MSDU_Frames_processed_count
924d5c65159SKalle Valo  *		Total_processed_byte_count
925d5c65159SKalle Valo  *		Late_receive_MPDU_count
926d5c65159SKalle Valo  *		window_jump_2k
927d5c65159SKalle Valo  *		Hole_count
928d5c65159SKalle Valo  */
929d5c65159SKalle Valo 
930d5c65159SKalle Valo #define HAL_REO_FLUSH_QUEUE_INFO0_DESC_ADDR_HI		GENMASK(7, 0)
931d5c65159SKalle Valo #define HAL_REO_FLUSH_QUEUE_INFO0_BLOCK_DESC_ADDR	BIT(8)
932d5c65159SKalle Valo #define HAL_REO_FLUSH_QUEUE_INFO0_BLOCK_RESRC_IDX	GENMASK(10, 9)
933d5c65159SKalle Valo 
934d5c65159SKalle Valo struct hal_reo_flush_queue {
935d5c65159SKalle Valo 	struct hal_reo_cmd_hdr cmd;
936d5c65159SKalle Valo 	u32 desc_addr_lo;
937d5c65159SKalle Valo 	u32 info0;
938d5c65159SKalle Valo 	u32 rsvd0[6];
939d5c65159SKalle Valo } __packed;
940d5c65159SKalle Valo 
941d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_INFO0_CACHE_ADDR_HI		GENMASK(7, 0)
942d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_INFO0_FWD_ALL_MPDUS		BIT(8)
943d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_INFO0_RELEASE_BLOCK_IDX	BIT(9)
944d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_INFO0_BLOCK_RESRC_IDX	GENMASK(11, 10)
945d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_INFO0_FLUSH_WO_INVALIDATE	BIT(12)
946d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_INFO0_BLOCK_CACHE_USAGE	BIT(13)
947d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_INFO0_FLUSH_ALL		BIT(14)
948d5c65159SKalle Valo 
949d5c65159SKalle Valo struct hal_reo_flush_cache {
950d5c65159SKalle Valo 	struct hal_reo_cmd_hdr cmd;
951d5c65159SKalle Valo 	u32 cache_addr_lo;
952d5c65159SKalle Valo 	u32 info0;
953d5c65159SKalle Valo 	u32 rsvd0[6];
954d5c65159SKalle Valo } __packed;
955d5c65159SKalle Valo 
956d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO0_DESC_TYPE	BIT(0)
957d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO0_EPD		BIT(1)
958d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO0_ENCAP_TYPE	GENMASK(3, 2)
959d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO0_ENCRYPT_TYPE	GENMASK(7, 4)
960d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO0_SRC_BUF_SWAP	BIT(8)
961d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO0_LNK_META_SWAP	BIT(9)
9620f37fbf4SAnilkumar Kolli #define HAL_TCL_DATA_CMD_INFO0_SEARCH_TYPE	GENMASK(13, 12)
9630f37fbf4SAnilkumar Kolli #define HAL_TCL_DATA_CMD_INFO0_ADDR_EN		GENMASK(15, 14)
964d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO0_CMD_NUM		GENMASK(31, 16)
965d5c65159SKalle Valo 
966d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO1_DATA_LEN		GENMASK(15, 0)
967d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO1_IP4_CKSUM_EN	BIT(16)
968d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO1_UDP4_CKSUM_EN	BIT(17)
969d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO1_UDP6_CKSUM_EN	BIT(18)
970d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO1_TCP4_CKSUM_EN	BIT(19)
971d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO1_TCP6_CKSUM_EN	BIT(20)
972d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO1_TO_FW		BIT(21)
973d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO1_PKT_OFFSET	GENMASK(31, 23)
974d5c65159SKalle Valo 
975d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO2_BUF_TIMESTAMP		GENMASK(18, 0)
976d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO2_BUF_T_VALID		BIT(19)
9776fe6f68fSKarthikeyan Periyasamy #define HAL_IPQ8074_TCL_DATA_CMD_INFO2_MESH_ENABLE	BIT(20)
978d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE		BIT(21)
979d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO2_TID			GENMASK(25, 22)
980d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO2_LMAC_ID			GENMASK(27, 26)
981d5c65159SKalle Valo 
982d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO3_DSCP_TID_TABLE_IDX	GENMASK(5, 0)
983d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO3_SEARCH_INDEX		GENMASK(25, 6)
984d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO3_CACHE_SET_NUM		GENMASK(29, 26)
9856fe6f68fSKarthikeyan Periyasamy #define HAL_QCN9074_TCL_DATA_CMD_INFO3_MESH_ENABLE	GENMASK(31, 30)
986d5c65159SKalle Valo 
987d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO4_RING_ID			GENMASK(27, 20)
988d5c65159SKalle Valo #define HAL_TCL_DATA_CMD_INFO4_LOOPING_COUNT		GENMASK(31, 28)
989d5c65159SKalle Valo 
990d5c65159SKalle Valo enum hal_encrypt_type {
991d5c65159SKalle Valo 	HAL_ENCRYPT_TYPE_WEP_40,
992d5c65159SKalle Valo 	HAL_ENCRYPT_TYPE_WEP_104,
993d5c65159SKalle Valo 	HAL_ENCRYPT_TYPE_TKIP_NO_MIC,
994d5c65159SKalle Valo 	HAL_ENCRYPT_TYPE_WEP_128,
995d5c65159SKalle Valo 	HAL_ENCRYPT_TYPE_TKIP_MIC,
996d5c65159SKalle Valo 	HAL_ENCRYPT_TYPE_WAPI,
997d5c65159SKalle Valo 	HAL_ENCRYPT_TYPE_CCMP_128,
998d5c65159SKalle Valo 	HAL_ENCRYPT_TYPE_OPEN,
999d5c65159SKalle Valo 	HAL_ENCRYPT_TYPE_CCMP_256,
1000d5c65159SKalle Valo 	HAL_ENCRYPT_TYPE_GCMP_128,
1001d5c65159SKalle Valo 	HAL_ENCRYPT_TYPE_AES_GCMP_256,
1002d5c65159SKalle Valo 	HAL_ENCRYPT_TYPE_WAPI_GCM_SM4,
1003d5c65159SKalle Valo };
1004d5c65159SKalle Valo 
1005d5c65159SKalle Valo enum hal_tcl_encap_type {
1006d5c65159SKalle Valo 	HAL_TCL_ENCAP_TYPE_RAW,
1007d5c65159SKalle Valo 	HAL_TCL_ENCAP_TYPE_NATIVE_WIFI,
1008d5c65159SKalle Valo 	HAL_TCL_ENCAP_TYPE_ETHERNET,
1009d5c65159SKalle Valo 	HAL_TCL_ENCAP_TYPE_802_3 = 3,
1010d5c65159SKalle Valo };
1011d5c65159SKalle Valo 
1012d5c65159SKalle Valo enum hal_tcl_desc_type {
1013d5c65159SKalle Valo 	HAL_TCL_DESC_TYPE_BUFFER,
1014d5c65159SKalle Valo 	HAL_TCL_DESC_TYPE_EXT_DESC,
1015d5c65159SKalle Valo };
1016d5c65159SKalle Valo 
1017d5c65159SKalle Valo enum hal_wbm_htt_tx_comp_status {
1018d5c65159SKalle Valo 	HAL_WBM_REL_HTT_TX_COMP_STATUS_OK,
1019d5c65159SKalle Valo 	HAL_WBM_REL_HTT_TX_COMP_STATUS_DROP,
1020d5c65159SKalle Valo 	HAL_WBM_REL_HTT_TX_COMP_STATUS_TTL,
1021d5c65159SKalle Valo 	HAL_WBM_REL_HTT_TX_COMP_STATUS_REINJ,
1022d5c65159SKalle Valo 	HAL_WBM_REL_HTT_TX_COMP_STATUS_INSPECT,
1023d5c65159SKalle Valo 	HAL_WBM_REL_HTT_TX_COMP_STATUS_MEC_NOTIFY,
1024d5c65159SKalle Valo };
1025d5c65159SKalle Valo 
1026d5c65159SKalle Valo struct hal_tcl_data_cmd {
1027d5c65159SKalle Valo 	struct ath11k_buffer_addr buf_addr_info;
1028d5c65159SKalle Valo 	u32 info0;
1029d5c65159SKalle Valo 	u32 info1;
1030d5c65159SKalle Valo 	u32 info2;
1031d5c65159SKalle Valo 	u32 info3;
1032d5c65159SKalle Valo 	u32 info4;
1033d5c65159SKalle Valo } __packed;
1034d5c65159SKalle Valo 
1035d5c65159SKalle Valo /* hal_tcl_data_cmd
1036d5c65159SKalle Valo  *
1037d5c65159SKalle Valo  * buf_addr_info
1038d5c65159SKalle Valo  *		Details of the physical address of a buffer or MSDU
1039d5c65159SKalle Valo  *		link descriptor.
1040d5c65159SKalle Valo  *
1041d5c65159SKalle Valo  * desc_type
1042d5c65159SKalle Valo  *		Indicates the type of address provided in the buf_addr_info.
1043d5c65159SKalle Valo  *		Values are defined in enum %HAL_REO_DEST_RING_BUFFER_TYPE_.
1044d5c65159SKalle Valo  *
1045d5c65159SKalle Valo  * epd
1046d5c65159SKalle Valo  *		When this bit is set then input packet is an EPD type.
1047d5c65159SKalle Valo  *
1048d5c65159SKalle Valo  * encap_type
1049d5c65159SKalle Valo  *		Indicates the encapsulation that HW will perform. Values are
1050d5c65159SKalle Valo  *		defined in enum %HAL_TCL_ENCAP_TYPE_.
1051d5c65159SKalle Valo  *
1052d5c65159SKalle Valo  * encrypt_type
1053d5c65159SKalle Valo  *		Field only valid for encap_type: RAW
1054d5c65159SKalle Valo  *		Values are defined in enum %HAL_ENCRYPT_TYPE_.
1055d5c65159SKalle Valo  *
1056d5c65159SKalle Valo  * src_buffer_swap
1057d5c65159SKalle Valo  *		Treats source memory (packet buffer) organization as big-endian.
1058d5c65159SKalle Valo  *		1'b0: Source memory is little endian
1059d5c65159SKalle Valo  *		1'b1: Source memory is big endian
1060d5c65159SKalle Valo  *
1061d5c65159SKalle Valo  * link_meta_swap
1062d5c65159SKalle Valo  *		Treats link descriptor and Metadata as big-endian.
1063d5c65159SKalle Valo  *		1'b0: memory is little endian
1064d5c65159SKalle Valo  *		1'b1: memory is big endian
1065d5c65159SKalle Valo  *
1066d5c65159SKalle Valo  * search_type
1067d5c65159SKalle Valo  *		Search type select
1068d5c65159SKalle Valo  *		0 - Normal search, 1 - Index based address search,
1069d5c65159SKalle Valo  *		2 - Index based flow search
1070d5c65159SKalle Valo  *
1071d5c65159SKalle Valo  * addrx_en
1072d5c65159SKalle Valo  * addry_en
1073d5c65159SKalle Valo  *		Address X/Y search enable in ASE correspondingly.
1074d5c65159SKalle Valo  *		1'b0: Search disable
1075d5c65159SKalle Valo  *		1'b1: Search Enable
1076d5c65159SKalle Valo  *
1077d5c65159SKalle Valo  * cmd_num
1078d5c65159SKalle Valo  *		This number can be used to match against status.
1079d5c65159SKalle Valo  *
1080d5c65159SKalle Valo  * data_length
1081d5c65159SKalle Valo  *		MSDU length in case of direct descriptor. Length of link
1082d5c65159SKalle Valo  *		extension descriptor in case of Link extension descriptor.
1083d5c65159SKalle Valo  *
1084d5c65159SKalle Valo  * *_checksum_en
1085d5c65159SKalle Valo  *		Enable checksum replacement for ipv4, udp_over_ipv4, ipv6,
1086d5c65159SKalle Valo  *		udp_over_ipv6, tcp_over_ipv4 and tcp_over_ipv6.
1087d5c65159SKalle Valo  *
1088d5c65159SKalle Valo  * to_fw
1089d5c65159SKalle Valo  *		Forward packet to FW along with classification result. The
1090d5c65159SKalle Valo  *		packet will not be forward to TQM when this bit is set.
1091d5c65159SKalle Valo  *		1'b0: Use classification result to forward the packet.
1092d5c65159SKalle Valo  *		1'b1: Override classification result & forward packet only to fw
1093d5c65159SKalle Valo  *
1094d5c65159SKalle Valo  * packet_offset
1095d5c65159SKalle Valo  *		Packet offset from Metadata in case of direct buffer descriptor.
1096d5c65159SKalle Valo  *
1097d5c65159SKalle Valo  * buffer_timestamp
1098d5c65159SKalle Valo  * buffer_timestamp_valid
1099d5c65159SKalle Valo  *		Frame system entrance timestamp. It shall be filled by first
1100d5c65159SKalle Valo  *		module (SW, TCL or TQM) that sees the frames first.
1101d5c65159SKalle Valo  *
1102d5c65159SKalle Valo  * mesh_enable
1103d5c65159SKalle Valo  *		For raw WiFi frames, this indicates transmission to a mesh STA,
1104d5c65159SKalle Valo  *		enabling the interpretation of the 'Mesh Control Present' bit
1105d5c65159SKalle Valo  *		(bit 8) of QoS Control.
1106d5c65159SKalle Valo  *		For native WiFi frames, this indicates that a 'Mesh Control'
1107d5c65159SKalle Valo  *		field is present between the header and the LLC.
1108d5c65159SKalle Valo  *
1109d5c65159SKalle Valo  * hlos_tid_overwrite
1110d5c65159SKalle Valo  *
1111d5c65159SKalle Valo  *		When set, TCL shall ignore the IP DSCP and VLAN PCP
1112d5c65159SKalle Valo  *		fields and use HLOS_TID as the final TID. Otherwise TCL
1113d5c65159SKalle Valo  *		shall consider the DSCP and PCP fields as well as HLOS_TID
1114d5c65159SKalle Valo  *		and choose a final TID based on the configured priority
1115d5c65159SKalle Valo  *
1116d5c65159SKalle Valo  * hlos_tid
1117d5c65159SKalle Valo  *		HLOS MSDU priority
1118d5c65159SKalle Valo  *		Field is used when HLOS_TID_overwrite is set.
1119d5c65159SKalle Valo  *
1120d5c65159SKalle Valo  * lmac_id
1121d5c65159SKalle Valo  *		TCL uses this LMAC_ID in address search, i.e, while
1122d5c65159SKalle Valo  *		finding matching entry for the packet in AST corresponding
1123d5c65159SKalle Valo  *		to given LMAC_ID
1124d5c65159SKalle Valo  *
1125d5c65159SKalle Valo  *		If LMAC ID is all 1s (=> value 3), it indicates wildcard
1126d5c65159SKalle Valo  *		match for any MAC
1127d5c65159SKalle Valo  *
1128d5c65159SKalle Valo  * dscp_tid_table_num
1129d5c65159SKalle Valo  *		DSCP to TID mapping table number that need to be used
1130d5c65159SKalle Valo  *		for the MSDU.
1131d5c65159SKalle Valo  *
1132d5c65159SKalle Valo  * search_index
1133d5c65159SKalle Valo  *		The index that will be used for index based address or
1134d5c65159SKalle Valo  *		flow search. The field is valid when 'search_type' is  1 or 2.
1135d5c65159SKalle Valo  *
1136d5c65159SKalle Valo  * cache_set_num
1137d5c65159SKalle Valo  *
1138d5c65159SKalle Valo  *		Cache set number that should be used to cache the index
1139d5c65159SKalle Valo  *		based search results, for address and flow search. This
1140d5c65159SKalle Valo  *		value should be equal to LSB four bits of the hash value of
1141d5c65159SKalle Valo  *		match data, in case of search index points to an entry which
1142d5c65159SKalle Valo  *		may be used in content based search also. The value can be
1143d5c65159SKalle Valo  *		anything when the entry pointed by search index will not be
1144d5c65159SKalle Valo  *		used for content based search.
1145d5c65159SKalle Valo  *
1146d5c65159SKalle Valo  * ring_id
1147d5c65159SKalle Valo  *		The buffer pointer ring ID.
1148d5c65159SKalle Valo  *		0 refers to the IDLE ring
1149d5c65159SKalle Valo  *		1 - N refers to other rings
1150d5c65159SKalle Valo  *
1151d5c65159SKalle Valo  * looping_count
1152d5c65159SKalle Valo  *
1153d5c65159SKalle Valo  *		A count value that indicates the number of times the
1154d5c65159SKalle Valo  *		producer of entries into the Ring has looped around the
1155d5c65159SKalle Valo  *		ring.
1156d5c65159SKalle Valo  *
1157d5c65159SKalle Valo  *		At initialization time, this value is set to 0. On the
1158d5c65159SKalle Valo  *		first loop, this value is set to 1. After the max value is
1159d5c65159SKalle Valo  *		reached allowed by the number of bits for this field, the
1160d5c65159SKalle Valo  *		count value continues with 0 again.
1161d5c65159SKalle Valo  *
1162d5c65159SKalle Valo  *		In case SW is the consumer of the ring entries, it can
1163d5c65159SKalle Valo  *		use this field to figure out up to where the producer of
1164d5c65159SKalle Valo  *		entries has created new entries. This eliminates the need to
1165d5c65159SKalle Valo  *		check where the head pointer' of the ring is located once
1166d5c65159SKalle Valo  *		the SW starts processing an interrupt indicating that new
1167d5c65159SKalle Valo  *		entries have been put into this ring...
1168d5c65159SKalle Valo  *
1169d5c65159SKalle Valo  *		Also note that SW if it wants only needs to look at the
1170d5c65159SKalle Valo  *		LSB bit of this count value.
1171d5c65159SKalle Valo  */
1172d5c65159SKalle Valo 
1173d5c65159SKalle Valo #define HAL_TCL_DESC_LEN sizeof(struct hal_tcl_data_cmd)
1174d5c65159SKalle Valo 
1175d5c65159SKalle Valo enum hal_tcl_gse_ctrl {
1176d5c65159SKalle Valo 	HAL_TCL_GSE_CTRL_RD_STAT,
1177d5c65159SKalle Valo 	HAL_TCL_GSE_CTRL_SRCH_DIS,
1178d5c65159SKalle Valo 	HAL_TCL_GSE_CTRL_WR_BK_SINGLE,
1179d5c65159SKalle Valo 	HAL_TCL_GSE_CTRL_WR_BK_ALL,
1180d5c65159SKalle Valo 	HAL_TCL_GSE_CTRL_INVAL_SINGLE,
1181d5c65159SKalle Valo 	HAL_TCL_GSE_CTRL_INVAL_ALL,
1182d5c65159SKalle Valo 	HAL_TCL_GSE_CTRL_WR_BK_INVAL_SINGLE,
1183d5c65159SKalle Valo 	HAL_TCL_GSE_CTRL_WR_BK_INVAL_ALL,
1184d5c65159SKalle Valo 	HAL_TCL_GSE_CTRL_CLR_STAT_SINGLE,
1185d5c65159SKalle Valo };
1186d5c65159SKalle Valo 
1187d5c65159SKalle Valo /* hal_tcl_gse_ctrl
1188d5c65159SKalle Valo  *
1189d5c65159SKalle Valo  * rd_stat
1190d5c65159SKalle Valo  *		Report or Read statistics
1191d5c65159SKalle Valo  * srch_dis
1192d5c65159SKalle Valo  *		Search disable. Report only Hash.
1193d5c65159SKalle Valo  * wr_bk_single
1194d5c65159SKalle Valo  *		Write Back single entry
1195d5c65159SKalle Valo  * wr_bk_all
1196d5c65159SKalle Valo  *		Write Back entire cache entry
1197d5c65159SKalle Valo  * inval_single
1198d5c65159SKalle Valo  *		Invalidate single cache entry
1199d5c65159SKalle Valo  * inval_all
1200d5c65159SKalle Valo  *		Invalidate entire cache
1201d5c65159SKalle Valo  * wr_bk_inval_single
1202d5c65159SKalle Valo  *		Write back and invalidate single entry in cache
1203d5c65159SKalle Valo  * wr_bk_inval_all
1204d5c65159SKalle Valo  *		Write back and invalidate entire cache
1205d5c65159SKalle Valo  * clr_stat_single
1206d5c65159SKalle Valo  *		Clear statistics for single entry
1207d5c65159SKalle Valo  */
1208d5c65159SKalle Valo 
1209d5c65159SKalle Valo #define HAL_TCL_GSE_CMD_INFO0_CTRL_BUF_ADDR_HI		GENMASK(7, 0)
1210d5c65159SKalle Valo #define HAL_TCL_GSE_CMD_INFO0_GSE_CTRL			GENMASK(11, 8)
1211d5c65159SKalle Valo #define HAL_TCL_GSE_CMD_INFO0_GSE_SEL			BIT(12)
1212d5c65159SKalle Valo #define HAL_TCL_GSE_CMD_INFO0_STATUS_DEST_RING_ID	BIT(13)
1213d5c65159SKalle Valo #define HAL_TCL_GSE_CMD_INFO0_SWAP			BIT(14)
1214d5c65159SKalle Valo 
1215d5c65159SKalle Valo #define HAL_TCL_GSE_CMD_INFO1_RING_ID			GENMASK(27, 20)
1216d5c65159SKalle Valo #define HAL_TCL_GSE_CMD_INFO1_LOOPING_COUNT		GENMASK(31, 28)
1217d5c65159SKalle Valo 
1218d5c65159SKalle Valo struct hal_tcl_gse_cmd {
1219d5c65159SKalle Valo 	u32 ctrl_buf_addr_lo;
1220d5c65159SKalle Valo 	u32 info0;
1221d5c65159SKalle Valo 	u32 meta_data[2];
1222d5c65159SKalle Valo 	u32 rsvd0[2];
1223d5c65159SKalle Valo 	u32 info1;
1224d5c65159SKalle Valo } __packed;
1225d5c65159SKalle Valo 
1226d5c65159SKalle Valo /* hal_tcl_gse_cmd
1227d5c65159SKalle Valo  *
1228d5c65159SKalle Valo  * ctrl_buf_addr_lo, ctrl_buf_addr_hi
1229d5c65159SKalle Valo  *		Address of a control buffer containing additional info needed
1230d5c65159SKalle Valo  *		for this command execution.
1231d5c65159SKalle Valo  *
1232d5c65159SKalle Valo  * gse_ctrl
1233d5c65159SKalle Valo  *		GSE control operations. This includes cache operations and table
1234d5c65159SKalle Valo  *		entry statistics read/clear operation. Values are defined in
1235d5c65159SKalle Valo  *		enum %HAL_TCL_GSE_CTRL.
1236d5c65159SKalle Valo  *
1237d5c65159SKalle Valo  * gse_sel
1238d5c65159SKalle Valo  *		To select the ASE/FSE to do the operation mention by GSE_ctrl.
1239d5c65159SKalle Valo  *		0: FSE select 1: ASE select
1240d5c65159SKalle Valo  *
1241d5c65159SKalle Valo  * status_destination_ring_id
1242d5c65159SKalle Valo  *		TCL status ring to which the GSE status needs to be send.
1243d5c65159SKalle Valo  *
1244d5c65159SKalle Valo  * swap
1245d5c65159SKalle Valo  *		Bit to enable byte swapping of contents of buffer.
1246d5c65159SKalle Valo  *
1247d5c65159SKalle Valo  * meta_data
1248d5c65159SKalle Valo  *		Meta data to be returned in the status descriptor
1249d5c65159SKalle Valo  */
1250d5c65159SKalle Valo 
1251d5c65159SKalle Valo enum hal_tcl_cache_op_res {
1252d5c65159SKalle Valo 	HAL_TCL_CACHE_OP_RES_DONE,
1253d5c65159SKalle Valo 	HAL_TCL_CACHE_OP_RES_NOT_FOUND,
1254d5c65159SKalle Valo 	HAL_TCL_CACHE_OP_RES_TIMEOUT,
1255d5c65159SKalle Valo };
1256d5c65159SKalle Valo 
1257d5c65159SKalle Valo #define HAL_TCL_STATUS_RING_INFO0_GSE_CTRL		GENMASK(3, 0)
1258d5c65159SKalle Valo #define HAL_TCL_STATUS_RING_INFO0_GSE_SEL		BIT(4)
1259d5c65159SKalle Valo #define HAL_TCL_STATUS_RING_INFO0_CACHE_OP_RES		GENMASK(6, 5)
1260d5c65159SKalle Valo #define HAL_TCL_STATUS_RING_INFO0_MSDU_CNT		GENMASK(31, 8)
1261d5c65159SKalle Valo 
1262d5c65159SKalle Valo #define HAL_TCL_STATUS_RING_INFO1_HASH_IDX		GENMASK(19, 0)
1263d5c65159SKalle Valo 
1264d5c65159SKalle Valo #define HAL_TCL_STATUS_RING_INFO2_RING_ID		GENMASK(27, 20)
1265d5c65159SKalle Valo #define HAL_TCL_STATUS_RING_INFO2_LOOPING_COUNT		GENMASK(31, 28)
1266d5c65159SKalle Valo 
1267d5c65159SKalle Valo struct hal_tcl_status_ring {
1268d5c65159SKalle Valo 	u32 info0;
1269d5c65159SKalle Valo 	u32 msdu_byte_count;
1270d5c65159SKalle Valo 	u32 msdu_timestamp;
1271d5c65159SKalle Valo 	u32 meta_data[2];
1272d5c65159SKalle Valo 	u32 info1;
1273d5c65159SKalle Valo 	u32 rsvd0;
1274d5c65159SKalle Valo 	u32 info2;
1275d5c65159SKalle Valo } __packed;
1276d5c65159SKalle Valo 
1277d5c65159SKalle Valo /* hal_tcl_status_ring
1278d5c65159SKalle Valo  *
1279d5c65159SKalle Valo  * gse_ctrl
1280d5c65159SKalle Valo  *		GSE control operations. This includes cache operations and table
1281d5c65159SKalle Valo  *		entry statistics read/clear operation. Values are defined in
1282d5c65159SKalle Valo  *		enum %HAL_TCL_GSE_CTRL.
1283d5c65159SKalle Valo  *
1284d5c65159SKalle Valo  * gse_sel
1285d5c65159SKalle Valo  *		To select the ASE/FSE to do the operation mention by GSE_ctrl.
1286d5c65159SKalle Valo  *		0: FSE select 1: ASE select
1287d5c65159SKalle Valo  *
1288d5c65159SKalle Valo  * cache_op_res
1289d5c65159SKalle Valo  *		Cache operation result. Values are defined in enum
1290d5c65159SKalle Valo  *		%HAL_TCL_CACHE_OP_RES_.
1291d5c65159SKalle Valo  *
1292d5c65159SKalle Valo  * msdu_cnt
1293d5c65159SKalle Valo  * msdu_byte_count
1294d5c65159SKalle Valo  *		MSDU count of Entry and MSDU byte count for entry 1.
1295d5c65159SKalle Valo  *
1296d5c65159SKalle Valo  * hash_indx
1297d5c65159SKalle Valo  *		Hash value of the entry in case of search failed or disabled.
1298d5c65159SKalle Valo  */
1299d5c65159SKalle Valo 
1300d5c65159SKalle Valo #define HAL_CE_SRC_DESC_ADDR_INFO_ADDR_HI	GENMASK(7, 0)
1301d5c65159SKalle Valo #define HAL_CE_SRC_DESC_ADDR_INFO_HASH_EN	BIT(8)
1302d5c65159SKalle Valo #define HAL_CE_SRC_DESC_ADDR_INFO_BYTE_SWAP	BIT(9)
1303d5c65159SKalle Valo #define HAL_CE_SRC_DESC_ADDR_INFO_DEST_SWAP	BIT(10)
1304d5c65159SKalle Valo #define HAL_CE_SRC_DESC_ADDR_INFO_GATHER	BIT(11)
1305d5c65159SKalle Valo #define HAL_CE_SRC_DESC_ADDR_INFO_LEN		GENMASK(31, 16)
1306d5c65159SKalle Valo 
1307d5c65159SKalle Valo #define HAL_CE_SRC_DESC_META_INFO_DATA		GENMASK(15, 0)
1308d5c65159SKalle Valo 
1309d5c65159SKalle Valo #define HAL_CE_SRC_DESC_FLAGS_RING_ID		GENMASK(27, 20)
1310d5c65159SKalle Valo #define HAL_CE_SRC_DESC_FLAGS_LOOP_CNT		HAL_SRNG_DESC_LOOP_CNT
1311d5c65159SKalle Valo 
1312d5c65159SKalle Valo struct hal_ce_srng_src_desc {
1313d5c65159SKalle Valo 	u32 buffer_addr_low;
1314d5c65159SKalle Valo 	u32 buffer_addr_info; /* %HAL_CE_SRC_DESC_ADDR_INFO_ */
1315d5c65159SKalle Valo 	u32 meta_info; /* %HAL_CE_SRC_DESC_META_INFO_ */
1316d5c65159SKalle Valo 	u32 flags; /* %HAL_CE_SRC_DESC_FLAGS_ */
1317d5c65159SKalle Valo } __packed;
1318d5c65159SKalle Valo 
1319d5c65159SKalle Valo /*
1320d5c65159SKalle Valo  * hal_ce_srng_src_desc
1321d5c65159SKalle Valo  *
1322d5c65159SKalle Valo  * buffer_addr_lo
1323d5c65159SKalle Valo  *		LSB 32 bits of the 40 Bit Pointer to the source buffer
1324d5c65159SKalle Valo  *
1325d5c65159SKalle Valo  * buffer_addr_hi
1326d5c65159SKalle Valo  *		MSB 8 bits of the 40 Bit Pointer to the source buffer
1327d5c65159SKalle Valo  *
1328d5c65159SKalle Valo  * toeplitz_en
1329d5c65159SKalle Valo  *		Enable generation of 32-bit Toeplitz-LFSR hash for
1330d5c65159SKalle Valo  *		data transfer. In case of gather field in first source
1331d5c65159SKalle Valo  *		ring entry of the gather copy cycle in taken into account.
1332d5c65159SKalle Valo  *
1333d5c65159SKalle Valo  * src_swap
1334d5c65159SKalle Valo  *		Treats source memory organization as big-endian. For
1335d5c65159SKalle Valo  *		each dword read (4 bytes), the byte 0 is swapped with byte 3
1336d5c65159SKalle Valo  *		and byte 1 is swapped with byte 2.
1337d5c65159SKalle Valo  *		In case of gather field in first source ring entry of
1338d5c65159SKalle Valo  *		the gather copy cycle in taken into account.
1339d5c65159SKalle Valo  *
1340d5c65159SKalle Valo  * dest_swap
1341d5c65159SKalle Valo  *		Treats destination memory organization as big-endian.
1342d5c65159SKalle Valo  *		For each dword write (4 bytes), the byte 0 is swapped with
1343d5c65159SKalle Valo  *		byte 3 and byte 1 is swapped with byte 2.
1344d5c65159SKalle Valo  *		In case of gather field in first source ring entry of
1345d5c65159SKalle Valo  *		the gather copy cycle in taken into account.
1346d5c65159SKalle Valo  *
1347d5c65159SKalle Valo  * gather
1348d5c65159SKalle Valo  *		Enables gather of multiple copy engine source
1349d5c65159SKalle Valo  *		descriptors to one destination.
1350d5c65159SKalle Valo  *
1351d5c65159SKalle Valo  * ce_res_0
1352d5c65159SKalle Valo  *		Reserved
1353d5c65159SKalle Valo  *
1354d5c65159SKalle Valo  *
1355d5c65159SKalle Valo  * length
1356d5c65159SKalle Valo  *		Length of the buffer in units of octets of the current
1357d5c65159SKalle Valo  *		descriptor
1358d5c65159SKalle Valo  *
1359d5c65159SKalle Valo  * fw_metadata
1360d5c65159SKalle Valo  *		Meta data used by FW.
1361d5c65159SKalle Valo  *		In case of gather field in first source ring entry of
1362d5c65159SKalle Valo  *		the gather copy cycle in taken into account.
1363d5c65159SKalle Valo  *
1364d5c65159SKalle Valo  * ce_res_1
1365d5c65159SKalle Valo  *		Reserved
1366d5c65159SKalle Valo  *
1367d5c65159SKalle Valo  * ce_res_2
1368d5c65159SKalle Valo  *		Reserved
1369d5c65159SKalle Valo  *
1370d5c65159SKalle Valo  * ring_id
1371d5c65159SKalle Valo  *		The buffer pointer ring ID.
1372d5c65159SKalle Valo  *		0 refers to the IDLE ring
1373d5c65159SKalle Valo  *		1 - N refers to other rings
1374d5c65159SKalle Valo  *		Helps with debugging when dumping ring contents.
1375d5c65159SKalle Valo  *
1376d5c65159SKalle Valo  * looping_count
1377d5c65159SKalle Valo  *		A count value that indicates the number of times the
1378d5c65159SKalle Valo  *		producer of entries into the Ring has looped around the
1379d5c65159SKalle Valo  *		ring.
1380d5c65159SKalle Valo  *
1381d5c65159SKalle Valo  *		At initialization time, this value is set to 0. On the
1382d5c65159SKalle Valo  *		first loop, this value is set to 1. After the max value is
1383d5c65159SKalle Valo  *		reached allowed by the number of bits for this field, the
1384d5c65159SKalle Valo  *		count value continues with 0 again.
1385d5c65159SKalle Valo  *
1386d5c65159SKalle Valo  *		In case SW is the consumer of the ring entries, it can
1387d5c65159SKalle Valo  *		use this field to figure out up to where the producer of
1388d5c65159SKalle Valo  *		entries has created new entries. This eliminates the need to
1389d5c65159SKalle Valo  *		check where the head pointer' of the ring is located once
1390d5c65159SKalle Valo  *		the SW starts processing an interrupt indicating that new
1391d5c65159SKalle Valo  *		entries have been put into this ring...
1392d5c65159SKalle Valo  *
1393d5c65159SKalle Valo  *		Also note that SW if it wants only needs to look at the
1394d5c65159SKalle Valo  *		LSB bit of this count value.
1395d5c65159SKalle Valo  */
1396d5c65159SKalle Valo 
1397d5c65159SKalle Valo #define HAL_CE_DEST_DESC_ADDR_INFO_ADDR_HI		GENMASK(7, 0)
1398d5c65159SKalle Valo #define HAL_CE_DEST_DESC_ADDR_INFO_RING_ID		GENMASK(27, 20)
1399d5c65159SKalle Valo #define HAL_CE_DEST_DESC_ADDR_INFO_LOOP_CNT		HAL_SRNG_DESC_LOOP_CNT
1400d5c65159SKalle Valo 
1401d5c65159SKalle Valo struct hal_ce_srng_dest_desc {
1402d5c65159SKalle Valo 	u32 buffer_addr_low;
1403d5c65159SKalle Valo 	u32 buffer_addr_info; /* %HAL_CE_DEST_DESC_ADDR_INFO_ */
1404d5c65159SKalle Valo } __packed;
1405d5c65159SKalle Valo 
1406d5c65159SKalle Valo /* hal_ce_srng_dest_desc
1407d5c65159SKalle Valo  *
1408d5c65159SKalle Valo  * dst_buffer_low
1409d5c65159SKalle Valo  *		LSB 32 bits of the 40 Bit Pointer to the Destination
1410d5c65159SKalle Valo  *		buffer
1411d5c65159SKalle Valo  *
1412d5c65159SKalle Valo  * dst_buffer_high
1413d5c65159SKalle Valo  *		MSB 8 bits of the 40 Bit Pointer to the Destination
1414d5c65159SKalle Valo  *		buffer
1415d5c65159SKalle Valo  *
1416d5c65159SKalle Valo  * ce_res_4
1417d5c65159SKalle Valo  *		Reserved
1418d5c65159SKalle Valo  *
1419d5c65159SKalle Valo  * ring_id
1420d5c65159SKalle Valo  *		The buffer pointer ring ID.
1421d5c65159SKalle Valo  *		0 refers to the IDLE ring
1422d5c65159SKalle Valo  *		1 - N refers to other rings
1423d5c65159SKalle Valo  *		Helps with debugging when dumping ring contents.
1424d5c65159SKalle Valo  *
1425d5c65159SKalle Valo  * looping_count
1426d5c65159SKalle Valo  *		A count value that indicates the number of times the
1427d5c65159SKalle Valo  *		producer of entries into the Ring has looped around the
1428d5c65159SKalle Valo  *		ring.
1429d5c65159SKalle Valo  *
1430d5c65159SKalle Valo  *		At initialization time, this value is set to 0. On the
1431d5c65159SKalle Valo  *		first loop, this value is set to 1. After the max value is
1432d5c65159SKalle Valo  *		reached allowed by the number of bits for this field, the
1433d5c65159SKalle Valo  *		count value continues with 0 again.
1434d5c65159SKalle Valo  *
1435d5c65159SKalle Valo  *		In case SW is the consumer of the ring entries, it can
1436d5c65159SKalle Valo  *		use this field to figure out up to where the producer of
1437d5c65159SKalle Valo  *		entries has created new entries. This eliminates the need to
1438d5c65159SKalle Valo  *		check where the head pointer' of the ring is located once
1439d5c65159SKalle Valo  *		the SW starts processing an interrupt indicating that new
1440d5c65159SKalle Valo  *		entries have been put into this ring...
1441d5c65159SKalle Valo  *
1442d5c65159SKalle Valo  *		Also note that SW if it wants only needs to look at the
1443d5c65159SKalle Valo  *		LSB bit of this count value.
1444d5c65159SKalle Valo  */
1445d5c65159SKalle Valo 
1446d5c65159SKalle Valo #define HAL_CE_DST_STATUS_DESC_FLAGS_HASH_EN		BIT(8)
1447d5c65159SKalle Valo #define HAL_CE_DST_STATUS_DESC_FLAGS_BYTE_SWAP		BIT(9)
1448d5c65159SKalle Valo #define HAL_CE_DST_STATUS_DESC_FLAGS_DEST_SWAP		BIT(10)
1449d5c65159SKalle Valo #define HAL_CE_DST_STATUS_DESC_FLAGS_GATHER		BIT(11)
1450d5c65159SKalle Valo #define HAL_CE_DST_STATUS_DESC_FLAGS_LEN		GENMASK(31, 16)
1451d5c65159SKalle Valo 
1452ab041d06SKarthikeyan Periyasamy #define HAL_CE_DST_STATUS_DESC_META_INFO_DATA		GENMASK(15, 0)
1453d5c65159SKalle Valo #define HAL_CE_DST_STATUS_DESC_META_INFO_RING_ID	GENMASK(27, 20)
1454d5c65159SKalle Valo #define HAL_CE_DST_STATUS_DESC_META_INFO_LOOP_CNT	HAL_SRNG_DESC_LOOP_CNT
1455d5c65159SKalle Valo 
1456d5c65159SKalle Valo struct hal_ce_srng_dst_status_desc {
1457d5c65159SKalle Valo 	u32 flags; /* %HAL_CE_DST_STATUS_DESC_FLAGS_ */
1458d5c65159SKalle Valo 	u32 toeplitz_hash0;
1459d5c65159SKalle Valo 	u32 toeplitz_hash1;
1460d5c65159SKalle Valo 	u32 meta_info; /* HAL_CE_DST_STATUS_DESC_META_INFO_ */
1461d5c65159SKalle Valo } __packed;
1462d5c65159SKalle Valo 
1463d5c65159SKalle Valo /* hal_ce_srng_dst_status_desc
1464d5c65159SKalle Valo  *
1465d5c65159SKalle Valo  * ce_res_5
1466d5c65159SKalle Valo  *		Reserved
1467d5c65159SKalle Valo  *
1468d5c65159SKalle Valo  * toeplitz_en
1469d5c65159SKalle Valo  *
1470d5c65159SKalle Valo  * src_swap
1471d5c65159SKalle Valo  *		Source memory buffer swapped
1472d5c65159SKalle Valo  *
1473d5c65159SKalle Valo  * dest_swap
1474d5c65159SKalle Valo  *		Destination  memory buffer swapped
1475d5c65159SKalle Valo  *
1476d5c65159SKalle Valo  * gather
1477d5c65159SKalle Valo  *		Gather of multiple copy engine source descriptors to one
1478d5c65159SKalle Valo  *		destination enabled
1479d5c65159SKalle Valo  *
1480d5c65159SKalle Valo  * ce_res_6
1481d5c65159SKalle Valo  *		Reserved
1482d5c65159SKalle Valo  *
1483d5c65159SKalle Valo  * length
1484d5c65159SKalle Valo  *		Sum of all the Lengths of the source descriptor in the
1485d5c65159SKalle Valo  *		gather chain
1486d5c65159SKalle Valo  *
1487d5c65159SKalle Valo  * toeplitz_hash_0
1488d5c65159SKalle Valo  *		32 LS bits of 64 bit Toeplitz LFSR hash result
1489d5c65159SKalle Valo  *
1490d5c65159SKalle Valo  * toeplitz_hash_1
1491d5c65159SKalle Valo  *		32 MS bits of 64 bit Toeplitz LFSR hash result
1492d5c65159SKalle Valo  *
1493d5c65159SKalle Valo  * fw_metadata
1494d5c65159SKalle Valo  *		Meta data used by FW
1495d5c65159SKalle Valo  *		In case of gather field in first source ring entry of
1496d5c65159SKalle Valo  *		the gather copy cycle in taken into account.
1497d5c65159SKalle Valo  *
1498d5c65159SKalle Valo  * ce_res_7
1499d5c65159SKalle Valo  *		Reserved
1500d5c65159SKalle Valo  *
1501d5c65159SKalle Valo  * ring_id
1502d5c65159SKalle Valo  *		The buffer pointer ring ID.
1503d5c65159SKalle Valo  *		0 refers to the IDLE ring
1504d5c65159SKalle Valo  *		1 - N refers to other rings
1505d5c65159SKalle Valo  *		Helps with debugging when dumping ring contents.
1506d5c65159SKalle Valo  *
1507d5c65159SKalle Valo  * looping_count
1508d5c65159SKalle Valo  *		A count value that indicates the number of times the
1509d5c65159SKalle Valo  *		producer of entries into the Ring has looped around the
1510d5c65159SKalle Valo  *		ring.
1511d5c65159SKalle Valo  *
1512d5c65159SKalle Valo  *		At initialization time, this value is set to 0. On the
1513d5c65159SKalle Valo  *		first loop, this value is set to 1. After the max value is
1514d5c65159SKalle Valo  *		reached allowed by the number of bits for this field, the
1515d5c65159SKalle Valo  *		count value continues with 0 again.
1516d5c65159SKalle Valo  *
1517d5c65159SKalle Valo  *		In case SW is the consumer of the ring entries, it can
1518d5c65159SKalle Valo  *		use this field to figure out up to where the producer of
1519d5c65159SKalle Valo  *		entries has created new entries. This eliminates the need to
1520d5c65159SKalle Valo  *		check where the head pointer' of the ring is located once
1521d5c65159SKalle Valo  *		the SW starts processing an interrupt indicating that new
1522d5c65159SKalle Valo  *		entries have been put into this ring...
1523d5c65159SKalle Valo  *
1524d5c65159SKalle Valo  *		Also note that SW if it wants only needs to look at the
1525d5c65159SKalle Valo  *			LSB bit of this count value.
1526d5c65159SKalle Valo  */
1527d5c65159SKalle Valo 
1528d5c65159SKalle Valo #define HAL_TX_RATE_STATS_INFO0_VALID		BIT(0)
1529d5c65159SKalle Valo #define HAL_TX_RATE_STATS_INFO0_BW		GENMASK(2, 1)
1530d5c65159SKalle Valo #define HAL_TX_RATE_STATS_INFO0_PKT_TYPE	GENMASK(6, 3)
1531d5c65159SKalle Valo #define HAL_TX_RATE_STATS_INFO0_STBC		BIT(7)
1532d5c65159SKalle Valo #define HAL_TX_RATE_STATS_INFO0_LDPC		BIT(8)
1533d5c65159SKalle Valo #define HAL_TX_RATE_STATS_INFO0_SGI		GENMASK(10, 9)
1534d5c65159SKalle Valo #define HAL_TX_RATE_STATS_INFO0_MCS		GENMASK(14, 11)
1535d5c65159SKalle Valo #define HAL_TX_RATE_STATS_INFO0_OFDMA_TX	BIT(15)
1536d5c65159SKalle Valo #define HAL_TX_RATE_STATS_INFO0_TONES_IN_RU	GENMASK(27, 16)
1537d5c65159SKalle Valo 
1538d5c65159SKalle Valo enum hal_tx_rate_stats_bw {
1539d5c65159SKalle Valo 	HAL_TX_RATE_STATS_BW_20,
1540d5c65159SKalle Valo 	HAL_TX_RATE_STATS_BW_40,
1541d5c65159SKalle Valo 	HAL_TX_RATE_STATS_BW_80,
1542d5c65159SKalle Valo 	HAL_TX_RATE_STATS_BW_160,
1543d5c65159SKalle Valo };
1544d5c65159SKalle Valo 
1545d5c65159SKalle Valo enum hal_tx_rate_stats_pkt_type {
1546d5c65159SKalle Valo 	HAL_TX_RATE_STATS_PKT_TYPE_11A,
1547d5c65159SKalle Valo 	HAL_TX_RATE_STATS_PKT_TYPE_11B,
1548d5c65159SKalle Valo 	HAL_TX_RATE_STATS_PKT_TYPE_11N,
1549d5c65159SKalle Valo 	HAL_TX_RATE_STATS_PKT_TYPE_11AC,
1550d5c65159SKalle Valo 	HAL_TX_RATE_STATS_PKT_TYPE_11AX,
1551d5c65159SKalle Valo };
1552d5c65159SKalle Valo 
1553d5c65159SKalle Valo enum hal_tx_rate_stats_sgi {
1554d5c65159SKalle Valo 	HAL_TX_RATE_STATS_SGI_08US,
1555d5c65159SKalle Valo 	HAL_TX_RATE_STATS_SGI_04US,
1556d5c65159SKalle Valo 	HAL_TX_RATE_STATS_SGI_16US,
1557d5c65159SKalle Valo 	HAL_TX_RATE_STATS_SGI_32US,
1558d5c65159SKalle Valo };
1559d5c65159SKalle Valo 
1560d5c65159SKalle Valo struct hal_tx_rate_stats {
1561d5c65159SKalle Valo 	u32 info0;
1562d5c65159SKalle Valo 	u32 tsf;
1563d5c65159SKalle Valo } __packed;
1564d5c65159SKalle Valo 
1565d5c65159SKalle Valo struct hal_wbm_link_desc {
1566d5c65159SKalle Valo 	struct ath11k_buffer_addr buf_addr_info;
1567d5c65159SKalle Valo } __packed;
1568d5c65159SKalle Valo 
1569d5c65159SKalle Valo /* hal_wbm_link_desc
1570d5c65159SKalle Valo  *
1571d5c65159SKalle Valo  *	Producer: WBM
1572d5c65159SKalle Valo  *	Consumer: WBM
1573d5c65159SKalle Valo  *
1574d5c65159SKalle Valo  * buf_addr_info
1575d5c65159SKalle Valo  *		Details of the physical address of a buffer or MSDU
1576d5c65159SKalle Valo  *		link descriptor.
1577d5c65159SKalle Valo  */
1578d5c65159SKalle Valo 
1579d5c65159SKalle Valo enum hal_wbm_rel_src_module {
1580d5c65159SKalle Valo 	HAL_WBM_REL_SRC_MODULE_TQM,
1581d5c65159SKalle Valo 	HAL_WBM_REL_SRC_MODULE_RXDMA,
1582d5c65159SKalle Valo 	HAL_WBM_REL_SRC_MODULE_REO,
1583d5c65159SKalle Valo 	HAL_WBM_REL_SRC_MODULE_FW,
1584d5c65159SKalle Valo 	HAL_WBM_REL_SRC_MODULE_SW,
1585d5c65159SKalle Valo };
1586d5c65159SKalle Valo 
1587d5c65159SKalle Valo enum hal_wbm_rel_desc_type {
1588d5c65159SKalle Valo 	HAL_WBM_REL_DESC_TYPE_REL_MSDU,
1589d5c65159SKalle Valo 	HAL_WBM_REL_DESC_TYPE_MSDU_LINK,
1590d5c65159SKalle Valo 	HAL_WBM_REL_DESC_TYPE_MPDU_LINK,
1591d5c65159SKalle Valo 	HAL_WBM_REL_DESC_TYPE_MSDU_EXT,
1592d5c65159SKalle Valo 	HAL_WBM_REL_DESC_TYPE_QUEUE_EXT,
1593d5c65159SKalle Valo };
1594d5c65159SKalle Valo 
1595d5c65159SKalle Valo /* hal_wbm_rel_desc_type
1596d5c65159SKalle Valo  *
1597d5c65159SKalle Valo  * msdu_buffer
1598d5c65159SKalle Valo  *	The address points to an MSDU buffer
1599d5c65159SKalle Valo  *
1600d5c65159SKalle Valo  * msdu_link_descriptor
1601d5c65159SKalle Valo  *	The address points to an Tx MSDU link descriptor
1602d5c65159SKalle Valo  *
1603d5c65159SKalle Valo  * mpdu_link_descriptor
1604d5c65159SKalle Valo  *	The address points to an MPDU link descriptor
1605d5c65159SKalle Valo  *
1606d5c65159SKalle Valo  * msdu_ext_descriptor
1607d5c65159SKalle Valo  *	The address points to an MSDU extension descriptor
1608d5c65159SKalle Valo  *
1609d5c65159SKalle Valo  * queue_ext_descriptor
1610d5c65159SKalle Valo  *	The address points to an TQM queue extension descriptor. WBM should
1611d5c65159SKalle Valo  *	treat this is the same way as a link descriptor.
1612d5c65159SKalle Valo  */
1613d5c65159SKalle Valo 
1614d5c65159SKalle Valo enum hal_wbm_rel_bm_act {
1615d5c65159SKalle Valo 	HAL_WBM_REL_BM_ACT_PUT_IN_IDLE,
1616d5c65159SKalle Valo 	HAL_WBM_REL_BM_ACT_REL_MSDU,
1617d5c65159SKalle Valo };
1618d5c65159SKalle Valo 
1619d5c65159SKalle Valo /* hal_wbm_rel_bm_act
1620d5c65159SKalle Valo  *
1621d5c65159SKalle Valo  * put_in_idle_list
1622d5c65159SKalle Valo  *	Put the buffer or descriptor back in the idle list. In case of MSDU or
1623d5c65159SKalle Valo  *	MDPU link descriptor, BM does not need to check to release any
1624d5c65159SKalle Valo  *	individual MSDU buffers.
1625d5c65159SKalle Valo  *
1626d5c65159SKalle Valo  * release_msdu_list
1627d5c65159SKalle Valo  *	This BM action can only be used in combination with desc_type being
1628d5c65159SKalle Valo  *	msdu_link_descriptor. Field first_msdu_index points out which MSDU
1629d5c65159SKalle Valo  *	pointer in the MSDU link descriptor is the first of an MPDU that is
1630d5c65159SKalle Valo  *	released. BM shall release all the MSDU buffers linked to this first
1631d5c65159SKalle Valo  *	MSDU buffer pointer. All related MSDU buffer pointer entries shall be
1632d5c65159SKalle Valo  *	set to value 0, which represents the 'NULL' pointer. When all MSDU
1633d5c65159SKalle Valo  *	buffer pointers in the MSDU link descriptor are 'NULL', the MSDU link
1634d5c65159SKalle Valo  *	descriptor itself shall also be released.
1635d5c65159SKalle Valo  */
1636d5c65159SKalle Valo 
1637d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO0_REL_SRC_MODULE		GENMASK(2, 0)
1638d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO0_BM_ACTION			GENMASK(5, 3)
1639d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO0_DESC_TYPE			GENMASK(8, 6)
1640d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO0_FIRST_MSDU_IDX		GENMASK(12, 9)
1641d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO0_TQM_RELEASE_REASON	GENMASK(16, 13)
1642d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO0_RXDMA_PUSH_REASON		GENMASK(18, 17)
1643d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO0_RXDMA_ERROR_CODE		GENMASK(23, 19)
1644d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO0_REO_PUSH_REASON		GENMASK(25, 24)
1645d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO0_REO_ERROR_CODE		GENMASK(30, 26)
1646d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO0_WBM_INTERNAL_ERROR	BIT(31)
1647d5c65159SKalle Valo 
1648d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO1_TQM_STATUS_NUMBER		GENMASK(23, 0)
1649d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO1_TRANSMIT_COUNT		GENMASK(30, 24)
1650d5c65159SKalle Valo 
1651d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO2_ACK_FRAME_RSSI		GENMASK(7, 0)
1652d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO2_SW_REL_DETAILS_VALID	BIT(8)
1653d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO2_FIRST_MSDU		BIT(9)
1654d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO2_LAST_MSDU			BIT(10)
1655d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO2_MSDU_IN_AMSDU		BIT(11)
1656d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO2_FW_TX_NOTIF_FRAME		BIT(12)
1657d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO2_BUFFER_TIMESTAMP		GENMASK(31, 13)
1658d5c65159SKalle Valo 
1659d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO3_PEER_ID			GENMASK(15, 0)
1660d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO3_TID			GENMASK(19, 16)
1661d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO3_RING_ID			GENMASK(27, 20)
1662d5c65159SKalle Valo #define HAL_WBM_RELEASE_INFO3_LOOPING_COUNT		GENMASK(31, 28)
1663d5c65159SKalle Valo 
1664d5c65159SKalle Valo #define HAL_WBM_REL_HTT_TX_COMP_INFO0_STATUS		GENMASK(12, 9)
1665d5c65159SKalle Valo #define HAL_WBM_REL_HTT_TX_COMP_INFO0_REINJ_REASON	GENMASK(16, 13)
1666d5c65159SKalle Valo #define HAL_WBM_REL_HTT_TX_COMP_INFO0_EXP_FRAME		BIT(17)
1667d5c65159SKalle Valo 
1668d5c65159SKalle Valo struct hal_wbm_release_ring {
1669d5c65159SKalle Valo 	struct ath11k_buffer_addr buf_addr_info;
1670d5c65159SKalle Valo 	u32 info0;
1671d5c65159SKalle Valo 	u32 info1;
1672d5c65159SKalle Valo 	u32 info2;
1673d5c65159SKalle Valo 	struct hal_tx_rate_stats rate_stats;
1674d5c65159SKalle Valo 	u32 info3;
1675d5c65159SKalle Valo } __packed;
1676d5c65159SKalle Valo 
1677d5c65159SKalle Valo /* hal_wbm_release_ring
1678d5c65159SKalle Valo  *
1679d5c65159SKalle Valo  *	Producer: SW/TQM/RXDMA/REO/SWITCH
1680d5c65159SKalle Valo  *	Consumer: WBM/SW/FW
1681d5c65159SKalle Valo  *
16823fecca0eSJeff Johnson  * HTT tx status is overlaid on wbm_release ring on 4-byte words 2, 3, 4 and 5
1683d5c65159SKalle Valo  * for software based completions.
1684d5c65159SKalle Valo  *
1685d5c65159SKalle Valo  * buf_addr_info
1686d5c65159SKalle Valo  *	Details of the physical address of the buffer or link descriptor.
1687d5c65159SKalle Valo  *
1688d5c65159SKalle Valo  * release_source_module
1689d5c65159SKalle Valo  *	Indicates which module initiated the release of this buffer/descriptor.
1690d5c65159SKalle Valo  *	Values are defined in enum %HAL_WBM_REL_SRC_MODULE_.
1691d5c65159SKalle Valo  *
1692d5c65159SKalle Valo  * bm_action
1693d5c65159SKalle Valo  *	Field only valid when the field return_buffer_manager in
1694d5c65159SKalle Valo  *	Released_buff_or_desc_addr_info indicates:
1695d5c65159SKalle Valo  *		WBM_IDLE_BUF_LIST / WBM_IDLE_DESC_LIST
1696d5c65159SKalle Valo  *	Values are defined in enum %HAL_WBM_REL_BM_ACT_.
1697d5c65159SKalle Valo  *
1698d5c65159SKalle Valo  * buffer_or_desc_type
1699d5c65159SKalle Valo  *	Field only valid when WBM is marked as the return_buffer_manager in
1700d5c65159SKalle Valo  *	the Released_Buffer_address_info. Indicates that type of buffer or
1701d5c65159SKalle Valo  *	descriptor is being released. Values are in enum %HAL_WBM_REL_DESC_TYPE.
1702d5c65159SKalle Valo  *
1703d5c65159SKalle Valo  * first_msdu_index
1704d5c65159SKalle Valo  *	Field only valid for the bm_action release_msdu_list. The index of the
1705d5c65159SKalle Valo  *	first MSDU in an MSDU link descriptor all belonging to the same MPDU.
1706d5c65159SKalle Valo  *
1707d5c65159SKalle Valo  * tqm_release_reason
1708d5c65159SKalle Valo  *	Field only valid when Release_source_module is set to release_source_TQM
1709d5c65159SKalle Valo  *	Release reasons are defined in enum %HAL_WBM_TQM_REL_REASON_.
1710d5c65159SKalle Valo  *
1711d5c65159SKalle Valo  * rxdma_push_reason
1712d5c65159SKalle Valo  * reo_push_reason
1713d5c65159SKalle Valo  *	Indicates why rxdma/reo pushed the frame to this ring and values are
1714d5c65159SKalle Valo  *	defined in enum %HAL_REO_DEST_RING_PUSH_REASON_.
1715d5c65159SKalle Valo  *
1716d5c65159SKalle Valo  * rxdma_error_code
1717d5c65159SKalle Valo  *	Field only valid when 'rxdma_push_reason' set to 'error_detected'.
1718d5c65159SKalle Valo  *	Values are defined in enum %HAL_REO_ENTR_RING_RXDMA_ECODE_.
1719d5c65159SKalle Valo  *
1720d5c65159SKalle Valo  * reo_error_code
1721d5c65159SKalle Valo  *	Field only valid when 'reo_push_reason' set to 'error_detected'. Values
1722d5c65159SKalle Valo  *	are defined in enum %HAL_REO_DEST_RING_ERROR_CODE_.
1723d5c65159SKalle Valo  *
1724d5c65159SKalle Valo  * wbm_internal_error
1725d5c65159SKalle Valo  *	Is set when WBM got a buffer pointer but the action was to push it to
1726d5c65159SKalle Valo  *	the idle link descriptor ring or do link related activity OR
1727d5c65159SKalle Valo  *	Is set when WBM got a link buffer pointer but the action was to push it
1728d5c65159SKalle Valo  *	to the buffer descriptor ring.
1729d5c65159SKalle Valo  *
1730d5c65159SKalle Valo  * tqm_status_number
1731d5c65159SKalle Valo  *	The value in this field is equal to tqm_cmd_number in TQM command. It is
1732d5c65159SKalle Valo  *	used to correlate the statu with TQM commands. Only valid when
1733d5c65159SKalle Valo  *	release_source_module is TQM.
1734d5c65159SKalle Valo  *
1735d5c65159SKalle Valo  * transmit_count
1736d5c65159SKalle Valo  *	The number of times the frame has been transmitted, valid only when
1737d5c65159SKalle Valo  *	release source in TQM.
1738d5c65159SKalle Valo  *
1739d5c65159SKalle Valo  * ack_frame_rssi
1740d5c65159SKalle Valo  *	This field is only valid when the source is TQM. If this frame is
1741d5c65159SKalle Valo  *	removed as the result of the reception of an ACK or BA, this field
1742d5c65159SKalle Valo  *	indicates the RSSI of the received ACK or BA frame.
1743d5c65159SKalle Valo  *
1744d5c65159SKalle Valo  * sw_release_details_valid
1745d5c65159SKalle Valo  *	This is set when WMB got a 'release_msdu_list' command from TQM and
1746d5c65159SKalle Valo  *	return buffer manager is not WMB. WBM will then de-aggregate all MSDUs
1747d5c65159SKalle Valo  *	and pass them one at a time on to the 'buffer owner'.
1748d5c65159SKalle Valo  *
1749d5c65159SKalle Valo  * first_msdu
1750d5c65159SKalle Valo  *	Field only valid when SW_release_details_valid is set.
1751d5c65159SKalle Valo  *	When set, this MSDU is the first MSDU pointed to in the
1752d5c65159SKalle Valo  *	'release_msdu_list' command.
1753d5c65159SKalle Valo  *
1754d5c65159SKalle Valo  * last_msdu
1755d5c65159SKalle Valo  *	Field only valid when SW_release_details_valid is set.
1756d5c65159SKalle Valo  *	When set, this MSDU is the last MSDU pointed to in the
1757d5c65159SKalle Valo  *	'release_msdu_list' command.
1758d5c65159SKalle Valo  *
1759d5c65159SKalle Valo  * msdu_part_of_amsdu
1760d5c65159SKalle Valo  *	Field only valid when SW_release_details_valid is set.
1761d5c65159SKalle Valo  *	When set, this MSDU was part of an A-MSDU in MPDU
1762d5c65159SKalle Valo  *
1763d5c65159SKalle Valo  * fw_tx_notify_frame
1764d5c65159SKalle Valo  *	Field only valid when SW_release_details_valid is set.
1765d5c65159SKalle Valo  *
1766d5c65159SKalle Valo  * buffer_timestamp
1767d5c65159SKalle Valo  *	Field only valid when SW_release_details_valid is set.
1768d5c65159SKalle Valo  *	This is the Buffer_timestamp field from the
1769d5c65159SKalle Valo  *	Timestamp in units of 1024 us
1770d5c65159SKalle Valo  *
1771d5c65159SKalle Valo  * struct hal_tx_rate_stats rate_stats
1772d5c65159SKalle Valo  *	Details for command execution tracking purposes.
1773d5c65159SKalle Valo  *
1774d5c65159SKalle Valo  * sw_peer_id
1775d5c65159SKalle Valo  * tid
1776d5c65159SKalle Valo  *	Field only valid when Release_source_module is set to
1777d5c65159SKalle Valo  *	release_source_TQM
1778d5c65159SKalle Valo  *
1779d5c65159SKalle Valo  *	1) Release of msdu buffer due to drop_frame = 1. Flow is
1780d5c65159SKalle Valo  *	not fetched and hence sw_peer_id and tid = 0
1781d5c65159SKalle Valo  *
1782d5c65159SKalle Valo  *	buffer_or_desc_type = e_num 0
1783d5c65159SKalle Valo  *	MSDU_rel_buffertqm_release_reason = e_num 1
1784d5c65159SKalle Valo  *	tqm_rr_rem_cmd_rem
1785d5c65159SKalle Valo  *
1786d5c65159SKalle Valo  *	2) Release of msdu buffer due to Flow is not fetched and
1787d5c65159SKalle Valo  *	hence sw_peer_id and tid = 0
1788d5c65159SKalle Valo  *
1789d5c65159SKalle Valo  *	buffer_or_desc_type = e_num 0
1790d5c65159SKalle Valo  *	MSDU_rel_buffertqm_release_reason = e_num 1
1791d5c65159SKalle Valo  *	tqm_rr_rem_cmd_rem
1792d5c65159SKalle Valo  *
1793d5c65159SKalle Valo  *	3) Release of msdu link due to remove_mpdu or acked_mpdu
1794d5c65159SKalle Valo  *	command.
1795d5c65159SKalle Valo  *
1796d5c65159SKalle Valo  *	buffer_or_desc_type = e_num1
1797d5c65159SKalle Valo  *	msdu_link_descriptortqm_release_reason can be:e_num 1
1798d5c65159SKalle Valo  *	tqm_rr_rem_cmd_reme_num 2 tqm_rr_rem_cmd_tx
1799d5c65159SKalle Valo  *	e_num 3 tqm_rr_rem_cmd_notxe_num 4 tqm_rr_rem_cmd_aged
1800d5c65159SKalle Valo  *
1801d5c65159SKalle Valo  *	This field represents the TID from the TX_MSDU_FLOW
1802d5c65159SKalle Valo  *	descriptor or TX_MPDU_QUEUE descriptor
1803d5c65159SKalle Valo  *
1804d5c65159SKalle Valo  * rind_id
1805d5c65159SKalle Valo  *	For debugging.
1806d5c65159SKalle Valo  *	This field is filled in by the SRNG module.
1807d5c65159SKalle Valo  *	It help to identify the ring that is being looked
1808d5c65159SKalle Valo  *
1809d5c65159SKalle Valo  * looping_count
1810d5c65159SKalle Valo  *	A count value that indicates the number of times the
1811d5c65159SKalle Valo  *	producer of entries into the Buffer Manager Ring has looped
1812d5c65159SKalle Valo  *	around the ring.
1813d5c65159SKalle Valo  *
1814d5c65159SKalle Valo  *	At initialization time, this value is set to 0. On the
1815d5c65159SKalle Valo  *	first loop, this value is set to 1. After the max value is
1816d5c65159SKalle Valo  *	reached allowed by the number of bits for this field, the
1817d5c65159SKalle Valo  *	count value continues with 0 again.
1818d5c65159SKalle Valo  *
1819d5c65159SKalle Valo  *	In case SW is the consumer of the ring entries, it can
1820d5c65159SKalle Valo  *	use this field to figure out up to where the producer of
1821d5c65159SKalle Valo  *	entries has created new entries. This eliminates the need to
1822d5c65159SKalle Valo  *	check where the head pointer' of the ring is located once
1823d5c65159SKalle Valo  *	the SW starts processing an interrupt indicating that new
1824d5c65159SKalle Valo  *	entries have been put into this ring...
1825d5c65159SKalle Valo  *
1826d5c65159SKalle Valo  *	Also note that SW if it wants only needs to look at the
1827d5c65159SKalle Valo  *	LSB bit of this count value.
1828d5c65159SKalle Valo  */
1829d5c65159SKalle Valo 
1830d5c65159SKalle Valo /**
1831d5c65159SKalle Valo  * enum hal_wbm_tqm_rel_reason - TQM release reason code
1832d5c65159SKalle Valo  * @HAL_WBM_TQM_REL_REASON_FRAME_ACKED: ACK or BACK received for the frame
1833d5c65159SKalle Valo  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_MPDU: Command remove_mpdus initiated by SW
1834d5c65159SKalle Valo  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_TX: Command remove transmitted_mpdus
1835d5c65159SKalle Valo  *	initiated by sw.
1836d5c65159SKalle Valo  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_NOTX: Command remove untransmitted_mpdus
1837d5c65159SKalle Valo  *	initiated by sw.
1838d5c65159SKalle Valo  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_AGED_FRAMES: Command remove aged msdus or
1839d5c65159SKalle Valo  *	mpdus.
1840d5c65159SKalle Valo  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_RESEAON1: Remove command initiated by
1841d5c65159SKalle Valo  *	fw with fw_reason1.
1842d5c65159SKalle Valo  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_RESEAON2: Remove command initiated by
1843d5c65159SKalle Valo  *	fw with fw_reason2.
1844d5c65159SKalle Valo  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_RESEAON3: Remove command initiated by
1845d5c65159SKalle Valo  *	fw with fw_reason3.
1846d5c65159SKalle Valo  */
1847d5c65159SKalle Valo enum hal_wbm_tqm_rel_reason {
1848d5c65159SKalle Valo 	HAL_WBM_TQM_REL_REASON_FRAME_ACKED,
1849d5c65159SKalle Valo 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_MPDU,
1850d5c65159SKalle Valo 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_TX,
1851d5c65159SKalle Valo 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_NOTX,
1852d5c65159SKalle Valo 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_AGED_FRAMES,
1853d5c65159SKalle Valo 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_RESEAON1,
1854d5c65159SKalle Valo 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_RESEAON2,
1855d5c65159SKalle Valo 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_RESEAON3,
1856d5c65159SKalle Valo };
1857d5c65159SKalle Valo 
1858d5c65159SKalle Valo struct hal_wbm_buffer_ring {
1859d5c65159SKalle Valo 	struct ath11k_buffer_addr buf_addr_info;
1860d5c65159SKalle Valo };
1861d5c65159SKalle Valo 
1862d5c65159SKalle Valo enum hal_desc_owner {
1863d5c65159SKalle Valo 	HAL_DESC_OWNER_WBM,
1864d5c65159SKalle Valo 	HAL_DESC_OWNER_SW,
1865d5c65159SKalle Valo 	HAL_DESC_OWNER_TQM,
1866d5c65159SKalle Valo 	HAL_DESC_OWNER_RXDMA,
1867d5c65159SKalle Valo 	HAL_DESC_OWNER_REO,
1868d5c65159SKalle Valo 	HAL_DESC_OWNER_SWITCH,
1869d5c65159SKalle Valo };
1870d5c65159SKalle Valo 
1871d5c65159SKalle Valo enum hal_desc_buf_type {
1872d5c65159SKalle Valo 	HAL_DESC_BUF_TYPE_TX_MSDU_LINK,
1873d5c65159SKalle Valo 	HAL_DESC_BUF_TYPE_TX_MPDU_LINK,
1874d5c65159SKalle Valo 	HAL_DESC_BUF_TYPE_TX_MPDU_QUEUE_HEAD,
1875d5c65159SKalle Valo 	HAL_DESC_BUF_TYPE_TX_MPDU_QUEUE_EXT,
1876d5c65159SKalle Valo 	HAL_DESC_BUF_TYPE_TX_FLOW,
1877d5c65159SKalle Valo 	HAL_DESC_BUF_TYPE_TX_BUFFER,
1878d5c65159SKalle Valo 	HAL_DESC_BUF_TYPE_RX_MSDU_LINK,
1879d5c65159SKalle Valo 	HAL_DESC_BUF_TYPE_RX_MPDU_LINK,
1880d5c65159SKalle Valo 	HAL_DESC_BUF_TYPE_RX_REO_QUEUE,
1881d5c65159SKalle Valo 	HAL_DESC_BUF_TYPE_RX_REO_QUEUE_EXT,
1882d5c65159SKalle Valo 	HAL_DESC_BUF_TYPE_RX_BUFFER,
1883d5c65159SKalle Valo 	HAL_DESC_BUF_TYPE_IDLE_LINK,
1884d5c65159SKalle Valo };
1885d5c65159SKalle Valo 
1886d5c65159SKalle Valo #define HAL_DESC_REO_OWNED		4
1887d5c65159SKalle Valo #define HAL_DESC_REO_QUEUE_DESC		8
1888d5c65159SKalle Valo #define HAL_DESC_REO_QUEUE_EXT_DESC	9
1889d5c65159SKalle Valo #define HAL_DESC_REO_NON_QOS_TID	16
1890d5c65159SKalle Valo 
1891d5c65159SKalle Valo #define HAL_DESC_HDR_INFO0_OWNER	GENMASK(3, 0)
1892d5c65159SKalle Valo #define HAL_DESC_HDR_INFO0_BUF_TYPE	GENMASK(7, 4)
1893d5c65159SKalle Valo #define HAL_DESC_HDR_INFO0_DBG_RESERVED	GENMASK(31, 8)
1894d5c65159SKalle Valo 
1895d5c65159SKalle Valo struct hal_desc_header {
1896d5c65159SKalle Valo 	u32 info0;
1897d5c65159SKalle Valo } __packed;
1898d5c65159SKalle Valo 
1899d5c65159SKalle Valo struct hal_rx_mpdu_link_ptr {
1900d5c65159SKalle Valo 	struct ath11k_buffer_addr addr_info;
1901d5c65159SKalle Valo } __packed;
1902d5c65159SKalle Valo 
1903d5c65159SKalle Valo struct hal_rx_msdu_details {
1904d5c65159SKalle Valo 	struct ath11k_buffer_addr buf_addr_info;
1905d5c65159SKalle Valo 	struct rx_msdu_desc rx_msdu_info;
1906d5c65159SKalle Valo } __packed;
1907d5c65159SKalle Valo 
1908d5c65159SKalle Valo #define HAL_RX_MSDU_LNK_INFO0_RX_QUEUE_NUMBER		GENMASK(15, 0)
1909d5c65159SKalle Valo #define HAL_RX_MSDU_LNK_INFO0_FIRST_MSDU_LNK		BIT(16)
1910d5c65159SKalle Valo 
1911d5c65159SKalle Valo struct hal_rx_msdu_link {
1912d5c65159SKalle Valo 	struct hal_desc_header desc_hdr;
1913d5c65159SKalle Valo 	struct ath11k_buffer_addr buf_addr_info;
1914d5c65159SKalle Valo 	u32 info0;
1915d5c65159SKalle Valo 	u32 pn[4];
1916d5c65159SKalle Valo 	struct hal_rx_msdu_details msdu_link[6];
1917d5c65159SKalle Valo } __packed;
1918d5c65159SKalle Valo 
1919d5c65159SKalle Valo struct hal_rx_reo_queue_ext {
1920d5c65159SKalle Valo 	struct hal_desc_header desc_hdr;
1921d5c65159SKalle Valo 	u32 rsvd;
1922d5c65159SKalle Valo 	struct hal_rx_mpdu_link_ptr mpdu_link[15];
1923d5c65159SKalle Valo } __packed;
1924d5c65159SKalle Valo 
1925d5c65159SKalle Valo /* hal_rx_reo_queue_ext
1926d5c65159SKalle Valo  *	Consumer: REO
1927d5c65159SKalle Valo  *	Producer: REO
1928d5c65159SKalle Valo  *
1929d5c65159SKalle Valo  * descriptor_header
1930d5c65159SKalle Valo  *	Details about which module owns this struct.
1931d5c65159SKalle Valo  *
1932d5c65159SKalle Valo  * mpdu_link
1933d5c65159SKalle Valo  *	Pointer to the next MPDU_link descriptor in the MPDU queue.
1934d5c65159SKalle Valo  */
1935d5c65159SKalle Valo 
1936d5c65159SKalle Valo enum hal_rx_reo_queue_pn_size {
1937d5c65159SKalle Valo 	HAL_RX_REO_QUEUE_PN_SIZE_24,
1938d5c65159SKalle Valo 	HAL_RX_REO_QUEUE_PN_SIZE_48,
1939d5c65159SKalle Valo 	HAL_RX_REO_QUEUE_PN_SIZE_128,
1940d5c65159SKalle Valo };
1941d5c65159SKalle Valo 
1942d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_RX_QUEUE_NUMBER		GENMASK(15, 0)
1943d5c65159SKalle Valo 
1944d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_VLD			BIT(0)
1945d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_ASSOC_LNK_DESC_COUNTER	GENMASK(2, 1)
1946d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_DIS_DUP_DETECTION	BIT(3)
1947d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_SOFT_REORDER_EN		BIT(4)
1948d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_AC			GENMASK(6, 5)
1949d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_BAR			BIT(7)
1950d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_RETRY			BIT(8)
1951d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_CHECK_2K_MODE		BIT(9)
1952d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_OOR_MODE			BIT(10)
1953d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_BA_WINDOW_SIZE		GENMASK(18, 11)
1954d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_PN_CHECK			BIT(19)
1955d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_EVEN_PN			BIT(20)
1956d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_UNEVEN_PN		BIT(21)
1957d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_PN_HANDLE_ENABLE		BIT(22)
1958d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_PN_SIZE			GENMASK(24, 23)
1959d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO0_IGNORE_AMPDU_FLG		BIT(25)
1960d5c65159SKalle Valo 
1961d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO1_SVLD			BIT(0)
1962d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO1_SSN			GENMASK(12, 1)
1963d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO1_CURRENT_IDX		GENMASK(20, 13)
1964d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO1_SEQ_2K_ERR		BIT(21)
1965d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO1_PN_ERR			BIT(22)
1966d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO1_PN_VALID			BIT(31)
1967d5c65159SKalle Valo 
1968d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO2_MPDU_COUNT		GENMASK(6, 0)
1969d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO2_MSDU_COUNT		(31, 7)
1970d5c65159SKalle Valo 
1971d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO3_TIMEOUT_COUNT		GENMASK(9, 4)
1972d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO3_FWD_DUE_TO_BAR_CNT	GENMASK(15, 10)
1973ab041d06SKarthikeyan Periyasamy #define HAL_RX_REO_QUEUE_INFO3_DUPLICATE_COUNT		GENMASK(31, 16)
1974d5c65159SKalle Valo 
1975d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO4_FRAME_IN_ORD_COUNT	GENMASK(23, 0)
1976d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO4_BAR_RECVD_COUNT		GENMASK(31, 24)
1977d5c65159SKalle Valo 
1978d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO5_LATE_RX_MPDU_COUNT	GENMASK(11, 0)
1979d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO5_WINDOW_JUMP_2K		GENMASK(15, 12)
1980d5c65159SKalle Valo #define HAL_RX_REO_QUEUE_INFO5_HOLE_COUNT		GENMASK(31, 16)
1981d5c65159SKalle Valo 
1982d5c65159SKalle Valo struct hal_rx_reo_queue {
1983d5c65159SKalle Valo 	struct hal_desc_header desc_hdr;
1984d5c65159SKalle Valo 	u32 rx_queue_num;
1985d5c65159SKalle Valo 	u32 info0;
1986d5c65159SKalle Valo 	u32 info1;
1987d5c65159SKalle Valo 	u32 pn[4];
1988d5c65159SKalle Valo 	u32 last_rx_enqueue_timestamp;
1989d5c65159SKalle Valo 	u32 last_rx_dequeue_timestamp;
1990d5c65159SKalle Valo 	u32 next_aging_queue[2];
1991d5c65159SKalle Valo 	u32 prev_aging_queue[2];
1992d5c65159SKalle Valo 	u32 rx_bitmap[8];
1993d5c65159SKalle Valo 	u32 info2;
1994d5c65159SKalle Valo 	u32 info3;
1995d5c65159SKalle Valo 	u32 info4;
1996d5c65159SKalle Valo 	u32 processed_mpdus;
1997d5c65159SKalle Valo 	u32 processed_msdus;
1998d5c65159SKalle Valo 	u32 processed_total_bytes;
1999d5c65159SKalle Valo 	u32 info5;
2000d5c65159SKalle Valo 	u32 rsvd[3];
200114dd3a71SGustavo A. R. Silva 	struct hal_rx_reo_queue_ext ext_desc[];
2002d5c65159SKalle Valo } __packed;
2003d5c65159SKalle Valo 
2004d5c65159SKalle Valo /* hal_rx_reo_queue
2005d5c65159SKalle Valo  *
2006d5c65159SKalle Valo  * descriptor_header
2007d5c65159SKalle Valo  *	Details about which module owns this struct. Note that sub field
2008d5c65159SKalle Valo  *	Buffer_type shall be set to receive_reo_queue_descriptor.
2009d5c65159SKalle Valo  *
2010d5c65159SKalle Valo  * receive_queue_number
2011d5c65159SKalle Valo  *	Indicates the MPDU queue ID to which this MPDU link descriptor belongs.
2012d5c65159SKalle Valo  *
2013d5c65159SKalle Valo  * vld
2014d5c65159SKalle Valo  *	Valid bit indicating a session is established and the queue descriptor
2015d5c65159SKalle Valo  *	is valid.
2016d5c65159SKalle Valo  * associated_link_descriptor_counter
2017d5c65159SKalle Valo  *	Indicates which of the 3 link descriptor counters shall be incremented
2018d5c65159SKalle Valo  *	or decremented when link descriptors are added or removed from this
2019d5c65159SKalle Valo  *	flow queue.
2020d5c65159SKalle Valo  * disable_duplicate_detection
2021d5c65159SKalle Valo  *	When set, do not perform any duplicate detection.
2022d5c65159SKalle Valo  * soft_reorder_enable
2023d5c65159SKalle Valo  *	When set, REO has been instructed to not perform the actual re-ordering
2024d5c65159SKalle Valo  *	of frames for this queue, but just to insert the reorder opcodes.
2025d5c65159SKalle Valo  * ac
2026d5c65159SKalle Valo  *	Indicates the access category of the queue descriptor.
2027d5c65159SKalle Valo  * bar
2028d5c65159SKalle Valo  *	Indicates if BAR has been received.
2029d5c65159SKalle Valo  * retry
2030d5c65159SKalle Valo  *	Retry bit is checked if this bit is set.
2031d5c65159SKalle Valo  * chk_2k_mode
2032d5c65159SKalle Valo  *	Indicates what type of operation is expected from Reo when the received
2033d5c65159SKalle Valo  *	frame SN falls within the 2K window.
2034d5c65159SKalle Valo  * oor_mode
2035d5c65159SKalle Valo  *	Indicates what type of operation is expected when the received frame
2036d5c65159SKalle Valo  *	falls within the OOR window.
2037d5c65159SKalle Valo  * ba_window_size
2038d5c65159SKalle Valo  *	Indicates the negotiated (window size + 1). Max of 256 bits.
2039d5c65159SKalle Valo  *
2040d5c65159SKalle Valo  *	A value 255 means 256 bitmap, 63 means 64 bitmap, 0 (means non-BA
2041d5c65159SKalle Valo  *	session, with window size of 0). The 3 values here are the main values
2042d5c65159SKalle Valo  *	validated, but other values should work as well.
2043d5c65159SKalle Valo  *
2044d5c65159SKalle Valo  *	A BA window size of 0 (=> one frame entry bitmat), means that there is
2045d5c65159SKalle Valo  *	no additional rx_reo_queue_ext desc. following rx_reo_queue in memory.
2046d5c65159SKalle Valo  *	A BA window size of 1 - 105, means that there is 1 rx_reo_queue_ext.
2047d5c65159SKalle Valo  *	A BA window size of 106 - 210, means that there are 2 rx_reo_queue_ext.
2048d5c65159SKalle Valo  *	A BA window size of 211 - 256, means that there are 3 rx_reo_queue_ext.
2049d5c65159SKalle Valo  * pn_check_needed, pn_shall_be_even, pn_shall_be_uneven, pn_handling_enable,
2050d5c65159SKalle Valo  * pn_size
2051d5c65159SKalle Valo  *	REO shall perform the PN increment check, even number check, uneven
2052d5c65159SKalle Valo  *	number check, PN error check and size of the PN field check.
2053d5c65159SKalle Valo  * ignore_ampdu_flag
2054d5c65159SKalle Valo  *	REO shall ignore the ampdu_flag on entrance descriptor for this queue.
2055d5c65159SKalle Valo  *
2056d5c65159SKalle Valo  * svld
2057d5c65159SKalle Valo  *	Sequence number in next field is valid one.
2058d5c65159SKalle Valo  * ssn
2059d5c65159SKalle Valo  *	 Starting Sequence number of the session.
2060d5c65159SKalle Valo  * current_index
2061d5c65159SKalle Valo  *	Points to last forwarded packet
2062d5c65159SKalle Valo  * seq_2k_error_detected_flag
2063d5c65159SKalle Valo  *	REO has detected a 2k error jump in the sequence number and from that
2064d5c65159SKalle Valo  *	moment forward, all new frames are forwarded directly to FW, without
2065d5c65159SKalle Valo  *	duplicate detect, reordering, etc.
2066d5c65159SKalle Valo  * pn_error_detected_flag
2067d5c65159SKalle Valo  *	REO has detected a PN error.
2068d5c65159SKalle Valo  */
2069d5c65159SKalle Valo 
2070d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_QUEUE_ADDR_HI		GENMASK(7, 0)
2071d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_RX_QUEUE_NUM		BIT(8)
2072d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_VLD			BIT(9)
2073d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_ASSOC_LNK_DESC_CNT	BIT(10)
2074d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_DIS_DUP_DETECTION	BIT(11)
2075d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_SOFT_REORDER_EN		BIT(12)
2076d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_AC			BIT(13)
2077d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_BAR			BIT(14)
2078d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_RETRY			BIT(15)
2079d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_CHECK_2K_MODE		BIT(16)
2080d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_OOR_MODE			BIT(17)
2081d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_BA_WINDOW_SIZE		BIT(18)
2082d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_PN_CHECK			BIT(19)
2083d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_EVEN_PN			BIT(20)
2084d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_UNEVEN_PN		BIT(21)
2085d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_PN_HANDLE_ENABLE		BIT(22)
2086d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_PN_SIZE			BIT(23)
2087d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_IGNORE_AMPDU_FLG		BIT(24)
2088d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_SVLD			BIT(25)
2089d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_SSN			BIT(26)
2090d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_SEQ_2K_ERR		BIT(27)
2091d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_PN_ERR			BIT(28)
2092d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_PN_VALID			BIT(29)
2093d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_PN			BIT(30)
2094d5c65159SKalle Valo 
2095d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_RX_QUEUE_NUMBER		GENMASK(15, 0)
2096d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_VLD				BIT(16)
2097d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_ASSOC_LNK_DESC_COUNTER	GENMASK(18, 17)
2098d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_DIS_DUP_DETECTION		BIT(19)
2099d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_SOFT_REORDER_EN		BIT(20)
2100d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_AC				GENMASK(22, 21)
2101d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_BAR				BIT(23)
2102d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_RETRY			BIT(24)
2103d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_CHECK_2K_MODE		BIT(25)
2104d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_OOR_MODE			BIT(26)
2105d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_PN_CHECK			BIT(27)
2106d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_EVEN_PN			BIT(28)
2107d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_UNEVEN_PN			BIT(29)
2108d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_PN_HANDLE_ENABLE		BIT(30)
2109d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO1_IGNORE_AMPDU_FLG		BIT(31)
2110d5c65159SKalle Valo 
2111d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO2_BA_WINDOW_SIZE		GENMASK(7, 0)
2112d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO2_PN_SIZE			GENMASK(9, 8)
2113d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO2_SVLD				BIT(10)
2114d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO2_SSN				GENMASK(22, 11)
2115d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO2_SEQ_2K_ERR			BIT(23)
2116d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO2_PN_ERR			BIT(24)
2117d5c65159SKalle Valo #define HAL_REO_UPD_RX_QUEUE_INFO2_PN_VALID			BIT(25)
2118d5c65159SKalle Valo 
2119d5c65159SKalle Valo struct hal_reo_update_rx_queue {
2120d5c65159SKalle Valo 	struct hal_reo_cmd_hdr cmd;
2121d5c65159SKalle Valo 	u32 queue_addr_lo;
2122d5c65159SKalle Valo 	u32 info0;
2123d5c65159SKalle Valo 	u32 info1;
2124d5c65159SKalle Valo 	u32 info2;
2125d5c65159SKalle Valo 	u32 pn[4];
2126d5c65159SKalle Valo } __packed;
2127d5c65159SKalle Valo 
2128d5c65159SKalle Valo #define HAL_REO_UNBLOCK_CACHE_INFO0_UNBLK_CACHE		BIT(0)
2129d5c65159SKalle Valo #define HAL_REO_UNBLOCK_CACHE_INFO0_RESOURCE_IDX	GENMASK(2, 1)
2130d5c65159SKalle Valo 
2131d5c65159SKalle Valo struct hal_reo_unblock_cache {
2132d5c65159SKalle Valo 	struct hal_reo_cmd_hdr cmd;
2133d5c65159SKalle Valo 	u32 info0;
2134d5c65159SKalle Valo 	u32 rsvd[7];
2135d5c65159SKalle Valo } __packed;
2136d5c65159SKalle Valo 
2137d5c65159SKalle Valo enum hal_reo_exec_status {
2138d5c65159SKalle Valo 	HAL_REO_EXEC_STATUS_SUCCESS,
2139d5c65159SKalle Valo 	HAL_REO_EXEC_STATUS_BLOCKED,
2140d5c65159SKalle Valo 	HAL_REO_EXEC_STATUS_FAILED,
2141d5c65159SKalle Valo 	HAL_REO_EXEC_STATUS_RESOURCE_BLOCKED,
2142d5c65159SKalle Valo };
2143d5c65159SKalle Valo 
2144d5c65159SKalle Valo #define HAL_REO_STATUS_HDR_INFO0_STATUS_NUM	GENMASK(15, 0)
2145d5c65159SKalle Valo #define HAL_REO_STATUS_HDR_INFO0_EXEC_TIME	GENMASK(25, 16)
2146d5c65159SKalle Valo #define HAL_REO_STATUS_HDR_INFO0_EXEC_STATUS	GENMASK(27, 26)
2147d5c65159SKalle Valo 
2148d5c65159SKalle Valo struct hal_reo_status_hdr {
2149d5c65159SKalle Valo 	u32 info0;
2150d5c65159SKalle Valo 	u32 timestamp;
2151d5c65159SKalle Valo } __packed;
2152d5c65159SKalle Valo 
2153d5c65159SKalle Valo /* hal_reo_status_hdr
2154d5c65159SKalle Valo  *		Producer: REO
2155d5c65159SKalle Valo  *		Consumer: SW
2156d5c65159SKalle Valo  *
2157d5c65159SKalle Valo  * status_num
2158d5c65159SKalle Valo  *		The value in this field is equal to value of the reo command
2159d5c65159SKalle Valo  *		number. This field helps to correlate the statuses with the REO
2160d5c65159SKalle Valo  *		commands.
2161d5c65159SKalle Valo  *
2162d5c65159SKalle Valo  * execution_time (in us)
21633fecca0eSJeff Johnson  *		The amount of time REO took to execute the command. Note that
2164d5c65159SKalle Valo  *		this time does not include the duration of the command waiting
2165d5c65159SKalle Valo  *		in the command ring, before the execution started.
2166d5c65159SKalle Valo  *
2167d5c65159SKalle Valo  * execution_status
2168d5c65159SKalle Valo  *		Execution status of the command. Values are defined in
2169d5c65159SKalle Valo  *		enum %HAL_REO_EXEC_STATUS_.
2170d5c65159SKalle Valo  */
2171d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO0_SSN		GENMASK(11, 0)
2172d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO0_CUR_IDX		GENMASK(19, 12)
2173d5c65159SKalle Valo 
2174d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO1_MPDU_COUNT		GENMASK(6, 0)
2175d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO1_MSDU_COUNT		GENMASK(31, 7)
2176d5c65159SKalle Valo 
2177d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO2_TIMEOUT_COUNT	GENMASK(9, 4)
2178d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO2_FDTB_COUNT		GENMASK(15, 10)
2179d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO2_DUPLICATE_COUNT	GENMASK(31, 16)
2180d5c65159SKalle Valo 
2181d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO3_FIO_COUNT		GENMASK(23, 0)
2182d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO3_BAR_RCVD_CNT	GENMASK(31, 24)
2183d5c65159SKalle Valo 
2184d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO4_LATE_RX_MPDU	GENMASK(11, 0)
2185d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO4_WINDOW_JMP2K	GENMASK(15, 12)
2186d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO4_HOLE_COUNT		GENMASK(31, 16)
2187d5c65159SKalle Valo 
2188d5c65159SKalle Valo #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO5_LOOPING_CNT	GENMASK(31, 28)
2189d5c65159SKalle Valo 
2190d5c65159SKalle Valo struct hal_reo_get_queue_stats_status {
2191d5c65159SKalle Valo 	struct hal_reo_status_hdr hdr;
2192d5c65159SKalle Valo 	u32 info0;
2193d5c65159SKalle Valo 	u32 pn[4];
2194d5c65159SKalle Valo 	u32 last_rx_enqueue_timestamp;
2195d5c65159SKalle Valo 	u32 last_rx_dequeue_timestamp;
2196d5c65159SKalle Valo 	u32 rx_bitmap[8];
2197d5c65159SKalle Valo 	u32 info1;
2198d5c65159SKalle Valo 	u32 info2;
2199d5c65159SKalle Valo 	u32 info3;
2200d5c65159SKalle Valo 	u32 num_mpdu_frames;
2201d5c65159SKalle Valo 	u32 num_msdu_frames;
2202d5c65159SKalle Valo 	u32 total_bytes;
2203d5c65159SKalle Valo 	u32 info4;
2204d5c65159SKalle Valo 	u32 info5;
2205d5c65159SKalle Valo } __packed;
2206d5c65159SKalle Valo 
2207d5c65159SKalle Valo /* hal_reo_get_queue_stats_status
2208d5c65159SKalle Valo  *		Producer: REO
2209d5c65159SKalle Valo  *		Consumer: SW
2210d5c65159SKalle Valo  *
2211d5c65159SKalle Valo  * status_hdr
2212d5c65159SKalle Valo  *		Details that can link this status with the original command. It
2213d5c65159SKalle Valo  *		also contains info on how long REO took to execute this command.
2214d5c65159SKalle Valo  *
2215d5c65159SKalle Valo  * ssn
2216d5c65159SKalle Valo  *		Starting Sequence number of the session, this changes whenever
2217d5c65159SKalle Valo  *		window moves (can be filled by SW then maintained by REO).
2218d5c65159SKalle Valo  *
2219d5c65159SKalle Valo  * current_index
2220d5c65159SKalle Valo  *		Points to last forwarded packet.
2221d5c65159SKalle Valo  *
2222d5c65159SKalle Valo  * pn
2223d5c65159SKalle Valo  *		Bits of the PN number.
2224d5c65159SKalle Valo  *
2225d5c65159SKalle Valo  * last_rx_enqueue_timestamp
2226d5c65159SKalle Valo  * last_rx_dequeue_timestamp
2227d5c65159SKalle Valo  *		Timestamp of arrival of the last MPDU for this queue and
2228d5c65159SKalle Valo  *		Timestamp of forwarding an MPDU accordingly.
2229d5c65159SKalle Valo  *
2230d5c65159SKalle Valo  * rx_bitmap
2231d5c65159SKalle Valo  *		When a bit is set, the corresponding frame is currently held
2232d5c65159SKalle Valo  *		in the re-order queue. The bitmap  is Fully managed by HW.
2233d5c65159SKalle Valo  *
2234d5c65159SKalle Valo  * current_mpdu_count
2235d5c65159SKalle Valo  * current_msdu_count
2236d5c65159SKalle Valo  *		The number of MPDUs and MSDUs in the queue.
2237d5c65159SKalle Valo  *
2238d5c65159SKalle Valo  * timeout_count
2239d5c65159SKalle Valo  *		The number of times REO started forwarding frames even though
2240d5c65159SKalle Valo  *		there is a hole in the bitmap. Forwarding reason is timeout.
2241d5c65159SKalle Valo  *
2242d5c65159SKalle Valo  * forward_due_to_bar_count
2243d5c65159SKalle Valo  *		The number of times REO started forwarding frames even though
2244d5c65159SKalle Valo  *		there is a hole in the bitmap. Fwd reason is reception of BAR.
2245d5c65159SKalle Valo  *
2246d5c65159SKalle Valo  * duplicate_count
2247d5c65159SKalle Valo  *		The number of duplicate frames that have been detected.
2248d5c65159SKalle Valo  *
2249d5c65159SKalle Valo  * frames_in_order_count
2250d5c65159SKalle Valo  *		The number of frames that have been received in order (without
2251d5c65159SKalle Valo  *		a hole that prevented them from being forwarded immediately).
2252d5c65159SKalle Valo  *
2253d5c65159SKalle Valo  * bar_received_count
2254d5c65159SKalle Valo  *		The number of times a BAR frame is received.
2255d5c65159SKalle Valo  *
2256d5c65159SKalle Valo  * mpdu_frames_processed_count
2257d5c65159SKalle Valo  * msdu_frames_processed_count
2258d5c65159SKalle Valo  *		The total number of MPDU/MSDU frames that have been processed.
2259d5c65159SKalle Valo  *
2260d5c65159SKalle Valo  * total_bytes
2261d5c65159SKalle Valo  *		An approximation of the number of bytes received for this queue.
2262d5c65159SKalle Valo  *
2263d5c65159SKalle Valo  * late_receive_mpdu_count
2264d5c65159SKalle Valo  *		The number of MPDUs received after the window had already moved
2265d5c65159SKalle Valo  *		on. The 'late' sequence window is defined as
2266d5c65159SKalle Valo  *		(Window SSN - 256) - (Window SSN - 1).
2267d5c65159SKalle Valo  *
2268d5c65159SKalle Valo  * window_jump_2k
2269d5c65159SKalle Valo  *		The number of times the window moved more than 2K
2270d5c65159SKalle Valo  *
2271d5c65159SKalle Valo  * hole_count
2272d5c65159SKalle Valo  *		The number of times a hole was created in the receive bitmap.
2273d5c65159SKalle Valo  *
2274d5c65159SKalle Valo  * looping_count
2275d5c65159SKalle Valo  *		A count value that indicates the number of times the producer of
2276d5c65159SKalle Valo  *		entries into this Ring has looped around the ring.
2277d5c65159SKalle Valo  */
2278d5c65159SKalle Valo 
2279d5c65159SKalle Valo #define HAL_REO_STATUS_LOOP_CNT			GENMASK(31, 28)
2280d5c65159SKalle Valo 
2281d5c65159SKalle Valo #define HAL_REO_FLUSH_QUEUE_INFO0_ERR_DETECTED	BIT(0)
2282d5c65159SKalle Valo #define HAL_REO_FLUSH_QUEUE_INFO0_RSVD		GENMASK(31, 1)
2283d5c65159SKalle Valo #define HAL_REO_FLUSH_QUEUE_INFO1_RSVD		GENMASK(27, 0)
2284d5c65159SKalle Valo 
2285d5c65159SKalle Valo struct hal_reo_flush_queue_status {
2286d5c65159SKalle Valo 	struct hal_reo_status_hdr hdr;
2287d5c65159SKalle Valo 	u32 info0;
2288d5c65159SKalle Valo 	u32 rsvd0[21];
2289d5c65159SKalle Valo 	u32 info1;
2290d5c65159SKalle Valo } __packed;
2291d5c65159SKalle Valo 
2292d5c65159SKalle Valo /* hal_reo_flush_queue_status
2293d5c65159SKalle Valo  *		Producer: REO
2294d5c65159SKalle Valo  *		Consumer: SW
2295d5c65159SKalle Valo  *
2296d5c65159SKalle Valo  * status_hdr
2297d5c65159SKalle Valo  *		Details that can link this status with the original command. It
2298d5c65159SKalle Valo  *		also contains info on how long REO took to execute this command.
2299d5c65159SKalle Valo  *
2300d5c65159SKalle Valo  * error_detected
2301d5c65159SKalle Valo  *		Status of blocking resource
2302d5c65159SKalle Valo  *
2303d5c65159SKalle Valo  *		0 - No error has been detected while executing this command
2304d5c65159SKalle Valo  *		1 - Error detected. The resource to be used for blocking was
2305d5c65159SKalle Valo  *		    already in use.
2306d5c65159SKalle Valo  *
2307d5c65159SKalle Valo  * looping_count
2308d5c65159SKalle Valo  *		A count value that indicates the number of times the producer of
2309d5c65159SKalle Valo  *		entries into this Ring has looped around the ring.
2310d5c65159SKalle Valo  */
2311d5c65159SKalle Valo 
2312d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_IS_ERR			BIT(0)
2313d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_BLOCK_ERR_CODE		GENMASK(2, 1)
2314d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_FLUSH_STATUS_HIT	BIT(8)
2315d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_FLUSH_DESC_TYPE	GENMASK(11, 9)
2316d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_FLUSH_CLIENT_ID	GENMASK(15, 12)
2317d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_FLUSH_ERR		GENMASK(17, 16)
2318d5c65159SKalle Valo #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_FLUSH_COUNT		GENMASK(25, 18)
2319d5c65159SKalle Valo 
2320d5c65159SKalle Valo struct hal_reo_flush_cache_status {
2321d5c65159SKalle Valo 	struct hal_reo_status_hdr hdr;
2322d5c65159SKalle Valo 	u32 info0;
2323d5c65159SKalle Valo 	u32 rsvd0[21];
2324d5c65159SKalle Valo 	u32 info1;
2325d5c65159SKalle Valo } __packed;
2326d5c65159SKalle Valo 
2327d5c65159SKalle Valo /* hal_reo_flush_cache_status
2328d5c65159SKalle Valo  *		Producer: REO
2329d5c65159SKalle Valo  *		Consumer: SW
2330d5c65159SKalle Valo  *
2331d5c65159SKalle Valo  * status_hdr
2332d5c65159SKalle Valo  *		Details that can link this status with the original command. It
2333d5c65159SKalle Valo  *		also contains info on how long REO took to execute this command.
2334d5c65159SKalle Valo  *
2335d5c65159SKalle Valo  * error_detected
2336d5c65159SKalle Valo  *		Status for blocking resource handling
2337d5c65159SKalle Valo  *
2338d5c65159SKalle Valo  *		0 - No error has been detected while executing this command
2339d5c65159SKalle Valo  *		1 - An error in the blocking resource management was detected
2340d5c65159SKalle Valo  *
2341d5c65159SKalle Valo  * block_error_details
2342d5c65159SKalle Valo  *		only valid when error_detected is set
2343d5c65159SKalle Valo  *
2344d5c65159SKalle Valo  *		0 - No blocking related errors found
2345d5c65159SKalle Valo  *		1 - Blocking resource is already in use
2346d5c65159SKalle Valo  *		2 - Resource requested to be unblocked, was not blocked
2347d5c65159SKalle Valo  *
2348d5c65159SKalle Valo  * cache_controller_flush_status_hit
2349d5c65159SKalle Valo  *		The status that the cache controller returned on executing the
2350d5c65159SKalle Valo  *		flush command.
2351d5c65159SKalle Valo  *
2352d5c65159SKalle Valo  *		0 - miss; 1 - hit
2353d5c65159SKalle Valo  *
2354d5c65159SKalle Valo  * cache_controller_flush_status_desc_type
2355d5c65159SKalle Valo  *		Flush descriptor type
2356d5c65159SKalle Valo  *
2357d5c65159SKalle Valo  * cache_controller_flush_status_client_id
2358d5c65159SKalle Valo  *		Module who made the flush request
2359d5c65159SKalle Valo  *
2360d5c65159SKalle Valo  *		In REO, this is always 0
2361d5c65159SKalle Valo  *
2362d5c65159SKalle Valo  * cache_controller_flush_status_error
2363d5c65159SKalle Valo  *		Error condition
2364d5c65159SKalle Valo  *
2365d5c65159SKalle Valo  *		0 - No error found
2366d5c65159SKalle Valo  *		1 - HW interface is still busy
2367d5c65159SKalle Valo  *		2 - Line currently locked. Used for one line flush command
2368d5c65159SKalle Valo  *		3 - At least one line is still locked.
2369d5c65159SKalle Valo  *		    Used for cache flush command.
2370d5c65159SKalle Valo  *
2371d5c65159SKalle Valo  * cache_controller_flush_count
2372d5c65159SKalle Valo  *		The number of lines that were actually flushed out
2373d5c65159SKalle Valo  *
2374d5c65159SKalle Valo  * looping_count
2375d5c65159SKalle Valo  *		A count value that indicates the number of times the producer of
2376d5c65159SKalle Valo  *		entries into this Ring has looped around the ring.
2377d5c65159SKalle Valo  */
2378d5c65159SKalle Valo 
2379d5c65159SKalle Valo #define HAL_REO_UNBLOCK_CACHE_STATUS_INFO0_IS_ERR	BIT(0)
2380d5c65159SKalle Valo #define HAL_REO_UNBLOCK_CACHE_STATUS_INFO0_TYPE		BIT(1)
2381d5c65159SKalle Valo 
2382d5c65159SKalle Valo struct hal_reo_unblock_cache_status {
2383d5c65159SKalle Valo 	struct hal_reo_status_hdr hdr;
2384d5c65159SKalle Valo 	u32 info0;
2385d5c65159SKalle Valo 	u32 rsvd0[21];
2386d5c65159SKalle Valo 	u32 info1;
2387d5c65159SKalle Valo } __packed;
2388d5c65159SKalle Valo 
2389d5c65159SKalle Valo /* hal_reo_unblock_cache_status
2390d5c65159SKalle Valo  *		Producer: REO
2391d5c65159SKalle Valo  *		Consumer: SW
2392d5c65159SKalle Valo  *
2393d5c65159SKalle Valo  * status_hdr
2394d5c65159SKalle Valo  *		Details that can link this status with the original command. It
2395d5c65159SKalle Valo  *		also contains info on how long REO took to execute this command.
2396d5c65159SKalle Valo  *
2397d5c65159SKalle Valo  * error_detected
2398d5c65159SKalle Valo  *		0 - No error has been detected while executing this command
2399d5c65159SKalle Valo  *		1 - The blocking resource was not in use, and therefore it could
2400d5c65159SKalle Valo  *		    not be unblocked.
2401d5c65159SKalle Valo  *
2402d5c65159SKalle Valo  * unblock_type
2403d5c65159SKalle Valo  *		Reference to the type of unblock command
2404d5c65159SKalle Valo  *		0 - Unblock a blocking resource
2405d5c65159SKalle Valo  *		1 - The entire cache usage is unblock
2406d5c65159SKalle Valo  *
2407d5c65159SKalle Valo  * looping_count
2408d5c65159SKalle Valo  *		A count value that indicates the number of times the producer of
2409d5c65159SKalle Valo  *		entries into this Ring has looped around the ring.
2410d5c65159SKalle Valo  */
2411d5c65159SKalle Valo 
2412d5c65159SKalle Valo #define HAL_REO_FLUSH_TIMEOUT_STATUS_INFO0_IS_ERR		BIT(0)
2413d5c65159SKalle Valo #define HAL_REO_FLUSH_TIMEOUT_STATUS_INFO0_LIST_EMPTY		BIT(1)
2414d5c65159SKalle Valo 
2415d5c65159SKalle Valo #define HAL_REO_FLUSH_TIMEOUT_STATUS_INFO1_REL_DESC_COUNT	GENMASK(15, 0)
2416d5c65159SKalle Valo #define HAL_REO_FLUSH_TIMEOUT_STATUS_INFO1_FWD_BUF_COUNT	GENMASK(31, 16)
2417d5c65159SKalle Valo 
2418d5c65159SKalle Valo struct hal_reo_flush_timeout_list_status {
2419d5c65159SKalle Valo 	struct hal_reo_status_hdr hdr;
2420d5c65159SKalle Valo 	u32 info0;
2421d5c65159SKalle Valo 	u32 info1;
2422d5c65159SKalle Valo 	u32 rsvd0[20];
2423d5c65159SKalle Valo 	u32 info2;
2424d5c65159SKalle Valo } __packed;
2425d5c65159SKalle Valo 
2426d5c65159SKalle Valo /* hal_reo_flush_timeout_list_status
2427d5c65159SKalle Valo  *		Producer: REO
2428d5c65159SKalle Valo  *		Consumer: SW
2429d5c65159SKalle Valo  *
2430d5c65159SKalle Valo  * status_hdr
2431d5c65159SKalle Valo  *		Details that can link this status with the original command. It
2432d5c65159SKalle Valo  *		also contains info on how long REO took to execute this command.
2433d5c65159SKalle Valo  *
2434d5c65159SKalle Valo  * error_detected
2435d5c65159SKalle Valo  *		0 - No error has been detected while executing this command
2436d5c65159SKalle Valo  *		1 - Command not properly executed and returned with error
2437d5c65159SKalle Valo  *
2438d5c65159SKalle Valo  * timeout_list_empty
2439d5c65159SKalle Valo  *		When set, REO has depleted the timeout list and all entries are
2440d5c65159SKalle Valo  *		gone.
2441d5c65159SKalle Valo  *
2442d5c65159SKalle Valo  * release_desc_count
2443d5c65159SKalle Valo  *		Producer: SW; Consumer: REO
2444d5c65159SKalle Valo  *		The number of link descriptor released
2445d5c65159SKalle Valo  *
2446d5c65159SKalle Valo  * forward_buf_count
2447d5c65159SKalle Valo  *		Producer: SW; Consumer: REO
2448d5c65159SKalle Valo  *		The number of buffers forwarded to the REO destination rings
2449d5c65159SKalle Valo  *
2450d5c65159SKalle Valo  * looping_count
2451d5c65159SKalle Valo  *		A count value that indicates the number of times the producer of
2452d5c65159SKalle Valo  *		entries into this Ring has looped around the ring.
2453d5c65159SKalle Valo  */
2454d5c65159SKalle Valo 
2455d5c65159SKalle Valo #define HAL_REO_DESC_THRESH_STATUS_INFO0_THRESH_INDEX		GENMASK(1, 0)
2456d5c65159SKalle Valo #define HAL_REO_DESC_THRESH_STATUS_INFO1_LINK_DESC_COUNTER0	GENMASK(23, 0)
2457d5c65159SKalle Valo #define HAL_REO_DESC_THRESH_STATUS_INFO2_LINK_DESC_COUNTER1	GENMASK(23, 0)
2458d5c65159SKalle Valo #define HAL_REO_DESC_THRESH_STATUS_INFO3_LINK_DESC_COUNTER2	GENMASK(23, 0)
2459ab041d06SKarthikeyan Periyasamy #define HAL_REO_DESC_THRESH_STATUS_INFO4_LINK_DESC_COUNTER_SUM	GENMASK(25, 0)
2460d5c65159SKalle Valo 
2461d5c65159SKalle Valo struct hal_reo_desc_thresh_reached_status {
2462d5c65159SKalle Valo 	struct hal_reo_status_hdr hdr;
2463d5c65159SKalle Valo 	u32 info0;
2464d5c65159SKalle Valo 	u32 info1;
2465d5c65159SKalle Valo 	u32 info2;
2466d5c65159SKalle Valo 	u32 info3;
2467d5c65159SKalle Valo 	u32 info4;
2468d5c65159SKalle Valo 	u32 rsvd0[17];
2469d5c65159SKalle Valo 	u32 info5;
2470d5c65159SKalle Valo } __packed;
2471d5c65159SKalle Valo 
2472d5c65159SKalle Valo /* hal_reo_desc_thresh_reached_status
2473d5c65159SKalle Valo  *		Producer: REO
2474d5c65159SKalle Valo  *		Consumer: SW
2475d5c65159SKalle Valo  *
2476d5c65159SKalle Valo  * status_hdr
2477d5c65159SKalle Valo  *		Details that can link this status with the original command. It
2478d5c65159SKalle Valo  *		also contains info on how long REO took to execute this command.
2479d5c65159SKalle Valo  *
2480d5c65159SKalle Valo  * threshold_index
2481d5c65159SKalle Valo  *		The index of the threshold register whose value got reached
2482d5c65159SKalle Valo  *
2483d5c65159SKalle Valo  * link_descriptor_counter0
2484d5c65159SKalle Valo  * link_descriptor_counter1
2485d5c65159SKalle Valo  * link_descriptor_counter2
2486d5c65159SKalle Valo  * link_descriptor_counter_sum
2487d5c65159SKalle Valo  *		Value of the respective counters at generation of this message
2488d5c65159SKalle Valo  *
2489d5c65159SKalle Valo  * looping_count
2490d5c65159SKalle Valo  *		A count value that indicates the number of times the producer of
2491d5c65159SKalle Valo  *		entries into this Ring has looped around the ring.
2492d5c65159SKalle Valo  */
2493d5c65159SKalle Valo 
2494d5c65159SKalle Valo #endif /* ATH11K_HAL_DESC_H */
2495