rtl8192c_hal.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  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 __RTL8192C_HAL_H__
  21. #define __RTL8192C_HAL_H__
  22. //#include "hal_com.h"
  23. #if 1
  24. #include "hal_data.h"
  25. #else
  26. #include "../hal/OUTSRC/odm_precomp.h"
  27. #endif
  28. #include "drv_types.h"
  29. #include "rtl8192c_spec.h"
  30. #include "Hal8192CPhyReg.h"
  31. #include "Hal8192CPhyCfg.h"
  32. #include "rtl8192c_rf.h"
  33. #include "rtl8192c_dm.h"
  34. #include "rtl8192c_recv.h"
  35. #include "rtl8192c_xmit.h"
  36. #include "rtl8192c_cmd.h"
  37. #include "rtl8192c_led.h"
  38. #ifdef DBG_CONFIG_ERROR_DETECT
  39. #include "rtl8192c_sreset.h"
  40. #endif
  41. #ifdef CONFIG_PCI_HCI
  42. #define RTL819X_DEFAULT_RF_TYPE RF_2T2R
  43. //#define RTL819X_DEFAULT_RF_TYPE RF_1T2R
  44. #define RTL819X_TOTAL_RF_PATH 2
  45. //2TODO: The following need to check!!
  46. #define RTL8192C_FW_TSMC_IMG "rtl8192CE\\rtl8192cfwT.bin"
  47. #define RTL8192C_FW_UMC_IMG "rtl8192CE\\rtl8192cfwU.bin"
  48. #define RTL8192C_FW_UMC_B_IMG "rtl8192CE\\rtl8192cfwU_B.bin"
  49. #define RTL8188C_PHY_REG "rtl8192CE\\PHY_REG_1T.txt"
  50. #define RTL8188C_PHY_RADIO_A "rtl8192CE\\radio_a_1T.txt"
  51. #define RTL8188C_PHY_RADIO_B "rtl8192CE\\radio_b_1T.txt"
  52. #define RTL8188C_AGC_TAB "rtl8192CE\\AGC_TAB_1T.txt"
  53. #define RTL8188C_PHY_MACREG "rtl8192CE\\MACREG_1T.txt"
  54. #define RTL8192C_PHY_REG "rtl8192CE\\PHY_REG_2T.txt"
  55. #define RTL8192C_PHY_RADIO_A "rtl8192CE\\radio_a_2T.txt"
  56. #define RTL8192C_PHY_RADIO_B "rtl8192CE\\radio_b_2T.txt"
  57. #define RTL8192C_AGC_TAB "rtl8192CE\\AGC_TAB_2T.txt"
  58. #define RTL8192C_PHY_MACREG "rtl8192CE\\MACREG_2T.txt"
  59. #define RTL819X_PHY_MACPHY_REG "rtl8192CE\\MACPHY_reg.txt"
  60. #define RTL819X_PHY_MACPHY_REG_PG "rtl8192CE\\MACPHY_reg_PG.txt"
  61. #define RTL819X_PHY_MACREG "rtl8192CE\\MAC_REG.txt"
  62. #define RTL819X_PHY_REG "rtl8192CE\\PHY_REG.txt"
  63. #define RTL819X_PHY_REG_1T2R "rtl8192CE\\PHY_REG_1T2R.txt"
  64. #define RTL819X_PHY_REG_to1T1R "rtl8192CE\\phy_to1T1R_a.txt"
  65. #define RTL819X_PHY_REG_to1T2R "rtl8192CE\\phy_to1T2R.txt"
  66. #define RTL819X_PHY_REG_to2T2R "rtl8192CE\\phy_to2T2R.txt"
  67. #define RTL819X_PHY_REG_PG "rtl8192CE\\PHY_REG_PG.txt"
  68. #define RTL819X_AGC_TAB "rtl8192CE\\AGC_TAB.txt"
  69. #define RTL819X_PHY_RADIO_A "rtl8192CE\\radio_a.txt"
  70. #define RTL819X_PHY_RADIO_A_1T "rtl8192CE\\radio_a_1t.txt"
  71. #define RTL819X_PHY_RADIO_A_2T "rtl8192CE\\radio_a_2t.txt"
  72. #define RTL819X_PHY_RADIO_B "rtl8192CE\\radio_b.txt"
  73. #define RTL819X_PHY_RADIO_B_GM "rtl8192CE\\radio_b_gm.txt"
  74. #define RTL819X_PHY_RADIO_C "rtl8192CE\\radio_c.txt"
  75. #define RTL819X_PHY_RADIO_D "rtl8192CE\\radio_d.txt"
  76. #define RTL819X_EEPROM_MAP "rtl8192CE\\8192ce.map"
  77. #define RTL819X_EFUSE_MAP "rtl8192CE\\8192ce.map"
  78. //---------------------------------------------------------------------
  79. // RTL8723E From file
  80. //---------------------------------------------------------------------
  81. // The file name "_2T" is for 92CE, "_1T" is for 88CE. Modified by tynli. 2009.11.24.
  82. #define Rtl819XFwTSMCImageArray Rtl8192CEFwTSMCImgArray
  83. #define Rtl819XFwUMCACutImageArray Rtl8192CEFwUMCACutImgArray
  84. #define Rtl819XFwUMCBCutImageArray Rtl8192CEFwUMCBCutImgArray
  85. // #define Rtl8723FwUMCImageArray Rtl8192CEFwUMC8723ImgArray
  86. #define Rtl819XMAC_Array Rtl8192CEMAC_2T_Array
  87. #define Rtl819XAGCTAB_2TArray Rtl8192CEAGCTAB_2TArray
  88. #define Rtl819XAGCTAB_1TArray Rtl8192CEAGCTAB_1TArray
  89. #define Rtl819XPHY_REG_2TArray Rtl8192CEPHY_REG_2TArray
  90. #define Rtl819XPHY_REG_1TArray Rtl8192CEPHY_REG_1TArray
  91. #define Rtl819XRadioA_2TArray Rtl8192CERadioA_2TArray
  92. #define Rtl819XRadioA_1TArray Rtl8192CERadioA_1TArray
  93. #define Rtl819XRadioB_2TArray Rtl8192CERadioB_2TArray
  94. #define Rtl819XRadioB_1TArray Rtl8192CERadioB_1TArray
  95. #define Rtl819XPHY_REG_Array_PG Rtl8192CEPHY_REG_Array_PG
  96. #define Rtl819XPHY_REG_Array_MP Rtl8192CEPHY_REG_Array_MP
  97. #define PHY_REG_2TArrayLength Rtl8192CEPHY_REG_2TArrayLength
  98. #define PHY_REG_1TArrayLength Rtl8192CEPHY_REG_1TArrayLength
  99. #define PHY_ChangeTo_1T1RArrayLength Rtl8192CEPHY_ChangeTo_1T1RArrayLength
  100. #define PHY_ChangeTo_1T2RArrayLength Rtl8192CEPHY_ChangeTo_1T2RArrayLength
  101. #define PHY_ChangeTo_2T2RArrayLength Rtl8192CEPHY_ChangeTo_2T2RArrayLength
  102. #define PHY_REG_Array_PGLength Rtl8192CEPHY_REG_Array_PGLength
  103. //#define PHY_REG_Array_PG_mCardLength Rtl8192CEPHY_REG_Array_PG_mCardLength
  104. #define PHY_REG_Array_MPLength Rtl8192CEPHY_REG_Array_MPLength
  105. #define PHY_REG_Array_MPLength Rtl8192CEPHY_REG_Array_MPLength
  106. //#define PHY_REG_1T_mCardArrayLength Rtl8192CEPHY_REG_1T_mCardArrayLength
  107. //#define PHY_REG_2T_mCardArrayLength Rtl8192CEPHY_REG_2T_mCardArrayLength
  108. //#define PHY_REG_Array_PG_HPLength Rtl8192CEPHY_REG_Array_PG_HPLength
  109. #define RadioA_2TArrayLength Rtl8192CERadioA_2TArrayLength
  110. #define RadioB_2TArrayLength Rtl8192CERadioB_2TArrayLength
  111. #define RadioA_1TArrayLength Rtl8192CERadioA_1TArrayLength
  112. #define RadioB_1TArrayLength Rtl8192CERadioB_1TArrayLength
  113. //#define RadioA_1T_mCardArrayLength Rtl8192CERadioA_1T_mCardArrayLength
  114. //#define RadioB_1T_mCardArrayLength Rtl8192CERadioB_1T_mCardArrayLength
  115. //#define RadioA_1T_HPArrayLength Rtl8192CERadioA_1T_HPArrayLength
  116. #define RadioB_GM_ArrayLength Rtl8192CERadioB_GM_ArrayLength
  117. #define MAC_2T_ArrayLength Rtl8192CEMAC_2T_ArrayLength
  118. #define MACPHY_Array_PGLength Rtl8192CEMACPHY_Array_PGLength
  119. #define AGCTAB_2TArrayLength Rtl8192CEAGCTAB_2TArrayLength
  120. #define AGCTAB_1TArrayLength Rtl8192CEAGCTAB_1TArrayLength
  121. //#define AGCTAB_1T_HPArrayLength Rtl8192CEAGCTAB_1T_HPArrayLength
  122. #elif defined(CONFIG_USB_HCI)
  123. //2TODO: We should define 8192S firmware related macro settings here!!
  124. #define RTL819X_DEFAULT_RF_TYPE RF_1T2R
  125. #define RTL819X_TOTAL_RF_PATH 2
  126. //TODO: The following need to check!!
  127. #define RTL8192C_FW_TSMC_IMG "rtl8192CU\\rtl8192cfwT.bin"
  128. #define RTL8192C_FW_UMC_IMG "rtl8192CU\\rtl8192cfwU.bin"
  129. #define RTL8192C_FW_UMC_B_IMG "rtl8192CU\\rtl8192cfwU_B.bin"
  130. //#define RTL819X_FW_BOOT_IMG "rtl8192CU\\boot.img"
  131. //#define RTL819X_FW_MAIN_IMG "rtl8192CU\\main.img"
  132. //#define RTL819X_FW_DATA_IMG "rtl8192CU\\data.img"
  133. #define RTL8188C_PHY_REG "rtl8188CU\\PHY_REG.txt"
  134. #define RTL8188C_PHY_RADIO_A "rtl8188CU\\radio_a.txt"
  135. #define RTL8188C_PHY_RADIO_B "rtl8188CU\\radio_b.txt"
  136. #define RTL8188C_PHY_RADIO_A_mCard "rtl8192CU\\radio_a_1T_mCard.txt"
  137. #define RTL8188C_PHY_RADIO_B_mCard "rtl8192CU\\radio_b_1T_mCard.txt"
  138. #define RTL8188C_PHY_RADIO_A_HP "rtl8192CU\\radio_a_1T_HP.txt"
  139. #define RTL8188C_AGC_TAB "rtl8188CU\\AGC_TAB.txt"
  140. #define RTL8188C_PHY_MACREG "rtl8188CU\\MACREG.txt"
  141. #define RTL8192C_PHY_REG "rtl8192CU\\PHY_REG.txt"
  142. #define RTL8192C_PHY_RADIO_A "rtl8192CU\\radio_a.txt"
  143. #define RTL8192C_PHY_RADIO_B "rtl8192CU\\radio_b.txt"
  144. #define RTL8192C_AGC_TAB "rtl8192CU\\AGC_TAB.txt"
  145. #define RTL8192C_PHY_MACREG "rtl8192CU\\MACREG.txt"
  146. #define RTL819X_PHY_REG_PG "rtl8192CU\\PHY_REG_PG.txt"
  147. //---------------------------------------------------------------------
  148. // RTL8723U From file
  149. //---------------------------------------------------------------------
  150. // The file name "_2T" is for 92CU, "_1T" is for 88CU. Modified by tynli. 2009.11.24.
  151. #define Rtl819XFwImageArray Rtl8192CUFwTSMCImgArray
  152. #define Rtl819XFwTSMCImageArray Rtl8192CUFwTSMCImgArray
  153. #define Rtl819XFwUMCACutImageArray Rtl8192CUFwUMCACutImgArray
  154. #define Rtl819XFwUMCBCutImageArray Rtl8192CUFwUMCBCutImgArray
  155. #define Rtl819XMAC_Array Rtl8192CUMAC_2T_Array
  156. #define Rtl819XAGCTAB_2TArray Rtl8192CUAGCTAB_2TArray
  157. #define Rtl819XAGCTAB_1TArray Rtl8192CUAGCTAB_1TArray
  158. #define Rtl819XAGCTAB_1T_HPArray Rtl8192CUAGCTAB_1T_HPArray
  159. #define Rtl819XPHY_REG_2TArray Rtl8192CUPHY_REG_2TArray
  160. #define Rtl819XPHY_REG_1TArray Rtl8192CUPHY_REG_1TArray
  161. #define Rtl819XPHY_REG_1T_mCardArray Rtl8192CUPHY_REG_1T_mCardArray
  162. #define Rtl819XPHY_REG_2T_mCardArray Rtl8192CUPHY_REG_2T_mCardArray
  163. #define Rtl819XPHY_REG_1T_HPArray Rtl8192CUPHY_REG_1T_HPArray
  164. #define Rtl819XRadioA_2TArray Rtl8192CURadioA_2TArray
  165. #define Rtl819XRadioA_1TArray Rtl8192CURadioA_1TArray
  166. #define Rtl819XRadioA_1T_mCardArray Rtl8192CURadioA_1T_mCardArray
  167. #define Rtl819XRadioB_2TArray Rtl8192CURadioB_2TArray
  168. #define Rtl819XRadioB_1TArray Rtl8192CURadioB_1TArray
  169. #define Rtl819XRadioB_1T_mCardArray Rtl8192CURadioB_1T_mCardArray
  170. #define Rtl819XRadioA_1T_HPArray Rtl8192CURadioA_1T_HPArray
  171. #define Rtl819XPHY_REG_Array_PG Rtl8192CUPHY_REG_Array_PG
  172. #define Rtl819XPHY_REG_Array_PG_mCard Rtl8192CUPHY_REG_Array_PG_mCard
  173. #define Rtl819XPHY_REG_Array_PG_HP Rtl8192CUPHY_REG_Array_PG_HP
  174. #define Rtl819XPHY_REG_Array_MP Rtl8192CUPHY_REG_Array_MP
  175. #define PHY_REG_2TArrayLength Rtl8192CUPHY_REG_2TArrayLength
  176. #define PHY_REG_1TArrayLength Rtl8192CUPHY_REG_1TArrayLength
  177. #define PHY_ChangeTo_1T1RArrayLength Rtl8192CUPHY_ChangeTo_1T1RArrayLength
  178. #define PHY_ChangeTo_1T2RArrayLength Rtl8192CUPHY_ChangeTo_1T2RArrayLength
  179. #define PHY_ChangeTo_2T2RArrayLength Rtl8192CUPHY_ChangeTo_2T2RArrayLength
  180. #define PHY_REG_Array_PGLength Rtl8192CUPHY_REG_Array_PGLength
  181. #define PHY_REG_Array_PG_mCardLength Rtl8192CUPHY_REG_Array_PG_mCardLength
  182. #define PHY_REG_Array_MPLength Rtl8192CUPHY_REG_Array_MPLength
  183. #define PHY_REG_Array_MPLength Rtl8192CUPHY_REG_Array_MPLength
  184. #define PHY_REG_1T_mCardArrayLength Rtl8192CUPHY_REG_1T_mCardArrayLength
  185. #define PHY_REG_2T_mCardArrayLength Rtl8192CUPHY_REG_2T_mCardArrayLength
  186. #define PHY_REG_Array_PG_HPLength Rtl8192CUPHY_REG_Array_PG_HPLength
  187. #define RadioA_2TArrayLength Rtl8192CURadioA_2TArrayLength
  188. #define RadioB_2TArrayLength Rtl8192CURadioB_2TArrayLength
  189. #define RadioA_1TArrayLength Rtl8192CURadioA_1TArrayLength
  190. #define RadioB_1TArrayLength Rtl8192CURadioB_1TArrayLength
  191. #define RadioA_1T_mCardArrayLength Rtl8192CURadioA_1T_mCardArrayLength
  192. #define RadioB_1T_mCardArrayLength Rtl8192CURadioB_1T_mCardArrayLength
  193. #define RadioA_1T_HPArrayLength Rtl8192CURadioA_1T_HPArrayLength
  194. #define RadioB_GM_ArrayLength Rtl8192CURadioB_GM_ArrayLength
  195. #define MAC_2T_ArrayLength Rtl8192CUMAC_2T_ArrayLength
  196. #define MACPHY_Array_PGLength Rtl8192CUMACPHY_Array_PGLength
  197. #define AGCTAB_2TArrayLength Rtl8192CUAGCTAB_2TArrayLength
  198. #define AGCTAB_1TArrayLength Rtl8192CUAGCTAB_1TArrayLength
  199. #define AGCTAB_1T_HPArrayLength Rtl8192CUAGCTAB_1T_HPArrayLength
  200. #define PHY_REG_1T_HPArrayLength Rtl8192CUPHY_REG_1T_HPArrayLength
  201. #endif
  202. #define FW_8192C_SIZE 16384+32//16k
  203. #define FW_8192C_START_ADDRESS 0x1000
  204. //#define FW_8192C_END_ADDRESS 0x3FFF //Filen said this is for test chip
  205. #define FW_8192C_END_ADDRESS 0x1FFF
  206. #define IS_FW_HEADER_EXIST_92C(_pFwHdr) ((le16_to_cpu(_pFwHdr->Signature)&0xFFF0) == 0x92C0 ||\
  207. (le16_to_cpu(_pFwHdr->Signature)&0xFFF0) == 0x88C0 ||\
  208. (le16_to_cpu(_pFwHdr->Signature)&0xFFF0) == 0x2300)
  209. typedef struct _RT_FIRMWARE_8192C{
  210. FIRMWARE_SOURCE eFWSource;
  211. u8* szFwBuffer;
  212. u32 ulFwLength;
  213. } RT_FIRMWARE_8192C, *PRT_FIRMWARE_8192C;
  214. //
  215. // This structure must be cared byte-ordering
  216. //
  217. // Added by tynli. 2009.12.04.
  218. typedef struct _RT_8192C_FIRMWARE_HDR {//8-byte alinment required
  219. //--- LONG WORD 0 ----
  220. u16 Signature; // 92C0: test chip; 92C, 88C0: test chip; 88C1: MP A-cut; 92C1: MP A-cut
  221. u8 Category; // AP/NIC and USB/PCI
  222. u8 Function; // Reserved for different FW function indcation, for further use when driver needs to download different FW in different conditions
  223. u16 Version; // FW Version
  224. u8 Subversion; // FW Subversion, default 0x00
  225. u16 Rsvd1;
  226. //--- LONG WORD 1 ----
  227. u8 Month; // Release time Month field
  228. u8 Date; // Release time Date field
  229. u8 Hour; // Release time Hour field
  230. u8 Minute; // Release time Minute field
  231. u16 RamCodeSize; // The size of RAM code
  232. u16 Rsvd2;
  233. //--- LONG WORD 2 ----
  234. u32 SvnIdx; // The SVN entry index
  235. u32 Rsvd3;
  236. //--- LONG WORD 3 ----
  237. u32 Rsvd4;
  238. u32 Rsvd5;
  239. }RT_8192C_FIRMWARE_HDR, *PRT_8192C_FIRMWARE_HDR;
  240. #define DRIVER_EARLY_INT_TIME_8192C 0x05
  241. #define BCN_DMA_ATIME_INT_TIME_8192C 0x02
  242. // Note: We will divide number of page equally for each queue other than public queue!
  243. #define TX_TOTAL_PAGE_NUMBER_8192C 0xF8
  244. #define TX_PAGE_BOUNDARY (TX_TOTAL_PAGE_NUMBER_8192C + 1)
  245. // For Normal Chip Setting
  246. // (HPQ + LPQ + NPQ + PUBQ) shall be TX_TOTAL_PAGE_NUMBER_8192C
  247. #define NORMAL_PAGE_NUM_PUBQ 0xE7
  248. #define NORMAL_PAGE_NUM_HPQ 0x0C
  249. #define NORMAL_PAGE_NUM_LPQ 0x02
  250. #define NORMAL_PAGE_NUM_NPQ 0x02
  251. // For Test Chip Setting
  252. // (HPQ + LPQ + PUBQ) shall be TX_TOTAL_PAGE_NUMBER_8192C
  253. #define TEST_PAGE_NUM_PUBQ 0x7E
  254. // For Test Chip Setting
  255. #define WMM_TEST_TX_TOTAL_PAGE_NUMBER 0xF5
  256. #define WMM_TEST_TX_PAGE_BOUNDARY (WMM_TEST_TX_TOTAL_PAGE_NUMBER + 1) //F6
  257. #define WMM_TEST_PAGE_NUM_PUBQ 0xA3
  258. #define WMM_TEST_PAGE_NUM_HPQ 0x29
  259. #define WMM_TEST_PAGE_NUM_LPQ 0x29
  260. //Note: For Normal Chip Setting ,modify later
  261. #define WMM_NORMAL_TX_TOTAL_PAGE_NUMBER 0xF5
  262. #define WMM_NORMAL_TX_PAGE_BOUNDARY (WMM_TEST_TX_TOTAL_PAGE_NUMBER + 1) //F6
  263. #define WMM_NORMAL_PAGE_NUM_PUBQ 0xB0
  264. #define WMM_NORMAL_PAGE_NUM_HPQ 0x29
  265. #define WMM_NORMAL_PAGE_NUM_LPQ 0x1C
  266. #define WMM_NORMAL_PAGE_NUM_NPQ 0x1C
  267. //-------------------------------------------------------------------------
  268. // Chip specific
  269. //-------------------------------------------------------------------------
  270. #define CHIP_BONDING_IDENTIFIER(_value) (((_value)>>22)&0x3)
  271. #define CHIP_BONDING_92C_1T2R 0x1
  272. #define CHIP_BONDING_88C_USB_MCARD 0x2
  273. #define CHIP_BONDING_88C_USB_HP 0x1
  274. //-------------------------------------------------------------------------
  275. // Channel Plan
  276. //-------------------------------------------------------------------------
  277. #define EFUSE_REAL_CONTENT_LEN 512
  278. #define EFUSE_MAP_LEN 128
  279. #define EFUSE_MAX_SECTION 16
  280. #define EFUSE_IC_ID_OFFSET 506 //For some inferiority IC purpose. added by Roger, 2009.09.02.
  281. #define AVAILABLE_EFUSE_ADDR(addr) (addr < EFUSE_REAL_CONTENT_LEN)
  282. //
  283. // <Roger_Notes> To prevent out of boundary programming case, leave 1byte and program full section
  284. // 9bytes + 1byt + 5bytes and pre 1byte.
  285. // For worst case:
  286. // | 1byte|----8bytes----|1byte|--5bytes--|
  287. // | | Reserved(14bytes) |
  288. //
  289. #define EFUSE_OOB_PROTECT_BYTES 15 // PG data exclude header, dummy 6 bytes frome CP test and reserved 1byte.
  290. #define EFUSE_MAP_LEN_8723 256
  291. #define EFUSE_MAX_SECTION_8723 32
  292. //========================================================
  293. // EFUSE for BT definition
  294. //========================================================
  295. #define EFUSE_BT_REAL_CONTENT_LEN 1536 // 512*3
  296. #define EFUSE_BT_MAP_LEN 1024 // 1k bytes
  297. #define EFUSE_BT_MAX_SECTION 128 // 1024/8
  298. #define EFUSE_PROTECT_BYTES_BANK 16
  299. enum c2h_id_8192c {
  300. C2H_DBG = 0,
  301. C2H_TSF = 1,
  302. C2H_AP_RPT_RSP = 2,
  303. C2H_CCX_TX_RPT = 3,
  304. C2H_BT_RSSI = 4,
  305. C2H_BT_OP_MODE = 5,
  306. C2H_EXT_RA_RPT = 6,
  307. C2H_HW_INFO_EXCH = 10,
  308. C2H_C2H_H2C_TEST = 11,
  309. C2H_BT_INFO = 12,
  310. C2H_BT_MP_INFO = 15,
  311. MAX_C2HEVENT
  312. };
  313. #ifdef CONFIG_PCI_HCI
  314. //
  315. // Function disabled.
  316. //
  317. #define DF_TX_BIT BIT0
  318. #define DF_RX_BIT BIT1
  319. #define DF_IO_BIT BIT2
  320. #define DF_IO_D3_BIT BIT3
  321. #define RT_DF_TYPE u32
  322. //#define RT_DISABLE_FUNC(__pAdapter, __FuncBits) ((__pAdapter)->DisabledFunctions |= ((RT_DF_TYPE)(__FuncBits)))
  323. //#define RT_ENABLE_FUNC(__pAdapter, __FuncBits) ((__pAdapter)->DisabledFunctions &= (~((RT_DF_TYPE)(__FuncBits))))
  324. //#define RT_IS_FUNC_DISABLED(__pAdapter, __FuncBits) ( (__pAdapter)->DisabledFunctions & (__FuncBits) )
  325. #define IS_MULTI_FUNC_CHIP(_Adapter) (((((PHAL_DATA_TYPE)(_Adapter->HalData))->MultiFunc) & (RT_MULTI_FUNC_BT|RT_MULTI_FUNC_GPS)) ? _TRUE : _FALSE)
  326. void InterruptRecognized8192CE(PADAPTER Adapter, PRT_ISR_CONTENT pIsrContent);
  327. VOID UpdateInterruptMask8192CE(PADAPTER Adapter, u32 AddMSR, u32 AddMSR1, u32 RemoveMSR, u32 RemoveMSR1);
  328. #endif
  329. #define GET_RF_TYPE(priv) (GET_HAL_DATA(priv)->rf_type)
  330. #define INCLUDE_MULTI_FUNC_BT(_Adapter) (GET_HAL_DATA(_Adapter)->MultiFunc & RT_MULTI_FUNC_BT)
  331. #define INCLUDE_MULTI_FUNC_GPS(_Adapter) (GET_HAL_DATA(_Adapter)->MultiFunc & RT_MULTI_FUNC_GPS)
  332. VOID rtl8192c_FirmwareSelfReset(IN PADAPTER Adapter);
  333. int FirmwareDownload92C(IN PADAPTER Adapter);
  334. VOID InitializeFirmwareVars92C(PADAPTER Adapter);
  335. u8 GetEEPROMSize8192C(PADAPTER Adapter);
  336. void rtl8192c_EfuseParseChnlPlan(PADAPTER padapter, u8 *hwinfo, BOOLEAN AutoLoadFail);
  337. HAL_VERSION rtl8192c_ReadChipVersion(IN PADAPTER Adapter);
  338. void rtl8192c_ReadBluetoothCoexistInfo(PADAPTER Adapter, u8 *PROMContent, BOOLEAN AutoloadFail);
  339. //void rtl8192c_free_hal_data(_adapter * padapter);
  340. VOID rtl8192c_EfuseParseIDCode(PADAPTER pAdapter, u8 *hwinfo);
  341. void rtl8192c_set_hal_ops(struct hal_ops *pHalFunc);
  342. void rtl8192c_clone_haldata(_adapter* dst_adapter, _adapter* src_adapter);
  343. s32 c2h_id_filter_ccx_8192c(u8 id);
  344. #endif