rtl8723a_cmd.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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 __RTL8723A_CMD_H__
  21. #define __RTL8723A_CMD_H__
  22. #define H2C_BT_FW_PATCH_LEN 3
  23. #define H2C_BT_PWR_FORCE_LEN 3
  24. enum cmd_msg_element_id
  25. {
  26. NONE_CMDMSG_EID,
  27. AP_OFFLOAD_EID = 0,
  28. SET_PWRMODE_EID = 1,
  29. JOINBSS_RPT_EID = 2,
  30. RSVD_PAGE_EID = 3,
  31. RSSI_4_EID = 4,
  32. RSSI_SETTING_EID = 5,
  33. MACID_CONFIG_EID = 6,
  34. MACID_PS_MODE_EID = 7,
  35. P2P_PS_OFFLOAD_EID = 8,
  36. SELECTIVE_SUSPEND_ROF_CMD = 9,
  37. BT_QUEUE_PKT_EID = 17,
  38. BT_ANT_TDMA_EID = 20,
  39. BT_2ANT_HID_EID = 21,
  40. P2P_PS_CTW_CMD_EID = 32,
  41. FORCE_BT_TX_PWR_EID = 33,
  42. SET_TDMA_WLAN_ACT_TIME_EID = 34,
  43. SET_BT_TX_RETRY_INDEX_EID = 35,
  44. HID_PROFILE_ENABLE_EID = 36,
  45. BT_IGNORE_WLAN_ACT_EID = 37,
  46. BT_PTA_MANAGER_UPDATE_ENABLE_EID = 38,
  47. DAC_SWING_VALUE_EID = 41,
  48. TRADITIONAL_TDMA_EN_EID = 51,
  49. H2C_BT_FW_PATCH = 54,
  50. B_TYPE_TDMA_EID = 58,
  51. SCAN_EN_EID = 59,
  52. LOWPWR_LPS_EID = 71,
  53. H2C_RESET_TSF = 75,
  54. MAX_CMDMSG_EID
  55. };
  56. struct cmd_msg_parm {
  57. u8 eid; //element id
  58. u8 sz; // sz
  59. u8 buf[6];
  60. };
  61. typedef struct _SETPWRMODE_PARM
  62. {
  63. u8 Mode;
  64. u8 SmartPS;
  65. u8 AwakeInterval; // unit: beacon interval
  66. u8 bAllQueueUAPSD;
  67. #if 0
  68. u8 LowRxBCN:1;
  69. u8 AutoAntSwitch:1;
  70. u8 PSAllowBTHighPriority:1;
  71. u8 rsvd43:5;
  72. #else
  73. #define SETPM_LOWRXBCN BIT(0)
  74. #define SETPM_AUTOANTSWITCH BIT(1)
  75. #define SETPM_PSALLOWBTHIGHPRI BIT(2)
  76. u8 BcnAntMode;
  77. #endif
  78. }__attribute__((__packed__)) SETPWRMODE_PARM, *PSETPWRMODE_PARM;
  79. struct H2C_SS_RFOFF_PARAM{
  80. u8 ROFOn; // 1: on, 0:off
  81. u16 gpio_period; // unit: 1024 us
  82. }__attribute__ ((packed));
  83. typedef struct JOINBSSRPT_PARM_8723A{
  84. u8 OpMode; // RT_MEDIA_STATUS
  85. }JOINBSSRPT_PARM_8723A, *PJOINBSSRPT_PARM_8723A;
  86. typedef struct _RSVDPAGE_LOC_8723A {
  87. u8 LocProbeRsp;
  88. u8 LocPsPoll;
  89. u8 LocNullData;
  90. u8 LocQosNull;
  91. u8 LocBTQosNull;
  92. } RSVDPAGE_LOC_8723A, *PRSVDPAGE_LOC_8723A;
  93. typedef struct _B_TYPE_TDMA_PARM
  94. {
  95. #if 0
  96. u8 En:1;
  97. u8 FixAntennaInBTSide:1;
  98. u8 TxPspoll:1;
  99. u8 val870:1; // value of 870, when disable
  100. u8 AutoWakeUp:1;
  101. u8 NoPS:1;
  102. u8 WlanHighPriority:1;
  103. u8 rsvd07:1;
  104. #else
  105. #define B_TDMA_EN BIT(0)
  106. #define B_TDMA_FIXANTINBT BIT(1)
  107. #define B_TDMA_TXPSPOLL BIT(2)
  108. #define B_TDMA_VAL870 BIT(3)
  109. #define B_TDMA_AUTOWAKEUP BIT(4)
  110. #define B_TDMA_NOPS BIT(5)
  111. #define B_TDMA_WLANHIGHPRI BIT(6)
  112. u8 option;
  113. #endif
  114. u8 TBTTOnPeriod;
  115. u8 MedPeriod;
  116. u8 rsvd30;
  117. }__attribute__((__packed__)) B_TYPE_TDMA_PARM, *PB_TYPE_TDMA_PARM;
  118. typedef struct _SCAN_EN_PARM {
  119. #if 0
  120. u8 En:1;
  121. u8 rsvd01:7;
  122. #else
  123. u8 En;
  124. #endif
  125. }__attribute__((__packed__)) SCAN_EN_PARM, *PSCAN_EN_PARM;
  126. // BT_PWR
  127. #define SET_H2CCMD_BT_PWR_IDX(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value)
  128. // BT_FW_PATCH
  129. #if 0
  130. #define SET_H2CCMD_BT_FW_PATCH_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  131. #define SET_H2CCMD_BT_FW_PATCH_SIZE(__pH2CCmd, __Value) SET_BITS_TO_LE_2BYTE((__pH2CCmd)+1, 0, 16, __Value)
  132. #else
  133. #define SET_H2CCMD_BT_FW_PATCH_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_4BYTE(__pH2CCmd, 0, 8, __Value) // SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  134. #define SET_H2CCMD_BT_FW_PATCH_SIZE(__pH2CCmd, __Value) SET_BITS_TO_LE_4BYTE(__pH2CCmd, 8, 16, __Value) // SET_BITS_TO_LE_2BYTE((__pH2CCmd)+1, 0, 16, __Value)
  135. #endif
  136. #if 0
  137. /*
  138. * H2C_LOWPWR_LPS
  139. * h2c cmd = 71
  140. * byte1[6:0]= bcn count : how many bcn not recevied should return to old mechanism
  141. * byte1[7] = enable : enable mechanism
  142. * byte2=bcn period : bcn recv time of this AP, unit 32 us
  143. * byte3= drop threshold : how many pkts be droped, rx dma should be release
  144. * byte4 = max early period
  145. * byte5 = max bcn timeout period
  146. */
  147. #define SET_H2CCMD_LOWPWR_LPS_BCN_COUNT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 4, __Value)
  148. #define SET_H2CCMD_LOWPWR_LPS_TB_BCN_THRESH(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 3, __Value)
  149. #define SET_H2CCMD_LOWPWR_LPS_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 7, 1, __Value)
  150. #define SET_H2CCMD_LOWPWR_LPS_BCN_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value)
  151. #define SET_H2CCMD_LOWPWR_LPS_BCN_DROP_THRESH(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value)
  152. #define SET_H2CCMD_LOWPWR_LPS_MAX_EARLY_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value)
  153. #define SET_H2CCMD_LOWPWR_LPS_MAX_BCN_TO_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+4, 0, 8, __Value)
  154. #else
  155. typedef struct _LOWPWR_LPS_PARM
  156. {
  157. u8 bcn_count:4;
  158. u8 tb_bcn_threshold:3;
  159. u8 enable:1;
  160. u8 bcn_interval;
  161. u8 drop_threshold;
  162. u8 max_early_period;
  163. u8 max_bcn_timeout_period;
  164. }__attribute__((__packed__)) LOWPWR_LPS_PARM, *PLOWPWR_LPS_PARM;
  165. #endif
  166. // host message to firmware cmd
  167. void rtl8723a_set_FwPwrMode_cmd(PADAPTER padapter, u8 Mode);
  168. void rtl8723a_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus);
  169. #ifdef CONFIG_BT_COEXIST
  170. void rtl8723a_set_BTCoex_AP_mode_FwRsvdPkt_cmd(PADAPTER padapter);
  171. #endif
  172. u8 rtl8192c_set_rssi_cmd(PADAPTER padapter, u8 *param);
  173. //u8 rtl8723a_set_rssi_cmd(PADAPTER padapter, u8 *param);
  174. void rtl8192c_set_raid_cmd(PADAPTER padapter, u32 mask, u8* arg);
  175. //u8 rtl8723a_set_raid_cmd(PADAPTER padapter, u32 mask, u8 arg);
  176. void rtl8192c_Add_RateATid(PADAPTER padapter, u32 bitmap, u8* arg, u8 rssi_level);
  177. //void rtl8723a_Add_RateATid(PADAPTER padapter, u32 bitmap, u8 arg);
  178. u8 rtl8192c_set_FwSelectSuspend_cmd(PADAPTER padapter, u8 bfwpoll, u16 period);
  179. //u8 rtl8723a_set_FwSelectSuspend_cmd(PADAPTER padapter, u8 bfwpoll, u16 period);
  180. #ifdef CONFIG_P2P
  181. void rtl8192c_set_p2p_ps_offload_cmd(PADAPTER padapter, u8 p2p_ps_state);
  182. //void rtl8723a_set_p2p_ps_offload_cmd(PADAPTER padapter, u8 p2p_ps_state);
  183. #endif //CONFIG_P2P
  184. void CheckFwRsvdPageContent(PADAPTER padapter);
  185. #endif
  186. #ifdef CONFIG_TSF_RESET_OFFLOAD
  187. u8 rtl8723c_reset_tsf(_adapter *padapter, u8 reset_port);
  188. #endif // CONFIG_TSF_RESET_OFFLOAD