HalHWImg8812A_BB.c 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438
  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_MP_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, 0x64CC0001,
  222. 0x81C, 0x47CE0001,
  223. 0x81C, 0x46D00001,
  224. 0x81C, 0x45D20001,
  225. 0x81C, 0x44D40001,
  226. 0x81C, 0x43D60001,
  227. 0x81C, 0x42D80001,
  228. 0x81C, 0x08DA0001,
  229. 0x81C, 0x07DC0001,
  230. 0x81C, 0x06DE0001,
  231. 0x81C, 0x05E00001,
  232. 0x81C, 0x04E20001,
  233. 0x81C, 0x03E40001,
  234. 0x81C, 0x02E60001,
  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, 0x64CC0001,
  287. 0x81C, 0x47CE0001,
  288. 0x81C, 0x46D00001,
  289. 0x81C, 0x45D20001,
  290. 0x81C, 0x44D40001,
  291. 0x81C, 0x43D60001,
  292. 0x81C, 0x42D80001,
  293. 0x81C, 0x08DA0001,
  294. 0x81C, 0x07DC0001,
  295. 0x81C, 0x06DE0001,
  296. 0x81C, 0x05E00001,
  297. 0x81C, 0x04E20001,
  298. 0x81C, 0x03E40001,
  299. 0x81C, 0x02E60001,
  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, 0x64CC0001,
  352. 0x81C, 0x47CE0001,
  353. 0x81C, 0x46D00001,
  354. 0x81C, 0x45D20001,
  355. 0x81C, 0x44D40001,
  356. 0x81C, 0x43D60001,
  357. 0x81C, 0x42D80001,
  358. 0x81C, 0x08DA0001,
  359. 0x81C, 0x07DC0001,
  360. 0x81C, 0x06DE0001,
  361. 0x81C, 0x05E00001,
  362. 0x81C, 0x04E20001,
  363. 0x81C, 0x03E40001,
  364. 0x81C, 0x02E60001,
  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, 0x64D60001,
  422. 0x81C, 0x47D80001,
  423. 0x81C, 0x46DA0001,
  424. 0x81C, 0x45DC0001,
  425. 0x81C, 0x44DE0001,
  426. 0x81C, 0x43E00001,
  427. 0x81C, 0x42E20001,
  428. 0x81C, 0x08E40001,
  429. 0x81C, 0x07E60001,
  430. 0x81C, 0x06E80001,
  431. 0x81C, 0x05EA0001,
  432. 0x81C, 0x04EC0001,
  433. 0x81C, 0x03EE0001,
  434. 0x81C, 0x02F00001,
  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. 0xC50, 0x00000022,
  444. 0xC50, 0x00000020,
  445. 0xE50, 0x00000022,
  446. 0xE50, 0x00000020,
  447. };
  448. void
  449. ODM_ReadAndConfig_MP_8812A_AGC_TAB(
  450. IN PDM_ODM_T pDM_Odm
  451. )
  452. {
  453. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  454. u4Byte hex = 0;
  455. u4Byte i = 0;
  456. u2Byte count = 0;
  457. pu4Byte ptr_array = NULL;
  458. u1Byte platform = pDM_Odm->SupportPlatform;
  459. u1Byte _interface = pDM_Odm->SupportInterface;
  460. u1Byte board = pDM_Odm->BoardType;
  461. u4Byte ArrayLen = sizeof(Array_MP_8812A_AGC_TAB)/sizeof(u4Byte);
  462. pu4Byte Array = Array_MP_8812A_AGC_TAB;
  463. hex += board;
  464. hex += _interface << 8;
  465. hex += platform << 16;
  466. hex += 0xFF000000;
  467. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8812A_AGC_TAB, hex = 0x%X\n", hex));
  468. for (i = 0; i < ArrayLen; i += 2 )
  469. {
  470. u4Byte v1 = Array[i];
  471. u4Byte v2 = Array[i+1];
  472. // This (offset, data) pair meets the condition.
  473. if ( v1 < 0xCDCDCDCD )
  474. {
  475. odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2);
  476. continue;
  477. }
  478. else
  479. { // This line is the start line of branch.
  480. if ( !CheckCondition(Array[i], hex) )
  481. { // Discard the following (offset, data) pairs.
  482. READ_NEXT_PAIR(v1, v2, i);
  483. while (v2 != 0xDEAD &&
  484. v2 != 0xCDEF &&
  485. v2 != 0xCDCD && i < ArrayLen -2)
  486. {
  487. READ_NEXT_PAIR(v1, v2, i);
  488. }
  489. i -= 2; // prevent from for-loop += 2
  490. }
  491. else // Configure matched pairs and skip to end of if-else.
  492. {
  493. READ_NEXT_PAIR(v1, v2, i);
  494. while (v2 != 0xDEAD &&
  495. v2 != 0xCDEF &&
  496. v2 != 0xCDCD && i < ArrayLen -2)
  497. {
  498. odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2);
  499. READ_NEXT_PAIR(v1, v2, i);
  500. }
  501. while (v2 != 0xDEAD && i < ArrayLen -2)
  502. {
  503. READ_NEXT_PAIR(v1, v2, i);
  504. }
  505. }
  506. }
  507. }
  508. }
  509. /******************************************************************************
  510. * AGC_TAB_DIFF.TXT
  511. ******************************************************************************/
  512. u4Byte Array_MP_8812A_AGC_TAB_DIFF_LB[] = {
  513. 0xFF0F0780, 0xABCD,
  514. 0x81C, 0x47CE0001,
  515. 0x81C, 0x46D00001,
  516. 0x81C, 0x45D20001,
  517. 0x81C, 0x44D40001,
  518. 0x81C, 0x43D60001,
  519. 0x81C, 0x42D80001,
  520. 0x81C, 0x08DA0001,
  521. 0x81C, 0x07DC0001,
  522. 0x81C, 0x06DE0001,
  523. 0x81C, 0x05E00001,
  524. 0x81C, 0x04E20001,
  525. 0x81C, 0x03E40001,
  526. 0x81C, 0x02E60001,
  527. 0xFF0F07C0, 0xCDEF,
  528. 0x81C, 0x47CE0001,
  529. 0x81C, 0x46D00001,
  530. 0x81C, 0x45D20001,
  531. 0x81C, 0x44D40001,
  532. 0x81C, 0x43D60001,
  533. 0x81C, 0x42D80001,
  534. 0x81C, 0x08DA0001,
  535. 0x81C, 0x07DC0001,
  536. 0x81C, 0x06DE0001,
  537. 0x81C, 0x05E00001,
  538. 0x81C, 0x04E20001,
  539. 0x81C, 0x03E40001,
  540. 0x81C, 0x02E60001,
  541. 0xFF0F07D8, 0xCDEF,
  542. 0x81C, 0x47CE0001,
  543. 0x81C, 0x46D00001,
  544. 0x81C, 0x45D20001,
  545. 0x81C, 0x44D40001,
  546. 0x81C, 0x43D60001,
  547. 0x81C, 0x42D80001,
  548. 0x81C, 0x08DA0001,
  549. 0x81C, 0x07DC0001,
  550. 0x81C, 0x06DE0001,
  551. 0x81C, 0x05E00001,
  552. 0x81C, 0x04E20001,
  553. 0x81C, 0x03E40001,
  554. 0x81C, 0x02E60001,
  555. 0xCDCDCDCD, 0xCDCD,
  556. 0x81C, 0x47D80001,
  557. 0x81C, 0x46DA0001,
  558. 0x81C, 0x45DC0001,
  559. 0x81C, 0x44DE0001,
  560. 0x81C, 0x43E00001,
  561. 0x81C, 0x42E20001,
  562. 0x81C, 0x08E40001,
  563. 0x81C, 0x07E60001,
  564. 0x81C, 0x06E80001,
  565. 0x81C, 0x05EA0001,
  566. 0x81C, 0x04EC0001,
  567. 0x81C, 0x03EE0001,
  568. 0x81C, 0x02F00001,
  569. 0xFF0F0780, 0xDEAD,
  570. };
  571. u4Byte Array_MP_8812A_AGC_TAB_DIFF_HB[] = {
  572. 0xFF0F0780, 0xABCD,
  573. 0x81C, 0x45CE0001,
  574. 0x81C, 0x44D00001,
  575. 0x81C, 0x43D20001,
  576. 0x81C, 0x42D40001,
  577. 0x81C, 0x08D60001,
  578. 0x81C, 0x07D80001,
  579. 0x81C, 0x06DA0001,
  580. 0x81C, 0x05DC0001,
  581. 0x81C, 0x04DE0001,
  582. 0x81C, 0x03E00001,
  583. 0x81C, 0x02E20001,
  584. 0x81C, 0x01E40001,
  585. 0x81C, 0x01E60001,
  586. 0xFF0F07C0, 0xCDEF,
  587. 0x81C, 0x45CE0001,
  588. 0x81C, 0x44D00001,
  589. 0x81C, 0x43D20001,
  590. 0x81C, 0x42D40001,
  591. 0x81C, 0x08D60001,
  592. 0x81C, 0x07D80001,
  593. 0x81C, 0x06DA0001,
  594. 0x81C, 0x05DC0001,
  595. 0x81C, 0x04DE0001,
  596. 0x81C, 0x03E00001,
  597. 0x81C, 0x02E20001,
  598. 0x81C, 0x01E40001,
  599. 0x81C, 0x01E60001,
  600. 0xFF0F07D8, 0xCDEF,
  601. 0x81C, 0x45CE0001,
  602. 0x81C, 0x44D00001,
  603. 0x81C, 0x43D20001,
  604. 0x81C, 0x42D40001,
  605. 0x81C, 0x08D60001,
  606. 0x81C, 0x07D80001,
  607. 0x81C, 0x06DA0001,
  608. 0x81C, 0x05DC0001,
  609. 0x81C, 0x04DE0001,
  610. 0x81C, 0x03E00001,
  611. 0x81C, 0x02E20001,
  612. 0x81C, 0x01E40001,
  613. 0x81C, 0x01E60001,
  614. 0xCDCDCDCD, 0xCDCD,
  615. 0x81C, 0x45D80001,
  616. 0x81C, 0x44DA0001,
  617. 0x81C, 0x43DC0001,
  618. 0x81C, 0x42DE0001,
  619. 0x81C, 0x08E00001,
  620. 0x81C, 0x07E20001,
  621. 0x81C, 0x06E40001,
  622. 0x81C, 0x05E60001,
  623. 0x81C, 0x04E80001,
  624. 0x81C, 0x03EA0001,
  625. 0x81C, 0x02EC0001,
  626. 0x81C, 0x01EE0001,
  627. 0x81C, 0x01F00001,
  628. 0xFF0F0780, 0xDEAD,
  629. };
  630. void
  631. ODM_ReadAndConfig_MP_8812A_AGC_TAB_DIFF(
  632. IN PDM_ODM_T pDM_Odm,
  633. IN u4Byte Array[],
  634. IN u4Byte ArrayLen
  635. )
  636. {
  637. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  638. u4Byte hex = 0;
  639. u4Byte i = 0;
  640. u2Byte count = 0;
  641. pu4Byte ptr_array = NULL;
  642. u1Byte platform = pDM_Odm->SupportPlatform;
  643. u1Byte _interface = pDM_Odm->SupportInterface;
  644. u1Byte board = pDM_Odm->BoardType;
  645. hex += board;
  646. hex += _interface << 8;
  647. hex += platform << 16;
  648. hex += 0xFF000000;
  649. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8812A_AGC_TAB_DIFF, hex = 0x%X\n", hex));
  650. for (i = 0; i < ArrayLen; i += 2 )
  651. {
  652. u4Byte v1 = Array[i];
  653. u4Byte v2 = Array[i+1];
  654. // This (offset, data) pair meets the condition.
  655. if ( v1 < 0xCDCDCDCD )
  656. {
  657. odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2);
  658. continue;
  659. }
  660. else
  661. { // This line is the start line of branch.
  662. if ( !CheckCondition(Array[i], hex) )
  663. { // Discard the following (offset, data) pairs.
  664. READ_NEXT_PAIR(v1, v2, i);
  665. while (v2 != 0xDEAD &&
  666. v2 != 0xCDEF &&
  667. v2 != 0xCDCD && i < ArrayLen -2)
  668. {
  669. READ_NEXT_PAIR(v1, v2, i);
  670. }
  671. i -= 2; // prevent from for-loop += 2
  672. }
  673. else // Configure matched pairs and skip to end of if-else.
  674. {
  675. READ_NEXT_PAIR(v1, v2, i);
  676. while (v2 != 0xDEAD &&
  677. v2 != 0xCDEF &&
  678. v2 != 0xCDCD && i < ArrayLen -2)
  679. {
  680. odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2);
  681. READ_NEXT_PAIR(v1, v2, i);
  682. }
  683. while (v2 != 0xDEAD && i < ArrayLen -2)
  684. {
  685. READ_NEXT_PAIR(v1, v2, i);
  686. }
  687. }
  688. }
  689. }
  690. }
  691. /******************************************************************************
  692. * PHY_REG.TXT
  693. ******************************************************************************/
  694. u4Byte Array_MP_8812A_PHY_REG[] = {
  695. 0x800, 0x8020D010,
  696. 0x804, 0x080112E0,
  697. 0x808, 0x0E028233,
  698. 0x80C, 0x12131113,
  699. 0x810, 0x20101263,
  700. 0x814, 0x020C3D10,
  701. 0x818, 0x03A00385,
  702. 0x820, 0x00000000,
  703. 0x824, 0x00030FE0,
  704. 0x828, 0x00000000,
  705. 0x82C, 0x002083DD,
  706. 0x830, 0x2AAA6C86,
  707. 0x834, 0x0037A706,
  708. 0x838, 0x06C89B44,
  709. 0x83C, 0x0000095B,
  710. 0x840, 0xC0000001,
  711. 0x844, 0x40003CDE,
  712. 0x848, 0x6210FF8B,
  713. 0x84C, 0x6CFDFFB8,
  714. 0x850, 0x28874706,
  715. 0x854, 0x0001520C,
  716. 0x858, 0x8060E000,
  717. 0x85C, 0x74210168,
  718. 0x860, 0x6929C321,
  719. 0x864, 0x796A7432,
  720. 0x868, 0x8CA7A314,
  721. 0x86C, 0x338C2878,
  722. 0x870, 0x03333333,
  723. 0x874, 0x31602C2E,
  724. 0x878, 0x00003152,
  725. 0x87C, 0x000FC000,
  726. 0x8A0, 0x00000013,
  727. 0x8A4, 0x7F7F7F7F,
  728. 0x8A8, 0xA202033E,
  729. 0x8AC, 0x0FF0FA0A,
  730. 0x8B0, 0x00000600,
  731. 0x8B4, 0x000FC080,
  732. 0x8B8, 0x7C0057FF,
  733. 0x8BC, 0x4CA520A3,
  734. 0x8C0, 0x27F00020,
  735. 0x8C4, 0x00000000,
  736. 0x8C8, 0x00013169,
  737. 0x8CC, 0x08248492,
  738. 0x8D0, 0x0000B800,
  739. 0x8DC, 0x00000000,
  740. 0x8D4, 0x940008A0,
  741. 0x8D8, 0x290B1612,
  742. 0x8F8, 0x400002C0,
  743. 0x8FC, 0x00000000,
  744. 0xFF0F07D8, 0xABCD,
  745. 0x900, 0x00000701,
  746. 0xCDCDCDCD, 0xCDCD,
  747. 0x900, 0x00000700,
  748. 0xFF0F07D8, 0xDEAD,
  749. 0x90C, 0x00000000,
  750. 0x910, 0x0000FC00,
  751. 0x914, 0x00000404,
  752. 0x918, 0x1C1028C0,
  753. 0x91C, 0x64B11A1C,
  754. 0x920, 0xE0767233,
  755. 0x924, 0x055AA500,
  756. 0x928, 0x00000004,
  757. 0x92C, 0xFFFE0000,
  758. 0x930, 0xFFFFFFFE,
  759. 0x934, 0x001FFFFF,
  760. 0x960, 0x00000000,
  761. 0x964, 0x00000000,
  762. 0x968, 0x00000000,
  763. 0x96C, 0x00000000,
  764. 0x970, 0x801FFFFF,
  765. 0x978, 0x00000000,
  766. 0x97C, 0x00000000,
  767. 0x980, 0x00000000,
  768. 0x984, 0x00000000,
  769. 0x988, 0x00000000,
  770. 0x9A4, 0x00080080,
  771. 0x9A8, 0x00000000,
  772. 0x9AC, 0x00000000,
  773. 0x9B0, 0x01081008,
  774. 0x9B4, 0x00000000,
  775. 0x9B8, 0x01081008,
  776. 0x9BC, 0x01081008,
  777. 0x9D0, 0x00000000,
  778. 0x9D4, 0x00000000,
  779. 0x9D8, 0x00000000,
  780. 0x9DC, 0x00000000,
  781. 0x9E4, 0x00000002,
  782. 0x9E8, 0x000002D4,
  783. 0xA00, 0x00D047C8,
  784. 0xA04, 0x01FF000C,
  785. 0xA08, 0x8C8A8300,
  786. 0xA0C, 0x2E7F000F,
  787. 0xA10, 0x9500BB78,
  788. 0xA14, 0x11144028,
  789. 0xA18, 0x00881117,
  790. 0xA1C, 0x89140F00,
  791. 0xA20, 0x1A1B0000,
  792. 0xA24, 0x090E1317,
  793. 0xA28, 0x00000204,
  794. 0xA2C, 0x00900000,
  795. 0xA70, 0x101FFF00,
  796. 0xA74, 0x00000008,
  797. 0xA78, 0x00000900,
  798. 0xA7C, 0x225B0606,
  799. 0xA80, 0x218075B2,
  800. 0xA84, 0x001F8C80,
  801. 0xB00, 0x03100000,
  802. 0xB04, 0x0000B000,
  803. 0xB08, 0xAE0201EB,
  804. 0xB0C, 0x01003207,
  805. 0xB10, 0x00009807,
  806. 0xB14, 0x01000000,
  807. 0xB18, 0x00000002,
  808. 0xB1C, 0x00000002,
  809. 0xB20, 0x0000001F,
  810. 0xB24, 0x03020100,
  811. 0xB28, 0x07060504,
  812. 0xB2C, 0x0B0A0908,
  813. 0xB30, 0x0F0E0D0C,
  814. 0xB34, 0x13121110,
  815. 0xB38, 0x17161514,
  816. 0xB3C, 0x0000003A,
  817. 0xB40, 0x00000000,
  818. 0xB44, 0x00000000,
  819. 0xB48, 0x13000032,
  820. 0xB4C, 0x48080000,
  821. 0xB50, 0x00000000,
  822. 0xB54, 0x00000000,
  823. 0xB58, 0x00000000,
  824. 0xB5C, 0x00000000,
  825. 0xC00, 0x00000007,
  826. 0xC04, 0x00042020,
  827. 0xC08, 0x80410231,
  828. 0xC0C, 0x00000000,
  829. 0xC10, 0x00000100,
  830. 0xC14, 0x01000000,
  831. 0xC1C, 0x40000003,
  832. 0xC20, 0x12121212,
  833. 0xC24, 0x12121212,
  834. 0xC28, 0x12121212,
  835. 0xC2C, 0x12121212,
  836. 0xC30, 0x12121212,
  837. 0xC34, 0x12121212,
  838. 0xC38, 0x12121212,
  839. 0xC3C, 0x12121212,
  840. 0xC40, 0x12121212,
  841. 0xC44, 0x12121212,
  842. 0xC48, 0x12121212,
  843. 0xC4C, 0x12121212,
  844. 0xC50, 0x00000020,
  845. 0xC54, 0x0008121C,
  846. 0xC58, 0x30000C1C,
  847. 0xC5C, 0x00000058,
  848. 0xC60, 0x34344443,
  849. 0xC64, 0x07003333,
  850. 0xC68, 0x59791979,
  851. 0xC6C, 0x59795979,
  852. 0xC70, 0x19795979,
  853. 0xC74, 0x19795979,
  854. 0xC78, 0x19791979,
  855. 0xC7C, 0x19791979,
  856. 0xC80, 0x19791979,
  857. 0xC84, 0x19791979,
  858. 0xC94, 0x0100005C,
  859. 0xC98, 0x00000000,
  860. 0xC9C, 0x00000000,
  861. 0xCA0, 0x00000029,
  862. 0xCA4, 0x08040201,
  863. 0xCA8, 0x80402010,
  864. 0xFF0F0740, 0xABCD,
  865. 0xCB0, 0x77547717,
  866. 0xFF0F07C0, 0xCDEF,
  867. 0xCB0, 0x77547717,
  868. 0xFF0F07D8, 0xCDEF,
  869. 0xCB0, 0x54547710,
  870. 0xCDCDCDCD, 0xCDCD,
  871. 0xCB0, 0x77547777,
  872. 0xFF0F0740, 0xDEAD,
  873. 0xCB4, 0x00000077,
  874. 0xCB8, 0x00508242,
  875. 0xE00, 0x00000007,
  876. 0xE04, 0x00042020,
  877. 0xE08, 0x80410231,
  878. 0xE0C, 0x00000000,
  879. 0xE10, 0x00000100,
  880. 0xE14, 0x01000000,
  881. 0xE1C, 0x40000003,
  882. 0xE20, 0x12121212,
  883. 0xE24, 0x12121212,
  884. 0xE28, 0x12121212,
  885. 0xE2C, 0x12121212,
  886. 0xE30, 0x12121212,
  887. 0xE34, 0x12121212,
  888. 0xE38, 0x12121212,
  889. 0xE3C, 0x12121212,
  890. 0xE40, 0x12121212,
  891. 0xE44, 0x12121212,
  892. 0xE48, 0x12121212,
  893. 0xE4C, 0x12121212,
  894. 0xE50, 0x00000020,
  895. 0xE54, 0x0008121C,
  896. 0xE58, 0x30000C1C,
  897. 0xE5C, 0x00000058,
  898. 0xE60, 0x34344443,
  899. 0xE64, 0x07003333,
  900. 0xE68, 0x59791979,
  901. 0xE6C, 0x59795979,
  902. 0xE70, 0x19795979,
  903. 0xE74, 0x19795979,
  904. 0xE78, 0x19791979,
  905. 0xE7C, 0x19791979,
  906. 0xE80, 0x19791979,
  907. 0xE84, 0x19791979,
  908. 0xE94, 0x0100005C,
  909. 0xE98, 0x00000000,
  910. 0xE9C, 0x00000000,
  911. 0xEA0, 0x00000029,
  912. 0xEA4, 0x08040201,
  913. 0xEA8, 0x80402010,
  914. 0xFF0F0740, 0xABCD,
  915. 0xEB0, 0x77547717,
  916. 0xFF0F07C0, 0xCDEF,
  917. 0xEB0, 0x77547717,
  918. 0xFF0F07D8, 0xCDEF,
  919. 0xEB0, 0x54547710,
  920. 0xCDCDCDCD, 0xCDCD,
  921. 0xEB0, 0x77547777,
  922. 0xFF0F0740, 0xDEAD,
  923. 0xEB4, 0x00000077,
  924. 0xEB8, 0x00508242,
  925. };
  926. void
  927. ODM_ReadAndConfig_MP_8812A_PHY_REG(
  928. IN PDM_ODM_T pDM_Odm
  929. )
  930. {
  931. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  932. u4Byte hex = 0;
  933. u4Byte i = 0;
  934. u2Byte count = 0;
  935. pu4Byte ptr_array = NULL;
  936. u1Byte platform = pDM_Odm->SupportPlatform;
  937. u1Byte _interface = pDM_Odm->SupportInterface;
  938. u1Byte board = pDM_Odm->BoardType;
  939. u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG)/sizeof(u4Byte);
  940. pu4Byte Array = Array_MP_8812A_PHY_REG;
  941. hex += board;
  942. hex += _interface << 8;
  943. hex += platform << 16;
  944. hex += 0xFF000000;
  945. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8812A_PHY_REG, hex = 0x%X\n", hex));
  946. for (i = 0; i < ArrayLen; i += 2 )
  947. {
  948. u4Byte v1 = Array[i];
  949. u4Byte v2 = Array[i+1];
  950. // This (offset, data) pair meets the condition.
  951. if ( v1 < 0xCDCDCDCD )
  952. {
  953. odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2);
  954. continue;
  955. }
  956. else
  957. { // This line is the start line of branch.
  958. if ( !CheckCondition(Array[i], hex) )
  959. { // Discard the following (offset, data) pairs.
  960. READ_NEXT_PAIR(v1, v2, i);
  961. while (v2 != 0xDEAD &&
  962. v2 != 0xCDEF &&
  963. v2 != 0xCDCD && i < ArrayLen -2)
  964. {
  965. READ_NEXT_PAIR(v1, v2, i);
  966. }
  967. i -= 2; // prevent from for-loop += 2
  968. }
  969. else // Configure matched pairs and skip to end of if-else.
  970. {
  971. READ_NEXT_PAIR(v1, v2, i);
  972. while (v2 != 0xDEAD &&
  973. v2 != 0xCDEF &&
  974. v2 != 0xCDCD && i < ArrayLen -2)
  975. {
  976. odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2);
  977. READ_NEXT_PAIR(v1, v2, i);
  978. }
  979. while (v2 != 0xDEAD && i < ArrayLen -2)
  980. {
  981. READ_NEXT_PAIR(v1, v2, i);
  982. }
  983. }
  984. }
  985. }
  986. }
  987. /******************************************************************************
  988. * PHY_REG_MP.TXT
  989. ******************************************************************************/
  990. u4Byte Array_MP_8812A_PHY_REG_MP[] = {
  991. 0x800, 0x8020D410,
  992. 0x830, 0x2EAA8EB6,
  993. 0xC90, 0x01E00000,
  994. };
  995. void
  996. ODM_ReadAndConfig_MP_8812A_PHY_REG_MP(
  997. IN PDM_ODM_T pDM_Odm
  998. )
  999. {
  1000. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  1001. u4Byte hex = 0;
  1002. u4Byte i = 0;
  1003. u2Byte count = 0;
  1004. pu4Byte ptr_array = NULL;
  1005. u1Byte platform = pDM_Odm->SupportPlatform;
  1006. u1Byte _interface = pDM_Odm->SupportInterface;
  1007. u1Byte board = pDM_Odm->BoardType;
  1008. u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG_MP)/sizeof(u4Byte);
  1009. pu4Byte Array = Array_MP_8812A_PHY_REG_MP;
  1010. hex += board;
  1011. hex += _interface << 8;
  1012. hex += platform << 16;
  1013. hex += 0xFF000000;
  1014. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8812A_PHY_REG_MP, hex = 0x%X\n", hex));
  1015. for (i = 0; i < ArrayLen; i += 2 )
  1016. {
  1017. u4Byte v1 = Array[i];
  1018. u4Byte v2 = Array[i+1];
  1019. // This (offset, data) pair meets the condition.
  1020. if ( v1 < 0xCDCDCDCD )
  1021. {
  1022. odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2);
  1023. continue;
  1024. }
  1025. else
  1026. { // This line is the start line of branch.
  1027. if ( !CheckCondition(Array[i], hex) )
  1028. { // Discard the following (offset, data) pairs.
  1029. READ_NEXT_PAIR(v1, v2, i);
  1030. while (v2 != 0xDEAD &&
  1031. v2 != 0xCDEF &&
  1032. v2 != 0xCDCD && i < ArrayLen -2)
  1033. {
  1034. READ_NEXT_PAIR(v1, v2, i);
  1035. }
  1036. i -= 2; // prevent from for-loop += 2
  1037. }
  1038. else // Configure matched pairs and skip to end of if-else.
  1039. {
  1040. READ_NEXT_PAIR(v1, v2, i);
  1041. while (v2 != 0xDEAD &&
  1042. v2 != 0xCDEF &&
  1043. v2 != 0xCDCD && i < ArrayLen -2)
  1044. {
  1045. odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2);
  1046. READ_NEXT_PAIR(v1, v2, i);
  1047. }
  1048. while (v2 != 0xDEAD && i < ArrayLen -2)
  1049. {
  1050. READ_NEXT_PAIR(v1, v2, i);
  1051. }
  1052. }
  1053. }
  1054. }
  1055. }
  1056. /******************************************************************************
  1057. * PHY_REG_PG.TXT
  1058. ******************************************************************************/
  1059. u4Byte Array_MP_8812A_PHY_REG_PG[] = {
  1060. 0xC20, 0x00000000, 0x34363840,
  1061. 0xC24, 0x00000000, 0x42424444,
  1062. 0xC28, 0x00000000, 0x30323638,
  1063. 0xC2C, 0x00000000, 0x40424444,
  1064. 0xC30, 0x00000000, 0x28303236,
  1065. 0xC34, 0x00000000, 0x38404242,
  1066. 0xC38, 0x00000000, 0x26283034,
  1067. 0xE20, 0x00000000, 0x34363840,
  1068. 0xE24, 0x00000000, 0x42424444,
  1069. 0xE28, 0x00000000, 0x30323638,
  1070. 0xE2C, 0x00000000, 0x40424444,
  1071. 0xE30, 0x00000000, 0x28303236,
  1072. 0xE34, 0x00000000, 0x38404242,
  1073. 0xE38, 0x00000000, 0x26283034,
  1074. 0xC24, 0x00000000, 0x42424444,
  1075. 0xC28, 0x00000000, 0x30323640,
  1076. 0xC2C, 0x00000000, 0x40424444,
  1077. 0xC30, 0x00000000, 0x28303236,
  1078. 0xC34, 0x00000000, 0x38404242,
  1079. 0xC38, 0x00000000, 0x26283034,
  1080. 0xC3C, 0x00000000, 0x40424444,
  1081. 0xC40, 0x00000000, 0x28303236,
  1082. 0xC44, 0x00000000, 0x42422426,
  1083. 0xC48, 0x00000000, 0x30343840,
  1084. 0xC4C, 0x00000000, 0x22242628,
  1085. 0xE24, 0x00000000, 0x42424444,
  1086. 0xE28, 0x00000000, 0x30323640,
  1087. 0xE2C, 0x00000000, 0x40424444,
  1088. 0xE30, 0x00000000, 0x28303236,
  1089. 0xE34, 0x00000000, 0x38404242,
  1090. 0xE38, 0x00000000, 0x26283034,
  1091. 0xE3C, 0x00000000, 0x40424444,
  1092. 0xE40, 0x00000000, 0x28303236,
  1093. 0xE44, 0x00000000, 0x42422426,
  1094. 0xE48, 0x00000000, 0x30343840,
  1095. 0xE4C, 0x00000000, 0x22242628,
  1096. };
  1097. void
  1098. ODM_ReadAndConfig_MP_8812A_PHY_REG_PG(
  1099. IN PDM_ODM_T pDM_Odm
  1100. )
  1101. {
  1102. u4Byte hex = 0;
  1103. u4Byte i = 0;
  1104. u2Byte count = 0;
  1105. pu4Byte ptr_array = NULL;
  1106. u1Byte platform = pDM_Odm->SupportPlatform;
  1107. u1Byte _interface = pDM_Odm->SupportInterface;
  1108. u1Byte board = pDM_Odm->BoardType;
  1109. u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG_PG)/sizeof(u4Byte);
  1110. pu4Byte Array = Array_MP_8812A_PHY_REG_PG;
  1111. pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE;
  1112. hex += board;
  1113. hex += _interface << 8;
  1114. hex += platform << 16;
  1115. hex += 0xFF000000;
  1116. for (i = 0; i < ArrayLen; i += 3 )
  1117. {
  1118. u4Byte v1 = Array[i];
  1119. u4Byte v2 = Array[i+1];
  1120. u4Byte v3 = Array[i+2];
  1121. // this line is a line of pure_body
  1122. if ( v1 < 0xCDCDCDCD )
  1123. {
  1124. odm_ConfigBB_PHY_REG_PG_8812A(pDM_Odm, v1, v2, v3);
  1125. continue;
  1126. }
  1127. else
  1128. { // this line is the start of branch
  1129. if ( !CheckCondition(Array[i], hex) )
  1130. { // don't need the hw_body
  1131. i += 2; // skip the pair of expression
  1132. v1 = Array[i];
  1133. v2 = Array[i+1];
  1134. v3 = Array[i+2];
  1135. while (v2 != 0xDEAD)
  1136. {
  1137. i += 3;
  1138. v1 = Array[i];
  1139. v2 = Array[i+1];
  1140. v3 = Array[i+1];
  1141. }
  1142. }
  1143. }
  1144. }
  1145. }
  1146. /******************************************************************************
  1147. * PHY_REG_PG_ASUS.TXT
  1148. ******************************************************************************/
  1149. u4Byte Array_MP_8812A_PHY_REG_PG_ASUS[] = {
  1150. 0xC20, 0x00000000, 0x34343434,
  1151. 0xC24, 0x00000000, 0x32323232,
  1152. 0xC28, 0x00000000, 0x28303232,
  1153. 0xC2C, 0x00000000, 0x32323232,
  1154. 0xC30, 0x00000000, 0x24283032,
  1155. 0xC34, 0x00000000, 0x32323232,
  1156. 0xC38, 0x00000000, 0x24283032,
  1157. 0xE20, 0x00000000, 0x34343434,
  1158. 0xE24, 0x00000000, 0x32323232,
  1159. 0xE28, 0x00000000, 0x28303232,
  1160. 0xE2C, 0x00000000, 0x32323232,
  1161. 0xE30, 0x00000000, 0x24283032,
  1162. 0xE34, 0x00000000, 0x32323232,
  1163. 0xE38, 0x00000000, 0x24283032,
  1164. 0xC24, 0x00000000, 0x32323232,
  1165. 0xC28, 0x00000000, 0x28303232,
  1166. 0xC2C, 0x00000000, 0x32323232,
  1167. 0xC30, 0x00000000, 0x24283032,
  1168. 0xC34, 0x00000000, 0x32323232,
  1169. 0xC38, 0x00000000, 0x24283032,
  1170. 0xC3C, 0x00000000, 0x32323232,
  1171. 0xC40, 0x00000000, 0x24283032,
  1172. 0xC44, 0x00000000, 0x32322222,
  1173. 0xC48, 0x00000000, 0x30323232,
  1174. 0xC4C, 0x00000000, 0x22222428,
  1175. 0xE24, 0x00000000, 0x32323232,
  1176. 0xE28, 0x00000000, 0x28303232,
  1177. 0xE2C, 0x00000000, 0x32323232,
  1178. 0xE30, 0x00000000, 0x24283032,
  1179. 0xE34, 0x00000000, 0x32323232,
  1180. 0xE38, 0x00000000, 0x24283032,
  1181. 0xE3C, 0x00000000, 0x32323232,
  1182. 0xE40, 0x00000000, 0x24283032,
  1183. 0xE44, 0x00000000, 0x32322222,
  1184. 0xE48, 0x00000000, 0x30323232,
  1185. 0xE4C, 0x00000000, 0x22222428,
  1186. };
  1187. void
  1188. ODM_ReadAndConfig_MP_8812A_PHY_REG_PG_ASUS(
  1189. IN PDM_ODM_T pDM_Odm
  1190. )
  1191. {
  1192. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  1193. u4Byte hex = 0;
  1194. u4Byte i = 0;
  1195. u2Byte count = 0;
  1196. pu4Byte ptr_array = NULL;
  1197. u1Byte platform = pDM_Odm->SupportPlatform;
  1198. u1Byte _interface = pDM_Odm->SupportInterface;
  1199. u1Byte board = pDM_Odm->BoardType;
  1200. u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG_PG_ASUS)/sizeof(u4Byte);
  1201. pu4Byte Array = Array_MP_8812A_PHY_REG_PG_ASUS;
  1202. hex += board;
  1203. hex += _interface << 8;
  1204. hex += platform << 16;
  1205. hex += 0xFF000000;
  1206. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8812A_PHY_REG_PG_ASUS, hex = 0x%X\n", hex));
  1207. for (i = 0; i < ArrayLen; i += 2 )
  1208. {
  1209. u4Byte v1 = Array[i];
  1210. u4Byte v2 = Array[i+1];
  1211. // This (offset, data) pair meets the condition.
  1212. if ( v1 < 0xCDCDCDCD )
  1213. {
  1214. odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2);
  1215. continue;
  1216. }
  1217. else
  1218. { // This line is the start line of branch.
  1219. if ( !CheckCondition(Array[i], hex) )
  1220. { // Discard the following (offset, data) pairs.
  1221. READ_NEXT_PAIR(v1, v2, i);
  1222. while (v2 != 0xDEAD &&
  1223. v2 != 0xCDEF &&
  1224. v2 != 0xCDCD && i < ArrayLen -2)
  1225. {
  1226. READ_NEXT_PAIR(v1, v2, i);
  1227. }
  1228. i -= 2; // prevent from for-loop += 2
  1229. }
  1230. else // Configure matched pairs and skip to end of if-else.
  1231. {
  1232. READ_NEXT_PAIR(v1, v2, i);
  1233. while (v2 != 0xDEAD &&
  1234. v2 != 0xCDEF &&
  1235. v2 != 0xCDCD && i < ArrayLen -2)
  1236. {
  1237. odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2);
  1238. READ_NEXT_PAIR(v1, v2, i);
  1239. }
  1240. while (v2 != 0xDEAD && i < ArrayLen -2)
  1241. {
  1242. READ_NEXT_PAIR(v1, v2, i);
  1243. }
  1244. }
  1245. }
  1246. }
  1247. }
  1248. /******************************************************************************
  1249. * PHY_REG_PG_NEC.TXT
  1250. ******************************************************************************/
  1251. u4Byte Array_MP_8812A_PHY_REG_PG_NEC[] = {
  1252. 0xC20, 0x00000000, 0x32323232,
  1253. 0xC24, 0x00000000, 0x32343434,
  1254. 0xC28, 0x00000000, 0x24262830,
  1255. 0xC2C, 0x00000000, 0x32343434,
  1256. 0xC30, 0x00000000, 0x24262830,
  1257. 0xC34, 0x00000000, 0x32343434,
  1258. 0xC38, 0x00000000, 0x24262830,
  1259. 0xE20, 0x00000000, 0x32323232,
  1260. 0xE24, 0x00000000, 0x32343434,
  1261. 0xE28, 0x00000000, 0x24262830,
  1262. 0xE2C, 0x00000000, 0x32343434,
  1263. 0xE30, 0x00000000, 0x24262830,
  1264. 0xE34, 0x00000000, 0x32343434,
  1265. 0xE38, 0x00000000, 0x24262830,
  1266. 0xC24, 0x00000000, 0x32343434,
  1267. 0xC28, 0x00000000, 0x24262830,
  1268. 0xC2C, 0x00000000, 0x32343434,
  1269. 0xC30, 0x00000000, 0x24262830,
  1270. 0xC34, 0x00000000, 0x28282828,
  1271. 0xC38, 0x00000000, 0x24262828,
  1272. 0xC3C, 0x00000000, 0x32343434,
  1273. 0xC40, 0x00000000, 0x24262830,
  1274. 0xC44, 0x00000000, 0x28282022,
  1275. 0xC48, 0x00000000, 0x28282828,
  1276. 0xC4C, 0x00000000, 0x20222426,
  1277. 0xE24, 0x00000000, 0x32343434,
  1278. 0xE28, 0x00000000, 0x24262830,
  1279. 0xE2C, 0x00000000, 0x32343434,
  1280. 0xE30, 0x00000000, 0x24262830,
  1281. 0xE34, 0x00000000, 0x28282828,
  1282. 0xE38, 0x00000000, 0x24262828,
  1283. 0xE3C, 0x00000000, 0x32343434,
  1284. 0xE40, 0x00000000, 0x24262830,
  1285. 0xE44, 0x00000000, 0x28282022,
  1286. 0xE48, 0x00000000, 0x28282828,
  1287. 0xE4C, 0x00000000, 0x20222426,
  1288. };
  1289. void
  1290. ODM_ReadAndConfig_MP_8812A_PHY_REG_PG_NEC(
  1291. IN PDM_ODM_T pDM_Odm
  1292. )
  1293. {
  1294. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  1295. u4Byte hex = 0;
  1296. u4Byte i = 0;
  1297. u2Byte count = 0;
  1298. pu4Byte ptr_array = NULL;
  1299. u1Byte platform = pDM_Odm->SupportPlatform;
  1300. u1Byte _interface = pDM_Odm->SupportInterface;
  1301. u1Byte board = pDM_Odm->BoardType;
  1302. u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG_PG_NEC)/sizeof(u4Byte);
  1303. pu4Byte Array = Array_MP_8812A_PHY_REG_PG_NEC;
  1304. hex += board;
  1305. hex += _interface << 8;
  1306. hex += platform << 16;
  1307. hex += 0xFF000000;
  1308. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8812A_PHY_REG_PG_NEC, hex = 0x%X\n", hex));
  1309. for (i = 0; i < ArrayLen; i += 2 )
  1310. {
  1311. u4Byte v1 = Array[i];
  1312. u4Byte v2 = Array[i+1];
  1313. // This (offset, data) pair meets the condition.
  1314. if ( v1 < 0xCDCDCDCD )
  1315. {
  1316. odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2);
  1317. continue;
  1318. }
  1319. else
  1320. { // This line is the start line of branch.
  1321. if ( !CheckCondition(Array[i], hex) )
  1322. { // Discard the following (offset, data) pairs.
  1323. READ_NEXT_PAIR(v1, v2, i);
  1324. while (v2 != 0xDEAD &&
  1325. v2 != 0xCDEF &&
  1326. v2 != 0xCDCD && i < ArrayLen -2)
  1327. {
  1328. READ_NEXT_PAIR(v1, v2, i);
  1329. }
  1330. i -= 2; // prevent from for-loop += 2
  1331. }
  1332. else // Configure matched pairs and skip to end of if-else.
  1333. {
  1334. READ_NEXT_PAIR(v1, v2, i);
  1335. while (v2 != 0xDEAD &&
  1336. v2 != 0xCDEF &&
  1337. v2 != 0xCDCD && i < ArrayLen -2)
  1338. {
  1339. odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2);
  1340. READ_NEXT_PAIR(v1, v2, i);
  1341. }
  1342. while (v2 != 0xDEAD && i < ArrayLen -2)
  1343. {
  1344. READ_NEXT_PAIR(v1, v2, i);
  1345. }
  1346. }
  1347. }
  1348. }
  1349. }
  1350. #endif // end of HWIMG_SUPPORT