staging: xillybus: Return -EIO if *_iomap fails, instead of 0
[deliverable/linux.git] / drivers / staging / rtl8188eu / include / rtw_cmd.h
CommitLineData
475b922e
LF
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#include <wlan_bssdef.h>
24#include <rtw_rf.h>
25#include <rtw_led.h>
26
27#define C2H_MEM_SZ (16*1024)
28
29#include <osdep_service.h>
30#include <ieee80211.h> /* <ieee80211/ieee80211.h> */
31
32#define FREE_CMDOBJ_SZ 128
33
34#define MAX_CMDSZ 1024
35#define MAX_RSPSZ 512
36#define MAX_EVTSZ 1024
37
38#define CMDBUFF_ALIGN_SZ 512
39
40struct cmd_obj {
41 struct adapter *padapter;
42 u16 cmdcode;
43 u8 res;
44 u8 *parmbuf;
45 u32 cmdsz;
46 u8 *rsp;
47 u32 rspsz;
48 struct list_head list;
49};
50
51struct cmd_priv {
52 struct semaphore cmd_queue_sema;
53 struct semaphore terminate_cmdthread_sema;
54 struct __queue cmd_queue;
55 u8 cmd_seq;
56 u8 *cmd_buf; /* shall be non-paged, and 4 bytes aligned */
57 u8 *cmd_allocated_buf;
58 u8 *rsp_buf; /* shall be non-paged, and 4 bytes aligned */
59 u8 *rsp_allocated_buf;
60 u32 cmd_issued_cnt;
61 u32 cmd_done_cnt;
62 u32 rsp_cnt;
63 u8 cmdthd_running;
64 struct adapter *padapter;
65};
66
67struct evt_priv {
68 struct work_struct c2h_wk;
69 bool c2h_wk_alive;
70 struct rtw_cbuf *c2h_queue;
71 #define C2H_QUEUE_MAX_LEN 10
72 ATOMIC_T event_seq;
73 u8 *evt_buf; /* shall be non-paged, and 4 bytes aligned */
74 u8 *evt_allocated_buf;
75 u32 evt_done_cnt;
76};
77
78#define init_h2fwcmd_w_parm_no_rsp(pcmd, pparm, code) \
79do {\
80 _rtw_init_listhead(&pcmd->list);\
81 pcmd->cmdcode = code;\
82 pcmd->parmbuf = (u8 *)(pparm);\
83 pcmd->cmdsz = sizeof(*pparm);\
84 pcmd->rsp = NULL;\
85 pcmd->rspsz = 0;\
86} while (0)
87
88struct c2h_evt_hdr {
89 u8 id:4;
90 u8 plen:4;
91 u8 seq;
92 u8 payload[0];
93};
94
95#define c2h_evt_exist(c2h_evt) ((c2h_evt)->id || (c2h_evt)->plen)
96
97u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj);
98struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv);
99void rtw_free_cmd_obj(struct cmd_obj *pcmd);
100
101int rtw_cmd_thread(void *context);
102
103u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv);
104void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv);
105
106u32 rtw_init_evt_priv(struct evt_priv *pevtpriv);
107void rtw_free_evt_priv(struct evt_priv *pevtpriv);
108void rtw_cmd_clr_isr(struct cmd_priv *pcmdpriv);
109void rtw_evt_notify_isr(struct evt_priv *pevtpriv);
110#ifdef CONFIG_88EU_P2P
111u8 p2p_protocol_wk_cmd(struct adapter *padapter, int intCmdType);
112#endif /* CONFIG_88EU_P2P */
113
114enum rtw_drvextra_cmd_id {
115 NONE_WK_CID,
116 DYNAMIC_CHK_WK_CID,
117 DM_CTRL_WK_CID,
118 PBC_POLLING_WK_CID,
119 POWER_SAVING_CTRL_WK_CID,/* IPS,AUTOSuspend */
120 LPS_CTRL_WK_CID,
121 ANT_SELECT_WK_CID,
122 P2P_PS_WK_CID,
123 P2P_PROTO_WK_CID,
124 CHECK_HIQ_WK_CID,/* for softap mode, check hi queue if empty */
125 INTEl_WIDI_WK_CID,
126 C2H_WK_CID,
127 RTP_TIMER_CFG_WK_CID,
128 MAX_WK_CID
129};
130
131enum LPS_CTRL_TYPE {
132 LPS_CTRL_SCAN = 0,
133 LPS_CTRL_JOINBSS = 1,
134 LPS_CTRL_CONNECT = 2,
135 LPS_CTRL_DISCONNECT = 3,
136 LPS_CTRL_SPECIAL_PACKET = 4,
137 LPS_CTRL_LEAVE = 5,
138};
139
140enum RFINTFS {
141 SWSI,
142 HWSI,
143 HWPI,
144};
145
146/*
147Caller Mode: Infra, Ad-HoC(C)
148
149Notes: To enter USB suspend mode
150
151Command Mode
152
153*/
154struct usb_suspend_parm {
155 u32 action;/* 1: sleep, 0:resume */
156};
157
158/*
159Caller Mode: Infra, Ad-HoC
160
161Notes: To join a known BSS.
162
163Command-Event Mode
164
165*/
166
167/*
168Caller Mode: Infra, Ad-Hoc
169
170Notes: To join the specified bss
171
172Command Event Mode
173
174*/
175struct joinbss_parm {
176 struct wlan_bssid_ex network;
177};
178
179/*
180Caller Mode: Infra, Ad-HoC(C)
181
182Notes: To disconnect the current associated BSS
183
184Command Mode
185
186*/
187struct disconnect_parm {
188 u32 deauth_timeout_ms;
189};
190
191/*
192Caller Mode: AP, Ad-HoC(M)
193
194Notes: To create a BSS
195
196Command Mode
197*/
198struct createbss_parm {
199 struct wlan_bssid_ex network;
200};
201
202struct setopmode_parm {
203 u8 mode;
204 u8 rsvd[3];
205};
206
207/*
208Caller Mode: AP, Ad-HoC, Infra
209
210Notes: To ask RTL8711 performing site-survey
211
212Command-Event Mode
213
214*/
215
216#define RTW_SSID_SCAN_AMOUNT 9 /* for WEXT_CSCAN_AMOUNT 9 */
217#define RTW_CHANNEL_SCAN_AMOUNT (14+37)
218struct sitesurvey_parm {
219 int scan_mode; /* active: 1, passive: 0 */
220 u8 ssid_num;
221 u8 ch_num;
222 struct ndis_802_11_ssid ssid[RTW_SSID_SCAN_AMOUNT];
223 struct rtw_ieee80211_channel ch[RTW_CHANNEL_SCAN_AMOUNT];
224};
225
226/*
227Caller Mode: Any
228
229Notes: To set the auth type of RTL8711. open/shared/802.1x
230
231Command Mode
232
233*/
234struct setauth_parm {
235 u8 mode; /* 0: legacy open, 1: legacy shared 2: 802.1x */
236 u8 _1x; /* 0: PSK, 1: TLS */
237 u8 rsvd[2];
238};
239
240/*
241Caller Mode: Infra
242
243a. algorithm: wep40, wep104, tkip & aes
244b. keytype: grp key/unicast key
245c. key contents
246
247when shared key ==> keyid is the camid
248when 802.1x ==> keyid [0:1] ==> grp key
249when 802.1x ==> keyid > 2 ==> unicast key
250
251*/
252struct setkey_parm {
253 u8 algorithm; /* could be none, wep40, TKIP, CCMP, wep104 */
254 u8 keyid;
255 u8 grpkey; /* 1: this is the grpkey for 802.1x.
256 * 0: this is the unicast key for 802.1x */
257 u8 set_tx; /* 1: main tx key for wep. 0: other key. */
258 u8 key[16]; /* this could be 40 or 104 */
259};
260
261/*
262When in AP or Ad-Hoc mode, this is used to
263allocate an sw/hw entry for a newly associated sta.
264
265Command
266
267when shared key ==> algorithm/keyid
268
269*/
270struct set_stakey_parm {
271 u8 addr[ETH_ALEN];
272 u8 algorithm;
273 u8 id;/* currently for erasing cam entry if
274 * algorithm == _NO_PRIVACY_ */
275 u8 key[16];
276};
277
278struct set_stakey_rsp {
279 u8 addr[ETH_ALEN];
280 u8 keyid;
281 u8 rsvd;
282};
283
284/*
285Caller Ad-Hoc/AP
286
287Command -Rsp(AID == CAMID) mode
288
289This is to force fw to add an sta_data entry per driver's request.
290
291FW will write an cam entry associated with it.
292
293*/
294struct set_assocsta_parm {
295 u8 addr[ETH_ALEN];
296};
297
298struct set_assocsta_rsp {
299 u8 cam_id;
300 u8 rsvd[3];
301};
302
303/*
304 Caller Ad-Hoc/AP
305
306 Command mode
307
308 This is to force fw to del an sta_data entry per driver's request
309
310 FW will invalidate the cam entry associated with it.
311
312*/
313struct del_assocsta_parm {
314 u8 addr[ETH_ALEN];
315};
316
317/*
318Caller Mode: AP/Ad-HoC(M)
319
320Notes: To notify fw that given staid has changed its power state
321
322Command Mode
323
324*/
325struct setstapwrstate_parm {
326 u8 staid;
327 u8 status;
328 u8 hwaddr[6];
329};
330
331/*
332Caller Mode: Any
333
334Notes: To setup the basic rate of RTL8711
335
336Command Mode
337
338*/
339struct setbasicrate_parm {
340 u8 basicrates[NumRates];
341};
342
343/*
344Caller Mode: Any
345
346Notes: To read the current basic rate
347
348Command-Rsp Mode
349
350*/
351struct getbasicrate_parm {
352 u32 rsvd;
353};
354
355struct getbasicrate_rsp {
356 u8 basicrates[NumRates];
357};
358
359/*
360Caller Mode: Any
361
362Notes: To setup the data rate of RTL8711
363
364Command Mode
365
366*/
367struct setdatarate_parm {
368 u8 mac_id;
369 u8 datarates[NumRates];
370};
371
372/*
373Caller Mode: Any
374
375Notes: To read the current data rate
376
377Command-Rsp Mode
378
379*/
380struct getdatarate_parm {
381 u32 rsvd;
382
383};
384struct getdatarate_rsp {
385 u8 datarates[NumRates];
386};
387
388/*
389Caller Mode: Any
390AP: AP can use the info for the contents of beacon frame
391Infra: STA can use the info when sitesurveying
392Ad-HoC(M): Like AP
393Ad-HoC(C): Like STA
394
395Notes: To set the phy capability of the NIC
396
397Command Mode
398
399*/
400
401struct setphyinfo_parm {
402 struct regulatory_class class_sets[NUM_REGULATORYS];
403 u8 status;
404};
405
406struct getphyinfo_parm {
407 u32 rsvd;
408};
409
410struct getphyinfo_rsp {
411 struct regulatory_class class_sets[NUM_REGULATORYS];
412 u8 status;
413};
414
415/*
416Caller Mode: Any
417
418Notes: To set the channel/modem/band
419This command will be used when channel/modem/band is changed.
420
421Command Mode
422
423*/
424struct setphy_parm {
425 u8 rfchannel;
426 u8 modem;
427};
428
429/*
430Caller Mode: Any
431
432Notes: To get the current setting of channel/modem/band
433
434Command-Rsp Mode
435
436*/
437struct getphy_parm {
438 u32 rsvd;
439
440};
441struct getphy_rsp {
442 u8 rfchannel;
443 u8 modem;
444};
445
446struct readBB_parm {
447 u8 offset;
448};
449struct readBB_rsp {
450 u8 value;
451};
452
453struct readTSSI_parm {
454 u8 offset;
455};
456struct readTSSI_rsp {
457 u8 value;
458};
459
460struct writeBB_parm {
461 u8 offset;
462 u8 value;
463};
464
465struct readRF_parm {
466 u8 offset;
467};
468struct readRF_rsp {
469 u32 value;
470};
471
472struct writeRF_parm {
473 u32 offset;
474 u32 value;
475};
476
477struct getrfintfs_parm {
478 u8 rfintfs;
479};
480
481struct Tx_Beacon_param
482{
483 struct wlan_bssid_ex network;
484};
485
486/*
487 Notes: This command is used for H2C/C2H loopback testing
488
489 mac[0] == 0
490 ==> CMD mode, return H2C_SUCCESS.
491 The following condition must be ture under CMD mode
492 mac[1] == mac[4], mac[2] == mac[3], mac[0]=mac[5]= 0;
493 s0 == 0x1234, s1 == 0xabcd, w0 == 0x78563412, w1 == 0x5aa5def7;
494 s2 == (b1 << 8 | b0);
495
496 mac[0] == 1
497 ==> CMD_RSP mode, return H2C_SUCCESS_RSP
498
499 The rsp layout shall be:
500 rsp: parm:
501 mac[0] = mac[5];
502 mac[1] = mac[4];
503 mac[2] = mac[3];
504 mac[3] = mac[2];
505 mac[4] = mac[1];
506 mac[5] = mac[0];
507 s0 = s1;
508 s1 = swap16(s0);
509 w0 = swap32(w1);
510 b0 = b1
511 s2 = s0 + s1
512 b1 = b0
513 w1 = w0
514
515 mac[0] == 2
516 ==> CMD_EVENT mode, return H2C_SUCCESS
517 The event layout shall be:
518 event: parm:
519 mac[0] = mac[5];
520 mac[1] = mac[4];
521 mac[2] = event's seq no, starting from 1 to parm's marc[3]
522 mac[3] = mac[2];
523 mac[4] = mac[1];
524 mac[5] = mac[0];
525 s0 = swap16(s0) - event.mac[2];
526 s1 = s1 + event.mac[2];
527 w0 = swap32(w0);
528 b0 = b1
529 s2 = s0 + event.mac[2]
530 b1 = b0
531 w1 = swap32(w1) - event.mac[2];
532
533 parm->mac[3] is the total event counts that host requested.
534 event will be the same with the cmd's param.
535*/
536
537/* CMD param Format for driver extra cmd handler */
538struct drvextra_cmd_parm {
539 int ec_id; /* extra cmd id */
540 int type_size; /* Can use this field as the type id or command size */
541 unsigned char *pbuf;
542};
543
544/*------------------- Below are used for RF/BB tunning ---------------------*/
545
546struct setantenna_parm {
547 u8 tx_antset;
548 u8 rx_antset;
549 u8 tx_antenna;
550 u8 rx_antenna;
551};
552
553struct enrateadaptive_parm {
554 u32 en;
555};
556
557struct settxagctbl_parm {
558 u32 txagc[MAX_RATES_LENGTH];
559};
560
561struct gettxagctbl_parm {
562 u32 rsvd;
563};
564struct gettxagctbl_rsp {
565 u32 txagc[MAX_RATES_LENGTH];
566};
567
568struct setagcctrl_parm {
569 u32 agcctrl; /* 0: pure hw, 1: fw */
570};
571
572struct setssup_parm {
573 u32 ss_ForceUp[MAX_RATES_LENGTH];
574};
575
576struct getssup_parm {
577 u32 rsvd;
578};
579
580struct getssup_rsp {
581 u8 ss_ForceUp[MAX_RATES_LENGTH];
582};
583
584struct setssdlevel_parm {
585 u8 ss_DLevel[MAX_RATES_LENGTH];
586};
587
588struct getssdlevel_parm {
589 u32 rsvd;
590};
591
592struct getssdlevel_rsp {
593 u8 ss_DLevel[MAX_RATES_LENGTH];
594};
595
596struct setssulevel_parm {
597 u8 ss_ULevel[MAX_RATES_LENGTH];
598};
599
600struct getssulevel_parm {
601 u32 rsvd;
602};
603
604struct getssulevel_rsp {
605 u8 ss_ULevel[MAX_RATES_LENGTH];
606};
607
608struct setcountjudge_parm {
609 u8 count_judge[MAX_RATES_LENGTH];
610};
611
612struct getcountjudge_parm {
613 u32 rsvd;
614};
615
616struct getcountjudge_rsp {
617 u8 count_judge[MAX_RATES_LENGTH];
618};
619
620struct setratable_parm {
621 u8 ss_ForceUp[NumRates];
622 u8 ss_ULevel[NumRates];
623 u8 ss_DLevel[NumRates];
624 u8 count_judge[NumRates];
625};
626
627struct getratable_parm {
628 uint rsvd;
629};
630
631struct getratable_rsp {
632 u8 ss_ForceUp[NumRates];
633 u8 ss_ULevel[NumRates];
634 u8 ss_DLevel[NumRates];
635 u8 count_judge[NumRates];
636};
637
638/* to get TX,RX retry count */
639
640struct gettxretrycnt_parm {
641 unsigned int rsvd;
642};
643
644struct gettxretrycnt_rsp {
645 unsigned long tx_retrycnt;
646};
647
648struct getrxretrycnt_parm {
649 unsigned int rsvd;
650};
651
652struct getrxretrycnt_rsp {
653 unsigned long rx_retrycnt;
654};
655
656/* to get BCNOK,BCNERR count */
657struct getbcnokcnt_parm {
658 unsigned int rsvd;
659};
660
661struct getbcnokcnt_rsp {
662 unsigned long bcnokcnt;
663};
664
665struct getbcnerrcnt_parm {
666 unsigned int rsvd;
667};
668
669struct getbcnerrcnt_rsp {
670 unsigned long bcnerrcnt;
671};
672
673/* to get current TX power level */
674struct getcurtxpwrlevel_parm {
675 unsigned int rsvd;
676};
677struct getcurtxpwrlevel_rspi {
678 unsigned short tx_power;
679};
680
681struct setprobereqextraie_parm {
682 unsigned char e_id;
683 unsigned char ie_len;
684 unsigned char ie[0];
685};
686
687struct setassocreqextraie_parm {
688 unsigned char e_id;
689 unsigned char ie_len;
690 unsigned char ie[0];
691};
692
693struct setproberspextraie_parm {
694 unsigned char e_id;
695 unsigned char ie_len;
696 unsigned char ie[0];
697};
698
699struct setassocrspextraie_parm {
700 unsigned char e_id;
701 unsigned char ie_len;
702 unsigned char ie[0];
703};
704
705struct addBaReq_parm {
706 unsigned int tid;
707 u8 addr[ETH_ALEN];
708};
709
710/*H2C Handler index: 46 */
711struct set_ch_parm {
712 u8 ch;
713 u8 bw;
714 u8 ch_offset;
715};
716
717/*H2C Handler index: 59 */
718struct SetChannelPlan_param
719{
720 u8 channel_plan;
721};
722
723/*H2C Handler index: 60 */
724struct LedBlink_param
725{
726 struct LED_871x *pLed;
727};
728
729/*H2C Handler index: 61 */
730struct SetChannelSwitch_param
731{
732 u8 new_ch_no;
733};
734
735/*H2C Handler index: 62 */
736struct TDLSoption_param
737{
738 u8 addr[ETH_ALEN];
739 u8 option;
740};
741
742#define GEN_CMD_CODE(cmd) cmd ## _CMD_
743
744/*
745
746Result:
7470x00: success
f7bba924 7480x01: success, and check Response.
475b922e
LF
7490x02: cmd ignored due to duplicated sequcne number
7500x03: cmd dropped due to invalid cmd code
7510x04: reserved.
752
753*/
754
755#define H2C_RSP_OFFSET 512
756
757#define H2C_SUCCESS 0x00
758#define H2C_SUCCESS_RSP 0x01
759#define H2C_DUPLICATED 0x02
760#define H2C_DROPPED 0x03
761#define H2C_PARAMETERS_ERROR 0x04
762#define H2C_REJECTED 0x05
763#define H2C_CMD_OVERFLOW 0x06
764#define H2C_RESERVED 0x07
765
766u8 rtw_setassocsta_cmd(struct adapter *padapter, u8 *mac_addr);
767u8 rtw_setstandby_cmd(struct adapter *padapter, uint action);
768u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
769 int ssid_num, struct rtw_ieee80211_channel *ch,
770 int ch_num);
771u8 rtw_createbss_cmd(struct adapter *padapter);
772u8 rtw_createbss_cmd_ex(struct adapter *padapter, unsigned char *pbss,
773 unsigned int sz);
774u8 rtw_setphy_cmd(struct adapter *padapter, u8 modem, u8 ch);
775u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key);
776u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue);
777u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork);
778u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueue);
779u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype);
780u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset);
781u8 rtw_setbasicrate_cmd(struct adapter *padapter, u8 *rateset);
782u8 rtw_setbbreg_cmd(struct adapter * padapter, u8 offset, u8 val);
783u8 rtw_setrfreg_cmd(struct adapter * padapter, u8 offset, u32 val);
784u8 rtw_getbbreg_cmd(struct adapter * padapter, u8 offset, u8 * pval);
785u8 rtw_getrfreg_cmd(struct adapter * padapter, u8 offset, u8 * pval);
786u8 rtw_setrfintfs_cmd(struct adapter *padapter, u8 mode);
787u8 rtw_setrttbl_cmd(struct adapter *padapter, struct setratable_parm *prate_table);
788u8 rtw_getrttbl_cmd(struct adapter *padapter, struct getratable_rsp *pval);
789
790u8 rtw_gettssi_cmd(struct adapter *padapter, u8 offset,u8 *pval);
791u8 rtw_setfwdig_cmd(struct adapter*padapter, u8 type);
792u8 rtw_setfwra_cmd(struct adapter*padapter, u8 type);
793
794u8 rtw_addbareq_cmd(struct adapter*padapter, u8 tid, u8 *addr);
795
796u8 rtw_dynamic_chk_wk_cmd(struct adapter *adapter);
797
798u8 rtw_lps_ctrl_wk_cmd(struct adapter*padapter, u8 lps_ctrl_type, u8 enqueue);
799u8 rtw_rpt_timer_cfg_cmd(struct adapter*padapter, u16 minRptTime);
800
801 u8 rtw_antenna_select_cmd(struct adapter*padapter, u8 antenna,u8 enqueue);
802u8 rtw_ps_cmd(struct adapter*padapter);
803
804#ifdef CONFIG_88EU_AP_MODE
805u8 rtw_chk_hi_queue_cmd(struct adapter*padapter);
806#endif
807
808u8 rtw_set_ch_cmd(struct adapter*padapter, u8 ch, u8 bw, u8 ch_offset, u8 enqueue);
809u8 rtw_set_chplan_cmd(struct adapter*padapter, u8 chplan, u8 enqueue);
810u8 rtw_led_blink_cmd(struct adapter*padapter, struct LED_871x * pLed);
811u8 rtw_set_csa_cmd(struct adapter*padapter, u8 new_ch_no);
812u8 rtw_tdls_cmd(struct adapter *padapter, u8 *addr, u8 option);
813
814u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt);
815
816u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf);
817
818void rtw_survey_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd);
819void rtw_disassoc_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd);
820void rtw_joinbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd);
821void rtw_createbss_cmd_callback(struct adapter *adapt, struct cmd_obj *pcmd);
822void rtw_getbbrfreg_cmdrsp_callback(struct adapter *adapt, struct cmd_obj *cmd);
823void rtw_readtssi_cmdrsp_callback(struct adapter *adapt, struct cmd_obj *cmd);
824
825void rtw_setstaKey_cmdrsp_callback(struct adapter *adapt, struct cmd_obj *cmd);
826void rtw_setassocsta_cmdrsp_callback(struct adapter *adapt, struct cmd_obj *cm);
827void rtw_getrttbl_cmdrsp_callback(struct adapter *adapt, struct cmd_obj *cmd);
828
829struct _cmd_callback {
830 u32 cmd_code;
831 void (*callback)(struct adapter *padapter, struct cmd_obj *cmd);
832};
833
834enum rtw_h2c_cmd {
835 GEN_CMD_CODE(_Read_MACREG), /*0*/
836 GEN_CMD_CODE(_Write_MACREG),
837 GEN_CMD_CODE(_Read_BBREG),
838 GEN_CMD_CODE(_Write_BBREG),
839 GEN_CMD_CODE(_Read_RFREG),
840 GEN_CMD_CODE(_Write_RFREG), /*5*/
841 GEN_CMD_CODE(_Read_EEPROM),
842 GEN_CMD_CODE(_Write_EEPROM),
843 GEN_CMD_CODE(_Read_EFUSE),
844 GEN_CMD_CODE(_Write_EFUSE),
845
846 GEN_CMD_CODE(_Read_CAM), /*10*/
847 GEN_CMD_CODE(_Write_CAM),
848 GEN_CMD_CODE(_setBCNITV),
849 GEN_CMD_CODE(_setMBIDCFG),
850 GEN_CMD_CODE(_JoinBss), /*14*/
851 GEN_CMD_CODE(_DisConnect), /*15*/
852 GEN_CMD_CODE(_CreateBss),
853 GEN_CMD_CODE(_SetOpMode),
854 GEN_CMD_CODE(_SiteSurvey), /*18*/
855 GEN_CMD_CODE(_SetAuth),
856
857 GEN_CMD_CODE(_SetKey), /*20*/
858 GEN_CMD_CODE(_SetStaKey),
859 GEN_CMD_CODE(_SetAssocSta),
860 GEN_CMD_CODE(_DelAssocSta),
861 GEN_CMD_CODE(_SetStaPwrState),
862 GEN_CMD_CODE(_SetBasicRate), /*25*/
863 GEN_CMD_CODE(_GetBasicRate),
864 GEN_CMD_CODE(_SetDataRate),
865 GEN_CMD_CODE(_GetDataRate),
866 GEN_CMD_CODE(_SetPhyInfo),
867
868 GEN_CMD_CODE(_GetPhyInfo), /*30*/
869 GEN_CMD_CODE(_SetPhy),
870 GEN_CMD_CODE(_GetPhy),
871 GEN_CMD_CODE(_readRssi),
872 GEN_CMD_CODE(_readGain),
873 GEN_CMD_CODE(_SetAtim), /*35*/
874 GEN_CMD_CODE(_SetPwrMode),
875 GEN_CMD_CODE(_JoinbssRpt),
876 GEN_CMD_CODE(_SetRaTable),
877 GEN_CMD_CODE(_GetRaTable),
878
879 GEN_CMD_CODE(_GetCCXReport), /*40*/
880 GEN_CMD_CODE(_GetDTMReport),
881 GEN_CMD_CODE(_GetTXRateStatistics),
882 GEN_CMD_CODE(_SetUsbSuspend),
883 GEN_CMD_CODE(_SetH2cLbk),
884 GEN_CMD_CODE(_AddBAReq), /*45*/
885 GEN_CMD_CODE(_SetChannel), /*46*/
886 GEN_CMD_CODE(_SetTxPower),
887 GEN_CMD_CODE(_SwitchAntenna),
888 GEN_CMD_CODE(_SetCrystalCap),
889 GEN_CMD_CODE(_SetSingleCarrierTx), /*50*/
890
891 GEN_CMD_CODE(_SetSingleToneTx),/*51*/
892 GEN_CMD_CODE(_SetCarrierSuppressionTx),
893 GEN_CMD_CODE(_SetContinuousTx),
894 GEN_CMD_CODE(_SwitchBandwidth), /*54*/
895 GEN_CMD_CODE(_TX_Beacon), /*55*/
896
897 GEN_CMD_CODE(_Set_MLME_EVT), /*56*/
898 GEN_CMD_CODE(_Set_Drv_Extra), /*57*/
899 GEN_CMD_CODE(_Set_H2C_MSG), /*58*/
900
901 GEN_CMD_CODE(_SetChannelPlan), /*59*/
902 GEN_CMD_CODE(_LedBlink), /*60*/
903
904 GEN_CMD_CODE(_SetChannelSwitch), /*61*/
905 GEN_CMD_CODE(_TDLS), /*62*/
906
907 MAX_H2CCMD
908};
909
910#define _GetBBReg_CMD_ _Read_BBREG_CMD_
911#define _SetBBReg_CMD_ _Write_BBREG_CMD_
912#define _GetRFReg_CMD_ _Read_RFREG_CMD_
913#define _SetRFReg_CMD_ _Write_RFREG_CMD_
914
915#ifdef _RTW_CMD_C_
916static struct _cmd_callback rtw_cmd_callback[] =
917{
918 {GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/
919 {GEN_CMD_CODE(_Write_MACREG), NULL},
920 {GEN_CMD_CODE(_Read_BBREG), &rtw_getbbrfreg_cmdrsp_callback},
921 {GEN_CMD_CODE(_Write_BBREG), NULL},
922 {GEN_CMD_CODE(_Read_RFREG), &rtw_getbbrfreg_cmdrsp_callback},
923 {GEN_CMD_CODE(_Write_RFREG), NULL}, /*5*/
924 {GEN_CMD_CODE(_Read_EEPROM), NULL},
925 {GEN_CMD_CODE(_Write_EEPROM), NULL},
926 {GEN_CMD_CODE(_Read_EFUSE), NULL},
927 {GEN_CMD_CODE(_Write_EFUSE), NULL},
928
929 {GEN_CMD_CODE(_Read_CAM), NULL}, /*10*/
930 {GEN_CMD_CODE(_Write_CAM), NULL},
931 {GEN_CMD_CODE(_setBCNITV), NULL},
932 {GEN_CMD_CODE(_setMBIDCFG), NULL},
933 {GEN_CMD_CODE(_JoinBss), &rtw_joinbss_cmd_callback}, /*14*/
934 {GEN_CMD_CODE(_DisConnect), &rtw_disassoc_cmd_callback}, /*15*/
935 {GEN_CMD_CODE(_CreateBss), &rtw_createbss_cmd_callback},
936 {GEN_CMD_CODE(_SetOpMode), NULL},
937 {GEN_CMD_CODE(_SiteSurvey), &rtw_survey_cmd_callback}, /*18*/
938 {GEN_CMD_CODE(_SetAuth), NULL},
939
940 {GEN_CMD_CODE(_SetKey), NULL}, /*20*/
941 {GEN_CMD_CODE(_SetStaKey), &rtw_setstaKey_cmdrsp_callback},
942 {GEN_CMD_CODE(_SetAssocSta), &rtw_setassocsta_cmdrsp_callback},
943 {GEN_CMD_CODE(_DelAssocSta), NULL},
944 {GEN_CMD_CODE(_SetStaPwrState), NULL},
945 {GEN_CMD_CODE(_SetBasicRate), NULL}, /*25*/
946 {GEN_CMD_CODE(_GetBasicRate), NULL},
947 {GEN_CMD_CODE(_SetDataRate), NULL},
948 {GEN_CMD_CODE(_GetDataRate), NULL},
949 {GEN_CMD_CODE(_SetPhyInfo), NULL},
950
951 {GEN_CMD_CODE(_GetPhyInfo), NULL}, /*30*/
952 {GEN_CMD_CODE(_SetPhy), NULL},
953 {GEN_CMD_CODE(_GetPhy), NULL},
954 {GEN_CMD_CODE(_readRssi), NULL},
955 {GEN_CMD_CODE(_readGain), NULL},
956 {GEN_CMD_CODE(_SetAtim), NULL}, /*35*/
957 {GEN_CMD_CODE(_SetPwrMode), NULL},
958 {GEN_CMD_CODE(_JoinbssRpt), NULL},
959 {GEN_CMD_CODE(_SetRaTable), NULL},
960 {GEN_CMD_CODE(_GetRaTable), NULL},
961
962 {GEN_CMD_CODE(_GetCCXReport), NULL}, /*40*/
963 {GEN_CMD_CODE(_GetDTMReport), NULL},
964 {GEN_CMD_CODE(_GetTXRateStatistics), NULL},
965 {GEN_CMD_CODE(_SetUsbSuspend), NULL},
966 {GEN_CMD_CODE(_SetH2cLbk), NULL},
967 {GEN_CMD_CODE(_AddBAReq), NULL}, /*45*/
968 {GEN_CMD_CODE(_SetChannel), NULL}, /*46*/
969 {GEN_CMD_CODE(_SetTxPower), NULL},
970 {GEN_CMD_CODE(_SwitchAntenna), NULL},
971 {GEN_CMD_CODE(_SetCrystalCap), NULL},
972 {GEN_CMD_CODE(_SetSingleCarrierTx), NULL}, /*50*/
973
974 {GEN_CMD_CODE(_SetSingleToneTx), NULL}, /*51*/
975 {GEN_CMD_CODE(_SetCarrierSuppressionTx), NULL},
976 {GEN_CMD_CODE(_SetContinuousTx), NULL},
977 {GEN_CMD_CODE(_SwitchBandwidth), NULL}, /*54*/
978 {GEN_CMD_CODE(_TX_Beacon), NULL},/*55*/
979
980 {GEN_CMD_CODE(_Set_MLME_EVT), NULL},/*56*/
981 {GEN_CMD_CODE(_Set_Drv_Extra), NULL},/*57*/
982 {GEN_CMD_CODE(_Set_H2C_MSG), NULL},/*58*/
983 {GEN_CMD_CODE(_SetChannelPlan), NULL},/*59*/
984 {GEN_CMD_CODE(_LedBlink), NULL},/*60*/
985
986 {GEN_CMD_CODE(_SetChannelSwitch), NULL},/*61*/
987 {GEN_CMD_CODE(_TDLS), NULL},/*62*/
988};
989#endif
990
991#endif /* _CMD_H_ */
This page took 0.101371 seconds and 5 git commands to generate.