hal_data.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  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 __HAL_DATA_H__
  21. #define __HAL_DATA_H__
  22. #if 1//def CONFIG_SINGLE_IMG
  23. #include "../hal/OUTSRC/odm_precomp.h"
  24. //
  25. // <Roger_Notes> For RTL8723 WiFi/BT/GPS multi-function configuration. 2010.10.06.
  26. //
  27. typedef enum _RT_MULTI_FUNC{
  28. RT_MULTI_FUNC_NONE = 0x00,
  29. RT_MULTI_FUNC_WIFI = 0x01,
  30. RT_MULTI_FUNC_BT = 0x02,
  31. RT_MULTI_FUNC_GPS = 0x04,
  32. }RT_MULTI_FUNC,*PRT_MULTI_FUNC;
  33. //
  34. // <Roger_Notes> For RTL8723 WiFi PDn/GPIO polarity control configuration. 2010.10.08.
  35. //
  36. typedef enum _RT_POLARITY_CTL {
  37. RT_POLARITY_LOW_ACT = 0,
  38. RT_POLARITY_HIGH_ACT = 1,
  39. } RT_POLARITY_CTL, *PRT_POLARITY_CTL;
  40. // For RTL8723 regulator mode. by tynli. 2011.01.14.
  41. typedef enum _RT_REGULATOR_MODE {
  42. RT_SWITCHING_REGULATOR = 0,
  43. RT_LDO_REGULATOR = 1,
  44. } RT_REGULATOR_MODE, *PRT_REGULATOR_MODE;
  45. //
  46. // Interface type.
  47. //
  48. typedef enum _INTERFACE_SELECT_PCIE{
  49. INTF_SEL0_SOLO_MINICARD = 0, // WiFi solo-mCard
  50. INTF_SEL1_BT_COMBO_MINICARD = 1, // WiFi+BT combo-mCard
  51. INTF_SEL2_PCIe = 2, // PCIe Card
  52. } INTERFACE_SELECT_PCIE, *PINTERFACE_SELECT_PCIE;
  53. typedef enum _INTERFACE_SELECT_USB{
  54. INTF_SEL0_USB = 0, // USB
  55. INTF_SEL1_USB_High_Power = 1, // USB with high power PA
  56. INTF_SEL2_MINICARD = 2, // Minicard
  57. INTF_SEL3_USB_Solo = 3, // USB solo-Slim module
  58. INTF_SEL4_USB_Combo = 4, // USB Combo-Slim module
  59. INTF_SEL5_USB_Combo_MF = 5, // USB WiFi+BT Multi-Function Combo, i.e., Proprietary layout(AS-VAU) which is the same as SDIO card
  60. } INTERFACE_SELECT_USB, *PINTERFACE_SELECT_USB;
  61. typedef enum _RT_AMPDU_BRUST_MODE{
  62. RT_AMPDU_BRUST_NONE = 0,
  63. RT_AMPDU_BRUST_92D = 1,
  64. RT_AMPDU_BRUST_88E = 2,
  65. RT_AMPDU_BRUST_8812_4 = 3,
  66. RT_AMPDU_BRUST_8812_8 = 4,
  67. RT_AMPDU_BRUST_8812_12 = 5,
  68. RT_AMPDU_BRUST_8812_15 = 6,
  69. RT_AMPDU_BRUST_8723B = 7,
  70. }RT_AMPDU_BRUST,*PRT_AMPDU_BRUST_MODE;
  71. #define CHANNEL_MAX_NUMBER 14+24+21 // 14 is the max channel number
  72. #define CHANNEL_MAX_NUMBER_2G 14
  73. #define CHANNEL_MAX_NUMBER_5G 54 // Please refer to "phy_GetChnlGroup8812A" and "Hal_ReadTxPowerInfo8812A"
  74. #define CHANNEL_MAX_NUMBER_5G_80M 7
  75. #define CHANNEL_GROUP_MAX 3+9 // ch1~3, ch4~9, ch10~14 total three groups
  76. #define MAX_PG_GROUP 13
  77. #define MAX_REGULATION_NUM 3
  78. #define MAX_RF_PATH_NUM_IN_POWER_LIMIT_TABLE 4
  79. #define MAX_2_4G_BANDWITH_NUM 2
  80. #define MAX_2_4G_RATE_SECTION_NUM 3
  81. #define MAX_2_4G_CHANNEL_NUM 5 // adopt channel group instead of individual channel
  82. #define MAX_5G_BANDWITH_NUM 4
  83. #define MAX_5G_RATE_SECTION_NUM 4
  84. #define MAX_5G_CHANNEL_NUM 14 // adopt channel group instead of individual channel
  85. #define MAX_BASE_NUM_IN_PHY_REG_PG_2_4G 4 // CCK:1,OFDM:2, HT:2
  86. #define MAX_BASE_NUM_IN_PHY_REG_PG_5G 5 // OFDM:1, HT:2, VHT:2
  87. //###### duplicate code,will move to ODM #########
  88. #define IQK_MAC_REG_NUM 4
  89. #define IQK_ADDA_REG_NUM 16
  90. #define IQK_BB_REG_NUM 10
  91. #define IQK_BB_REG_NUM_92C 9
  92. #define IQK_BB_REG_NUM_92D 10
  93. #define IQK_BB_REG_NUM_test 6
  94. #define IQK_Matrix_Settings_NUM_92D 1+24+21
  95. #define HP_THERMAL_NUM 8
  96. //###### duplicate code,will move to ODM #########
  97. #ifdef CONFIG_RTL8192D
  98. typedef enum _MACPHY_MODE_8192D{
  99. SINGLEMAC_SINGLEPHY, //SMSP
  100. DUALMAC_DUALPHY, //DMDP
  101. DUALMAC_SINGLEPHY, //DMSP
  102. }MACPHY_MODE_8192D,*PMACPHY_MODE_8192D;
  103. #endif
  104. #ifdef CONFIG_USB_RX_AGGREGATION
  105. typedef enum _USB_RX_AGG_MODE{
  106. USB_RX_AGG_DISABLE,
  107. USB_RX_AGG_DMA,
  108. USB_RX_AGG_USB,
  109. USB_RX_AGG_MIX
  110. }USB_RX_AGG_MODE;
  111. //#define MAX_RX_DMA_BUFFER_SIZE 10240 // 10K for 8192C RX DMA buffer
  112. #endif
  113. struct dm_priv
  114. {
  115. u8 DM_Type;
  116. u8 DMFlag;
  117. u8 InitDMFlag;
  118. //u8 RSVD_1;
  119. u32 InitODMFlag;
  120. //* Upper and Lower Signal threshold for Rate Adaptive*/
  121. int UndecoratedSmoothedPWDB;
  122. int UndecoratedSmoothedCCK;
  123. int EntryMinUndecoratedSmoothedPWDB;
  124. int EntryMaxUndecoratedSmoothedPWDB;
  125. int MinUndecoratedPWDBForDM;
  126. int LastMinUndecoratedPWDBForDM;
  127. s32 UndecoratedSmoothedBeacon;
  128. #ifdef CONFIG_BT_COEXIST
  129. s32 BT_EntryMinUndecoratedSmoothedPWDB;
  130. s32 BT_EntryMaxUndecoratedSmoothedPWDB;
  131. #endif
  132. //###### duplicate code,will move to ODM #########
  133. //for High Power
  134. u8 bDynamicTxPowerEnable;
  135. u8 LastDTPLvl;
  136. u8 DynamicTxHighPowerLvl;//Add by Jacken Tx Power Control for Near/Far Range 2008/03/06
  137. //for tx power tracking
  138. u8 bTXPowerTracking;
  139. u8 TXPowercount;
  140. u8 bTXPowerTrackingInit;
  141. u8 TxPowerTrackControl; //for mp mode, turn off txpwrtracking as default
  142. u8 TM_Trigger;
  143. u8 ThermalMeter[2]; // ThermalMeter, index 0 for RFIC0, and 1 for RFIC1
  144. u8 ThermalValue;
  145. u8 ThermalValue_LCK;
  146. u8 ThermalValue_IQK;
  147. u8 ThermalValue_DPK;
  148. u8 bRfPiEnable;
  149. //u8 RSVD_2;
  150. //for APK
  151. u32 APKoutput[2][2]; //path A/B; output1_1a/output1_2a
  152. u8 bAPKdone;
  153. u8 bAPKThermalMeterIgnore;
  154. u8 bDPdone;
  155. u8 bDPPathAOK;
  156. u8 bDPPathBOK;
  157. //u8 RSVD_3;
  158. //u8 RSVD_4;
  159. //u8 RSVD_5;
  160. //for IQK
  161. u32 ADDA_backup[IQK_ADDA_REG_NUM];
  162. u32 IQK_MAC_backup[IQK_MAC_REG_NUM];
  163. u32 IQK_BB_backup_recover[9];
  164. u32 IQK_BB_backup[IQK_BB_REG_NUM];
  165. u8 PowerIndex_backup[6];
  166. u8 OFDM_index[2];
  167. u8 bCCKinCH14;
  168. u8 CCK_index;
  169. u8 bDoneTxpower;
  170. u8 CCK_index_HP;
  171. u8 OFDM_index_HP[2];
  172. u8 ThermalValue_HP[HP_THERMAL_NUM];
  173. u8 ThermalValue_HP_index;
  174. //u8 RSVD_6;
  175. //for TxPwrTracking2
  176. s32 RegE94;
  177. s32 RegE9C;
  178. s32 RegEB4;
  179. s32 RegEBC;
  180. u32 TXPowerTrackingCallbackCnt; //cosa add for debug
  181. u32 prv_traffic_idx; // edca turbo
  182. #ifdef CONFIG_RTL8192D
  183. u8 ThermalValue_AVG[AVG_THERMAL_NUM];
  184. u8 ThermalValue_AVG_index;
  185. u8 ThermalValue_RxGain;
  186. u8 ThermalValue_Crystal;
  187. u8 bReloadtxpowerindex;
  188. u32 RegD04_MP;
  189. u8 RegC04_MP;
  190. u8 Delta_IQK;
  191. u8 Delta_LCK;
  192. //u8 RSVD_7;
  193. BOOLEAN bDPKdone[2];
  194. //u16 RSVD_8;
  195. u32 RegA24;
  196. u32 RegRF3C[2]; //pathA / pathB
  197. #endif
  198. //###### duplicate code,will move to ODM #########
  199. // Add for Reading Initial Data Rate SEL Register 0x484 during watchdog. Using for fill tx desc. 2011.3.21 by Thomas
  200. u8 INIDATA_RATE[32];
  201. };
  202. typedef struct hal_com_data
  203. {
  204. HAL_VERSION VersionID;
  205. RT_MULTI_FUNC MultiFunc; // For multi-function consideration.
  206. RT_POLARITY_CTL PolarityCtl; // For Wifi PDn Polarity control.
  207. RT_REGULATOR_MODE RegulatorMode; // switching regulator or LDO
  208. u16 FirmwareVersion;
  209. u16 FirmwareVersionRev;
  210. u16 FirmwareSubVersion;
  211. u16 FirmwareSignature;
  212. //current WIFI_PHY values
  213. WIRELESS_MODE CurrentWirelessMode;
  214. CHANNEL_WIDTH CurrentChannelBW;
  215. BAND_TYPE CurrentBandType; //0:2.4G, 1:5G
  216. BAND_TYPE BandSet;
  217. u8 CurrentChannel;
  218. u8 CurrentCenterFrequencyIndex1;
  219. u8 nCur40MhzPrimeSC;// Control channel sub-carrier
  220. u8 nCur80MhzPrimeSC; //used for primary 40MHz of 80MHz mode
  221. u16 CustomerID;
  222. u16 BasicRateSet;
  223. u16 ForcedDataRate;// Force Data Rate. 0: Auto, 0x02: 1M ~ 0x6C: 54M.
  224. u32 ReceiveConfig;
  225. //rf_ctrl
  226. u8 rf_chip;
  227. u8 rf_type;
  228. u8 NumTotalRFPath;
  229. u8 InterfaceSel;
  230. u8 framesync;
  231. u32 framesyncC34;
  232. u8 framesyncMonitor;
  233. u8 DefaultInitialGain[4];
  234. //
  235. // EEPROM setting.
  236. //
  237. u16 EEPROMVID;
  238. u16 EEPROMSVID;
  239. #ifdef CONFIG_USB_HCI
  240. u16 EEPROMPID;
  241. u16 EEPROMSDID;
  242. #endif
  243. #ifdef CONFIG_PCI_HCI
  244. u16 EEPROMDID;
  245. u16 EEPROMSMID;
  246. #endif
  247. u8 EEPROMCustomerID;
  248. u8 EEPROMSubCustomerID;
  249. u8 EEPROMVersion;
  250. u8 EEPROMRegulatory;
  251. u8 EEPROMThermalMeter;
  252. u8 EEPROMBluetoothCoexist;
  253. u8 EEPROMBluetoothType;
  254. u8 EEPROMBluetoothAntNum;
  255. u8 EEPROMBluetoothAntIsolation;
  256. u8 EEPROMBluetoothRadioShared;
  257. u8 bTXPowerDataReadFromEEPORM;
  258. u8 bAPKThermalMeterIgnore;
  259. BOOLEAN EepromOrEfuse;
  260. u8 EfuseUsedPercentage;
  261. u16 EfuseUsedBytes;
  262. //u8 EfuseMap[2][HWSET_MAX_SIZE_JAGUAR];
  263. EFUSE_HAL EfuseHal;
  264. //---------------------------------------------------------------------------------//
  265. //3 [2.4G]
  266. u8 Index24G_CCK_Base[MAX_RF_PATH][CHANNEL_MAX_NUMBER];
  267. u8 Index24G_BW40_Base[MAX_RF_PATH][CHANNEL_MAX_NUMBER];
  268. //If only one tx, only BW20 and OFDM are used.
  269. s8 CCK_24G_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  270. s8 OFDM_24G_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  271. s8 BW20_24G_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  272. s8 BW40_24G_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  273. //3 [5G]
  274. u8 Index5G_BW40_Base[MAX_RF_PATH][CHANNEL_MAX_NUMBER];
  275. u8 Index5G_BW80_Base[MAX_RF_PATH][CHANNEL_MAX_NUMBER_5G_80M];
  276. s8 OFDM_5G_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  277. s8 BW20_5G_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  278. s8 BW40_5G_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  279. s8 BW80_5G_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  280. u8 Regulation2_4G;
  281. u8 Regulation5G;
  282. u8 TxPwrInPercentage;
  283. u8 TxPwrCalibrateRate;
  284. //
  285. // TX power by rate table at most 4RF path.
  286. // The register is
  287. //
  288. // VHT TX power by rate off setArray =
  289. // Band:-2G&5G = 0 / 1
  290. // RF: at most 4*4 = ABCD=0/1/2/3
  291. // CCK=0 OFDM=1/2 HT-MCS 0-15=3/4/56 VHT=7/8/9/10/11
  292. //
  293. u8 TxPwrByRateTable;
  294. u8 TxPwrByRateBand;
  295. u32 TxPwrByRateOffset[TX_PWR_BY_RATE_NUM_BAND]
  296. [TX_PWR_BY_RATE_NUM_RF]
  297. [TX_PWR_BY_RATE_NUM_SECTION];
  298. //---------------------------------------------------------------------------------//
  299. //2 Power Limit Table
  300. u8 TxPwrLevelCck[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];
  301. u8 TxPwrLevelHT40_1S[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER]; // For HT 40MHZ pwr
  302. u8 TxPwrLevelHT40_2S[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER]; // For HT 40MHZ pwr
  303. u8 TxPwrHt20Diff[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];// HT 20<->40 Pwr diff
  304. u8 TxPwrLegacyHtDiff[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];// For HT<->legacy pwr diff
  305. // Power Limit Table for 2.4G
  306. u8 TxPwrLimit_2_4G[MAX_REGULATION_NUM]
  307. [MAX_2_4G_BANDWITH_NUM]
  308. [MAX_2_4G_RATE_SECTION_NUM]
  309. [MAX_2_4G_CHANNEL_NUM]
  310. [MAX_RF_PATH_NUM];
  311. // Power Limit Table for 5G
  312. u8 TxPwrLimit_5G[MAX_REGULATION_NUM]
  313. [MAX_5G_BANDWITH_NUM]
  314. [MAX_5G_RATE_SECTION_NUM]
  315. [MAX_5G_CHANNEL_NUM]
  316. [MAX_RF_PATH_NUM];
  317. // Store the original power by rate value of the base of each rate section of rf path A & B
  318. u8 TxPwrByRateBase2_4G[MAX_RF_PATH_NUM_IN_POWER_LIMIT_TABLE]
  319. [MAX_BASE_NUM_IN_PHY_REG_PG_2_4G];
  320. u8 TxPwrByRateBase5G[MAX_RF_PATH_NUM_IN_POWER_LIMIT_TABLE]
  321. [MAX_BASE_NUM_IN_PHY_REG_PG_5G];
  322. // For power group
  323. u8 PwrGroupHT20[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];
  324. u8 PwrGroupHT40[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];
  325. u8 PGMaxGroup;
  326. u8 LegacyHTTxPowerDiff;// Legacy to HT rate power diff
  327. // The current Tx Power Level
  328. u8 CurrentCckTxPwrIdx;
  329. u8 CurrentOfdm24GTxPwrIdx;
  330. u8 CurrentBW2024GTxPwrIdx;
  331. u8 CurrentBW4024GTxPwrIdx;
  332. // Read/write are allow for following hardware information variables
  333. u8 pwrGroupCnt;
  334. u32 MCSTxPowerLevelOriginalOffset[MAX_PG_GROUP][16];
  335. u32 CCKTxPowerLevelOriginalOffset;
  336. u8 CrystalCap;
  337. u32 AntennaTxPath; // Antenna path Tx
  338. u32 AntennaRxPath; // Antenna path Rx
  339. u8 PAType_2G;
  340. u8 PAType_5G;
  341. u8 LNAType_2G;
  342. u8 LNAType_5G;
  343. u8 ExternalPA_2G;
  344. u8 ExternalLNA_2G;
  345. u8 ExternalPA_5G;
  346. u8 ExternalLNA_5G;
  347. u8 RFEType;
  348. u8 BoardType;
  349. u8 ExternalPA;
  350. u8 bIQKInitialized;
  351. BOOLEAN bLCKInProgress;
  352. BOOLEAN bSwChnl;
  353. BOOLEAN bSetChnlBW;
  354. BOOLEAN bChnlBWInitialzed;
  355. BOOLEAN bNeedIQK;
  356. u8 bLedOpenDrain; // Support Open-drain arrangement for controlling the LED. Added by Roger, 2009.10.16.
  357. u8 TxPowerTrackControl; //for mp mode, turn off txpwrtracking as default
  358. u8 b1x1RecvCombine; // for 1T1R receive combining
  359. u32 AcParam_BE; //Original parameter for BE, use for EDCA turbo.
  360. BB_REGISTER_DEFINITION_T PHYRegDef[4]; //Radio A/B/C/D
  361. u32 RfRegChnlVal[2];
  362. //RDG enable
  363. BOOLEAN bRDGEnable;
  364. //for host message to fw
  365. u8 LastHMEBoxNum;
  366. u8 fw_ractrl;
  367. u8 RegTxPause;
  368. // Beacon function related global variable.
  369. u8 RegBcnCtrlVal;
  370. u8 RegFwHwTxQCtrl;
  371. u8 RegReg542;
  372. u8 RegCR_1;
  373. u8 Reg837;
  374. u8 RegRFPathS1;
  375. u16 RegRRSR;
  376. u8 CurAntenna;
  377. u8 AntDivCfg;
  378. u8 TRxAntDivType;
  379. u8 bDumpRxPkt;//for debug
  380. u8 bDumpTxPkt;//for debug
  381. u8 FwRsvdPageStartOffset; //2010.06.23. Added by tynli. Reserve page start offset except beacon in TxQ.
  382. // 2010/08/09 MH Add CU power down mode.
  383. BOOLEAN pwrdown;
  384. // Add for dual MAC 0--Mac0 1--Mac1
  385. u32 interfaceIndex;
  386. u8 OutEpQueueSel;
  387. u8 OutEpNumber;
  388. // 2010/12/10 MH Add for USB aggreation mode dynamic shceme.
  389. BOOLEAN UsbRxHighSpeedMode;
  390. // 2010/11/22 MH Add for slim combo debug mode selective.
  391. // This is used for fix the drawback of CU TSMC-A/UMC-A cut. HW auto suspend ability. Close BT clock.
  392. BOOLEAN SlimComboDbg;
  393. #ifdef CONFIG_P2P
  394. u8 p2p_ps_offload;
  395. #endif
  396. u8 AMPDUDensity;
  397. // Auto FSM to Turn On, include clock, isolation, power control for MAC only
  398. u8 bMacPwrCtrlOn;
  399. RT_AMPDU_BRUST AMPDUBurstMode; //92C maybe not use, but for compile successfully
  400. #ifdef CONFIG_SDIO_HCI
  401. //
  402. // For SDIO Interface HAL related
  403. //
  404. //
  405. // SDIO ISR Related
  406. //
  407. // u32 IntrMask[1];
  408. // u32 IntrMaskToSet[1];
  409. // LOG_INTERRUPT InterruptLog;
  410. u32 sdio_himr;
  411. u32 sdio_hisr;
  412. //
  413. // SDIO Tx FIFO related.
  414. //
  415. // HIQ, MID, LOW, PUB free pages; padapter->xmitpriv.free_txpg
  416. u8 SdioTxFIFOFreePage[SDIO_TX_FREE_PG_QUEUE];
  417. _lock SdioTxFIFOFreePageLock;
  418. #ifndef CONFIG_SDIO_TX_TASKLET
  419. _thread_hdl_ SdioXmitThread;
  420. _sema SdioXmitSema;
  421. _sema SdioXmitTerminateSema;
  422. #endif//CONFIG_SDIO_TX_TASKLET
  423. //
  424. // SDIO Rx FIFO related.
  425. //
  426. u8 SdioRxFIFOCnt;
  427. u16 SdioRxFIFOSize;
  428. #endif //CONFIG_SDIO_HCI
  429. #ifdef CONFIG_USB_HCI
  430. u32 UsbBulkOutSize;
  431. BOOLEAN bSupportUSB3;
  432. // Interrupt relatd register information.
  433. u32 IntArray[3];//HISR0,HISR1,HSISR
  434. u32 IntrMask[3];
  435. u8 C2hArray[16];
  436. #ifdef CONFIG_USB_TX_AGGREGATION
  437. u8 UsbTxAggMode;
  438. u8 UsbTxAggDescNum;
  439. #endif // CONFIG_USB_TX_AGGREGATION
  440. #ifdef CONFIG_USB_RX_AGGREGATION
  441. u16 HwRxPageSize; // Hardware setting
  442. u32 MaxUsbRxAggBlock;
  443. USB_RX_AGG_MODE UsbRxAggMode;
  444. u8 UsbRxAggBlockCount; // USB Block count. Block size is 512-byte in hight speed and 64-byte in full speed
  445. u8 UsbRxAggBlockTimeout;
  446. u8 UsbRxAggPageCount; // 8192C DMA page count
  447. u8 UsbRxAggPageTimeout;
  448. u8 RegAcUsbDmaSize;
  449. u8 RegAcUsbDmaTime;
  450. #endif//CONFIG_USB_RX_AGGREGATION
  451. #endif //CONFIG_USB_HCI
  452. #ifdef CONFIG_PCI_HCI
  453. //
  454. // EEPROM setting.
  455. //
  456. u16 EEPROMChannelPlan;
  457. u8 EEPROMTSSI[2];
  458. u8 EEPROMBoardType;
  459. u32 TransmitConfig;
  460. u32 IntrMask[2];
  461. u32 IntrMaskToSet[2];
  462. u8 bDefaultAntenna;
  463. //u8 bIQKInitialized;
  464. u8 bInterruptMigration;
  465. u8 bDisableTxInt;
  466. u8 bGpioHwWpsPbc;
  467. #endif //CONFIG_PCI_HCI
  468. struct dm_priv dmpriv;
  469. DM_ODM_T odmpriv;
  470. #ifdef DBG_CONFIG_ERROR_DETECT
  471. struct sreset_priv srestpriv;
  472. #endif
  473. #ifdef CONFIG_BT_COEXIST
  474. struct btcoexist_priv bt_coexist;
  475. #endif
  476. #if defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8723B)
  477. // Interrupt relatd register information.
  478. u32 SysIntrStatus;
  479. u32 SysIntrMask;
  480. #endif //endif CONFIG_RTL8723A
  481. #if defined(CONFIG_RTL8192C) ||defined(CONFIG_RTL8192D)
  482. u8 BluetoothCoexist;
  483. u8 EEPROMChnlAreaTxPwrCCK[2][3];
  484. u8 EEPROMChnlAreaTxPwrHT40_1S[2][3];
  485. u8 EEPROMChnlAreaTxPwrHT40_2SDiff[2][3];
  486. u8 EEPROMPwrLimitHT20[3];
  487. u8 EEPROMPwrLimitHT40[3];
  488. #ifdef CONFIG_RTL8192D
  489. MACPHY_MODE_8192D MacPhyMode92D;
  490. BAND_TYPE CurrentBandType92D; //0:2.4G, 1:5G
  491. BAND_TYPE BandSet92D;
  492. BOOLEAN bMasterOfDMSP;
  493. BOOLEAN bSlaveOfDMSP;
  494. IQK_MATRIX_REGS_SETTING IQKMatrixRegSetting[IQK_Matrix_Settings_NUM_92D];
  495. #ifdef CONFIG_DUALMAC_CONCURRENT
  496. BOOLEAN bInModeSwitchProcess;
  497. #endif
  498. u8 AutoLoadStatusFor8192D;
  499. u8 EEPROMC9;
  500. u8 EEPROMCC;
  501. u8 PAMode;
  502. u8 InternalPA5G[2]; //pathA / pathB
  503. BOOLEAN bPhyValueInitReady;
  504. BOOLEAN bLoadIMRandIQKSettingFor2G;// True if IMR or IQK have done for 2.4G in scan progress
  505. BOOLEAN bNOPG;
  506. BOOLEAN bIsVS;
  507. //Query RF by FW
  508. BOOLEAN bReadRFbyFW;
  509. BOOLEAN bEarlyModeEnable;
  510. BOOLEAN bSupportRemoteWakeUp;
  511. BOOLEAN bInSetPower;
  512. u8 RTSInitRate; // 2010.11.24.by tynli.
  513. #endif //CONFIG_RTL8192D
  514. #endif //defined(CONFIG_RTL8192C) ||defined(CONFIG_RTL8192D)
  515. } HAL_DATA_COMMON, *PHAL_DATA_COMMON;
  516. typedef struct hal_com_data HAL_DATA_TYPE, *PHAL_DATA_TYPE;
  517. #define GET_HAL_DATA(__pAdapter) ((HAL_DATA_TYPE *)((__pAdapter)->HalData))
  518. #define GET_HAL_RFPATH_NUM(__pAdapter) (((HAL_DATA_TYPE *)((__pAdapter)->HalData))->NumTotalRFPath )
  519. #define RT_GetInterfaceSelection(_Adapter) (GET_HAL_DATA(_Adapter)->InterfaceSel)
  520. #endif
  521. #endif //__HAL_DATA_H__