rtl8188e_cmd.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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 __RTL8188E_CMD_H__
  21. #define __RTL8188E_CMD_H__
  22. #if 0
  23. enum cmd_msg_element_id
  24. {
  25. NONE_CMDMSG_EID,
  26. AP_OFFLOAD_EID = 0,
  27. SET_PWRMODE_EID = 1,
  28. JOINBSS_RPT_EID = 2,
  29. RSVD_PAGE_EID = 3,
  30. RSSI_4_EID = 4,
  31. RSSI_SETTING_EID = 5,
  32. MACID_CONFIG_EID = 6,
  33. MACID_PS_MODE_EID = 7,
  34. P2P_PS_OFFLOAD_EID = 8,
  35. SELECTIVE_SUSPEND_ROF_CMD = 9,
  36. P2P_PS_CTW_CMD_EID = 32,
  37. MAX_CMDMSG_EID
  38. };
  39. #else
  40. typedef enum _RTL8188E_H2C_CMD_ID
  41. {
  42. //Class Common
  43. H2C_COM_RSVD_PAGE =0x00,
  44. H2C_COM_MEDIA_STATUS_RPT =0x01,
  45. H2C_COM_SCAN =0x02,
  46. H2C_COM_KEEP_ALIVE =0x03,
  47. H2C_COM_DISCNT_DECISION =0x04,
  48. #ifndef CONFIG_WOWLAN
  49. H2C_COM_WWLAN =0x05,
  50. #endif
  51. H2C_COM_INIT_OFFLOAD =0x06,
  52. H2C_COM_REMOTE_WAKE_CTL =0x07,
  53. H2C_COM_AP_OFFLOAD =0x08,
  54. H2C_COM_BCN_RSVD_PAGE =0x09,
  55. H2C_COM_PROB_RSP_RSVD_PAGE =0x0A,
  56. //Class PS
  57. H2C_PS_PWR_MODE =0x20,
  58. H2C_PS_TUNE_PARA =0x21,
  59. H2C_PS_TUNE_PARA_2 =0x22,
  60. H2C_PS_LPS_PARA =0x23,
  61. H2C_PS_P2P_OFFLOAD =0x24,
  62. //Class DM
  63. H2C_DM_MACID_CFG =0x40,
  64. H2C_DM_TXBF =0x41,
  65. //Class BT
  66. H2C_BT_COEX_MASK =0x60,
  67. H2C_BT_COEX_GPIO_MODE =0x61,
  68. H2C_BT_DAC_SWING_VAL =0x62,
  69. H2C_BT_PSD_RST =0x63,
  70. //Class Remote WakeUp
  71. #ifdef CONFIG_WOWLAN
  72. H2C_COM_WWLAN =0x80,
  73. H2C_COM_REMOTE_WAKE_CTRL =0x81,
  74. #endif
  75. //Class
  76. H2C_RESET_TSF =0xc0,
  77. }RTL8188E_H2C_CMD_ID;
  78. #endif
  79. struct cmd_msg_parm {
  80. u8 eid; //element id
  81. u8 sz; // sz
  82. u8 buf[6];
  83. };
  84. enum{
  85. PWRS
  86. };
  87. typedef struct _SETPWRMODE_PARM {
  88. u8 Mode;//0:Active,1:LPS,2:WMMPS
  89. //u8 RLBM:4;//0:Min,1:Max,2: User define
  90. u8 SmartPS_RLBM;//LPS=0:PS_Poll,1:PS_Poll,2:NullData,WMM=0:PS_Poll,1:NullData
  91. u8 AwakeInterval; // unit: beacon interval
  92. u8 bAllQueueUAPSD;
  93. u8 PwrState;//AllON(0x0c),RFON(0x04),RFOFF(0x00)
  94. } SETPWRMODE_PARM, *PSETPWRMODE_PARM;
  95. struct H2C_SS_RFOFF_PARAM{
  96. u8 ROFOn; // 1: on, 0:off
  97. u16 gpio_period; // unit: 1024 us
  98. }__attribute__ ((packed));
  99. typedef struct JOINBSSRPT_PARM_88E{
  100. u8 OpMode; // RT_MEDIA_STATUS
  101. #ifdef CONFIG_WOWLAN
  102. u8 MacID; // MACID
  103. #endif //CONFIG_WOWLAN
  104. }JOINBSSRPT_PARM_88E, *PJOINBSSRPT_PARM_88E;
  105. typedef struct _RSVDPAGE_LOC_88E {
  106. u8 LocProbeRsp;
  107. u8 LocPsPoll;
  108. u8 LocNullData;
  109. u8 LocQosNull;
  110. u8 LocBTQosNull;
  111. } RSVDPAGE_LOC_88E, *PRSVDPAGE_LOC_88E;
  112. // host message to firmware cmd
  113. void rtl8188e_set_FwPwrMode_cmd(PADAPTER padapter, u8 Mode);
  114. void rtl8188e_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus);
  115. u8 rtl8188e_set_rssi_cmd(PADAPTER padapter, u8 *param);
  116. u8 rtl8188e_set_raid_cmd(PADAPTER padapter, u32 mask);
  117. void rtl8188e_Add_RateATid(PADAPTER padapter, u32 bitmap, u8* arg, u8 rssi_level);
  118. //u8 rtl8192c_set_FwSelectSuspend_cmd(PADAPTER padapter, u8 bfwpoll, u16 period);
  119. #ifdef CONFIG_P2P
  120. void rtl8188e_set_p2p_ps_offload_cmd(PADAPTER padapter, u8 p2p_ps_state);
  121. #endif //CONFIG_P2P
  122. void CheckFwRsvdPageContent(PADAPTER padapter);
  123. void rtl8188e_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 rtl8188es_set_wowlan_cmd(_adapter* padapter, u8 enable);
  149. void SetFwRelatedForWoWLAN8188ES(_adapter* padapter, u8 bHostIsGoingtoSleep);
  150. #endif//CONFIG_WOWLAN
  151. #endif//__RTL8188E_CMD_H__