HalHWImg8812A_TestChip_BB.c 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134
  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. #include "../odm_precomp.h"
  21. #if (RTL8812A_SUPPORT == 1)
  22. static BOOLEAN
  23. CheckCondition(
  24. const u4Byte Condition,
  25. const u4Byte Hex
  26. )
  27. {
  28. u4Byte _board = (Hex & 0x000000FF);
  29. u4Byte _interface = (Hex & 0x0000FF00) >> 8;
  30. u4Byte _platform = (Hex & 0x00FF0000) >> 16;
  31. u4Byte cond = Condition;
  32. if ( Condition == 0xCDCDCDCD )
  33. return TRUE;
  34. cond = Condition & 0x000000FF;
  35. if ( (_board != cond) && (cond != 0xFF) )
  36. return FALSE;
  37. cond = Condition & 0x0000FF00;
  38. cond = cond >> 8;
  39. if ( ((_interface & cond) == 0) && (cond != 0x07) )
  40. return FALSE;
  41. cond = Condition & 0x00FF0000;
  42. cond = cond >> 16;
  43. if ( ((_platform & cond) == 0) && (cond != 0x0F) )
  44. return FALSE;
  45. return TRUE;
  46. }
  47. /******************************************************************************
  48. * AGC_TAB.TXT
  49. ******************************************************************************/
  50. u4Byte Array_TC_8812A_AGC_TAB[] = {
  51. 0xFF0F07D8, 0xABCD,
  52. 0x81C, 0xFF000001,
  53. 0x81C, 0xFF020001,
  54. 0x81C, 0xFF040001,
  55. 0x81C, 0xFE060001,
  56. 0x81C, 0xFD080001,
  57. 0x81C, 0xFC0A0001,
  58. 0x81C, 0xFB0C0001,
  59. 0x81C, 0xFA0E0001,
  60. 0x81C, 0xF9100001,
  61. 0x81C, 0xF8120001,
  62. 0x81C, 0xF7140001,
  63. 0x81C, 0xF6160001,
  64. 0x81C, 0xF5180001,
  65. 0x81C, 0xF41A0001,
  66. 0x81C, 0xF31C0001,
  67. 0x81C, 0xF21E0001,
  68. 0x81C, 0xF1200001,
  69. 0x81C, 0xF0220001,
  70. 0x81C, 0xEF240001,
  71. 0x81C, 0xEE260001,
  72. 0x81C, 0xED280001,
  73. 0x81C, 0xEC2A0001,
  74. 0x81C, 0xEB2C0001,
  75. 0x81C, 0xEA2E0001,
  76. 0x81C, 0xE9300001,
  77. 0x81C, 0xE8320001,
  78. 0x81C, 0xC7340001,
  79. 0x81C, 0xC6360001,
  80. 0x81C, 0xC5380001,
  81. 0x81C, 0xC43A0001,
  82. 0x81C, 0xC33C0001,
  83. 0x81C, 0xC23E0001,
  84. 0x81C, 0xC1400001,
  85. 0x81C, 0xA6420001,
  86. 0x81C, 0xA5440001,
  87. 0x81C, 0xA4460001,
  88. 0x81C, 0x69480001,
  89. 0x81C, 0x684A0001,
  90. 0x81C, 0x674C0001,
  91. 0x81C, 0x664E0001,
  92. 0x81C, 0x65500001,
  93. 0x81C, 0x64520001,
  94. 0x81C, 0x63540001,
  95. 0x81C, 0x62560001,
  96. 0x81C, 0x48580001,
  97. 0x81C, 0x475A0001,
  98. 0x81C, 0x465C0001,
  99. 0x81C, 0x455E0001,
  100. 0x81C, 0x44600001,
  101. 0x81C, 0x43620001,
  102. 0x81C, 0x42640001,
  103. 0x81C, 0x41660001,
  104. 0x81C, 0x41680001,
  105. 0x81C, 0x416A0001,
  106. 0x81C, 0x416C0001,
  107. 0x81C, 0x416E0001,
  108. 0x81C, 0x41700001,
  109. 0x81C, 0x41720001,
  110. 0x81C, 0x41740001,
  111. 0x81C, 0x41760001,
  112. 0x81C, 0x41780001,
  113. 0x81C, 0x417A0001,
  114. 0x81C, 0x417C0001,
  115. 0x81C, 0x417E0001,
  116. 0xCDCDCDCD, 0xCDCD,
  117. 0x81C, 0xFF000001,
  118. 0x81C, 0xFF020001,
  119. 0x81C, 0xFF040001,
  120. 0x81C, 0xFF060001,
  121. 0x81C, 0xFF080001,
  122. 0x81C, 0xFE0A0001,
  123. 0x81C, 0xFD0C0001,
  124. 0x81C, 0xFC0E0001,
  125. 0x81C, 0xFB100001,
  126. 0x81C, 0xFA120001,
  127. 0x81C, 0xF9140001,
  128. 0x81C, 0xF8160001,
  129. 0x81C, 0xF7180001,
  130. 0x81C, 0xF61A0001,
  131. 0x81C, 0xF51C0001,
  132. 0x81C, 0xF41E0001,
  133. 0x81C, 0xF3200001,
  134. 0x81C, 0xF2220001,
  135. 0x81C, 0xF1240001,
  136. 0x81C, 0xF0260001,
  137. 0x81C, 0xEF280001,
  138. 0x81C, 0xEE2A0001,
  139. 0x81C, 0xED2C0001,
  140. 0x81C, 0xEC2E0001,
  141. 0x81C, 0xEB300001,
  142. 0x81C, 0xEA320001,
  143. 0x81C, 0xE9340001,
  144. 0x81C, 0xE8360001,
  145. 0x81C, 0xE7380001,
  146. 0x81C, 0xE63A0001,
  147. 0x81C, 0xE53C0001,
  148. 0x81C, 0xC73E0001,
  149. 0x81C, 0xC6400001,
  150. 0x81C, 0xC5420001,
  151. 0x81C, 0xC4440001,
  152. 0x81C, 0xC3460001,
  153. 0x81C, 0xC2480001,
  154. 0x81C, 0xC14A0001,
  155. 0x81C, 0xA74C0001,
  156. 0x81C, 0xA64E0001,
  157. 0x81C, 0xA5500001,
  158. 0x81C, 0xA4520001,
  159. 0x81C, 0xA3540001,
  160. 0x81C, 0xA2560001,
  161. 0x81C, 0xA1580001,
  162. 0x81C, 0x675A0001,
  163. 0x81C, 0x665C0001,
  164. 0x81C, 0x655E0001,
  165. 0x81C, 0x64600001,
  166. 0x81C, 0x63620001,
  167. 0x81C, 0x48640001,
  168. 0x81C, 0x47660001,
  169. 0x81C, 0x46680001,
  170. 0x81C, 0x456A0001,
  171. 0x81C, 0x446C0001,
  172. 0x81C, 0x436E0001,
  173. 0x81C, 0x42700001,
  174. 0x81C, 0x41720001,
  175. 0x81C, 0x41740001,
  176. 0x81C, 0x41760001,
  177. 0x81C, 0x41780001,
  178. 0x81C, 0x417A0001,
  179. 0x81C, 0x417C0001,
  180. 0x81C, 0x417E0001,
  181. 0xFF0F07D8, 0xDEAD,
  182. 0xFF0F0780, 0xABCD,
  183. 0x81C, 0xFC800001,
  184. 0x81C, 0xFB820001,
  185. 0x81C, 0xFA840001,
  186. 0x81C, 0xF9860001,
  187. 0x81C, 0xF8880001,
  188. 0x81C, 0xF78A0001,
  189. 0x81C, 0xF68C0001,
  190. 0x81C, 0xF58E0001,
  191. 0x81C, 0xF4900001,
  192. 0x81C, 0xF3920001,
  193. 0x81C, 0xF2940001,
  194. 0x81C, 0xF1960001,
  195. 0x81C, 0xF0980001,
  196. 0x81C, 0xEF9A0001,
  197. 0x81C, 0xEE9C0001,
  198. 0x81C, 0xED9E0001,
  199. 0x81C, 0xECA00001,
  200. 0x81C, 0xEBA20001,
  201. 0x81C, 0xEAA40001,
  202. 0x81C, 0xE9A60001,
  203. 0x81C, 0xE8A80001,
  204. 0x81C, 0xE7AA0001,
  205. 0x81C, 0xE6AC0001,
  206. 0x81C, 0xE5AE0001,
  207. 0x81C, 0xE4B00001,
  208. 0x81C, 0xE3B20001,
  209. 0x81C, 0xA8B40001,
  210. 0x81C, 0xA7B60001,
  211. 0x81C, 0xA6B80001,
  212. 0x81C, 0xA5BA0001,
  213. 0x81C, 0xA4BC0001,
  214. 0x81C, 0xA3BE0001,
  215. 0x81C, 0xA2C00001,
  216. 0x81C, 0xA1C20001,
  217. 0x81C, 0x68C40001,
  218. 0x81C, 0x67C60001,
  219. 0x81C, 0x66C80001,
  220. 0x81C, 0x65CA0001,
  221. 0x81C, 0x47CC0001,
  222. 0x81C, 0x46CE0001,
  223. 0x81C, 0x45D00001,
  224. 0x81C, 0x44D20001,
  225. 0x81C, 0x43D40001,
  226. 0x81C, 0x42D60001,
  227. 0x81C, 0x08D80001,
  228. 0x81C, 0x07DA0001,
  229. 0x81C, 0x06DC0001,
  230. 0x81C, 0x05DE0001,
  231. 0x81C, 0x04E00001,
  232. 0x81C, 0x03E20001,
  233. 0x81C, 0x02E40001,
  234. 0x81C, 0x01E60001,
  235. 0x81C, 0x01E80001,
  236. 0x81C, 0x01EA0001,
  237. 0x81C, 0x01EC0001,
  238. 0x81C, 0x01EE0001,
  239. 0x81C, 0x01F00001,
  240. 0x81C, 0x01F20001,
  241. 0x81C, 0x01F40001,
  242. 0x81C, 0x01F60001,
  243. 0x81C, 0x01F80001,
  244. 0x81C, 0x01FA0001,
  245. 0x81C, 0x01FC0001,
  246. 0x81C, 0x01FE0001,
  247. 0xFF0F07C0, 0xCDEF,
  248. 0x81C, 0xFC800001,
  249. 0x81C, 0xFB820001,
  250. 0x81C, 0xFA840001,
  251. 0x81C, 0xF9860001,
  252. 0x81C, 0xF8880001,
  253. 0x81C, 0xF78A0001,
  254. 0x81C, 0xF68C0001,
  255. 0x81C, 0xF58E0001,
  256. 0x81C, 0xF4900001,
  257. 0x81C, 0xF3920001,
  258. 0x81C, 0xF2940001,
  259. 0x81C, 0xF1960001,
  260. 0x81C, 0xF0980001,
  261. 0x81C, 0xEF9A0001,
  262. 0x81C, 0xEE9C0001,
  263. 0x81C, 0xED9E0001,
  264. 0x81C, 0xECA00001,
  265. 0x81C, 0xEBA20001,
  266. 0x81C, 0xEAA40001,
  267. 0x81C, 0xE9A60001,
  268. 0x81C, 0xE8A80001,
  269. 0x81C, 0xE7AA0001,
  270. 0x81C, 0xE6AC0001,
  271. 0x81C, 0xE5AE0001,
  272. 0x81C, 0xE4B00001,
  273. 0x81C, 0xE3B20001,
  274. 0x81C, 0xA8B40001,
  275. 0x81C, 0xA7B60001,
  276. 0x81C, 0xA6B80001,
  277. 0x81C, 0xA5BA0001,
  278. 0x81C, 0xA4BC0001,
  279. 0x81C, 0xA3BE0001,
  280. 0x81C, 0xA2C00001,
  281. 0x81C, 0xA1C20001,
  282. 0x81C, 0x68C40001,
  283. 0x81C, 0x67C60001,
  284. 0x81C, 0x66C80001,
  285. 0x81C, 0x65CA0001,
  286. 0x81C, 0x47CC0001,
  287. 0x81C, 0x46CE0001,
  288. 0x81C, 0x45D00001,
  289. 0x81C, 0x44D20001,
  290. 0x81C, 0x43D40001,
  291. 0x81C, 0x42D60001,
  292. 0x81C, 0x08D80001,
  293. 0x81C, 0x07DA0001,
  294. 0x81C, 0x06DC0001,
  295. 0x81C, 0x05DE0001,
  296. 0x81C, 0x04E00001,
  297. 0x81C, 0x03E20001,
  298. 0x81C, 0x02E40001,
  299. 0x81C, 0x01E60001,
  300. 0x81C, 0x01E80001,
  301. 0x81C, 0x01EA0001,
  302. 0x81C, 0x01EC0001,
  303. 0x81C, 0x01EE0001,
  304. 0x81C, 0x01F00001,
  305. 0x81C, 0x01F20001,
  306. 0x81C, 0x01F40001,
  307. 0x81C, 0x01F60001,
  308. 0x81C, 0x01F80001,
  309. 0x81C, 0x01FA0001,
  310. 0x81C, 0x01FC0001,
  311. 0x81C, 0x01FE0001,
  312. 0xFF0F07D8, 0xCDEF,
  313. 0x81C, 0xFC800001,
  314. 0x81C, 0xFB820001,
  315. 0x81C, 0xFA840001,
  316. 0x81C, 0xF9860001,
  317. 0x81C, 0xF8880001,
  318. 0x81C, 0xF78A0001,
  319. 0x81C, 0xF68C0001,
  320. 0x81C, 0xF58E0001,
  321. 0x81C, 0xF4900001,
  322. 0x81C, 0xF3920001,
  323. 0x81C, 0xF2940001,
  324. 0x81C, 0xF1960001,
  325. 0x81C, 0xF0980001,
  326. 0x81C, 0xEF9A0001,
  327. 0x81C, 0xEE9C0001,
  328. 0x81C, 0xED9E0001,
  329. 0x81C, 0xECA00001,
  330. 0x81C, 0xEBA20001,
  331. 0x81C, 0xEAA40001,
  332. 0x81C, 0xE9A60001,
  333. 0x81C, 0xE8A80001,
  334. 0x81C, 0xE7AA0001,
  335. 0x81C, 0xE6AC0001,
  336. 0x81C, 0xE5AE0001,
  337. 0x81C, 0xE4B00001,
  338. 0x81C, 0xE3B20001,
  339. 0x81C, 0xA8B40001,
  340. 0x81C, 0xA7B60001,
  341. 0x81C, 0xA6B80001,
  342. 0x81C, 0xA5BA0001,
  343. 0x81C, 0xA4BC0001,
  344. 0x81C, 0xA3BE0001,
  345. 0x81C, 0xA2C00001,
  346. 0x81C, 0xA1C20001,
  347. 0x81C, 0x68C40001,
  348. 0x81C, 0x67C60001,
  349. 0x81C, 0x66C80001,
  350. 0x81C, 0x65CA0001,
  351. 0x81C, 0x47CC0001,
  352. 0x81C, 0x46CE0001,
  353. 0x81C, 0x45D00001,
  354. 0x81C, 0x44D20001,
  355. 0x81C, 0x43D40001,
  356. 0x81C, 0x42D60001,
  357. 0x81C, 0x08D80001,
  358. 0x81C, 0x07DA0001,
  359. 0x81C, 0x06DC0001,
  360. 0x81C, 0x05DE0001,
  361. 0x81C, 0x04E00001,
  362. 0x81C, 0x03E20001,
  363. 0x81C, 0x02E40001,
  364. 0x81C, 0x01E60001,
  365. 0x81C, 0x01E80001,
  366. 0x81C, 0x01EA0001,
  367. 0x81C, 0x01EC0001,
  368. 0x81C, 0x01EE0001,
  369. 0x81C, 0x01F00001,
  370. 0x81C, 0x01F20001,
  371. 0x81C, 0x01F40001,
  372. 0x81C, 0x01F60001,
  373. 0x81C, 0x01F80001,
  374. 0x81C, 0x01FA0001,
  375. 0x81C, 0x01FC0001,
  376. 0x81C, 0x01FE0001,
  377. 0xCDCDCDCD, 0xCDCD,
  378. 0x81C, 0xFF800001,
  379. 0x81C, 0xFF820001,
  380. 0x81C, 0xFF840001,
  381. 0x81C, 0xFE860001,
  382. 0x81C, 0xFD880001,
  383. 0x81C, 0xFC8A0001,
  384. 0x81C, 0xFB8C0001,
  385. 0x81C, 0xFA8E0001,
  386. 0x81C, 0xF9900001,
  387. 0x81C, 0xF8920001,
  388. 0x81C, 0xF7940001,
  389. 0x81C, 0xF6960001,
  390. 0x81C, 0xF5980001,
  391. 0x81C, 0xF49A0001,
  392. 0x81C, 0xF39C0001,
  393. 0x81C, 0xF29E0001,
  394. 0x81C, 0xF1A00001,
  395. 0x81C, 0xF0A20001,
  396. 0x81C, 0xEFA40001,
  397. 0x81C, 0xEEA60001,
  398. 0x81C, 0xEDA80001,
  399. 0x81C, 0xECAA0001,
  400. 0x81C, 0xEBAC0001,
  401. 0x81C, 0xEAAE0001,
  402. 0x81C, 0xE9B00001,
  403. 0x81C, 0xE8B20001,
  404. 0x81C, 0xE7B40001,
  405. 0x81C, 0xE6B60001,
  406. 0x81C, 0xE5B80001,
  407. 0x81C, 0xE4BA0001,
  408. 0x81C, 0xE3BC0001,
  409. 0x81C, 0xA8BE0001,
  410. 0x81C, 0xA7C00001,
  411. 0x81C, 0xA6C20001,
  412. 0x81C, 0xA5C40001,
  413. 0x81C, 0xA4C60001,
  414. 0x81C, 0xA3C80001,
  415. 0x81C, 0xA2CA0001,
  416. 0x81C, 0xA1CC0001,
  417. 0x81C, 0x68CE0001,
  418. 0x81C, 0x67D00001,
  419. 0x81C, 0x66D20001,
  420. 0x81C, 0x65D40001,
  421. 0x81C, 0x47D60001,
  422. 0x81C, 0x46D80001,
  423. 0x81C, 0x45DA0001,
  424. 0x81C, 0x44DC0001,
  425. 0x81C, 0x43DE0001,
  426. 0x81C, 0x42E00001,
  427. 0x81C, 0x08E20001,
  428. 0x81C, 0x07E40001,
  429. 0x81C, 0x06E60001,
  430. 0x81C, 0x05E80001,
  431. 0x81C, 0x04EA0001,
  432. 0x81C, 0x03EC0001,
  433. 0x81C, 0x02EE0001,
  434. 0x81C, 0x01F00001,
  435. 0x81C, 0x01F20001,
  436. 0x81C, 0x01F40001,
  437. 0x81C, 0x01F60001,
  438. 0x81C, 0x01F80001,
  439. 0x81C, 0x01FA0001,
  440. 0x81C, 0x01FC0001,
  441. 0x81C, 0x01FE0001,
  442. 0xFF0F0780, 0xDEAD,
  443. };
  444. void
  445. ODM_ReadAndConfig_TC_8812A_AGC_TAB(
  446. IN PDM_ODM_T pDM_Odm
  447. )
  448. {
  449. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  450. u4Byte hex = 0;
  451. u4Byte i = 0;
  452. u2Byte count = 0;
  453. pu4Byte ptr_array = NULL;
  454. u1Byte platform = pDM_Odm->SupportPlatform;
  455. u1Byte _interface = pDM_Odm->SupportInterface;
  456. u1Byte board = pDM_Odm->BoardType;
  457. u4Byte ArrayLen = sizeof(Array_TC_8812A_AGC_TAB)/sizeof(u4Byte);
  458. pu4Byte Array = Array_TC_8812A_AGC_TAB;
  459. hex += board;
  460. hex += _interface << 8;
  461. hex += platform << 16;
  462. hex += 0xFF000000;
  463. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8812A_AGC_TAB, hex = 0x%X\n", hex));
  464. for (i = 0; i < ArrayLen; i += 2 )
  465. {
  466. u4Byte v1 = Array[i];
  467. u4Byte v2 = Array[i+1];
  468. // This (offset, data) pair meets the condition.
  469. if ( v1 < 0xCDCDCDCD )
  470. {
  471. odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2);
  472. continue;
  473. }
  474. else
  475. { // This line is the start line of branch.
  476. if ( !CheckCondition(Array[i], hex) )
  477. { // Discard the following (offset, data) pairs.
  478. READ_NEXT_PAIR(v1, v2, i);
  479. while (v2 != 0xDEAD &&
  480. v2 != 0xCDEF &&
  481. v2 != 0xCDCD && i < ArrayLen -2)
  482. {
  483. READ_NEXT_PAIR(v1, v2, i);
  484. }
  485. i -= 2; // prevent from for-loop += 2
  486. }
  487. else // Configure matched pairs and skip to end of if-else.
  488. {
  489. READ_NEXT_PAIR(v1, v2, i);
  490. while (v2 != 0xDEAD &&
  491. v2 != 0xCDEF &&
  492. v2 != 0xCDCD && i < ArrayLen -2)
  493. {
  494. odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2);
  495. READ_NEXT_PAIR(v1, v2, i);
  496. }
  497. while (v2 != 0xDEAD && i < ArrayLen -2)
  498. {
  499. READ_NEXT_PAIR(v1, v2, i);
  500. }
  501. }
  502. }
  503. }
  504. }
  505. /******************************************************************************
  506. * AGC_TAB_DIFF.TXT
  507. ******************************************************************************/
  508. u4Byte Array_TC_8812A_AGC_TAB_DIFF_MB[] = {
  509. 0x111, 0x47CE0003,
  510. 0x81C, 0x46D00001,
  511. 0x81C, 0x45D20001,
  512. 0x81C, 0x44D40001,
  513. 0x81C, 0x43D60001,
  514. 0x81C, 0x42D80001,
  515. 0x81C, 0x08DA0001,
  516. 0x81C, 0x07DC0001,
  517. 0x81C, 0x06DE0001,
  518. 0x81C, 0x05E00001,
  519. 0x81C, 0x04E20001,
  520. 0x81C, 0x03E40001,
  521. 0x222, 0x02E60001,
  522. };
  523. u4Byte Array_TC_8812A_AGC_TAB_DIFF_HB[] = {
  524. 0x333, 0x47CE0003,
  525. 0x81C, 0x46D00001,
  526. 0x81C, 0x45D20001,
  527. 0x81C, 0x44D40001,
  528. 0x81C, 0x43D60001,
  529. 0x81C, 0x42D80001,
  530. 0x81C, 0x08DA0001,
  531. 0x81C, 0x07DC0001,
  532. 0x81C, 0x06DE0001,
  533. 0x81C, 0x05E00001,
  534. 0x81C, 0x04E20001,
  535. 0x81C, 0x03E40001,
  536. 0x444, 0x02E60001,
  537. };
  538. u4Byte Array_TC_8812A_AGC_TAB_DIFF_LB[] = {
  539. 0x555, 0x08DA0001,
  540. 0x81B, 0x07DC0001,
  541. 0x81C, 0x06DE0001,
  542. 0x666, 0x05E00001,
  543. 0xFF0F07D8, 0xABCD,
  544. 0x81C, 0xFF000001,
  545. 0xFF0F0708, 0xCDEF,
  546. 0x81C, 0xFF000002,
  547. 0xCDCDCDCD, 0xCDCD,
  548. 0x81C, 0xFF000003,
  549. 0xFF0F07D8, 0xDEAD,
  550. 0x777, 0x08DA0001,
  551. 0x81C, 0x07DC0001,
  552. 0x81C, 0x06DE0001,
  553. 0x888, 0x05E00001,
  554. };
  555. void
  556. ODM_ReadAndConfig_TC_8812A_AGC_TAB_DIFF(
  557. IN PDM_ODM_T pDM_Odm,
  558. IN u4Byte Array[],
  559. IN u4Byte ArrayLen
  560. )
  561. {
  562. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  563. u4Byte hex = 0;
  564. u4Byte i = 0;
  565. u2Byte count = 0;
  566. pu4Byte ptr_array = NULL;
  567. u1Byte platform = pDM_Odm->SupportPlatform;
  568. u1Byte _interface = pDM_Odm->SupportInterface;
  569. u1Byte board = pDM_Odm->BoardType;
  570. hex += board;
  571. hex += _interface << 8;
  572. hex += platform << 16;
  573. hex += 0xFF000000;
  574. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8812A_AGC_TAB_DIFF, hex = 0x%X\n", hex));
  575. for (i = 0; i < ArrayLen; i += 2 )
  576. {
  577. u4Byte v1 = Array[i];
  578. u4Byte v2 = Array[i+1];
  579. // This (offset, data) pair meets the condition.
  580. if ( v1 < 0xCDCDCDCD )
  581. {
  582. odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2);
  583. continue;
  584. }
  585. else
  586. { // This line is the start line of branch.
  587. if ( !CheckCondition(Array[i], hex) )
  588. { // Discard the following (offset, data) pairs.
  589. READ_NEXT_PAIR(v1, v2, i);
  590. while (v2 != 0xDEAD &&
  591. v2 != 0xCDEF &&
  592. v2 != 0xCDCD && i < ArrayLen -2)
  593. {
  594. READ_NEXT_PAIR(v1, v2, i);
  595. }
  596. i -= 2; // prevent from for-loop += 2
  597. }
  598. else // Configure matched pairs and skip to end of if-else.
  599. {
  600. READ_NEXT_PAIR(v1, v2, i);
  601. while (v2 != 0xDEAD &&
  602. v2 != 0xCDEF &&
  603. v2 != 0xCDCD && i < ArrayLen -2)
  604. {
  605. odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2);
  606. READ_NEXT_PAIR(v1, v2, i);
  607. }
  608. while (v2 != 0xDEAD && i < ArrayLen -2)
  609. {
  610. READ_NEXT_PAIR(v1, v2, i);
  611. }
  612. }
  613. }
  614. }
  615. }
  616. /******************************************************************************
  617. * PHY_REG.TXT
  618. ******************************************************************************/
  619. u4Byte Array_TC_8812A_PHY_REG[] = {
  620. 0x800, 0x8020D010,
  621. 0x804, 0x080112E0,
  622. 0x808, 0x0E028233,
  623. 0x80C, 0x12131113,
  624. 0x810, 0x20101263,
  625. 0x814, 0x020C3D10,
  626. 0x818, 0x03A00385,
  627. 0x820, 0x00000000,
  628. 0x824, 0x00030FE0,
  629. 0x828, 0x00000000,
  630. 0x82C, 0x002083DD,
  631. 0x830, 0x2AAA6C86,
  632. 0x834, 0x0037A706,
  633. 0x838, 0x06C89B44,
  634. 0x83C, 0x0000095B,
  635. 0x840, 0xC0000001,
  636. 0x844, 0x40003CDE,
  637. 0x848, 0x6210FF8B,
  638. 0x84C, 0x6CFDFFB8,
  639. 0x850, 0x28874706,
  640. 0x854, 0x0001520C,
  641. 0x858, 0x8060E000,
  642. 0x85C, 0x74210168,
  643. 0x860, 0x6929C321,
  644. 0x864, 0x796A7432,
  645. 0x868, 0x8CA7A314,
  646. 0x86C, 0x338C2878,
  647. 0x870, 0x03333333,
  648. 0x874, 0x31602C2E,
  649. 0x878, 0x00003152,
  650. 0x87C, 0x000FC000,
  651. 0x8A0, 0x00000013,
  652. 0x8A4, 0x7F7F7F7F,
  653. 0x8A8, 0xA202033E,
  654. 0x8AC, 0x0FF0FA0A,
  655. 0x8B0, 0x00000600,
  656. 0x8B4, 0x000FC080,
  657. 0x8B8, 0x7C0057FF,
  658. 0x8BC, 0x8CA520A3,
  659. 0x8C0, 0x27F00020,
  660. 0x8C4, 0x00000000,
  661. 0x8C8, 0x00013169,
  662. 0x8CC, 0x08248492,
  663. 0x8D0, 0x0000B800,
  664. 0x8DC, 0x00000000,
  665. 0x8D4, 0x940008A0,
  666. 0x8D8, 0x290B1612,
  667. 0x8F8, 0x400002C0,
  668. 0x8FC, 0x00000000,
  669. 0xFF0F07D8, 0xABCD,
  670. 0x900, 0x00000701,
  671. 0xCDCDCDCD, 0xCDCD,
  672. 0x900, 0x00000700,
  673. 0xFF0F07D8, 0xDEAD,
  674. 0x90C, 0x00000000,
  675. 0x910, 0x0000FC00,
  676. 0x914, 0x00000404,
  677. 0x918, 0x1C1028C0,
  678. 0x91C, 0x64B11A1C,
  679. 0x920, 0xE0767233,
  680. 0x924, 0x055AA500,
  681. 0x928, 0x00000004,
  682. 0x92C, 0xFFFE0000,
  683. 0x930, 0xFFFFFFFE,
  684. 0x934, 0x001FFFFF,
  685. 0x960, 0x00000000,
  686. 0x964, 0x00000000,
  687. 0x968, 0x00000000,
  688. 0x96C, 0x00000000,
  689. 0x970, 0x801FFFFF,
  690. 0x978, 0x00000000,
  691. 0x97C, 0x00000000,
  692. 0x980, 0x00000000,
  693. 0x984, 0x00000000,
  694. 0x988, 0x00000000,
  695. 0x9A4, 0x00000080,
  696. 0x9A8, 0x00000000,
  697. 0x9AC, 0x00000000,
  698. 0x9B0, 0x01081008,
  699. 0x9B4, 0x01081008,
  700. 0x9B8, 0x01081008,
  701. 0x9BC, 0x01081008,
  702. 0x9D0, 0x00000000,
  703. 0x9D4, 0x00000000,
  704. 0x9D8, 0x00000000,
  705. 0x9DC, 0x00000000,
  706. 0x9E4, 0x00000002,
  707. 0x9E8, 0x000002D4,
  708. 0xA00, 0x00D047C8,
  709. 0xA04, 0x01FF000C,
  710. 0xA08, 0x8C8A8300,
  711. 0xA0C, 0x2E7F000F,
  712. 0xA10, 0x9500BB78,
  713. 0xA14, 0x11144028,
  714. 0xA18, 0x00881117,
  715. 0xA1C, 0x89140F00,
  716. 0xA20, 0x1A1B0000,
  717. 0xA24, 0x090E1317,
  718. 0xA28, 0x00000204,
  719. 0xA2C, 0x00910000,
  720. 0xA70, 0x101FFF00,
  721. 0xA74, 0x00000008,
  722. 0xA78, 0x00000900,
  723. 0xA7C, 0x225B0606,
  724. 0xA80, 0x218075B2,
  725. 0xA84, 0x001F8C80,
  726. 0xB00, 0x03100200,
  727. 0xB04, 0x0000B000,
  728. 0xB08, 0xAE0201EB,
  729. 0xB0C, 0x01003207,
  730. 0xB10, 0x00009807,
  731. 0xB14, 0x01000000,
  732. 0xB18, 0x00000002,
  733. 0xB1C, 0x00000002,
  734. 0xB20, 0x0000001F,
  735. 0xB24, 0x03020100,
  736. 0xB28, 0x07060504,
  737. 0xB2C, 0x0B0A0908,
  738. 0xB30, 0x0F0E0D0C,
  739. 0xB34, 0x13121110,
  740. 0xB38, 0x17161514,
  741. 0xB3C, 0x0000003A,
  742. 0xB40, 0x00000000,
  743. 0xB44, 0x00000000,
  744. 0xB48, 0x13000032,
  745. 0xB4C, 0x48080000,
  746. 0xB50, 0x00000000,
  747. 0xB54, 0x00000000,
  748. 0xB58, 0x00000000,
  749. 0xB5C, 0x00000000,
  750. 0xC00, 0x00000007,
  751. 0xC04, 0x00042020,
  752. 0xC08, 0x80410231,
  753. 0xC0C, 0x00000000,
  754. 0xC10, 0x00000100,
  755. 0xC14, 0x01000000,
  756. 0xC1C, 0x40000003,
  757. 0xC20, 0x12121212,
  758. 0xC24, 0x12121212,
  759. 0xC28, 0x12121212,
  760. 0xC2C, 0x12121212,
  761. 0xC30, 0x12121212,
  762. 0xC34, 0x12121212,
  763. 0xC38, 0x12121212,
  764. 0xC3C, 0x12121212,
  765. 0xC40, 0x12121212,
  766. 0xC44, 0x12121212,
  767. 0xC48, 0x12121212,
  768. 0xC4C, 0x12121212,
  769. 0xC50, 0x00000020,
  770. 0xC54, 0x001C1208,
  771. 0xC58, 0x30000C1C,
  772. 0xC5C, 0x00000058,
  773. 0xC60, 0x34344443,
  774. 0xC64, 0x07003333,
  775. 0xC68, 0x59791979,
  776. 0xC6C, 0x59795979,
  777. 0xC70, 0x19795979,
  778. 0xC74, 0x19795979,
  779. 0xC78, 0x19791979,
  780. 0xC7C, 0x19791979,
  781. 0xC80, 0x19791979,
  782. 0xC84, 0x19791979,
  783. 0xC94, 0x0100005C,
  784. 0xC98, 0x00000000,
  785. 0xC9C, 0x00000000,
  786. 0xCA0, 0x00000029,
  787. 0xCA4, 0x08040201,
  788. 0xCA8, 0x80402010,
  789. 0xFF0F0740, 0xABCD,
  790. 0xCB0, 0x77547717,
  791. 0xFF0F07C0, 0xCDEF,
  792. 0xCB0, 0x77547717,
  793. 0xFF0F07D8, 0xCDEF,
  794. 0xCB0, 0x54547710,
  795. 0xCDCDCDCD, 0xCDCD,
  796. 0xCB0, 0x77547777,
  797. 0xFF0F0740, 0xDEAD,
  798. 0xCB4, 0x00000077,
  799. 0xCB8, 0x00508242,
  800. 0xE00, 0x00000007,
  801. 0xE04, 0x00042020,
  802. 0xE08, 0x80410231,
  803. 0xE0C, 0x00000000,
  804. 0xE10, 0x00000100,
  805. 0xE14, 0x01000000,
  806. 0xE1C, 0x40000003,
  807. 0xE20, 0x12121212,
  808. 0xE24, 0x12121212,
  809. 0xE28, 0x12121212,
  810. 0xE2C, 0x12121212,
  811. 0xE30, 0x12121212,
  812. 0xE34, 0x12121212,
  813. 0xE38, 0x12121212,
  814. 0xE3C, 0x12121212,
  815. 0xE40, 0x12121212,
  816. 0xE44, 0x12121212,
  817. 0xE48, 0x12121212,
  818. 0xE4C, 0x12121212,
  819. 0xE50, 0x00000020,
  820. 0xE54, 0x001C1208,
  821. 0xE58, 0x30000C1C,
  822. 0xE5C, 0x00000058,
  823. 0xE60, 0x34344443,
  824. 0xE64, 0x07003333,
  825. 0xE68, 0x59791979,
  826. 0xE6C, 0x59795979,
  827. 0xE70, 0x19795979,
  828. 0xE74, 0x19795979,
  829. 0xE78, 0x19791979,
  830. 0xE7C, 0x19791979,
  831. 0xE80, 0x19791979,
  832. 0xE84, 0x19791979,
  833. 0xE94, 0x0100005C,
  834. 0xE98, 0x00000000,
  835. 0xE9C, 0x00000000,
  836. 0xEA0, 0x00000029,
  837. 0xEA4, 0x08040201,
  838. 0xEA8, 0x80402010,
  839. 0xFF0F0740, 0xABCD,
  840. 0xEB0, 0x77547717,
  841. 0xFF0F07C0, 0xCDEF,
  842. 0xEB0, 0x77547717,
  843. 0xFF0F07D8, 0xCDEF,
  844. 0xEB0, 0x54547710,
  845. 0xCDCDCDCD, 0xCDCD,
  846. 0xEB0, 0x77547777,
  847. 0xFF0F0740, 0xDEAD,
  848. 0xEB4, 0x00000077,
  849. 0xEB8, 0x00508242,
  850. };
  851. void
  852. ODM_ReadAndConfig_TC_8812A_PHY_REG(
  853. IN PDM_ODM_T pDM_Odm
  854. )
  855. {
  856. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  857. u4Byte hex = 0;
  858. u4Byte i = 0;
  859. u2Byte count = 0;
  860. pu4Byte ptr_array = NULL;
  861. u1Byte platform = pDM_Odm->SupportPlatform;
  862. u1Byte _interface = pDM_Odm->SupportInterface;
  863. u1Byte board = pDM_Odm->BoardType;
  864. u4Byte ArrayLen = sizeof(Array_TC_8812A_PHY_REG)/sizeof(u4Byte);
  865. pu4Byte Array = Array_TC_8812A_PHY_REG;
  866. hex += board;
  867. hex += _interface << 8;
  868. hex += platform << 16;
  869. hex += 0xFF000000;
  870. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8812A_PHY_REG, hex = 0x%X\n", hex));
  871. for (i = 0; i < ArrayLen; i += 2 )
  872. {
  873. u4Byte v1 = Array[i];
  874. u4Byte v2 = Array[i+1];
  875. // This (offset, data) pair meets the condition.
  876. if ( v1 < 0xCDCDCDCD )
  877. {
  878. odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2);
  879. continue;
  880. }
  881. else
  882. { // This line is the start line of branch.
  883. if ( !CheckCondition(Array[i], hex) )
  884. { // Discard the following (offset, data) pairs.
  885. READ_NEXT_PAIR(v1, v2, i);
  886. while (v2 != 0xDEAD &&
  887. v2 != 0xCDEF &&
  888. v2 != 0xCDCD && i < ArrayLen -2)
  889. {
  890. READ_NEXT_PAIR(v1, v2, i);
  891. }
  892. i -= 2; // prevent from for-loop += 2
  893. }
  894. else // Configure matched pairs and skip to end of if-else.
  895. {
  896. READ_NEXT_PAIR(v1, v2, i);
  897. while (v2 != 0xDEAD &&
  898. v2 != 0xCDEF &&
  899. v2 != 0xCDCD && i < ArrayLen -2)
  900. {
  901. odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2);
  902. READ_NEXT_PAIR(v1, v2, i);
  903. }
  904. while (v2 != 0xDEAD && i < ArrayLen -2)
  905. {
  906. READ_NEXT_PAIR(v1, v2, i);
  907. }
  908. }
  909. }
  910. }
  911. }
  912. /******************************************************************************
  913. * PHY_REG_MP.TXT
  914. ******************************************************************************/
  915. u4Byte Array_TC_8812A_PHY_REG_MP[] = {
  916. 0x800, 0x8020D410,
  917. };
  918. void
  919. ODM_ReadAndConfig_TC_8812A_PHY_REG_MP(
  920. IN PDM_ODM_T pDM_Odm
  921. )
  922. {
  923. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  924. u4Byte hex = 0;
  925. u4Byte i = 0;
  926. u2Byte count = 0;
  927. pu4Byte ptr_array = NULL;
  928. u1Byte platform = pDM_Odm->SupportPlatform;
  929. u1Byte _interface = pDM_Odm->SupportInterface;
  930. u1Byte board = pDM_Odm->BoardType;
  931. u4Byte ArrayLen = sizeof(Array_TC_8812A_PHY_REG_MP)/sizeof(u4Byte);
  932. pu4Byte Array = Array_TC_8812A_PHY_REG_MP;
  933. hex += board;
  934. hex += _interface << 8;
  935. hex += platform << 16;
  936. hex += 0xFF000000;
  937. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8812A_PHY_REG_MP, hex = 0x%X\n", hex));
  938. for (i = 0; i < ArrayLen; i += 2 )
  939. {
  940. u4Byte v1 = Array[i];
  941. u4Byte v2 = Array[i+1];
  942. // This (offset, data) pair meets the condition.
  943. if ( v1 < 0xCDCDCDCD )
  944. {
  945. odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2);
  946. continue;
  947. }
  948. else
  949. { // This line is the start line of branch.
  950. if ( !CheckCondition(Array[i], hex) )
  951. { // Discard the following (offset, data) pairs.
  952. READ_NEXT_PAIR(v1, v2, i);
  953. while (v2 != 0xDEAD &&
  954. v2 != 0xCDEF &&
  955. v2 != 0xCDCD && i < ArrayLen -2)
  956. {
  957. READ_NEXT_PAIR(v1, v2, i);
  958. }
  959. i -= 2; // prevent from for-loop += 2
  960. }
  961. else // Configure matched pairs and skip to end of if-else.
  962. {
  963. READ_NEXT_PAIR(v1, v2, i);
  964. while (v2 != 0xDEAD &&
  965. v2 != 0xCDEF &&
  966. v2 != 0xCDCD && i < ArrayLen -2)
  967. {
  968. odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2);
  969. READ_NEXT_PAIR(v1, v2, i);
  970. }
  971. while (v2 != 0xDEAD && i < ArrayLen -2)
  972. {
  973. READ_NEXT_PAIR(v1, v2, i);
  974. }
  975. }
  976. }
  977. }
  978. }
  979. /******************************************************************************
  980. * PHY_REG_PG.TXT
  981. ******************************************************************************/
  982. u4Byte Array_TC_8812A_PHY_REG_PG[] = {
  983. 0xC20, 0x00000000, 0x34363840,
  984. 0xC24, 0x00000000, 0x42424444,
  985. 0xC28, 0x00000000, 0x30323638,
  986. 0xC2C, 0x00000000, 0x40424444,
  987. 0xC30, 0x00000000, 0x28303236,
  988. 0xC34, 0x00000000, 0x38404242,
  989. 0xC38, 0x00000000, 0x26283034,
  990. 0xE20, 0x00000000, 0x34363840,
  991. 0xE24, 0x00000000, 0x42424444,
  992. 0xE28, 0x00000000, 0x30323638,
  993. 0xE2C, 0x00000000, 0x40424444,
  994. 0xE30, 0x00000000, 0x28303236,
  995. 0xE34, 0x00000000, 0x38404242,
  996. 0xE38, 0x00000000, 0x26283034,
  997. 0xC24, 0x00000000, 0x42424444,
  998. 0xC28, 0x00000000, 0x30323640,
  999. 0xC2C, 0x00000000, 0x40424444,
  1000. 0xC30, 0x00000000, 0x28303236,
  1001. 0xC34, 0x00000000, 0x38404242,
  1002. 0xC38, 0x00000000, 0x26283034,
  1003. 0xC3C, 0x00000000, 0x40424444,
  1004. 0xC40, 0x00000000, 0x28303236,
  1005. 0xC44, 0x00000000, 0x42422426,
  1006. 0xC48, 0x00000000, 0x30343840,
  1007. 0xC4C, 0x00000000, 0x22242628,
  1008. 0xE24, 0x00000000, 0x42424444,
  1009. 0xE28, 0x00000000, 0x30323640,
  1010. 0xE2C, 0x00000000, 0x40424444,
  1011. 0xE30, 0x00000000, 0x28303236,
  1012. 0xE34, 0x00000000, 0x38404242,
  1013. 0xE38, 0x00000000, 0x26283034,
  1014. 0xE3C, 0x00000000, 0x40424444,
  1015. 0xE40, 0x00000000, 0x28303236,
  1016. 0xE44, 0x00000000, 0x42422426,
  1017. 0xE48, 0x00000000, 0x30343840,
  1018. 0xE4C, 0x00000000, 0x22242628,
  1019. };
  1020. void
  1021. ODM_ReadAndConfig_TC_8812A_PHY_REG_PG(
  1022. IN PDM_ODM_T pDM_Odm
  1023. )
  1024. {
  1025. u4Byte hex = 0;
  1026. u4Byte i = 0;
  1027. u2Byte count = 0;
  1028. pu4Byte ptr_array = NULL;
  1029. u1Byte platform = pDM_Odm->SupportPlatform;
  1030. u1Byte _interface = pDM_Odm->SupportInterface;
  1031. u1Byte board = pDM_Odm->BoardType;
  1032. u4Byte ArrayLen = sizeof(Array_TC_8812A_PHY_REG_PG)/sizeof(u4Byte);
  1033. pu4Byte Array = Array_TC_8812A_PHY_REG_PG;
  1034. pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE;
  1035. hex += board;
  1036. hex += _interface << 8;
  1037. hex += platform << 16;
  1038. hex += 0xFF000000;
  1039. for (i = 0; i < ArrayLen; i += 3 )
  1040. {
  1041. u4Byte v1 = Array[i];
  1042. u4Byte v2 = Array[i+1];
  1043. u4Byte v3 = Array[i+2];
  1044. // this line is a line of pure_body
  1045. if ( v1 < 0xCDCDCDCD )
  1046. {
  1047. odm_ConfigBB_PHY_REG_PG_8812A(pDM_Odm, v1, v2, v3);
  1048. continue;
  1049. }
  1050. else
  1051. { // this line is the start of branch
  1052. if ( !CheckCondition(Array[i], hex) )
  1053. { // don't need the hw_body
  1054. i += 2; // skip the pair of expression
  1055. v1 = Array[i];
  1056. v2 = Array[i+1];
  1057. v3 = Array[i+2];
  1058. while (v2 != 0xDEAD)
  1059. {
  1060. i += 3;
  1061. v1 = Array[i];
  1062. v2 = Array[i+1];
  1063. v3 = Array[i+1];
  1064. }
  1065. }
  1066. }
  1067. }
  1068. }
  1069. #endif // end of HWIMG_SUPPORT