1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
|
/*
* Header file defines IEEE802.11 MIB
*
* $Id: ieee802_mib.h,v 1.12.2.5 2010/12/16 05:32:20 bruce Exp $
*
* Copyright (c) 2009 Realtek Semiconductor Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/*
* Note: Should not use compiler flag in this header file in order for
* flash utility to get correct mib size.
*/
#ifndef _IEEE802_MIB_H_
#define _IEEE802_MIB_H_
#define MIB_VERSION 6
#define MAX_2G_CHANNEL_NUM 14
#define MAX_5G_CHANNEL_NUM 196
#define MACADDRLEN 6
#ifdef CONFIG_RTL8196B_TLD
#define NUM_ACL 64
#else
#define NUM_ACL 32
#endif
#define NUM_GBWC 64
#ifdef CONFIG_RTL8186_KB
#define NUM_WDS 4
#elif defined(CONFIG_RTL8196C_EC) //no WDS or only one WDS
#define NUM_WDS 1
#else
#if defined(CONFIG_RTL8196B_GW_8M) || defined(CONFIG_RTL8196C_AP_ROOT) || defined(CONFIG_RTL8198_AP_ROOT)
#define NUM_WDS 4
#else
#define NUM_WDS 8
#endif
#endif
#define MESH_ID_LEN 32
#if !defined(_LITTLE_ENDIAN_) && !defined(_BIG_ENDIAN_)
#define _BIG_ENDIAN_
#endif
struct Dot11StationConfigEntry {
unsigned char dot11Bssid[MACADDRLEN];
unsigned char dot11DesiredSSID[32];
unsigned int dot11DesiredSSIDLen;
unsigned char dot11DefaultSSID[32];
unsigned int dot11DefaultSSIDLen;
unsigned char dot11SSIDtoScan[32];
unsigned int dot11SSIDtoScanLen;
unsigned char dot11DesiredBssid[6];
unsigned char dot11OperationalRateSet[32];
unsigned int dot11OperationalRateSetLen;
unsigned int dot11BeaconPeriod;
unsigned int dot11DTIMPeriod;
unsigned int dot11swcrypto;
unsigned int dot11AclMode; // 1: positive check 2: negative check
unsigned char dot11AclAddr[NUM_ACL][MACADDRLEN];
unsigned int dot11AclNum; // acl entry number, this field should be followed to dot11AclAddr
unsigned int dot11SupportedRates; // bit mask value. bit0-bit11 as 1,2,5.5,11,6,9,12,18,24,36,48,54
unsigned int dot11BasicRates; // bit mask value. bit0-bit11 as 1,2,5.5,11,6,9,12,18,24,36,48,54
unsigned int dot11RegDomain; // reguration domain
unsigned int autoRate; // enable/disable auto rate
unsigned int fixedTxRate; // fix tx rate
int swTkipMic;
int protectionDisabled; // force disable protection
int olbcDetectDisabled; // david, force disable olbc dection
int legacySTADeny; // deny association from legacy (11B) STA
int fastRoaming; // 1: enable fast-roaming, 0: disable
unsigned int lowestMlcstRate; // 1: use lowest basic rate to send multicast
unsigned int supportedStaNum; // limit supported station number
};
/* add for 802.11d */
struct Dot1180211CountryCodeEntry {
unsigned int dot11CountryCodeSwitch; // 1=enabled; 0=disabled
unsigned char dot11CountryString[3];
};
// Detect STA for disappearing; added by Annie, 2010-08-10.
struct StaDetectInfo {
unsigned char txRprDetectPeriod; // period to send H2C command for Tx report infoormation; in second.
};
struct Dot1180211AuthEntry {
unsigned int dot11AuthAlgrthm; // 802.11 auth, could be open, shared, auto
unsigned int dot11PrivacyAlgrthm; // encryption algorithm, could be none, wep40, TKIP, CCMP, wep104
unsigned int dot11PrivacyKeyIndex; // this is only valid for legendary wep, 0~3 for key id.
unsigned int dot11PrivacyKeyLen; // this could be 40 or 104
int dot11EnablePSK; // 0: disable, bit0: WPA, bit1: WPA2
int dot11WPACipher; // bit0-wep64, bit1-tkip, bit2-wrap,bit3-ccmp, bit4-wep128
int dot11WPA2Cipher; // bit0-wep64, bit1-tkip, bit2-wrap,bit3-ccmp, bit4-wep128
unsigned char dot11PassPhrase[65]; // passphrase
unsigned char dot11PassPhraseGuest[65]; // passphrase of guest
unsigned long dot11GKRekeyTime; // group key rekey time, 0 - disable
};
struct Dot118021xAuthEntry {
unsigned int dot118021xAlgrthm; // could be null, 802.1x/PSK
unsigned int dot118021xDefaultPort; // used as AP mode for default ieee8021x control port
unsigned int dot118021xcontrolport;
};
union Keytype {
unsigned char skey[16];
unsigned int lkey[4];
};
struct Dot11DefaultKeysTable {
union Keytype keytype[4];
};
union TSC48 {
unsigned long long val48;
#if defined _LITTLE_ENDIAN_
struct {
unsigned char TSC0;
unsigned char TSC1;
unsigned char TSC2;
unsigned char TSC3;
unsigned char TSC4;
unsigned char TSC5;
unsigned char TSC6;
unsigned char TSC7;
} _byte_;
#elif defined _BIG_ENDIAN_
struct {
unsigned char TSC7;
unsigned char TSC6;
unsigned char TSC5;
unsigned char TSC4;
unsigned char TSC3;
unsigned char TSC2;
unsigned char TSC1;
unsigned char TSC0;
} _byte_;
#endif
};
union PN48 {
unsigned long long val48;
#if defined _LITTLE_ENDIAN_
struct {
unsigned char TSC0;
unsigned char TSC1;
unsigned char TSC2;
unsigned char TSC3;
unsigned char TSC4;
unsigned char TSC5;
unsigned char TSC6;
unsigned char TSC7;
} _byte_;
#elif defined _BIG_ENDIAN_
struct {
unsigned char TSC7;
unsigned char TSC6;
unsigned char TSC5;
unsigned char TSC4;
unsigned char TSC3;
unsigned char TSC2;
unsigned char TSC1;
unsigned char TSC0;
} _byte_;
#endif
};
struct Dot11EncryptKey
{
unsigned int dot11TTKeyLen;
unsigned int dot11TMicKeyLen;
union Keytype dot11TTKey;
union Keytype dot11TMicKey1;
union Keytype dot11TMicKey2;
union PN48 dot11TXPN48;
union PN48 dot11RXPN48;
};
struct Dot11KeyMappingsEntry {
unsigned int dot11Privacy;
unsigned int keyInCam; // Is my key in CAM?
unsigned int keyid;
struct Dot11EncryptKey dot11EncryptKey;
};
struct Dot11RsnIE {
unsigned char rsnie[128];
unsigned char rsnielen;
};
struct Dot11OperationEntry {
unsigned char hwaddr[MACADDRLEN];
unsigned int opmode;
unsigned int hiddenAP;
unsigned int dot11RTSThreshold;
unsigned int dot11FragmentationThreshold;
unsigned int dot11ShortRetryLimit;
unsigned int dot11LongRetryLimit;
unsigned int expiretime;
unsigned int ledtype;
unsigned int ledroute;
unsigned int iapp_enable;
unsigned int block_relay;
unsigned int deny_any;
unsigned int crc_log;
unsigned int wifi_specific;
unsigned int disable_txsc;
unsigned int disable_rxsc;
unsigned int disable_brsc;
int keep_rsnie;
int guest_access;
};
struct Dot11RFEntry {
unsigned int dot11RFType;
unsigned int dot11channel;
unsigned int dot11ch_low;
unsigned int dot11ch_hi;
unsigned char pwrlevelCCK_A[MAX_2G_CHANNEL_NUM];
unsigned char pwrlevelCCK_B[MAX_2G_CHANNEL_NUM];
unsigned char pwrlevelHT40_1S_A[MAX_2G_CHANNEL_NUM];
unsigned char pwrlevelHT40_1S_B[MAX_2G_CHANNEL_NUM];
unsigned char pwrdiffHT40_2S[MAX_2G_CHANNEL_NUM];
unsigned char pwrdiffHT20[MAX_2G_CHANNEL_NUM];
unsigned char pwrdiffOFDM[MAX_2G_CHANNEL_NUM];
unsigned char pwrlevel5GHT40_1S_A[MAX_5G_CHANNEL_NUM];
unsigned char pwrlevel5GHT40_1S_B[MAX_5G_CHANNEL_NUM];
unsigned char pwrdiff5GHT40_2S[MAX_5G_CHANNEL_NUM];
unsigned char pwrdiff5GHT20[MAX_5G_CHANNEL_NUM];
unsigned char pwrdiff5GOFDM[MAX_5G_CHANNEL_NUM];
unsigned int defaultAntennaB;
unsigned int dot11DiversitySupport;
unsigned int shortpreamble;
unsigned int trswitch;
unsigned int disable_ch14_ofdm;
unsigned int xcap;
unsigned int tssi1;
unsigned int tssi2;
unsigned int ther;
unsigned int deltaIQK;
unsigned int deltaLCK;
unsigned int MIMO_TR_mode;
unsigned int phyBandSelect;
unsigned int macPhyMode;
unsigned int smcc;
unsigned int smcc_t;
#ifdef PHASE2_TEST
unsigned int smcc_p;
#endif
unsigned char trsw_pape_C9;
unsigned char trsw_pape_CC;
unsigned int txbf;
unsigned int target_pwr;
};
struct ibss_priv {
unsigned short atim_win;
};
#if defined(CONFIG_RTL_WAPI_SUPPORT)
#define SECURITY_INFO_WAPI 0xa5a56789
#endif
struct bss_desc {
unsigned char bssid[MACADDRLEN];
unsigned char ssid[32];
unsigned char *ssidptr; // unused, for backward compatible
unsigned short ssidlen;
unsigned char meshid[MESH_ID_LEN];
unsigned char *meshidptr; // unused, for backward compatible
unsigned short meshidlen;
unsigned int bsstype;
unsigned short beacon_prd;
unsigned char dtim_prd;
unsigned int t_stamp[2];
struct ibss_priv ibss_par;
unsigned short capability;
unsigned char channel;
unsigned int basicrate;
unsigned int supportrate;
unsigned char bdsa[MACADDRLEN];
unsigned char rssi;
unsigned char sq;
unsigned char network;
};
struct bss_type
{
unsigned char net_work_type;
};
struct erp_mib {
int protection; // protection mechanism flag
int nonErpStaNum; // none ERP client assoication num
int olbcDetected; // OLBC detected
int olbcExpired; // expired time of OLBC state
int shortSlot; // short slot time flag
int ctsToSelf; // CTStoSelf flag
int longPreambleStaNum; // number of assocated STA using long preamble
};
struct wdsEntry {
unsigned char macAddr [MACADDRLEN] __attribute__ ((packed));
unsigned int txRate __attribute__ ((packed));
};
struct wds_info {
int wdsEnabled;
int wdsPure; // act as WDS bridge only, no AP function
int wdsPriority; // WDS packets have higer priority
struct wdsEntry entry[NUM_WDS];
int wdsNum; // number of WDS used
int wdsPrivacy;
unsigned char wdsWepKey[32];
unsigned char wdsMapingKey[NUM_WDS][32];
int wdsMappingKeyLen[NUM_WDS];
int wdsKeyId;
unsigned char wdsPskPassPhrase[65];
};
struct br_ext_info {
unsigned int nat25_disable;
unsigned int macclone_enable;
unsigned int dhcp_bcst_disable;
int addPPPoETag; // 1: Add PPPoE relay-SID, 0: disable
unsigned char nat25_dmzMac[MACADDRLEN];
unsigned int nat25sc_disable;
};
struct Dot11DFSEntry {
unsigned int disable_DFS; // 1 or 0
unsigned int disable_tx; // 1 or 0
unsigned int DFS_timeout; // set to 10 ms
unsigned int DFS_detected; // 1 or 0
unsigned int NOP_timeout; // set to 30 mins
unsigned int rs1_threshold; // threshold for 26ms/18pulses and 70ms/18pulses radar signals
unsigned int temply_disable_DFS;
unsigned int Throughput_Threshold; // will disable DFS when greater than this threshold (M bits/sec)
unsigned int RecordHistory_sec;
unsigned int Dump_Throughput; // dynamically dump the throughput
unsigned int disable_DetermineDFSDisable;// var. to dynamically turn on/off DetermineDFSDisable func.
};
struct MiscEntry {
unsigned int show_hidden_bss;
unsigned int ack_timeout;
unsigned int reserved1;
unsigned int reserved2;
unsigned char private_ie[32];
unsigned int private_ie_len;
unsigned int set_vlanid;
unsigned int rxInt_thrd;
unsigned int drvmac_lb;
unsigned char lb_da[6];
unsigned int lb_tps;
unsigned int lb_mlmp;
unsigned int groupID;
unsigned int vap_enable;
unsigned int rsv_txdesc; // 1: enable "reserve tx desc for each interface" function; 0: disable.
unsigned int func_off;
};
struct ParaRecord {
unsigned int ACM;
unsigned int AIFSN;
unsigned int ECWmin;
unsigned int ECWmax;
unsigned int TXOPlimit;
};
struct Dot11QosEntry {
unsigned int dot11QosEnable; // 0=disable, 1=enable
unsigned int dot11QosAPSD; // 0=disable, 1=enable
unsigned int EDCAparaUpdateCount; // default=0, increases if any STA_AC_XX_paraRecord updated
unsigned int EDCA_STA_config; // WMM STA, default=0, will be set when assoc AP's EDCA para have been set
unsigned char WMM_IE[7]; // WMM STA, WMM IE
unsigned char WMM_PARA_IE[24]; // WMM EDCA Parameter IE
struct ParaRecord STA_AC_BE_paraRecord;
struct ParaRecord STA_AC_BK_paraRecord;
struct ParaRecord STA_AC_VI_paraRecord;
struct ParaRecord STA_AC_VO_paraRecord;
unsigned int ManualEDCA; // 0=disable, 1=enable
struct ParaRecord AP_manualEDCA[4];
struct ParaRecord STA_manualEDCA[4];
unsigned char TID_mapping[8]; // 1: BK, 2: BE, 3: VI, 4: VO
};
struct WifiSimpleConfigEntry {
unsigned int wsc_enable;
unsigned char beacon_ie[256];
int beacon_ielen;
unsigned char probe_rsp_ie[256];
int probe_rsp_ielen;
unsigned char probe_req_ie[256];
int probe_req_ielen;
unsigned char assoc_ie[256];
int assoc_ielen;
};
struct GroupBandWidthControl {
unsigned int GBWCMode; // 0: disable 1: inner limitation 2: outer limitation
unsigned char GBWCAddr[NUM_GBWC][MACADDRLEN];
unsigned int GBWCNum; // GBWC entry number, this field should be followed to GBWCAddr
unsigned int GBWCThrd; // Threshold, in unit of kbps
};
struct Dot11nConfigEntry {
unsigned int dot11nSupportedMCS;
unsigned int dot11nBasicMCS;
unsigned int dot11nUse40M; // 0: 20M, 1: 40M
unsigned int dot11n2ndChOffset; // 0: don't care, 1: below the primary, 2: above the primary
unsigned int dot11nShortGIfor20M;
unsigned int dot11nShortGIfor40M;
unsigned int dot11nSTBC;
unsigned int dot11nAMPDU;
unsigned int dot11nAMSDU;
unsigned int dot11nAMPDUSendSz; // 8: 8K, 16: 16K, 32: 32K, 64: 64K, other: auto
unsigned int dot11nAMSDURecvMax; // 0: 4K, 1: 8K
unsigned int dot11nAMSDUSendTimeout; // timeout value to queue AMSDU packets
unsigned int dot11nAMSDUSendNum; // max aggregation packet number
unsigned int dot11nLgyEncRstrct; // bit0: Wep, bit1: TKIP, bit2: restrict Realtek client, bit3: forbid N mode for legacy enc
unsigned int dot11nCoexist;
};
struct ReorderControlEntry {
unsigned int ReorderCtrlEnable;
unsigned int reserved;
unsigned int ReorderCtrlWinSz;
unsigned int ReorderCtrlTimeout;
};
struct Dot1180211sInfo{
unsigned char meshSilence; // active when pure Mesh Mode but not enabled
unsigned char mesh_enable;
unsigned char mesh_root_enable;
unsigned char mesh_ap_enable;
unsigned char mesh_portal_enable;
unsigned char mesh_id[32];
unsigned short mesh_max_neightbor;
unsigned char log_enabled; // content from webpage setting MIB_LOG_ENABLED (bitmap)
unsigned int mesh_acl_mode;
unsigned char mesh_acl_addr[NUM_ACL][MACADDRLEN];
unsigned int mesh_acl_num;
unsigned short mesh_reserved1;
unsigned short mesh_reserved2;
unsigned short mesh_reserved3;
unsigned short mesh_reserved4;
unsigned short mesh_reserved5;
unsigned short mesh_reserved6;
unsigned short mesh_reserved7;
unsigned short mesh_reserved8;
unsigned short mesh_reserved9;
unsigned short mesh_reserveda;
unsigned short mesh_reservedb;
unsigned short mesh_reservedc;
unsigned short mesh_reservedd;
unsigned short mesh_reservede;
unsigned short mesh_reservedf;
unsigned char mesh_reservedstr1[16];
};
struct EfuseEntry {
unsigned int enable_efuse;
};
struct VlanConfig {
int global_vlan; // 0/1 - global vlan disable/enable
int is_lan; // 1: LAN port, 0: WAN port (per-port)
int vlan_enable; // 0/1: disable/enable vlan (per-port)
int vlan_tag; // 0/1: disable/enable tagging (per-port)
int vlan_id; // 1~4090: vlan id (per-port)
int vlan_pri; // 0~7: priority; (per-port)
int vlan_cfi; // 0/1: cfi (per-port)
int forwarding; // 0: disable 1:L2 bridged 2:NAT
};
/* type define must accordint to the wapi standard */
typedef enum __wapiMibType {
wapiDisable = 0,
wapiTypeCert = 1,
wapiTypePSK = 2
} wapiMibType;
#define WAPI_PSK_LEN 32
typedef struct __wapiMibPSK {
unsigned char octet[WAPI_PSK_LEN];
unsigned int len;
} wapiMibPSK;
typedef enum __wapiMibTimeoutType {
wapiTimeoutStart = 0,
wapiTimeoutTotalNum = 1
} wapiMibTimeoutType;
typedef unsigned int wapiMibTimeout;
/* Currently only one encrypt algorithm was supported,
* we need NOT to record it
*/
typedef enum __wapiMibEncryptAlgorithm {
wapi_SMS4 = 1
} wapiMibEncryptAlgorithm;
typedef enum __wapiMibKeyUpdateType {
wapi_disable_update = 1,
wapi_time_update = 2,
wapi_pktnum_update = 3,
wapi_all_update = 4
} wapiMibKeyUpdateType;
typedef struct __wapiMibInfo {
wapiMibType wapiType;
wapiMibEncryptAlgorithm wapiUCastEncodeType;
wapiMibEncryptAlgorithm wapiMCastEncodeType;
wapiMibPSK wapiPsk;
wapiMibKeyUpdateType wapiUpdateUCastKeyType;
unsigned long wapiUpdateUCastKeyTimeout;
unsigned long wapiUpdateUCastKeyPktNum;
wapiMibKeyUpdateType wapiUpdateMCastKeyType;
unsigned long wapiUpdateMCastKeyTimeout;
unsigned long wapiUpdateMCastKeyPktNum;
wapiMibTimeout wapiTimeout[wapiTimeoutTotalNum];
} wapiMibInfo;
// driver mib
struct wifi_mib {
unsigned int mib_version;
struct Dot11StationConfigEntry dot11StationConfigEntry;
struct Dot1180211AuthEntry dot1180211AuthEntry;
struct Dot118021xAuthEntry dot118021xAuthEntry;
struct Dot11DefaultKeysTable dot11DefaultKeysTable;
struct Dot11KeyMappingsEntry dot11GroupKeysTable;
struct Dot11RsnIE dot11RsnIE;
struct Dot11OperationEntry dot11OperationEntry;
struct Dot11RFEntry dot11RFEntry;
struct bss_desc dot11Bss;
struct bss_type dot11BssType;
struct erp_mib dot11ErpInfo;
struct wds_info dot11WdsInfo;
struct br_ext_info ethBrExtInfo;
struct Dot11DFSEntry dot11DFSEntry;
struct MiscEntry miscEntry;
struct Dot11QosEntry dot11QosEntry;
struct WifiSimpleConfigEntry wscEntry;
struct GroupBandWidthControl gbwcEntry;
struct Dot11nConfigEntry dot11nConfigEntry;
struct ReorderControlEntry reorderCtrlEntry;
struct VlanConfig vlan;
struct Dot1180211sInfo dot1180211sInfo;
struct Dot11KeyMappingsEntry dot11sKeysTable;
struct __wapiMibInfo wapiInfo;
struct Dot1180211CountryCodeEntry dot11dCountry;
struct EfuseEntry efuseEntry;
struct StaDetectInfo staDetectInfo;
};
#endif // _IEEE802_MIB_H_
|