OSDN Git Service

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