xref: /linux/drivers/net/wireless/ath/ath12k/hal_rx.h (revision 37a0dd6137ecfbd25d6ce84b65ad23de4f06b779)
1d8899132SKalle Valo /* SPDX-License-Identifier: BSD-3-Clause-Clear */
2d8899132SKalle Valo /*
3d8899132SKalle Valo  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
4*37a0dd61SMuna Sinada  * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
5d8899132SKalle Valo  */
6d8899132SKalle Valo 
7d8899132SKalle Valo #ifndef ATH12K_HAL_RX_H
8d8899132SKalle Valo #define ATH12K_HAL_RX_H
9d8899132SKalle Valo 
10d8899132SKalle Valo struct hal_rx_wbm_rel_info {
11d8899132SKalle Valo 	u32 cookie;
12d8899132SKalle Valo 	enum hal_wbm_rel_src_module err_rel_src;
13d8899132SKalle Valo 	enum hal_reo_dest_ring_push_reason push_reason;
14d8899132SKalle Valo 	u32 err_code;
15d8899132SKalle Valo 	bool first_msdu;
16d8899132SKalle Valo 	bool last_msdu;
17d8899132SKalle Valo 	bool continuation;
18d8899132SKalle Valo 	void *rx_desc;
19d8899132SKalle Valo 	bool hw_cc_done;
20d8899132SKalle Valo };
21d8899132SKalle Valo 
22d8899132SKalle Valo #define HAL_INVALID_PEERID 0xffff
23d8899132SKalle Valo #define VHT_SIG_SU_NSS_MASK 0x7
24d8899132SKalle Valo 
25d8899132SKalle Valo #define HAL_RX_MAX_MCS 12
26d8899132SKalle Valo #define HAL_RX_MAX_NSS 8
27d8899132SKalle Valo 
28d8899132SKalle Valo #define HAL_RX_MPDU_INFO_PN_GET_BYTE1(__val) \
29d8899132SKalle Valo 	le32_get_bits((__val), GENMASK(7, 0))
30d8899132SKalle Valo 
31d8899132SKalle Valo #define HAL_RX_MPDU_INFO_PN_GET_BYTE2(__val) \
32d8899132SKalle Valo 	le32_get_bits((__val), GENMASK(15, 8))
33d8899132SKalle Valo 
34d8899132SKalle Valo #define HAL_RX_MPDU_INFO_PN_GET_BYTE3(__val) \
35d8899132SKalle Valo 	le32_get_bits((__val), GENMASK(23, 16))
36d8899132SKalle Valo 
37d8899132SKalle Valo #define HAL_RX_MPDU_INFO_PN_GET_BYTE4(__val) \
38d8899132SKalle Valo 	le32_get_bits((__val), GENMASK(31, 24))
39d8899132SKalle Valo 
40d8899132SKalle Valo struct hal_rx_mon_status_tlv_hdr {
41d8899132SKalle Valo 	u32 hdr;
42d8899132SKalle Valo 	u8 value[];
43d8899132SKalle Valo };
44d8899132SKalle Valo 
45d8899132SKalle Valo enum hal_rx_su_mu_coding {
46d8899132SKalle Valo 	HAL_RX_SU_MU_CODING_BCC,
47d8899132SKalle Valo 	HAL_RX_SU_MU_CODING_LDPC,
48d8899132SKalle Valo 	HAL_RX_SU_MU_CODING_MAX,
49d8899132SKalle Valo };
50d8899132SKalle Valo 
51d8899132SKalle Valo enum hal_rx_gi {
52d8899132SKalle Valo 	HAL_RX_GI_0_8_US,
53d8899132SKalle Valo 	HAL_RX_GI_0_4_US,
54d8899132SKalle Valo 	HAL_RX_GI_1_6_US,
55d8899132SKalle Valo 	HAL_RX_GI_3_2_US,
56d8899132SKalle Valo 	HAL_RX_GI_MAX,
57d8899132SKalle Valo };
58d8899132SKalle Valo 
59d8899132SKalle Valo enum hal_rx_bw {
60d8899132SKalle Valo 	HAL_RX_BW_20MHZ,
61d8899132SKalle Valo 	HAL_RX_BW_40MHZ,
62d8899132SKalle Valo 	HAL_RX_BW_80MHZ,
63d8899132SKalle Valo 	HAL_RX_BW_160MHZ,
64*37a0dd61SMuna Sinada 	HAL_RX_BW_320MHZ,
65d8899132SKalle Valo 	HAL_RX_BW_MAX,
66d8899132SKalle Valo };
67d8899132SKalle Valo 
68d8899132SKalle Valo enum hal_rx_preamble {
69d8899132SKalle Valo 	HAL_RX_PREAMBLE_11A,
70d8899132SKalle Valo 	HAL_RX_PREAMBLE_11B,
71d8899132SKalle Valo 	HAL_RX_PREAMBLE_11N,
72d8899132SKalle Valo 	HAL_RX_PREAMBLE_11AC,
73d8899132SKalle Valo 	HAL_RX_PREAMBLE_11AX,
74d8899132SKalle Valo 	HAL_RX_PREAMBLE_MAX,
75d8899132SKalle Valo };
76d8899132SKalle Valo 
77d8899132SKalle Valo enum hal_rx_reception_type {
78d8899132SKalle Valo 	HAL_RX_RECEPTION_TYPE_SU,
79d8899132SKalle Valo 	HAL_RX_RECEPTION_TYPE_MU_MIMO,
80d8899132SKalle Valo 	HAL_RX_RECEPTION_TYPE_MU_OFDMA,
81d8899132SKalle Valo 	HAL_RX_RECEPTION_TYPE_MU_OFDMA_MIMO,
82d8899132SKalle Valo 	HAL_RX_RECEPTION_TYPE_MAX,
83d8899132SKalle Valo };
84d8899132SKalle Valo 
85d8899132SKalle Valo enum hal_rx_legacy_rate {
86d8899132SKalle Valo 	HAL_RX_LEGACY_RATE_1_MBPS,
87d8899132SKalle Valo 	HAL_RX_LEGACY_RATE_2_MBPS,
88d8899132SKalle Valo 	HAL_RX_LEGACY_RATE_5_5_MBPS,
89d8899132SKalle Valo 	HAL_RX_LEGACY_RATE_6_MBPS,
90d8899132SKalle Valo 	HAL_RX_LEGACY_RATE_9_MBPS,
91d8899132SKalle Valo 	HAL_RX_LEGACY_RATE_11_MBPS,
92d8899132SKalle Valo 	HAL_RX_LEGACY_RATE_12_MBPS,
93d8899132SKalle Valo 	HAL_RX_LEGACY_RATE_18_MBPS,
94d8899132SKalle Valo 	HAL_RX_LEGACY_RATE_24_MBPS,
95d8899132SKalle Valo 	HAL_RX_LEGACY_RATE_36_MBPS,
96d8899132SKalle Valo 	HAL_RX_LEGACY_RATE_48_MBPS,
97d8899132SKalle Valo 	HAL_RX_LEGACY_RATE_54_MBPS,
98d8899132SKalle Valo 	HAL_RX_LEGACY_RATE_INVALID,
99d8899132SKalle Valo };
100d8899132SKalle Valo 
101d8899132SKalle Valo #define HAL_TLV_STATUS_PPDU_NOT_DONE            0
102d8899132SKalle Valo #define HAL_TLV_STATUS_PPDU_DONE                1
103d8899132SKalle Valo #define HAL_TLV_STATUS_BUF_DONE                 2
104d8899132SKalle Valo #define HAL_TLV_STATUS_PPDU_NON_STD_DONE        3
105d8899132SKalle Valo #define HAL_RX_FCS_LEN                          4
106d8899132SKalle Valo 
107d8899132SKalle Valo enum hal_rx_mon_status {
108d8899132SKalle Valo 	HAL_RX_MON_STATUS_PPDU_NOT_DONE,
109d8899132SKalle Valo 	HAL_RX_MON_STATUS_PPDU_DONE,
110d8899132SKalle Valo 	HAL_RX_MON_STATUS_BUF_DONE,
111d8899132SKalle Valo };
112d8899132SKalle Valo 
113d8899132SKalle Valo #define HAL_RX_MAX_MPDU		256
114d8899132SKalle Valo #define HAL_RX_NUM_WORDS_PER_PPDU_BITMAP	(HAL_RX_MAX_MPDU >> 5)
115d8899132SKalle Valo 
116d8899132SKalle Valo struct hal_rx_user_status {
117d8899132SKalle Valo 	u32 mcs:4,
118d8899132SKalle Valo 	nss:3,
119d8899132SKalle Valo 	ofdma_info_valid:1,
120d8899132SKalle Valo 	ul_ofdma_ru_start_index:7,
121d8899132SKalle Valo 	ul_ofdma_ru_width:7,
122d8899132SKalle Valo 	ul_ofdma_ru_size:8;
123d8899132SKalle Valo 	u32 ul_ofdma_user_v0_word0;
124d8899132SKalle Valo 	u32 ul_ofdma_user_v0_word1;
125d8899132SKalle Valo 	u32 ast_index;
126d8899132SKalle Valo 	u32 tid;
127d8899132SKalle Valo 	u16 tcp_msdu_count;
128d8899132SKalle Valo 	u16 tcp_ack_msdu_count;
129d8899132SKalle Valo 	u16 udp_msdu_count;
130d8899132SKalle Valo 	u16 other_msdu_count;
131d8899132SKalle Valo 	u16 frame_control;
132d8899132SKalle Valo 	u8 frame_control_info_valid;
133d8899132SKalle Valo 	u8 data_sequence_control_info_valid;
134d8899132SKalle Valo 	u16 first_data_seq_ctrl;
135d8899132SKalle Valo 	u32 preamble_type;
136d8899132SKalle Valo 	u16 ht_flags;
137d8899132SKalle Valo 	u16 vht_flags;
138d8899132SKalle Valo 	u16 he_flags;
139d8899132SKalle Valo 	u8 rs_flags;
140d8899132SKalle Valo 	u8 ldpc;
141d8899132SKalle Valo 	u32 mpdu_cnt_fcs_ok;
142d8899132SKalle Valo 	u32 mpdu_cnt_fcs_err;
143d8899132SKalle Valo 	u32 mpdu_fcs_ok_bitmap[HAL_RX_NUM_WORDS_PER_PPDU_BITMAP];
144d8899132SKalle Valo 	u32 mpdu_ok_byte_count;
145d8899132SKalle Valo 	u32 mpdu_err_byte_count;
146d8899132SKalle Valo };
147d8899132SKalle Valo 
148d8899132SKalle Valo #define HAL_MAX_UL_MU_USERS	37
149d8899132SKalle Valo 
150d8899132SKalle Valo struct hal_rx_mon_ppdu_info {
151d8899132SKalle Valo 	u32 ppdu_id;
152d8899132SKalle Valo 	u32 last_ppdu_id;
153d8899132SKalle Valo 	u64 ppdu_ts;
154d8899132SKalle Valo 	u32 num_mpdu_fcs_ok;
155d8899132SKalle Valo 	u32 num_mpdu_fcs_err;
156d8899132SKalle Valo 	u32 preamble_type;
157d8899132SKalle Valo 	u32 mpdu_len;
158d8899132SKalle Valo 	u16 chan_num;
159d8899132SKalle Valo 	u16 tcp_msdu_count;
160d8899132SKalle Valo 	u16 tcp_ack_msdu_count;
161d8899132SKalle Valo 	u16 udp_msdu_count;
162d8899132SKalle Valo 	u16 other_msdu_count;
163d8899132SKalle Valo 	u16 peer_id;
164d8899132SKalle Valo 	u8 rate;
165d8899132SKalle Valo 	u8 mcs;
166d8899132SKalle Valo 	u8 nss;
167d8899132SKalle Valo 	u8 bw;
168d8899132SKalle Valo 	u8 vht_flag_values1;
169d8899132SKalle Valo 	u8 vht_flag_values2;
170d8899132SKalle Valo 	u8 vht_flag_values3[4];
171d8899132SKalle Valo 	u8 vht_flag_values4;
172d8899132SKalle Valo 	u8 vht_flag_values5;
173d8899132SKalle Valo 	u16 vht_flag_values6;
174d8899132SKalle Valo 	u8 is_stbc;
175d8899132SKalle Valo 	u8 gi;
176d8899132SKalle Valo 	u8 sgi;
177d8899132SKalle Valo 	u8 ldpc;
178d8899132SKalle Valo 	u8 beamformed;
179d8899132SKalle Valo 	u8 rssi_comb;
180d8899132SKalle Valo 	u16 tid;
181d8899132SKalle Valo 	u8 fc_valid;
182d8899132SKalle Valo 	u16 ht_flags;
183d8899132SKalle Valo 	u16 vht_flags;
184d8899132SKalle Valo 	u16 he_flags;
185d8899132SKalle Valo 	u16 he_mu_flags;
186d8899132SKalle Valo 	u8 dcm;
187d8899132SKalle Valo 	u8 ru_alloc;
188d8899132SKalle Valo 	u8 reception_type;
189d8899132SKalle Valo 	u64 tsft;
190d8899132SKalle Valo 	u64 rx_duration;
191d8899132SKalle Valo 	u16 frame_control;
192d8899132SKalle Valo 	u32 ast_index;
193d8899132SKalle Valo 	u8 rs_fcs_err;
194d8899132SKalle Valo 	u8 rs_flags;
195d8899132SKalle Valo 	u8 cck_flag;
196d8899132SKalle Valo 	u8 ofdm_flag;
197d8899132SKalle Valo 	u8 ulofdma_flag;
198d8899132SKalle Valo 	u8 frame_control_info_valid;
199d8899132SKalle Valo 	u16 he_per_user_1;
200d8899132SKalle Valo 	u16 he_per_user_2;
201d8899132SKalle Valo 	u8 he_per_user_position;
202d8899132SKalle Valo 	u8 he_per_user_known;
203d8899132SKalle Valo 	u16 he_flags1;
204d8899132SKalle Valo 	u16 he_flags2;
205d8899132SKalle Valo 	u8 he_RU[4];
206d8899132SKalle Valo 	u16 he_data1;
207d8899132SKalle Valo 	u16 he_data2;
208d8899132SKalle Valo 	u16 he_data3;
209d8899132SKalle Valo 	u16 he_data4;
210d8899132SKalle Valo 	u16 he_data5;
211d8899132SKalle Valo 	u16 he_data6;
212d8899132SKalle Valo 	u32 ppdu_len;
213d8899132SKalle Valo 	u32 prev_ppdu_id;
214d8899132SKalle Valo 	u32 device_id;
215d8899132SKalle Valo 	u16 first_data_seq_ctrl;
216d8899132SKalle Valo 	u8 monitor_direct_used;
217d8899132SKalle Valo 	u8 data_sequence_control_info_valid;
218d8899132SKalle Valo 	u8 ltf_size;
219d8899132SKalle Valo 	u8 rxpcu_filter_pass;
220d8899132SKalle Valo 	s8 rssi_chain[8][8];
221d8899132SKalle Valo 	u32 num_users;
222d8899132SKalle Valo 	u32 mpdu_fcs_ok_bitmap[HAL_RX_NUM_WORDS_PER_PPDU_BITMAP];
223d8899132SKalle Valo 	u8 addr1[ETH_ALEN];
224d8899132SKalle Valo 	u8 addr2[ETH_ALEN];
225d8899132SKalle Valo 	u8 addr3[ETH_ALEN];
226d8899132SKalle Valo 	u8 addr4[ETH_ALEN];
227d8899132SKalle Valo 	struct hal_rx_user_status userstats[HAL_MAX_UL_MU_USERS];
228d8899132SKalle Valo 	u8 userid;
229d8899132SKalle Valo 	u16 ampdu_id[HAL_MAX_UL_MU_USERS];
230d8899132SKalle Valo 	bool first_msdu_in_mpdu;
231d8899132SKalle Valo 	bool is_ampdu;
232d8899132SKalle Valo 	u8 medium_prot_type;
233d8899132SKalle Valo };
234d8899132SKalle Valo 
235d8899132SKalle Valo #define HAL_RX_PPDU_START_INFO0_PPDU_ID		GENMASK(15, 0)
236d8899132SKalle Valo 
237d8899132SKalle Valo struct hal_rx_ppdu_start {
238d8899132SKalle Valo 	__le32 info0;
239d8899132SKalle Valo 	__le32 chan_num;
240d8899132SKalle Valo 	__le32 ppdu_start_ts;
241d8899132SKalle Valo } __packed;
242d8899132SKalle Valo 
243d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO0_MPDU_CNT_FCS_ERR	GENMASK(25, 16)
244d8899132SKalle Valo 
245d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO1_MPDU_CNT_FCS_OK	GENMASK(8, 0)
246d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO1_FC_VALID		BIT(9)
247d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO1_QOS_CTRL_VALID		BIT(10)
248d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO1_HT_CTRL_VALID		BIT(11)
249d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO1_PKT_TYPE		GENMASK(23, 20)
250d8899132SKalle Valo 
251d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO2_AST_INDEX		GENMASK(15, 0)
252d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO2_FRAME_CTRL		GENMASK(31, 16)
253d8899132SKalle Valo 
254d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO3_QOS_CTRL		GENMASK(31, 16)
255d8899132SKalle Valo 
256d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO4_UDP_MSDU_CNT		GENMASK(15, 0)
257d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO4_TCP_MSDU_CNT		GENMASK(31, 16)
258d8899132SKalle Valo 
259d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO5_OTHER_MSDU_CNT		GENMASK(15, 0)
260d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO5_TCP_ACK_MSDU_CNT	GENMASK(31, 16)
261d8899132SKalle Valo 
262d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP		GENMASK(15, 0)
263d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_EOSP_BITMAP	GENMASK(31, 16)
264d8899132SKalle Valo 
265d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_MPDU_DELIM_OK_BYTE_COUNT	GENMASK(24, 0)
266d8899132SKalle Valo #define HAL_RX_PPDU_END_USER_STATS_MPDU_DELIM_ERR_BYTE_COUNT	GENMASK(24, 0)
267d8899132SKalle Valo 
268d8899132SKalle Valo struct hal_rx_ppdu_end_user_stats {
269d8899132SKalle Valo 	__le32 rsvd0[2];
270d8899132SKalle Valo 	__le32 info0;
271d8899132SKalle Valo 	__le32 info1;
272d8899132SKalle Valo 	__le32 info2;
273d8899132SKalle Valo 	__le32 info3;
274d8899132SKalle Valo 	__le32 ht_ctrl;
275d8899132SKalle Valo 	__le32 rsvd1[2];
276d8899132SKalle Valo 	__le32 info4;
277d8899132SKalle Valo 	__le32 info5;
278d8899132SKalle Valo 	__le32 usr_resp_ref;
279d8899132SKalle Valo 	__le32 info6;
280d8899132SKalle Valo 	__le32 rsvd3[4];
281d8899132SKalle Valo 	__le32 mpdu_ok_cnt;
282d8899132SKalle Valo 	__le32 rsvd4;
283d8899132SKalle Valo 	__le32 mpdu_err_cnt;
284d8899132SKalle Valo 	__le32 rsvd5[2];
285d8899132SKalle Valo 	__le32 usr_resp_ref_ext;
286d8899132SKalle Valo 	__le32 rsvd6;
287d8899132SKalle Valo } __packed;
288d8899132SKalle Valo 
289d8899132SKalle Valo struct hal_rx_ppdu_end_user_stats_ext {
290d8899132SKalle Valo 	__le32 info0;
291d8899132SKalle Valo 	__le32 info1;
292d8899132SKalle Valo 	__le32 info2;
293d8899132SKalle Valo 	__le32 info3;
294d8899132SKalle Valo 	__le32 info4;
295d8899132SKalle Valo 	__le32 info5;
296d8899132SKalle Valo 	__le32 info6;
297d8899132SKalle Valo } __packed;
298d8899132SKalle Valo 
299d8899132SKalle Valo #define HAL_RX_HT_SIG_INFO_INFO0_MCS		GENMASK(6, 0)
300d8899132SKalle Valo #define HAL_RX_HT_SIG_INFO_INFO0_BW		BIT(7)
301d8899132SKalle Valo 
302d8899132SKalle Valo #define HAL_RX_HT_SIG_INFO_INFO1_STBC		GENMASK(5, 4)
303d8899132SKalle Valo #define HAL_RX_HT_SIG_INFO_INFO1_FEC_CODING	BIT(6)
304d8899132SKalle Valo #define HAL_RX_HT_SIG_INFO_INFO1_GI		BIT(7)
305d8899132SKalle Valo 
306d8899132SKalle Valo struct hal_rx_ht_sig_info {
307d8899132SKalle Valo 	__le32 info0;
308d8899132SKalle Valo 	__le32 info1;
309d8899132SKalle Valo } __packed;
310d8899132SKalle Valo 
311d8899132SKalle Valo #define HAL_RX_LSIG_B_INFO_INFO0_RATE	GENMASK(3, 0)
312d8899132SKalle Valo #define HAL_RX_LSIG_B_INFO_INFO0_LEN	GENMASK(15, 4)
313d8899132SKalle Valo 
314d8899132SKalle Valo struct hal_rx_lsig_b_info {
315d8899132SKalle Valo 	__le32 info0;
316d8899132SKalle Valo } __packed;
317d8899132SKalle Valo 
318d8899132SKalle Valo #define HAL_RX_LSIG_A_INFO_INFO0_RATE		GENMASK(3, 0)
319d8899132SKalle Valo #define HAL_RX_LSIG_A_INFO_INFO0_LEN		GENMASK(16, 5)
320d8899132SKalle Valo #define HAL_RX_LSIG_A_INFO_INFO0_PKT_TYPE	GENMASK(27, 24)
321d8899132SKalle Valo 
322d8899132SKalle Valo struct hal_rx_lsig_a_info {
323d8899132SKalle Valo 	__le32 info0;
324d8899132SKalle Valo } __packed;
325d8899132SKalle Valo 
326d8899132SKalle Valo #define HAL_RX_VHT_SIG_A_INFO_INFO0_BW		GENMASK(1, 0)
327d8899132SKalle Valo #define HAL_RX_VHT_SIG_A_INFO_INFO0_STBC	BIT(3)
328d8899132SKalle Valo #define HAL_RX_VHT_SIG_A_INFO_INFO0_GROUP_ID	GENMASK(9, 4)
329d8899132SKalle Valo #define HAL_RX_VHT_SIG_A_INFO_INFO0_NSTS	GENMASK(21, 10)
330d8899132SKalle Valo 
331d8899132SKalle Valo #define HAL_RX_VHT_SIG_A_INFO_INFO1_GI_SETTING		GENMASK(1, 0)
332d8899132SKalle Valo #define HAL_RX_VHT_SIG_A_INFO_INFO1_SU_MU_CODING	BIT(2)
333d8899132SKalle Valo #define HAL_RX_VHT_SIG_A_INFO_INFO1_MCS			GENMASK(7, 4)
334d8899132SKalle Valo #define HAL_RX_VHT_SIG_A_INFO_INFO1_BEAMFORMED		BIT(8)
335d8899132SKalle Valo 
336d8899132SKalle Valo struct hal_rx_vht_sig_a_info {
337d8899132SKalle Valo 	__le32 info0;
338d8899132SKalle Valo 	__le32 info1;
339d8899132SKalle Valo } __packed;
340d8899132SKalle Valo 
341d8899132SKalle Valo enum hal_rx_vht_sig_a_gi_setting {
342d8899132SKalle Valo 	HAL_RX_VHT_SIG_A_NORMAL_GI = 0,
343d8899132SKalle Valo 	HAL_RX_VHT_SIG_A_SHORT_GI = 1,
344d8899132SKalle Valo 	HAL_RX_VHT_SIG_A_SHORT_GI_AMBIGUITY = 3,
345d8899132SKalle Valo };
346d8899132SKalle Valo 
347d8899132SKalle Valo #define HE_GI_0_8 0
348d8899132SKalle Valo #define HE_GI_0_4 1
349d8899132SKalle Valo #define HE_GI_1_6 2
350d8899132SKalle Valo #define HE_GI_3_2 3
351d8899132SKalle Valo 
352d8899132SKalle Valo #define HE_LTF_1_X 0
353d8899132SKalle Valo #define HE_LTF_2_X 1
354d8899132SKalle Valo #define HE_LTF_4_X 2
355d8899132SKalle Valo 
356d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO0_TRANSMIT_MCS	GENMASK(6, 3)
357d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO0_DCM		BIT(7)
358d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO0_TRANSMIT_BW	GENMASK(20, 19)
359d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO0_CP_LTF_SIZE	GENMASK(22, 21)
360d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO0_NSTS		GENMASK(25, 23)
361d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO0_BSS_COLOR		GENMASK(13, 8)
362d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO0_SPATIAL_REUSE	GENMASK(18, 15)
363d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO0_FORMAT_IND	BIT(0)
364d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO0_BEAM_CHANGE	BIT(1)
365d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO0_DL_UL_FLAG	BIT(2)
366d8899132SKalle Valo 
367d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO1_TXOP_DURATION	GENMASK(6, 0)
368d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO1_CODING		BIT(7)
369d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO1_LDPC_EXTRA	BIT(8)
370d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO1_STBC		BIT(9)
371d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO1_TXBF		BIT(10)
372d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO1_PKT_EXT_FACTOR	GENMASK(12, 11)
373d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO1_PKT_EXT_PE_DISAM	BIT(13)
374d8899132SKalle Valo #define HAL_RX_HE_SIG_A_SU_INFO_INFO1_DOPPLER_IND	BIT(15)
375d8899132SKalle Valo 
376d8899132SKalle Valo struct hal_rx_he_sig_a_su_info {
377d8899132SKalle Valo 	__le32 info0;
378d8899132SKalle Valo 	__le32 info1;
379d8899132SKalle Valo } __packed;
380d8899132SKalle Valo 
381d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO0_UL_FLAG		BIT(1)
382d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO0_MCS_OF_SIGB		GENMASK(3, 1)
383d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO0_DCM_OF_SIGB		BIT(4)
384d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO0_BSS_COLOR		GENMASK(10, 5)
385d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO0_SPATIAL_REUSE	GENMASK(14, 11)
386d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO0_TRANSMIT_BW		GENMASK(17, 15)
387d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO0_NUM_SIGB_SYMB	GENMASK(21, 18)
388d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO0_COMP_MODE_SIGB	BIT(22)
389d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO0_CP_LTF_SIZE		GENMASK(24, 23)
390d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO0_DOPPLER_INDICATION	BIT(25)
391d8899132SKalle Valo 
392d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO1_TXOP_DURATION	GENMASK(6, 0)
393d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO1_CODING		BIT(7)
394d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO1_NUM_LTF_SYMB	GENMASK(10, 8)
395d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO1_LDPC_EXTRA		BIT(11)
396d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO1_STBC		BIT(12)
397d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO1_TXBF		BIT(10)
398d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO1_PKT_EXT_FACTOR	GENMASK(14, 13)
399d8899132SKalle Valo #define HAL_RX_HE_SIG_A_MU_DL_INFO1_PKT_EXT_PE_DISAM	BIT(15)
400d8899132SKalle Valo 
401d8899132SKalle Valo struct hal_rx_he_sig_a_mu_dl_info {
402d8899132SKalle Valo 	__le32 info0;
403d8899132SKalle Valo 	__le32 info1;
404d8899132SKalle Valo } __packed;
405d8899132SKalle Valo 
406d8899132SKalle Valo #define HAL_RX_HE_SIG_B1_MU_INFO_INFO0_RU_ALLOCATION	GENMASK(7, 0)
407d8899132SKalle Valo 
408d8899132SKalle Valo struct hal_rx_he_sig_b1_mu_info {
409d8899132SKalle Valo 	__le32 info0;
410d8899132SKalle Valo } __packed;
411d8899132SKalle Valo 
412d8899132SKalle Valo #define HAL_RX_HE_SIG_B2_MU_INFO_INFO0_STA_ID           GENMASK(10, 0)
413d8899132SKalle Valo #define HAL_RX_HE_SIG_B2_MU_INFO_INFO0_STA_MCS		GENMASK(18, 15)
414d8899132SKalle Valo #define HAL_RX_HE_SIG_B2_MU_INFO_INFO0_STA_CODING	BIT(20)
415d8899132SKalle Valo #define HAL_RX_HE_SIG_B2_MU_INFO_INFO0_STA_NSTS		GENMASK(31, 29)
416d8899132SKalle Valo 
417d8899132SKalle Valo struct hal_rx_he_sig_b2_mu_info {
418d8899132SKalle Valo 	__le32 info0;
419d8899132SKalle Valo } __packed;
420d8899132SKalle Valo 
421d8899132SKalle Valo #define HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_ID	GENMASK(10, 0)
422d8899132SKalle Valo #define HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_NSTS	GENMASK(13, 11)
423d8899132SKalle Valo #define HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_TXBF	BIT(19)
424d8899132SKalle Valo #define HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_MCS	GENMASK(18, 15)
425d8899132SKalle Valo #define HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_DCM	BIT(19)
426d8899132SKalle Valo #define HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_CODING	BIT(20)
427d8899132SKalle Valo 
428d8899132SKalle Valo struct hal_rx_he_sig_b2_ofdma_info {
429d8899132SKalle Valo 	__le32 info0;
430d8899132SKalle Valo } __packed;
431d8899132SKalle Valo 
432d8899132SKalle Valo enum hal_rx_ul_reception_type {
433d8899132SKalle Valo 	HAL_RECEPTION_TYPE_ULOFMDA,
434d8899132SKalle Valo 	HAL_RECEPTION_TYPE_ULMIMO,
435d8899132SKalle Valo 	HAL_RECEPTION_TYPE_OTHER,
436d8899132SKalle Valo 	HAL_RECEPTION_TYPE_FRAMELESS
437d8899132SKalle Valo };
438d8899132SKalle Valo 
439d8899132SKalle Valo #define HAL_RX_PHYRX_RSSI_LEGACY_INFO_INFO0_RSSI_COMB	GENMASK(15, 8)
440d8899132SKalle Valo #define HAL_RX_PHYRX_RSSI_LEGACY_INFO_RSVD1_RECEPTION   GENMASK(3, 0)
441d8899132SKalle Valo 
442d8899132SKalle Valo struct hal_rx_phyrx_rssi_legacy_info {
443d8899132SKalle Valo 	__le32 rsvd[35];
444d8899132SKalle Valo 	__le32 info0;
445d8899132SKalle Valo } __packed;
446d8899132SKalle Valo 
447d8899132SKalle Valo #define HAL_RX_MPDU_START_INFO0_PPDU_ID	GENMASK(31, 16)
448d8899132SKalle Valo #define HAL_RX_MPDU_START_INFO1_PEERID	GENMASK(31, 16)
449d8899132SKalle Valo #define HAL_RX_MPDU_START_INFO2_MPDU_LEN GENMASK(13, 0)
450d8899132SKalle Valo struct hal_rx_mpdu_start {
451d8899132SKalle Valo 	__le32 info0;
452d8899132SKalle Valo 	__le32 info1;
453d8899132SKalle Valo 	__le32 rsvd1[11];
454d8899132SKalle Valo 	__le32 info2;
455d8899132SKalle Valo 	__le32 rsvd2[9];
456d8899132SKalle Valo } __packed;
457d8899132SKalle Valo 
458d8899132SKalle Valo #define HAL_RX_PPDU_END_DURATION	GENMASK(23, 0)
459d8899132SKalle Valo struct hal_rx_ppdu_end_duration {
460d8899132SKalle Valo 	__le32 rsvd0[9];
461d8899132SKalle Valo 	__le32 info0;
462d8899132SKalle Valo 	__le32 rsvd1[4];
463d8899132SKalle Valo } __packed;
464d8899132SKalle Valo 
465d8899132SKalle Valo struct hal_rx_rxpcu_classification_overview {
466d8899132SKalle Valo 	u32 rsvd0;
467d8899132SKalle Valo } __packed;
468d8899132SKalle Valo 
469d8899132SKalle Valo struct hal_rx_msdu_desc_info {
470d8899132SKalle Valo 	u32 msdu_flags;
471d8899132SKalle Valo 	u16 msdu_len; /* 14 bits for length */
472d8899132SKalle Valo };
473d8899132SKalle Valo 
474d8899132SKalle Valo #define HAL_RX_NUM_MSDU_DESC 6
475d8899132SKalle Valo struct hal_rx_msdu_list {
476d8899132SKalle Valo 	struct hal_rx_msdu_desc_info msdu_info[HAL_RX_NUM_MSDU_DESC];
477d8899132SKalle Valo 	u32 sw_cookie[HAL_RX_NUM_MSDU_DESC];
478d8899132SKalle Valo 	u8 rbm[HAL_RX_NUM_MSDU_DESC];
479d8899132SKalle Valo };
480d8899132SKalle Valo 
481d8899132SKalle Valo #define HAL_RX_FBM_ACK_INFO0_ADDR1_31_0		GENMASK(31, 0)
482d8899132SKalle Valo #define HAL_RX_FBM_ACK_INFO1_ADDR1_47_32	GENMASK(15, 0)
483d8899132SKalle Valo #define HAL_RX_FBM_ACK_INFO1_ADDR2_15_0		GENMASK(31, 16)
484d8899132SKalle Valo #define HAL_RX_FBM_ACK_INFO2_ADDR2_47_16	GENMASK(31, 0)
485d8899132SKalle Valo 
486d8899132SKalle Valo struct hal_rx_frame_bitmap_ack {
487d8899132SKalle Valo 	__le32 reserved;
488d8899132SKalle Valo 	__le32 info0;
489d8899132SKalle Valo 	__le32 info1;
490d8899132SKalle Valo 	__le32 info2;
491d8899132SKalle Valo 	__le32 reserved1[10];
492d8899132SKalle Valo } __packed;
493d8899132SKalle Valo 
494d8899132SKalle Valo #define HAL_RX_RESP_REQ_INFO0_PPDU_ID		GENMASK(15, 0)
495d8899132SKalle Valo #define HAL_RX_RESP_REQ_INFO0_RECEPTION_TYPE	BIT(16)
496d8899132SKalle Valo #define HAL_RX_RESP_REQ_INFO1_DURATION		GENMASK(15, 0)
497d8899132SKalle Valo #define HAL_RX_RESP_REQ_INFO1_RATE_MCS		GENMASK(24, 21)
498d8899132SKalle Valo #define HAL_RX_RESP_REQ_INFO1_SGI		GENMASK(26, 25)
499d8899132SKalle Valo #define HAL_RX_RESP_REQ_INFO1_STBC		BIT(27)
500d8899132SKalle Valo #define HAL_RX_RESP_REQ_INFO1_LDPC		BIT(28)
501d8899132SKalle Valo #define HAL_RX_RESP_REQ_INFO1_IS_AMPDU		BIT(29)
502d8899132SKalle Valo #define HAL_RX_RESP_REQ_INFO2_NUM_USER		GENMASK(6, 0)
503d8899132SKalle Valo #define HAL_RX_RESP_REQ_INFO3_ADDR1_31_0	GENMASK(31, 0)
504d8899132SKalle Valo #define HAL_RX_RESP_REQ_INFO4_ADDR1_47_32	GENMASK(15, 0)
505d8899132SKalle Valo #define HAL_RX_RESP_REQ_INFO4_ADDR1_15_0	GENMASK(31, 16)
506d8899132SKalle Valo #define HAL_RX_RESP_REQ_INFO5_ADDR1_47_16	GENMASK(31, 0)
507d8899132SKalle Valo 
508d8899132SKalle Valo struct hal_rx_resp_req_info {
509d8899132SKalle Valo 	__le32 info0;
510d8899132SKalle Valo 	__le32 reserved[1];
511d8899132SKalle Valo 	__le32 info1;
512d8899132SKalle Valo 	__le32 info2;
513d8899132SKalle Valo 	__le32 reserved1[2];
514d8899132SKalle Valo 	__le32 info3;
515d8899132SKalle Valo 	__le32 info4;
516d8899132SKalle Valo 	__le32 info5;
517d8899132SKalle Valo 	__le32 reserved2[5];
518d8899132SKalle Valo } __packed;
519d8899132SKalle Valo 
520d8899132SKalle Valo #define REO_QUEUE_DESC_MAGIC_DEBUG_PATTERN_0 0xDDBEEF
521d8899132SKalle Valo #define REO_QUEUE_DESC_MAGIC_DEBUG_PATTERN_1 0xADBEEF
522d8899132SKalle Valo #define REO_QUEUE_DESC_MAGIC_DEBUG_PATTERN_2 0xBDBEEF
523d8899132SKalle Valo #define REO_QUEUE_DESC_MAGIC_DEBUG_PATTERN_3 0xCDBEEF
524d8899132SKalle Valo 
525d8899132SKalle Valo #define HAL_RX_UL_OFDMA_USER_INFO_V0_W0_VALID		BIT(30)
526d8899132SKalle Valo #define HAL_RX_UL_OFDMA_USER_INFO_V0_W0_VER		BIT(31)
527d8899132SKalle Valo #define HAL_RX_UL_OFDMA_USER_INFO_V0_W1_NSS		GENMASK(2, 0)
528d8899132SKalle Valo #define HAL_RX_UL_OFDMA_USER_INFO_V0_W1_MCS		GENMASK(6, 3)
529d8899132SKalle Valo #define HAL_RX_UL_OFDMA_USER_INFO_V0_W1_LDPC		BIT(7)
530d8899132SKalle Valo #define HAL_RX_UL_OFDMA_USER_INFO_V0_W1_DCM		BIT(8)
531d8899132SKalle Valo #define HAL_RX_UL_OFDMA_USER_INFO_V0_W1_RU_START	GENMASK(15, 9)
532d8899132SKalle Valo #define HAL_RX_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE		GENMASK(18, 16)
533d8899132SKalle Valo 
534d8899132SKalle Valo /* HE Radiotap data1 Mask */
535d8899132SKalle Valo #define HE_SU_FORMAT_TYPE 0x0000
536d8899132SKalle Valo #define HE_EXT_SU_FORMAT_TYPE 0x0001
537d8899132SKalle Valo #define HE_MU_FORMAT_TYPE  0x0002
538d8899132SKalle Valo #define HE_TRIG_FORMAT_TYPE  0x0003
539d8899132SKalle Valo #define HE_BEAM_CHANGE_KNOWN 0x0008
540d8899132SKalle Valo #define HE_DL_UL_KNOWN 0x0010
541d8899132SKalle Valo #define HE_MCS_KNOWN 0x0020
542d8899132SKalle Valo #define HE_DCM_KNOWN 0x0040
543d8899132SKalle Valo #define HE_CODING_KNOWN 0x0080
544d8899132SKalle Valo #define HE_LDPC_EXTRA_SYMBOL_KNOWN 0x0100
545d8899132SKalle Valo #define HE_STBC_KNOWN 0x0200
546d8899132SKalle Valo #define HE_DATA_BW_RU_KNOWN 0x4000
547d8899132SKalle Valo #define HE_DOPPLER_KNOWN 0x8000
548d8899132SKalle Valo #define HE_BSS_COLOR_KNOWN 0x0004
549d8899132SKalle Valo 
550d8899132SKalle Valo /* HE Radiotap data2 Mask */
551d8899132SKalle Valo #define HE_GI_KNOWN 0x0002
552d8899132SKalle Valo #define HE_TXBF_KNOWN 0x0010
553d8899132SKalle Valo #define HE_PE_DISAMBIGUITY_KNOWN 0x0020
554d8899132SKalle Valo #define HE_TXOP_KNOWN 0x0040
555d8899132SKalle Valo #define HE_LTF_SYMBOLS_KNOWN 0x0004
556d8899132SKalle Valo #define HE_PRE_FEC_PADDING_KNOWN 0x0008
557d8899132SKalle Valo #define HE_MIDABLE_PERIODICITY_KNOWN 0x0080
558d8899132SKalle Valo 
559d8899132SKalle Valo /* HE radiotap data3 shift values */
560d8899132SKalle Valo #define HE_BEAM_CHANGE_SHIFT 6
561d8899132SKalle Valo #define HE_DL_UL_SHIFT 7
562d8899132SKalle Valo #define HE_TRANSMIT_MCS_SHIFT 8
563d8899132SKalle Valo #define HE_DCM_SHIFT 12
564d8899132SKalle Valo #define HE_CODING_SHIFT 13
565d8899132SKalle Valo #define HE_LDPC_EXTRA_SYMBOL_SHIFT 14
566d8899132SKalle Valo #define HE_STBC_SHIFT 15
567d8899132SKalle Valo 
568d8899132SKalle Valo /* HE radiotap data4 shift values */
569d8899132SKalle Valo #define HE_STA_ID_SHIFT 4
570d8899132SKalle Valo 
571d8899132SKalle Valo /* HE radiotap data5 */
572d8899132SKalle Valo #define HE_GI_SHIFT 4
573d8899132SKalle Valo #define HE_LTF_SIZE_SHIFT 6
574d8899132SKalle Valo #define HE_LTF_SYM_SHIFT 8
575d8899132SKalle Valo #define HE_TXBF_SHIFT 14
576d8899132SKalle Valo #define HE_PE_DISAMBIGUITY_SHIFT 15
577d8899132SKalle Valo #define HE_PRE_FEC_PAD_SHIFT 12
578d8899132SKalle Valo 
579d8899132SKalle Valo /* HE radiotap data6 */
580d8899132SKalle Valo #define HE_DOPPLER_SHIFT 4
581d8899132SKalle Valo #define HE_TXOP_SHIFT 8
582d8899132SKalle Valo 
583d8899132SKalle Valo /* HE radiotap HE-MU flags1 */
584d8899132SKalle Valo #define HE_SIG_B_MCS_KNOWN 0x0010
585d8899132SKalle Valo #define HE_SIG_B_DCM_KNOWN 0x0040
586d8899132SKalle Valo #define HE_SIG_B_SYM_NUM_KNOWN 0x8000
587d8899132SKalle Valo #define HE_RU_0_KNOWN 0x0100
588d8899132SKalle Valo #define HE_RU_1_KNOWN 0x0200
589d8899132SKalle Valo #define HE_RU_2_KNOWN 0x0400
590d8899132SKalle Valo #define HE_RU_3_KNOWN 0x0800
591d8899132SKalle Valo #define HE_DCM_FLAG_1_SHIFT 5
592d8899132SKalle Valo #define HE_SPATIAL_REUSE_MU_KNOWN 0x0100
593d8899132SKalle Valo #define HE_SIG_B_COMPRESSION_FLAG_1_KNOWN 0x4000
594d8899132SKalle Valo 
595d8899132SKalle Valo /* HE radiotap HE-MU flags2 */
596d8899132SKalle Valo #define HE_SIG_B_COMPRESSION_FLAG_2_SHIFT 3
597d8899132SKalle Valo #define HE_BW_KNOWN 0x0004
598d8899132SKalle Valo #define HE_NUM_SIG_B_SYMBOLS_SHIFT 4
599d8899132SKalle Valo #define HE_SIG_B_COMPRESSION_FLAG_2_KNOWN 0x0100
600d8899132SKalle Valo #define HE_NUM_SIG_B_FLAG_2_SHIFT 9
601d8899132SKalle Valo #define HE_LTF_FLAG_2_SYMBOLS_SHIFT 12
602d8899132SKalle Valo #define HE_LTF_KNOWN 0x8000
603d8899132SKalle Valo 
604d8899132SKalle Valo /* HE radiotap per_user_1 */
605d8899132SKalle Valo #define HE_STA_SPATIAL_SHIFT 11
606d8899132SKalle Valo #define HE_TXBF_SHIFT 14
607d8899132SKalle Valo #define HE_RESERVED_SET_TO_1_SHIFT 19
608d8899132SKalle Valo #define HE_STA_CODING_SHIFT 20
609d8899132SKalle Valo 
610d8899132SKalle Valo /* HE radiotap per_user_2 */
611d8899132SKalle Valo #define HE_STA_MCS_SHIFT 4
612d8899132SKalle Valo #define HE_STA_DCM_SHIFT 5
613d8899132SKalle Valo 
614d8899132SKalle Valo /* HE radiotap per user known */
615d8899132SKalle Valo #define HE_USER_FIELD_POSITION_KNOWN 0x01
616d8899132SKalle Valo #define HE_STA_ID_PER_USER_KNOWN 0x02
617d8899132SKalle Valo #define HE_STA_NSTS_KNOWN 0x04
618d8899132SKalle Valo #define HE_STA_TX_BF_KNOWN 0x08
619d8899132SKalle Valo #define HE_STA_SPATIAL_CONFIG_KNOWN 0x10
620d8899132SKalle Valo #define HE_STA_MCS_KNOWN 0x20
621d8899132SKalle Valo #define HE_STA_DCM_KNOWN 0x40
622d8899132SKalle Valo #define HE_STA_CODING_KNOWN 0x80
623d8899132SKalle Valo 
624d8899132SKalle Valo #define HAL_RX_MPDU_ERR_FCS			BIT(0)
625d8899132SKalle Valo #define HAL_RX_MPDU_ERR_DECRYPT			BIT(1)
626d8899132SKalle Valo #define HAL_RX_MPDU_ERR_TKIP_MIC		BIT(2)
627d8899132SKalle Valo #define HAL_RX_MPDU_ERR_AMSDU_ERR		BIT(3)
628d8899132SKalle Valo #define HAL_RX_MPDU_ERR_OVERFLOW		BIT(4)
629d8899132SKalle Valo #define HAL_RX_MPDU_ERR_MSDU_LEN		BIT(5)
630d8899132SKalle Valo #define HAL_RX_MPDU_ERR_MPDU_LEN		BIT(6)
631d8899132SKalle Valo #define HAL_RX_MPDU_ERR_UNENCRYPTED_FRAME	BIT(7)
632d8899132SKalle Valo 
633d8899132SKalle Valo static inline
634d8899132SKalle Valo enum nl80211_he_ru_alloc ath12k_he_ru_tones_to_nl80211_he_ru_alloc(u16 ru_tones)
635d8899132SKalle Valo {
636d8899132SKalle Valo 	enum nl80211_he_ru_alloc ret;
637d8899132SKalle Valo 
638d8899132SKalle Valo 	switch (ru_tones) {
639d8899132SKalle Valo 	case RU_52:
640d8899132SKalle Valo 		ret = NL80211_RATE_INFO_HE_RU_ALLOC_52;
641d8899132SKalle Valo 		break;
642d8899132SKalle Valo 	case RU_106:
643d8899132SKalle Valo 		ret = NL80211_RATE_INFO_HE_RU_ALLOC_106;
644d8899132SKalle Valo 		break;
645d8899132SKalle Valo 	case RU_242:
646d8899132SKalle Valo 		ret = NL80211_RATE_INFO_HE_RU_ALLOC_242;
647d8899132SKalle Valo 		break;
648d8899132SKalle Valo 	case RU_484:
649d8899132SKalle Valo 		ret = NL80211_RATE_INFO_HE_RU_ALLOC_484;
650d8899132SKalle Valo 		break;
651d8899132SKalle Valo 	case RU_996:
652d8899132SKalle Valo 		ret = NL80211_RATE_INFO_HE_RU_ALLOC_996;
653d8899132SKalle Valo 		break;
654d8899132SKalle Valo 	case RU_26:
655d8899132SKalle Valo 		fallthrough;
656d8899132SKalle Valo 	default:
657d8899132SKalle Valo 		ret = NL80211_RATE_INFO_HE_RU_ALLOC_26;
658d8899132SKalle Valo 		break;
659d8899132SKalle Valo 	}
660d8899132SKalle Valo 	return ret;
661d8899132SKalle Valo }
662d8899132SKalle Valo 
663d8899132SKalle Valo void ath12k_hal_reo_status_queue_stats(struct ath12k_base *ab,
664d8899132SKalle Valo 				       struct hal_tlv_64_hdr *tlv,
665d8899132SKalle Valo 				       struct hal_reo_status *status);
666d8899132SKalle Valo void ath12k_hal_reo_flush_queue_status(struct ath12k_base *ab,
667d8899132SKalle Valo 				       struct hal_tlv_64_hdr *tlv,
668d8899132SKalle Valo 				       struct hal_reo_status *status);
669d8899132SKalle Valo void ath12k_hal_reo_flush_cache_status(struct ath12k_base *ab,
670d8899132SKalle Valo 				       struct hal_tlv_64_hdr *tlv,
671d8899132SKalle Valo 				       struct hal_reo_status *status);
672d8899132SKalle Valo void ath12k_hal_reo_unblk_cache_status(struct ath12k_base *ab,
673d8899132SKalle Valo 				       struct hal_tlv_64_hdr *tlv,
674d8899132SKalle Valo 				       struct hal_reo_status *status);
675d8899132SKalle Valo void ath12k_hal_reo_flush_timeout_list_status(struct ath12k_base *ab,
676d8899132SKalle Valo 					      struct hal_tlv_64_hdr *tlv,
677d8899132SKalle Valo 					      struct hal_reo_status *status);
678d8899132SKalle Valo void ath12k_hal_reo_desc_thresh_reached_status(struct ath12k_base *ab,
679d8899132SKalle Valo 					       struct hal_tlv_64_hdr *tlv,
680d8899132SKalle Valo 					       struct hal_reo_status *status);
681d8899132SKalle Valo void ath12k_hal_reo_update_rx_reo_queue_status(struct ath12k_base *ab,
682d8899132SKalle Valo 					       struct hal_tlv_64_hdr *tlv,
683d8899132SKalle Valo 					       struct hal_reo_status *status);
684d8899132SKalle Valo void ath12k_hal_rx_msdu_link_info_get(struct hal_rx_msdu_link *link, u32 *num_msdus,
685d8899132SKalle Valo 				      u32 *msdu_cookies,
686d8899132SKalle Valo 				      enum hal_rx_buf_return_buf_manager *rbm);
687d8899132SKalle Valo void ath12k_hal_rx_msdu_link_desc_set(struct ath12k_base *ab,
688d8899132SKalle Valo 				      struct hal_wbm_release_ring *dst_desc,
689d8899132SKalle Valo 				      struct hal_wbm_release_ring *src_desc,
690d8899132SKalle Valo 				      enum hal_wbm_rel_bm_act action);
691d8899132SKalle Valo void ath12k_hal_rx_buf_addr_info_set(struct ath12k_buffer_addr *binfo,
692d8899132SKalle Valo 				     dma_addr_t paddr, u32 cookie, u8 manager);
693d8899132SKalle Valo void ath12k_hal_rx_buf_addr_info_get(struct ath12k_buffer_addr *binfo,
694d8899132SKalle Valo 				     dma_addr_t *paddr,
695d8899132SKalle Valo 				     u32 *cookie, u8 *rbm);
696d8899132SKalle Valo int ath12k_hal_desc_reo_parse_err(struct ath12k_base *ab,
697d8899132SKalle Valo 				  struct hal_reo_dest_ring *desc,
698d8899132SKalle Valo 				  dma_addr_t *paddr, u32 *desc_bank);
699d8899132SKalle Valo int ath12k_hal_wbm_desc_parse_err(struct ath12k_base *ab, void *desc,
700d8899132SKalle Valo 				  struct hal_rx_wbm_rel_info *rel_info);
701d8899132SKalle Valo void ath12k_hal_rx_reo_ent_paddr_get(struct ath12k_base *ab,
702d8899132SKalle Valo 				     struct ath12k_buffer_addr *buff_addr,
703d8899132SKalle Valo 				     dma_addr_t *paddr, u32 *cookie);
704d8899132SKalle Valo 
705d8899132SKalle Valo #endif
706