GNU Linux-libre 4.14.332-gnu1
[releases.git] / drivers / staging / rtlwifi / rtl8822be / def.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2016  Realtek Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  *
14  * The full GNU General Public License is included in this distribution in the
15  * file called LICENSE.
16  *
17  * Contact Information:
18  * wlanfae <wlanfae@realtek.com>
19  * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20  * Hsinchu 300, Taiwan.
21  *
22  * Larry Finger <Larry.Finger@lwfinger.net>
23  *
24  *****************************************************************************/
25
26 #ifndef __RTL8822B_DEF_H__
27 #define __RTL8822B_DEF_H__
28
29 #define RX_DESC_NUM_8822BE      512
30
31 #define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0
32 #define HAL_PRIME_CHNL_OFFSET_LOWER     1
33 #define HAL_PRIME_CHNL_OFFSET_UPPER     2
34
35 #define RX_MPDU_QUEUE   0
36
37 #define IS_HT_RATE(_rate) (_rate >= DESC_RATEMCS0)
38 #define IS_CCK_RATE(_rate) (_rate >= DESC_RATE1M && _rate <= DESC_RATE11M)
39 #define IS_OFDM_RATE(_rate) (_rate >= DESC_RATE6M && _rate <= DESC_RATE54M)
40 #define IS_1T_RATE(_rate)                                                      \
41         ((_rate >= DESC_RATE1M && _rate <= DESC_RATEMCS7) ||                   \
42          (_rate >= DESC_RATEVHT1SS_MCS0 && _rate <= DESC_RATEVHT1SS_MCS9))
43 #define IS_2T_RATE(_rate)                                                      \
44         ((_rate >= DESC_RATEMCS8 && _rate <= DESC_RATEMCS15) ||                \
45          (_rate >= DESC_RATEVHT2SS_MCS0 && _rate <= DESC_RATEVHT2SS_MCS9))
46
47 #define IS_1T_RATESEC(_rs)                                                     \
48         ((_rs == CCK) || (_rs == OFDM) || (_rs == HT_MCS0_MCS7) ||             \
49          (_rs == VHT_1SSMCS0_1SSMCS9))
50 #define IS_2T_RATESEC(_rs)                                                     \
51         ((_rs == HT_MCS8_MCS15) || (_rs == VHT_2SSMCS0_2SSMCS9))
52
53 enum rx_packet_type {
54         NORMAL_RX,
55         C2H_PACKET,
56 };
57
58 enum rtl_desc_qsel {
59         QSLT_BK = 0x2,
60         QSLT_BE = 0x0,
61         QSLT_VI = 0x5,
62         QSLT_VO = 0x7,
63         QSLT_BEACON     = 0x10,
64         QSLT_HIGH       = 0x11,
65         QSLT_MGNT       = 0x12,
66         QSLT_CMD        = 0x13,
67 };
68
69 enum vht_data_sc {
70         VHT_DATA_SC_DONOT_CARE  = 0,
71         VHT_DATA_SC_20_UPPER_OF_80MHZ   = 1,
72         VHT_DATA_SC_20_LOWER_OF_80MHZ   = 2,
73         VHT_DATA_SC_20_UPPERST_OF_80MHZ = 3,
74         VHT_DATA_SC_20_LOWEST_OF_80MHZ  = 4,
75         VHT_DATA_SC_20_RECV1    = 5,
76         VHT_DATA_SC_20_RECV2    = 6,
77         VHT_DATA_SC_20_RECV3    = 7,
78         VHT_DATA_SC_20_RECV4    = 8,
79         VHT_DATA_SC_40_UPPER_OF_80MHZ   = 9,
80         VHT_DATA_SC_40_LOWER_OF_80MHZ   = 10,
81 };
82 #endif