net: wireless: rockchip: add rtl8822be pcie wifi driver
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8822be / include / rtw_cmd.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  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  *
19  ******************************************************************************/
20 #ifndef __RTW_CMD_H_
21 #define __RTW_CMD_H_
22
23
24 #define C2H_MEM_SZ (16*1024)
25
26 #ifndef CONFIG_RTL8711FW
27
28 #define FREE_CMDOBJ_SZ  128
29
30 #define MAX_CMDSZ       1024
31 #define MAX_RSPSZ       512
32 #define MAX_EVTSZ       1024
33
34 #ifdef PLATFORM_OS_CE
35         #define CMDBUFF_ALIGN_SZ 4
36 #else
37         #define CMDBUFF_ALIGN_SZ 512
38 #endif
39
40 struct cmd_obj {
41         _adapter *padapter;
42         u16     cmdcode;
43         u8      res;
44         u8      *parmbuf;
45         u32     cmdsz;
46         u8      *rsp;
47         u32     rspsz;
48         struct submit_ctx *sctx;
49         u8 no_io;
50         /* _sema        cmd_sem; */
51         _list   list;
52 };
53
54 /* cmd flags */
55 enum {
56         RTW_CMDF_DIRECTLY = BIT0,
57         RTW_CMDF_WAIT_ACK = BIT1,
58 };
59
60 struct cmd_priv {
61         _sema   cmd_queue_sema;
62         /* _sema        cmd_done_sema; */
63         _sema   terminate_cmdthread_sema;
64         _queue  cmd_queue;
65         u8      cmd_seq;
66         u8      *cmd_buf;       /* shall be non-paged, and 4 bytes aligned */
67         u8      *cmd_allocated_buf;
68         u8      *rsp_buf;       /* shall be non-paged, and 4 bytes aligned               */
69         u8      *rsp_allocated_buf;
70         u32     cmd_issued_cnt;
71         u32     cmd_done_cnt;
72         u32     rsp_cnt;
73         ATOMIC_T cmdthd_running;
74         /* u8 cmdthd_running; */
75         u8 stop_req;
76         _adapter *padapter;
77         _mutex sctx_mutex;
78 };
79
80 #ifdef CONFIG_EVENT_THREAD_MODE
81 struct evt_obj {
82         u16     evtcode;
83         u8      res;
84         u8      *parmbuf;
85         u32     evtsz;
86         _list   list;
87 };
88 #endif
89
90 struct  evt_priv {
91 #ifdef CONFIG_EVENT_THREAD_MODE
92         _sema   evt_notify;
93         _sema   terminate_evtthread_sema;
94         _queue  evt_queue;
95 #endif
96
97 #define CONFIG_C2H_WK
98 #ifdef CONFIG_C2H_WK
99         _workitem c2h_wk;
100         bool c2h_wk_alive;
101         struct rtw_cbuf *c2h_queue;
102 #define C2H_QUEUE_MAX_LEN 10
103 #endif
104
105 #ifdef CONFIG_H2CLBK
106         _sema   lbkevt_done;
107         u8      lbkevt_limit;
108         u8      lbkevt_num;
109         u8      *cmdevt_parm;
110 #endif
111         ATOMIC_T event_seq;
112         u8      *evt_buf;       /* shall be non-paged, and 4 bytes aligned               */
113         u8      *evt_allocated_buf;
114         u32     evt_done_cnt;
115 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
116         u8      *c2h_mem;
117         u8      *allocated_c2h_mem;
118 #ifdef PLATFORM_OS_XP
119         PMDL    pc2h_mdl;
120 #endif
121 #endif
122
123 };
124
125 #define init_h2fwcmd_w_parm_no_rsp(pcmd, pparm, code) \
126         do {\
127                 _rtw_init_listhead(&pcmd->list);\
128                 pcmd->cmdcode = code;\
129                 pcmd->parmbuf = (u8 *)(pparm);\
130                 pcmd->cmdsz = sizeof (*pparm);\
131                 pcmd->rsp = NULL;\
132                 pcmd->rspsz = 0;\
133         } while (0)
134
135 #define init_h2fwcmd_w_parm_no_parm_rsp(pcmd, code) \
136         do {\
137                 _rtw_init_listhead(&pcmd->list);\
138                 pcmd->cmdcode = code;\
139                 pcmd->parmbuf = NULL;\
140                 pcmd->cmdsz = 0;\
141                 pcmd->rsp = NULL;\
142                 pcmd->rspsz = 0;\
143         } while (0)
144
145 struct c2h_evt_hdr {
146         u8 id:4;
147         u8 plen:4;
148         u8 seq;
149         u8 payload[0];
150 };
151
152 struct c2h_evt_hdr_88xx {
153         u8 id;
154         u8 seq;
155         u8 payload[12];
156         u8 plen;
157         u8 trigger;
158 };
159
160 #define c2h_evt_valid(c2h_evt) ((c2h_evt)->id || (c2h_evt)->plen)
161
162 struct P2P_PS_Offload_t {
163         u8 Offload_En:1;
164         u8 role:1; /* 1: Owner, 0: Client */
165         u8 CTWindow_En:1;
166         u8 NoA0_En:1;
167         u8 NoA1_En:1;
168         u8 AllStaSleep:1; /* Only valid in Owner */
169         u8 discovery:1;
170         u8 rsvd:1;
171 };
172
173 struct P2P_PS_CTWPeriod_t {
174         u8 CTWPeriod;   /* TU */
175 };
176
177 #ifdef CONFIG_P2P_WOWLAN
178
179 struct P2P_WoWlan_Offload_t {
180         u8 Disconnect_Wkup_Drv:1;
181         u8 role:2;
182         u8 Wps_Config[2];
183 };
184
185 #endif /* CONFIG_P2P_WOWLAN */
186
187 extern u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj);
188 extern struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv);
189 extern void rtw_free_cmd_obj(struct cmd_obj *pcmd);
190
191 #ifdef CONFIG_EVENT_THREAD_MODE
192         extern u32 rtw_enqueue_evt(struct evt_priv *pevtpriv, struct evt_obj *obj);
193         extern struct evt_obj *rtw_dequeue_evt(_queue *queue);
194         extern void rtw_free_evt_obj(struct evt_obj *pcmd);
195 #endif
196
197 void rtw_stop_cmd_thread(_adapter *adapter);
198 thread_return rtw_cmd_thread(thread_context context);
199
200 extern u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv);
201 extern void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv);
202
203 extern u32 rtw_init_evt_priv(struct evt_priv *pevtpriv);
204 extern void rtw_free_evt_priv(struct evt_priv *pevtpriv);
205 extern void rtw_cmd_clr_isr(struct cmd_priv *pcmdpriv);
206 extern void rtw_evt_notify_isr(struct evt_priv *pevtpriv);
207 #ifdef CONFIG_P2P
208         u8 p2p_protocol_wk_cmd(_adapter *padapter, int intCmdType);
209 #endif /* CONFIG_P2P */
210
211 #else
212 /* #include <ieee80211.h> */
213 #endif  /* CONFIG_RTL8711FW */
214
215 enum rtw_drvextra_cmd_id {
216         NONE_WK_CID,
217         STA_MSTATUS_RPT_WK_CID,
218         DYNAMIC_CHK_WK_CID,
219         DM_CTRL_WK_CID,
220         PBC_POLLING_WK_CID,
221         POWER_SAVING_CTRL_WK_CID,/* IPS,AUTOSuspend */
222         LPS_CTRL_WK_CID,
223         ANT_SELECT_WK_CID,
224         P2P_PS_WK_CID,
225         P2P_PROTO_WK_CID,
226         CHECK_HIQ_WK_CID,/* for softap mode, check hi queue if empty */
227         INTEl_WIDI_WK_CID,
228         C2H_WK_CID,
229         RTP_TIMER_CFG_WK_CID,
230         RESET_SECURITYPRIV, /* add for CONFIG_IEEE80211W, none 11w also can use */
231         FREE_ASSOC_RESOURCES, /* add for CONFIG_IEEE80211W, none 11w also can use */
232         DM_IN_LPS_WK_CID,
233         DM_RA_MSK_WK_CID, /* add for STA update RAMask when bandwith change. */
234         BEAMFORMING_WK_CID,
235         LPS_CHANGE_DTIM_CID,
236         BTINFO_WK_CID,
237         DFS_MASTER_WK_CID,
238         SESSION_TRACKER_WK_CID,
239         EN_HW_UPDATE_TSF_WK_CID,
240         TEST_H2C_CID,
241         MAX_WK_CID
242 };
243
244 enum LPS_CTRL_TYPE {
245         LPS_CTRL_SCAN = 0,
246         LPS_CTRL_JOINBSS = 1,
247         LPS_CTRL_CONNECT = 2,
248         LPS_CTRL_DISCONNECT = 3,
249         LPS_CTRL_SPECIAL_PACKET = 4,
250         LPS_CTRL_LEAVE = 5,
251         LPS_CTRL_TRAFFIC_BUSY = 6,
252         LPS_CTRL_TX_TRAFFIC_LEAVE = 7,
253         LPS_CTRL_RX_TRAFFIC_LEAVE = 8,
254         LPS_CTRL_ENTER = 9,
255         LPS_CTRL_LEAVE_CFG80211_PWRMGMT = 10,
256 };
257
258 enum STAKEY_TYPE {
259         GROUP_KEY               = 0,
260         UNICAST_KEY             = 1,
261         TDLS_KEY                = 2,
262 };
263
264 enum RFINTFS {
265         SWSI,
266         HWSI,
267         HWPI,
268 };
269
270 /*
271 Caller Mode: Infra, Ad-HoC(C)
272
273 Notes: To enter USB suspend mode
274
275 Command Mode
276
277 */
278 struct usb_suspend_parm {
279         u32 action;/* 1: sleep, 0:resume */
280 };
281
282 /*
283 Caller Mode: Infra, Ad-HoC
284
285 Notes: To join a known BSS.
286
287 Command-Event Mode
288
289 */
290
291 /*
292 Caller Mode: Infra, Ad-Hoc
293
294 Notes: To join the specified bss
295
296 Command Event Mode
297
298 */
299 struct joinbss_parm {
300         WLAN_BSSID_EX network;
301 };
302
303 /*
304 Caller Mode: Infra, Ad-HoC(C)
305
306 Notes: To disconnect the current associated BSS
307
308 Command Mode
309
310 */
311 struct disconnect_parm {
312         u32 deauth_timeout_ms;
313 };
314
315 /*
316 Caller Mode: AP, Ad-HoC(M)
317
318 Notes: To create a BSS
319
320 Command Mode
321 */
322 struct createbss_parm {
323         bool adhoc;
324
325         /* used by AP mode now */
326         s16 req_ch;
327         s8 req_bw;
328         s8 req_offset;
329 };
330
331 #if 0
332         /* Caller Mode: AP, Ad-HoC, Infra */
333
334         /* Notes: To set the NIC mode of RTL8711 */
335
336         /* Command Mode */
337
338         /* The definition of mode: */
339
340         #define IW_MODE_AUTO    0       /*  Let the driver decides which AP to join */
341         #define IW_MODE_ADHOC   1       /*  Single cell network (Ad-Hoc Clients) */
342         #define IW_MODE_INFRA   2       /*  Multi cell network, roaming, .. */
343         #define IW_MODE_MASTER  3       /*  Synchronisation master or Access Point */
344         #define IW_MODE_REPEAT  4       /*  Wireless Repeater (forwarder) */
345         #define IW_MODE_SECOND  5       /*  Secondary master/repeater (backup) */
346         #define IW_MODE_MONITOR 6       /*  Passive monitor (listen only) */
347
348 #endif
349 struct  setopmode_parm {
350         u8      mode;
351         u8      rsvd[3];
352 };
353
354 /*
355 Caller Mode: AP, Ad-HoC, Infra
356
357 Notes: To ask RTL8711 performing site-survey
358
359 Command-Event Mode
360
361 */
362
363 #define RTW_SSID_SCAN_AMOUNT 9 /* for WEXT_CSCAN_AMOUNT 9 */
364 #define RTW_CHANNEL_SCAN_AMOUNT (14+37)
365 struct sitesurvey_parm {
366         sint scan_mode; /* active: 1, passive: 0 */
367         /* sint bsslimit;       // 1 ~ 48 */
368         u8 ssid_num;
369         u8 ch_num;
370         NDIS_802_11_SSID ssid[RTW_SSID_SCAN_AMOUNT];
371         struct rtw_ieee80211_channel ch[RTW_CHANNEL_SCAN_AMOUNT];
372 };
373
374 /*
375 Caller Mode: Any
376
377 Notes: To set the auth type of RTL8711. open/shared/802.1x
378
379 Command Mode
380
381 */
382 struct setauth_parm {
383         u8 mode;  /* 0: legacy open, 1: legacy shared 2: 802.1x */
384         u8 _1x;   /* 0: PSK, 1: TLS */
385         u8 rsvd[2];
386 };
387
388 /*
389 Caller Mode: Infra
390
391 a. algorithm: wep40, wep104, tkip & aes
392 b. keytype: grp key/unicast key
393 c. key contents
394
395 when shared key ==> keyid is the camid
396 when 802.1x ==> keyid [0:1] ==> grp key
397 when 802.1x ==> keyid > 2 ==> unicast key
398
399 */
400 struct setkey_parm {
401         u8      algorithm;      /* encryption algorithm, could be none, wep40, TKIP, CCMP, wep104 */
402         u8      keyid;
403         u8      grpkey;         /* 1: this is the grpkey for 802.1x. 0: this is the unicast key for 802.1x */
404         u8      set_tx;         /* 1: main tx key for wep. 0: other key. */
405         u8      key[16];        /* this could be 40 or 104 */
406 };
407
408 /*
409 When in AP or Ad-Hoc mode, this is used to
410 allocate an sw/hw entry for a newly associated sta.
411
412 Command
413
414 when shared key ==> algorithm/keyid
415
416 */
417 struct set_stakey_parm {
418         u8      addr[ETH_ALEN];
419         u8      algorithm;
420         u8      keyid;
421         u8      key[16];
422 };
423
424 struct set_stakey_rsp {
425         u8      addr[ETH_ALEN];
426         u8      keyid;
427         u8      rsvd;
428 };
429
430 /*
431 Caller Ad-Hoc/AP
432
433 Command -Rsp(AID == CAMID) mode
434
435 This is to force fw to add an sta_data entry per driver's request.
436
437 FW will write an cam entry associated with it.
438
439 */
440 struct set_assocsta_parm {
441         u8      addr[ETH_ALEN];
442 };
443
444 struct set_assocsta_rsp {
445         u8      cam_id;
446         u8      rsvd[3];
447 };
448
449 /*
450         Caller Ad-Hoc/AP
451
452         Command mode
453
454         This is to force fw to del an sta_data entry per driver's request
455
456         FW will invalidate the cam entry associated with it.
457
458 */
459 struct del_assocsta_parm {
460         u8      addr[ETH_ALEN];
461 };
462
463 /*
464 Caller Mode: AP/Ad-HoC(M)
465
466 Notes: To notify fw that given staid has changed its power state
467
468 Command Mode
469
470 */
471 struct setstapwrstate_parm {
472         u8      staid;
473         u8      status;
474         u8      hwaddr[6];
475 };
476
477 /*
478 Caller Mode: Any
479
480 Notes: To setup the basic rate of RTL8711
481
482 Command Mode
483
484 */
485 struct  setbasicrate_parm {
486         u8      basicrates[NumRates];
487 };
488
489 /*
490 Caller Mode: Any
491
492 Notes: To read the current basic rate
493
494 Command-Rsp Mode
495
496 */
497 struct getbasicrate_parm {
498         u32 rsvd;
499 };
500
501 struct getbasicrate_rsp {
502         u8 basicrates[NumRates];
503 };
504
505 /*
506 Caller Mode: Any
507
508 Notes: To setup the data rate of RTL8711
509
510 Command Mode
511
512 */
513 struct setdatarate_parm {
514 #ifdef MP_FIRMWARE_OFFLOAD
515         u32     curr_rateidx;
516 #else
517         u8      mac_id;
518         u8      datarates[NumRates];
519 #endif
520 };
521
522 /*
523 Caller Mode: Any
524
525 Notes: To read the current data rate
526
527 Command-Rsp Mode
528
529 */
530 struct getdatarate_parm {
531         u32 rsvd;
532
533 };
534 struct getdatarate_rsp {
535         u8 datarates[NumRates];
536 };
537
538
539 /*
540 Caller Mode: Any
541 AP: AP can use the info for the contents of beacon frame
542 Infra: STA can use the info when sitesurveying
543 Ad-HoC(M): Like AP
544 Ad-HoC(C): Like STA
545
546
547 Notes: To set the phy capability of the NIC
548
549 Command Mode
550
551 */
552
553 struct  setphyinfo_parm {
554         struct regulatory_class class_sets[NUM_REGULATORYS];
555         u8      status;
556 };
557
558 struct  getphyinfo_parm {
559         u32 rsvd;
560 };
561
562 struct  getphyinfo_rsp {
563         struct regulatory_class class_sets[NUM_REGULATORYS];
564         u8      status;
565 };
566
567 /*
568 Caller Mode: Any
569
570 Notes: To set the channel/modem/band
571 This command will be used when channel/modem/band is changed.
572
573 Command Mode
574
575 */
576 struct  setphy_parm {
577         u8      rfchannel;
578         u8      modem;
579 };
580
581 /*
582 Caller Mode: Any
583
584 Notes: To get the current setting of channel/modem/band
585
586 Command-Rsp Mode
587
588 */
589 struct  getphy_parm {
590         u32 rsvd;
591
592 };
593 struct  getphy_rsp {
594         u8      rfchannel;
595         u8      modem;
596 };
597
598 struct readBB_parm {
599         u8      offset;
600 };
601 struct readBB_rsp {
602         u8      value;
603 };
604
605 struct readTSSI_parm {
606         u8      offset;
607 };
608 struct readTSSI_rsp {
609         u8      value;
610 };
611
612 struct readMAC_parm {
613         u8 len;
614         u32     addr;
615 };
616
617 struct writeBB_parm {
618         u8      offset;
619         u8      value;
620 };
621
622 struct readRF_parm {
623         u8      offset;
624 };
625 struct readRF_rsp {
626         u32     value;
627 };
628
629 struct writeRF_parm {
630         u32     offset;
631         u32     value;
632 };
633
634 struct getrfintfs_parm {
635         u8      rfintfs;
636 };
637
638
639 struct Tx_Beacon_param {
640         WLAN_BSSID_EX network;
641 };
642
643 /*
644         Notes: This command is used for H2C/C2H loopback testing
645
646         mac[0] == 0
647         ==> CMD mode, return H2C_SUCCESS.
648         The following condition must be ture under CMD mode
649                 mac[1] == mac[4], mac[2] == mac[3], mac[0]=mac[5]= 0;
650                 s0 == 0x1234, s1 == 0xabcd, w0 == 0x78563412, w1 == 0x5aa5def7;
651                 s2 == (b1 << 8 | b0);
652
653         mac[0] == 1
654         ==> CMD_RSP mode, return H2C_SUCCESS_RSP
655
656         The rsp layout shall be:
657         rsp:                    parm:
658                 mac[0]  =   mac[5];
659                 mac[1]  =   mac[4];
660                 mac[2]  =   mac[3];
661                 mac[3]  =   mac[2];
662                 mac[4]  =   mac[1];
663                 mac[5]  =   mac[0];
664                 s0              =   s1;
665                 s1              =   swap16(s0);
666                 w0              =       swap32(w1);
667                 b0              =       b1
668                 s2              =       s0 + s1
669                 b1              =       b0
670                 w1              =       w0
671
672         mac[0] ==       2
673         ==> CMD_EVENT mode, return      H2C_SUCCESS
674         The event layout shall be:
675         event:                  parm:
676                 mac[0]  =   mac[5];
677                 mac[1]  =   mac[4];
678                 mac[2]  =   event's sequence number, starting from 1 to parm's marc[3]
679                 mac[3]  =   mac[2];
680                 mac[4]  =   mac[1];
681                 mac[5]  =   mac[0];
682                 s0              =   swap16(s0) - event.mac[2];
683                 s1              =   s1 + event.mac[2];
684                 w0              =       swap32(w0);
685                 b0              =       b1
686                 s2              =       s0 + event.mac[2]
687                 b1              =       b0
688                 w1              =       swap32(w1) - event.mac[2];
689
690                 parm->mac[3] is the total event counts that host requested.
691
692
693         event will be the same with the cmd's param.
694
695 */
696
697 #ifdef CONFIG_H2CLBK
698
699 struct seth2clbk_parm {
700         u8 mac[6];
701         u16     s0;
702         u16     s1;
703         u32     w0;
704         u8      b0;
705         u16  s2;
706         u8      b1;
707         u32     w1;
708 };
709
710 struct geth2clbk_parm {
711         u32 rsv;
712 };
713
714 struct geth2clbk_rsp {
715         u8      mac[6];
716         u16     s0;
717         u16     s1;
718         u32     w0;
719         u8      b0;
720         u16     s2;
721         u8      b1;
722         u32     w1;
723 };
724
725 #endif  /* CONFIG_H2CLBK */
726
727 /* CMD param Formart for driver extra cmd handler */
728 struct drvextra_cmd_parm {
729         int ec_id; /* extra cmd id */
730         int type; /* Can use this field as the type id or command size */
731         int size; /* buffer size */
732         unsigned char *pbuf;
733 };
734
735 /*------------------- Below are used for RF/BB tunning ---------------------*/
736
737 struct  setantenna_parm {
738         u8      tx_antset;
739         u8      rx_antset;
740         u8      tx_antenna;
741         u8      rx_antenna;
742 };
743
744 struct  enrateadaptive_parm {
745         u32     en;
746 };
747
748 struct settxagctbl_parm {
749         u32     txagc[MAX_RATES_LENGTH];
750 };
751
752 struct gettxagctbl_parm {
753         u32 rsvd;
754 };
755 struct gettxagctbl_rsp {
756         u32     txagc[MAX_RATES_LENGTH];
757 };
758
759 struct setagcctrl_parm {
760         u32     agcctrl;                /* 0: pure hw, 1: fw */
761 };
762
763
764 struct setssup_parm     {
765         u32     ss_ForceUp[MAX_RATES_LENGTH];
766 };
767
768 struct getssup_parm     {
769         u32 rsvd;
770 };
771 struct getssup_rsp      {
772         u8      ss_ForceUp[MAX_RATES_LENGTH];
773 };
774
775
776 struct setssdlevel_parm {
777         u8      ss_DLevel[MAX_RATES_LENGTH];
778 };
779
780 struct getssdlevel_parm {
781         u32 rsvd;
782 };
783 struct getssdlevel_rsp  {
784         u8      ss_DLevel[MAX_RATES_LENGTH];
785 };
786
787 struct setssulevel_parm {
788         u8      ss_ULevel[MAX_RATES_LENGTH];
789 };
790
791 struct getssulevel_parm {
792         u32 rsvd;
793 };
794 struct getssulevel_rsp  {
795         u8      ss_ULevel[MAX_RATES_LENGTH];
796 };
797
798
799 struct  setcountjudge_parm {
800         u8      count_judge[MAX_RATES_LENGTH];
801 };
802
803 struct  getcountjudge_parm {
804         u32 rsvd;
805 };
806 struct  getcountjudge_rsp {
807         u8      count_judge[MAX_RATES_LENGTH];
808 };
809
810
811 struct setratable_parm {
812         u8 ss_ForceUp[NumRates];
813         u8 ss_ULevel[NumRates];
814         u8 ss_DLevel[NumRates];
815         u8 count_judge[NumRates];
816 };
817
818 struct getratable_parm {
819         uint rsvd;
820 };
821 struct getratable_rsp {
822         u8 ss_ForceUp[NumRates];
823         u8 ss_ULevel[NumRates];
824         u8 ss_DLevel[NumRates];
825         u8 count_judge[NumRates];
826 };
827
828
829 /* to get TX,RX retry count */
830 struct gettxretrycnt_parm {
831         unsigned int rsvd;
832 };
833 struct gettxretrycnt_rsp {
834         unsigned long tx_retrycnt;
835 };
836
837 struct getrxretrycnt_parm {
838         unsigned int rsvd;
839 };
840 struct getrxretrycnt_rsp {
841         unsigned long rx_retrycnt;
842 };
843
844 /* to get BCNOK,BCNERR count */
845 struct getbcnokcnt_parm {
846         unsigned int rsvd;
847 };
848 struct getbcnokcnt_rsp {
849         unsigned long  bcnokcnt;
850 };
851
852 struct getbcnerrcnt_parm {
853         unsigned int rsvd;
854 };
855 struct getbcnerrcnt_rsp {
856         unsigned long bcnerrcnt;
857 };
858
859 /* to get current TX power level */
860 struct getcurtxpwrlevel_parm {
861         unsigned int rsvd;
862 };
863 struct getcurtxpwrlevel_rsp {
864         unsigned short tx_power;
865 };
866
867 struct setprobereqextraie_parm {
868         unsigned char e_id;
869         unsigned char ie_len;
870         unsigned char ie[0];
871 };
872
873 struct setassocreqextraie_parm {
874         unsigned char e_id;
875         unsigned char ie_len;
876         unsigned char ie[0];
877 };
878
879 struct setproberspextraie_parm {
880         unsigned char e_id;
881         unsigned char ie_len;
882         unsigned char ie[0];
883 };
884
885 struct setassocrspextraie_parm {
886         unsigned char e_id;
887         unsigned char ie_len;
888         unsigned char ie[0];
889 };
890
891
892 struct addBaReq_parm {
893         unsigned int tid;
894         u8      addr[ETH_ALEN];
895 };
896
897 struct addBaRsp_parm {
898         unsigned int tid;
899         unsigned int start_seq;
900         u8 addr[ETH_ALEN];
901         u8 status;
902         u8 size;
903 };
904
905 /*H2C Handler index: 46 */
906 struct set_ch_parm {
907         u8 ch;
908         u8 bw;
909         u8 ch_offset;
910 };
911
912 #ifdef MP_FIRMWARE_OFFLOAD
913 /*H2C Handler index: 47 */
914 struct SetTxPower_parm {
915         u8 TxPower;
916 };
917
918 /*H2C Handler index: 48 */
919 struct SwitchAntenna_parm {
920         u16 antenna_tx;
921         u16 antenna_rx;
922         /*      R_ANTENNA_SELECT_CCK cck_txrx; */
923         u8 cck_txrx;
924 };
925
926 /*H2C Handler index: 49 */
927 struct SetCrystalCap_parm {
928         u32 curr_crystalcap;
929 };
930
931 /*H2C Handler index: 50 */
932 struct SetSingleCarrierTx_parm {
933         u8 bStart;
934 };
935
936 /*H2C Handler index: 51 */
937 struct SetSingleToneTx_parm {
938         u8 bStart;
939         u8 curr_rfpath;
940 };
941
942 /*H2C Handler index: 52 */
943 struct SetCarrierSuppressionTx_parm {
944         u8 bStart;
945         u32 curr_rateidx;
946 };
947
948 /*H2C Handler index: 53 */
949 struct SetContinuousTx_parm {
950         u8 bStart;
951         u8 CCK_flag; /*1:CCK 2:OFDM*/
952         u32 curr_rateidx;
953 };
954
955 /*H2C Handler index: 54 */
956 struct SwitchBandwidth_parm {
957         u8 curr_bandwidth;
958 };
959
960 #endif  /* MP_FIRMWARE_OFFLOAD */
961
962 /*H2C Handler index: 59 */
963 struct SetChannelPlan_param {
964         const struct country_chplan *country_ent;
965         u8 channel_plan;
966 };
967
968 /*H2C Handler index: 60 */
969 struct LedBlink_param {
970         PVOID    pLed;
971 };
972
973 /*H2C Handler index: 61 */
974 struct SetChannelSwitch_param {
975         u8 new_ch_no;
976 };
977
978 /*H2C Handler index: 62 */
979 struct TDLSoption_param {
980         u8 addr[ETH_ALEN];
981         u8 option;
982 };
983
984 /*H2C Handler index: 64 */
985 struct RunInThread_param {
986         void (*func)(void *);
987         void *context;
988 };
989
990
991 #define GEN_CMD_CODE(cmd)       cmd ## _CMD_
992
993
994 /*
995
996 Result:
997 0x00: success
998 0x01: sucess, and check Response.
999 0x02: cmd ignored due to duplicated sequcne number
1000 0x03: cmd dropped due to invalid cmd code
1001 0x04: reserved.
1002
1003 */
1004
1005 #define H2C_RSP_OFFSET                  512
1006
1007 #define H2C_SUCCESS                     0x00
1008 #define H2C_SUCCESS_RSP                 0x01
1009 #define H2C_DUPLICATED                  0x02
1010 #define H2C_DROPPED                     0x03
1011 #define H2C_PARAMETERS_ERROR            0x04
1012 #define H2C_REJECTED                    0x05
1013 #define H2C_CMD_OVERFLOW                0x06
1014 #define H2C_RESERVED                    0x07
1015 #define H2C_ENQ_HEAD                    0x08
1016 #define H2C_ENQ_HEAD_FAIL               0x09
1017
1018 extern u8 rtw_setassocsta_cmd(_adapter  *padapter, u8 *mac_addr);
1019 extern u8 rtw_setstandby_cmd(_adapter *padapter, uint action);
1020 u8 rtw_sitesurvey_cmd(_adapter  *padapter, NDIS_802_11_SSID *ssid, int ssid_num, struct rtw_ieee80211_channel *ch, int ch_num);
1021
1022 u8 rtw_create_ibss_cmd(_adapter *adapter, int flags);
1023 u8 rtw_startbss_cmd(_adapter *adapter, int flags);
1024 u8 rtw_change_bss_chbw_cmd(_adapter *adapter, int flags, s16 req_ch, s8 req_bw, s8 req_offset);
1025
1026 extern u8 rtw_setphy_cmd(_adapter  *padapter, u8 modem, u8 ch);
1027
1028 struct sta_info;
1029 extern u8 rtw_setstakey_cmd(_adapter  *padapter, struct sta_info *sta, u8 key_type, bool enqueue);
1030 extern u8 rtw_clearstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 enqueue);
1031
1032 extern u8 rtw_joinbss_cmd(_adapter  *padapter, struct wlan_network *pnetwork);
1033 u8 rtw_disassoc_cmd(_adapter *padapter, u32 deauth_timeout_ms, bool enqueue);
1034 extern u8 rtw_setopmode_cmd(_adapter  *padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE networktype, bool enqueue);
1035 extern u8 rtw_setdatarate_cmd(_adapter  *padapter, u8 *rateset);
1036 extern u8 rtw_setbasicrate_cmd(_adapter  *padapter, u8 *rateset);
1037 extern u8 rtw_getmacreg_cmd(_adapter *padapter, u8 len, u32 addr);
1038 extern void rtw_usb_catc_trigger_cmd(_adapter *padapter, const char *caller);
1039 extern u8 rtw_setbbreg_cmd(_adapter *padapter, u8 offset, u8 val);
1040 extern u8 rtw_setrfreg_cmd(_adapter *padapter, u8 offset, u32 val);
1041 extern u8 rtw_getbbreg_cmd(_adapter *padapter, u8 offset, u8 *pval);
1042 extern u8 rtw_getrfreg_cmd(_adapter *padapter, u8 offset, u8 *pval);
1043 extern u8 rtw_setrfintfs_cmd(_adapter  *padapter, u8 mode);
1044 extern u8 rtw_setrttbl_cmd(_adapter  *padapter, struct setratable_parm *prate_table);
1045 extern u8 rtw_getrttbl_cmd(_adapter  *padapter, struct getratable_rsp *pval);
1046
1047 extern u8 rtw_gettssi_cmd(_adapter  *padapter, u8 offset, u8 *pval);
1048 extern u8 rtw_setfwdig_cmd(_adapter *padapter, u8 type);
1049 extern u8 rtw_setfwra_cmd(_adapter *padapter, u8 type);
1050
1051 extern u8 rtw_addbareq_cmd(_adapter *padapter, u8 tid, u8 *addr);
1052 extern u8 rtw_addbarsp_cmd(_adapter *padapter, u8 *addr, u16 tid, u8 status, u8 size, u16 start_seq);
1053 /* add for CONFIG_IEEE80211W, none 11w also can use */
1054 extern u8 rtw_reset_securitypriv_cmd(_adapter *padapter);
1055 extern u8 rtw_free_assoc_resources_cmd(_adapter *padapter);
1056 extern u8 rtw_dynamic_chk_wk_cmd(_adapter *adapter);
1057
1058 u8 rtw_lps_ctrl_wk_cmd(_adapter *padapter, u8 lps_ctrl_type, u8 enqueue);
1059 u8 rtw_dm_in_lps_wk_cmd(_adapter *padapter);
1060 u8 rtw_lps_change_dtim_cmd(_adapter *padapter, u8 dtim);
1061
1062 #if (RATE_ADAPTIVE_SUPPORT == 1)
1063         u8 rtw_rpt_timer_cfg_cmd(_adapter *padapter, u16 minRptTime);
1064 #endif
1065
1066 #ifdef CONFIG_ANTENNA_DIVERSITY
1067         extern  u8 rtw_antenna_select_cmd(_adapter *padapter, u8 antenna, u8 enqueue);
1068 #endif
1069
1070 u8 rtw_dm_ra_mask_wk_cmd(_adapter *padapter, u8 *psta);
1071
1072 extern u8 rtw_ps_cmd(_adapter *padapter);
1073
1074 #ifdef CONFIG_AP_MODE
1075 u8 rtw_chk_hi_queue_cmd(_adapter *padapter);
1076 #ifdef CONFIG_DFS_MASTER
1077 u8 rtw_dfs_master_cmd(_adapter *adapter, bool enqueue);
1078 void rtw_dfs_master_timer_hdl(RTW_TIMER_HDL_ARGS);
1079 void rtw_dfs_master_enable(_adapter *adapter, u8 ch, u8 bw, u8 offset);
1080 void rtw_dfs_master_disable(_adapter *adapter, u8 ch, u8 bw, u8 offset, bool by_others);
1081 enum {
1082         MLME_STA_CONNECTING,
1083         MLME_STA_CONNECTED,
1084         MLME_STA_DISCONNECTED,
1085         MLME_AP_STARTED,
1086         MLME_AP_STOPPED,
1087 };
1088 void rtw_dfs_master_status_apply(_adapter *adapter, u8 self_action);
1089 #endif /* CONFIG_DFS_MASTER */
1090 #endif /* CONFIG_AP_MODE */
1091
1092 #ifdef CONFIG_BT_COEXIST
1093         u8 rtw_btinfo_cmd(PADAPTER padapter, u8 *pbuf, u16 length);
1094 #endif
1095
1096 u8 rtw_test_h2c_cmd(_adapter *adapter, u8 *buf, u8 len);
1097
1098 u8 rtw_enable_hw_update_tsf_cmd(_adapter *padapter);
1099
1100 u8 rtw_set_ch_cmd(_adapter *padapter, u8 ch, u8 bw, u8 ch_offset, u8 enqueue);
1101
1102 u8 rtw_set_chplan_cmd(_adapter *adapter, int flags, u8 chplan, u8 swconfig);
1103 u8 rtw_set_country_cmd(_adapter *adapter, int flags, const char *country_code, u8 swconfig);
1104
1105 extern u8 rtw_led_blink_cmd(_adapter *padapter, PVOID pLed);
1106 extern u8 rtw_set_csa_cmd(_adapter *padapter, u8 new_ch_no);
1107 extern u8 rtw_tdls_cmd(_adapter *padapter, u8 *addr, u8 option);
1108
1109 /* #ifdef CONFIG_C2H_PACKET_EN */
1110 extern u8 rtw_c2h_packet_wk_cmd(PADAPTER padapter, u8 *pbuf, u16 length);
1111 /* #else */
1112 extern u8 rtw_c2h_wk_cmd(PADAPTER padapter, u8 *c2h_evt);
1113 /* #endif */
1114
1115 u8 rtw_run_in_thread_cmd(PADAPTER padapter, void (*func)(void *), void *context);
1116
1117 u8 session_tracker_chk_cmd(_adapter *adapter, struct sta_info *sta);
1118 u8 session_tracker_add_cmd(_adapter *adapter, struct sta_info *sta, u8 *local_naddr, u8 *local_port, u8 *remote_naddr, u8 *remote_port);
1119 u8 session_tracker_del_cmd(_adapter *adapter, struct sta_info *sta, u8 *local_naddr, u8 *local_port, u8 *remote_naddr, u8 *remote_port);
1120
1121 u8 rtw_drvextra_cmd_hdl(_adapter *padapter, unsigned char *pbuf);
1122
1123 extern void rtw_survey_cmd_callback(_adapter  *padapter, struct cmd_obj *pcmd);
1124 extern void rtw_disassoc_cmd_callback(_adapter  *padapter, struct cmd_obj *pcmd);
1125 extern void rtw_joinbss_cmd_callback(_adapter  *padapter, struct cmd_obj *pcmd);
1126 void rtw_create_ibss_post_hdl(_adapter *padapter, int status);
1127 extern void rtw_getbbrfreg_cmdrsp_callback(_adapter  *padapter, struct cmd_obj *pcmd);
1128 extern void rtw_readtssi_cmdrsp_callback(_adapter       *padapter,  struct cmd_obj *pcmd);
1129
1130 extern void rtw_setstaKey_cmdrsp_callback(_adapter  *padapter,  struct cmd_obj *pcmd);
1131 extern void rtw_setassocsta_cmdrsp_callback(_adapter  *padapter,  struct cmd_obj *pcmd);
1132 extern void rtw_getrttbl_cmdrsp_callback(_adapter  *padapter,  struct cmd_obj *pcmd);
1133 extern void rtw_getmacreg_cmdrsp_callback(_adapter *padapter,  struct cmd_obj *pcmd);
1134
1135
1136 struct _cmd_callback {
1137         u32     cmd_code;
1138         void (*callback)(_adapter  *padapter, struct cmd_obj *cmd);
1139 };
1140
1141 enum rtw_h2c_cmd {
1142         GEN_CMD_CODE(_Read_MACREG) ,    /*0*/
1143         GEN_CMD_CODE(_Write_MACREG) ,
1144         GEN_CMD_CODE(_Read_BBREG) ,
1145         GEN_CMD_CODE(_Write_BBREG) ,
1146         GEN_CMD_CODE(_Read_RFREG) ,
1147         GEN_CMD_CODE(_Write_RFREG) , /*5*/
1148         GEN_CMD_CODE(_Read_EEPROM) ,
1149         GEN_CMD_CODE(_Write_EEPROM) ,
1150         GEN_CMD_CODE(_Read_EFUSE) ,
1151         GEN_CMD_CODE(_Write_EFUSE) ,
1152
1153         GEN_CMD_CODE(_Read_CAM) ,       /*10*/
1154         GEN_CMD_CODE(_Write_CAM) ,
1155         GEN_CMD_CODE(_setBCNITV),
1156         GEN_CMD_CODE(_setMBIDCFG),
1157         GEN_CMD_CODE(_JoinBss),   /*14*/
1158         GEN_CMD_CODE(_DisConnect) , /*15*/
1159         GEN_CMD_CODE(_CreateBss) ,
1160         GEN_CMD_CODE(_SetOpMode) ,
1161         GEN_CMD_CODE(_SiteSurvey),  /*18*/
1162         GEN_CMD_CODE(_SetAuth) ,
1163
1164         GEN_CMD_CODE(_SetKey) , /*20*/
1165         GEN_CMD_CODE(_SetStaKey) ,
1166         GEN_CMD_CODE(_SetAssocSta) ,
1167         GEN_CMD_CODE(_DelAssocSta) ,
1168         GEN_CMD_CODE(_SetStaPwrState) ,
1169         GEN_CMD_CODE(_SetBasicRate) , /*25*/
1170         GEN_CMD_CODE(_GetBasicRate) ,
1171         GEN_CMD_CODE(_SetDataRate) ,
1172         GEN_CMD_CODE(_GetDataRate) ,
1173         GEN_CMD_CODE(_SetPhyInfo) ,
1174
1175         GEN_CMD_CODE(_GetPhyInfo) ,     /*30*/
1176         GEN_CMD_CODE(_SetPhy) ,
1177         GEN_CMD_CODE(_GetPhy) ,
1178         GEN_CMD_CODE(_readRssi) ,
1179         GEN_CMD_CODE(_readGain) ,
1180         GEN_CMD_CODE(_SetAtim) , /*35*/
1181         GEN_CMD_CODE(_SetPwrMode) ,
1182         GEN_CMD_CODE(_JoinbssRpt),
1183         GEN_CMD_CODE(_SetRaTable) ,
1184         GEN_CMD_CODE(_GetRaTable) ,
1185
1186         GEN_CMD_CODE(_GetCCXReport), /*40*/
1187         GEN_CMD_CODE(_GetDTMReport),
1188         GEN_CMD_CODE(_GetTXRateStatistics),
1189         GEN_CMD_CODE(_SetUsbSuspend),
1190         GEN_CMD_CODE(_SetH2cLbk),
1191         GEN_CMD_CODE(_AddBAReq) , /*45*/
1192         GEN_CMD_CODE(_SetChannel), /*46*/
1193         GEN_CMD_CODE(_SetTxPower),
1194         GEN_CMD_CODE(_SwitchAntenna),
1195         GEN_CMD_CODE(_SetCrystalCap),
1196         GEN_CMD_CODE(_SetSingleCarrierTx), /*50*/
1197
1198         GEN_CMD_CODE(_SetSingleToneTx),/*51*/
1199         GEN_CMD_CODE(_SetCarrierSuppressionTx),
1200         GEN_CMD_CODE(_SetContinuousTx),
1201         GEN_CMD_CODE(_SwitchBandwidth), /*54*/
1202         GEN_CMD_CODE(_TX_Beacon), /*55*/
1203
1204         GEN_CMD_CODE(_Set_MLME_EVT), /*56*/
1205         GEN_CMD_CODE(_Set_Drv_Extra), /*57*/
1206         GEN_CMD_CODE(_Set_H2C_MSG), /*58*/
1207
1208         GEN_CMD_CODE(_SetChannelPlan), /*59*/
1209         GEN_CMD_CODE(_LedBlink), /*60*/
1210
1211         GEN_CMD_CODE(_SetChannelSwitch), /*61*/
1212         GEN_CMD_CODE(_TDLS), /*62*/
1213         GEN_CMD_CODE(_ChkBMCSleepq), /*63*/
1214
1215         GEN_CMD_CODE(_RunInThreadCMD), /*64*/
1216         GEN_CMD_CODE(_AddBARsp) , /*65*/
1217
1218         MAX_H2CCMD
1219 };
1220
1221 #define _GetMACReg_CMD_ _Read_MACREG_CMD_
1222 #define _SetMACReg_CMD_ _Write_MACREG_CMD_
1223 #define _GetBBReg_CMD_          _Read_BBREG_CMD_
1224 #define _SetBBReg_CMD_          _Write_BBREG_CMD_
1225 #define _GetRFReg_CMD_          _Read_RFREG_CMD_
1226 #define _SetRFReg_CMD_          _Write_RFREG_CMD_
1227
1228 #ifdef _RTW_CMD_C_
1229 struct _cmd_callback    rtw_cmd_callback[] = {
1230         {GEN_CMD_CODE(_Read_MACREG), &rtw_getmacreg_cmdrsp_callback}, /*0*/
1231         {GEN_CMD_CODE(_Write_MACREG), NULL},
1232         {GEN_CMD_CODE(_Read_BBREG), &rtw_getbbrfreg_cmdrsp_callback},
1233         {GEN_CMD_CODE(_Write_BBREG), NULL},
1234         {GEN_CMD_CODE(_Read_RFREG), &rtw_getbbrfreg_cmdrsp_callback},
1235         {GEN_CMD_CODE(_Write_RFREG), NULL}, /*5*/
1236         {GEN_CMD_CODE(_Read_EEPROM), NULL},
1237         {GEN_CMD_CODE(_Write_EEPROM), NULL},
1238         {GEN_CMD_CODE(_Read_EFUSE), NULL},
1239         {GEN_CMD_CODE(_Write_EFUSE), NULL},
1240
1241         {GEN_CMD_CODE(_Read_CAM),       NULL},  /*10*/
1242         {GEN_CMD_CODE(_Write_CAM),       NULL},
1243         {GEN_CMD_CODE(_setBCNITV), NULL},
1244         {GEN_CMD_CODE(_setMBIDCFG), NULL},
1245         {GEN_CMD_CODE(_JoinBss), &rtw_joinbss_cmd_callback},  /*14*/
1246         {GEN_CMD_CODE(_DisConnect), &rtw_disassoc_cmd_callback}, /*15*/
1247         {GEN_CMD_CODE(_CreateBss), NULL},
1248         {GEN_CMD_CODE(_SetOpMode), NULL},
1249         {GEN_CMD_CODE(_SiteSurvey), &rtw_survey_cmd_callback}, /*18*/
1250         {GEN_CMD_CODE(_SetAuth), NULL},
1251
1252         {GEN_CMD_CODE(_SetKey), NULL},  /*20*/
1253         {GEN_CMD_CODE(_SetStaKey), &rtw_setstaKey_cmdrsp_callback},
1254         {GEN_CMD_CODE(_SetAssocSta), &rtw_setassocsta_cmdrsp_callback},
1255         {GEN_CMD_CODE(_DelAssocSta), NULL},
1256         {GEN_CMD_CODE(_SetStaPwrState), NULL},
1257         {GEN_CMD_CODE(_SetBasicRate), NULL}, /*25*/
1258         {GEN_CMD_CODE(_GetBasicRate), NULL},
1259         {GEN_CMD_CODE(_SetDataRate), NULL},
1260         {GEN_CMD_CODE(_GetDataRate), NULL},
1261         {GEN_CMD_CODE(_SetPhyInfo), NULL},
1262
1263         {GEN_CMD_CODE(_GetPhyInfo), NULL}, /*30*/
1264         {GEN_CMD_CODE(_SetPhy), NULL},
1265         {GEN_CMD_CODE(_GetPhy), NULL},
1266         {GEN_CMD_CODE(_readRssi), NULL},
1267         {GEN_CMD_CODE(_readGain), NULL},
1268         {GEN_CMD_CODE(_SetAtim), NULL}, /*35*/
1269         {GEN_CMD_CODE(_SetPwrMode), NULL},
1270         {GEN_CMD_CODE(_JoinbssRpt), NULL},
1271         {GEN_CMD_CODE(_SetRaTable), NULL},
1272         {GEN_CMD_CODE(_GetRaTable) , NULL},
1273
1274         {GEN_CMD_CODE(_GetCCXReport), NULL}, /*40*/
1275         {GEN_CMD_CODE(_GetDTMReport),   NULL},
1276         {GEN_CMD_CODE(_GetTXRateStatistics), NULL},
1277         {GEN_CMD_CODE(_SetUsbSuspend), NULL},
1278         {GEN_CMD_CODE(_SetH2cLbk), NULL},
1279         {GEN_CMD_CODE(_AddBAReq), NULL}, /*45*/
1280         {GEN_CMD_CODE(_SetChannel), NULL},              /*46*/
1281         {GEN_CMD_CODE(_SetTxPower), NULL},
1282         {GEN_CMD_CODE(_SwitchAntenna), NULL},
1283         {GEN_CMD_CODE(_SetCrystalCap), NULL},
1284         {GEN_CMD_CODE(_SetSingleCarrierTx), NULL},      /*50*/
1285
1286         {GEN_CMD_CODE(_SetSingleToneTx), NULL}, /*51*/
1287         {GEN_CMD_CODE(_SetCarrierSuppressionTx), NULL},
1288         {GEN_CMD_CODE(_SetContinuousTx), NULL},
1289         {GEN_CMD_CODE(_SwitchBandwidth), NULL},         /*54*/
1290         {GEN_CMD_CODE(_TX_Beacon), NULL},/*55*/
1291
1292         {GEN_CMD_CODE(_Set_MLME_EVT), NULL},/*56*/
1293         {GEN_CMD_CODE(_Set_Drv_Extra), NULL},/*57*/
1294         {GEN_CMD_CODE(_Set_H2C_MSG), NULL},/*58*/
1295         {GEN_CMD_CODE(_SetChannelPlan), NULL},/*59*/
1296         {GEN_CMD_CODE(_LedBlink), NULL},/*60*/
1297
1298         {GEN_CMD_CODE(_SetChannelSwitch), NULL},/*61*/
1299         {GEN_CMD_CODE(_TDLS), NULL},/*62*/
1300         {GEN_CMD_CODE(_ChkBMCSleepq), NULL}, /*63*/
1301
1302         {GEN_CMD_CODE(_RunInThreadCMD), NULL},/*64*/
1303         {GEN_CMD_CODE(_AddBARsp), NULL}, /*65*/
1304 };
1305 #endif
1306
1307 #define CMD_FMT "cmd=%d,%d,%d"
1308 #define CMD_ARG(cmd) \
1309         (cmd)->cmdcode, \
1310         (cmd)->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra) ? ((struct drvextra_cmd_parm *)(cmd)->parmbuf)->ec_id : ((cmd)->cmdcode == GEN_CMD_CODE(_Set_MLME_EVT) ? ((struct C2HEvent_Header *)(cmd)->parmbuf)->ID : 0), \
1311         (cmd)->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra) ? ((struct drvextra_cmd_parm *)(cmd)->parmbuf)->type : 0
1312
1313 #endif /* _CMD_H_ */