rtl8723b_cmd.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2012 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 __RTL8723B_CMD_H__
  21. #define __RTL8723B_CMD_H__
  22. //---------------------------------------------------------------------------------------------------------//
  23. //---------------------------------- H2C CMD DEFINITION ------------------------------------------------//
  24. //---------------------------------------------------------------------------------------------------------//
  25. enum h2c_cmd_8723B{
  26. //Common Class: 000
  27. H2C_8723B_RSVD_PAGE = 0x00,
  28. H2C_8723B_MEDIA_STATUS_RPT = 0x01,
  29. H2C_8723B_SCAN_ENABLE = 0x02,
  30. H2C_8723B_KEEP_ALIVE = 0x03,
  31. H2C_8723B_DISCON_DECISION = 0x04,
  32. H2C_8723B_PSD_OFFLOAD = 0x05,
  33. H2C_8723B_AP_OFFLOAD = 0x08,
  34. H2C_8723B_BCN_RSVDPAGE = 0x09,
  35. H2C_8723B_PROBERSP_RSVDPAGE = 0x0A,
  36. H2C_8723B_FCS_RSVDPAGE = 0x10,
  37. H2C_8723B_FCS_INFO = 0x11,
  38. //PoweSave Class: 001
  39. H2C_8723B_SET_PWR_MODE = 0x20,
  40. H2C_8723B_PS_TUNING_PARA = 0x21,
  41. H2C_8723B_PS_TUNING_PARA2 = 0x22,
  42. H2C_8723B_P2P_LPS_PARAM = 0x23,
  43. H2C_8723B_P2P_PS_OFFLOAD = 0x24,
  44. H2C_8723B_PS_SCAN_ENABLE = 0x25,
  45. H2C_8723B_SAP_PS_ = 0x26,
  46. //Dynamic Mechanism Class: 010
  47. H2C_8723B_MACID_CFG = 0x40,
  48. H2C_8723B_TXBF = 0x41,
  49. H2C_8723B_RSSI_SETTING = 0x42,
  50. H2C_8723B_AP_REQ_TXRPT = 0x43,
  51. H2C_8723B_INIT_RATE_COLLECT = 0x44,
  52. //BT Class: 011
  53. H2C_8723B_B_TYPE_TDMA = 0x60,
  54. H2C_8723B_BT_INFO = 0x61,
  55. H2C_8723B_FORCE_BT_TXPWR = 0x62,
  56. H2C_8723B_BT_IGNORE_WLANACT = 0x63,
  57. H2C_8723B_DAC_SWING_VALUE = 0x64,
  58. H2C_8723B_ANT_SEL_RSV = 0x65,
  59. H2C_8723B_WL_OPMODE = 0x66,
  60. H2C_8723B_BT_MP_OPER = 0x67,
  61. H2C_8723B_BT_CONTROL = 0x68,
  62. H2C_8723B_BT_WIFI_CTRL = 0x69,
  63. H2C_8723B_BT_FW_PATCH = 0x6A,
  64. //WOWLAN Class: 100
  65. H2C_8723B_WOWLAN = 0x80,
  66. H2C_8723B_REMOTE_WAKE_CTRL = 0x81,
  67. H2C_8723B_AOAC_GLOBAL_INFO = 0x82,
  68. H2C_8723B_AOAC_RSVD_PAGE = 0x83,
  69. H2C_8723B_AOAC_RSVD_PAGE2 = 0x84,
  70. H2C_8723B_D0_SCAN_OFFLOAD_INFO = 0x85,
  71. H2C_8723B_D0_SCAN_OFFLOAD_CTRL = 0x86,
  72. H2C_8723B_CHNL_SWITCH_OFFLOAD = 0x87,
  73. H2C_8723B_RESET_TSF = 0xC0,
  74. H2C_8723B_MAXID,
  75. };
  76. #define H2C_8723B_RSVDPAGE_LOC_LEN 5
  77. #define H2C_8723B_MEDIA_STATUS_RPT_LEN 3
  78. #define H2C_8723B_KEEP_ALIVE_CTRL_LEN 2
  79. #define H2C_8723B_DISCON_DECISION_LEN 3
  80. //#define H2C_8723B_AP_OFFLOAD_LEN 3
  81. #define H2C_8723B_PWRMODE_LEN 6
  82. #define H2C_8723B_PSTUNEPARAM_LEN 4
  83. #define H2C_8723B_MACID_CFG_LEN 7
  84. #define H2C_8723B_BTMP_OPER_LEN 4
  85. #define H2C_8723B_WOWLAN_LEN 3
  86. #define H2C_8723B_REMOTE_WAKE_CTRL_LEN 1
  87. #define H2C_8723B_AOAC_GLOBAL_INFO_LEN 2
  88. #define H2C_8723B_AOAC_RSVDPAGE_LOC_LEN 7
  89. //#define H2C_8723B_SCAN_OFFLOAD_CTRL_LEN 4
  90. #define H2C_8723B_BT_FW_PATCH_LEN 6
  91. #define H2C_8723B_RSSI_SETTING_LEN 4
  92. #define H2C_8723B_AP_REQ_TXRPT_LEN 2
  93. #define H2C_8723B_FORCE_BT_TXPWR_LEN 3
  94. #ifdef CONFIG_WOWLAN_8723
  95. #define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 )
  96. #define cpMacAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3],(des)[4]=(src)[4],(des)[5]=(src)[5])
  97. #define cpIpAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3])
  98. //
  99. // ARP packet
  100. //
  101. // LLC Header
  102. #define GET_ARP_PKT_LLC_TYPE(__pHeader) ReadEF2Byte( ((u8*)(__pHeader)) + 6)
  103. //ARP element
  104. #define GET_ARP_PKT_OPERATION(__pHeader) ReadEF2Byte( ((u8*)(__pHeader)) + 6)
  105. #define GET_ARP_PKT_SENDER_MAC_ADDR(__pHeader, _val) cpMacAddr((u8*)(_val), ((u8*)(__pHeader))+8)
  106. #define GET_ARP_PKT_SENDER_IP_ADDR(__pHeader, _val) cpIpAddr((u8*)(_val), ((u8*)(__pHeader))+14)
  107. #define GET_ARP_PKT_TARGET_MAC_ADDR(__pHeader, _val) cpMacAddr((u8*)(_val), ((u8*)(__pHeader))+18)
  108. #define SET_ARP_PKT_HW(__pHeader, __Value) WriteEF2Byte( ((u8*)(__pHeader)) + 0, __Value)
  109. #define SET_ARP_PKT_PROTOCOL(__pHeader, __Value) WriteEF2Byte( ((u8*)(__pHeader)) + 2, __Value)
  110. #define SET_ARP_PKT_HW_ADDR_LEN(__pHeader, __Value) WriteEF1Byte( ((u8*)(__pHeader)) + 4, __Value)
  111. #define SET_ARP_PKT_PROTOCOL_ADDR_LEN(__pHeader, __Value) WriteEF1Byte( ((u8*)(__pHeader)) + 5, __Value)
  112. #define SET_ARP_PKT_OPERATION(__pHeader, __Value) WriteEF2Byte( ((u8*)(__pHeader)) + 6, __Value)
  113. #define SET_ARP_PKT_SENDER_MAC_ADDR(__pHeader, _val) cpMacAddr(((u8*)(__pHeader))+8, (u8*)(_val))
  114. #define SET_ARP_PKT_SENDER_IP_ADDR(__pHeader, _val) cpIpAddr(((u8*)(__pHeader))+14, (u8*)(_val))
  115. #define SET_ARP_PKT_TARGET_MAC_ADDR(__pHeader, _val) cpMacAddr(((u8*)(__pHeader))+18, (u8*)(_val))
  116. #define SET_ARP_PKT_TARGET_IP_ADDR(__pHeader, _val) cpIpAddr(((u8*)(__pHeader))+24, (u8*)(_val))
  117. #define FW_WOWLAN_FUN_EN BIT(0)
  118. #define FW_WOWLAN_PATTERN_MATCH BIT(1)
  119. #define FW_WOWLAN_MAGIC_PKT BIT(2)
  120. #define FW_WOWLAN_UNICAST BIT(3)
  121. #define FW_WOWLAN_ALL_PKT_DROP BIT(4)
  122. #define FW_WOWLAN_GPIO_ACTIVE BIT(5)
  123. #define FW_WOWLAN_REKEY_WAKEUP BIT(6)
  124. #define FW_WOWLAN_DEAUTH_WAKEUP BIT(7)
  125. #define FW_WOWLAN_GPIO_WAKEUP_EN BIT(0)
  126. #define FW_FW_PARSE_MAGIC_PKT BIT(1)
  127. #define FW_REMOTE_WAKE_CTRL_EN BIT(0)
  128. #define FW_REALWOWLAN_EN BIT(5)
  129. #endif //CONFIG_WOWLAN_8723
  130. //---------------------------------------------------------------------------------------------------------//
  131. //---------------------------------- H2C CMD CONTENT --------------------------------------------------//
  132. //---------------------------------------------------------------------------------------------------------//
  133. //_RSVDPAGE_LOC_CMD_0x00
  134. #define SET_8723B_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  135. #define SET_8723B_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value)
  136. #define SET_8723B_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value)
  137. #define SET_8723B_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value)
  138. #define SET_8723B_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value)
  139. //_MEDIA_STATUS_RPT_PARM_CMD_0x01
  140. #define SET_8723B_H2CCMD_MSRRPT_PARM_OPMODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
  141. #define SET_8723B_H2CCMD_MSRRPT_PARM_MACID_IND(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
  142. #define SET_8723B_H2CCMD_MSRRPT_PARM_MACID(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value)
  143. #define SET_8723B_H2CCMD_MSRRPT_PARM_MACID_END(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 0, 8, __Value)
  144. //_KEEP_ALIVE_CMD_0x03
  145. #define SET_8723B_H2CCMD_KEEPALIVE_PARM_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
  146. #define SET_8723B_H2CCMD_KEEPALIVE_PARM_ADOPT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
  147. #define SET_8723B_H2CCMD_KEEPALIVE_PARM_CHECK_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value)
  148. //_DISCONNECT_DECISION_CMD_0x04
  149. #define SET_8723B_H2CCMD_DISCONDECISION_PARM_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
  150. #define SET_8723B_H2CCMD_DISCONDECISION_PARM_ADOPT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
  151. #define SET_8723B_H2CCMD_DISCONDECISION_PARM_CHECK_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value)
  152. #define SET_8723B_H2CCMD_DISCONDECISION_PARM_TRY_PKT_NUM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 0, 8, __Value)
  153. // _PWR_MOD_CMD_0x20
  154. #define SET_8723B_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  155. #define SET_8723B_H2CCMD_PWRMODE_PARM_RLBM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 4, __Value)
  156. #define SET_8723B_H2CCMD_PWRMODE_PARM_SMART_PS(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 4, 4, __Value)
  157. #define SET_8723B_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value)
  158. #define SET_8723B_H2CCMD_PWRMODE_PARM_ALL_QUEUE_UAPSD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value)
  159. #define SET_8723B_H2CCMD_PWRMODE_PARM_PWR_STATE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value)
  160. #define SET_8723B_H2CCMD_PWRMODE_PARM_BYTE5(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+5, 0, 8, __Value)
  161. #define GET_8723B_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd) LE_BITS_TO_1BYTE(__pH2CCmd, 0, 8)
  162. // _PS_TUNE_PARAM_CMD_0x21
  163. #define SET_8723B_H2CCMD_PSTUNE_PARM_BCN_TO_LIMIT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  164. #define SET_8723B_H2CCMD_PSTUNE_PARM_DTIM_TIMEOUT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value)
  165. #define SET_8723B_H2CCMD_PSTUNE_PARM_ADOPT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 0, 1, __Value)
  166. #define SET_8723B_H2CCMD_PSTUNE_PARM_PS_TIMEOUT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 1, 7, __Value)
  167. #define SET_8723B_H2CCMD_PSTUNE_PARM_DTIM_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+3, 0, 8, __Value)
  168. //_MACID_CFG_CMD_0x40
  169. #define SET_8723B_H2CCMD_MACID_CFG_MACID(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  170. #define SET_8723B_H2CCMD_MACID_CFG_RAID(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 5, __Value)
  171. #define SET_8723B_H2CCMD_MACID_CFG_SGI_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 7, 1, __Value)
  172. #define SET_8723B_H2CCMD_MACID_CFG_BW(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 0, 2, __Value)
  173. #define SET_8723B_H2CCMD_MACID_CFG_NO_UPDATE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 3, 1, __Value)
  174. #define SET_8723B_H2CCMD_MACID_CFG_VHT_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 4, 2, __Value)
  175. #define SET_8723B_H2CCMD_MACID_CFG_DISPT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 6, 1, __Value)
  176. #define SET_8723B_H2CCMD_MACID_CFG_DISRA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 7, 1, __Value)
  177. #define SET_8723B_H2CCMD_MACID_CFG_RATE_MASK0(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+3, 0, 8, __Value)
  178. #define SET_8723B_H2CCMD_MACID_CFG_RATE_MASK1(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+4, 0, 8, __Value)
  179. #define SET_8723B_H2CCMD_MACID_CFG_RATE_MASK2(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+5, 0, 8, __Value)
  180. #define SET_8723B_H2CCMD_MACID_CFG_RATE_MASK3(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+6, 0, 8, __Value)
  181. //_RSSI_SETTING_CMD_0x42
  182. #define SET_8723B_H2CCMD_RSSI_SETTING_MACID(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  183. #define SET_8723B_H2CCMD_RSSI_SETTING_RSSI(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 0, 7, __Value)
  184. #define SET_8723B_H2CCMD_RSSI_SETTING_ULDL_STATE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+3, 0, 8, __Value)
  185. // _AP_REQ_TXRPT_CMD_0x43
  186. #define SET_8723B_H2CCMD_APREQRPT_PARM_MACID1(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  187. #define SET_8723B_H2CCMD_APREQRPT_PARM_MACID2(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value)
  188. // _FORCE_BT_TXPWR_CMD_0x62
  189. #define SET_8723B_H2CCMD_BT_PWR_IDX(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value)
  190. // _FORCE_BT_MP_OPER_CMD_0x67
  191. #define SET_8723B_H2CCMD_BT_MPOPER_VER(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 4, __Value)
  192. #define SET_8723B_H2CCMD_BT_MPOPER_REQNUM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 4, __Value)
  193. #define SET_8723B_H2CCMD_BT_MPOPER_IDX(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value)
  194. #define SET_8723B_H2CCMD_BT_MPOPER_PARAM1(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 0, 8, __Value)
  195. #define SET_8723B_H2CCMD_BT_MPOPER_PARAM2(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+3, 0, 8, __Value)
  196. // _BT_FW_PATCH_0x6A
  197. #define SET_8723B_H2CCMD_BT_FW_PATCH_SIZE(__pH2CCmd, __Value) SET_BITS_TO_LE_2BYTE((pu1Byte)(__pH2CCmd), 0, 16, __Value)
  198. #define SET_8723B_H2CCMD_BT_FW_PATCH_ADDR0(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value)
  199. #define SET_8723B_H2CCMD_BT_FW_PATCH_ADDR1(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value)
  200. #define SET_8723B_H2CCMD_BT_FW_PATCH_ADDR2(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value)
  201. #define SET_8723B_H2CCMD_BT_FW_PATCH_ADDR3(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+5, 0, 8, __Value)
  202. // _WoWLAN PARAM_CMD_0x80
  203. #define SET_8723B_H2CCMD_WOWLAN_FUNC_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
  204. #define SET_8723B_H2CCMD_WOWLAN_PATTERN_MATCH_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
  205. #define SET_8723B_H2CCMD_WOWLAN_MAGIC_PKT_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value)
  206. #define SET_8723B_H2CCMD_WOWLAN_UNICAST_PKT_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value)
  207. #define SET_8723B_H2CCMD_WOWLAN_ALL_PKT_DROP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value)
  208. #define SET_8723B_H2CCMD_WOWLAN_GPIO_ACTIVE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value)
  209. #define SET_8723B_H2CCMD_WOWLAN_REKEY_WAKE_UP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 6, 1, __Value)
  210. #define SET_8723B_H2CCMD_WOWLAN_DISCONNECT_WAKE_UP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 7, 1, __Value)
  211. #define SET_8723B_H2CCMD_WOWLAN_GPIONUM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 7, __Value)
  212. #define SET_8723B_H2CCMD_WOWLAN_DATAPIN_WAKE_UP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 7, 1, __Value)
  213. #define SET_8723B_H2CCMD_WOWLAN_GPIO_DURATION(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value)
  214. // _REMOTE_WAKEUP_CMD_0x81
  215. #define SET_8723B_H2CCMD_REMOTE_WAKECTRL_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
  216. #define SET_8723B_H2CCMD_REMOTE_WAKE_CTRL_ARP_OFFLOAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
  217. #define SET_8723B_H2CCMD_REMOTE_WAKE_CTRL_NDP_OFFLOAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value)
  218. #define SET_8723B_H2CCMD_REMOTE_WAKE_CTRL_GTK_OFFLOAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value)
  219. // AOAC_GLOBAL_INFO_0x82
  220. #define SET_8723B_H2CCMD_AOAC_GLOBAL_INFO_PAIRWISE_ENC_ALG(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  221. #define SET_8723B_H2CCMD_AOAC_GLOBAL_INFO_GROUP_ENC_ALG(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value)
  222. // AOAC_RSVDPAGE_LOC_0x83
  223. #define SET_8723B_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd), 0, 8, __Value)
  224. #define SET_8723B_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value)
  225. #define SET_8723B_H2CCMD_AOAC_RSVDPAGE_LOC_NEIGHBOR_ADV(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value)
  226. #define SET_8723B_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value)
  227. #define SET_8723B_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value)
  228. #define SET_8723B_H2CCMD_AOAC_RSVDPAGE_LOC_PROBE_REQ(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+5, 0, 8, __Value)
  229. #define SET_8723B_H2CCMD_AOAC_RSVDPAGE_LOC_NETWORK_LIST(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+6, 0, 8, __Value)
  230. //---------------------------------------------------------------------------------------------------------//
  231. //------------------------------------------- Structure --------------------------------------------------//
  232. //---------------------------------------------------------------------------------------------------------//
  233. typedef struct _RSVDPAGE_LOC {
  234. u8 LocProbeRsp;
  235. u8 LocPsPoll;
  236. u8 LocNullData;
  237. u8 LocQosNull;
  238. u8 LocBTQosNull;
  239. #ifdef CONFIG_WOWLAN_8723
  240. u8 LocRemoteCtrlInfo;
  241. u8 LocArpRsp;
  242. u8 LocNbrAdv;
  243. u8 LocGTKRsp;
  244. u8 LocGTKInfo;
  245. u8 LocProbeReq;
  246. u8 LocNetList;
  247. #endif //CONFIG_WOWLAN_8723
  248. } RSVDPAGE_LOC_8723B, *PRSVDPAGE_LOC_8723B;
  249. //---------------------------------------------------------------------------------------------------------//
  250. //---------------------------------- Function Statement --------------------------------------------------//
  251. //---------------------------------------------------------------------------------------------------------//
  252. // host message to firmware cmd
  253. void rtl8723b_set_FwPwrMode_cmd(PADAPTER padapter, u8 Mode);
  254. void rtl8723b_set_FwJoinBssRpt_cmd(PADAPTER padapter, u8 mstatus);
  255. #ifdef CONFIG_BT_COEXIST
  256. void rtl8723b_set_BTCoex_AP_mode_FwRsvdPkt_cmd(PADAPTER padapter);
  257. #endif
  258. void rtl8723b_set_rssi_cmd(PADAPTER padapter, u8 *param);
  259. void rtl8723b_Add_RateATid(PADAPTER pAdapter, u32 bitmap, u8* arg, u8 rssi_level);
  260. void rtl8723b_fw_try_ap_cmd(PADAPTER padapter, u32 need_ack);
  261. //s32 rtl8723b_set_lowpwr_lps_cmd(PADAPTER padapter, u8 enable);
  262. void rtl8723b_set_FwPsTuneParam_cmd(PADAPTER padapter);
  263. void rtl8723a_set_FwMacIdConfig_cmd(_adapter*padapter, u32 mask, u8 arg);
  264. void rtl8723b_set_FwMacIdConfig_cmd(_adapter* padapter, u8 mac_id, u8 raid, u8 bw, u32 mask);
  265. void rtl8723b_set_FwBtMpOper_cmd(PADAPTER padapter, u8 idx, u8 ver, u8 reqnum, u8 param1);
  266. void rtl8723b_download_rsvd_page(PADAPTER padapter, u8 mstatus);
  267. #ifdef CONFIG_P2P
  268. void rtl8723b_set_p2p_ps_offload_cmd(PADAPTER padapter, u8 p2p_ps_state);
  269. #endif //CONFIG_P2P
  270. void CheckFwRsvdPageContent(PADAPTER padapter);
  271. #ifdef CONFIG_WOWLAN_8723
  272. void rtl8723b_set_wowlan_cmd(_adapter* padapter, u8 enable);
  273. void SetFwRelatedForWoWLAN8723b(_adapter* padapter, u8 bHostIsGoingtoSleep);
  274. #endif//CONFIG_WOWLAN_8723
  275. #ifdef CONFIG_TSF_RESET_OFFLOAD
  276. u8 rtl8723b_reset_tsf(_adapter *padapter, u8 reset_port);
  277. #endif // CONFIG_TSF_RESET_OFFLOAD
  278. s32 FillH2CCmd8723B(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer);
  279. #define FillH2CCmd FillH2CCmd8723B
  280. #endif