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