reg.h 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2009-2012 Realtek Corporation.
  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. * The full GNU General Public License is included in this distribution in the
  15. * file called LICENSE.
  16. *
  17. * Contact Information:
  18. * wlanfae <wlanfae@realtek.com>
  19. * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
  20. * Hsinchu 300, Taiwan.
  21. *
  22. * Larry Finger <Larry.Finger@lwfinger.net>
  23. *
  24. *****************************************************************************/
  25. #ifndef __RTL8723E_REG_H__
  26. #define __RTL8723E_REG_H__
  27. #define REG_SYS_ISO_CTRL 0x0000
  28. #define REG_SYS_FUNC_EN 0x0002
  29. #define REG_APS_FSMCO 0x0004
  30. #define REG_SYS_CLKR 0x0008
  31. #define REG_9346CR 0x000A
  32. #define REG_EE_VPD 0x000C
  33. #define REG_AFE_MISC 0x0010
  34. #define REG_SPS0_CTRL 0x0011
  35. #define REG_SPS_OCP_CFG 0x0018
  36. #define REG_RSV_CTRL 0x001C
  37. #define REG_RF_CTRL 0x001F
  38. #define REG_LDOA15_CTRL 0x0020
  39. #define REG_LDOV12D_CTRL 0x0021
  40. #define REG_LDOHCI12_CTRL 0x0022
  41. #define REG_LPLDO_CTRL 0x0023
  42. #define REG_AFE_XTAL_CTRL 0x0024
  43. #define REG_AFE_PLL_CTRL 0x0028
  44. #define REG_EFUSE_CTRL 0x0030
  45. #define REG_EFUSE_TEST 0x0034
  46. #define REG_PWR_DATA 0x0038
  47. #define REG_CAL_TIMER 0x003C
  48. #define REG_ACLK_MON 0x003E
  49. #define REG_GPIO_MUXCFG 0x0040
  50. #define REG_GPIO_IO_SEL 0x0042
  51. #define REG_MAC_PINMUX_CFG 0x0043
  52. #define REG_GPIO_PIN_CTRL 0x0044
  53. #define REG_GPIO_INTM 0x0048
  54. #define REG_LEDCFG0 0x004C
  55. #define REG_LEDCFG1 0x004D
  56. #define REG_LEDCFG2 0x004E
  57. #define REG_LEDCFG3 0x004F
  58. #define REG_FSIMR 0x0050
  59. #define REG_FSISR 0x0054
  60. #define REG_GPIO_PIN_CTRL_2 0x0060
  61. #define REG_GPIO_IO_SEL_2 0x0062
  62. #define REG_MULTI_FUNC_CTRL 0x0068
  63. #define REG_MCUFWDL 0x0080
  64. #define REG_HMEBOX_EXT_0 0x0088
  65. #define REG_HMEBOX_EXT_1 0x008A
  66. #define REG_HMEBOX_EXT_2 0x008C
  67. #define REG_HMEBOX_EXT_3 0x008E
  68. #define REG_BIST_SCAN 0x00D0
  69. #define REG_BIST_RPT 0x00D4
  70. #define REG_BIST_ROM_RPT 0x00D8
  71. #define REG_USB_SIE_INTF 0x00E0
  72. #define REG_PCIE_MIO_INTF 0x00E4
  73. #define REG_PCIE_MIO_INTD 0x00E8
  74. #define REG_SYS_CFG 0x00F0
  75. #define REG_GPIO_OUTSTS 0x00F4
  76. #define REG_CR 0x0100
  77. #define REG_PBP 0x0104
  78. #define REG_TRXDMA_CTRL 0x010C
  79. #define REG_TRXFF_BNDY 0x0114
  80. #define REG_TRXFF_STATUS 0x0118
  81. #define REG_RXFF_PTR 0x011C
  82. #define REG_HIMR 0x0120
  83. #define REG_HISR 0x0124
  84. #define REG_HIMRE 0x0128
  85. #define REG_HISRE 0x012C
  86. #define REG_CPWM 0x012F
  87. #define REG_FWIMR 0x0130
  88. #define REG_FWISR 0x0134
  89. #define REG_PKTBUF_DBG_CTRL 0x0140
  90. #define REG_PKTBUF_DBG_DATA_L 0x0144
  91. #define REG_PKTBUF_DBG_DATA_H 0x0148
  92. #define REG_TC0_CTRL 0x0150
  93. #define REG_TC1_CTRL 0x0154
  94. #define REG_TC2_CTRL 0x0158
  95. #define REG_TC3_CTRL 0x015C
  96. #define REG_TC4_CTRL 0x0160
  97. #define REG_TCUNIT_BASE 0x0164
  98. #define REG_MBIST_START 0x0174
  99. #define REG_MBIST_DONE 0x0178
  100. #define REG_MBIST_FAIL 0x017C
  101. #define REG_C2HEVT_MSG_NORMAL 0x01A0
  102. #define REG_C2HEVT_MSG_TEST 0x01B8
  103. #define REG_MCUTST_1 0x01c0
  104. #define REG_FMETHR 0x01C8
  105. #define REG_HMETFR 0x01CC
  106. #define REG_HMEBOX_0 0x01D0
  107. #define REG_HMEBOX_1 0x01D4
  108. #define REG_HMEBOX_2 0x01D8
  109. #define REG_HMEBOX_3 0x01DC
  110. #define REG_LLT_INIT 0x01E0
  111. #define REG_BB_ACCEESS_CTRL 0x01E8
  112. #define REG_BB_ACCESS_DATA 0x01EC
  113. #define REG_RQPN 0x0200
  114. #define REG_FIFOPAGE 0x0204
  115. #define REG_TDECTRL 0x0208
  116. #define REG_TXDMA_OFFSET_CHK 0x020C
  117. #define REG_TXDMA_STATUS 0x0210
  118. #define REG_RQPN_NPQ 0x0214
  119. #define REG_RXDMA_AGG_PG_TH 0x0280
  120. #define REG_RXPKT_NUM 0x0284
  121. #define REG_RXDMA_STATUS 0x0288
  122. #define REG_PCIE_CTRL_REG 0x0300
  123. #define REG_INT_MIG 0x0304
  124. #define REG_BCNQ_DESA 0x0308
  125. #define REG_HQ_DESA 0x0310
  126. #define REG_MGQ_DESA 0x0318
  127. #define REG_VOQ_DESA 0x0320
  128. #define REG_VIQ_DESA 0x0328
  129. #define REG_BEQ_DESA 0x0330
  130. #define REG_BKQ_DESA 0x0338
  131. #define REG_RX_DESA 0x0340
  132. #define REG_DBI 0x0348
  133. #define REG_MDIO 0x0354
  134. #define REG_DBG_SEL 0x0360
  135. #define REG_PCIE_HRPWM 0x0361
  136. #define REG_PCIE_HCPWM 0x0363
  137. #define REG_UART_CTRL 0x0364
  138. #define REG_UART_TX_DESA 0x0370
  139. #define REG_UART_RX_DESA 0x0378
  140. #define REG_HDAQ_DESA_NODEF 0x0000
  141. #define REG_CMDQ_DESA_NODEF 0x0000
  142. #define REG_VOQ_INFORMATION 0x0400
  143. #define REG_VIQ_INFORMATION 0x0404
  144. #define REG_BEQ_INFORMATION 0x0408
  145. #define REG_BKQ_INFORMATION 0x040C
  146. #define REG_MGQ_INFORMATION 0x0410
  147. #define REG_HGQ_INFORMATION 0x0414
  148. #define REG_BCNQ_INFORMATION 0x0418
  149. #define REG_CPU_MGQ_INFORMATION 0x041C
  150. #define REG_FWHW_TXQ_CTRL 0x0420
  151. #define REG_HWSEQ_CTRL 0x0423
  152. #define REG_TXPKTBUF_BCNQ_BDNY 0x0424
  153. #define REG_TXPKTBUF_MGQ_BDNY 0x0425
  154. #define REG_MULTI_BCNQ_EN 0x0426
  155. #define REG_MULTI_BCNQ_OFFSET 0x0427
  156. #define REG_SPEC_SIFS 0x0428
  157. #define REG_RL 0x042A
  158. #define REG_DARFRC 0x0430
  159. #define REG_RARFRC 0x0438
  160. #define REG_RRSR 0x0440
  161. #define REG_ARFR0 0x0444
  162. #define REG_ARFR1 0x0448
  163. #define REG_ARFR2 0x044C
  164. #define REG_ARFR3 0x0450
  165. #define REG_AGGLEN_LMT 0x0458
  166. #define REG_AMPDU_MIN_SPACE 0x045C
  167. #define REG_TXPKTBUF_WMAC_LBK_BF_HD 0x045D
  168. #define REG_FAST_EDCA_CTRL 0x0460
  169. #define REG_RD_RESP_PKT_TH 0x0463
  170. #define REG_INIRTS_RATE_SEL 0x0480
  171. #define REG_INIDATA_RATE_SEL 0x0484
  172. #define REG_POWER_STATUS 0x04A4
  173. #define REG_POWER_STAGE1 0x04B4
  174. #define REG_POWER_STAGE2 0x04B8
  175. #define REG_PKT_LIFE_TIME 0x04C0
  176. #define REG_STBC_SETTING 0x04C4
  177. #define REG_PROT_MODE_CTRL 0x04C8
  178. #define REG_BAR_MODE_CTRL 0x04CC
  179. #define REG_RA_TRY_RATE_AGG_LMT 0x04CF
  180. #define REG_NQOS_SEQ 0x04DC
  181. #define REG_QOS_SEQ 0x04DE
  182. #define REG_NEED_CPU_HANDLE 0x04E0
  183. #define REG_PKT_LOSE_RPT 0x04E1
  184. #define REG_PTCL_ERR_STATUS 0x04E2
  185. #define REG_DUMMY 0x04FC
  186. #define REG_EDCA_VO_PARAM 0x0500
  187. #define REG_EDCA_VI_PARAM 0x0504
  188. #define REG_EDCA_BE_PARAM 0x0508
  189. #define REG_EDCA_BK_PARAM 0x050C
  190. #define REG_BCNTCFG 0x0510
  191. #define REG_PIFS 0x0512
  192. #define REG_RDG_PIFS 0x0513
  193. #define REG_SIFS_CTX 0x0514
  194. #define REG_SIFS_TRX 0x0516
  195. #define REG_AGGR_BREAK_TIME 0x051A
  196. #define REG_SLOT 0x051B
  197. #define REG_TX_PTCL_CTRL 0x0520
  198. #define REG_TXPAUSE 0x0522
  199. #define REG_DIS_TXREQ_CLR 0x0523
  200. #define REG_RD_CTRL 0x0524
  201. #define REG_TBTT_PROHIBIT 0x0540
  202. #define REG_RD_NAV_NXT 0x0544
  203. #define REG_NAV_PROT_LEN 0x0546
  204. #define REG_BCN_CTRL 0x0550
  205. #define REG_MBID_NUM 0x0552
  206. #define REG_DUAL_TSF_RST 0x0553
  207. #define REG_BCN_INTERVAL 0x0554
  208. #define REG_MBSSID_BCN_SPACE 0x0554
  209. #define REG_DRVERLYINT 0x0558
  210. #define REG_BCNDMATIM 0x0559
  211. #define REG_ATIMWND 0x055A
  212. #define REG_USTIME_TSF 0x055C
  213. #define REG_BCN_MAX_ERR 0x055D
  214. #define REG_RXTSF_OFFSET_CCK 0x055E
  215. #define REG_RXTSF_OFFSET_OFDM 0x055F
  216. #define REG_TSFTR 0x0560
  217. #define REG_INIT_TSFTR 0x0564
  218. #define REG_PSTIMER 0x0580
  219. #define REG_TIMER0 0x0584
  220. #define REG_TIMER1 0x0588
  221. #define REG_ACMHWCTRL 0x05C0
  222. #define REG_ACMRSTCTRL 0x05C1
  223. #define REG_ACMAVG 0x05C2
  224. #define REG_VO_ADMTIME 0x05C4
  225. #define REG_VI_ADMTIME 0x05C6
  226. #define REG_BE_ADMTIME 0x05C8
  227. #define REG_EDCA_RANDOM_GEN 0x05CC
  228. #define REG_SCH_TXCMD 0x05D0
  229. #define REG_APSD_CTRL 0x0600
  230. #define REG_BWOPMODE 0x0603
  231. #define REG_TCR 0x0604
  232. #define REG_RCR 0x0608
  233. #define REG_RX_PKT_LIMIT 0x060C
  234. #define REG_RX_DLK_TIME 0x060D
  235. #define REG_RX_DRVINFO_SZ 0x060F
  236. #define REG_MACID 0x0610
  237. #define REG_BSSID 0x0618
  238. #define REG_MAR 0x0620
  239. #define REG_MBIDCAMCFG 0x0628
  240. #define REG_USTIME_EDCA 0x0638
  241. #define REG_MAC_SPEC_SIFS 0x063A
  242. #define REG_RESP_SIFS_CCK 0x063C
  243. #define REG_RESP_SIFS_OFDM 0x063E
  244. #define REG_ACKTO 0x0640
  245. #define REG_CTS2TO 0x0641
  246. #define REG_EIFS 0x0642
  247. #define REG_NAV_CTRL 0x0650
  248. #define REG_BACAMCMD 0x0654
  249. #define REG_BACAMCONTENT 0x0658
  250. #define REG_LBDLY 0x0660
  251. #define REG_FWDLY 0x0661
  252. #define REG_RXERR_RPT 0x0664
  253. #define REG_WMAC_TRXPTCL_CTL 0x0668
  254. #define REG_CAMCMD 0x0670
  255. #define REG_CAMWRITE 0x0674
  256. #define REG_CAMREAD 0x0678
  257. #define REG_CAMDBG 0x067C
  258. #define REG_SECCFG 0x0680
  259. #define REG_WOW_CTRL 0x0690
  260. #define REG_PSSTATUS 0x0691
  261. #define REG_PS_RX_INFO 0x0692
  262. #define REG_LPNAV_CTRL 0x0694
  263. #define REG_WKFMCAM_CMD 0x0698
  264. #define REG_WKFMCAM_RWD 0x069C
  265. #define REG_RXFLTMAP0 0x06A0
  266. #define REG_RXFLTMAP1 0x06A2
  267. #define REG_RXFLTMAP2 0x06A4
  268. #define REG_BCN_PSR_RPT 0x06A8
  269. #define REG_CALB32K_CTRL 0x06AC
  270. #define REG_PKT_MON_CTRL 0x06B4
  271. #define REG_BT_COEX_TABLE 0x06C0
  272. #define REG_WMAC_RESP_TXINFO 0x06D8
  273. #define REG_USB_INFO 0xFE17
  274. #define REG_USB_SPECIAL_OPTION 0xFE55
  275. #define REG_USB_DMA_AGG_TO 0xFE5B
  276. #define REG_USB_AGG_TO 0xFE5C
  277. #define REG_USB_AGG_TH 0xFE5D
  278. #define REG_TEST_USB_TXQS 0xFE48
  279. #define REG_TEST_SIE_VID 0xFE60
  280. #define REG_TEST_SIE_PID 0xFE62
  281. #define REG_TEST_SIE_OPTIONAL 0xFE64
  282. #define REG_TEST_SIE_CHIRP_K 0xFE65
  283. #define REG_TEST_SIE_PHY 0xFE66
  284. #define REG_TEST_SIE_MAC_ADDR 0xFE70
  285. #define REG_TEST_SIE_STRING 0xFE80
  286. #define REG_NORMAL_SIE_VID 0xFE60
  287. #define REG_NORMAL_SIE_PID 0xFE62
  288. #define REG_NORMAL_SIE_OPTIONAL 0xFE64
  289. #define REG_NORMAL_SIE_EP 0xFE65
  290. #define REG_NORMAL_SIE_PHY 0xFE68
  291. #define REG_NORMAL_SIE_MAC_ADDR 0xFE70
  292. #define REG_NORMAL_SIE_STRING 0xFE80
  293. #define CR9346 REG_9346CR
  294. #define MSR (REG_CR + 2)
  295. #define ISR REG_HISR
  296. #define TSFR REG_TSFTR
  297. #define MACIDR0 REG_MACID
  298. #define MACIDR4 (REG_MACID + 4)
  299. #define PBP REG_PBP
  300. #define IDR0 MACIDR0
  301. #define IDR4 MACIDR4
  302. #define UNUSED_REGISTER 0x1BF
  303. #define DCAM UNUSED_REGISTER
  304. #define PSR UNUSED_REGISTER
  305. #define BBADDR UNUSED_REGISTER
  306. #define PHYDATAR UNUSED_REGISTER
  307. #define INVALID_BBRF_VALUE 0x12345678
  308. #define MAX_MSS_DENSITY_2T 0x13
  309. #define MAX_MSS_DENSITY_1T 0x0A
  310. #define CMDEEPROM_EN BIT(5)
  311. #define CMDEEPROM_SEL BIT(4)
  312. #define CMD9346CR_9356SEL BIT(4)
  313. #define AUTOLOAD_EEPROM (CMDEEPROM_EN|CMDEEPROM_SEL)
  314. #define AUTOLOAD_EFUSE CMDEEPROM_EN
  315. #define GPIOSEL_GPIO 0
  316. #define GPIOSEL_ENBT BIT(5)
  317. #define GPIO_IN REG_GPIO_PIN_CTRL
  318. #define GPIO_OUT (REG_GPIO_PIN_CTRL+1)
  319. #define GPIO_IO_SEL (REG_GPIO_PIN_CTRL+2)
  320. #define GPIO_MOD (REG_GPIO_PIN_CTRL+3)
  321. #define MSR_NOLINK 0x00
  322. #define MSR_ADHOC 0x01
  323. #define MSR_INFRA 0x02
  324. #define MSR_AP 0x03
  325. #define RRSR_RSC_OFFSET 21
  326. #define RRSR_SHORT_OFFSET 23
  327. #define RRSR_RSC_BW_40M 0x600000
  328. #define RRSR_RSC_UPSUBCHNL 0x400000
  329. #define RRSR_RSC_LOWSUBCHNL 0x200000
  330. #define RRSR_SHORT 0x800000
  331. #define RRSR_1M BIT(0)
  332. #define RRSR_2M BIT(1)
  333. #define RRSR_5_5M BIT(2)
  334. #define RRSR_11M BIT(3)
  335. #define RRSR_6M BIT(4)
  336. #define RRSR_9M BIT(5)
  337. #define RRSR_12M BIT(6)
  338. #define RRSR_18M BIT(7)
  339. #define RRSR_24M BIT(8)
  340. #define RRSR_36M BIT(9)
  341. #define RRSR_48M BIT(10)
  342. #define RRSR_54M BIT(11)
  343. #define RRSR_MCS0 BIT(12)
  344. #define RRSR_MCS1 BIT(13)
  345. #define RRSR_MCS2 BIT(14)
  346. #define RRSR_MCS3 BIT(15)
  347. #define RRSR_MCS4 BIT(16)
  348. #define RRSR_MCS5 BIT(17)
  349. #define RRSR_MCS6 BIT(18)
  350. #define RRSR_MCS7 BIT(19)
  351. #define BRSR_ACKSHORTPMB BIT(23)
  352. #define RATR_1M 0x00000001
  353. #define RATR_2M 0x00000002
  354. #define RATR_55M 0x00000004
  355. #define RATR_11M 0x00000008
  356. #define RATR_6M 0x00000010
  357. #define RATR_9M 0x00000020
  358. #define RATR_12M 0x00000040
  359. #define RATR_18M 0x00000080
  360. #define RATR_24M 0x00000100
  361. #define RATR_36M 0x00000200
  362. #define RATR_48M 0x00000400
  363. #define RATR_54M 0x00000800
  364. #define RATR_MCS0 0x00001000
  365. #define RATR_MCS1 0x00002000
  366. #define RATR_MCS2 0x00004000
  367. #define RATR_MCS3 0x00008000
  368. #define RATR_MCS4 0x00010000
  369. #define RATR_MCS5 0x00020000
  370. #define RATR_MCS6 0x00040000
  371. #define RATR_MCS7 0x00080000
  372. #define RATR_MCS8 0x00100000
  373. #define RATR_MCS9 0x00200000
  374. #define RATR_MCS10 0x00400000
  375. #define RATR_MCS11 0x00800000
  376. #define RATR_MCS12 0x01000000
  377. #define RATR_MCS13 0x02000000
  378. #define RATR_MCS14 0x04000000
  379. #define RATR_MCS15 0x08000000
  380. #define RATE_1M BIT(0)
  381. #define RATE_2M BIT(1)
  382. #define RATE_5_5M BIT(2)
  383. #define RATE_11M BIT(3)
  384. #define RATE_6M BIT(4)
  385. #define RATE_9M BIT(5)
  386. #define RATE_12M BIT(6)
  387. #define RATE_18M BIT(7)
  388. #define RATE_24M BIT(8)
  389. #define RATE_36M BIT(9)
  390. #define RATE_48M BIT(10)
  391. #define RATE_54M BIT(11)
  392. #define RATE_MCS0 BIT(12)
  393. #define RATE_MCS1 BIT(13)
  394. #define RATE_MCS2 BIT(14)
  395. #define RATE_MCS3 BIT(15)
  396. #define RATE_MCS4 BIT(16)
  397. #define RATE_MCS5 BIT(17)
  398. #define RATE_MCS6 BIT(18)
  399. #define RATE_MCS7 BIT(19)
  400. #define RATE_MCS8 BIT(20)
  401. #define RATE_MCS9 BIT(21)
  402. #define RATE_MCS10 BIT(22)
  403. #define RATE_MCS11 BIT(23)
  404. #define RATE_MCS12 BIT(24)
  405. #define RATE_MCS13 BIT(25)
  406. #define RATE_MCS14 BIT(26)
  407. #define RATE_MCS15 BIT(27)
  408. #define RATE_ALL_CCK (RATR_1M | RATR_2M | RATR_55M | RATR_11M)
  409. #define RATE_ALL_OFDM_AG (RATR_6M | RATR_9M | RATR_12M | RATR_18M |\
  410. RATR_24M | RATR_36M | RATR_48M | RATR_54M)
  411. #define RATE_ALL_OFDM_1SS (RATR_MCS0 | RATR_MCS1 | RATR_MCS2 |\
  412. RATR_MCS3 | RATR_MCS4 | RATR_MCS5 |\
  413. RATR_MCS6 | RATR_MCS7)
  414. #define RATE_ALL_OFDM_2SS (RATR_MCS8 | RATR_MCS9 | RATR_MCS10 |\
  415. RATR_MCS11 | RATR_MCS12 | RATR_MCS13 |\
  416. RATR_MCS14 | RATR_MCS15)
  417. #define BW_OPMODE_20MHZ BIT(2)
  418. #define BW_OPMODE_5G BIT(1)
  419. #define BW_OPMODE_11J BIT(0)
  420. #define CAM_VALID BIT(15)
  421. #define CAM_NOTVALID 0x0000
  422. #define CAM_USEDK BIT(5)
  423. #define CAM_NONE 0x0
  424. #define CAM_WEP40 0x01
  425. #define CAM_TKIP 0x02
  426. #define CAM_AES 0x04
  427. #define CAM_WEP104 0x05
  428. #define TOTAL_CAM_ENTRY 32
  429. #define HALF_CAM_ENTRY 16
  430. #define CAM_WRITE BIT(16)
  431. #define CAM_READ 0x00000000
  432. #define CAM_POLLINIG BIT(31)
  433. #define SCR_USEDK 0x01
  434. #define SCR_TXSEC_ENABLE 0x02
  435. #define SCR_RXSEC_ENABLE 0x04
  436. #define WOW_PMEN BIT(0)
  437. #define WOW_WOMEN BIT(1)
  438. #define WOW_MAGIC BIT(2)
  439. #define WOW_UWF BIT(3)
  440. #define IMR8190_DISABLED 0x0
  441. #define IMR_BCNDMAINT6 BIT(31)
  442. #define IMR_BCNDMAINT5 BIT(30)
  443. #define IMR_BCNDMAINT4 BIT(29)
  444. #define IMR_BCNDMAINT3 BIT(28)
  445. #define IMR_BCNDMAINT2 BIT(27)
  446. #define IMR_BCNDMAINT1 BIT(26)
  447. #define IMR_BCNDOK8 BIT(25)
  448. #define IMR_BCNDOK7 BIT(24)
  449. #define IMR_BCNDOK6 BIT(23)
  450. #define IMR_BCNDOK5 BIT(22)
  451. #define IMR_BCNDOK4 BIT(21)
  452. #define IMR_BCNDOK3 BIT(20)
  453. #define IMR_BCNDOK2 BIT(19)
  454. #define IMR_BCNDOK1 BIT(18)
  455. #define IMR_TIMEOUT2 BIT(17)
  456. #define IMR_TIMEOUT1 BIT(16)
  457. #define IMR_TXFOVW BIT(15)
  458. #define IMR_PSTIMEOUT BIT(14)
  459. #define IMR_BCNINT BIT(13)
  460. #define IMR_RXFOVW BIT(12)
  461. #define IMR_RDU BIT(11)
  462. #define IMR_ATIMEND BIT(10)
  463. #define IMR_BDOK BIT(9)
  464. #define IMR_HIGHDOK BIT(8)
  465. #define IMR_TBDOK BIT(7)
  466. #define IMR_MGNTDOK BIT(6)
  467. #define IMR_TBDER BIT(5)
  468. #define IMR_BKDOK BIT(4)
  469. #define IMR_BEDOK BIT(3)
  470. #define IMR_VIDOK BIT(2)
  471. #define IMR_VODOK BIT(1)
  472. #define IMR_ROK BIT(0)
  473. #define IMR_TXERR BIT(11)
  474. #define IMR_RXERR BIT(10)
  475. #define IMR_CPWM BIT(8)
  476. #define IMR_OCPINT BIT(1)
  477. #define IMR_WLANOFF BIT(0)
  478. /* 8723E series PCIE Host IMR/ISR bit */
  479. /* IMR DW0 Bit 0-31 */
  480. #define PHIMR_TIMEOUT2 BIT(31)
  481. #define PHIMR_TIMEOUT1 BIT(30)
  482. #define PHIMR_PSTIMEOUT BIT(29)
  483. #define PHIMR_GTINT4 BIT(28)
  484. #define PHIMR_GTINT3 BIT(27)
  485. #define PHIMR_TXBCNERR BIT(26)
  486. #define PHIMR_TXBCNOK BIT(25)
  487. #define PHIMR_TSF_BIT32_TOGGLE BIT(24)
  488. #define PHIMR_BCNDMAINT3 BIT(23)
  489. #define PHIMR_BCNDMAINT2 BIT(22)
  490. #define PHIMR_BCNDMAINT1 BIT(21)
  491. #define PHIMR_BCNDMAINT0 BIT(20)
  492. #define PHIMR_BCNDOK3 BIT(19)
  493. #define PHIMR_BCNDOK2 BIT(18)
  494. #define PHIMR_BCNDOK1 BIT(17)
  495. #define PHIMR_BCNDOK0 BIT(16)
  496. #define PHIMR_HSISR_IND_ON BIT(15)
  497. #define PHIMR_BCNDMAINT_E BIT(14)
  498. #define PHIMR_ATIMEND_E BIT(13)
  499. #define PHIMR_ATIM_CTW_END BIT(12)
  500. #define PHIMR_HISRE_IND BIT(11)
  501. #define PHIMR_C2HCMD BIT(10)
  502. #define PHIMR_CPWM2 BIT(9)
  503. #define PHIMR_CPWM BIT(8)
  504. #define PHIMR_HIGHDOK BIT(7)
  505. #define PHIMR_MGNTDOK BIT(6)
  506. #define PHIMR_BKDOK BIT(5)
  507. #define PHIMR_BEDOK BIT(4)
  508. #define PHIMR_VIDOK BIT(3)
  509. #define PHIMR_VODOK BIT(2)
  510. #define PHIMR_RDU BIT(1)
  511. #define PHIMR_ROK BIT(0)
  512. /* PCIE Host Interrupt Status Extension bit */
  513. #define PHIMR_BCNDMAINT7 BIT(23)
  514. #define PHIMR_BCNDMAINT6 BIT(22)
  515. #define PHIMR_BCNDMAINT5 BIT(21)
  516. #define PHIMR_BCNDMAINT4 BIT(20)
  517. #define PHIMR_BCNDOK7 BIT(19)
  518. #define PHIMR_BCNDOK6 BIT(18)
  519. #define PHIMR_BCNDOK5 BIT(17)
  520. #define PHIMR_BCNDOK4 BIT(16)
  521. /* bit12-15: RSVD */
  522. #define PHIMR_TXERR BIT(11)
  523. #define PHIMR_RXERR BIT(10)
  524. #define PHIMR_TXFOVW BIT(9)
  525. #define PHIMR_RXFOVW BIT(8)
  526. /* bit2-7: RSVD */
  527. #define PHIMR_OCPINT BIT(1)
  528. #define HWSET_MAX_SIZE 256
  529. #define EFUSE_MAX_SECTION 32
  530. #define EFUSE_REAL_CONTENT_LEN 512
  531. #define EFUSE_OOB_PROTECT_BYTES 15
  532. #define EEPROM_DEFAULT_TSSI 0x0
  533. #define EEPROM_DEFAULT_TXPOWERDIFF 0x0
  534. #define EEPROM_DEFAULT_CRYSTALCAP 0x5
  535. #define EEPROM_DEFAULT_BOARDTYPE 0x02
  536. #define EEPROM_DEFAULT_TXPOWER 0x1010
  537. #define EEPROM_DEFAULT_HT2T_TXPWR 0x10
  538. #define EEPROM_DEFAULT_LEGACYHTTXPOWERDIFF 0x3
  539. #define EEPROM_DEFAULT_THERMALMETER 0x12
  540. #define EEPROM_DEFAULT_ANTTXPOWERDIFF 0x0
  541. #define EEPROM_DEFAULT_TXPWDIFF_CRYSTALCAP 0x5
  542. #define EEPROM_DEFAULT_TXPOWERLEVEL 0x22
  543. #define EEPROM_DEFAULT_HT40_2SDIFF 0x0
  544. #define EEPROM_DEFAULT_HT20_DIFF 2
  545. #define EEPROM_DEFAULT_LEGACYHTTXPOWERDIFF 0x3
  546. #define EEPROM_DEFAULT_HT40_PWRMAXOFFSET 0
  547. #define EEPROM_DEFAULT_HT20_PWRMAXOFFSET 0
  548. #define EEPROM_DEFAULT_PID 0x1234
  549. #define EEPROM_DEFAULT_VID 0x5678
  550. #define EEPROM_DEFAULT_CUSTOMERID 0xAB
  551. #define EEPROM_DEFAULT_SUBCUSTOMERID 0xCD
  552. #define EEPROM_DEFAULT_VERSION 0
  553. #define EEPROM_CHANNEL_PLAN_FCC 0x0
  554. #define EEPROM_CHANNEL_PLAN_IC 0x1
  555. #define EEPROM_CHANNEL_PLAN_ETSI 0x2
  556. #define EEPROM_CHANNEL_PLAN_SPAIN 0x3
  557. #define EEPROM_CHANNEL_PLAN_FRANCE 0x4
  558. #define EEPROM_CHANNEL_PLAN_MKK 0x5
  559. #define EEPROM_CHANNEL_PLAN_MKK1 0x6
  560. #define EEPROM_CHANNEL_PLAN_ISRAEL 0x7
  561. #define EEPROM_CHANNEL_PLAN_TELEC 0x8
  562. #define EEPROM_CHANNEL_PLAN_GLOBAL_DOMAIN 0x9
  563. #define EEPROM_CHANNEL_PLAN_WORLD_WIDE_13 0xA
  564. #define EEPROM_CHANNEL_PLAN_NCC 0xB
  565. #define EEPROM_CHANNEL_PLAN_BY_HW_MASK 0x80
  566. #define EEPROM_CID_DEFAULT 0x0
  567. #define EEPROM_CID_TOSHIBA 0x4
  568. #define EEPROM_CID_CCX 0x10
  569. #define EEPROM_CID_QMI 0x0D
  570. #define EEPROM_CID_WHQL 0xFE
  571. #define RTL8192_EEPROM_ID 0x8129
  572. #define RTL8190_EEPROM_ID 0x8129
  573. #define EEPROM_HPON 0x02
  574. #define EEPROM_CLK 0x06
  575. #define EEPROM_TESTR 0x08
  576. #define EEPROM_VID 0x49
  577. #define EEPROM_DID 0x4B
  578. #define EEPROM_SVID 0x4D
  579. #define EEPROM_SMID 0x4F
  580. #define EEPROM_MAC_ADDR 0x67
  581. #define EEPROM_CCK_TX_PWR_INX 0x5A
  582. #define EEPROM_HT40_1S_TX_PWR_INX 0x60
  583. #define EEPROM_HT40_2S_TX_PWR_INX_DIFF 0x66
  584. #define EEPROM_HT20_TX_PWR_INX_DIFF 0x69
  585. #define EEPROM_OFDM_TX_PWR_INX_DIFF 0x6C
  586. #define EEPROM_HT40_MAX_PWR_OFFSET 0x25
  587. #define EEPROM_HT20_MAX_PWR_OFFSET 0x22
  588. #define EEPROM_THERMAL_METER 0x2a
  589. #define EEPROM_XTAL_K 0x78
  590. #define EEPROM_RF_OPT1 0x79
  591. #define EEPROM_RF_OPT2 0x7A
  592. #define EEPROM_RF_OPT3 0x7B
  593. #define EEPROM_RF_OPT4 0x7C
  594. #define EEPROM_CHANNEL_PLAN 0x28
  595. #define EEPROM_VERSION 0x30
  596. #define EEPROM_CUSTOMER_ID 0x31
  597. #define EEPROM_PWRDIFF 0x54
  598. #define EEPROM_TXPOWERCCK 0x10
  599. #define EEPROM_TXPOWERHT40_1S 0x16
  600. #define EEPROM_TXPOWERHT40_2SDIFF 0x66
  601. #define EEPROM_TXPOWERHT20DIFF 0x1C
  602. #define EEPROM_TXPOWER_OFDMDIFF 0x1F
  603. #define EEPROM_TXPWR_GROUP 0x22
  604. #define EEPROM_TSSI_A 0x29
  605. #define EEPROM_TSSI_B 0x77
  606. #define EEPROM_CHANNELPLAN 0x28
  607. #define RF_OPTION1 0x2B
  608. #define RF_OPTION2 0x2C
  609. #define RF_OPTION3 0x2D
  610. #define RF_OPTION4 0x2E
  611. #define STOPBECON BIT(6)
  612. #define STOPHIGHT BIT(5)
  613. #define STOPMGT BIT(4)
  614. #define STOPVO BIT(3)
  615. #define STOPVI BIT(2)
  616. #define STOPBE BIT(1)
  617. #define STOPBK BIT(0)
  618. #define RCR_APPFCS BIT(31)
  619. #define RCR_APP_MIC BIT(30)
  620. #define RCR_APP_ICV BIT(29)
  621. #define RCR_APP_PHYST_RXFF BIT(28)
  622. #define RCR_APP_BA_SSN BIT(27)
  623. #define RCR_ENMBID BIT(24)
  624. #define RCR_LSIGEN BIT(23)
  625. #define RCR_MFBEN BIT(22)
  626. #define RCR_HTC_LOC_CTRL BIT(14)
  627. #define RCR_AMF BIT(13)
  628. #define RCR_ACF BIT(12)
  629. #define RCR_ADF BIT(11)
  630. #define RCR_AICV BIT(9)
  631. #define RCR_ACRC32 BIT(8)
  632. #define RCR_CBSSID_BCN BIT(7)
  633. #define RCR_CBSSID_DATA BIT(6)
  634. #define RCR_CBSSID RCR_CBSSID_DATA
  635. #define RCR_APWRMGT BIT(5)
  636. #define RCR_ADD3 BIT(4)
  637. #define RCR_AB BIT(3)
  638. #define RCR_AM BIT(2)
  639. #define RCR_APM BIT(1)
  640. #define RCR_AAP BIT(0)
  641. #define RCR_MXDMA_OFFSET 8
  642. #define RCR_FIFO_OFFSET 13
  643. #define RSV_CTRL 0x001C
  644. #define RD_CTRL 0x0524
  645. #define REG_USB_INFO 0xFE17
  646. #define REG_USB_SPECIAL_OPTION 0xFE55
  647. #define REG_USB_DMA_AGG_TO 0xFE5B
  648. #define REG_USB_AGG_TO 0xFE5C
  649. #define REG_USB_AGG_TH 0xFE5D
  650. #define REG_USB_VID 0xFE60
  651. #define REG_USB_PID 0xFE62
  652. #define REG_USB_OPTIONAL 0xFE64
  653. #define REG_USB_CHIRP_K 0xFE65
  654. #define REG_USB_PHY 0xFE66
  655. #define REG_USB_MAC_ADDR 0xFE70
  656. #define REG_USB_HRPWM 0xFE58
  657. #define REG_USB_HCPWM 0xFE57
  658. #define SW18_FPWM BIT(3)
  659. #define ISO_MD2PP BIT(0)
  660. #define ISO_UA2USB BIT(1)
  661. #define ISO_UD2CORE BIT(2)
  662. #define ISO_PA2PCIE BIT(3)
  663. #define ISO_PD2CORE BIT(4)
  664. #define ISO_IP2MAC BIT(5)
  665. #define ISO_DIOP BIT(6)
  666. #define ISO_DIOE BIT(7)
  667. #define ISO_EB2CORE BIT(8)
  668. #define ISO_DIOR BIT(9)
  669. #define PWC_EV25V BIT(14)
  670. #define PWC_EV12V BIT(15)
  671. #define FEN_BBRSTB BIT(0)
  672. #define FEN_BB_GLB_RSTN BIT(1)
  673. #define FEN_USBA BIT(2)
  674. #define FEN_UPLL BIT(3)
  675. #define FEN_USBD BIT(4)
  676. #define FEN_DIO_PCIE BIT(5)
  677. #define FEN_PCIEA BIT(6)
  678. #define FEN_PPLL BIT(7)
  679. #define FEN_PCIED BIT(8)
  680. #define FEN_DIOE BIT(9)
  681. #define FEN_CPUEN BIT(10)
  682. #define FEN_DCORE BIT(11)
  683. #define FEN_ELDR BIT(12)
  684. #define FEN_DIO_RF BIT(13)
  685. #define FEN_HWPDN BIT(14)
  686. #define FEN_MREGEN BIT(15)
  687. #define PFM_LDALL BIT(0)
  688. #define PFM_ALDN BIT(1)
  689. #define PFM_LDKP BIT(2)
  690. #define PFM_WOWL BIT(3)
  691. #define ENPDN BIT(4)
  692. #define PDN_PL BIT(5)
  693. #define APFM_ONMAC BIT(8)
  694. #define APFM_OFF BIT(9)
  695. #define APFM_RSM BIT(10)
  696. #define AFSM_HSUS BIT(11)
  697. #define AFSM_PCIE BIT(12)
  698. #define APDM_MAC BIT(13)
  699. #define APDM_HOST BIT(14)
  700. #define APDM_HPDN BIT(15)
  701. #define RDY_MACON BIT(16)
  702. #define SUS_HOST BIT(17)
  703. #define ROP_ALD BIT(20)
  704. #define ROP_PWR BIT(21)
  705. #define ROP_SPS BIT(22)
  706. #define SOP_MRST BIT(25)
  707. #define SOP_FUSE BIT(26)
  708. #define SOP_ABG BIT(27)
  709. #define SOP_AMB BIT(28)
  710. #define SOP_RCK BIT(29)
  711. #define SOP_A8M BIT(30)
  712. #define XOP_BTCK BIT(31)
  713. #define ANAD16V_EN BIT(0)
  714. #define ANA8M BIT(1)
  715. #define MACSLP BIT(4)
  716. #define LOADER_CLK_EN BIT(5)
  717. #define _80M_SSC_DIS BIT(7)
  718. #define _80M_SSC_EN_HO BIT(8)
  719. #define PHY_SSC_RSTB BIT(9)
  720. #define SEC_CLK_EN BIT(10)
  721. #define MAC_CLK_EN BIT(11)
  722. #define SYS_CLK_EN BIT(12)
  723. #define RING_CLK_EN BIT(13)
  724. #define BOOT_FROM_EEPROM BIT(4)
  725. #define EEPROM_EN BIT(5)
  726. #define AFE_BGEN BIT(0)
  727. #define AFE_MBEN BIT(1)
  728. #define MAC_ID_EN BIT(7)
  729. #define WLOCK_ALL BIT(0)
  730. #define WLOCK_00 BIT(1)
  731. #define WLOCK_04 BIT(2)
  732. #define WLOCK_08 BIT(3)
  733. #define WLOCK_40 BIT(4)
  734. #define R_DIS_PRST_0 BIT(5)
  735. #define R_DIS_PRST_1 BIT(6)
  736. #define LOCK_ALL_EN BIT(7)
  737. #define RF_EN BIT(0)
  738. #define RF_RSTB BIT(1)
  739. #define RF_SDMRSTB BIT(2)
  740. #define LDA15_EN BIT(0)
  741. #define LDA15_STBY BIT(1)
  742. #define LDA15_OBUF BIT(2)
  743. #define LDA15_REG_VOS BIT(3)
  744. #define _LDA15_VOADJ(x) (((x) & 0x7) << 4)
  745. #define LDV12_EN BIT(0)
  746. #define LDV12_SDBY BIT(1)
  747. #define LPLDO_HSM BIT(2)
  748. #define LPLDO_LSM_DIS BIT(3)
  749. #define _LDV12_VADJ(x) (((x) & 0xF) << 4)
  750. #define XTAL_EN BIT(0)
  751. #define XTAL_BSEL BIT(1)
  752. #define _XTAL_BOSC(x) (((x) & 0x3) << 2)
  753. #define _XTAL_CADJ(x) (((x) & 0xF) << 4)
  754. #define XTAL_GATE_USB BIT(8)
  755. #define _XTAL_USB_DRV(x) (((x) & 0x3) << 9)
  756. #define XTAL_GATE_AFE BIT(11)
  757. #define _XTAL_AFE_DRV(x) (((x) & 0x3) << 12)
  758. #define XTAL_RF_GATE BIT(14)
  759. #define _XTAL_RF_DRV(x) (((x) & 0x3) << 15)
  760. #define XTAL_GATE_DIG BIT(17)
  761. #define _XTAL_DIG_DRV(x) (((x) & 0x3) << 18)
  762. #define XTAL_BT_GATE BIT(20)
  763. #define _XTAL_BT_DRV(x) (((x) & 0x3) << 21)
  764. #define _XTAL_GPIO(x) (((x) & 0x7) << 23)
  765. #define CKDLY_AFE BIT(26)
  766. #define CKDLY_USB BIT(27)
  767. #define CKDLY_DIG BIT(28)
  768. #define CKDLY_BT BIT(29)
  769. #define APLL_EN BIT(0)
  770. #define APLL_320_EN BIT(1)
  771. #define APLL_FREF_SEL BIT(2)
  772. #define APLL_EDGE_SEL BIT(3)
  773. #define APLL_WDOGB BIT(4)
  774. #define APLL_LPFEN BIT(5)
  775. #define APLL_REF_CLK_13MHZ 0x1
  776. #define APLL_REF_CLK_19_2MHZ 0x2
  777. #define APLL_REF_CLK_20MHZ 0x3
  778. #define APLL_REF_CLK_25MHZ 0x4
  779. #define APLL_REF_CLK_26MHZ 0x5
  780. #define APLL_REF_CLK_38_4MHZ 0x6
  781. #define APLL_REF_CLK_40MHZ 0x7
  782. #define APLL_320EN BIT(14)
  783. #define APLL_80EN BIT(15)
  784. #define APLL_1MEN BIT(24)
  785. #define ALD_EN BIT(18)
  786. #define EF_PD BIT(19)
  787. #define EF_FLAG BIT(31)
  788. #define EF_TRPT BIT(7)
  789. #define LDOE25_EN BIT(31)
  790. #define RSM_EN BIT(0)
  791. #define TIMER_EN BIT(4)
  792. #define TRSW0EN BIT(2)
  793. #define TRSW1EN BIT(3)
  794. #define EROM_EN BIT(4)
  795. #define ENBT BIT(5)
  796. #define ENUART BIT(8)
  797. #define UART_910 BIT(9)
  798. #define ENPMAC BIT(10)
  799. #define SIC_SWRST BIT(11)
  800. #define ENSIC BIT(12)
  801. #define SIC_23 BIT(13)
  802. #define ENHDP BIT(14)
  803. #define SIC_LBK BIT(15)
  804. #define LED0PL BIT(4)
  805. #define LED1PL BIT(12)
  806. #define LED0DIS BIT(7)
  807. #define MCUFWDL_EN BIT(0)
  808. #define MCUFWDL_RDY BIT(1)
  809. #define FWDL_CHKSUM_RPT BIT(2)
  810. #define MACINI_RDY BIT(3)
  811. #define BBINI_RDY BIT(4)
  812. #define RFINI_RDY BIT(5)
  813. #define WINTINI_RDY BIT(6)
  814. #define CPRST BIT(23)
  815. #define XCLK_VLD BIT(0)
  816. #define ACLK_VLD BIT(1)
  817. #define UCLK_VLD BIT(2)
  818. #define PCLK_VLD BIT(3)
  819. #define PCIRSTB BIT(4)
  820. #define V15_VLD BIT(5)
  821. #define TRP_B15V_EN BIT(7)
  822. #define SIC_IDLE BIT(8)
  823. #define BD_MAC2 BIT(9)
  824. #define BD_MAC1 BIT(10)
  825. #define IC_MACPHY_MODE BIT(11)
  826. #define BT_FUNC BIT(16)
  827. #define VENDOR_ID BIT(19)
  828. #define PAD_HWPD_IDN BIT(22)
  829. #define TRP_VAUX_EN BIT(23)
  830. #define TRP_BT_EN BIT(24)
  831. #define BD_PKG_SEL BIT(25)
  832. #define BD_HCI_SEL BIT(26)
  833. #define TYPE_ID BIT(27)
  834. #define CHIP_VER_RTL_MASK 0xF000
  835. #define CHIP_VER_RTL_SHIFT 12
  836. #define REG_LBMODE (REG_CR + 3)
  837. #define HCI_TXDMA_EN BIT(0)
  838. #define HCI_RXDMA_EN BIT(1)
  839. #define TXDMA_EN BIT(2)
  840. #define RXDMA_EN BIT(3)
  841. #define PROTOCOL_EN BIT(4)
  842. #define SCHEDULE_EN BIT(5)
  843. #define MACTXEN BIT(6)
  844. #define MACRXEN BIT(7)
  845. #define ENSWBCN BIT(8)
  846. #define ENSEC BIT(9)
  847. #define _NETTYPE(x) (((x) & 0x3) << 16)
  848. #define MASK_NETTYPE 0x30000
  849. #define NT_NO_LINK 0x0
  850. #define NT_LINK_AD_HOC 0x1
  851. #define NT_LINK_AP 0x2
  852. #define NT_AS_AP 0x3
  853. #define _LBMODE(x) (((x) & 0xF) << 24)
  854. #define MASK_LBMODE 0xF000000
  855. #define LOOPBACK_NORMAL 0x0
  856. #define LOOPBACK_IMMEDIATELY 0xB
  857. #define LOOPBACK_MAC_DELAY 0x3
  858. #define LOOPBACK_PHY 0x1
  859. #define LOOPBACK_DMA 0x7
  860. #define GET_RX_PAGE_SIZE(value) ((value) & 0xF)
  861. #define GET_TX_PAGE_SIZE(value) (((value) & 0xF0) >> 4)
  862. #define _PSRX_MASK 0xF
  863. #define _PSTX_MASK 0xF0
  864. #define _PSRX(x) (x)
  865. #define _PSTX(x) ((x) << 4)
  866. #define PBP_64 0x0
  867. #define PBP_128 0x1
  868. #define PBP_256 0x2
  869. #define PBP_512 0x3
  870. #define PBP_1024 0x4
  871. #define RXDMA_ARBBW_EN BIT(0)
  872. #define RXSHFT_EN BIT(1)
  873. #define RXDMA_AGG_EN BIT(2)
  874. #define QS_VO_QUEUE BIT(8)
  875. #define QS_VI_QUEUE BIT(9)
  876. #define QS_BE_QUEUE BIT(10)
  877. #define QS_BK_QUEUE BIT(11)
  878. #define QS_MANAGER_QUEUE BIT(12)
  879. #define QS_HIGH_QUEUE BIT(13)
  880. #define HQSEL_VOQ BIT(0)
  881. #define HQSEL_VIQ BIT(1)
  882. #define HQSEL_BEQ BIT(2)
  883. #define HQSEL_BKQ BIT(3)
  884. #define HQSEL_MGTQ BIT(4)
  885. #define HQSEL_HIQ BIT(5)
  886. #define _TXDMA_HIQ_MAP(x) (((x)&0x3) << 14)
  887. #define _TXDMA_MGQ_MAP(x) (((x)&0x3) << 12)
  888. #define _TXDMA_BKQ_MAP(x) (((x)&0x3) << 10)
  889. #define _TXDMA_BEQ_MAP(x) (((x)&0x3) << 8)
  890. #define _TXDMA_VIQ_MAP(x) (((x)&0x3) << 6)
  891. #define _TXDMA_VOQ_MAP(x) (((x)&0x3) << 4)
  892. #define QUEUE_LOW 1
  893. #define QUEUE_NORMAL 2
  894. #define QUEUE_HIGH 3
  895. #define _LLT_NO_ACTIVE 0x0
  896. #define _LLT_WRITE_ACCESS 0x1
  897. #define _LLT_READ_ACCESS 0x2
  898. #define _LLT_INIT_DATA(x) ((x) & 0xFF)
  899. #define _LLT_INIT_ADDR(x) (((x) & 0xFF) << 8)
  900. #define _LLT_OP(x) (((x) & 0x3) << 30)
  901. #define _LLT_OP_VALUE(x) (((x) >> 30) & 0x3)
  902. #define BB_WRITE_READ_MASK (BIT(31) | BIT(30))
  903. #define BB_WRITE_EN BIT(30)
  904. #define BB_READ_EN BIT(31)
  905. #define _HPQ(x) ((x) & 0xFF)
  906. #define _LPQ(x) (((x) & 0xFF) << 8)
  907. #define _PUBQ(x) (((x) & 0xFF) << 16)
  908. #define _NPQ(x) ((x) & 0xFF)
  909. #define HPQ_PUBLIC_DIS BIT(24)
  910. #define LPQ_PUBLIC_DIS BIT(25)
  911. #define LD_RQPN BIT(31)
  912. #define BCN_VALID BIT(16)
  913. #define BCN_HEAD(x) (((x) & 0xFF) << 8)
  914. #define BCN_HEAD_MASK 0xFF00
  915. #define BLK_DESC_NUM_SHIFT 4
  916. #define BLK_DESC_NUM_MASK 0xF
  917. #define DROP_DATA_EN BIT(9)
  918. #define EN_AMPDU_RTY_NEW BIT(7)
  919. #define _INIRTSMCS_SEL(x) ((x) & 0x3F)
  920. #define _SPEC_SIFS_CCK(x) ((x) & 0xFF)
  921. #define _SPEC_SIFS_OFDM(x) (((x) & 0xFF) << 8)
  922. #define RATE_REG_BITMAP_ALL 0xFFFFF
  923. #define _RRSC_BITMAP(x) ((x) & 0xFFFFF)
  924. #define _RRSR_RSC(x) (((x) & 0x3) << 21)
  925. #define RRSR_RSC_RESERVED 0x0
  926. #define RRSR_RSC_UPPER_SUBCHANNEL 0x1
  927. #define RRSR_RSC_LOWER_SUBCHANNEL 0x2
  928. #define RRSR_RSC_DUPLICATE_MODE 0x3
  929. #define USE_SHORT_G1 BIT(20)
  930. #define _AGGLMT_MCS0(x) ((x) & 0xF)
  931. #define _AGGLMT_MCS1(x) (((x) & 0xF) << 4)
  932. #define _AGGLMT_MCS2(x) (((x) & 0xF) << 8)
  933. #define _AGGLMT_MCS3(x) (((x) & 0xF) << 12)
  934. #define _AGGLMT_MCS4(x) (((x) & 0xF) << 16)
  935. #define _AGGLMT_MCS5(x) (((x) & 0xF) << 20)
  936. #define _AGGLMT_MCS6(x) (((x) & 0xF) << 24)
  937. #define _AGGLMT_MCS7(x) (((x) & 0xF) << 28)
  938. #define RETRY_LIMIT_SHORT_SHIFT 8
  939. #define RETRY_LIMIT_LONG_SHIFT 0
  940. #define _DARF_RC1(x) ((x) & 0x1F)
  941. #define _DARF_RC2(x) (((x) & 0x1F) << 8)
  942. #define _DARF_RC3(x) (((x) & 0x1F) << 16)
  943. #define _DARF_RC4(x) (((x) & 0x1F) << 24)
  944. #define _DARF_RC5(x) ((x) & 0x1F)
  945. #define _DARF_RC6(x) (((x) & 0x1F) << 8)
  946. #define _DARF_RC7(x) (((x) & 0x1F) << 16)
  947. #define _DARF_RC8(x) (((x) & 0x1F) << 24)
  948. #define _RARF_RC1(x) ((x) & 0x1F)
  949. #define _RARF_RC2(x) (((x) & 0x1F) << 8)
  950. #define _RARF_RC3(x) (((x) & 0x1F) << 16)
  951. #define _RARF_RC4(x) (((x) & 0x1F) << 24)
  952. #define _RARF_RC5(x) ((x) & 0x1F)
  953. #define _RARF_RC6(x) (((x) & 0x1F) << 8)
  954. #define _RARF_RC7(x) (((x) & 0x1F) << 16)
  955. #define _RARF_RC8(x) (((x) & 0x1F) << 24)
  956. #define AC_PARAM_TXOP_LIMIT_OFFSET 16
  957. #define AC_PARAM_ECW_MAX_OFFSET 12
  958. #define AC_PARAM_ECW_MIN_OFFSET 8
  959. #define AC_PARAM_AIFS_OFFSET 0
  960. #define _AIFS(x) (x)
  961. #define _ECW_MAX_MIN(x) ((x) << 8)
  962. #define _TXOP_LIMIT(x) ((x) << 16)
  963. #define _BCNIFS(x) ((x) & 0xFF)
  964. #define _BCNECW(x) ((((x) & 0xF)) << 8)
  965. #define _LRL(x) ((x) & 0x3F)
  966. #define _SRL(x) (((x) & 0x3F) << 8)
  967. #define _SIFS_CCK_CTX(x) ((x) & 0xFF)
  968. #define _SIFS_CCK_TRX(x) (((x) & 0xFF) << 8)
  969. #define _SIFS_OFDM_CTX(x) ((x) & 0xFF)
  970. #define _SIFS_OFDM_TRX(x) (((x) & 0xFF) << 8)
  971. #define _TBTT_PROHIBIT_HOLD(x) (((x) & 0xFF) << 8)
  972. #define DIS_EDCA_CNT_DWN BIT(11)
  973. #define EN_MBSSID BIT(1)
  974. #define EN_TXBCN_RPT BIT(2)
  975. #define EN_BCN_FUNCTION BIT(3)
  976. #define TSFTR_RST BIT(0)
  977. #define TSFTR1_RST BIT(1)
  978. #define STOP_BCNQ BIT(6)
  979. #define DIS_TSF_UDT0_NORMAL_CHIP BIT(4)
  980. #define DIS_TSF_UDT0_TEST_CHIP BIT(5)
  981. #define ACMHW_HWEN BIT(0)
  982. #define ACMHW_BEQEN BIT(1)
  983. #define ACMHW_VIQEN BIT(2)
  984. #define ACMHW_VOQEN BIT(3)
  985. #define ACMHW_BEQSTATUS BIT(4)
  986. #define ACMHW_VIQSTATUS BIT(5)
  987. #define ACMHW_VOQSTATUS BIT(6)
  988. #define APSDOFF BIT(6)
  989. #define APSDOFF_STATUS BIT(7)
  990. #define BW_20MHZ BIT(2)
  991. #define RATE_BITMAP_ALL 0xFFFFF
  992. #define RATE_RRSR_CCK_ONLY_1M 0xFFFF1
  993. #define TSFRST BIT(0)
  994. #define DIS_GCLK BIT(1)
  995. #define PAD_SEL BIT(2)
  996. #define PWR_ST BIT(6)
  997. #define PWRBIT_OW_EN BIT(7)
  998. #define ACRC BIT(8)
  999. #define CFENDFORM BIT(9)
  1000. #define ICV BIT(10)
  1001. #define AAP BIT(0)
  1002. #define APM BIT(1)
  1003. #define AM BIT(2)
  1004. #define AB BIT(3)
  1005. #define ADD3 BIT(4)
  1006. #define APWRMGT BIT(5)
  1007. #define CBSSID BIT(6)
  1008. #define CBSSID_DATA BIT(6)
  1009. #define CBSSID_BCN BIT(7)
  1010. #define ACRC32 BIT(8)
  1011. #define AICV BIT(9)
  1012. #define ADF BIT(11)
  1013. #define ACF BIT(12)
  1014. #define AMF BIT(13)
  1015. #define HTC_LOC_CTRL BIT(14)
  1016. #define UC_DATA_EN BIT(16)
  1017. #define BM_DATA_EN BIT(17)
  1018. #define MFBEN BIT(22)
  1019. #define LSIGEN BIT(23)
  1020. #define ENMBID BIT(24)
  1021. #define APP_BASSN BIT(27)
  1022. #define APP_PHYSTS BIT(28)
  1023. #define APP_ICV BIT(29)
  1024. #define APP_MIC BIT(30)
  1025. #define APP_FCS BIT(31)
  1026. #define _MIN_SPACE(x) ((x) & 0x7)
  1027. #define _SHORT_GI_PADDING(x) (((x) & 0x1F) << 3)
  1028. #define RXERR_TYPE_OFDM_PPDU 0
  1029. #define RXERR_TYPE_OFDM_FALSE_ALARM 1
  1030. #define RXERR_TYPE_OFDM_MPDU_OK 2
  1031. #define RXERR_TYPE_OFDM_MPDU_FAIL 3
  1032. #define RXERR_TYPE_CCK_PPDU 4
  1033. #define RXERR_TYPE_CCK_FALSE_ALARM 5
  1034. #define RXERR_TYPE_CCK_MPDU_OK 6
  1035. #define RXERR_TYPE_CCK_MPDU_FAIL 7
  1036. #define RXERR_TYPE_HT_PPDU 8
  1037. #define RXERR_TYPE_HT_FALSE_ALARM 9
  1038. #define RXERR_TYPE_HT_MPDU_TOTAL 10
  1039. #define RXERR_TYPE_HT_MPDU_OK 11
  1040. #define RXERR_TYPE_HT_MPDU_FAIL 12
  1041. #define RXERR_TYPE_RX_FULL_DROP 15
  1042. #define RXERR_COUNTER_MASK 0xFFFFF
  1043. #define RXERR_RPT_RST BIT(27)
  1044. #define _RXERR_RPT_SEL(type) ((type) << 28)
  1045. #define SCR_TXUSEDK BIT(0)
  1046. #define SCR_RXUSEDK BIT(1)
  1047. #define SCR_TXENCENABLE BIT(2)
  1048. #define SCR_RXDECENABLE BIT(3)
  1049. #define SCR_SKBYA2 BIT(4)
  1050. #define SCR_NOSKMC BIT(5)
  1051. #define SCR_TXBCUSEDK BIT(6)
  1052. #define SCR_RXBCUSEDK BIT(7)
  1053. #define USB_IS_HIGH_SPEED 0
  1054. #define USB_IS_FULL_SPEED 1
  1055. #define USB_SPEED_MASK BIT(5)
  1056. #define USB_NORMAL_SIE_EP_MASK 0xF
  1057. #define USB_NORMAL_SIE_EP_SHIFT 4
  1058. #define USB_TEST_EP_MASK 0x30
  1059. #define USB_TEST_EP_SHIFT 4
  1060. #define USB_AGG_EN BIT(3)
  1061. #define MAC_ADDR_LEN 6
  1062. #define LAST_ENTRY_OF_TX_PKT_BUFFER 255
  1063. #define POLLING_LLT_THRESHOLD 20
  1064. #define POLLING_READY_TIMEOUT_COUNT 1000
  1065. #define MAX_MSS_DENSITY_2T 0x13
  1066. #define MAX_MSS_DENSITY_1T 0x0A
  1067. #define EPROM_CMD_OPERATING_MODE_MASK ((1<<7)|(1<<6))
  1068. #define EPROM_CMD_CONFIG 0x3
  1069. #define EPROM_CMD_LOAD 1
  1070. #define HWSET_MAX_SIZE_92S HWSET_MAX_SIZE
  1071. #define HAL_8192C_HW_GPIO_WPS_BIT BIT(2)
  1072. #define RPMAC_RESET 0x100
  1073. #define RPMAC_TXSTART 0x104
  1074. #define RPMAC_TXLEGACYSIG 0x108
  1075. #define RPMAC_TXHTSIG1 0x10c
  1076. #define RPMAC_TXHTSIG2 0x110
  1077. #define RPMAC_PHYDEBUG 0x114
  1078. #define RPMAC_TXPACKETNUM 0x118
  1079. #define RPMAC_TXIDLE 0x11c
  1080. #define RPMAC_TXMACHEADER0 0x120
  1081. #define RPMAC_TXMACHEADER1 0x124
  1082. #define RPMAC_TXMACHEADER2 0x128
  1083. #define RPMAC_TXMACHEADER3 0x12c
  1084. #define RPMAC_TXMACHEADER4 0x130
  1085. #define RPMAC_TXMACHEADER5 0x134
  1086. #define RPMAC_TXDADATYPE 0x138
  1087. #define RPMAC_TXRANDOMSEED 0x13c
  1088. #define RPMAC_CCKPLCPPREAMBLE 0x140
  1089. #define RPMAC_CCKPLCPHEADER 0x144
  1090. #define RPMAC_CCKCRC16 0x148
  1091. #define RPMAC_OFDMRXCRC32OK 0x170
  1092. #define RPMAC_OFDMRXCRC32ER 0x174
  1093. #define RPMAC_OFDMRXPARITYER 0x178
  1094. #define RPMAC_OFDMRXCRC8ER 0x17c
  1095. #define RPMAC_CCKCRXRC16ER 0x180
  1096. #define RPMAC_CCKCRXRC32ER 0x184
  1097. #define RPMAC_CCKCRXRC32OK 0x188
  1098. #define RPMAC_TXSTATUS 0x18c
  1099. #define RFPGA0_RFMOD 0x800
  1100. #define RFPGA0_TXINFO 0x804
  1101. #define RFPGA0_PSDFUNCTION 0x808
  1102. #define RFPGA0_TXGAINSTAGE 0x80c
  1103. #define RFPGA0_RFTIMING1 0x810
  1104. #define RFPGA0_RFTIMING2 0x814
  1105. #define RFPGA0_XA_HSSIPARAMETER1 0x820
  1106. #define RFPGA0_XA_HSSIPARAMETER2 0x824
  1107. #define RFPGA0_XB_HSSIPARAMETER1 0x828
  1108. #define RFPGA0_XB_HSSIPARAMETER2 0x82c
  1109. #define RFPGA0_XA_LSSIPARAMETER 0x840
  1110. #define RFPGA0_XB_LSSIPARAMETER 0x844
  1111. #define RFPGA0_RFWAKEUPPARAMETER 0x850
  1112. #define RFPGA0_RFSLEEPUPPARAMETER 0x854
  1113. #define RFPGA0_XAB_SWITCHCONTROL 0x858
  1114. #define RFPGA0_XCD_SWITCHCONTROL 0x85c
  1115. #define RFPGA0_XA_RFINTERFACEOE 0x860
  1116. #define RFPGA0_XB_RFINTERFACEOE 0x864
  1117. #define RFPGA0_XAB_RFINTERFACESW 0x870
  1118. #define RFPGA0_XCD_RFINTERFACESW 0x874
  1119. #define RFPGA0_XAB_RFPARAMETER 0x878
  1120. #define RFPGA0_XCD_RFPARAMETER 0x87c
  1121. #define RFPGA0_ANALOGPARAMETER1 0x880
  1122. #define RFPGA0_ANALOGPARAMETER2 0x884
  1123. #define RFPGA0_ANALOGPARAMETER3 0x888
  1124. #define RFPGA0_ANALOGPARAMETER4 0x88c
  1125. #define RFPGA0_XA_LSSIREADBACK 0x8a0
  1126. #define RFPGA0_XB_LSSIREADBACK 0x8a4
  1127. #define RFPGA0_XC_LSSIREADBACK 0x8a8
  1128. #define RFPGA0_XD_LSSIREADBACK 0x8ac
  1129. #define RFPGA0_PSDREPORT 0x8b4
  1130. #define TRANSCEIVEA_HSPI_READBACK 0x8b8
  1131. #define TRANSCEIVEB_HSPI_READBACK 0x8bc
  1132. #define RFPGA0_XAB_RFINTERFACERB 0x8e0
  1133. #define RFPGA0_XCD_RFINTERFACERB 0x8e4
  1134. #define RFPGA1_RFMOD 0x900
  1135. #define RFPGA1_TXBLOCK 0x904
  1136. #define RFPGA1_DEBUGSELECT 0x908
  1137. #define RFPGA1_TXINFO 0x90c
  1138. #define RCCK0_SYSTEM 0xa00
  1139. #define RCCK0_AFESETTING 0xa04
  1140. #define RCCK0_CCA 0xa08
  1141. #define RCCK0_RXAGC1 0xa0c
  1142. #define RCCK0_RXAGC2 0xa10
  1143. #define RCCK0_RXHP 0xa14
  1144. #define RCCK0_DSPPARAMETER1 0xa18
  1145. #define RCCK0_DSPPARAMETER2 0xa1c
  1146. #define RCCK0_TXFILTER1 0xa20
  1147. #define RCCK0_TXFILTER2 0xa24
  1148. #define RCCK0_DEBUGPORT 0xa28
  1149. #define RCCK0_FALSEALARMREPORT 0xa2c
  1150. #define RCCK0_TRSSIREPORT 0xa50
  1151. #define RCCK0_RXREPORT 0xa54
  1152. #define RCCK0_FACOUNTERLOWER 0xa5c
  1153. #define RCCK0_FACOUNTERUPPER 0xa58
  1154. #define ROFDM0_LSTF 0xc00
  1155. #define ROFDM0_TRXPATHENABLE 0xc04
  1156. #define ROFDM0_TRMUXPAR 0xc08
  1157. #define ROFDM0_TRSWISOLATION 0xc0c
  1158. #define ROFDM0_XARXAFE 0xc10
  1159. #define ROFDM0_XARXIQIMBALANCE 0xc14
  1160. #define ROFDM0_XBRXAFE 0xc18
  1161. #define ROFDM0_XBRXIQIMBALANCE 0xc1c
  1162. #define ROFDM0_XCRXAFE 0xc20
  1163. #define ROFDM0_XCRXIQIMBANLANCE 0xc24
  1164. #define ROFDM0_XDRXAFE 0xc28
  1165. #define ROFDM0_XDRXIQIMBALANCE 0xc2c
  1166. #define ROFDM0_RXDETECTOR1 0xc30
  1167. #define ROFDM0_RXDETECTOR2 0xc34
  1168. #define ROFDM0_RXDETECTOR3 0xc38
  1169. #define ROFDM0_RXDETECTOR4 0xc3c
  1170. #define ROFDM0_RXDSP 0xc40
  1171. #define ROFDM0_CFOANDDAGC 0xc44
  1172. #define ROFDM0_CCADROPTHRESHOLD 0xc48
  1173. #define ROFDM0_ECCATHRESHOLD 0xc4c
  1174. #define ROFDM0_XAAGCCORE1 0xc50
  1175. #define ROFDM0_XAAGCCORE2 0xc54
  1176. #define ROFDM0_XBAGCCORE1 0xc58
  1177. #define ROFDM0_XBAGCCORE2 0xc5c
  1178. #define ROFDM0_XCAGCCORE1 0xc60
  1179. #define ROFDM0_XCAGCCORE2 0xc64
  1180. #define ROFDM0_XDAGCCORE1 0xc68
  1181. #define ROFDM0_XDAGCCORE2 0xc6c
  1182. #define ROFDM0_AGCPARAMETER1 0xc70
  1183. #define ROFDM0_AGCPARAMETER2 0xc74
  1184. #define ROFDM0_AGCRSSITABLE 0xc78
  1185. #define ROFDM0_HTSTFAGC 0xc7c
  1186. #define ROFDM0_XATXIQIMBALANCE 0xc80
  1187. #define ROFDM0_XATXAFE 0xc84
  1188. #define ROFDM0_XBTXIQIMBALANCE 0xc88
  1189. #define ROFDM0_XBTXAFE 0xc8c
  1190. #define ROFDM0_XCTXIQIMBALANCE 0xc90
  1191. #define ROFDM0_XCTXAFE 0xc94
  1192. #define ROFDM0_XDTXIQIMBALANCE 0xc98
  1193. #define ROFDM0_XDTXAFE 0xc9c
  1194. #define ROFDM0_RXIQEXTANTA 0xca0
  1195. #define ROFDM0_RXHPPARAMETER 0xce0
  1196. #define ROFDM0_TXPSEUDONOISEWGT 0xce4
  1197. #define ROFDM0_FRAMESYNC 0xcf0
  1198. #define ROFDM0_DFSREPORT 0xcf4
  1199. #define ROFDM0_TXCOEFF1 0xca4
  1200. #define ROFDM0_TXCOEFF2 0xca8
  1201. #define ROFDM0_TXCOEFF3 0xcac
  1202. #define ROFDM0_TXCOEFF4 0xcb0
  1203. #define ROFDM0_TXCOEFF5 0xcb4
  1204. #define ROFDM0_TXCOEFF6 0xcb8
  1205. #define ROFDM1_LSTF 0xd00
  1206. #define ROFDM1_TRXPATHENABLE 0xd04
  1207. #define ROFDM1_CF0 0xd08
  1208. #define ROFDM1_CSI1 0xd10
  1209. #define ROFDM1_SBD 0xd14
  1210. #define ROFDM1_CSI2 0xd18
  1211. #define ROFDM1_CFOTRACKING 0xd2c
  1212. #define ROFDM1_TRXMESAURE1 0xd34
  1213. #define ROFDM1_INTFDET 0xd3c
  1214. #define ROFDM1_PSEUDONOISESTATEAB 0xd50
  1215. #define ROFDM1_PSEUDONOISESTATECD 0xd54
  1216. #define ROFDM1_RXPSEUDONOISEWGT 0xd58
  1217. #define ROFDM_PHYCOUNTER1 0xda0
  1218. #define ROFDM_PHYCOUNTER2 0xda4
  1219. #define ROFDM_PHYCOUNTER3 0xda8
  1220. #define ROFDM_SHORTCFOAB 0xdac
  1221. #define ROFDM_SHORTCFOCD 0xdb0
  1222. #define ROFDM_LONGCFOAB 0xdb4
  1223. #define ROFDM_LONGCFOCD 0xdb8
  1224. #define ROFDM_TAILCF0AB 0xdbc
  1225. #define ROFDM_TAILCF0CD 0xdc0
  1226. #define ROFDM_PWMEASURE1 0xdc4
  1227. #define ROFDM_PWMEASURE2 0xdc8
  1228. #define ROFDM_BWREPORT 0xdcc
  1229. #define ROFDM_AGCREPORT 0xdd0
  1230. #define ROFDM_RXSNR 0xdd4
  1231. #define ROFDM_RXEVMCSI 0xdd8
  1232. #define ROFDM_SIGREPORT 0xddc
  1233. #define RTXAGC_A_RATE18_06 0xe00
  1234. #define RTXAGC_A_RATE54_24 0xe04
  1235. #define RTXAGC_A_CCK1_MCS32 0xe08
  1236. #define RTXAGC_A_MCS03_MCS00 0xe10
  1237. #define RTXAGC_A_MCS07_MCS04 0xe14
  1238. #define RTXAGC_A_MCS11_MCS08 0xe18
  1239. #define RTXAGC_A_MCS15_MCS12 0xe1c
  1240. #define RTXAGC_B_RATE18_06 0x830
  1241. #define RTXAGC_B_RATE54_24 0x834
  1242. #define RTXAGC_B_CCK1_55_MCS32 0x838
  1243. #define RTXAGC_B_MCS03_MCS00 0x83c
  1244. #define RTXAGC_B_MCS07_MCS04 0x848
  1245. #define RTXAGC_B_MCS11_MCS08 0x84c
  1246. #define RTXAGC_B_MCS15_MCS12 0x868
  1247. #define RTXAGC_B_CCK11_A_CCK2_11 0x86c
  1248. #define RZEBRA1_HSSIENABLE 0x0
  1249. #define RZEBRA1_TRXENABLE1 0x1
  1250. #define RZEBRA1_TRXENABLE2 0x2
  1251. #define RZEBRA1_AGC 0x4
  1252. #define RZEBRA1_CHARGEPUMP 0x5
  1253. #define RZEBRA1_CHANNEL 0x7
  1254. #define RZEBRA1_TXGAIN 0x8
  1255. #define RZEBRA1_TXLPF 0x9
  1256. #define RZEBRA1_RXLPF 0xb
  1257. #define RZEBRA1_RXHPFCORNER 0xc
  1258. #define RGLOBALCTRL 0
  1259. #define RRTL8256_TXLPF 19
  1260. #define RRTL8256_RXLPF 11
  1261. #define RRTL8258_TXLPF 0x11
  1262. #define RRTL8258_RXLPF 0x13
  1263. #define RRTL8258_RSSILPF 0xa
  1264. #define RF_AC 0x00
  1265. #define RF_IQADJ_G1 0x01
  1266. #define RF_IQADJ_G2 0x02
  1267. #define RF_POW_TRSW 0x05
  1268. #define RF_GAIN_RX 0x06
  1269. #define RF_GAIN_TX 0x07
  1270. #define RF_TXM_IDAC 0x08
  1271. #define RF_BS_IQGEN 0x0F
  1272. #define RF_MODE1 0x10
  1273. #define RF_MODE2 0x11
  1274. #define RF_RX_AGC_HP 0x12
  1275. #define RF_TX_AGC 0x13
  1276. #define RF_BIAS 0x14
  1277. #define RF_IPA 0x15
  1278. #define RF_POW_ABILITY 0x17
  1279. #define RF_MODE_AG 0x18
  1280. #define RRFCHANNEL 0x18
  1281. #define RF_CHNLBW 0x18
  1282. #define RF_TOP 0x19
  1283. #define RF_RX_G1 0x1A
  1284. #define RF_RX_G2 0x1B
  1285. #define RF_RX_BB2 0x1C
  1286. #define RF_RX_BB1 0x1D
  1287. #define RF_RCK1 0x1E
  1288. #define RF_RCK2 0x1F
  1289. #define RF_TX_G1 0x20
  1290. #define RF_TX_G2 0x21
  1291. #define RF_TX_G3 0x22
  1292. #define RF_TX_BB1 0x23
  1293. #define RF_T_METER 0x24
  1294. #define RF_SYN_G1 0x25
  1295. #define RF_SYN_G2 0x26
  1296. #define RF_SYN_G3 0x27
  1297. #define RF_SYN_G4 0x28
  1298. #define RF_SYN_G5 0x29
  1299. #define RF_SYN_G6 0x2A
  1300. #define RF_SYN_G7 0x2B
  1301. #define RF_SYN_G8 0x2C
  1302. #define RF_RCK_OS 0x30
  1303. #define RF_TXPA_G1 0x31
  1304. #define RF_TXPA_G2 0x32
  1305. #define RF_TXPA_G3 0x33
  1306. #define BBBRESETB 0x100
  1307. #define BGLOBALRESETB 0x200
  1308. #define BOFDMTXSTART 0x4
  1309. #define BCCKTXSTART 0x8
  1310. #define BCRC32DEBUG 0x100
  1311. #define BPMACLOOPBACK 0x10
  1312. #define BTXLSIG 0xffffff
  1313. #define BOFDMTXRATE 0xf
  1314. #define BOFDMTXRESERVED 0x10
  1315. #define BOFDMTXLENGTH 0x1ffe0
  1316. #define BOFDMTXPARITY 0x20000
  1317. #define BTXHTSIG1 0xffffff
  1318. #define BTXHTMCSRATE 0x7f
  1319. #define BTXHTBW 0x80
  1320. #define BTXHTLENGTH 0xffff00
  1321. #define BTXHTSIG2 0xffffff
  1322. #define BTXHTSMOOTHING 0x1
  1323. #define BTXHTSOUNDING 0x2
  1324. #define BTXHTRESERVED 0x4
  1325. #define BTXHTAGGREATION 0x8
  1326. #define BTXHTSTBC 0x30
  1327. #define BTXHTADVANCECODING 0x40
  1328. #define BTXHTSHORTGI 0x80
  1329. #define BTXHTNUMBERHT_LTF 0x300
  1330. #define BTXHTCRC8 0x3fc00
  1331. #define BCOUNTERRESET 0x10000
  1332. #define BNUMOFOFDMTX 0xffff
  1333. #define BNUMOFCCKTX 0xffff0000
  1334. #define BTXIDLEINTERVAL 0xffff
  1335. #define BOFDMSERVICE 0xffff0000
  1336. #define BTXMACHEADER 0xffffffff
  1337. #define BTXDATAINIT 0xff
  1338. #define BTXHTMODE 0x100
  1339. #define BTXDATATYPE 0x30000
  1340. #define BTXRANDOMSEED 0xffffffff
  1341. #define BCCKTXPREAMBLE 0x1
  1342. #define BCCKTXSFD 0xffff0000
  1343. #define BCCKTXSIG 0xff
  1344. #define BCCKTXSERVICE 0xff00
  1345. #define BCCKLENGTHEXT 0x8000
  1346. #define BCCKTXLENGHT 0xffff0000
  1347. #define BCCKTXCRC16 0xffff
  1348. #define BCCKTXSTATUS 0x1
  1349. #define BOFDMTXSTATUS 0x2
  1350. #define IS_BB_REG_OFFSET_92S(_offset) \
  1351. ((_offset >= 0x800) && (_offset <= 0xfff))
  1352. #define BRFMOD 0x1
  1353. #define BJAPANMODE 0x2
  1354. #define BCCKTXSC 0x30
  1355. #define BCCKEN 0x1000000
  1356. #define BOFDMEN 0x2000000
  1357. #define BOFDMRXADCPHASE 0x10000
  1358. #define BOFDMTXDACPHASE 0x40000
  1359. #define BXATXAGC 0x3f
  1360. #define BXBTXAGC 0xf00
  1361. #define BXCTXAGC 0xf000
  1362. #define BXDTXAGC 0xf0000
  1363. #define BPASTART 0xf0000000
  1364. #define BTRSTART 0x00f00000
  1365. #define BRFSTART 0x0000f000
  1366. #define BBBSTART 0x000000f0
  1367. #define BBBCCKSTART 0x0000000f
  1368. #define BPAEND 0xf
  1369. #define BTREND 0x0f000000
  1370. #define BRFEND 0x000f0000
  1371. #define BCCAMASK 0x000000f0
  1372. #define BR2RCCAMASK 0x00000f00
  1373. #define BHSSI_R2TDELAY 0xf8000000
  1374. #define BHSSI_T2RDELAY 0xf80000
  1375. #define BCONTXHSSI 0x400
  1376. #define BIGFROMCCK 0x200
  1377. #define BAGCADDRESS 0x3f
  1378. #define BRXHPTX 0x7000
  1379. #define BRXHP2RX 0x38000
  1380. #define BRXHPCCKINI 0xc0000
  1381. #define BAGCTXCODE 0xc00000
  1382. #define BAGCRXCODE 0x300000
  1383. #define B3WIREDATALENGTH 0x800
  1384. #define B3WIREADDREAALENGTH 0x400
  1385. #define B3WIRERFPOWERDOWN 0x1
  1386. #define B5GPAPEPOLARITY 0x40000000
  1387. #define B2GPAPEPOLARITY 0x80000000
  1388. #define BRFSW_TXDEFAULTANT 0x3
  1389. #define BRFSW_TXOPTIONANT 0x30
  1390. #define BRFSW_RXDEFAULTANT 0x300
  1391. #define BRFSW_RXOPTIONANT 0x3000
  1392. #define BRFSI_3WIREDATA 0x1
  1393. #define BRFSI_3WIRECLOCK 0x2
  1394. #define BRFSI_3WIRELOAD 0x4
  1395. #define BRFSI_3WIRERW 0x8
  1396. #define BRFSI_3WIRE 0xf
  1397. #define BRFSI_RFENV 0x10
  1398. #define BRFSI_TRSW 0x20
  1399. #define BRFSI_TRSWB 0x40
  1400. #define BRFSI_ANTSW 0x100
  1401. #define BRFSI_ANTSWB 0x200
  1402. #define BRFSI_PAPE 0x400
  1403. #define BRFSI_PAPE5G 0x800
  1404. #define BBANDSELECT 0x1
  1405. #define BHTSIG2_GI 0x80
  1406. #define BHTSIG2_SMOOTHING 0x01
  1407. #define BHTSIG2_SOUNDING 0x02
  1408. #define BHTSIG2_AGGREATON 0x08
  1409. #define BHTSIG2_STBC 0x30
  1410. #define BHTSIG2_ADVCODING 0x40
  1411. #define BHTSIG2_NUMOFHTLTF 0x300
  1412. #define BHTSIG2_CRC8 0x3fc
  1413. #define BHTSIG1_MCS 0x7f
  1414. #define BHTSIG1_BANDWIDTH 0x80
  1415. #define BHTSIG1_HTLENGTH 0xffff
  1416. #define BLSIG_RATE 0xf
  1417. #define BLSIG_RESERVED 0x10
  1418. #define BLSIG_LENGTH 0x1fffe
  1419. #define BLSIG_PARITY 0x20
  1420. #define BCCKRXPHASE 0x4
  1421. #define BLSSIREADADDRESS 0x7f800000
  1422. #define BLSSIREADEDGE 0x80000000
  1423. #define BLSSIREADBACKDATA 0xfffff
  1424. #define BLSSIREADOKFLAG 0x1000
  1425. #define BCCKSAMPLERATE 0x8
  1426. #define BREGULATOR0STANDBY 0x1
  1427. #define BREGULATORPLLSTANDBY 0x2
  1428. #define BREGULATOR1STANDBY 0x4
  1429. #define BPLLPOWERUP 0x8
  1430. #define BDPLLPOWERUP 0x10
  1431. #define BDA10POWERUP 0x20
  1432. #define BAD7POWERUP 0x200
  1433. #define BDA6POWERUP 0x2000
  1434. #define BXTALPOWERUP 0x4000
  1435. #define B40MDCLKPOWERUP 0x8000
  1436. #define BDA6DEBUGMODE 0x20000
  1437. #define BDA6SWING 0x380000
  1438. #define BADCLKPHASE 0x4000000
  1439. #define B80MCLKDELAY 0x18000000
  1440. #define BAFEWATCHDOGENABLE 0x20000000
  1441. #define BXTALCAP01 0xc0000000
  1442. #define BXTALCAP23 0x3
  1443. #define BXTALCAP92X 0x0f000000
  1444. #define BXTALCAP 0x0f000000
  1445. #define BINTDIFCLKENABLE 0x400
  1446. #define BEXTSIGCLKENABLE 0x800
  1447. #define BBANDGAP_MBIAS_POWERUP 0x10000
  1448. #define BAD11SH_GAIN 0xc0000
  1449. #define BAD11NPUT_RANGE 0x700000
  1450. #define BAD110P_CURRENT 0x3800000
  1451. #define BLPATH_LOOPBACK 0x4000000
  1452. #define BQPATH_LOOPBACK 0x8000000
  1453. #define BAFE_LOOPBACK 0x10000000
  1454. #define BDA10_SWING 0x7e0
  1455. #define BDA10_REVERSE 0x800
  1456. #define BDA_CLK_SOURCE 0x1000
  1457. #define BDA7INPUT_RANGE 0x6000
  1458. #define BDA7_GAIN 0x38000
  1459. #define BDA7OUTPUT_CM_MODE 0x40000
  1460. #define BDA7INPUT_CM_MODE 0x380000
  1461. #define BDA7CURRENT 0xc00000
  1462. #define BREGULATOR_ADJUST 0x7000000
  1463. #define BAD11POWERUP_ATTX 0x1
  1464. #define BDA10PS_ATTX 0x10
  1465. #define BAD11POWERUP_ATRX 0x100
  1466. #define BDA10PS_ATRX 0x1000
  1467. #define BCCKRX_AGC_FORMAT 0x200
  1468. #define BPSDFFT_SAMPLE_POINT 0xc000
  1469. #define BPSD_AVERAGE_NUM 0x3000
  1470. #define BIQPATH_CONTROL 0xc00
  1471. #define BPSD_FREQ 0x3ff
  1472. #define BPSD_ANTENNA_PATH 0x30
  1473. #define BPSD_IQ_SWITCH 0x40
  1474. #define BPSD_RX_TRIGGER 0x400000
  1475. #define BPSD_TX_TRIGGER 0x80000000
  1476. #define BPSD_SINE_TONE_SCALE 0x7f000000
  1477. #define BPSD_REPORT 0xffff
  1478. #define BOFDM_TXSC 0x30000000
  1479. #define BCCK_TXON 0x1
  1480. #define BOFDM_TXON 0x2
  1481. #define BDEBUG_PAGE 0xfff
  1482. #define BDEBUG_ITEM 0xff
  1483. #define BANTL 0x10
  1484. #define BANT_NONHT 0x100
  1485. #define BANT_HT1 0x1000
  1486. #define BANT_HT2 0x10000
  1487. #define BANT_HT1S1 0x100000
  1488. #define BANT_NONHTS1 0x1000000
  1489. #define BCCK_BBMODE 0x3
  1490. #define BCCK_TXPOWERSAVING 0x80
  1491. #define BCCK_RXPOWERSAVING 0x40
  1492. #define BCCK_SIDEBAND 0x10
  1493. #define BCCK_SCRAMBLE 0x8
  1494. #define BCCK_ANTDIVERSITY 0x8000
  1495. #define BCCK_CARRIER_RECOVERY 0x4000
  1496. #define BCCK_TXRATE 0x3000
  1497. #define BCCK_DCCANCEL 0x0800
  1498. #define BCCK_ISICANCEL 0x0400
  1499. #define BCCK_MATCH_FILTER 0x0200
  1500. #define BCCK_EQUALIZER 0x0100
  1501. #define BCCK_PREAMBLE_DETECT 0x800000
  1502. #define BCCK_FAST_FALSECCA 0x400000
  1503. #define BCCK_CH_ESTSTART 0x300000
  1504. #define BCCK_CCA_COUNT 0x080000
  1505. #define BCCK_CS_LIM 0x070000
  1506. #define BCCK_BIST_MODE 0x80000000
  1507. #define BCCK_CCAMASK 0x40000000
  1508. #define BCCK_TX_DAC_PHASE 0x4
  1509. #define BCCK_RX_ADC_PHASE 0x20000000
  1510. #define BCCKR_CP_MODE 0x0100
  1511. #define BCCK_TXDC_OFFSET 0xf0
  1512. #define BCCK_RXDC_OFFSET 0xf
  1513. #define BCCK_CCA_MODE 0xc000
  1514. #define BCCK_FALSECS_LIM 0x3f00
  1515. #define BCCK_CS_RATIO 0xc00000
  1516. #define BCCK_CORGBIT_SEL 0x300000
  1517. #define BCCK_PD_LIM 0x0f0000
  1518. #define BCCK_NEWCCA 0x80000000
  1519. #define BCCK_RXHP_OF_IG 0x8000
  1520. #define BCCK_RXIG 0x7f00
  1521. #define BCCK_LNA_POLARITY 0x800000
  1522. #define BCCK_RX1ST_BAIN 0x7f0000
  1523. #define BCCK_RF_EXTEND 0x20000000
  1524. #define BCCK_RXAGC_SATLEVEL 0x1f000000
  1525. #define BCCK_RXAGC_SATCOUNT 0xe0
  1526. #define BCCKRXRFSETTLE 0x1f
  1527. #define BCCK_FIXED_RXAGC 0x8000
  1528. #define BCCK_ANTENNA_POLARITY 0x2000
  1529. #define BCCK_TXFILTER_TYPE 0x0c00
  1530. #define BCCK_RXAGC_REPORTTYPE 0x0300
  1531. #define BCCK_RXDAGC_EN 0x80000000
  1532. #define BCCK_RXDAGC_PERIOD 0x20000000
  1533. #define BCCK_RXDAGC_SATLEVEL 0x1f000000
  1534. #define BCCK_TIMING_RECOVERY 0x800000
  1535. #define BCCK_TXC0 0x3f0000
  1536. #define BCCK_TXC1 0x3f000000
  1537. #define BCCK_TXC2 0x3f
  1538. #define BCCK_TXC3 0x3f00
  1539. #define BCCK_TXC4 0x3f0000
  1540. #define BCCK_TXC5 0x3f000000
  1541. #define BCCK_TXC6 0x3f
  1542. #define BCCK_TXC7 0x3f00
  1543. #define BCCK_DEBUGPORT 0xff0000
  1544. #define BCCK_DAC_DEBUG 0x0f000000
  1545. #define BCCK_FALSEALARM_ENABLE 0x8000
  1546. #define BCCK_FALSEALARM_READ 0x4000
  1547. #define BCCK_TRSSI 0x7f
  1548. #define BCCK_RXAGC_REPORT 0xfe
  1549. #define BCCK_RXREPORT_ANTSEL 0x80000000
  1550. #define BCCK_RXREPORT_MFOFF 0x40000000
  1551. #define BCCK_RXREPORT_SQLOSS 0x20000000
  1552. #define BCCK_RXREPORT_PKTLOSS 0x10000000
  1553. #define BCCK_RXREPORT_LOCKEDBIT 0x08000000
  1554. #define BCCK_RXREPORT_RATEERROR 0x04000000
  1555. #define BCCK_RXREPORT_RXRATE 0x03000000
  1556. #define BCCK_RXFA_COUNTER_LOWER 0xff
  1557. #define BCCK_RXFA_COUNTER_UPPER 0xff000000
  1558. #define BCCK_RXHPAGC_START 0xe000
  1559. #define BCCK_RXHPAGC_FINAL 0x1c00
  1560. #define BCCK_RXFALSEALARM_ENABLE 0x8000
  1561. #define BCCK_FACOUNTER_FREEZE 0x4000
  1562. #define BCCK_TXPATH_SEL 0x10000000
  1563. #define BCCK_DEFAULT_RXPATH 0xc000000
  1564. #define BCCK_OPTION_RXPATH 0x3000000
  1565. #define BNUM_OFSTF 0x3
  1566. #define BSHIFT_L 0xc0
  1567. #define BGI_TH 0xc
  1568. #define BRXPATH_A 0x1
  1569. #define BRXPATH_B 0x2
  1570. #define BRXPATH_C 0x4
  1571. #define BRXPATH_D 0x8
  1572. #define BTXPATH_A 0x1
  1573. #define BTXPATH_B 0x2
  1574. #define BTXPATH_C 0x4
  1575. #define BTXPATH_D 0x8
  1576. #define BTRSSI_FREQ 0x200
  1577. #define BADC_BACKOFF 0x3000
  1578. #define BDFIR_BACKOFF 0xc000
  1579. #define BTRSSI_LATCH_PHASE 0x10000
  1580. #define BRX_LDC_OFFSET 0xff
  1581. #define BRX_QDC_OFFSET 0xff00
  1582. #define BRX_DFIR_MODE 0x1800000
  1583. #define BRX_DCNF_TYPE 0xe000000
  1584. #define BRXIQIMB_A 0x3ff
  1585. #define BRXIQIMB_B 0xfc00
  1586. #define BRXIQIMB_C 0x3f0000
  1587. #define BRXIQIMB_D 0xffc00000
  1588. #define BDC_DC_NOTCH 0x60000
  1589. #define BRXNB_NOTCH 0x1f000000
  1590. #define BPD_TH 0xf
  1591. #define BPD_TH_OPT2 0xc000
  1592. #define BPWED_TH 0x700
  1593. #define BIFMF_WIN_L 0x800
  1594. #define BPD_OPTION 0x1000
  1595. #define BMF_WIN_L 0xe000
  1596. #define BBW_SEARCH_L 0x30000
  1597. #define BWIN_ENH_L 0xc0000
  1598. #define BBW_TH 0x700000
  1599. #define BED_TH2 0x3800000
  1600. #define BBW_OPTION 0x4000000
  1601. #define BRADIO_TH 0x18000000
  1602. #define BWINDOW_L 0xe0000000
  1603. #define BSBD_OPTION 0x1
  1604. #define BFRAME_TH 0x1c
  1605. #define BFS_OPTION 0x60
  1606. #define BDC_SLOPE_CHECK 0x80
  1607. #define BFGUARD_COUNTER_DC_L 0xe00
  1608. #define BFRAME_WEIGHT_SHORT 0x7000
  1609. #define BSUB_TUNE 0xe00000
  1610. #define BFRAME_DC_LENGTH 0xe000000
  1611. #define BSBD_START_OFFSET 0x30000000
  1612. #define BFRAME_TH_2 0x7
  1613. #define BFRAME_GI2_TH 0x38
  1614. #define BGI2_SYNC_EN 0x40
  1615. #define BSARCH_SHORT_EARLY 0x300
  1616. #define BSARCH_SHORT_LATE 0xc00
  1617. #define BSARCH_GI2_LATE 0x70000
  1618. #define BCFOANTSUM 0x1
  1619. #define BCFOACC 0x2
  1620. #define BCFOSTARTOFFSET 0xc
  1621. #define BCFOLOOPBACK 0x70
  1622. #define BCFOSUMWEIGHT 0x80
  1623. #define BDAGCENABLE 0x10000
  1624. #define BTXIQIMB_A 0x3ff
  1625. #define BTXIQIMB_b 0xfc00
  1626. #define BTXIQIMB_C 0x3f0000
  1627. #define BTXIQIMB_D 0xffc00000
  1628. #define BTXIDCOFFSET 0xff
  1629. #define BTXIQDCOFFSET 0xff00
  1630. #define BTXDFIRMODE 0x10000
  1631. #define BTXPESUDO_NOISEON 0x4000000
  1632. #define BTXPESUDO_NOISE_A 0xff
  1633. #define BTXPESUDO_NOISE_B 0xff00
  1634. #define BTXPESUDO_NOISE_C 0xff0000
  1635. #define BTXPESUDO_NOISE_D 0xff000000
  1636. #define BCCA_DROPOPTION 0x20000
  1637. #define BCCA_DROPTHRES 0xfff00000
  1638. #define BEDCCA_H 0xf
  1639. #define BEDCCA_L 0xf0
  1640. #define BLAMBDA_ED 0x300
  1641. #define BRX_INITIALGAIN 0x7f
  1642. #define BRX_ANTDIV_EN 0x80
  1643. #define BRX_AGC_ADDRESS_FOR_LNA 0x7f00
  1644. #define BRX_HIGHPOWER_FLOW 0x8000
  1645. #define BRX_AGC_FREEZE_THRES 0xc0000
  1646. #define BRX_FREEZESTEP_AGC1 0x300000
  1647. #define BRX_FREEZESTEP_AGC2 0xc00000
  1648. #define BRX_FREEZESTEP_AGC3 0x3000000
  1649. #define BRX_FREEZESTEP_AGC0 0xc000000
  1650. #define BRXRSSI_CMP_EN 0x10000000
  1651. #define BRXQUICK_AGCEN 0x20000000
  1652. #define BRXAGC_FREEZE_THRES_MODE 0x40000000
  1653. #define BRX_OVERFLOW_CHECKTYPE 0x80000000
  1654. #define BRX_AGCSHIFT 0x7f
  1655. #define BTRSW_TRI_ONLY 0x80
  1656. #define BPOWER_THRES 0x300
  1657. #define BRXAGC_EN 0x1
  1658. #define BRXAGC_TOGETHER_EN 0x2
  1659. #define BRXAGC_MIN 0x4
  1660. #define BRXHP_INI 0x7
  1661. #define BRXHP_TRLNA 0x70
  1662. #define BRXHP_RSSI 0x700
  1663. #define BRXHP_BBP1 0x7000
  1664. #define BRXHP_BBP2 0x70000
  1665. #define BRXHP_BBP3 0x700000
  1666. #define BRSSI_H 0x7f0000
  1667. #define BRSSI_GEN 0x7f000000
  1668. #define BRXSETTLE_TRSW 0x7
  1669. #define BRXSETTLE_LNA 0x38
  1670. #define BRXSETTLE_RSSI 0x1c0
  1671. #define BRXSETTLE_BBP 0xe00
  1672. #define BRXSETTLE_RXHP 0x7000
  1673. #define BRXSETTLE_ANTSW_RSSI 0x38000
  1674. #define BRXSETTLE_ANTSW 0xc0000
  1675. #define BRXPROCESS_TIME_DAGC 0x300000
  1676. #define BRXSETTLE_HSSI 0x400000
  1677. #define BRXPROCESS_TIME_BBPPW 0x800000
  1678. #define BRXANTENNA_POWER_SHIFT 0x3000000
  1679. #define BRSSI_TABLE_SELECT 0xc000000
  1680. #define BRXHP_FINAL 0x7000000
  1681. #define BRXHPSETTLE_BBP 0x7
  1682. #define BRXHTSETTLE_HSSI 0x8
  1683. #define BRXHTSETTLE_RXHP 0x70
  1684. #define BRXHTSETTLE_BBPPW 0x80
  1685. #define BRXHTSETTLE_IDLE 0x300
  1686. #define BRXHTSETTLE_RESERVED 0x1c00
  1687. #define BRXHT_RXHP_EN 0x8000
  1688. #define BRXAGC_FREEZE_THRES 0x30000
  1689. #define BRXAGC_TOGETHEREN 0x40000
  1690. #define BRXHTAGC_MIN 0x80000
  1691. #define BRXHTAGC_EN 0x100000
  1692. #define BRXHTDAGC_EN 0x200000
  1693. #define BRXHT_RXHP_BBP 0x1c00000
  1694. #define BRXHT_RXHP_FINAL 0xe0000000
  1695. #define BRXPW_RADIO_TH 0x3
  1696. #define BRXPW_RADIO_EN 0x4
  1697. #define BRXMF_HOLD 0x3800
  1698. #define BRXPD_DELAY_TH1 0x38
  1699. #define BRXPD_DELAY_TH2 0x1c0
  1700. #define BRXPD_DC_COUNT_MAX 0x600
  1701. #define BRXPD_DELAY_TH 0x8000
  1702. #define BRXPROCESS_DELAY 0xf0000
  1703. #define BRXSEARCHRANGE_GI2_EARLY 0x700000
  1704. #define BRXFRAME_FUARD_COUNTER_L 0x3800000
  1705. #define BRXSGI_GUARD_L 0xc000000
  1706. #define BRXSGI_SEARCH_L 0x30000000
  1707. #define BRXSGI_TH 0xc0000000
  1708. #define BDFSCNT0 0xff
  1709. #define BDFSCNT1 0xff00
  1710. #define BDFSFLAG 0xf0000
  1711. #define BMF_WEIGHT_SUM 0x300000
  1712. #define BMINIDX_TH 0x7f000000
  1713. #define BDAFORMAT 0x40000
  1714. #define BTXCH_EMU_ENABLE 0x01000000
  1715. #define BTRSW_ISOLATION_A 0x7f
  1716. #define BTRSW_ISOLATION_B 0x7f00
  1717. #define BTRSW_ISOLATION_C 0x7f0000
  1718. #define BTRSW_ISOLATION_D 0x7f000000
  1719. #define BEXT_LNA_GAIN 0x7c00
  1720. #define BSTBC_EN 0x4
  1721. #define BANTENNA_MAPPING 0x10
  1722. #define BNSS 0x20
  1723. #define BCFO_ANTSUM_ID 0x200
  1724. #define BPHY_COUNTER_RESET 0x8000000
  1725. #define BCFO_REPORT_GET 0x4000000
  1726. #define BOFDM_CONTINUE_TX 0x10000000
  1727. #define BOFDM_SINGLE_CARRIER 0x20000000
  1728. #define BOFDM_SINGLE_TONE 0x40000000
  1729. #define BHT_DETECT 0x100
  1730. #define BCFOEN 0x10000
  1731. #define BCFOVALUE 0xfff00000
  1732. #define BSIGTONE_RE 0x3f
  1733. #define BSIGTONE_IM 0x7f00
  1734. #define BCOUNTER_CCA 0xffff
  1735. #define BCOUNTER_PARITYFAIL 0xffff0000
  1736. #define BCOUNTER_RATEILLEGAL 0xffff
  1737. #define BCOUNTER_CRC8FAIL 0xffff0000
  1738. #define BCOUNTER_MCSNOSUPPORT 0xffff
  1739. #define BCOUNTER_FASTSYNC 0xffff
  1740. #define BSHORTCFO 0xfff
  1741. #define BSHORTCFOT_LENGTH 12
  1742. #define BSHORTCFOF_LENGTH 11
  1743. #define BLONGCFO 0x7ff
  1744. #define BLONGCFOT_LENGTH 11
  1745. #define BLONGCFOF_LENGTH 11
  1746. #define BTAILCFO 0x1fff
  1747. #define BTAILCFOT_LENGTH 13
  1748. #define BTAILCFOF_LENGTH 12
  1749. #define BNOISE_EN_PWDB 0xffff
  1750. #define BCC_POWER_DB 0xffff0000
  1751. #define BMOISE_PWDB 0xffff
  1752. #define BPOWERMEAST_LENGTH 10
  1753. #define BPOWERMEASF_LENGTH 3
  1754. #define BRX_HT_BW 0x1
  1755. #define BRXSC 0x6
  1756. #define BRX_HT 0x8
  1757. #define BNB_INTF_DET_ON 0x1
  1758. #define BINTF_WIN_LEN_CFG 0x30
  1759. #define BNB_INTF_TH_CFG 0x1c0
  1760. #define BRFGAIN 0x3f
  1761. #define BTABLESEL 0x40
  1762. #define BTRSW 0x80
  1763. #define BRXSNR_A 0xff
  1764. #define BRXSNR_B 0xff00
  1765. #define BRXSNR_C 0xff0000
  1766. #define BRXSNR_D 0xff000000
  1767. #define BSNR_EVMT_LENGTH 8
  1768. #define BSNR_EVMF_LENGTH 1
  1769. #define BCSI1ST 0xff
  1770. #define BCSI2ND 0xff00
  1771. #define BRXEVM1ST 0xff0000
  1772. #define BRXEVM2ND 0xff000000
  1773. #define BSIGEVM 0xff
  1774. #define BPWDB 0xff00
  1775. #define BSGIEN 0x10000
  1776. #define BSFACTOR_QMA1 0xf
  1777. #define BSFACTOR_QMA2 0xf0
  1778. #define BSFACTOR_QMA3 0xf00
  1779. #define BSFACTOR_QMA4 0xf000
  1780. #define BSFACTOR_QMA5 0xf0000
  1781. #define BSFACTOR_QMA6 0xf0000
  1782. #define BSFACTOR_QMA7 0xf00000
  1783. #define BSFACTOR_QMA8 0xf000000
  1784. #define BSFACTOR_QMA9 0xf0000000
  1785. #define BCSI_SCHEME 0x100000
  1786. #define BNOISE_LVL_TOP_SET 0x3
  1787. #define BCHSMOOTH 0x4
  1788. #define BCHSMOOTH_CFG1 0x38
  1789. #define BCHSMOOTH_CFG2 0x1c0
  1790. #define BCHSMOOTH_CFG3 0xe00
  1791. #define BCHSMOOTH_CFG4 0x7000
  1792. #define BMRCMODE 0x800000
  1793. #define BTHEVMCFG 0x7000000
  1794. #define BLOOP_FIT_TYPE 0x1
  1795. #define BUPD_CFO 0x40
  1796. #define BUPD_CFO_OFFDATA 0x80
  1797. #define BADV_UPD_CFO 0x100
  1798. #define BADV_TIME_CTRL 0x800
  1799. #define BUPD_CLKO 0x1000
  1800. #define BFC 0x6000
  1801. #define BTRACKING_MODE 0x8000
  1802. #define BPHCMP_ENABLE 0x10000
  1803. #define BUPD_CLKO_LTF 0x20000
  1804. #define BCOM_CH_CFO 0x40000
  1805. #define BCSI_ESTI_MODE 0x80000
  1806. #define BADV_UPD_EQZ 0x100000
  1807. #define BUCHCFG 0x7000000
  1808. #define BUPDEQZ 0x8000000
  1809. #define BRX_PESUDO_NOISE_ON 0x20000000
  1810. #define BRX_PESUDO_NOISE_A 0xff
  1811. #define BRX_PESUDO_NOISE_B 0xff00
  1812. #define BRX_PESUDO_NOISE_C 0xff0000
  1813. #define BRX_PESUDO_NOISE_D 0xff000000
  1814. #define BRX_PESUDO_NOISESTATE_A 0xffff
  1815. #define BRX_PESUDO_NOISESTATE_B 0xffff0000
  1816. #define BRX_PESUDO_NOISESTATE_C 0xffff
  1817. #define BRX_PESUDO_NOISESTATE_D 0xffff0000
  1818. #define BZEBRA1_HSSIENABLE 0x8
  1819. #define BZEBRA1_TRXCONTROL 0xc00
  1820. #define BZEBRA1_TRXGAINSETTING 0x07f
  1821. #define BZEBRA1_RXCOUNTER 0xc00
  1822. #define BZEBRA1_TXCHANGEPUMP 0x38
  1823. #define BZEBRA1_RXCHANGEPUMP 0x7
  1824. #define BZEBRA1_CHANNEL_NUM 0xf80
  1825. #define BZEBRA1_TXLPFBW 0x400
  1826. #define BZEBRA1_RXLPFBW 0x600
  1827. #define BRTL8256REG_MODE_CTRL1 0x100
  1828. #define BRTL8256REG_MODE_CTRL0 0x40
  1829. #define BRTL8256REG_TXLPFBW 0x18
  1830. #define BRTL8256REG_RXLPFBW 0x600
  1831. #define BRTL8258_TXLPFBW 0xc
  1832. #define BRTL8258_RXLPFBW 0xc00
  1833. #define BRTL8258_RSSILPFBW 0xc0
  1834. #define BBYTE0 0x1
  1835. #define BBYTE1 0x2
  1836. #define BBYTE2 0x4
  1837. #define BBYTE3 0x8
  1838. #define BWORD0 0x3
  1839. #define BWORD1 0xc
  1840. #define BWORD 0xf
  1841. #define MASKBYTE0 0xff
  1842. #define MASKBYTE1 0xff00
  1843. #define MASKBYTE2 0xff0000
  1844. #define MASKBYTE3 0xff000000
  1845. #define MASKHWORD 0xffff0000
  1846. #define MASKLWORD 0x0000ffff
  1847. #define MASKDWORD 0xffffffff
  1848. #define MASK12BITS 0xfff
  1849. #define MASKH4BITS 0xf0000000
  1850. #define MASKOFDM_D 0xffc00000
  1851. #define MASKCCK 0x3f3f3f3f
  1852. #define MASK4BITS 0x0f
  1853. #define MASK20BITS 0xfffff
  1854. #define RFREG_OFFSET_MASK 0xfffff
  1855. #define BENABLE 0x1
  1856. #define BDISABLE 0x0
  1857. #define LEFT_ANTENNA 0x0
  1858. #define RIGHT_ANTENNA 0x1
  1859. #define TCHECK_TXSTATUS 500
  1860. #define TUPDATE_RXCOUNTER 100
  1861. /* 2 EFUSE_TEST (For RTL8723 partially) */
  1862. #define EFUSE_SEL(x) (((x) & 0x3) << 8)
  1863. #define EFUSE_SEL_MASK 0x300
  1864. #define EFUSE_WIFI_SEL_0 0x0
  1865. /* Enable GPIO[9] as WiFi HW PDn source*/
  1866. #define WL_HWPDN_EN BIT(0)
  1867. /* WiFi HW PDn polarity control*/
  1868. #define WL_HWPDN_SL BIT(1)
  1869. #endif