This source file includes following definitions.
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
- GEN_EVT_CODE
1
2
3
4
5
6
7 #ifndef __RTW_MLME_EXT_H_
8 #define __RTW_MLME_EXT_H_
9
10
11
12
13
14
15
16
17 #define SURVEY_TO (100)
18 #define REAUTH_TO (300)
19 #define REASSOC_TO (300)
20
21 #define ADDBA_TO (2000)
22
23 #define LINKED_TO (1)
24
25 #define REAUTH_LIMIT (4)
26 #define REASSOC_LIMIT (4)
27 #define READDBA_LIMIT (2)
28
29 #define ROAMING_LIMIT 8
30
31
32
33
34
35
36
37
38
39
40 #define DYNAMIC_FUNC_DISABLE (0x0)
41
42
43
44 #define DYNAMIC_BB_DIG BIT0
45 #define DYNAMIC_BB_RA_MASK BIT1
46 #define DYNAMIC_BB_DYNAMIC_TXPWR BIT2
47 #define DYNAMIC_BB_BB_FA_CNT BIT3
48 #define DYNAMIC_BB_RSSI_MONITOR BIT4
49 #define DYNAMIC_BB_CCK_PD BIT5
50 #define DYNAMIC_BB_ANT_DIV BIT6
51 #define DYNAMIC_BB_PWR_SAVE BIT7
52 #define DYNAMIC_BB_PWR_TRAIN BIT8
53 #define DYNAMIC_BB_RATE_ADAPTIVE BIT9
54 #define DYNAMIC_BB_PATH_DIV BIT10
55 #define DYNAMIC_BB_PSD BIT11
56 #define DYNAMIC_BB_RXHP BIT12
57 #define DYNAMIC_BB_ADAPTIVITY BIT13
58 #define DYNAMIC_BB_DYNAMIC_ATC BIT14
59
60
61 #define DYNAMIC_MAC_EDCA_TURBO BIT16
62 #define DYNAMIC_MAC_EARLY_MODE BIT17
63
64
65 #define DYNAMIC_RF_TX_PWR_TRACK BIT24
66 #define DYNAMIC_RF_RX_GAIN_TRACK BIT25
67 #define DYNAMIC_RF_CALIBRATION BIT26
68
69 #define DYNAMIC_ALL_FUNC_ENABLE 0xFFFFFFF
70
71 #define _HW_STATE_NOLINK_ 0x00
72 #define _HW_STATE_ADHOC_ 0x01
73 #define _HW_STATE_STATION_ 0x02
74 #define _HW_STATE_AP_ 0x03
75
76
77 #define _1M_RATE_ 0
78 #define _2M_RATE_ 1
79 #define _5M_RATE_ 2
80 #define _11M_RATE_ 3
81 #define _6M_RATE_ 4
82 #define _9M_RATE_ 5
83 #define _12M_RATE_ 6
84 #define _18M_RATE_ 7
85 #define _24M_RATE_ 8
86 #define _36M_RATE_ 9
87 #define _48M_RATE_ 10
88 #define _54M_RATE_ 11
89
90
91
92
93 #define MCS_RATE_1R (0x000000ff)
94 #define MCS_RATE_2R (0x0000ffff)
95 #define MCS_RATE_3R (0x00ffffff)
96 #define MCS_RATE_4R (0xffffffff)
97 #define MCS_RATE_2R_13TO15_OFF (0x00001fff)
98
99
100 extern unsigned char RTW_WPA_OUI[];
101 extern unsigned char WMM_OUI[];
102 extern unsigned char WPS_OUI[];
103 extern unsigned char WFD_OUI[];
104 extern unsigned char P2P_OUI[];
105
106 extern unsigned char WMM_INFO_OUI[];
107 extern unsigned char WMM_PARA_OUI[];
108
109
110
111
112
113
114
115
116
117
118 typedef enum _RT_CHANNEL_DOMAIN
119 {
120
121 RT_CHANNEL_DOMAIN_FCC = 0x00,
122 RT_CHANNEL_DOMAIN_IC = 0x01,
123 RT_CHANNEL_DOMAIN_ETSI = 0x02,
124 RT_CHANNEL_DOMAIN_SPAIN = 0x03,
125 RT_CHANNEL_DOMAIN_FRANCE = 0x04,
126 RT_CHANNEL_DOMAIN_MKK = 0x05,
127 RT_CHANNEL_DOMAIN_MKK1 = 0x06,
128 RT_CHANNEL_DOMAIN_ISRAEL = 0x07,
129 RT_CHANNEL_DOMAIN_TELEC = 0x08,
130 RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN = 0x09,
131 RT_CHANNEL_DOMAIN_WORLD_WIDE_13 = 0x0A,
132 RT_CHANNEL_DOMAIN_TAIWAN = 0x0B,
133 RT_CHANNEL_DOMAIN_CHINA = 0x0C,
134 RT_CHANNEL_DOMAIN_SINGAPORE_INDIA_MEXICO = 0x0D,
135 RT_CHANNEL_DOMAIN_KOREA = 0x0E,
136 RT_CHANNEL_DOMAIN_TURKEY = 0x0F,
137 RT_CHANNEL_DOMAIN_JAPAN = 0x10,
138 RT_CHANNEL_DOMAIN_FCC_NO_DFS = 0x11,
139 RT_CHANNEL_DOMAIN_JAPAN_NO_DFS = 0x12,
140 RT_CHANNEL_DOMAIN_WORLD_WIDE_5G = 0x13,
141 RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS = 0x14,
142
143
144 RT_CHANNEL_DOMAIN_WORLD_NULL = 0x20,
145 RT_CHANNEL_DOMAIN_ETSI1_NULL = 0x21,
146 RT_CHANNEL_DOMAIN_FCC1_NULL = 0x22,
147 RT_CHANNEL_DOMAIN_MKK1_NULL = 0x23,
148 RT_CHANNEL_DOMAIN_ETSI2_NULL = 0x24,
149 RT_CHANNEL_DOMAIN_FCC1_FCC1 = 0x25,
150 RT_CHANNEL_DOMAIN_WORLD_ETSI1 = 0x26,
151 RT_CHANNEL_DOMAIN_MKK1_MKK1 = 0x27,
152 RT_CHANNEL_DOMAIN_WORLD_KCC1 = 0x28,
153 RT_CHANNEL_DOMAIN_WORLD_FCC2 = 0x29,
154 RT_CHANNEL_DOMAIN_WORLD_FCC3 = 0x30,
155 RT_CHANNEL_DOMAIN_WORLD_FCC4 = 0x31,
156 RT_CHANNEL_DOMAIN_WORLD_FCC5 = 0x32,
157 RT_CHANNEL_DOMAIN_WORLD_FCC6 = 0x33,
158 RT_CHANNEL_DOMAIN_FCC1_FCC7 = 0x34,
159 RT_CHANNEL_DOMAIN_WORLD_ETSI2 = 0x35,
160 RT_CHANNEL_DOMAIN_WORLD_ETSI3 = 0x36,
161 RT_CHANNEL_DOMAIN_MKK1_MKK2 = 0x37,
162 RT_CHANNEL_DOMAIN_MKK1_MKK3 = 0x38,
163 RT_CHANNEL_DOMAIN_FCC1_NCC1 = 0x39,
164 RT_CHANNEL_DOMAIN_FCC1_NCC2 = 0x40,
165 RT_CHANNEL_DOMAIN_GLOBAL_NULL = 0x41,
166 RT_CHANNEL_DOMAIN_ETSI1_ETSI4 = 0x42,
167 RT_CHANNEL_DOMAIN_FCC1_FCC2 = 0x43,
168 RT_CHANNEL_DOMAIN_FCC1_NCC3 = 0x44,
169 RT_CHANNEL_DOMAIN_WORLD_ETSI5 = 0x45,
170 RT_CHANNEL_DOMAIN_FCC1_FCC8 = 0x46,
171 RT_CHANNEL_DOMAIN_WORLD_ETSI6 = 0x47,
172 RT_CHANNEL_DOMAIN_WORLD_ETSI7 = 0x48,
173 RT_CHANNEL_DOMAIN_WORLD_ETSI8 = 0x49,
174 RT_CHANNEL_DOMAIN_WORLD_ETSI9 = 0x50,
175 RT_CHANNEL_DOMAIN_WORLD_ETSI10 = 0x51,
176 RT_CHANNEL_DOMAIN_WORLD_ETSI11 = 0x52,
177 RT_CHANNEL_DOMAIN_FCC1_NCC4 = 0x53,
178 RT_CHANNEL_DOMAIN_WORLD_ETSI12 = 0x54,
179 RT_CHANNEL_DOMAIN_FCC1_FCC9 = 0x55,
180 RT_CHANNEL_DOMAIN_WORLD_ETSI13 = 0x56,
181 RT_CHANNEL_DOMAIN_FCC1_FCC10 = 0x57,
182
183 RT_CHANNEL_DOMAIN_MAX,
184 RT_CHANNEL_DOMAIN_REALTEK_DEFINE = 0x7F,
185 }RT_CHANNEL_DOMAIN, *PRT_CHANNEL_DOMAIN;
186
187 typedef enum _RT_CHANNEL_DOMAIN_2G
188 {
189 RT_CHANNEL_DOMAIN_2G_WORLD = 0x00,
190 RT_CHANNEL_DOMAIN_2G_ETSI1 = 0x01,
191 RT_CHANNEL_DOMAIN_2G_FCC1 = 0x02,
192 RT_CHANNEL_DOMAIN_2G_MKK1 = 0x03,
193 RT_CHANNEL_DOMAIN_2G_ETSI2 = 0x04,
194 RT_CHANNEL_DOMAIN_2G_GLOBAL = 0x05,
195 RT_CHANNEL_DOMAIN_2G_NULL = 0x06,
196
197 RT_CHANNEL_DOMAIN_2G_MAX,
198 }RT_CHANNEL_DOMAIN_2G, *PRT_CHANNEL_DOMAIN_2G;
199
200 typedef enum _RT_CHANNEL_DOMAIN_5G
201 {
202 RT_CHANNEL_DOMAIN_5G_NULL = 0x00,
203 RT_CHANNEL_DOMAIN_5G_ETSI1 = 0x01,
204 RT_CHANNEL_DOMAIN_5G_ETSI2 = 0x02,
205 RT_CHANNEL_DOMAIN_5G_ETSI3 = 0x03,
206 RT_CHANNEL_DOMAIN_5G_FCC1 = 0x04,
207 RT_CHANNEL_DOMAIN_5G_FCC2 = 0x05,
208 RT_CHANNEL_DOMAIN_5G_FCC3 = 0x06,
209 RT_CHANNEL_DOMAIN_5G_FCC4 = 0x07,
210 RT_CHANNEL_DOMAIN_5G_FCC5 = 0x08,
211 RT_CHANNEL_DOMAIN_5G_FCC6 = 0x09,
212 RT_CHANNEL_DOMAIN_5G_FCC7_IC1 = 0x0A,
213 RT_CHANNEL_DOMAIN_5G_KCC1 = 0x0B,
214 RT_CHANNEL_DOMAIN_5G_MKK1 = 0x0C,
215 RT_CHANNEL_DOMAIN_5G_MKK2 = 0x0D,
216 RT_CHANNEL_DOMAIN_5G_MKK3 = 0x0E,
217 RT_CHANNEL_DOMAIN_5G_NCC1 = 0x0F,
218 RT_CHANNEL_DOMAIN_5G_NCC2 = 0x10,
219 RT_CHANNEL_DOMAIN_5G_NCC3 = 0x11,
220 RT_CHANNEL_DOMAIN_5G_ETSI4 = 0x12,
221 RT_CHANNEL_DOMAIN_5G_ETSI5 = 0x13,
222 RT_CHANNEL_DOMAIN_5G_FCC8 = 0x14,
223 RT_CHANNEL_DOMAIN_5G_ETSI6 = 0x15,
224 RT_CHANNEL_DOMAIN_5G_ETSI7 = 0x16,
225 RT_CHANNEL_DOMAIN_5G_ETSI8 = 0x17,
226 RT_CHANNEL_DOMAIN_5G_ETSI9 = 0x18,
227 RT_CHANNEL_DOMAIN_5G_ETSI10 = 0x19,
228 RT_CHANNEL_DOMAIN_5G_ETSI11 = 0x1A,
229 RT_CHANNEL_DOMAIN_5G_NCC4 = 0x1B,
230 RT_CHANNEL_DOMAIN_5G_ETSI12 = 0x1C,
231 RT_CHANNEL_DOMAIN_5G_FCC9 = 0x1D,
232 RT_CHANNEL_DOMAIN_5G_ETSI13 = 0x1E,
233 RT_CHANNEL_DOMAIN_5G_FCC10 = 0x1F,
234
235
236 RT_CHANNEL_DOMAIN_5G_FCC = 0x20,
237 RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS = 0x21,
238 RT_CHANNEL_DOMAIN_5G_FCC4_NO_DFS = 0x22,
239 RT_CHANNEL_DOMAIN_5G_MAX,
240 }RT_CHANNEL_DOMAIN_5G, *PRT_CHANNEL_DOMAIN_5G;
241
242 #define rtw_is_channel_plan_valid(chplan) (chplan<RT_CHANNEL_DOMAIN_MAX || chplan == RT_CHANNEL_DOMAIN_REALTEK_DEFINE)
243
244 typedef struct _RT_CHANNEL_PLAN
245 {
246 unsigned char Channel[MAX_CHANNEL_NUM];
247 unsigned char Len;
248 }RT_CHANNEL_PLAN, *PRT_CHANNEL_PLAN;
249
250 typedef struct _RT_CHANNEL_PLAN_2G
251 {
252 unsigned char Channel[MAX_CHANNEL_NUM_2G];
253 unsigned char Len;
254 }RT_CHANNEL_PLAN_2G, *PRT_CHANNEL_PLAN_2G;
255
256 typedef struct _RT_CHANNEL_PLAN_5G
257 {
258 unsigned char Channel[MAX_CHANNEL_NUM_5G];
259 unsigned char Len;
260 }RT_CHANNEL_PLAN_5G, *PRT_CHANNEL_PLAN_5G;
261
262 typedef struct _RT_CHANNEL_PLAN_MAP
263 {
264 unsigned char Index2G;
265 unsigned char Index5G;
266 }RT_CHANNEL_PLAN_MAP, *PRT_CHANNEL_PLAN_MAP;
267
268 enum Associated_AP
269 {
270 atherosAP = 0,
271 broadcomAP = 1,
272 ciscoAP = 2,
273 marvellAP = 3,
274 ralinkAP = 4,
275 realtekAP = 5,
276 airgocapAP = 6,
277 unknownAP = 7,
278 maxAP,
279 };
280
281 typedef enum _HT_IOT_PEER
282 {
283 HT_IOT_PEER_UNKNOWN = 0,
284 HT_IOT_PEER_REALTEK = 1,
285 HT_IOT_PEER_REALTEK_92SE = 2,
286 HT_IOT_PEER_BROADCOM = 3,
287 HT_IOT_PEER_RALINK = 4,
288 HT_IOT_PEER_ATHEROS = 5,
289 HT_IOT_PEER_CISCO = 6,
290 HT_IOT_PEER_MERU = 7,
291 HT_IOT_PEER_MARVELL = 8,
292 HT_IOT_PEER_REALTEK_SOFTAP = 9,
293 HT_IOT_PEER_SELF_SOFTAP = 10,
294 HT_IOT_PEER_AIRGO = 11,
295 HT_IOT_PEER_INTEL = 12,
296 HT_IOT_PEER_RTK_APCLIENT = 13,
297 HT_IOT_PEER_REALTEK_81XX = 14,
298 HT_IOT_PEER_REALTEK_WOW = 15,
299 HT_IOT_PEER_REALTEK_JAGUAR_BCUTAP = 16,
300 HT_IOT_PEER_REALTEK_JAGUAR_CCUTAP = 17,
301 HT_IOT_PEER_MAX = 18
302 }HT_IOT_PEER_E, *PHTIOT_PEER_E;
303
304
305 enum SCAN_STATE
306 {
307 SCAN_DISABLE = 0,
308 SCAN_START = 1,
309 SCAN_TXNULL = 2,
310 SCAN_PROCESS = 3,
311 SCAN_COMPLETE = 4,
312 SCAN_STATE_MAX,
313 };
314
315 struct mlme_handler {
316 unsigned int num;
317 char* str;
318 unsigned int (*func)(struct adapter *padapter, union recv_frame *precv_frame);
319 };
320
321 struct action_handler {
322 unsigned int num;
323 char* str;
324 unsigned int (*func)(struct adapter *padapter, union recv_frame *precv_frame);
325 };
326
327 struct ss_res
328 {
329 int state;
330 int bss_cnt;
331 int channel_idx;
332 int scan_mode;
333 u8 ssid_num;
334 u8 ch_num;
335 struct ndis_802_11_ssid ssid[RTW_SSID_SCAN_AMOUNT];
336 struct rtw_ieee80211_channel ch[RTW_CHANNEL_SCAN_AMOUNT];
337 };
338
339
340
341
342
343
344 #define WIFI_FW_NULL_STATE _HW_STATE_NOLINK_
345 #define WIFI_FW_STATION_STATE _HW_STATE_STATION_
346 #define WIFI_FW_AP_STATE _HW_STATE_AP_
347 #define WIFI_FW_ADHOC_STATE _HW_STATE_ADHOC_
348
349 #define WIFI_FW_AUTH_NULL 0x00000100
350 #define WIFI_FW_AUTH_STATE 0x00000200
351 #define WIFI_FW_AUTH_SUCCESS 0x00000400
352
353 #define WIFI_FW_ASSOC_STATE 0x00002000
354 #define WIFI_FW_ASSOC_SUCCESS 0x00004000
355
356 #define WIFI_FW_LINKING_STATE (WIFI_FW_AUTH_NULL | WIFI_FW_AUTH_STATE | WIFI_FW_AUTH_SUCCESS |WIFI_FW_ASSOC_STATE)
357
358 struct FW_Sta_Info
359 {
360 struct sta_info *psta;
361 u32 status;
362 u32 rx_pkt;
363 u32 retry;
364 NDIS_802_11_RATES_EX SupportedRates;
365 };
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385 struct mlme_ext_info
386 {
387 u32 state;
388 u32 reauth_count;
389 u32 reassoc_count;
390 u32 link_count;
391 u32 auth_seq;
392 u32 auth_algo;
393 u32 authModeToggle;
394 u32 enc_algo;
395 u32 key_index;
396 u32 iv;
397 u8 chg_txt[128];
398 u16 aid;
399 u16 bcn_interval;
400 u16 capability;
401 u8 assoc_AP_vendor;
402 u8 slotTime;
403 u8 preamble_mode;
404 u8 WMM_enable;
405 u8 ERP_enable;
406 u8 ERP_IE;
407 u8 HT_enable;
408 u8 HT_caps_enable;
409 u8 HT_info_enable;
410 u8 HT_protection;
411 u8 turboMode_cts2self;
412 u8 turboMode_rtsen;
413 u8 SM_PS;
414 u8 agg_enable_bitmap;
415 u8 ADDBA_retry_count;
416 u8 candidate_tid_bitmap;
417 u8 dialogToken;
418
419 bool accept_addba_req;
420 u8 bwmode_updated;
421 u8 hidden_ssid_mode;
422 u8 VHT_enable;
423
424 struct ADDBA_request ADDBA_req;
425 struct WMM_para_element WMM_param;
426 struct HT_caps_element HT_caps;
427 struct HT_info_element HT_info;
428 struct wlan_bssid_ex network;
429 struct FW_Sta_Info FW_sta_info[NUM_STA];
430 };
431
432
433 typedef struct _RT_CHANNEL_INFO
434 {
435 u8 ChannelNum;
436 RT_SCAN_TYPE ScanType;
437 }RT_CHANNEL_INFO, *PRT_CHANNEL_INFO;
438
439 int rtw_ch_set_search_ch(RT_CHANNEL_INFO *ch_set, const u32 ch);
440 bool rtw_mlme_band_check(struct adapter *adapter, const u32 ch);
441
442
443 #define P2P_MAX_REG_CLASSES 10
444
445
446 #define P2P_MAX_REG_CLASS_CHANNELS 20
447
448
449 struct p2p_channels {
450
451 struct p2p_reg_class {
452
453 u8 reg_class;
454
455
456 u8 channel[P2P_MAX_REG_CLASS_CHANNELS];
457
458
459 size_t channels;
460 } reg_class[P2P_MAX_REG_CLASSES];
461
462
463 size_t reg_classes;
464 };
465
466 struct p2p_oper_class_map {
467 enum hw_mode {IEEE80211G, IEEE80211A} mode;
468 u8 op_class;
469 u8 min_chan;
470 u8 max_chan;
471 u8 inc;
472 enum { BW20, BW40PLUS, BW40MINUS } bw;
473 };
474
475 struct mlme_ext_priv
476 {
477 struct adapter *padapter;
478 u8 mlmeext_init;
479 atomic_t event_seq;
480 u16 mgnt_seq;
481 u16 sa_query_seq;
482 u64 mgnt_80211w_IPN;
483 u64 mgnt_80211w_IPN_rx;
484
485
486 unsigned char cur_channel;
487 unsigned char cur_bwmode;
488 unsigned char cur_ch_offset;
489 unsigned char cur_wireless_mode;
490
491 unsigned char max_chan_nums;
492 RT_CHANNEL_INFO channel_set[MAX_CHANNEL_NUM];
493 struct p2p_channels channel_list;
494 unsigned char basicrate[NumRates];
495 unsigned char datarate[NumRates];
496 unsigned char default_supported_mcs_set[16];
497
498 struct ss_res sitesurvey_res;
499 struct mlme_ext_info mlmext_info;
500
501 _timer survey_timer;
502 _timer link_timer;
503 _timer sa_query_timer;
504
505 u16 chan_scan_time;
506 unsigned long last_scan_time;
507 u8 scan_abort;
508 u8 tx_rate;
509
510 u32 retry;
511
512 u64 TSFValue;
513
514
515 u8 adaptive_tsf_done;
516 u32 bcn_delay_cnt[9];
517 u32 bcn_delay_ratio[9];
518 u32 bcn_cnt;
519 u8 DrvBcnEarly;
520 u8 DrvBcnTimeOut;
521
522 unsigned char bstart_bss;
523
524 u8 update_channel_plan_by_ap_done;
525
526
527 u8 action_public_dialog_token;
528 u16 action_public_rxseq;
529
530 u8 active_keep_alive_check;
531 #ifdef DBG_FIXED_CHAN
532 u8 fixed_chan;
533 #endif
534
535 };
536
537 void init_mlme_default_rate_set(struct adapter *padapter);
538 void init_mlme_ext_priv(struct adapter *padapter);
539 int init_hw_mlme_ext(struct adapter *padapter);
540 void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext);
541 extern void init_mlme_ext_timer(struct adapter *padapter);
542 extern void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta);
543 extern struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv);
544
545
546
547 u8 networktype_to_raid_ex(struct adapter *adapter, struct sta_info *psta);
548
549 void get_rate_set(struct adapter *padapter, unsigned char *pbssrate, int *bssrate_len);
550 void set_mcs_rate_by_mask(u8 *mcs_set, u32 mask);
551 void UpdateBrateTbl(struct adapter *padapter, u8 *mBratesOS);
552 void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen);
553
554 void Save_DM_Func_Flag(struct adapter *padapter);
555 void Restore_DM_Func_Flag(struct adapter *padapter);
556 void Switch_DM_Func(struct adapter *padapter, u32 mode, u8 enable);
557
558 void Set_MSR(struct adapter *padapter, u8 type);
559
560 u8 rtw_get_oper_ch(struct adapter *adapter);
561 void rtw_set_oper_ch(struct adapter *adapter, u8 ch);
562 u8 rtw_get_oper_bw(struct adapter *adapter);
563 void rtw_set_oper_bw(struct adapter *adapter, u8 bw);
564 u8 rtw_get_oper_choffset(struct adapter *adapter);
565 void rtw_set_oper_choffset(struct adapter *adapter, u8 offset);
566 u8 rtw_get_center_ch(u8 channel, u8 chnl_bw, u8 chnl_offset);
567 unsigned long rtw_get_on_cur_ch_time(struct adapter *adapter);
568
569 void set_channel_bwmode(struct adapter *padapter, unsigned char channel, unsigned char channel_offset, unsigned short bwmode);
570 void SelectChannel(struct adapter *padapter, unsigned char channel);
571
572 unsigned int decide_wait_for_beacon_timeout(unsigned int bcn_interval);
573
574 void read_cam(struct adapter *padapter , u8 entry, u8 *get_key);
575
576
577 void _write_cam(struct adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key);
578 void _clear_cam_entry(struct adapter *padapter, u8 entry);
579 void write_cam_from_cache(struct adapter *adapter, u8 id);
580
581
582 void write_cam(struct adapter *padapter, u8 id, u16 ctrl, u8 *mac, u8 *key);
583 void clear_cam_entry(struct adapter *padapter, u8 id);
584
585
586 void write_cam_cache(struct adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key);
587 void clear_cam_cache(struct adapter *adapter, u8 id);
588
589 void invalidate_cam_all(struct adapter *padapter);
590
591
592 int allocate_fw_sta_entry(struct adapter *padapter);
593 void flush_all_cam_entry(struct adapter *padapter);
594
595 void site_survey(struct adapter *padapter);
596 u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, struct wlan_bssid_ex *bssid);
597 void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src, struct adapter *padapter, bool update_ie);
598
599 u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork);
600 u16 get_beacon_interval(struct wlan_bssid_ex *bss);
601
602 int is_client_associated_to_ap(struct adapter *padapter);
603 int is_client_associated_to_ibss(struct adapter *padapter);
604 int is_IBSS_empty(struct adapter *padapter);
605
606 unsigned char check_assoc_AP(u8 *pframe, uint len);
607
608 int WMM_param_handler(struct adapter *padapter, struct ndis_80211_var_ie * pIE);
609 void WMMOnAssocRsp(struct adapter *padapter);
610
611 void HT_caps_handler(struct adapter *padapter, struct ndis_80211_var_ie * pIE);
612 void HT_info_handler(struct adapter *padapter, struct ndis_80211_var_ie * pIE);
613 void HTOnAssocRsp(struct adapter *padapter);
614
615 void ERP_IE_handler(struct adapter *padapter, struct ndis_80211_var_ie * pIE);
616 void VCS_update(struct adapter *padapter, struct sta_info *psta);
617 void update_ldpc_stbc_cap(struct sta_info *psta);
618
619 void update_beacon_info(struct adapter *padapter, u8 *pframe, uint len, struct sta_info *psta);
620 int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len);
621 void update_IOT_info(struct adapter *padapter);
622 void update_capinfo(struct adapter * Adapter, u16 updateCap);
623 void update_wireless_mode(struct adapter *padapter);
624 void update_sta_basic_rate(struct sta_info *psta, u8 wireless_mode);
625 int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie, uint var_ie_len, int cam_idx);
626
627
628 void update_sta_info(struct adapter *padapter, struct sta_info *psta);
629 void Update_RA_Entry(struct adapter *padapter, struct sta_info *psta);
630 void set_sta_rate(struct adapter *padapter, struct sta_info *psta);
631
632 unsigned int receive_disconnect(struct adapter *padapter, unsigned char *MacAddr, unsigned short reason);
633
634 unsigned char get_highest_rate_idx(u32 mask);
635 int support_short_GI(struct adapter *padapter, struct HT_caps_element *pHT_caps, u8 bwmode);
636 unsigned int is_ap_in_tkip(struct adapter *padapter);
637
638 s16 rtw_camid_search(struct adapter *adapter, u8 *addr, s16 kid);
639 s16 rtw_camid_alloc(struct adapter *adapter, struct sta_info *sta, u8 kid);
640 void rtw_camid_free(struct adapter *adapter, u8 cam_id);
641
642 extern void rtw_alloc_macid(struct adapter *padapter, struct sta_info *psta);
643 extern void rtw_release_macid(struct adapter *padapter, struct sta_info *psta);
644 extern u8 rtw_search_max_mac_id(struct adapter *padapter);
645
646 void report_join_res(struct adapter *padapter, int res);
647 void report_survey_event(struct adapter *padapter, union recv_frame *precv_frame);
648 void report_surveydone_event(struct adapter *padapter);
649 void report_del_sta_event(struct adapter *padapter, unsigned char* MacAddr, unsigned short reason);
650 void report_add_sta_event(struct adapter *padapter, unsigned char* MacAddr, int cam_idx);
651 void report_wmm_edca_update(struct adapter *padapter);
652
653 u8 chk_bmc_sleepq_cmd(struct adapter *padapter);
654 extern u8 set_tx_beacon_cmd(struct adapter *padapter);
655 unsigned int setup_beacon_frame(struct adapter *padapter, unsigned char *beacon_frame);
656 void update_mgnt_tx_rate(struct adapter *padapter, u8 rate);
657 void update_mgntframe_attrib(struct adapter *padapter, struct pkt_attrib *pattrib);
658 void update_mgntframe_attrib_addr(struct adapter *padapter, struct xmit_frame *pmgntframe);
659 void dump_mgntframe(struct adapter *padapter, struct xmit_frame *pmgntframe);
660 s32 dump_mgntframe_and_wait(struct adapter *padapter, struct xmit_frame *pmgntframe, int timeout_ms);
661 s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmgntframe);
662
663 void issue_beacon(struct adapter *padapter, int timeout_ms);
664 void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p_probereq);
665 void issue_assocreq(struct adapter *padapter);
666 void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_info *pstat, int pkt_type);
667 void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short status);
668 void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da);
669 s32 issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da, u8 ch, bool append_wps, int try_cnt, int wait_ms);
670 int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms);
671 s32 issue_nulldata_in_interrupt(struct adapter *padapter, u8 *da);
672 int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms);
673 int issue_deauth(struct adapter *padapter, unsigned char *da, unsigned short reason);
674 int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, int try_cnt, int wait_ms);
675 void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short status);
676 void issue_action_SA_Query(struct adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short tid);
677 unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr);
678 unsigned int send_beacon(struct adapter *padapter);
679
680 void start_clnt_assoc(struct adapter *padapter);
681 void start_clnt_auth(struct adapter *padapter);
682 void start_clnt_join(struct adapter *padapter);
683 void start_create_ibss(struct adapter *padapter);
684
685 unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame);
686 unsigned int OnAssocRsp(struct adapter *padapter, union recv_frame *precv_frame);
687 unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame);
688 unsigned int OnProbeRsp(struct adapter *padapter, union recv_frame *precv_frame);
689 unsigned int DoReserved(struct adapter *padapter, union recv_frame *precv_frame);
690 unsigned int OnBeacon(struct adapter *padapter, union recv_frame *precv_frame);
691 unsigned int OnAtim(struct adapter *padapter, union recv_frame *precv_frame);
692 unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame);
693 unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame);
694 unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_frame);
695 unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame);
696 unsigned int OnAction(struct adapter *padapter, union recv_frame *precv_frame);
697
698 unsigned int on_action_spct(struct adapter *padapter, union recv_frame *precv_frame);
699 unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_frame);
700 unsigned int on_action_public(struct adapter *padapter, union recv_frame *precv_frame);
701 unsigned int OnAction_ht(struct adapter *padapter, union recv_frame *precv_frame);
702 unsigned int OnAction_sa_query(struct adapter *padapter, union recv_frame *precv_frame);
703
704 void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res);
705 void mlmeext_sta_del_event_callback(struct adapter *padapter);
706 void mlmeext_sta_add_event_callback(struct adapter *padapter, struct sta_info *psta);
707
708 void linked_status_chk(struct adapter *padapter);
709
710 void _linked_info_dump(struct adapter *padapter);
711
712 void survey_timer_hdl (struct timer_list *t);
713 void link_timer_hdl (struct timer_list *t);
714 void addba_timer_hdl(struct timer_list *t);
715 void sa_query_timer_hdl(struct timer_list *t);
716
717
718
719 #define set_survey_timer(mlmeext, ms) \
720 do { \
721 \
722 _set_timer(&(mlmeext)->survey_timer, (ms)); \
723 } while (0)
724
725 #define set_link_timer(mlmeext, ms) \
726 do { \
727 \
728 _set_timer(&(mlmeext)->link_timer, (ms)); \
729 } while (0)
730 #define set_sa_query_timer(mlmeext, ms) \
731 do { \
732 DBG_871X("%s set_sa_query_timer(%p, %d)\n", __func__, (mlmeext), (ms)); \
733 _set_timer(&(mlmeext)->sa_query_timer, (ms)); \
734 } while (0)
735 extern int cckrates_included(unsigned char *rate, int ratelen);
736 extern int cckratesonly_included(unsigned char *rate, int ratelen);
737
738 extern void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr);
739
740 extern void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len);
741 extern void correct_TSF(struct adapter *padapter, struct mlme_ext_priv *pmlmeext);
742 extern void adaptive_early_32k(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len);
743 extern u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer);
744
745 int rtw_chk_start_clnt_join(struct adapter *padapter, u8 *ch, u8 *bw, u8 *offset);
746 int rtw_get_ch_setting_union(struct adapter *adapter, u8 *ch, u8 *bw, u8 *offset);
747
748 struct cmd_hdl {
749 uint parmsize;
750 u8 (*h2cfuns)(struct adapter *padapter, u8 *pbuf);
751 };
752
753
754 u8 read_macreg_hdl(struct adapter *padapter, u8 *pbuf);
755 u8 write_macreg_hdl(struct adapter *padapter, u8 *pbuf);
756 u8 read_bbreg_hdl(struct adapter *padapter, u8 *pbuf);
757 u8 write_bbreg_hdl(struct adapter *padapter, u8 *pbuf);
758 u8 read_rfreg_hdl(struct adapter *padapter, u8 *pbuf);
759 u8 write_rfreg_hdl(struct adapter *padapter, u8 *pbuf);
760
761
762 u8 NULL_hdl(struct adapter *padapter, u8 *pbuf);
763 u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf);
764 u8 disconnect_hdl(struct adapter *padapter, u8 *pbuf);
765 u8 createbss_hdl(struct adapter *padapter, u8 *pbuf);
766 u8 setopmode_hdl(struct adapter *padapter, u8 *pbuf);
767 u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf);
768 u8 setauth_hdl(struct adapter *padapter, u8 *pbuf);
769 u8 setkey_hdl(struct adapter *padapter, u8 *pbuf);
770 u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf);
771 u8 set_assocsta_hdl(struct adapter *padapter, u8 *pbuf);
772 u8 del_assocsta_hdl(struct adapter *padapter, u8 *pbuf);
773 u8 add_ba_hdl(struct adapter *padapter, unsigned char *pbuf);
774
775 u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf);
776 u8 h2c_msg_hdl(struct adapter *padapter, unsigned char *pbuf);
777 u8 chk_bmc_sleepq_hdl(struct adapter *padapter, unsigned char *pbuf);
778 u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf);
779 u8 set_ch_hdl(struct adapter *padapter, u8 *pbuf);
780 u8 set_chplan_hdl(struct adapter *padapter, unsigned char *pbuf);
781 u8 led_blink_hdl(struct adapter *padapter, unsigned char *pbuf);
782 u8 set_csa_hdl(struct adapter *padapter, unsigned char *pbuf);
783 u8 tdls_hdl(struct adapter *padapter, unsigned char *pbuf);
784 u8 run_in_thread_hdl(struct adapter *padapter, u8 *pbuf);
785
786
787 #define GEN_DRV_CMD_HANDLER(size, cmd) {size, &cmd ## _hdl},
788 #define GEN_MLME_EXT_HANDLER(size, cmd) {size, cmd},
789
790 struct C2HEvent_Header
791 {
792
793 #ifdef __LITTLE_ENDIAN
794
795 unsigned int len:16;
796 unsigned int ID:8;
797 unsigned int seq:8;
798 #else
799 unsigned int seq:8;
800 unsigned int ID:8;
801 unsigned int len:16;
802 #endif
803 unsigned int rsvd;
804 };
805
806 void rtw_dummy_event_callback(struct adapter *adapter , u8 *pbuf);
807 void rtw_fwdbg_event_callback(struct adapter *adapter , u8 *pbuf);
808
809 enum rtw_c2h_event
810 {
811 GEN_EVT_CODE(_Read_MACREG) = 0,
812 GEN_EVT_CODE(_Read_BBREG),
813 GEN_EVT_CODE(_Read_RFREG),
814 GEN_EVT_CODE(_Read_EEPROM),
815 GEN_EVT_CODE(_Read_EFUSE),
816 GEN_EVT_CODE(_Read_CAM),
817 GEN_EVT_CODE(_Get_BasicRate),
818 GEN_EVT_CODE(_Get_DataRate),
819 GEN_EVT_CODE(_Survey),
820 GEN_EVT_CODE(_SurveyDone),
821
822 GEN_EVT_CODE(_JoinBss) ,
823 GEN_EVT_CODE(_AddSTA),
824 GEN_EVT_CODE(_DelSTA),
825 GEN_EVT_CODE(_AtimDone) ,
826 GEN_EVT_CODE(_TX_Report),
827 GEN_EVT_CODE(_CCX_Report),
828 GEN_EVT_CODE(_DTM_Report),
829 GEN_EVT_CODE(_TX_Rate_Statistics),
830 GEN_EVT_CODE(_C2HLBK),
831 GEN_EVT_CODE(_FWDBG),
832 GEN_EVT_CODE(_C2HFEEDBACK),
833 GEN_EVT_CODE(_ADDBA),
834 GEN_EVT_CODE(_C2HBCN),
835 GEN_EVT_CODE(_ReportPwrState),
836 GEN_EVT_CODE(_CloseRF),
837 GEN_EVT_CODE(_WMM),
838 MAX_C2HEVT
839 };
840
841
842 #ifdef _RTW_MLME_EXT_C_
843
844 static struct fwevent wlanevents[] =
845 {
846 {0, rtw_dummy_event_callback},
847 {0, NULL},
848 {0, NULL},
849 {0, NULL},
850 {0, NULL},
851 {0, NULL},
852 {0, NULL},
853 {0, NULL},
854 {0, &rtw_survey_event_callback},
855 {sizeof (struct surveydone_event), &rtw_surveydone_event_callback},
856
857 {0, &rtw_joinbss_event_callback},
858 {sizeof(struct stassoc_event), &rtw_stassoc_event_callback},
859 {sizeof(struct stadel_event), &rtw_stadel_event_callback},
860 {0, &rtw_atimdone_event_callback},
861 {0, rtw_dummy_event_callback},
862 {0, NULL},
863 {0, NULL},
864 {0, NULL},
865 {0, NULL},
866 {0, rtw_fwdbg_event_callback},
867 {0, NULL},
868 {0, NULL},
869 {0, NULL},
870 {0, &rtw_cpwm_event_callback},
871 {0, NULL},
872 {0, &rtw_wmm_event_callback},
873
874 };
875
876 #endif
877
878 #endif