rtw_cmd.h 29 KB

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