rtl8812a_cmd.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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 __RTL8812A_CMD_H__
  21. #define __RTL8812A_CMD_H__
  22. typedef enum _RTL8812_H2C_CMD
  23. {
  24. H2C_8812_RSVDPAGE = 0,
  25. H2C_8812_MSRRPT = 1,
  26. H2C_8812_SCAN = 2,
  27. H2C_8812_KEEP_ALIVE_CTRL = 3,
  28. H2C_8812_DISCONNECT_DECISION = 4,
  29. H2C_8812_INIT_OFFLOAD = 6,
  30. H2C_8812_AP_OFFLOAD = 8,
  31. H2C_8812_BCN_RSVDPAGE = 9,
  32. H2C_8812_PROBERSP_RSVDPAGE = 10,
  33. H2C_8812_SETPWRMODE = 0x20,
  34. H2C_8812_PS_TUNING_PARA = 0x21,
  35. H2C_8812_PS_TUNING_PARA2 = 0x22,
  36. H2C_8812_PS_LPS_PARA = 0x23,
  37. H2C_8812_P2P_PS_OFFLOAD = 0x24,
  38. H2C_8812_RA_MASK = 0x40,
  39. H2C_8812_RSSI_REPORT = 0x42,
  40. H2C_8812_WO_WLAN = 0x80,
  41. H2C_8812_REMOTE_WAKE_CTRL = 0x81,
  42. H2C_8812_AOAC_GLOBAL_INFO = 0x82,
  43. H2C_8812_AOAC_RSVDPAGE = 0x83,
  44. H2C_8812_TSF_RESET = 0xC0,
  45. MAX_8812_H2CCMD
  46. }RTL8812_H2C_CMD;
  47. typedef enum _RTL8812_C2H_EVT
  48. {
  49. C2H_8812_DBG = 0,
  50. C2H_8812_LB = 1,
  51. C2H_8812_TXBF = 2,
  52. C2H_8812_TX_REPORT = 3,
  53. C2H_8812_BT_INFO = 9,
  54. C2H_8812_BT_MP = 11,
  55. C2H_8812_RA_RPT=12,
  56. C2H_8812_FW_SWCHNL = 0x10,
  57. C2H_8812_IQK_FINISH = 0x11,
  58. MAX_8812_C2HEVENT
  59. }RTL8812_C2H_EVT;
  60. struct cmd_msg_parm {
  61. u8 eid; //element id
  62. u8 sz; // sz
  63. u8 buf[6];
  64. };
  65. enum{
  66. PWRS
  67. };
  68. struct H2C_SS_RFOFF_PARAM{
  69. u8 ROFOn; // 1: on, 0:off
  70. u16 gpio_period; // unit: 1024 us
  71. }__attribute__ ((packed));
  72. //_RSVDPAGE_LOC_CMD0
  73. #define SET_8812_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  74. #define SET_8812_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value)
  75. #define SET_8812_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value)
  76. #define SET_8812_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value)
  77. #define SET_8812_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value)
  78. //_MEDIA_STATUS_RPT_PARM_CMD1
  79. #define SET_8812_H2CCMD_MSRRPT_PARM_OPMODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
  80. #define SET_8812_H2CCMD_MSRRPT_PARM_MACID_IND(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
  81. #define SET_8812_H2CCMD_MSRRPT_PARM_MACID(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value)
  82. #define SET_8812_H2CCMD_MSRRPT_PARM_MACID_END(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 0, 8, __Value)
  83. //_SETPWRMODE_PARM
  84. #define SET_8812_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  85. #define SET_8812_H2CCMD_PWRMODE_PARM_RLBM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 4, __Value)
  86. #define SET_8812_H2CCMD_PWRMODE_PARM_SMART_PS(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 4, 4, __Value)
  87. #define SET_8812_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value)
  88. #define SET_8812_H2CCMD_PWRMODE_PARM_ALL_QUEUE_UAPSD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value)
  89. #define SET_8812_H2CCMD_PWRMODE_PARM_PWR_STATE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value)
  90. #define GET_8812_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd) LE_BITS_TO_1BYTE(__pH2CCmd, 0, 8)
  91. //_P2P_PS_OFFLOAD
  92. #define SET_8812_H2CCMD_P2P_PS_OFFLOAD_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
  93. #define SET_8812_H2CCMD_P2P_PS_OFFLOAD_ROLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
  94. #define SET_8812_H2CCMD_P2P_PS_OFFLOAD_CTWINDOW_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value)
  95. #define SET_8812_H2CCMD_P2P_PS_OFFLOAD_NOA0_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value)
  96. #define SET_8812_H2CCMD_P2P_PS_OFFLOAD_NOA1_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value)
  97. #define SET_8812_H2CCMD_P2P_PS_OFFLOAD_ALLSTASLEEP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value)
  98. #define SET_8812_H2CCMD_P2P_PS_OFFLOAD_DISCOVERY(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 6, 1, __Value)
  99. void Set_RA_LDPC_8812(struct sta_info *psta, BOOLEAN bLDPC);
  100. // host message to firmware cmd
  101. void rtl8812_set_FwPwrMode_cmd(PADAPTER padapter, u8 PSMode);
  102. void rtl8812_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus);
  103. u8 rtl8812_set_rssi_cmd(PADAPTER padapter, u8 *param);
  104. void rtl8812_set_raid_cmd(PADAPTER padapter, u32 bitmap, u8* arg);
  105. void rtl8812_Add_RateATid(PADAPTER padapter, u32 bitmap, u8* arg, u8 rssi_level);
  106. #ifdef CONFIG_P2P_PS
  107. void rtl8812_set_p2p_ps_offload_cmd(PADAPTER padapter, u8 p2p_ps_state);
  108. #endif //CONFIG_P2P
  109. void CheckFwRsvdPageContent(PADAPTER padapter);
  110. void rtl8812_set_FwMediaStatus_cmd(PADAPTER padapter, u16 mstatus_rpt );
  111. #ifdef CONFIG_TSF_RESET_OFFLOAD
  112. int reset_tsf(PADAPTER Adapter, u8 reset_port );
  113. #endif // CONFIG_TSF_RESET_OFFLOAD
  114. #ifdef CONFIG_WOWLAN
  115. typedef struct _SETWOWLAN_PARM{
  116. u8 mode;
  117. u8 gpio_index;
  118. u8 gpio_duration;
  119. u8 second_mode;
  120. u8 reserve;
  121. }SETWOWLAN_PARM, *PSETWOWLAN_PARM;
  122. #define FW_WOWLAN_FUN_EN BIT(0)
  123. #define FW_WOWLAN_PATTERN_MATCH BIT(1)
  124. #define FW_WOWLAN_MAGIC_PKT BIT(2)
  125. #define FW_WOWLAN_UNICAST BIT(3)
  126. #define FW_WOWLAN_ALL_PKT_DROP BIT(4)
  127. #define FW_WOWLAN_GPIO_ACTIVE BIT(5)
  128. #define FW_WOWLAN_REKEY_WAKEUP BIT(6)
  129. #define FW_WOWLAN_DEAUTH_WAKEUP BIT(7)
  130. #define FW_WOWLAN_GPIO_WAKEUP_EN BIT(0)
  131. #define FW_FW_PARSE_MAGIC_PKT BIT(1)
  132. #define FW_REMOTE_WAKE_CTRL_EN BIT(0)
  133. #define FW_REALWOWLAN_EN BIT(5)
  134. void rtl8812a_set_wowlan_cmd(_adapter* padapter, u8 enable);
  135. void SetFwRelatedForWoWLAN8812(_adapter* padapter, u8 bHostIsGoingtoSleep);
  136. #endif//CONFIG_WOWLAN
  137. #endif//__RTL8188E_CMD_H__