def.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2009-2012 Realtek Corporation.
  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. * The full GNU General Public License is included in this distribution in the
  19. * file called LICENSE.
  20. *
  21. * Contact Information:
  22. * wlanfae <wlanfae@realtek.com>
  23. * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
  24. * Hsinchu 300, Taiwan.
  25. *
  26. * Larry Finger <Larry.Finger@lwfinger.net>
  27. *
  28. *****************************************************************************/
  29. #ifndef __RTL92C_DEF_H__
  30. #define __RTL92C_DEF_H__
  31. #define PHY_RSSI_SLID_WIN_MAX 100
  32. #define PHY_LINKQUALITY_SLID_WIN_MAX 20
  33. #define PHY_BEACON_RSSI_SLID_WIN_MAX 10
  34. #define RX_SMOOTH_FACTOR 20
  35. #define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0
  36. #define HAL_PRIME_CHNL_OFFSET_LOWER 1
  37. #define HAL_PRIME_CHNL_OFFSET_UPPER 2
  38. #define RX_MPDU_QUEUE 0
  39. #define RX_CMD_QUEUE 1
  40. #define C2H_RX_CMD_HDR_LEN 8
  41. #define GET_C2H_CMD_CMD_LEN(__prxhdr) \
  42. LE_BITS_TO_4BYTE((__prxhdr), 0, 16)
  43. #define GET_C2H_CMD_ELEMENT_ID(__prxhdr) \
  44. LE_BITS_TO_4BYTE((__prxhdr), 16, 8)
  45. #define GET_C2H_CMD_CMD_SEQ(__prxhdr) \
  46. LE_BITS_TO_4BYTE((__prxhdr), 24, 7)
  47. #define GET_C2H_CMD_CONTINUE(__prxhdr) \
  48. LE_BITS_TO_4BYTE((__prxhdr), 31, 1)
  49. #define GET_C2H_CMD_CONTENT(__prxhdr) \
  50. ((u8 *)(__prxhdr) + C2H_RX_CMD_HDR_LEN)
  51. #define GET_C2H_CMD_FEEDBACK_ELEMENT_ID(__pcmdfbhdr) \
  52. LE_BITS_TO_4BYTE((__pcmdfbhdr), 0, 8)
  53. #define GET_C2H_CMD_FEEDBACK_CCX_LEN(__pcmdfbhdr) \
  54. LE_BITS_TO_4BYTE((__pcmdfbhdr), 8, 8)
  55. #define GET_C2H_CMD_FEEDBACK_CCX_CMD_CNT(__pcmdfbhdr) \
  56. LE_BITS_TO_4BYTE((__pcmdfbhdr), 16, 16)
  57. #define GET_C2H_CMD_FEEDBACK_CCX_MAC_ID(__pcmdfbhdr) \
  58. LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 0, 5)
  59. #define GET_C2H_CMD_FEEDBACK_CCX_VALID(__pcmdfbhdr) \
  60. LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 7, 1)
  61. #define GET_C2H_CMD_FEEDBACK_CCX_RETRY_CNT(__pcmdfbhdr) \
  62. LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 8, 5)
  63. #define GET_C2H_CMD_FEEDBACK_CCX_TOK(__pcmdfbhdr) \
  64. LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 15, 1)
  65. #define GET_C2H_CMD_FEEDBACK_CCX_QSEL(__pcmdfbhdr) \
  66. LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 16, 4)
  67. #define GET_C2H_CMD_FEEDBACK_CCX_SEQ(__pcmdfbhdr) \
  68. LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 20, 12)
  69. #define GET_RX_STATUS_DESC_BUFF_ADDR(__pdesc) \
  70. SHIFT_AND_MASK_LE(__pdesc + 24, 0, 32)
  71. #define CHIP_VER_B BIT(4)
  72. #define CHIP_BONDING_IDENTIFIER(_value) (((_value) >> 22) & 0x3)
  73. #define CHIP_BONDING_92C_1T2R 0x1
  74. #define RF_TYPE_1T2R BIT(1)
  75. #define CHIP_92C_BITMASK BIT(0)
  76. #define CHIP_UNKNOWN BIT(7)
  77. #define CHIP_92C_1T2R 0x03
  78. #define CHIP_92C 0x01
  79. #define CHIP_88C 0x00
  80. enum version_8192c {
  81. VERSION_A_CHIP_92C = 0x01,
  82. VERSION_A_CHIP_88C = 0x00,
  83. VERSION_B_CHIP_92C = 0x11,
  84. VERSION_B_CHIP_88C = 0x10,
  85. VERSION_TEST_CHIP_88C = 0x00,
  86. VERSION_TEST_CHIP_92C = 0x01,
  87. VERSION_NORMAL_TSMC_CHIP_88C = 0x10,
  88. VERSION_NORMAL_TSMC_CHIP_92C = 0x11,
  89. VERSION_NORMAL_TSMC_CHIP_92C_1T2R = 0x13,
  90. VERSION_NORMAL_UMC_CHIP_88C_A_CUT = 0x30,
  91. VERSION_NORMAL_UMC_CHIP_92C_A_CUT = 0x31,
  92. VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT = 0x33,
  93. VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT = 0x34,
  94. VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT = 0x3c,
  95. VERSION_NORMAL_UMC_CHIP_88C_B_CUT = 0x70,
  96. VERSION_NORMAL_UMC_CHIP_92C_B_CUT = 0x71,
  97. VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT = 0x73,
  98. VERSION_UNKNOWN = 0x88,
  99. };
  100. enum rtl819x_loopback_e {
  101. RTL819X_NO_LOOPBACK = 0,
  102. RTL819X_MAC_LOOPBACK = 1,
  103. RTL819X_DMA_LOOPBACK = 2,
  104. RTL819X_CCK_LOOPBACK = 3,
  105. };
  106. enum rf_optype {
  107. RF_OP_BY_SW_3WIRE = 0,
  108. RF_OP_BY_FW,
  109. RF_OP_MAX
  110. };
  111. enum rf_power_state {
  112. RF_ON,
  113. RF_OFF,
  114. RF_SLEEP,
  115. RF_SHUT_DOWN,
  116. };
  117. enum power_save_mode {
  118. POWER_SAVE_MODE_ACTIVE,
  119. POWER_SAVE_MODE_SAVE,
  120. };
  121. enum power_polocy_config {
  122. POWERCFG_MAX_POWER_SAVINGS,
  123. POWERCFG_GLOBAL_POWER_SAVINGS,
  124. POWERCFG_LOCAL_POWER_SAVINGS,
  125. POWERCFG_LENOVO,
  126. };
  127. enum interface_select_pci {
  128. INTF_SEL1_MINICARD = 0,
  129. INTF_SEL0_PCIE = 1,
  130. INTF_SEL2_RSV = 2,
  131. INTF_SEL3_RSV = 3,
  132. };
  133. enum hal_fw_c2h_cmd_id {
  134. HAL_FW_C2H_CMD_Read_MACREG = 0,
  135. HAL_FW_C2H_CMD_Read_BBREG = 1,
  136. HAL_FW_C2H_CMD_Read_RFREG = 2,
  137. HAL_FW_C2H_CMD_Read_EEPROM = 3,
  138. HAL_FW_C2H_CMD_Read_EFUSE = 4,
  139. HAL_FW_C2H_CMD_Read_CAM = 5,
  140. HAL_FW_C2H_CMD_Get_BasicRate = 6,
  141. HAL_FW_C2H_CMD_Get_DataRate = 7,
  142. HAL_FW_C2H_CMD_Survey = 8,
  143. HAL_FW_C2H_CMD_SurveyDone = 9,
  144. HAL_FW_C2H_CMD_JoinBss = 10,
  145. HAL_FW_C2H_CMD_AddSTA = 11,
  146. HAL_FW_C2H_CMD_DelSTA = 12,
  147. HAL_FW_C2H_CMD_AtimDone = 13,
  148. HAL_FW_C2H_CMD_TX_Report = 14,
  149. HAL_FW_C2H_CMD_CCX_Report = 15,
  150. HAL_FW_C2H_CMD_DTM_Report = 16,
  151. HAL_FW_C2H_CMD_TX_Rate_Statistics = 17,
  152. HAL_FW_C2H_CMD_C2HLBK = 18,
  153. HAL_FW_C2H_CMD_C2HDBG = 19,
  154. HAL_FW_C2H_CMD_C2HFEEDBACK = 20,
  155. HAL_FW_C2H_CMD_MAX
  156. };
  157. enum rtl_desc_qsel {
  158. QSLT_BK = 0x2,
  159. QSLT_BE = 0x0,
  160. QSLT_VI = 0x5,
  161. QSLT_VO = 0x7,
  162. QSLT_BEACON = 0x10,
  163. QSLT_HIGH = 0x11,
  164. QSLT_MGNT = 0x12,
  165. QSLT_CMD = 0x13,
  166. };
  167. struct phy_sts_cck_8192s_t {
  168. u8 adc_pwdb_X[4];
  169. u8 sq_rpt;
  170. u8 cck_agc_rpt;
  171. };
  172. struct h2c_cmd_8192c {
  173. u8 element_id;
  174. u32 cmd_len;
  175. u8 *p_cmdbuffer;
  176. };
  177. #endif