rtl8192e_cmd.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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 __RTL8192E_CMD_H__
  21. #define __RTL8192E_CMD_H__
  22. typedef enum _RTL8192E_H2C_CMD
  23. {
  24. H2C_8192E_RSVDPAGE = 0,
  25. H2C_8192E_MSRRPT = 1,
  26. H2C_8192E_SCAN = 2,
  27. H2C_8192E_KEEP_ALIVE_CTRL = 3,
  28. H2C_8192E_DISCONNECT_DECISION = 4,
  29. H2C_8192E_INIT_OFFLOAD = 6,
  30. H2C_8192E_AP_OFFLOAD = 8,
  31. H2C_8192E_BCN_RSVDPAGE = 9,
  32. H2C_8192E_PROBERSP_RSVDPAGE = 10,
  33. H2C_8192E_SETPWRMODE = 0x20,
  34. H2C_8192E_PS_TUNING_PARA = 0x21,
  35. H2C_8192E_PS_TUNING_PARA2 = 0x22,
  36. H2C_8192E_PS_LPS_PARA = 0x23,
  37. H2C_8192E_P2P_PS_OFFLOAD = 0x24,
  38. H2C_8192E_RA_MASK = 0x40,
  39. H2C_8192E_RSSI_REPORT = 0x42,
  40. H2C_8192E_WO_WLAN = 0x80,
  41. H2C_8192E_REMOTE_WAKE_CTRL = 0x81,
  42. H2C_8192E_AOAC_GLOBAL_INFO = 0x82,
  43. H2C_8192E_AOAC_RSVDPAGE = 0x83,
  44. //Not defined in new 88E H2C CMD Format
  45. H2C_8192E_SELECTIVE_SUSPEND_ROF_CMD,
  46. H2C_8192E_P2P_PS_MODE,
  47. H2C_8192E_PSD_RESULT,
  48. MAX_8192E_H2CCMD
  49. }RTL8192E_H2C_CMD;
  50. typedef enum _RTL8192E_C2H_EVT
  51. {
  52. C2H_8192E_DBG = 0,
  53. C2H_8192E_LB = 1,
  54. C2H_8192E_TXBF = 2,
  55. C2H_8192E_TX_REPORT = 3,
  56. C2H_8192E_BT_INFO = 9,
  57. C2H_8192E_FW_SWCHNL = 0x10,
  58. C2H_8192E_BT_MP = 11,
  59. C2H_8192E_RA_RPT=12,
  60. MAX_8192E_C2HEVENT
  61. }RTL8192E_C2H_EVT;
  62. struct cmd_msg_parm {
  63. u8 eid; //element id
  64. u8 sz; // sz
  65. u8 buf[6];
  66. };
  67. enum{
  68. PWRS
  69. };
  70. typedef struct _SETPWRMODE_PARM {
  71. u8 Mode;//0:Active,1:LPS,2:WMMPS
  72. //u8 RLBM:4;//0:Min,1:Max,2: User define
  73. u8 SmartPS_RLBM;//LPS=0:PS_Poll,1:PS_Poll,2:NullData,WMM=0:PS_Poll,1:NullData
  74. u8 AwakeInterval; // unit: beacon interval
  75. u8 bAllQueueUAPSD;
  76. u8 PwrState;//AllON(0x0c),RFON(0x04),RFOFF(0x00)
  77. } SETPWRMODE_PARM, *PSETPWRMODE_PARM;
  78. struct H2C_SS_RFOFF_PARAM{
  79. u8 ROFOn; // 1: on, 0:off
  80. u16 gpio_period; // unit: 1024 us
  81. }__attribute__ ((packed));
  82. typedef struct JOINBSSRPT_PARM_92E{
  83. u8 OpMode; // RT_MEDIA_STATUS
  84. #ifdef CONFIG_WOWLAN
  85. u8 MacID; // MACID
  86. #endif //CONFIG_WOWLAN
  87. }JOINBSSRPT_PARM_92E, *PJOINBSSRPT_PARM_92E;
  88. typedef struct _RSVDPAGE_LOC_92E {
  89. u8 LocProbeRsp;
  90. u8 LocPsPoll;
  91. u8 LocNullData;
  92. u8 LocQosNull;
  93. u8 LocBTQosNull;
  94. } RSVDPAGE_LOC_92E, *PRSVDPAGE_LOC_92E;
  95. //_SETPWRMODE_PARM
  96. #define SET_8192E_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  97. #define SET_8192E_H2CCMD_PWRMODE_PARM_RLBM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 4, __Value)
  98. #define SET_8192E_H2CCMD_PWRMODE_PARM_SMART_PS(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 4, 4, __Value)
  99. #define SET_8192E_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value)
  100. #define SET_8192E_H2CCMD_PWRMODE_PARM_ALL_QUEUE_UAPSD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value)
  101. #define SET_8192E_H2CCMD_PWRMODE_PARM_PWR_STATE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value)
  102. #define SET_8192E_H2CCMD_PWRMODE_PARM_BYTE5(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+5, 0, 8, __Value)
  103. #define GET_8192E_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd) LE_BITS_TO_1BYTE(__pH2CCmd, 0, 8)
  104. //_P2P_PS_OFFLOAD
  105. #define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
  106. #define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_ROLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
  107. #define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_CTWINDOW_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value)
  108. #define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_NOA0_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value)
  109. #define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_NOA1_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value)
  110. #define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_ALLSTASLEEP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value)
  111. // host message to firmware cmd
  112. void rtl8192e_set_FwPwrMode_cmd(PADAPTER padapter, u8 Mode);
  113. void rtl8192e_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus);
  114. u8 rtl8192e_set_rssi_cmd(PADAPTER padapter, u8 *param);
  115. void rtl8192e_set_raid_cmd(PADAPTER padapter, u32 bitmap, u8* arg);
  116. void rtl8192e_Add_RateATid(PADAPTER padapter, u32 bitmap, u8 *arg, u8 rssi_level);
  117. //u8 rtl8192c_set_FwSelectSuspend_cmd(PADAPTER padapter, u8 bfwpoll, u16 period);
  118. #ifdef CONFIG_P2P_PS
  119. void rtl8192e_set_p2p_ps_offload_cmd(PADAPTER padapter, u8 p2p_ps_state);
  120. //void rtl8723a_set_p2p_ps_offload_cmd(PADAPTER padapter, u8 p2p_ps_state);
  121. #endif //CONFIG_P2P
  122. void CheckFwRsvdPageContent(PADAPTER padapter);
  123. void rtl8192e_set_FwMediaStatus_cmd(PADAPTER padapter, u16 mstatus_rpt );
  124. #ifdef CONFIG_TSF_RESET_OFFLOAD
  125. //u8 rtl8188e_reset_tsf(_adapter *padapter, u8 reset_port);
  126. int reset_tsf(PADAPTER Adapter, u8 reset_port );
  127. #endif // CONFIG_TSF_RESET_OFFLOAD
  128. #ifdef CONFIG_WOWLAN
  129. typedef struct _SETWOWLAN_PARM{
  130. u8 mode;
  131. u8 gpio_index;
  132. u8 gpio_duration;
  133. u8 second_mode;
  134. u8 reserve;
  135. }SETWOWLAN_PARM, *PSETWOWLAN_PARM;
  136. #define FW_WOWLAN_FUN_EN BIT(0)
  137. #define FW_WOWLAN_PATTERN_MATCH BIT(1)
  138. #define FW_WOWLAN_MAGIC_PKT BIT(2)
  139. #define FW_WOWLAN_UNICAST BIT(3)
  140. #define FW_WOWLAN_ALL_PKT_DROP BIT(4)
  141. #define FW_WOWLAN_GPIO_ACTIVE BIT(5)
  142. #define FW_WOWLAN_REKEY_WAKEUP BIT(6)
  143. #define FW_WOWLAN_DEAUTH_WAKEUP BIT(7)
  144. #define FW_WOWLAN_GPIO_WAKEUP_EN BIT(0)
  145. #define FW_FW_PARSE_MAGIC_PKT BIT(1)
  146. #define FW_REMOTE_WAKE_CTRL_EN BIT(0)
  147. #define FW_REALWOWLAN_EN BIT(5)
  148. void rtl8192e_set_wowlan_cmd(_adapter* padapter, u8 enable);
  149. void SetFwRelatedForWoWLAN8192E(_adapter* padapter, u8 bHostIsGoingtoSleep);
  150. #endif//CONFIG_WOWLAN
  151. void C2HContentParsing8192E(
  152. IN PADAPTER Adapter,
  153. IN u1Byte c2hCmdId,
  154. IN u1Byte c2hCmdLen,
  155. IN pu1Byte tmpBuf
  156. );
  157. VOID
  158. C2HPacketHandler_8192E(
  159. IN PADAPTER Adapter,
  160. IN pu1Byte Buffer,
  161. IN u1Byte Length
  162. );
  163. #endif//__RTL8188E_CMD_H__