hal_intf.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  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 __HAL_INTF_H__
  21. #define __HAL_INTF_H__
  22. enum RTL871X_HCI_TYPE {
  23. RTW_PCIE = BIT0,
  24. RTW_USB = BIT1,
  25. RTW_SDIO = BIT2,
  26. RTW_GSPI = BIT3,
  27. };
  28. enum _CHIP_TYPE {
  29. NULL_CHIP_TYPE,
  30. RTL8188C_8192C,
  31. RTL8192D,
  32. RTL8723A,
  33. RTL8188E,
  34. RTL8192E,
  35. RTL8812,
  36. RTL8821, //RTL8811
  37. RTL8723B,
  38. MAX_CHIP_TYPE
  39. };
  40. typedef enum _HW_VARIABLES{
  41. HW_VAR_MEDIA_STATUS,
  42. HW_VAR_MEDIA_STATUS1,
  43. HW_VAR_SET_OPMODE,
  44. HW_VAR_MAC_ADDR,
  45. HW_VAR_BSSID,
  46. HW_VAR_INIT_RTS_RATE,
  47. HW_VAR_BASIC_RATE,
  48. HW_VAR_TXPAUSE,
  49. HW_VAR_BCN_FUNC,
  50. HW_VAR_CORRECT_TSF,
  51. HW_VAR_CHECK_BSSID,
  52. HW_VAR_MLME_DISCONNECT,
  53. HW_VAR_MLME_SITESURVEY,
  54. HW_VAR_MLME_JOIN,
  55. HW_VAR_ON_RCR_AM,
  56. HW_VAR_OFF_RCR_AM,
  57. HW_VAR_BEACON_INTERVAL,
  58. HW_VAR_SLOT_TIME,
  59. HW_VAR_RESP_SIFS,
  60. HW_VAR_ACK_PREAMBLE,
  61. HW_VAR_SEC_CFG,
  62. HW_VAR_BCN_VALID,
  63. HW_VAR_RF_TYPE,
  64. HW_VAR_DM_FLAG,
  65. HW_VAR_DM_FUNC_OP,
  66. HW_VAR_DM_FUNC_SET,
  67. HW_VAR_DM_FUNC_CLR,
  68. HW_VAR_CAM_EMPTY_ENTRY,
  69. HW_VAR_CAM_INVALID_ALL,
  70. HW_VAR_CAM_WRITE,
  71. HW_VAR_CAM_READ,
  72. HW_VAR_AC_PARAM_VO,
  73. HW_VAR_AC_PARAM_VI,
  74. HW_VAR_AC_PARAM_BE,
  75. HW_VAR_AC_PARAM_BK,
  76. HW_VAR_ACM_CTRL,
  77. HW_VAR_AMPDU_MIN_SPACE,
  78. HW_VAR_AMPDU_FACTOR,
  79. HW_VAR_RXDMA_AGG_PG_TH,
  80. HW_VAR_SET_RPWM,
  81. HW_VAR_H2C_FW_PWRMODE,
  82. HW_VAR_H2C_PS_TUNE_PARAM,
  83. HW_VAR_H2C_FW_JOINBSSRPT,
  84. HW_VAR_FWLPS_RF_ON,
  85. HW_VAR_H2C_FW_P2P_PS_OFFLOAD,
  86. HW_VAR_TDLS_WRCR,
  87. HW_VAR_TDLS_INIT_CH_SEN,
  88. HW_VAR_TDLS_RS_RCR,
  89. HW_VAR_TDLS_DONE_CH_SEN,
  90. HW_VAR_INITIAL_GAIN,
  91. HW_VAR_TRIGGER_GPIO_0,
  92. HW_VAR_BT_SET_COEXIST,
  93. HW_VAR_BT_ISSUE_DELBA,
  94. HW_VAR_CURRENT_ANTENNA,
  95. HW_VAR_ANTENNA_DIVERSITY_LINK,
  96. HW_VAR_ANTENNA_DIVERSITY_SELECT,
  97. HW_VAR_SWITCH_EPHY_WoWLAN,
  98. HW_VAR_EFUSE_USAGE,
  99. HW_VAR_EFUSE_BYTES,
  100. HW_VAR_EFUSE_BT_USAGE,
  101. HW_VAR_EFUSE_BT_BYTES,
  102. HW_VAR_FIFO_CLEARN_UP,
  103. HW_VAR_CHECK_TXBUF,
  104. HW_VAR_APFM_ON_MAC, //Auto FSM to Turn On, include clock, isolation, power control for MAC only
  105. // The valid upper nav range for the HW updating, if the true value is larger than the upper range, the HW won't update it.
  106. // Unit in microsecond. 0 means disable this function.
  107. #ifdef CONFIG_WOWLAN
  108. HW_VAR_WOWLAN,
  109. #endif
  110. HW_VAR_NAV_UPPER,
  111. HW_VAR_C2H_HANDLE,
  112. HW_VAR_RPT_TIMER_SETTING,
  113. HW_VAR_TX_RPT_MAX_MACID,
  114. HW_VAR_H2C_MEDIA_STATUS_RPT,
  115. HW_VAR_CHK_HI_QUEUE_EMPTY,
  116. HW_VAR_DL_BCN_SEL,
  117. HW_VAR_AMPDU_MAX_TIME,
  118. HW_VAR_WIRELESS_MODE,
  119. HW_VAR_USB_MODE,
  120. }HW_VARIABLES;
  121. typedef enum _HAL_DEF_VARIABLE{
  122. HAL_DEF_UNDERCORATEDSMOOTHEDPWDB,
  123. HAL_DEF_IS_SUPPORT_ANT_DIV,
  124. HAL_DEF_CURRENT_ANTENNA,
  125. HAL_DEF_DRVINFO_SZ,
  126. HAL_DEF_MAX_RECVBUF_SZ,
  127. HAL_DEF_RX_PACKET_OFFSET,
  128. HAL_DEF_DBG_DUMP_RXPKT,//for dbg
  129. HAL_DEF_DBG_DM_FUNC,//for dbg
  130. HAL_DEF_RA_DECISION_RATE,
  131. HAL_DEF_RA_SGI,
  132. HAL_DEF_PT_PWR_STATUS,
  133. HAL_DEF_LDPC, // LDPC support
  134. HAL_DEF_TX_STBC, // TX STBC support
  135. HAL_DEF_RX_STBC, // RX STBC support
  136. HW_VAR_MAX_RX_AMPDU_FACTOR,
  137. HW_DEF_RA_INFO_DUMP,
  138. HAL_DEF_DBG_DUMP_TXPKT,
  139. HW_DEF_FA_CNT_DUMP,
  140. HW_DEF_ODM_DBG_FLAG,
  141. HAL_DEF_TX_PAGE_BOUNDARY,
  142. HAL_DEF_TX_PAGE_BOUNDARY_WOWLAN,
  143. HAL_DEF_ANT_DETECT,//to do for 8723a
  144. }HAL_DEF_VARIABLE;
  145. typedef enum _HAL_ODM_VARIABLE{
  146. HAL_ODM_STA_INFO,
  147. HAL_ODM_P2P_STATE,
  148. HAL_ODM_WIFI_DISPLAY_STATE,
  149. }HAL_ODM_VARIABLE;
  150. typedef enum _HAL_INTF_PS_FUNC{
  151. HAL_USB_SELECT_SUSPEND,
  152. HAL_MAX_ID,
  153. }HAL_INTF_PS_FUNC;
  154. typedef s32 (*c2h_id_filter)(u8 id);
  155. struct hal_ops {
  156. u32 (*hal_power_on)(_adapter *padapter);
  157. u32 (*hal_init)(_adapter *padapter);
  158. u32 (*hal_deinit)(_adapter *padapter);
  159. void (*free_hal_data)(_adapter *padapter);
  160. u32 (*inirp_init)(_adapter *padapter);
  161. u32 (*inirp_deinit)(_adapter *padapter);
  162. s32 (*init_xmit_priv)(_adapter *padapter);
  163. void (*free_xmit_priv)(_adapter *padapter);
  164. s32 (*init_recv_priv)(_adapter *padapter);
  165. void (*free_recv_priv)(_adapter *padapter);
  166. void (*InitSwLeds)(_adapter *padapter);
  167. void (*DeInitSwLeds)(_adapter *padapter);
  168. void (*dm_init)(_adapter *padapter);
  169. void (*dm_deinit)(_adapter *padapter);
  170. void (*read_chip_version)(_adapter *padapter);
  171. void (*init_default_value)(_adapter *padapter);
  172. void (*intf_chip_configure)(_adapter *padapter);
  173. void (*read_adapter_info)(_adapter *padapter);
  174. void (*enable_interrupt)(_adapter *padapter);
  175. void (*disable_interrupt)(_adapter *padapter);
  176. s32 (*interrupt_handler)(_adapter *padapter);
  177. void (*set_bwmode_handler)(_adapter *padapter, CHANNEL_WIDTH Bandwidth, u8 Offset);
  178. void (*set_channel_handler)(_adapter *padapter, u8 channel);
  179. void (*set_chnl_bw_handler)(_adapter *padapter, u8 channel, CHANNEL_WIDTH Bandwidth, u8 Offset40, u8 Offset80);
  180. void (*hal_dm_watchdog)(_adapter *padapter);
  181. void (*SetHwRegHandler)(_adapter *padapter, u8 variable,u8* val);
  182. void (*GetHwRegHandler)(_adapter *padapter, u8 variable,u8* val);
  183. u8 (*GetHalDefVarHandler)(_adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pValue);
  184. u8 (*SetHalDefVarHandler)(_adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pValue);
  185. void (*GetHalODMVarHandler)(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet);
  186. void (*SetHalODMVarHandler)(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet);
  187. void (*UpdateRAMaskHandler)(_adapter *padapter, u32 mac_id, u8 rssi_level);
  188. void (*SetBeaconRelatedRegistersHandler)(_adapter *padapter);
  189. void (*Add_RateATid)(_adapter *padapter, u32 bitmap, u8* arg, u8 rssi_level);
  190. #ifdef CONFIG_CONCURRENT_MODE
  191. void (*clone_haldata)(_adapter *dst_padapter, _adapter *src_padapter);
  192. #endif
  193. void (*run_thread)(_adapter *padapter);
  194. void (*cancel_thread)(_adapter *padapter);
  195. #ifdef CONFIG_ANTENNA_DIVERSITY
  196. u8 (*AntDivBeforeLinkHandler)(_adapter *padapter);
  197. void (*AntDivCompareHandler)(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src);
  198. #endif
  199. u8 (*interface_ps_func)(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id, u8* val);
  200. s32 (*hal_xmit)(_adapter *padapter, struct xmit_frame *pxmitframe);
  201. s32 (*mgnt_xmit)(_adapter *padapter, struct xmit_frame *pmgntframe);
  202. s32 (*hal_xmitframe_enqueue)(_adapter *padapter, struct xmit_frame *pxmitframe);
  203. u32 (*read_bbreg)(_adapter *padapter, u32 RegAddr, u32 BitMask);
  204. void (*write_bbreg)(_adapter *padapter, u32 RegAddr, u32 BitMask, u32 Data);
  205. u32 (*read_rfreg)(_adapter *padapter, u8 eRFPath, u32 RegAddr, u32 BitMask);
  206. void (*write_rfreg)(_adapter *padapter, u8 eRFPath, u32 RegAddr, u32 BitMask, u32 Data);
  207. #ifdef CONFIG_HOSTAPD_MLME
  208. s32 (*hostap_mgnt_xmit_entry)(_adapter *padapter, _pkt *pkt);
  209. #endif
  210. void (*EfusePowerSwitch)(_adapter *padapter, u8 bWrite, u8 PwrState);
  211. void (*ReadEFuse)(_adapter *padapter, u8 efuseType, u16 _offset, u16 _size_byte, u8 *pbuf, BOOLEAN bPseudoTest);
  212. void (*EFUSEGetEfuseDefinition)(_adapter *padapter, u8 efuseType, u8 type, void *pOut, BOOLEAN bPseudoTest);
  213. u16 (*EfuseGetCurrentSize)(_adapter *padapter, u8 efuseType, BOOLEAN bPseudoTest);
  214. int (*Efuse_PgPacketRead)(_adapter *padapter, u8 offset, u8 *data, BOOLEAN bPseudoTest);
  215. int (*Efuse_PgPacketWrite)(_adapter *padapter, u8 offset, u8 word_en, u8 *data, BOOLEAN bPseudoTest);
  216. u8 (*Efuse_WordEnableDataWrite)(_adapter *padapter, u16 efuse_addr, u8 word_en, u8 *data, BOOLEAN bPseudoTest);
  217. BOOLEAN (*Efuse_PgPacketWrite_BT)(_adapter *padapter, u8 offset, u8 word_en, u8 *data, BOOLEAN bPseudoTest);
  218. #ifdef DBG_CONFIG_ERROR_DETECT
  219. void (*sreset_init_value)(_adapter *padapter);
  220. void (*sreset_reset_value)(_adapter *padapter);
  221. void (*silentreset)(_adapter *padapter);
  222. void (*sreset_xmit_status_check)(_adapter *padapter);
  223. void (*sreset_linked_status_check) (_adapter *padapter);
  224. u8 (*sreset_get_wifi_status)(_adapter *padapter);
  225. bool (*sreset_inprogress)(_adapter *padapter);
  226. #endif
  227. #ifdef CONFIG_IOL
  228. int (*IOL_exec_cmds_sync)(_adapter *padapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt);
  229. #endif
  230. #ifdef CONFIG_XMIT_THREAD_MODE
  231. s32 (*xmit_thread_handler)(_adapter *padapter);
  232. #endif
  233. void (*hal_notch_filter)(_adapter * adapter, bool enable);
  234. void (*hal_reset_security_engine)(_adapter * adapter);
  235. s32 (*c2h_handler)(_adapter *padapter, struct c2h_evt_hdr *c2h_evt);
  236. c2h_id_filter c2h_id_filter_ccx;
  237. };
  238. typedef enum _RT_EEPROM_TYPE{
  239. EEPROM_93C46,
  240. EEPROM_93C56,
  241. EEPROM_BOOT_EFUSE,
  242. }RT_EEPROM_TYPE,*PRT_EEPROM_TYPE;
  243. #define RF_CHANGE_BY_INIT 0
  244. #define RF_CHANGE_BY_IPS BIT28
  245. #define RF_CHANGE_BY_PS BIT29
  246. #define RF_CHANGE_BY_HW BIT30
  247. #define RF_CHANGE_BY_SW BIT31
  248. typedef enum _HARDWARE_TYPE{
  249. HARDWARE_TYPE_RTL8180,
  250. HARDWARE_TYPE_RTL8185,
  251. HARDWARE_TYPE_RTL8187,
  252. HARDWARE_TYPE_RTL8188,
  253. HARDWARE_TYPE_RTL8190P,
  254. HARDWARE_TYPE_RTL8192E,
  255. HARDWARE_TYPE_RTL819xU,
  256. HARDWARE_TYPE_RTL8192SE,
  257. HARDWARE_TYPE_RTL8192SU,
  258. HARDWARE_TYPE_RTL8192CE,
  259. HARDWARE_TYPE_RTL8192CU,
  260. HARDWARE_TYPE_RTL8192DE,
  261. HARDWARE_TYPE_RTL8192DU,
  262. HARDWARE_TYPE_RTL8723AE,
  263. HARDWARE_TYPE_RTL8723AU,
  264. HARDWARE_TYPE_RTL8723AS,
  265. HARDWARE_TYPE_RTL8188EE,
  266. HARDWARE_TYPE_RTL8188EU,
  267. HARDWARE_TYPE_RTL8188ES,
  268. // NEW_GENERATION_IC
  269. HARDWARE_TYPE_RTL8192EE,
  270. HARDWARE_TYPE_RTL8192EU,
  271. HARDWARE_TYPE_RTL8192ES,
  272. HARDWARE_TYPE_RTL8812E,
  273. HARDWARE_TYPE_RTL8812AU,
  274. HARDWARE_TYPE_RTL8811AU,
  275. HARDWARE_TYPE_RTL8821E,
  276. HARDWARE_TYPE_RTL8821U,
  277. HARDWARE_TYPE_RTL8821S,
  278. HARDWARE_TYPE_RTL8723BE,
  279. HARDWARE_TYPE_RTL8723BU,
  280. HARDWARE_TYPE_RTL8723BS,
  281. HARDWARE_TYPE_MAX,
  282. }HARDWARE_TYPE;
  283. #define IS_NEW_GENERATION_IC(_Adapter) (((PADAPTER)_Adapter)->HardwareType >=HARDWARE_TYPE_RTL8192EE)
  284. //
  285. // RTL8192C Series
  286. //
  287. #define IS_HARDWARE_TYPE_8192CE(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8192CE)
  288. #define IS_HARDWARE_TYPE_8192CU(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8192CU)
  289. #define IS_HARDWARE_TYPE_8192C(_Adapter) \
  290. (IS_HARDWARE_TYPE_8192CE(_Adapter) || IS_HARDWARE_TYPE_8192CU(_Adapter))
  291. //
  292. // RTL8192D Series
  293. //
  294. #define IS_HARDWARE_TYPE_8192DE(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8192DE)
  295. #define IS_HARDWARE_TYPE_8192DU(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8192DU)
  296. #define IS_HARDWARE_TYPE_8192D(_Adapter) \
  297. (IS_HARDWARE_TYPE_8192DE(_Adapter) || IS_HARDWARE_TYPE_8192DU(_Adapter))
  298. //
  299. // RTL8723A Series
  300. //
  301. #define IS_HARDWARE_TYPE_8723AE(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8723AE)
  302. #define IS_HARDWARE_TYPE_8723AU(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8723AU)
  303. #define IS_HARDWARE_TYPE_8723AS(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8723AS)
  304. #define IS_HARDWARE_TYPE_8723A(_Adapter) \
  305. (IS_HARDWARE_TYPE_8723AE(_Adapter) || IS_HARDWARE_TYPE_8723AU(_Adapter) || IS_HARDWARE_TYPE_8723AS(_Adapter))
  306. //
  307. // RTL8188E Series
  308. //
  309. #define IS_HARDWARE_TYPE_8188EE(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8188EE)
  310. #define IS_HARDWARE_TYPE_8188EU(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8188EU)
  311. #define IS_HARDWARE_TYPE_8188ES(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8188ES)
  312. #define IS_HARDWARE_TYPE_8188E(_Adapter) \
  313. (IS_HARDWARE_TYPE_8188EE(_Adapter) || IS_HARDWARE_TYPE_8188EU(_Adapter) || IS_HARDWARE_TYPE_8188ES(_Adapter))
  314. #define IS_HARDWARE_TYPE_OLDER_THAN_8812A(_Adapter) \
  315. (IS_HARDWARE_TYPE_8192D(_Adapter) || IS_HARDWARE_TYPE_8192C(_Adapter) ||\
  316. IS_HARDWARE_TYPE_8723AE(_Adapter) || IS_HARDWARE_TYPE_8723AU(_Adapter) || IS_HARDWARE_TYPE_8723AS(_Adapter) ||\
  317. IS_HARDWARE_TYPE_8188EE(_Adapter) || IS_HARDWARE_TYPE_8188EU(_Adapter) || IS_HARDWARE_TYPE_8188ES(_Adapter)\
  318. )
  319. // RTL8812 Series
  320. #define IS_HARDWARE_TYPE_8812E(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8812E)
  321. #define IS_HARDWARE_TYPE_8812AU(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8812AU)
  322. #define IS_HARDWARE_TYPE_8812(_Adapter) \
  323. (IS_HARDWARE_TYPE_8812E(_Adapter) || IS_HARDWARE_TYPE_8812AU(_Adapter))
  324. // RTL8821 Series
  325. #define IS_HARDWARE_TYPE_8821E(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8821E)
  326. #define IS_HARDWARE_TYPE_8811AU(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8811AU)
  327. #define IS_HARDWARE_TYPE_8821U(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8821U ||\
  328. ((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8811AU)
  329. #define IS_HARDWARE_TYPE_8821S(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8821S)
  330. #define IS_HARDWARE_TYPE_8821(_Adapter) \
  331. (IS_HARDWARE_TYPE_8821E(_Adapter) || IS_HARDWARE_TYPE_8821U(_Adapter)|| IS_HARDWARE_TYPE_8821S(_Adapter))
  332. #define IS_HARDWARE_TYPE_JAGUAR(_Adapter) \
  333. (IS_HARDWARE_TYPE_8812(_Adapter) || IS_HARDWARE_TYPE_8821(_Adapter))
  334. //RTL8192E Series
  335. #define IS_HARDWARE_TYPE_8192EE(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8192EE)
  336. #define IS_HARDWARE_TYPE_8192EU(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8192EU)
  337. #define IS_HARDWARE_TYPE_8192ES(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8192ES)
  338. #define IS_HARDWARE_TYPE_8192E(_Adapter) \
  339. (IS_HARDWARE_TYPE_8192EE(_Adapter) || IS_HARDWARE_TYPE_8192EU(_Adapter) ||IS_HARDWARE_TYPE_8192ES(_Adapter))
  340. #define IS_HARDWARE_TYPE_8723BE(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8723BE)
  341. #define IS_HARDWARE_TYPE_8723BU(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8723BU)
  342. #define IS_HARDWARE_TYPE_8723BS(_Adapter) (((PADAPTER)_Adapter)->HardwareType==HARDWARE_TYPE_RTL8723BS)
  343. #define IS_HARDWARE_TYPE_8723B(_Adapter) \
  344. (IS_HARDWARE_TYPE_8723BE(_Adapter) || IS_HARDWARE_TYPE_8723BU(_Adapter) ||IS_HARDWARE_TYPE_8723BS(_Adapter))
  345. typedef struct eeprom_priv EEPROM_EFUSE_PRIV, *PEEPROM_EFUSE_PRIV;
  346. #define GET_EEPROM_EFUSE_PRIV(adapter) (&adapter->eeprompriv)
  347. #define is_boot_from_eeprom(adapter) (adapter->eeprompriv.EepromOrEfuse)
  348. #ifdef CONFIG_WOWLAN
  349. typedef enum _wowlan_subcode{
  350. WOWLAN_PATTERN_MATCH = 1,
  351. WOWLAN_MAGIC_PACKET = 2,
  352. WOWLAN_UNICAST = 3,
  353. WOWLAN_SET_PATTERN = 4,
  354. WOWLAN_DUMP_REG = 5,
  355. WOWLAN_ENABLE = 6,
  356. WOWLAN_DISABLE = 7,
  357. WOWLAN_STATUS = 8,
  358. WOWLAN_DEBUG_RELOAD_FW = 9,
  359. WOWLAN_DEBUG_1 =10,
  360. WOWLAN_DEBUG_2 =11
  361. }wowlan_subcode;
  362. struct wowlan_ioctl_param{
  363. unsigned int subcode;
  364. unsigned int subcode_value;
  365. unsigned int wakeup_reason;
  366. unsigned int len;
  367. unsigned char pattern[0];
  368. };
  369. #define Rx_Pairwisekey 0x01
  370. #define Rx_GTK 0x02
  371. #define Rx_DisAssoc 0x04
  372. #define Rx_DeAuth 0x08
  373. #define FWDecisionDisconnect 0x10
  374. #define Rx_MagicPkt 0x21
  375. #define Rx_UnicastPkt 0x22
  376. #define Rx_PatternPkt 0x23
  377. #endif // CONFIG_WOWLAN
  378. void rtw_hal_def_value_init(_adapter *padapter);
  379. void rtw_hal_free_data(_adapter *padapter);
  380. void rtw_hal_dm_init(_adapter *padapter);
  381. void rtw_hal_dm_deinit(_adapter *padapter);
  382. void rtw_hal_sw_led_init(_adapter *padapter);
  383. void rtw_hal_sw_led_deinit(_adapter *padapter);
  384. u32 rtw_hal_power_on(_adapter *padapter);
  385. uint rtw_hal_init(_adapter *padapter);
  386. uint rtw_hal_deinit(_adapter *padapter);
  387. void rtw_hal_stop(_adapter *padapter);
  388. void rtw_hal_set_hwreg(PADAPTER padapter, u8 variable, u8 *val);
  389. void rtw_hal_get_hwreg(PADAPTER padapter, u8 variable, u8 *val);
  390. void rtw_hal_chip_configure(_adapter *padapter);
  391. void rtw_hal_read_chip_info(_adapter *padapter);
  392. void rtw_hal_read_chip_version(_adapter *padapter);
  393. u8 rtw_hal_set_def_var(_adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pValue);
  394. u8 rtw_hal_get_def_var(_adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pValue);
  395. void rtw_hal_set_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet);
  396. void rtw_hal_get_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet);
  397. void rtw_hal_enable_interrupt(_adapter *padapter);
  398. void rtw_hal_disable_interrupt(_adapter *padapter);
  399. u32 rtw_hal_inirp_init(_adapter *padapter);
  400. u32 rtw_hal_inirp_deinit(_adapter *padapter);
  401. u8 rtw_hal_intf_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id, u8* val);
  402. s32 rtw_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe);
  403. s32 rtw_hal_xmit(_adapter *padapter, struct xmit_frame *pxmitframe);
  404. s32 rtw_hal_mgnt_xmit(_adapter *padapter, struct xmit_frame *pmgntframe);
  405. s32 rtw_hal_init_xmit_priv(_adapter *padapter);
  406. void rtw_hal_free_xmit_priv(_adapter *padapter);
  407. s32 rtw_hal_init_recv_priv(_adapter *padapter);
  408. void rtw_hal_free_recv_priv(_adapter *padapter);
  409. void rtw_hal_update_ra_mask(struct sta_info *psta, u8 rssi_level);
  410. void rtw_hal_add_ra_tid(_adapter *padapter, u32 bitmap, u8* arg, u8 rssi_level);
  411. void rtw_hal_clone_data(_adapter *dst_padapter, _adapter *src_padapter);
  412. void rtw_hal_start_thread(_adapter *padapter);
  413. void rtw_hal_stop_thread(_adapter *padapter);
  414. void rtw_hal_bcn_related_reg_setting(_adapter *padapter);
  415. u32 rtw_hal_read_bbreg(_adapter *padapter, u32 RegAddr, u32 BitMask);
  416. void rtw_hal_write_bbreg(_adapter *padapter, u32 RegAddr, u32 BitMask, u32 Data);
  417. u32 rtw_hal_read_rfreg(_adapter *padapter, u32 eRFPath, u32 RegAddr, u32 BitMask);
  418. void rtw_hal_write_rfreg(_adapter *padapter, u32 eRFPath, u32 RegAddr, u32 BitMask, u32 Data);
  419. #define PHY_QueryBBReg(Adapter, RegAddr, BitMask) rtw_hal_read_bbreg((Adapter), (RegAddr), (BitMask))
  420. #define PHY_SetBBReg(Adapter, RegAddr, BitMask, Data) rtw_hal_write_bbreg((Adapter), (RegAddr), (BitMask), (Data))
  421. #define PHY_QueryRFReg(Adapter, eRFPath, RegAddr, BitMask) rtw_hal_read_rfreg((Adapter), (eRFPath), (RegAddr), (BitMask))
  422. #define PHY_SetRFReg(Adapter, eRFPath, RegAddr, BitMask, Data) rtw_hal_write_rfreg((Adapter), (eRFPath), (RegAddr), (BitMask), (Data))
  423. s32 rtw_hal_interrupt_handler(_adapter *padapter);
  424. void rtw_hal_set_bwmode(_adapter *padapter, CHANNEL_WIDTH Bandwidth, u8 Offset);
  425. void rtw_hal_set_chan(_adapter *padapter, u8 channel);
  426. void rtw_hal_set_chnl_bw(_adapter *padapter, u8 channel, CHANNEL_WIDTH Bandwidth, u8 Offset40, u8 Offset80);
  427. void rtw_hal_dm_watchdog(_adapter *padapter);
  428. #ifdef CONFIG_ANTENNA_DIVERSITY
  429. u8 rtw_hal_antdiv_before_linked(_adapter *padapter);
  430. void rtw_hal_antdiv_rssi_compared(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src);
  431. #endif
  432. #ifdef CONFIG_HOSTAPD_MLME
  433. s32 rtw_hal_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt);
  434. #endif
  435. #ifdef DBG_CONFIG_ERROR_DETECT
  436. void rtw_hal_sreset_init(_adapter *padapter);
  437. void rtw_hal_sreset_reset(_adapter *padapter);
  438. void rtw_hal_sreset_reset_value(_adapter *padapter);
  439. void rtw_hal_sreset_xmit_status_check(_adapter *padapter);
  440. void rtw_hal_sreset_linked_status_check (_adapter *padapter);
  441. u8 rtw_hal_sreset_get_wifi_status(_adapter *padapter);
  442. bool rtw_hal_sreset_inprogress(_adapter *padapter);
  443. #endif
  444. #ifdef CONFIG_IOL
  445. int rtw_hal_iol_cmd(ADAPTER *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt);
  446. #endif
  447. #ifdef CONFIG_XMIT_THREAD_MODE
  448. s32 rtw_hal_xmit_thread_handler(_adapter *padapter);
  449. #endif
  450. void rtw_hal_notch_filter(_adapter * adapter, bool enable);
  451. void rtw_hal_reset_security_engine(_adapter * adapter);
  452. s32 rtw_hal_c2h_handler(_adapter *adapter, struct c2h_evt_hdr *c2h_evt);
  453. c2h_id_filter rtw_hal_c2h_id_filter_ccx(_adapter *adapter);
  454. #endif //__HAL_INTF_H__