OSDN Git Service

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