GNU Linux-libre 4.9-gnu1
[releases.git] / drivers / staging / rtl8188eu / include / rtw_rf.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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  ******************************************************************************/
15 #ifndef __RTW_RF_H_
16 #define __RTW_RF_H_
17
18 #include <rtw_cmd.h>
19
20 #define OFDM_PHY                1
21 #define MIXED_PHY               2
22 #define CCK_PHY         3
23
24 #define NumRates        (13)
25
26 /*  slot time for 11g */
27 #define SHORT_SLOT_TIME                 9
28 #define NON_SHORT_SLOT_TIME             20
29
30 #define RTL8711_RF_MAX_SENS             6
31 #define RTL8711_RF_DEF_SENS             4
32
33 /*  We now define the following channels as the max channels in each
34  * channel plan. */
35 /*  2G, total 14 chnls */
36 /*  {1,2,3,4,5,6,7,8,9,10,11,12,13,14} */
37 #define MAX_CHANNEL_NUM_2G              14
38 #define MAX_CHANNEL_NUM                 14      /* 2.4 GHz only */
39
40 #define NUM_REGULATORYS 1
41
42 /* Country codes */
43 #define USA                             0x555320
44 #define EUROPE                          0x1 /* temp, should be provided later */
45 #define JAPAN                           0x2 /* temp, should be provided later */
46
47 struct  regulatory_class {
48         u32     starting_freq;                          /* MHz, */
49         u8      channel_set[MAX_CHANNEL_NUM];
50         u8      channel_cck_power[MAX_CHANNEL_NUM];     /* dbm */
51         u8      channel_ofdm_power[MAX_CHANNEL_NUM];    /* dbm */
52         u8      txpower_limit;                          /* dbm */
53         u8      channel_spacing;                        /* MHz */
54         u8      modem;
55 };
56
57 enum capability {
58         cESS            = 0x0001,
59         cIBSS           = 0x0002,
60         cPollable       = 0x0004,
61         cPollReq        = 0x0008,
62         cPrivacy        = 0x0010,
63         cShortPreamble  = 0x0020,
64         cPBCC           = 0x0040,
65         cChannelAgility = 0x0080,
66         cSpectrumMgnt   = 0x0100,
67         cQos            = 0x0200,       /* For HCCA, use with CF-Pollable
68                                          * and CF-PollReq */
69         cShortSlotTime  = 0x0400,
70         cAPSD           = 0x0800,
71         cRM             = 0x1000,       /*  RRM (Radio Request Measurement) */
72         cDSSS_OFDM      = 0x2000,
73         cDelayedBA      = 0x4000,
74         cImmediateBA    = 0x8000,
75 };
76
77 enum    _REG_PREAMBLE_MODE {
78         PREAMBLE_LONG   = 1,
79         PREAMBLE_AUTO   = 2,
80         PREAMBLE_SHORT  = 3,
81 };
82
83 enum _RTL8712_RF_MIMO_CONFIG_ {
84         RTL8712_RFCONFIG_1T = 0x10,
85         RTL8712_RFCONFIG_2T = 0x20,
86         RTL8712_RFCONFIG_1R = 0x01,
87         RTL8712_RFCONFIG_2R = 0x02,
88         RTL8712_RFCONFIG_1T1R = 0x11,
89         RTL8712_RFCONFIG_1T2R = 0x12,
90         RTL8712_RFCONFIG_TURBO = 0x92,
91         RTL8712_RFCONFIG_2T2R = 0x22
92 };
93
94 enum rf90_radio_path {
95         RF90_PATH_A = 0,                /* Radio Path A */
96         RF90_PATH_B = 1,                /* Radio Path B */
97         RF90_PATH_C = 2,                /* Radio Path C */
98         RF90_PATH_D = 3                 /* Radio Path D */
99 };
100
101 /*  Bandwidth Offset */
102 #define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0
103 #define HAL_PRIME_CHNL_OFFSET_LOWER     1
104 #define HAL_PRIME_CHNL_OFFSET_UPPER     2
105
106 /*  Represent Channel Width in HT Capabilities */
107 /*  */
108 enum ht_channel_width {
109         HT_CHANNEL_WIDTH_20 = 0,
110         HT_CHANNEL_WIDTH_40 = 1,
111         HT_CHANNEL_WIDTH_80 = 2,
112         HT_CHANNEL_WIDTH_160 = 3,
113         HT_CHANNEL_WIDTH_10 = 4,
114 };
115
116 /*  */
117 /*  Represent Extension Channel Offset in HT Capabilities */
118 /*  This is available only in 40Mhz mode. */
119 /*  */
120 enum ht_extchnl_offset {
121         HT_EXTCHNL_OFFSET_NO_EXT = 0,
122         HT_EXTCHNL_OFFSET_UPPER = 1,
123         HT_EXTCHNL_OFFSET_NO_DEF = 2,
124         HT_EXTCHNL_OFFSET_LOWER = 3,
125 };
126
127 /* 2007/11/15 MH Define different RF type. */
128 enum rt_rf_type_def {
129         RF_1T2R = 0,
130         RF_2T4R = 1,
131         RF_2T2R = 2,
132         RF_1T1R = 3,
133         RF_2T2R_GREEN = 4,
134         RF_819X_MAX_TYPE = 5,
135 };
136
137 u32 rtw_ch2freq(u32 ch);
138
139
140 #endif /* _RTL8711_RF_H_ */