Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/core/rtw_chplan.h
1307 views
1
/******************************************************************************
2
*
3
* Copyright(c) 2007 - 2018 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
*****************************************************************************/
15
#ifndef __RTW_CHPLAN_H__
16
#define __RTW_CHPLAN_H__
17
18
enum rtw_chplan_id {
19
/* ===== 0x00 ~ 0x1F, legacy channel plan ===== */
20
RTW_CHPLAN_FCC = 0x00,
21
RTW_CHPLAN_IC = 0x01,
22
RTW_CHPLAN_ETSI = 0x02,
23
RTW_CHPLAN_SPAIN = 0x03,
24
RTW_CHPLAN_FRANCE = 0x04,
25
RTW_CHPLAN_MKK = 0x05,
26
RTW_CHPLAN_MKK1 = 0x06,
27
RTW_CHPLAN_ISRAEL = 0x07,
28
RTW_CHPLAN_TELEC = 0x08,
29
RTW_CHPLAN_GLOBAL_DOAMIN = 0x09,
30
RTW_CHPLAN_WORLD_WIDE_13 = 0x0A,
31
RTW_CHPLAN_TAIWAN = 0x0B,
32
RTW_CHPLAN_CHINA = 0x0C,
33
RTW_CHPLAN_SINGAPORE_INDIA_MEXICO = 0x0D,
34
RTW_CHPLAN_KOREA = 0x0E,
35
RTW_CHPLAN_TURKEY = 0x0F,
36
RTW_CHPLAN_JAPAN = 0x10,
37
RTW_CHPLAN_FCC_NO_DFS = 0x11,
38
RTW_CHPLAN_JAPAN_NO_DFS = 0x12,
39
RTW_CHPLAN_WORLD_WIDE_5G = 0x13,
40
RTW_CHPLAN_TAIWAN_NO_DFS = 0x14,
41
42
/* ===== 0x20 ~ 0x7F, new channel plan ===== */
43
RTW_CHPLAN_WORLD_NULL = 0x20,
44
RTW_CHPLAN_ETSI1_NULL = 0x21,
45
RTW_CHPLAN_FCC1_NULL = 0x22,
46
RTW_CHPLAN_MKK1_NULL = 0x23,
47
RTW_CHPLAN_ETSI2_NULL = 0x24,
48
RTW_CHPLAN_FCC1_FCC1 = 0x25,
49
RTW_CHPLAN_WORLD_ETSI1 = 0x26,
50
RTW_CHPLAN_MKK1_MKK1 = 0x27,
51
RTW_CHPLAN_WORLD_KCC1 = 0x28,
52
RTW_CHPLAN_WORLD_FCC2 = 0x29,
53
RTW_CHPLAN_FCC2_NULL = 0x2A,
54
RTW_CHPLAN_IC1_IC2 = 0x2B,
55
RTW_CHPLAN_MKK2_NULL = 0x2C,
56
RTW_CHPLAN_WORLD_CHILE1= 0x2D,
57
RTW_CHPLAN_WORLD1_WORLD1 = 0x2E,
58
RTW_CHPLAN_WORLD_CHILE2 = 0x2F,
59
RTW_CHPLAN_WORLD_FCC3 = 0x30,
60
RTW_CHPLAN_WORLD_FCC4 = 0x31,
61
RTW_CHPLAN_WORLD_FCC5 = 0x32,
62
RTW_CHPLAN_WORLD_FCC6 = 0x33,
63
RTW_CHPLAN_FCC1_FCC7 = 0x34,
64
RTW_CHPLAN_WORLD_ETSI2 = 0x35,
65
RTW_CHPLAN_WORLD_ETSI3 = 0x36,
66
RTW_CHPLAN_MKK1_MKK2 = 0x37,
67
RTW_CHPLAN_MKK1_MKK3 = 0x38,
68
RTW_CHPLAN_FCC1_NCC1 = 0x39,
69
RTW_CHPLAN_ETSI1_ETSI1 = 0x3A,
70
RTW_CHPLAN_ETSI1_ACMA1 = 0x3B,
71
RTW_CHPLAN_ETSI1_ETSI6 = 0x3C,
72
RTW_CHPLAN_ETSI1_ETSI12 = 0x3D,
73
RTW_CHPLAN_KCC1_KCC2 = 0x3E,
74
RTW_CHPLAN_FCC1_FCC11 = 0x3F,
75
RTW_C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14 = 0x68,
109
RTW_CHPLAN_FCC2_FCC12 = 0x69,
110
RTW_CHPLAN_ETSI1_ETSI17 = 0x6A,
111
RTW_CHPLAN_WORLD_FCC16 = 0x6B,
112
RTW_CHPLAN_WORLD_FCC13 = 0x6C,
113
RTW_CHPLAN_FCC2_FCC15 = 0x6D,
114
RTW_CHPLAN_WORLD_FCC12 = 0x6E,
115
RTW_CHPLAN_NULL_ETSI8 = 0x6F,
116
RTW_CHPLAN_NULL_ETSI18 = 0x70,
117
RTW_CHPLAN_NULL_ETSI17 = 0x71,
118
RTW_CHPLAN_NULL_ETSI19 = 0x72,
119
RTW_CHPLAN_WORLD_FCC7 = 0x73,
120
RTW_CHPLAN_FCC2_FCC17 = 0x74,
121
RTW_CHPLAN_WORLD_ETSI20 = 0x75,
122
RTW_CHPLAN_FCC2_FCC11 = 0x76,
123
RTW_CHPLAN_WORLD_ETSI21 = 0x77,
124
RTW_CHPLAN_FCC1_FCC18 = 0x78,
125
RTW_CHPLAN_MKK2_MKK1 = 0x79,
126
127
RTW_CHPLAN_MAX,
128
RTW_CHPLAN_REALTEK_DEFINE = 0x7F,
129
RTW_CHPLAN_UNSPECIFIED = 0xFF,
130
};
131
132
u8 rtw_chplan_get_default_regd(u8 id);
133
bool rtw_chplan_is_empty(u8 id);
134
#define rtw_is_channel_plan_valid(chplan) (((chplan) < RTW_CHPLAN_MAX || (chplan) == RTW_CHPLAN_REALTEK_DEFINE) && !rtw_chplan_is_empty(chplan))
135
#define rtw_is_legacy_channel_plan(chplan) ((chplan) < 0x20)
136
137
struct _RT_CHANNEL_INFO;
138
u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, struct _RT_CHANNEL_INFO *channel_set);
139
140
#define IS_ALPHA2_NO_SPECIFIED(_alpha2) ((*((u16 *)(_alpha2))) == 0xFFFF)
141
142
#define RTW_MODULE_RTL8821AE_HMC_M2 BIT0 /* RTL8821AE(HMC + M.2) */
143
#define RTW_MODULE_RTL8821AU BIT1 /* RTL8821AU */
144
#define RTW_MODULE_RTL8812AENF_NGFF BIT2 /* RTL8812AENF(8812AE+8761)_NGFF */
145
#define RTW_MODULE_RTL8812AEBT_HMC BIT3 /* RTL8812AEBT(8812AE+8761)_HMC */
146
#define RTW_MODULE_RTL8188EE_HMC_M2 BIT4 /* RTL8188EE(HMC + M.2) */
147
#define RTW_MODULE_RTL8723BE_HMC_M2 BIT5 /* RTL8723BE(HMC + M.2) */
148
#define RTW_MODULE_RTL8723BS_NGFF1216 BIT6 /* RTL8723BS(NGFF1216) */
149
#define RTW_MODULE_RTL8192EEBT_HMC_M2 BIT7 /* RTL8192EEBT(8192EE+8761AU)_(HMC + M.2) */
150
#define RTW_MODULE_RTL8723DE_NGFF1630 BIT8 /* RTL8723DE(NGFF1630) */
151
#define RTW_MODULE_RTL8822BE BIT9 /* RTL8822BE */
152
#define RTW_MODULE_RTL8821CE BIT10 /* RTL8821CE */
153
154
struct country_chplan {
155
char alpha2[2];
156
u8 chplan;
157
#ifdef CONFIG_80211AC_VHT
158
u8 en_11ac;
159
#endif
160
#if RTW_DEF_MODULE_REGULATORY_CERT
161
u16 def_module_flags; /* RTW_MODULE_RTLXXX */
162
#endif
163
};
164
165
#ifdef CONFIG_80211AC_VHT
166
#define COUNTRY_CHPLAN_EN_11AC(_ent) ((_ent)->en_11ac)
167
#else
168
#define COUNTRY_CHPLAN_EN_11AC(_ent) 0
169
#endif
170
171
#if RTW_DEF_MODULE_REGULATORY_CERT
172
#define COUNTRY_CHPLAN_DEF_MODULE_FALGS(_ent) ((_ent)->def_module_flags)
173
#else
174
#define COUNTRY_CHPLAN_DEF_MODULE_FALGS(_ent) 0
175
#endif
176
177
const struct country_chplan *rtw_get_chplan_from_country(const char *country_code);
178
179
void dump_country_chplan(void *sel, const struct country_chplan *ent);
180
void dump_country_chplan_map(void *sel);
181
void dump_chplan_id_list(void *sel);
182
void dump_chplan_test(void *sel);
183
void dump_chplan_ver(void *sel);
184
185
#endif /* __RTW_CHPLAN_H__ */
186
187