1
2
3
4
5
6
7 #ifndef __RTW_MLME_EXT_H_
8 #define __RTW_MLME_EXT_H_
9
10 #include <osdep_service.h>
11 #include <drv_types.h>
12 #include <wlan_bssdef.h>
13
14
15
16
17
18
19
20
21 #define SURVEY_TO (100)
22 #define REAUTH_TO (300)
23 #define REASSOC_TO (300)
24
25 #define ADDBA_TO (2000)
26
27 #define LINKED_TO (1)
28
29 #define REAUTH_LIMIT (4)
30 #define REASSOC_LIMIT (4)
31 #define READDBA_LIMIT (2)
32
33 #define ROAMING_LIMIT 8
34
35 #define DYNAMIC_FUNC_DISABLE (0x0)
36
37
38
39 #define DYNAMIC_BB_DIG BIT(0)
40 #define DYNAMIC_BB_RA_MASK BIT(1)
41 #define DYNAMIC_BB_DYNAMIC_TXPWR BIT(2)
42 #define DYNAMIC_BB_BB_FA_CNT BIT(3)
43
44 #define DYNAMIC_BB_RSSI_MONITOR BIT(4)
45 #define DYNAMIC_BB_CCK_PD BIT(5)
46 #define DYNAMIC_BB_ANT_DIV BIT(6)
47 #define DYNAMIC_BB_PWR_SAVE BIT(7)
48 #define DYNAMIC_BB_PWR_TRA BIT(8)
49 #define DYNAMIC_BB_RATE_ADAPTIVE BIT(9)
50 #define DYNAMIC_BB_PATH_DIV BIT(10)
51 #define DYNAMIC_BB_PSD BIT(11)
52
53
54 #define DYNAMIC_MAC_EDCA_TURBO BIT(16)
55 #define DYNAMIC_MAC_EARLY_MODE BIT(17)
56
57
58 #define DYNAMIC_RF_TX_PWR_TRACK BIT(24)
59 #define DYNAMIC_RF_RX_GAIN_TRACK BIT(25)
60 #define DYNAMIC_RF_CALIBRATION BIT(26)
61
62 #define DYNAMIC_ALL_FUNC_ENABLE 0xFFFFFFF
63
64 #define _HW_STATE_NOLINK_ 0x00
65 #define _HW_STATE_ADHOC_ 0x01
66 #define _HW_STATE_STATION_ 0x02
67 #define _HW_STATE_AP_ 0x03
68
69
70 #define _1M_RATE_ 0
71 #define _2M_RATE_ 1
72 #define _5M_RATE_ 2
73 #define _11M_RATE_ 3
74 #define _6M_RATE_ 4
75 #define _9M_RATE_ 5
76 #define _12M_RATE_ 6
77 #define _18M_RATE_ 7
78 #define _24M_RATE_ 8
79 #define _36M_RATE_ 9
80 #define _48M_RATE_ 10
81 #define _54M_RATE_ 11
82
83 extern const u8 RTW_WPA_OUI[];
84 extern const u8 WPS_OUI[];
85
86
87
88
89
90
91
92
93
94
95 enum RT_CHANNEL_DOMAIN {
96
97 RT_CHANNEL_DOMAIN_FCC = 0x00,
98 RT_CHANNEL_DOMAIN_IC = 0x01,
99 RT_CHANNEL_DOMAIN_ETSI = 0x02,
100 RT_CHANNEL_DOMAIN_SPAIN = 0x03,
101 RT_CHANNEL_DOMAIN_FRANCE = 0x04,
102 RT_CHANNEL_DOMAIN_MKK = 0x05,
103 RT_CHANNEL_DOMAIN_MKK1 = 0x06,
104 RT_CHANNEL_DOMAIN_ISRAEL = 0x07,
105 RT_CHANNEL_DOMAIN_TELEC = 0x08,
106 RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN = 0x09,
107 RT_CHANNEL_DOMAIN_WORLD_WIDE_13 = 0x0A,
108 RT_CHANNEL_DOMAIN_TAIWAN = 0x0B,
109 RT_CHANNEL_DOMAIN_CHINA = 0x0C,
110 RT_CHANNEL_DOMAIN_SINGAPORE_INDIA_MEXICO = 0x0D,
111 RT_CHANNEL_DOMAIN_KOREA = 0x0E,
112 RT_CHANNEL_DOMAIN_TURKEY = 0x0F,
113 RT_CHANNEL_DOMAIN_JAPAN = 0x10,
114 RT_CHANNEL_DOMAIN_FCC_NO_DFS = 0x11,
115 RT_CHANNEL_DOMAIN_JAPAN_NO_DFS = 0x12,
116 RT_CHANNEL_DOMAIN_WORLD_WIDE_5G = 0x13,
117 RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS = 0x14,
118
119
120 RT_CHANNEL_DOMAIN_WORLD_NULL = 0x20,
121 RT_CHANNEL_DOMAIN_ETSI1_NULL = 0x21,
122 RT_CHANNEL_DOMAIN_FCC1_NULL = 0x22,
123 RT_CHANNEL_DOMAIN_MKK1_NULL = 0x23,
124 RT_CHANNEL_DOMAIN_ETSI2_NULL = 0x24,
125 RT_CHANNEL_DOMAIN_FCC1_FCC1 = 0x25,
126 RT_CHANNEL_DOMAIN_WORLD_ETSI1 = 0x26,
127 RT_CHANNEL_DOMAIN_MKK1_MKK1 = 0x27,
128 RT_CHANNEL_DOMAIN_WORLD_KCC1 = 0x28,
129 RT_CHANNEL_DOMAIN_WORLD_FCC2 = 0x29,
130 RT_CHANNEL_DOMAIN_WORLD_FCC3 = 0x30,
131 RT_CHANNEL_DOMAIN_WORLD_FCC4 = 0x31,
132 RT_CHANNEL_DOMAIN_WORLD_FCC5 = 0x32,
133 RT_CHANNEL_DOMAIN_WORLD_FCC6 = 0x33,
134 RT_CHANNEL_DOMAIN_FCC1_FCC7 = 0x34,
135 RT_CHANNEL_DOMAIN_WORLD_ETSI2 = 0x35,
136 RT_CHANNEL_DOMAIN_WORLD_ETSI3 = 0x36,
137 RT_CHANNEL_DOMAIN_MKK1_MKK2 = 0x37,
138 RT_CHANNEL_DOMAIN_MKK1_MKK3 = 0x38,
139 RT_CHANNEL_DOMAIN_FCC1_NCC1 = 0x39,
140 RT_CHANNEL_DOMAIN_FCC1_NCC2 = 0x40,
141 RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G = 0x41,
142
143 RT_CHANNEL_DOMAIN_MAX,
144 RT_CHANNEL_DOMAIN_REALTEK_DEFINE = 0x7F,
145 };
146
147 enum RT_CHANNEL_DOMAIN_2G {
148 RT_CHANNEL_DOMAIN_2G_WORLD = 0x00,
149 RT_CHANNEL_DOMAIN_2G_ETSI1 = 0x01,
150 RT_CHANNEL_DOMAIN_2G_FCC1 = 0x02,
151 RT_CHANNEL_DOMAIN_2G_MKK1 = 0x03,
152 RT_CHANNEL_DOMAIN_2G_ETSI2 = 0x04,
153 RT_CHANNEL_DOMAIN_2G_NULL = 0x05,
154
155 RT_CHANNEL_DOMAIN_2G_MAX,
156 };
157
158 #define rtw_is_channel_plan_valid(chplan) \
159 (chplan < RT_CHANNEL_DOMAIN_MAX || \
160 chplan == RT_CHANNEL_DOMAIN_REALTEK_DEFINE)
161
162 struct rt_channel_plan {
163 unsigned char Channel[MAX_CHANNEL_NUM];
164 unsigned char Len;
165 };
166
167 struct rt_channel_plan_2g {
168 unsigned char Channel[MAX_CHANNEL_NUM_2G];
169 unsigned char Len;
170 };
171
172 struct rt_channel_plan_map {
173 unsigned char Index2G;
174 };
175
176 static const struct {
177 int channel_plan;
178 char *name;
179 } channel_table[] = { { RT_CHANNEL_DOMAIN_FCC, "US" },
180 { RT_CHANNEL_DOMAIN_ETSI, "EU" },
181 { RT_CHANNEL_DOMAIN_MKK, "JP" },
182 { RT_CHANNEL_DOMAIN_CHINA, "CN"} };
183
184 enum Associated_AP {
185 atherosAP = 0,
186 broadcomAP = 1,
187 ciscoAP = 2,
188 marvellAP = 3,
189 ralinkAP = 4,
190 realtekAP = 5,
191 airgocapAP = 6,
192 unknownAP = 7,
193 maxAP,
194 };
195
196 enum HT_IOT_PEER {
197 HT_IOT_PEER_UNKNOWN = 0,
198 HT_IOT_PEER_REALTEK = 1,
199 HT_IOT_PEER_REALTEK_92SE = 2,
200 HT_IOT_PEER_BROADCOM = 3,
201 HT_IOT_PEER_RALINK = 4,
202 HT_IOT_PEER_ATHEROS = 5,
203 HT_IOT_PEER_CISCO = 6,
204 HT_IOT_PEER_MERU = 7,
205 HT_IOT_PEER_MARVELL = 8,
206 HT_IOT_PEER_REALTEK_SOFTAP = 9,
207 HT_IOT_PEER_SELF_SOFTAP = 10,
208 HT_IOT_PEER_AIRGO = 11,
209 HT_IOT_PEER_INTEL = 12,
210 HT_IOT_PEER_RTK_APCLIENT = 13,
211 HT_IOT_PEER_REALTEK_81XX = 14,
212 HT_IOT_PEER_REALTEK_WOW = 15,
213 HT_IOT_PEER_TENDA = 16,
214 HT_IOT_PEER_MAX = 17
215 };
216
217 enum SCAN_STATE {
218 SCAN_DISABLE = 0,
219 SCAN_START = 1,
220 SCAN_TXNULL = 2,
221 SCAN_PROCESS = 3,
222 SCAN_COMPLETE = 4,
223 SCAN_STATE_MAX,
224 };
225
226 struct mlme_handler {
227 unsigned int num;
228 const char *str;
229 unsigned int (*func)(struct adapter *adapt, struct recv_frame *frame);
230 };
231
232 struct action_handler {
233 unsigned int num;
234 const char *str;
235 unsigned int (*func)(struct adapter *adapt, struct recv_frame *frame);
236 };
237
238 struct ss_res {
239 int state;
240 int bss_cnt;
241 int channel_idx;
242 int scan_mode;
243 u8 ssid_num;
244 u8 ch_num;
245 struct ndis_802_11_ssid ssid[RTW_SSID_SCAN_AMOUNT];
246 struct rtw_ieee80211_channel ch[RTW_CHANNEL_SCAN_AMOUNT];
247 };
248
249
250
251
252
253
254 #define WIFI_FW_NULL_STATE _HW_STATE_NOLINK_
255 #define WIFI_FW_STATION_STATE _HW_STATE_STATION_
256 #define WIFI_FW_AP_STATE _HW_STATE_AP_
257 #define WIFI_FW_ADHOC_STATE _HW_STATE_ADHOC_
258
259 #define WIFI_FW_AUTH_NULL 0x00000100
260 #define WIFI_FW_AUTH_STATE 0x00000200
261 #define WIFI_FW_AUTH_SUCCESS 0x00000400
262
263 #define WIFI_FW_ASSOC_STATE 0x00002000
264 #define WIFI_FW_ASSOC_SUCCESS 0x00004000
265
266 #define WIFI_FW_LINKING_STATE (WIFI_FW_AUTH_NULL | \
267 WIFI_FW_AUTH_STATE | \
268 WIFI_FW_AUTH_SUCCESS | \
269 WIFI_FW_ASSOC_STATE)
270
271 struct FW_Sta_Info {
272 struct sta_info *psta;
273 u32 status;
274 u32 rx_pkt;
275 u32 retry;
276 unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
277 };
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299 struct mlme_ext_info {
300 u32 state;
301 u32 reauth_count;
302 u32 reassoc_count;
303 u32 link_count;
304 u32 auth_seq;
305 u32 auth_algo;
306 u32 authModeToggle;
307 u32 enc_algo;
308 u32 key_index;
309
310
311 u32 iv;
312 u8 chg_txt[128];
313 u16 aid;
314 u16 bcn_interval;
315 u16 capability;
316 u8 assoc_AP_vendor;
317 u8 slotTime;
318 u8 preamble_mode;
319 u8 WMM_enable;
320 u8 ERP_enable;
321 u8 ERP_IE;
322 u8 HT_enable;
323 u8 HT_caps_enable;
324 u8 HT_info_enable;
325 u8 HT_protection;
326 u8 turboMode_cts2self;
327 u8 turboMode_rtsen;
328 u8 SM_PS;
329 u8 agg_enable_bitmap;
330 u8 ADDBA_retry_count;
331 u8 candidate_tid_bitmap;
332 u8 dialogToken;
333
334 bool accept_addba_req;
335 u8 bwmode_updated;
336 u8 hidden_ssid_mode;
337
338 struct ADDBA_request ADDBA_req;
339 struct WMM_para_element WMM_param;
340 struct ieee80211_ht_cap HT_caps;
341 struct HT_info_element HT_info;
342 struct wlan_bssid_ex network;
343
344
345
346 struct FW_Sta_Info FW_sta_info[NUM_STA];
347 };
348
349
350
351
352 struct rt_channel_info {
353 u8 ChannelNum;
354 enum rt_scan_type ScanType;
355
356
357 u32 rx_count;
358 };
359
360 int rtw_ch_set_search_ch(struct rt_channel_info *ch_set, const u32 ch);
361
362
363 #define P2P_MAX_REG_CLASSES 10
364
365
366 #define P2P_MAX_REG_CLASS_CHANNELS 20
367
368
369 struct p2p_channels {
370
371 struct p2p_reg_class {
372
373 u8 reg_class;
374
375
376 u8 channel[P2P_MAX_REG_CLASS_CHANNELS];
377
378
379 size_t channels;
380 } reg_class[P2P_MAX_REG_CLASSES];
381
382
383 size_t reg_classes;
384 };
385
386 struct p2p_oper_class_map {
387 enum hw_mode {IEEE80211G} mode;
388 u8 op_class;
389 u8 min_chan;
390 u8 max_chan;
391 u8 inc;
392 enum {BW20, BW40PLUS, BW40MINUS} bw;
393 };
394
395 struct mlme_ext_priv {
396 struct adapter *padapter;
397 u8 mlmeext_init;
398 atomic_t event_seq;
399 u16 mgnt_seq;
400
401 unsigned char cur_channel;
402 unsigned char cur_bwmode;
403 unsigned char cur_ch_offset;
404 unsigned char cur_wireless_mode;
405
406 unsigned char oper_channel;
407
408
409 unsigned char oper_bwmode;
410 unsigned char oper_ch_offset;
411
412 unsigned char max_chan_nums;
413 struct rt_channel_info channel_set[MAX_CHANNEL_NUM];
414 struct p2p_channels channel_list;
415 unsigned char basicrate[NumRates];
416 unsigned char datarate[NumRates];
417
418 struct ss_res sitesurvey_res;
419 struct mlme_ext_info mlmext_info;
420
421
422
423
424 struct timer_list survey_timer;
425 struct timer_list link_timer;
426 u16 chan_scan_time;
427
428 u8 scan_abort;
429 u8 tx_rate;
430
431 u32 retry;
432
433 u64 TSFValue;
434
435 #ifdef CONFIG_88EU_AP_MODE
436 unsigned char bstart_bss;
437 #endif
438 u8 update_channel_plan_by_ap_done;
439
440 u8 action_public_dialog_token;
441 u16 action_public_rxseq;
442 u8 active_keep_alive_check;
443 };
444
445 int init_mlme_ext_priv(struct adapter *adapter);
446 int init_hw_mlme_ext(struct adapter *padapter);
447 void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext);
448 void init_mlme_ext_timer(struct adapter *padapter);
449 void init_addba_retry_timer(struct adapter *adapt, struct sta_info *sta);
450 struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv);
451
452 unsigned char networktype_to_raid(unsigned char network_type);
453 u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int len);
454 void get_rate_set(struct adapter *padapter, unsigned char *pbssrate, int *len);
455 void UpdateBrateTbl(struct adapter *padapter, u8 *mBratesOS);
456 void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen);
457
458 void Save_DM_Func_Flag(struct adapter *padapter);
459 void Restore_DM_Func_Flag(struct adapter *padapter);
460 void Switch_DM_Func(struct adapter *padapter, u32 mode, u8 enable);
461
462 void Set_MSR(struct adapter *padapter, u8 type);
463
464 u8 rtw_get_oper_ch(struct adapter *adapter);
465 void rtw_set_oper_ch(struct adapter *adapter, u8 ch);
466 void rtw_set_oper_bw(struct adapter *adapter, u8 bw);
467 void rtw_set_oper_choffset(struct adapter *adapter, u8 offset);
468
469 void set_channel_bwmode(struct adapter *padapter, unsigned char channel,
470 unsigned char channel_offset, unsigned short bwmode);
471 void SelectChannel(struct adapter *padapter, unsigned char channel);
472 void SetBWMode(struct adapter *padapter, unsigned short bwmode,
473 unsigned char channel_offset);
474
475 unsigned int decide_wait_for_beacon_timeout(unsigned int bcn_interval);
476
477 void write_cam(struct adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key);
478 void clear_cam_entry(struct adapter *padapter, u8 entry);
479
480 void invalidate_cam_all(struct adapter *padapter);
481
482 int allocate_fw_sta_entry(struct adapter *padapter);
483 void flush_all_cam_entry(struct adapter *padapter);
484
485 void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
486 struct adapter *adapter, bool update_ie);
487
488 u16 get_beacon_interval(struct wlan_bssid_ex *bss);
489
490 int is_client_associated_to_ap(struct adapter *padapter);
491 int is_client_associated_to_ibss(struct adapter *padapter);
492 int is_IBSS_empty(struct adapter *padapter);
493
494 unsigned char check_assoc_AP(u8 *pframe, uint len);
495
496 int WMM_param_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE);
497 void WMMOnAssocRsp(struct adapter *padapter);
498
499 void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE);
500 void HT_info_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE);
501 void HTOnAssocRsp(struct adapter *padapter);
502
503 void ERP_IE_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE);
504 void VCS_update(struct adapter *padapter, struct sta_info *psta);
505
506 void update_beacon_info(struct adapter *padapter, u8 *pframe, uint len,
507 struct sta_info *psta);
508 int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len);
509 void update_IOT_info(struct adapter *padapter);
510 void update_capinfo(struct adapter *adapter, u16 updatecap);
511 void update_wireless_mode(struct adapter *padapter);
512 void update_tx_basic_rate(struct adapter *padapter, u8 modulation);
513 void update_bmc_sta_support_rate(struct adapter *padapter, u32 mac_id);
514 int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie,
515 uint var_ie_len, int cam_idx);
516
517
518 void update_sta_info(struct adapter *padapter, struct sta_info *psta);
519 unsigned int update_basic_rate(unsigned char *ptn, unsigned int ptn_sz);
520 unsigned int update_supported_rate(unsigned char *ptn, unsigned int ptn_sz);
521 unsigned int update_MSC_rate(struct ieee80211_ht_cap *pHT_caps);
522 void Update_RA_Entry(struct adapter *padapter, u32 mac_id);
523 void set_sta_rate(struct adapter *padapter, struct sta_info *psta);
524
525 unsigned char get_highest_rate_idx(u32 mask);
526 int support_short_GI(struct adapter *padapter, struct ieee80211_ht_cap *caps);
527 unsigned int is_ap_in_tkip(struct adapter *padapter);
528
529 void report_join_res(struct adapter *padapter, int res);
530 void report_survey_event(struct adapter *padapter,
531 struct recv_frame *precv_frame);
532 void report_surveydone_event(struct adapter *padapter);
533 void report_del_sta_event(struct adapter *padapter,
534 unsigned char *addr, unsigned short reason);
535 void report_add_sta_event(struct adapter *padapter, unsigned char *addr,
536 int cam_idx);
537
538 u8 set_tx_beacon_cmd(struct adapter *padapter);
539 unsigned int setup_beacon_frame(struct adapter *padapter,
540 unsigned char *beacon_frame);
541 void update_mgnt_tx_rate(struct adapter *padapter, u8 rate);
542 void update_mgntframe_attrib(struct adapter *padapter,
543 struct pkt_attrib *pattrib);
544
545 int issue_nulldata(struct adapter *padapter, unsigned char *da,
546 unsigned int power_mode, int try_cnt, int wait_ms);
547 int issue_qos_nulldata(struct adapter *padapter, unsigned char *da,
548 u16 tid, int try_cnt, int wait_ms);
549 int issue_deauth(struct adapter *padapter, unsigned char *da,
550 unsigned short reason);
551 unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr);
552 unsigned int send_beacon(struct adapter *padapter);
553
554 void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res);
555 void mlmeext_sta_del_event_callback(struct adapter *padapter);
556 void mlmeext_sta_add_event_callback(struct adapter *padapter,
557 struct sta_info *psta);
558
559 void linked_status_chk(struct adapter *padapter);
560
561 void survey_timer_hdl(struct timer_list *t);
562 void link_timer_hdl(struct timer_list *t);
563 void addba_timer_hdl(struct timer_list *t);
564
565 #define set_survey_timer(mlmeext, ms) \
566 mod_timer(&mlmeext->survey_timer, jiffies + \
567 msecs_to_jiffies(ms))
568
569 #define set_link_timer(mlmeext, ms) \
570 mod_timer(&mlmeext->link_timer, jiffies + \
571 msecs_to_jiffies(ms))
572
573 bool cckrates_included(unsigned char *rate, int ratelen);
574 bool cckratesonly_included(unsigned char *rate, int ratelen);
575
576 void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr);
577
578 void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len);
579 void correct_TSF(struct adapter *padapter, struct mlme_ext_priv *pmlmeext);
580
581 struct cmd_hdl {
582 uint parmsize;
583 u8 (*h2cfuns)(struct adapter *padapter, u8 *pbuf);
584 };
585
586 u8 read_macreg_hdl(struct adapter *padapter, u8 *pbuf);
587 u8 write_macreg_hdl(struct adapter *padapter, u8 *pbuf);
588 u8 read_bbreg_hdl(struct adapter *padapter, u8 *pbuf);
589 u8 write_bbreg_hdl(struct adapter *padapter, u8 *pbuf);
590 u8 read_rfreg_hdl(struct adapter *padapter, u8 *pbuf);
591 u8 write_rfreg_hdl(struct adapter *padapter, u8 *pbuf);
592 u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf);
593 u8 disconnect_hdl(struct adapter *padapter, u8 *pbuf);
594 u8 createbss_hdl(struct adapter *padapter, u8 *pbuf);
595 u8 setopmode_hdl(struct adapter *padapter, u8 *pbuf);
596 u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf);
597 u8 setauth_hdl(struct adapter *padapter, u8 *pbuf);
598 u8 setkey_hdl(struct adapter *padapter, u8 *pbuf);
599 u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf);
600 u8 set_assocsta_hdl(struct adapter *padapter, u8 *pbuf);
601 u8 del_assocsta_hdl(struct adapter *padapter, u8 *pbuf);
602 u8 add_ba_hdl(struct adapter *padapter, unsigned char *pbuf);
603
604 u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf);
605 u8 h2c_msg_hdl(struct adapter *padapter, unsigned char *pbuf);
606 u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf);
607 u8 set_ch_hdl(struct adapter *padapter, u8 *pbuf);
608 u8 set_chplan_hdl(struct adapter *padapter, unsigned char *pbuf);
609 u8 led_blink_hdl(struct adapter *padapter, unsigned char *pbuf);
610
611 u8 set_csa_hdl(struct adapter *padapter, unsigned char *pbuf);
612 u8 tdls_hdl(struct adapter *padapter, unsigned char *pbuf);
613
614 #ifdef _RTW_CMD_C_
615
616 static struct cmd_hdl wlancmds[] = {
617 {sizeof(struct wlan_bssid_ex), join_cmd_hdl},
618 {sizeof(struct disconnect_parm), disconnect_hdl},
619 {sizeof(struct wlan_bssid_ex), createbss_hdl},
620 {sizeof(struct setopmode_parm), setopmode_hdl},
621 {sizeof(struct sitesurvey_parm), sitesurvey_cmd_hdl},
622 {sizeof(struct setauth_parm), setauth_hdl},
623 {sizeof(struct setkey_parm), setkey_hdl},
624 {sizeof(struct set_stakey_parm), set_stakey_hdl},
625 {sizeof(struct set_assocsta_parm), NULL},
626 {sizeof(struct addBaReq_parm), add_ba_hdl},
627 {sizeof(struct set_ch_parm), set_ch_hdl},
628 {sizeof(struct wlan_bssid_ex), tx_beacon_hdl},
629 {0, mlme_evt_hdl},
630 {0, rtw_drvextra_cmd_hdl},
631 {sizeof(struct SetChannelPlan_param), set_chplan_hdl}
632 };
633
634 #endif
635
636 struct C2HEvent_Header {
637 #ifdef __LITTLE_ENDIAN
638 unsigned int len:16;
639 unsigned int ID:8;
640 unsigned int seq:8;
641 #elif defined(__BIG_ENDIAN)
642 unsigned int seq:8;
643 unsigned int ID:8;
644 unsigned int len:16;
645 #endif
646 unsigned int rsvd;
647 };
648
649 void rtw_dummy_event_callback(struct adapter *adapter, u8 *pbuf);
650 void rtw_fwdbg_event_callback(struct adapter *adapter, u8 *pbuf);
651
652 enum rtw_c2h_event {
653 _Read_MACREG_EVT_ = 0,
654 _Read_BBREG_EVT_,
655 _Read_RFREG_EVT_,
656 _Read_EEPROM_EVT_,
657 _Read_EFUSE_EVT_,
658 _Read_CAM_EVT_,
659 _Get_BasicRate_EVT_,
660 _Get_DataRate_EVT_,
661 _Survey_EVT_,
662 _SurveyDone_EVT_,
663
664 _JoinBss_EVT_,
665 _AddSTA_EVT_,
666 _DelSTA_EVT_,
667 _AtimDone_EVT_,
668 _TX_Report_EVT_,
669 _CCX_Report_EVT_,
670 _DTM_Report_EVT_,
671 _TX_Rate_Statistics_EVT_,
672 _C2HLBK_EVT_,
673 _FWDBG_EVT_,
674 _C2HFEEDBACK_EVT_,
675 _ADDBA_EVT_,
676 _C2HBCN_EVT_,
677 _ReportPwrState_EVT_,
678 _CloseRF_EVT_,
679
680
681 MAX_C2HEVT
682 };
683
684
685 #ifdef _RTW_MLME_EXT_C_
686
687 static struct fwevent wlanevents[] = {
688 {0, rtw_dummy_event_callback},
689 {0, NULL},
690 {0, NULL},
691 {0, NULL},
692 {0, NULL},
693 {0, NULL},
694 {0, NULL},
695 {0, NULL},
696 {0, &rtw_survey_event_callback},
697 {sizeof(struct surveydone_event), &rtw_surveydone_event_callback},
698 {0, &rtw_joinbss_event_callback},
699 {sizeof(struct stassoc_event), &rtw_stassoc_event_callback},
700 {sizeof(struct stadel_event), &rtw_stadel_event_callback},
701 {0, &rtw_atimdone_event_callback},
702 {0, rtw_dummy_event_callback},
703 {0, NULL},
704 {0, NULL},
705 {0, NULL},
706 {0, NULL},
707 {0, rtw_fwdbg_event_callback},
708 {0, NULL},
709 {0, NULL},
710 {0, NULL},
711 {0, &rtw_cpwm_event_callback},
712 {0, NULL},
713 };
714
715 #endif
716
717 #endif