1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
3  *
4  * Copyright(c) 2016  Realtek Corporation.
5  *
6  * Contact Information:
7  * wlanfae <wlanfae@realtek.com>
8  * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
9  * Hsinchu 300, Taiwan.
10  *
11  * Larry Finger <Larry.Finger@lwfinger.net>
12  *
13  *****************************************************************************/
14 
15 #ifndef __RTL8822B_DEF_H__
16 #define __RTL8822B_DEF_H__
17 
18 #define RX_DESC_NUM_8822BE	512
19 
20 #define HAL_PRIME_CHNL_OFFSET_DONT_CARE	0
21 #define HAL_PRIME_CHNL_OFFSET_LOWER	1
22 #define HAL_PRIME_CHNL_OFFSET_UPPER	2
23 
24 #define RX_MPDU_QUEUE	0
25 
26 #define IS_HT_RATE(_rate) (_rate >= DESC_RATEMCS0)
27 #define IS_CCK_RATE(_rate) (_rate >= DESC_RATE1M && _rate <= DESC_RATE11M)
28 #define IS_OFDM_RATE(_rate) (_rate >= DESC_RATE6M && _rate <= DESC_RATE54M)
29 #define IS_1T_RATE(_rate)                                                      \
30 	((_rate >= DESC_RATE1M && _rate <= DESC_RATEMCS7) ||                   \
31 	 (_rate >= DESC_RATEVHT1SS_MCS0 && _rate <= DESC_RATEVHT1SS_MCS9))
32 #define IS_2T_RATE(_rate)                                                      \
33 	((_rate >= DESC_RATEMCS8 && _rate <= DESC_RATEMCS15) ||                \
34 	 (_rate >= DESC_RATEVHT2SS_MCS0 && _rate <= DESC_RATEVHT2SS_MCS9))
35 
36 #define IS_1T_RATESEC(_rs)                                                     \
37 	((_rs == CCK) || (_rs == OFDM) || (_rs == HT_MCS0_MCS7) ||             \
38 	 (_rs == VHT_1SSMCS0_1SSMCS9))
39 #define IS_2T_RATESEC(_rs)                                                     \
40 	((_rs == HT_MCS8_MCS15) || (_rs == VHT_2SSMCS0_2SSMCS9))
41 
42 enum rx_packet_type {
43 	NORMAL_RX,
44 	C2H_PACKET,
45 };
46 
47 enum rtl_desc_qsel {
48 	QSLT_BK	= 0x2,
49 	QSLT_BE	= 0x0,
50 	QSLT_VI	= 0x5,
51 	QSLT_VO	= 0x7,
52 	QSLT_BEACON	= 0x10,
53 	QSLT_HIGH	= 0x11,
54 	QSLT_MGNT	= 0x12,
55 	QSLT_CMD	= 0x13,
56 };
57 
58 enum vht_data_sc {
59 	VHT_DATA_SC_DONOT_CARE	= 0,
60 	VHT_DATA_SC_20_UPPER_OF_80MHZ	= 1,
61 	VHT_DATA_SC_20_LOWER_OF_80MHZ	= 2,
62 	VHT_DATA_SC_20_UPPERST_OF_80MHZ	= 3,
63 	VHT_DATA_SC_20_LOWEST_OF_80MHZ	= 4,
64 	VHT_DATA_SC_20_RECV1	= 5,
65 	VHT_DATA_SC_20_RECV2	= 6,
66 	VHT_DATA_SC_20_RECV3	= 7,
67 	VHT_DATA_SC_20_RECV4	= 8,
68 	VHT_DATA_SC_40_UPPER_OF_80MHZ	= 9,
69 	VHT_DATA_SC_40_LOWER_OF_80MHZ	= 10,
70 };
71 #endif
72