odm_HWConfig.h 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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 __HALHWOUTSRC_H__
  21. #define __HALHWOUTSRC_H__
  22. //============================================================
  23. // C Series Rate
  24. //============================================================
  25. //
  26. //-----------------------------------------------------------
  27. // CCK Rates, TxHT = 0
  28. #define DESC92C_RATE1M 0x00
  29. #define DESC92C_RATE2M 0x01
  30. #define DESC92C_RATE5_5M 0x02
  31. #define DESC92C_RATE11M 0x03
  32. // OFDM Rates, TxHT = 0
  33. #define DESC92C_RATE6M 0x04
  34. #define DESC92C_RATE9M 0x05
  35. #define DESC92C_RATE12M 0x06
  36. #define DESC92C_RATE18M 0x07
  37. #define DESC92C_RATE24M 0x08
  38. #define DESC92C_RATE36M 0x09
  39. #define DESC92C_RATE48M 0x0a
  40. #define DESC92C_RATE54M 0x0b
  41. // MCS Rates, TxHT = 1
  42. #define DESC92C_RATEMCS0 0x0c
  43. #define DESC92C_RATEMCS1 0x0d
  44. #define DESC92C_RATEMCS2 0x0e
  45. #define DESC92C_RATEMCS3 0x0f
  46. #define DESC92C_RATEMCS4 0x10
  47. #define DESC92C_RATEMCS5 0x11
  48. #define DESC92C_RATEMCS6 0x12
  49. #define DESC92C_RATEMCS7 0x13
  50. #define DESC92C_RATEMCS8 0x14
  51. #define DESC92C_RATEMCS9 0x15
  52. #define DESC92C_RATEMCS10 0x16
  53. #define DESC92C_RATEMCS11 0x17
  54. #define DESC92C_RATEMCS12 0x18
  55. #define DESC92C_RATEMCS13 0x19
  56. #define DESC92C_RATEMCS14 0x1a
  57. #define DESC92C_RATEMCS15 0x1b
  58. #define DESC92C_RATEMCS15_SG 0x1c
  59. #define DESC92C_RATEMCS32 0x20
  60. /*--------------------------Define -------------------------------------------*/
  61. /* BIT 7 HT Rate*/
  62. // TxHT = 0
  63. #define MGN_1M 0x02
  64. #define MGN_2M 0x04
  65. #define MGN_5_5M 0x0b
  66. #define MGN_11M 0x16
  67. #define MGN_6M 0x0c
  68. #define MGN_9M 0x12
  69. #define MGN_12M 0x18
  70. #define MGN_18M 0x24
  71. #define MGN_24M 0x30
  72. #define MGN_36M 0x48
  73. #define MGN_48M 0x60
  74. #define MGN_54M 0x6c
  75. // TxHT = 1
  76. #define MGN_MCS0 0x80
  77. #define MGN_MCS1 0x81
  78. #define MGN_MCS2 0x82
  79. #define MGN_MCS3 0x83
  80. #define MGN_MCS4 0x84
  81. #define MGN_MCS5 0x85
  82. #define MGN_MCS6 0x86
  83. #define MGN_MCS7 0x87
  84. #define MGN_MCS8 0x88
  85. #define MGN_MCS9 0x89
  86. #define MGN_MCS10 0x8a
  87. #define MGN_MCS11 0x8b
  88. #define MGN_MCS12 0x8c
  89. #define MGN_MCS13 0x8d
  90. #define MGN_MCS14 0x8e
  91. #define MGN_MCS15 0x8f
  92. #define MGN_VHT1SS_MCS0 0x90
  93. #define MGN_VHT1SS_MCS1 0x91
  94. #define MGN_VHT1SS_MCS2 0x92
  95. #define MGN_VHT1SS_MCS3 0x93
  96. #define MGN_VHT1SS_MCS4 0x94
  97. #define MGN_VHT1SS_MCS5 0x95
  98. #define MGN_VHT1SS_MCS6 0x96
  99. #define MGN_VHT1SS_MCS7 0x97
  100. #define MGN_VHT1SS_MCS8 0x98
  101. #define MGN_VHT1SS_MCS9 0x99
  102. #define MGN_VHT2SS_MCS0 0x9a
  103. #define MGN_VHT2SS_MCS1 0x9b
  104. #define MGN_VHT2SS_MCS2 0x9c
  105. #define MGN_VHT2SS_MCS3 0x9d
  106. #define MGN_VHT2SS_MCS4 0x9e
  107. #define MGN_VHT2SS_MCS5 0x9f
  108. #define MGN_VHT2SS_MCS6 0xa0
  109. #define MGN_VHT2SS_MCS7 0xa1
  110. #define MGN_VHT2SS_MCS8 0xa2
  111. #define MGN_VHT2SS_MCS9 0xa3
  112. #define MGN_MCS0_SG 0xc0
  113. #define MGN_MCS1_SG 0xc1
  114. #define MGN_MCS2_SG 0xc2
  115. #define MGN_MCS3_SG 0xc3
  116. #define MGN_MCS4_SG 0xc4
  117. #define MGN_MCS5_SG 0xc5
  118. #define MGN_MCS6_SG 0xc6
  119. #define MGN_MCS7_SG 0xc7
  120. #define MGN_MCS8_SG 0xc8
  121. #define MGN_MCS9_SG 0xc9
  122. #define MGN_MCS10_SG 0xca
  123. #define MGN_MCS11_SG 0xcb
  124. #define MGN_MCS12_SG 0xcc
  125. #define MGN_MCS13_SG 0xcd
  126. #define MGN_MCS14_SG 0xce
  127. #define MGN_MCS15_SG 0xcf
  128. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  129. #define AGC_DIFF_CONFIG_MP(ic, band) (ODM_ReadAndConfig_MP_##ic##_AGC_TAB_DIFF(pDM_Odm, Array_MP_##ic##_AGC_TAB_DIFF_##band, \
  130. sizeof(Array_MP_##ic##_AGC_TAB_DIFF_##band)/sizeof(u4Byte)))
  131. #define AGC_DIFF_CONFIG_TC(ic, band) (ODM_ReadAndConfig_TC_##ic##_AGC_TAB_DIFF(pDM_Odm, Array_TC_##ic##_AGC_TAB_DIFF_##band, \
  132. sizeof(Array_TC_##ic##_AGC_TAB_DIFF_##band)/sizeof(u4Byte)))
  133. #define AGC_DIFF_CONFIG(ic, band) do {\
  134. if (pDM_Odm->bIsMPChip)\
  135. AGC_DIFF_CONFIG_MP(ic,band);\
  136. else\
  137. AGC_DIFF_CONFIG_TC(ic,band);\
  138. } while(0)
  139. //============================================================
  140. // structure and define
  141. //============================================================
  142. typedef struct _Phy_Rx_AGC_Info
  143. {
  144. #if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
  145. u1Byte gain:7,trsw:1;
  146. #else
  147. u1Byte trsw:1,gain:7;
  148. #endif
  149. } PHY_RX_AGC_INFO_T,*pPHY_RX_AGC_INFO_T;
  150. typedef struct _Phy_Status_Rpt_8192cd
  151. {
  152. PHY_RX_AGC_INFO_T path_agc[2];
  153. u1Byte ch_corr[2];
  154. u1Byte cck_sig_qual_ofdm_pwdb_all;
  155. u1Byte cck_agc_rpt_ofdm_cfosho_a;
  156. u1Byte cck_rpt_b_ofdm_cfosho_b;
  157. u1Byte rsvd_1;//ch_corr_msb;
  158. u1Byte noise_power_db_msb;
  159. s1Byte path_cfotail[2];
  160. u1Byte pcts_mask[2];
  161. s1Byte stream_rxevm[2];
  162. u1Byte path_rxsnr[2];
  163. u1Byte noise_power_db_lsb;
  164. u1Byte rsvd_2[3];
  165. u1Byte stream_csi[2];
  166. u1Byte stream_target_csi[2];
  167. s1Byte sig_evm;
  168. u1Byte rsvd_3;
  169. #if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
  170. u1Byte antsel_rx_keep_2:1; //ex_intf_flg:1;
  171. u1Byte sgi_en:1;
  172. u1Byte rxsc:2;
  173. u1Byte idle_long:1;
  174. u1Byte r_ant_train_en:1;
  175. u1Byte ant_sel_b:1;
  176. u1Byte ant_sel:1;
  177. #else // _BIG_ENDIAN_
  178. u1Byte ant_sel:1;
  179. u1Byte ant_sel_b:1;
  180. u1Byte r_ant_train_en:1;
  181. u1Byte idle_long:1;
  182. u1Byte rxsc:2;
  183. u1Byte sgi_en:1;
  184. u1Byte antsel_rx_keep_2:1; //ex_intf_flg:1;
  185. #endif
  186. } PHY_STATUS_RPT_8192CD_T,*PPHY_STATUS_RPT_8192CD_T;
  187. typedef struct _Phy_Status_Rpt_8812
  188. {
  189. #if 0
  190. PHY_RX_AGC_INFO_T path_agc[2];
  191. u1Byte ch_num[2];
  192. u1Byte cck_sig_qual_ofdm_pwdb_all;
  193. u1Byte cck_agc_rpt_ofdm_cfosho_a;
  194. u1Byte cck_bb_pwr_ofdm_cfosho_b;
  195. u1Byte cck_rx_path; //CCK_RX_PATH [3:0] (with regA07[3:0] definition)
  196. u1Byte rsvd_1;
  197. u1Byte path_cfotail[2];
  198. u1Byte pcts_mask[2];
  199. s1Byte stream_rxevm[2];
  200. u1Byte path_rxsnr[2];
  201. u1Byte rsvd_2[2];
  202. u1Byte stream_snr[2];
  203. u1Byte stream_csi[2];
  204. u1Byte rsvd_3[2];
  205. s1Byte sig_evm;
  206. u1Byte rsvd_4;
  207. #if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
  208. u1Byte antidx_anta:3;
  209. u1Byte antidx_antb:3;
  210. u1Byte rsvd_5:2;
  211. #else // _BIG_ENDIAN_
  212. u1Byte rsvd_5:2;
  213. u1Byte antidx_antb:3;
  214. u1Byte antidx_anta:3;
  215. #endif
  216. #endif
  217. //2012.05.24 LukeLee: This structure should take big/little endian in consideration later.....
  218. //DWORD 0
  219. u1Byte gain_trsw[2];
  220. u2Byte chl_num:10;
  221. u2Byte sub_chnl:4;
  222. u2Byte r_RFMOD:2;
  223. //DWORD 1
  224. u1Byte pwdb_all;
  225. u1Byte cfosho[4]; // DW 1 byte 1 DW 2 byte 0
  226. //DWORD 2
  227. s1Byte cfotail[4]; // DW 2 byte 1 DW 3 byte 0
  228. //DWORD 3
  229. s1Byte rxevm[2]; // DW 3 byte 1 DW 3 byte 2
  230. s1Byte rxsnr[2]; // DW 3 byte 3 DW 4 byte 0
  231. //DWORD 4
  232. u1Byte PCTS_MSK_RPT[2];
  233. u1Byte pdsnr[2]; // DW 4 byte 3 DW 5 Byte 0
  234. //DWORD 5
  235. u1Byte csi_current[2];
  236. u1Byte rx_gain_c;
  237. //DWORD 6
  238. u1Byte rx_gain_d;
  239. u1Byte sigevm;
  240. u1Byte resvd_0;
  241. u1Byte antidx_anta:3;
  242. u1Byte antidx_antb:3;
  243. u1Byte resvd_1:2;
  244. } PHY_STATUS_RPT_8812_T,*PPHY_STATUS_RPT_8812_T;
  245. VOID
  246. odm_Init_RSSIForDM(
  247. IN OUT PDM_ODM_T pDM_Odm
  248. );
  249. VOID
  250. ODM_PhyStatusQuery(
  251. IN OUT PDM_ODM_T pDM_Odm,
  252. OUT PODM_PHY_INFO_T pPhyInfo,
  253. IN pu1Byte pPhyStatus,
  254. IN PODM_PACKET_INFO_T pPktinfo
  255. );
  256. VOID
  257. ODM_MacStatusQuery(
  258. IN OUT PDM_ODM_T pDM_Odm,
  259. IN pu1Byte pMacStatus,
  260. IN u1Byte MacID,
  261. IN BOOLEAN bPacketMatchBSSID,
  262. IN BOOLEAN bPacketToSelf,
  263. IN BOOLEAN bPacketBeacon
  264. );
  265. #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE|ODM_AP))
  266. HAL_STATUS
  267. ODM_ConfigRFWithTxPwrTrackHeaderFile(
  268. IN PDM_ODM_T pDM_Odm
  269. );
  270. HAL_STATUS
  271. ODM_ConfigRFWithHeaderFile(
  272. IN PDM_ODM_T pDM_Odm,
  273. IN ODM_RF_Config_Type ConfigType,
  274. IN ODM_RF_RADIO_PATH_E eRFPath
  275. );
  276. HAL_STATUS
  277. ODM_ConfigBBWithHeaderFile(
  278. IN PDM_ODM_T pDM_Odm,
  279. IN ODM_BB_Config_Type ConfigType
  280. );
  281. HAL_STATUS
  282. ODM_ConfigMACWithHeaderFile(
  283. IN PDM_ODM_T pDM_Odm
  284. );
  285. HAL_STATUS
  286. ODM_ConfigFWWithHeaderFile(
  287. IN PDM_ODM_T pDM_Odm,
  288. IN ODM_FW_Config_Type ConfigType,
  289. OUT u1Byte *pFirmware,
  290. OUT u4Byte *pSize
  291. );
  292. #endif
  293. #endif