/kernel/2.6.32_froyo_photon_nightly/drivers/staging/rt2860/rt28xx.h

http://photon-android.googlecode.com/ · C++ Header · 1688 lines · 1262 code · 140 blank · 286 comment · 0 complexity · 0de14dec1022717e7ec75f44c8239184 MD5 · raw file

Large files are truncated click here to view the full file

  1. /*
  2. *************************************************************************
  3. * Ralink Tech Inc.
  4. * 5F., No.36, Taiyuan St., Jhubei City,
  5. * Hsinchu County 302,
  6. * Taiwan, R.O.C.
  7. *
  8. * (c) Copyright 2002-2007, Ralink Technology, Inc.
  9. *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. * This program is distributed in the hope that it will be useful, *
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  18. * GNU General Public License for more details. *
  19. * *
  20. * You should have received a copy of the GNU General Public License *
  21. * along with this program; if not, write to the *
  22. * Free Software Foundation, Inc., *
  23. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  24. * *
  25. *************************************************************************
  26. Module Name:
  27. rt28xx.h
  28. Abstract:
  29. RT28xx ASIC related definition & structures
  30. Revision History:
  31. Who When What
  32. -------- ---------- ----------------------------------------------
  33. Jan Lee Jan-3-2006 created for RT2860c
  34. */
  35. #ifndef __RT28XX_H__
  36. #define __RT28XX_H__
  37. //
  38. // PCI registers - base address 0x0000
  39. //
  40. #define PCI_CFG 0x0000
  41. #define PCI_EECTRL 0x0004
  42. #define PCI_MCUCTRL 0x0008
  43. typedef int NTSTATUS;
  44. #define OPT_14 0x114
  45. //
  46. // SCH/DMA registers - base address 0x0200
  47. //
  48. // INT_SOURCE_CSR: Interrupt source register. Write one to clear corresponding bit
  49. //
  50. #define DMA_CSR0 0x200
  51. #define INT_SOURCE_CSR 0x200
  52. typedef union _INT_SOURCE_CSR_STRUC {
  53. struct {
  54. UINT32 RxDelayINT:1;
  55. UINT32 TxDelayINT:1;
  56. UINT32 RxDone:1;
  57. UINT32 Ac0DmaDone:1;//4
  58. UINT32 Ac1DmaDone:1;
  59. UINT32 Ac2DmaDone:1;
  60. UINT32 Ac3DmaDone:1;
  61. UINT32 HccaDmaDone:1; // bit7
  62. UINT32 MgmtDmaDone:1;
  63. UINT32 MCUCommandINT:1;//bit 9
  64. UINT32 RxTxCoherent:1;
  65. UINT32 TBTTInt:1;
  66. UINT32 PreTBTT:1;
  67. UINT32 TXFifoStatusInt:1;//FIFO Statistics is full, sw should read 0x171c
  68. UINT32 AutoWakeup:1;//bit14
  69. UINT32 GPTimer:1;
  70. UINT32 RxCoherent:1;//bit16
  71. UINT32 TxCoherent:1;
  72. UINT32 :14;
  73. } field;
  74. UINT32 word;
  75. } INT_SOURCE_CSR_STRUC, *PINT_SOURCE_CSR_STRUC;
  76. //
  77. // INT_MASK_CSR: Interrupt MASK register. 1: the interrupt is mask OFF
  78. //
  79. #define INT_MASK_CSR 0x204
  80. typedef union _INT_MASK_CSR_STRUC {
  81. struct {
  82. UINT32 RXDelay_INT_MSK:1;
  83. UINT32 TxDelay:1;
  84. UINT32 RxDone:1;
  85. UINT32 Ac0DmaDone:1;
  86. UINT32 Ac1DmaDone:1;
  87. UINT32 Ac2DmaDone:1;
  88. UINT32 Ac3DmaDone:1;
  89. UINT32 HccaDmaDone:1;
  90. UINT32 MgmtDmaDone:1;
  91. UINT32 MCUCommandINT:1;
  92. UINT32 :20;
  93. UINT32 RxCoherent:1;
  94. UINT32 TxCoherent:1;
  95. } field;
  96. UINT32 word;
  97. } INT_MASK_CSR_STRUC, *PINT_MASK_CSR_STRUC;
  98. #define WPDMA_GLO_CFG 0x208
  99. typedef union _WPDMA_GLO_CFG_STRUC {
  100. struct {
  101. UINT32 EnableTxDMA:1;
  102. UINT32 TxDMABusy:1;
  103. UINT32 EnableRxDMA:1;
  104. UINT32 RxDMABusy:1;
  105. UINT32 WPDMABurstSIZE:2;
  106. UINT32 EnTXWriteBackDDONE:1;
  107. UINT32 BigEndian:1;
  108. UINT32 RXHdrScater:8;
  109. UINT32 HDR_SEG_LEN:16;
  110. } field;
  111. UINT32 word;
  112. } WPDMA_GLO_CFG_STRUC, *PWPDMA_GLO_CFG_STRUC;
  113. #define WPDMA_RST_IDX 0x20c
  114. typedef union _WPDMA_RST_IDX_STRUC {
  115. struct {
  116. UINT32 RST_DTX_IDX0:1;
  117. UINT32 RST_DTX_IDX1:1;
  118. UINT32 RST_DTX_IDX2:1;
  119. UINT32 RST_DTX_IDX3:1;
  120. UINT32 RST_DTX_IDX4:1;
  121. UINT32 RST_DTX_IDX5:1;
  122. UINT32 rsv:10;
  123. UINT32 RST_DRX_IDX0:1;
  124. UINT32 :15;
  125. } field;
  126. UINT32 word;
  127. } WPDMA_RST_IDX_STRUC, *PWPDMA_RST_IDX_STRUC;
  128. #define DELAY_INT_CFG 0x0210
  129. typedef union _DELAY_INT_CFG_STRUC {
  130. struct {
  131. UINT32 RXMAX_PTIME:8;
  132. UINT32 RXMAX_PINT:7;
  133. UINT32 RXDLY_INT_EN:1;
  134. UINT32 TXMAX_PTIME:8;
  135. UINT32 TXMAX_PINT:7;
  136. UINT32 TXDLY_INT_EN:1;
  137. } field;
  138. UINT32 word;
  139. } DELAY_INT_CFG_STRUC, *PDELAY_INT_CFG_STRUC;
  140. #define WMM_AIFSN_CFG 0x0214
  141. typedef union _AIFSN_CSR_STRUC {
  142. struct {
  143. UINT32 Aifsn0:4; // for AC_BE
  144. UINT32 Aifsn1:4; // for AC_BK
  145. UINT32 Aifsn2:4; // for AC_VI
  146. UINT32 Aifsn3:4; // for AC_VO
  147. UINT32 Rsv:16;
  148. } field;
  149. UINT32 word;
  150. } AIFSN_CSR_STRUC, *PAIFSN_CSR_STRUC;
  151. //
  152. // CWMIN_CSR: CWmin for each EDCA AC
  153. //
  154. #define WMM_CWMIN_CFG 0x0218
  155. typedef union _CWMIN_CSR_STRUC {
  156. struct {
  157. UINT32 Cwmin0:4; // for AC_BE
  158. UINT32 Cwmin1:4; // for AC_BK
  159. UINT32 Cwmin2:4; // for AC_VI
  160. UINT32 Cwmin3:4; // for AC_VO
  161. UINT32 Rsv:16;
  162. } field;
  163. UINT32 word;
  164. } CWMIN_CSR_STRUC, *PCWMIN_CSR_STRUC;
  165. //
  166. // CWMAX_CSR: CWmin for each EDCA AC
  167. //
  168. #define WMM_CWMAX_CFG 0x021c
  169. typedef union _CWMAX_CSR_STRUC {
  170. struct {
  171. UINT32 Cwmax0:4; // for AC_BE
  172. UINT32 Cwmax1:4; // for AC_BK
  173. UINT32 Cwmax2:4; // for AC_VI
  174. UINT32 Cwmax3:4; // for AC_VO
  175. UINT32 Rsv:16;
  176. } field;
  177. UINT32 word;
  178. } CWMAX_CSR_STRUC, *PCWMAX_CSR_STRUC;
  179. //
  180. // AC_TXOP_CSR0: AC_BK/AC_BE TXOP register
  181. //
  182. #define WMM_TXOP0_CFG 0x0220
  183. typedef union _AC_TXOP_CSR0_STRUC {
  184. struct {
  185. USHORT Ac0Txop; // for AC_BK, in unit of 32us
  186. USHORT Ac1Txop; // for AC_BE, in unit of 32us
  187. } field;
  188. UINT32 word;
  189. } AC_TXOP_CSR0_STRUC, *PAC_TXOP_CSR0_STRUC;
  190. //
  191. // AC_TXOP_CSR1: AC_VO/AC_VI TXOP register
  192. //
  193. #define WMM_TXOP1_CFG 0x0224
  194. typedef union _AC_TXOP_CSR1_STRUC {
  195. struct {
  196. USHORT Ac2Txop; // for AC_VI, in unit of 32us
  197. USHORT Ac3Txop; // for AC_VO, in unit of 32us
  198. } field;
  199. UINT32 word;
  200. } AC_TXOP_CSR1_STRUC, *PAC_TXOP_CSR1_STRUC;
  201. #define RINGREG_DIFF 0x10
  202. #define GPIO_CTRL_CFG 0x0228 //MAC_CSR13
  203. #define MCU_CMD_CFG 0x022c
  204. #define TX_BASE_PTR0 0x0230 //AC_BK base address
  205. #define TX_MAX_CNT0 0x0234
  206. #define TX_CTX_IDX0 0x0238
  207. #define TX_DTX_IDX0 0x023c
  208. #define TX_BASE_PTR1 0x0240 //AC_BE base address
  209. #define TX_MAX_CNT1 0x0244
  210. #define TX_CTX_IDX1 0x0248
  211. #define TX_DTX_IDX1 0x024c
  212. #define TX_BASE_PTR2 0x0250 //AC_VI base address
  213. #define TX_MAX_CNT2 0x0254
  214. #define TX_CTX_IDX2 0x0258
  215. #define TX_DTX_IDX2 0x025c
  216. #define TX_BASE_PTR3 0x0260 //AC_VO base address
  217. #define TX_MAX_CNT3 0x0264
  218. #define TX_CTX_IDX3 0x0268
  219. #define TX_DTX_IDX3 0x026c
  220. #define TX_BASE_PTR4 0x0270 //HCCA base address
  221. #define TX_MAX_CNT4 0x0274
  222. #define TX_CTX_IDX4 0x0278
  223. #define TX_DTX_IDX4 0x027c
  224. #define TX_BASE_PTR5 0x0280 //MGMT base address
  225. #define TX_MAX_CNT5 0x0284
  226. #define TX_CTX_IDX5 0x0288
  227. #define TX_DTX_IDX5 0x028c
  228. #define TX_MGMTMAX_CNT TX_MAX_CNT5
  229. #define TX_MGMTCTX_IDX TX_CTX_IDX5
  230. #define TX_MGMTDTX_IDX TX_DTX_IDX5
  231. #define RX_BASE_PTR 0x0290 //RX base address
  232. #define RX_MAX_CNT 0x0294
  233. #define RX_CRX_IDX 0x0298
  234. #define RX_DRX_IDX 0x029c
  235. #define USB_DMA_CFG 0x02a0
  236. typedef union _USB_DMA_CFG_STRUC {
  237. struct {
  238. UINT32 RxBulkAggTOut:8; //Rx Bulk Aggregation TimeOut in unit of 33ns
  239. UINT32 RxBulkAggLmt:8; //Rx Bulk Aggregation Limit in unit of 256 bytes
  240. UINT32 phyclear:1; //phy watch dog enable. write 1
  241. UINT32 rsv:2;
  242. UINT32 TxClear:1; //Clear USB DMA TX path
  243. UINT32 TxopHalt:1; //Halt TXOP count down when TX buffer is full.
  244. UINT32 RxBulkAggEn:1; //Enable Rx Bulk Aggregation
  245. UINT32 RxBulkEn:1; //Enable USB DMA Rx
  246. UINT32 TxBulkEn:1; //Enable USB DMA Tx
  247. UINT32 EpoutValid:6; //OUT endpoint data valid
  248. UINT32 RxBusy:1; //USB DMA RX FSM busy
  249. UINT32 TxBusy:1; //USB DMA TX FSM busy
  250. } field;
  251. UINT32 word;
  252. } USB_DMA_CFG_STRUC, *PUSB_DMA_CFG_STRUC;
  253. //
  254. // 3 PBF registers
  255. //
  256. //
  257. // Most are for debug. Driver doesn't touch PBF register.
  258. #define PBF_SYS_CTRL 0x0400
  259. #define PBF_CFG 0x0408
  260. #define PBF_MAX_PCNT 0x040C
  261. #define PBF_CTRL 0x0410
  262. #define PBF_INT_STA 0x0414
  263. #define PBF_INT_ENA 0x0418
  264. #define TXRXQ_PCNT 0x0438
  265. #define PBF_DBG 0x043c
  266. #define PBF_CAP_CTRL 0x0440
  267. // eFuse registers
  268. #define EFUSE_CTRL 0x0580
  269. #define EFUSE_DATA0 0x0590
  270. #define EFUSE_DATA1 0x0594
  271. #define EFUSE_DATA2 0x0598
  272. #define EFUSE_DATA3 0x059c
  273. #define EFUSE_USAGE_MAP_START 0x2d0
  274. #define EFUSE_USAGE_MAP_END 0x2fc
  275. #define EFUSE_TAG 0x2fe
  276. #define EFUSE_USAGE_MAP_SIZE 45
  277. typedef union _EFUSE_CTRL_STRUC {
  278. struct {
  279. UINT32 EFSROM_AOUT:6;
  280. UINT32 EFSROM_MODE:2;
  281. UINT32 EFSROM_LDO_OFF_TIME:6;
  282. UINT32 EFSROM_LDO_ON_TIME:2;
  283. UINT32 EFSROM_AIN:10;
  284. UINT32 RESERVED:4;
  285. UINT32 EFSROM_KICK:1;
  286. UINT32 SEL_EFUSE:1;
  287. } field;
  288. UINT32 word;
  289. } EFUSE_CTRL_STRUC, *PEFUSE_CTRL_STRUC;
  290. #define LDO_CFG0 0x05d4
  291. #define GPIO_SWITCH 0x05dc
  292. //
  293. // 4 MAC registers
  294. //
  295. //
  296. // 4.1 MAC SYSTEM configuration registers (offset:0x1000)
  297. //
  298. #define MAC_CSR0 0x1000
  299. typedef union _ASIC_VER_ID_STRUC {
  300. struct {
  301. USHORT ASICRev; // reversion : 0
  302. USHORT ASICVer; // version : 2860
  303. } field;
  304. UINT32 word;
  305. } ASIC_VER_ID_STRUC, *PASIC_VER_ID_STRUC;
  306. #define MAC_SYS_CTRL 0x1004 //MAC_CSR1
  307. #define MAC_ADDR_DW0 0x1008 // MAC ADDR DW0
  308. #define MAC_ADDR_DW1 0x100c // MAC ADDR DW1
  309. //
  310. // MAC_CSR2: STA MAC register 0
  311. //
  312. typedef union _MAC_DW0_STRUC {
  313. struct {
  314. UCHAR Byte0; // MAC address byte 0
  315. UCHAR Byte1; // MAC address byte 1
  316. UCHAR Byte2; // MAC address byte 2
  317. UCHAR Byte3; // MAC address byte 3
  318. } field;
  319. UINT32 word;
  320. } MAC_DW0_STRUC, *PMAC_DW0_STRUC;
  321. //
  322. // MAC_CSR3: STA MAC register 1
  323. //
  324. typedef union _MAC_DW1_STRUC {
  325. struct {
  326. UCHAR Byte4; // MAC address byte 4
  327. UCHAR Byte5; // MAC address byte 5
  328. UCHAR U2MeMask;
  329. UCHAR Rsvd1;
  330. } field;
  331. UINT32 word;
  332. } MAC_DW1_STRUC, *PMAC_DW1_STRUC;
  333. #define MAC_BSSID_DW0 0x1010 // MAC BSSID DW0
  334. #define MAC_BSSID_DW1 0x1014 // MAC BSSID DW1
  335. //
  336. // MAC_CSR5: BSSID register 1
  337. //
  338. typedef union _MAC_CSR5_STRUC {
  339. struct {
  340. UCHAR Byte4; // BSSID byte 4
  341. UCHAR Byte5; // BSSID byte 5
  342. USHORT BssIdMask:2; // 0: one BSSID, 10: 4 BSSID, 01: 2 BSSID , 11: 8BSSID
  343. USHORT MBssBcnNum:3;
  344. USHORT Rsvd:11;
  345. } field;
  346. UINT32 word;
  347. } MAC_CSR5_STRUC, *PMAC_CSR5_STRUC;
  348. #define MAX_LEN_CFG 0x1018 // rt2860b max 16k bytes. bit12:13 Maximum PSDU length (power factor) 0:2^13, 1:2^14, 2:2^15, 3:2^16
  349. #define BBP_CSR_CFG 0x101c //
  350. //
  351. // BBP_CSR_CFG: BBP serial control register
  352. //
  353. typedef union _BBP_CSR_CFG_STRUC {
  354. struct {
  355. UINT32 Value:8; // Register value to program into BBP
  356. UINT32 RegNum:8; // Selected BBP register
  357. UINT32 fRead:1; // 0: Write BBP, 1: Read BBP
  358. UINT32 Busy:1; // 1: ASIC is busy execute BBP programming.
  359. UINT32 BBP_PAR_DUR:1; // 0: 4 MAC clock cycles 1: 8 MAC clock cycles
  360. UINT32 BBP_RW_MODE:1; // 0: use serial mode 1:parallel
  361. UINT32 :12;
  362. } field;
  363. UINT32 word;
  364. } BBP_CSR_CFG_STRUC, *PBBP_CSR_CFG_STRUC;
  365. #define RF_CSR_CFG0 0x1020
  366. //
  367. // RF_CSR_CFG: RF control register
  368. //
  369. typedef union _RF_CSR_CFG0_STRUC {
  370. struct {
  371. UINT32 RegIdAndContent:24; // Register value to program into BBP
  372. UINT32 bitwidth:5; // Selected BBP register
  373. UINT32 StandbyMode:1; // 0: high when stand by 1: low when standby
  374. UINT32 Sel:1; // 0:RF_LE0 activate 1:RF_LE1 activate
  375. UINT32 Busy:1; // 0: idle 1: 8busy
  376. } field;
  377. UINT32 word;
  378. } RF_CSR_CFG0_STRUC, *PRF_CSR_CFG0_STRUC;
  379. #define RF_CSR_CFG1 0x1024
  380. typedef union _RF_CSR_CFG1_STRUC {
  381. struct {
  382. UINT32 RegIdAndContent:24; // Register value to program into BBP
  383. UINT32 RFGap:5; // Gap between BB_CONTROL_RF and RF_LE. 0: 3 system clock cycle (37.5usec) 1: 5 system clock cycle (62.5usec)
  384. UINT32 rsv:7; // 0: idle 1: 8busy
  385. } field;
  386. UINT32 word;
  387. } RF_CSR_CFG1_STRUC, *PRF_CSR_CFG1_STRUC;
  388. #define RF_CSR_CFG2 0x1028 //
  389. typedef union _RF_CSR_CFG2_STRUC {
  390. struct {
  391. UINT32 RegIdAndContent:24; // Register value to program into BBP
  392. UINT32 rsv:8; // 0: idle 1: 8busy
  393. } field;
  394. UINT32 word;
  395. } RF_CSR_CFG2_STRUC, *PRF_CSR_CFG2_STRUC;
  396. #define LED_CFG 0x102c // MAC_CSR14
  397. typedef union _LED_CFG_STRUC {
  398. struct {
  399. UINT32 OnPeriod:8; // blinking on period unit 1ms
  400. UINT32 OffPeriod:8; // blinking off period unit 1ms
  401. UINT32 SlowBlinkPeriod:6; // slow blinking period. unit:1ms
  402. UINT32 rsv:2;
  403. UINT32 RLedMode:2; // red Led Mode 0: off1: blinking upon TX2: periodic slow blinking3: always on
  404. UINT32 GLedMode:2; // green Led Mode
  405. UINT32 YLedMode:2; // yellow Led Mode
  406. UINT32 LedPolar:1; // Led Polarity. 0: active low1: active high
  407. UINT32 :1;
  408. } field;
  409. UINT32 word;
  410. } LED_CFG_STRUC, *PLED_CFG_STRUC;
  411. //
  412. // 4.2 MAC TIMING configuration registers (offset:0x1100)
  413. //
  414. #define XIFS_TIME_CFG 0x1100 // MAC_CSR8 MAC_CSR9
  415. typedef union _IFS_SLOT_CFG_STRUC {
  416. struct {
  417. UINT32 CckmSifsTime:8; // unit 1us. Applied after CCK RX/TX
  418. UINT32 OfdmSifsTime:8; // unit 1us. Applied after OFDM RX/TX
  419. UINT32 OfdmXifsTime:4; //OFDM SIFS. unit 1us. Applied after OFDM RX when MAC doesn't reference BBP signal BBRXEND
  420. UINT32 EIFS:9; // unit 1us
  421. UINT32 BBRxendEnable:1; // reference RXEND signal to begin XIFS defer
  422. UINT32 rsv:2;
  423. } field;
  424. UINT32 word;
  425. } IFS_SLOT_CFG_STRUC, *PIFS_SLOT_CFG_STRUC;
  426. #define BKOFF_SLOT_CFG 0x1104 // mac_csr9 last 8 bits
  427. #define NAV_TIME_CFG 0x1108 // NAV (MAC_CSR15)
  428. #define CH_TIME_CFG 0x110C // Count as channel busy
  429. #define PBF_LIFE_TIMER 0x1110 //TX/RX MPDU timestamp timer (free run)Unit: 1us
  430. #define BCN_TIME_CFG 0x1114 // TXRX_CSR9
  431. #define BCN_OFFSET0 0x042C
  432. #define BCN_OFFSET1 0x0430
  433. //
  434. // BCN_TIME_CFG : Synchronization control register
  435. //
  436. typedef union _BCN_TIME_CFG_STRUC {
  437. struct {
  438. UINT32 BeaconInterval:16; // in unit of 1/16 TU
  439. UINT32 bTsfTicking:1; // Enable TSF auto counting
  440. UINT32 TsfSyncMode:2; // Enable TSF sync, 00: disable, 01: infra mode, 10: ad-hoc mode
  441. UINT32 bTBTTEnable:1;
  442. UINT32 bBeaconGen:1; // Enable beacon generator
  443. UINT32 :3;
  444. UINT32 TxTimestampCompensate:8;
  445. } field;
  446. UINT32 word;
  447. } BCN_TIME_CFG_STRUC, *PBCN_TIME_CFG_STRUC;
  448. #define TBTT_SYNC_CFG 0x1118 // txrx_csr10
  449. #define TSF_TIMER_DW0 0x111C // Local TSF timer lsb 32 bits. Read-only
  450. #define TSF_TIMER_DW1 0x1120 // msb 32 bits. Read-only.
  451. #define TBTT_TIMER 0x1124 // TImer remains till next TBTT. Read-only. TXRX_CSR14
  452. #define INT_TIMER_CFG 0x1128 //
  453. #define INT_TIMER_EN 0x112c // GP-timer and pre-tbtt Int enable
  454. #define CH_IDLE_STA 0x1130 // channel idle time
  455. #define CH_BUSY_STA 0x1134 // channle busy time
  456. //
  457. // 4.2 MAC POWER configuration registers (offset:0x1200)
  458. //
  459. #define MAC_STATUS_CFG 0x1200 // old MAC_CSR12
  460. #define PWR_PIN_CFG 0x1204 // old MAC_CSR12
  461. #define AUTO_WAKEUP_CFG 0x1208 // old MAC_CSR10
  462. //
  463. // AUTO_WAKEUP_CFG: Manual power control / status register
  464. //
  465. typedef union _AUTO_WAKEUP_STRUC {
  466. struct {
  467. UINT32 AutoLeadTime:8;
  468. UINT32 NumofSleepingTbtt:7; // ForceWake has high privilege than PutToSleep when both set
  469. UINT32 EnableAutoWakeup:1; // 0:sleep, 1:awake
  470. UINT32 :16;
  471. } field;
  472. UINT32 word;
  473. } AUTO_WAKEUP_STRUC, *PAUTO_WAKEUP_STRUC;
  474. //
  475. // 4.3 MAC TX configuration registers (offset:0x1300)
  476. //
  477. #define EDCA_AC0_CFG 0x1300 //AC_TXOP_CSR0 0x3474
  478. #define EDCA_AC1_CFG 0x1304
  479. #define EDCA_AC2_CFG 0x1308
  480. #define EDCA_AC3_CFG 0x130c
  481. typedef union _EDCA_AC_CFG_STRUC {
  482. struct {
  483. UINT32 AcTxop:8; // in unit of 32us
  484. UINT32 Aifsn:4; // # of slot time
  485. UINT32 Cwmin:4; //
  486. UINT32 Cwmax:4; //unit power of 2
  487. UINT32 :12; //
  488. } field;
  489. UINT32 word;
  490. } EDCA_AC_CFG_STRUC, *PEDCA_AC_CFG_STRUC;
  491. #define EDCA_TID_AC_MAP 0x1310
  492. #define TX_PWR_CFG_0 0x1314
  493. #define TX_PWR_CFG_1 0x1318
  494. #define TX_PWR_CFG_2 0x131C
  495. #define TX_PWR_CFG_3 0x1320
  496. #define TX_PWR_CFG_4 0x1324
  497. #define TX_PIN_CFG 0x1328
  498. #define TX_BAND_CFG 0x132c // 0x1 use upper 20MHz. 0 juse lower 20MHz
  499. #define TX_SW_CFG0 0x1330
  500. #define TX_SW_CFG1 0x1334
  501. #define TX_SW_CFG2 0x1338
  502. #define TXOP_THRES_CFG 0x133c
  503. #define TXOP_CTRL_CFG 0x1340
  504. #define TX_RTS_CFG 0x1344
  505. typedef union _TX_RTS_CFG_STRUC {
  506. struct {
  507. UINT32 AutoRtsRetryLimit:8;
  508. UINT32 RtsThres:16; // unit:byte
  509. UINT32 RtsFbkEn:1; // enable rts rate fallback
  510. UINT32 rsv:7; // 1: HT non-STBC control frame enable
  511. } field;
  512. UINT32 word;
  513. } TX_RTS_CFG_STRUC, *PTX_RTS_CFG_STRUC;
  514. #define TX_TIMEOUT_CFG 0x1348
  515. typedef union _TX_TIMEOUT_CFG_STRUC {
  516. struct {
  517. UINT32 rsv:4;
  518. UINT32 MpduLifeTime:4; // expiration time = 2^(9+MPDU LIFE TIME) us
  519. UINT32 RxAckTimeout:8; // unit:slot. Used for TX precedure
  520. UINT32 TxopTimeout:8; //TXOP timeout value for TXOP truncation. It is recommended that (SLOT_TIME) > (TX_OP_TIMEOUT) > (RX_ACK_TIMEOUT)
  521. UINT32 rsv2:8; // 1: HT non-STBC control frame enable
  522. } field;
  523. UINT32 word;
  524. } TX_TIMEOUT_CFG_STRUC, *PTX_TIMEOUT_CFG_STRUC;
  525. #define TX_RTY_CFG 0x134c
  526. typedef union PACKED _TX_RTY_CFG_STRUC {
  527. struct {
  528. UINT32 ShortRtyLimit:8; // short retry limit
  529. UINT32 LongRtyLimit:8; //long retry limit
  530. UINT32 LongRtyThre:12; // Long retry threshoold
  531. UINT32 NonAggRtyMode:1; // Non-Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer
  532. UINT32 AggRtyMode:1; // Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer
  533. UINT32 TxautoFBEnable:1; // Tx retry PHY rate auto fallback enable
  534. UINT32 rsv:1; // 1: HT non-STBC control frame enable
  535. } field;
  536. UINT32 word;
  537. } TX_RTY_CFG_STRUC, *PTX_RTY_CFG_STRUC;
  538. #define TX_LINK_CFG 0x1350
  539. typedef union PACKED _TX_LINK_CFG_STRUC {
  540. struct PACKED {
  541. UINT32 RemoteMFBLifeTime:8; //remote MFB life time. unit : 32us
  542. UINT32 MFBEnable:1; // TX apply remote MFB 1:enable
  543. UINT32 RemoteUMFSEnable:1; // remote unsolicit MFB enable. 0: not apply remote remote unsolicit (MFS=7)
  544. UINT32 TxMRQEn:1; // MCS request TX enable
  545. UINT32 TxRDGEn:1; // RDG TX enable
  546. UINT32 TxCFAckEn:1; // Piggyback CF-ACK enable
  547. UINT32 rsv:3; //
  548. UINT32 RemotMFB:8; // remote MCS feedback
  549. UINT32 RemotMFS:8; //remote MCS feedback sequence number
  550. } field;
  551. UINT32 word;
  552. } TX_LINK_CFG_STRUC, *PTX_LINK_CFG_STRUC;
  553. #define HT_FBK_CFG0 0x1354
  554. typedef union PACKED _HT_FBK_CFG0_STRUC {
  555. struct {
  556. UINT32 HTMCS0FBK:4;
  557. UINT32 HTMCS1FBK:4;
  558. UINT32 HTMCS2FBK:4;
  559. UINT32 HTMCS3FBK:4;
  560. UINT32 HTMCS4FBK:4;
  561. UINT32 HTMCS5FBK:4;
  562. UINT32 HTMCS6FBK:4;
  563. UINT32 HTMCS7FBK:4;
  564. } field;
  565. UINT32 word;
  566. } HT_FBK_CFG0_STRUC, *PHT_FBK_CFG0_STRUC;
  567. #define HT_FBK_CFG1 0x1358
  568. typedef union _HT_FBK_CFG1_STRUC {
  569. struct {
  570. UINT32 HTMCS8FBK:4;
  571. UINT32 HTMCS9FBK:4;
  572. UINT32 HTMCS10FBK:4;
  573. UINT32 HTMCS11FBK:4;
  574. UINT32 HTMCS12FBK:4;
  575. UINT32 HTMCS13FBK:4;
  576. UINT32 HTMCS14FBK:4;
  577. UINT32 HTMCS15FBK:4;
  578. } field;
  579. UINT32 word;
  580. } HT_FBK_CFG1_STRUC, *PHT_FBK_CFG1_STRUC;
  581. #define LG_FBK_CFG0 0x135c
  582. typedef union _LG_FBK_CFG0_STRUC {
  583. struct {
  584. UINT32 OFDMMCS0FBK:4; //initial value is 0
  585. UINT32 OFDMMCS1FBK:4; //initial value is 0
  586. UINT32 OFDMMCS2FBK:4; //initial value is 1
  587. UINT32 OFDMMCS3FBK:4; //initial value is 2
  588. UINT32 OFDMMCS4FBK:4; //initial value is 3
  589. UINT32 OFDMMCS5FBK:4; //initial value is 4
  590. UINT32 OFDMMCS6FBK:4; //initial value is 5
  591. UINT32 OFDMMCS7FBK:4; //initial value is 6
  592. } field;
  593. UINT32 word;
  594. } LG_FBK_CFG0_STRUC, *PLG_FBK_CFG0_STRUC;
  595. #define LG_FBK_CFG1 0x1360
  596. typedef union _LG_FBK_CFG1_STRUC {
  597. struct {
  598. UINT32 CCKMCS0FBK:4; //initial value is 0
  599. UINT32 CCKMCS1FBK:4; //initial value is 0
  600. UINT32 CCKMCS2FBK:4; //initial value is 1
  601. UINT32 CCKMCS3FBK:4; //initial value is 2
  602. UINT32 rsv:16;
  603. } field;
  604. UINT32 word;
  605. } LG_FBK_CFG1_STRUC, *PLG_FBK_CFG1_STRUC;
  606. //=======================================================
  607. //================ Protection Paramater================================
  608. //=======================================================
  609. #define CCK_PROT_CFG 0x1364 //CCK Protection
  610. #define ASIC_SHORTNAV 1
  611. #define ASIC_LONGNAV 2
  612. #define ASIC_RTS 1
  613. #define ASIC_CTS 2
  614. typedef union _PROT_CFG_STRUC {
  615. struct {
  616. UINT32 ProtectRate:16; //Protection control frame rate for CCK TX(RTS/CTS/CFEnd).
  617. UINT32 ProtectCtrl:2; //Protection control frame type for CCK TX. 1:RTS/CTS, 2:CTS-to-self, 0:None, 3:rsv
  618. UINT32 ProtectNav:2; //TXOP protection type for CCK TX. 0:None, 1:ShortNAVprotect, 2:LongNAVProtect, 3:rsv
  619. UINT32 TxopAllowCck:1; //CCK TXOP allowance.0:disallow.
  620. UINT32 TxopAllowOfdm:1; //CCK TXOP allowance.0:disallow.
  621. UINT32 TxopAllowMM20:1; //CCK TXOP allowance. 0:disallow.
  622. UINT32 TxopAllowMM40:1; //CCK TXOP allowance.0:disallow.
  623. UINT32 TxopAllowGF20:1; //CCK TXOP allowance.0:disallow.
  624. UINT32 TxopAllowGF40:1; //CCK TXOP allowance.0:disallow.
  625. UINT32 RTSThEn:1; //RTS threshold enable on CCK TX
  626. UINT32 rsv:5;
  627. } field;
  628. UINT32 word;
  629. } PROT_CFG_STRUC, *PPROT_CFG_STRUC;
  630. #define OFDM_PROT_CFG 0x1368 //OFDM Protection
  631. #define MM20_PROT_CFG 0x136C //MM20 Protection
  632. #define MM40_PROT_CFG 0x1370 //MM40 Protection
  633. #define GF20_PROT_CFG 0x1374 //GF20 Protection
  634. #define GF40_PROT_CFG 0x1378 //GR40 Protection
  635. #define EXP_CTS_TIME 0x137C //
  636. #define EXP_ACK_TIME 0x1380 //
  637. //
  638. // 4.4 MAC RX configuration registers (offset:0x1400)
  639. //
  640. #define RX_FILTR_CFG 0x1400 //TXRX_CSR0
  641. #define AUTO_RSP_CFG 0x1404 //TXRX_CSR4
  642. //
  643. // TXRX_CSR4: Auto-Responder/
  644. //
  645. typedef union _AUTO_RSP_CFG_STRUC {
  646. struct {
  647. UINT32 AutoResponderEnable:1;
  648. UINT32 BACAckPolicyEnable:1; // 0:long, 1:short preamble
  649. UINT32 CTS40MMode:1; // Response CTS 40MHz duplicate mode
  650. UINT32 CTS40MRef:1; // Response CTS 40MHz duplicate mode
  651. UINT32 AutoResponderPreamble:1; // 0:long, 1:short preamble
  652. UINT32 rsv:1; // Power bit value in conrtrol frame
  653. UINT32 DualCTSEn:1; // Power bit value in conrtrol frame
  654. UINT32 AckCtsPsmBit:1; // Power bit value in conrtrol frame
  655. UINT32 :24;
  656. } field;
  657. UINT32 word;
  658. } AUTO_RSP_CFG_STRUC, *PAUTO_RSP_CFG_STRUC;
  659. #define LEGACY_BASIC_RATE 0x1408 // TXRX_CSR5 0x3054
  660. #define HT_BASIC_RATE 0x140c
  661. #define HT_CTRL_CFG 0x1410
  662. #define SIFS_COST_CFG 0x1414
  663. #define RX_PARSER_CFG 0x1418 //Set NAV for all received frames
  664. //
  665. // 4.5 MAC Security configuration (offset:0x1500)
  666. //
  667. #define TX_SEC_CNT0 0x1500 //
  668. #define RX_SEC_CNT0 0x1504 //
  669. #define CCMP_FC_MUTE 0x1508 //
  670. //
  671. // 4.6 HCCA/PSMP (offset:0x1600)
  672. //
  673. #define TXOP_HLDR_ADDR0 0x1600
  674. #define TXOP_HLDR_ADDR1 0x1604
  675. #define TXOP_HLDR_ET 0x1608
  676. #define QOS_CFPOLL_RA_DW0 0x160c
  677. #define QOS_CFPOLL_A1_DW1 0x1610
  678. #define QOS_CFPOLL_QC 0x1614
  679. //
  680. // 4.7 MAC Statistis registers (offset:0x1700)
  681. //
  682. #define RX_STA_CNT0 0x1700 //
  683. #define RX_STA_CNT1 0x1704 //
  684. #define RX_STA_CNT2 0x1708 //
  685. //
  686. // RX_STA_CNT0_STRUC: RX PLCP error count & RX CRC error count
  687. //
  688. typedef union _RX_STA_CNT0_STRUC {
  689. struct {
  690. USHORT CrcErr;
  691. USHORT PhyErr;
  692. } field;
  693. UINT32 word;
  694. } RX_STA_CNT0_STRUC, *PRX_STA_CNT0_STRUC;
  695. //
  696. // RX_STA_CNT1_STRUC: RX False CCA count & RX LONG frame count
  697. //
  698. typedef union _RX_STA_CNT1_STRUC {
  699. struct {
  700. USHORT FalseCca;
  701. USHORT PlcpErr;
  702. } field;
  703. UINT32 word;
  704. } RX_STA_CNT1_STRUC, *PRX_STA_CNT1_STRUC;
  705. //
  706. // RX_STA_CNT2_STRUC:
  707. //
  708. typedef union _RX_STA_CNT2_STRUC {
  709. struct {
  710. USHORT RxDupliCount;
  711. USHORT RxFifoOverflowCount;
  712. } field;
  713. UINT32 word;
  714. } RX_STA_CNT2_STRUC, *PRX_STA_CNT2_STRUC;
  715. #define TX_STA_CNT0 0x170C //
  716. //
  717. // STA_CSR3: TX Beacon count
  718. //
  719. typedef union _TX_STA_CNT0_STRUC {
  720. struct {
  721. USHORT TxFailCount;
  722. USHORT TxBeaconCount;
  723. } field;
  724. UINT32 word;
  725. } TX_STA_CNT0_STRUC, *PTX_STA_CNT0_STRUC;
  726. #define TX_STA_CNT1 0x1710 //
  727. //
  728. // TX_STA_CNT1: TX tx count
  729. //
  730. typedef union _TX_STA_CNT1_STRUC {
  731. struct {
  732. USHORT TxSuccess;
  733. USHORT TxRetransmit;
  734. } field;
  735. UINT32 word;
  736. } TX_STA_CNT1_STRUC, *PTX_STA_CNT1_STRUC;
  737. #define TX_STA_CNT2 0x1714 //
  738. //
  739. // TX_STA_CNT2: TX tx count
  740. //
  741. typedef union _TX_STA_CNT2_STRUC {
  742. struct {
  743. USHORT TxZeroLenCount;
  744. USHORT TxUnderFlowCount;
  745. } field;
  746. UINT32 word;
  747. } TX_STA_CNT2_STRUC, *PTX_STA_CNT2_STRUC;
  748. #define TX_STA_FIFO 0x1718 //
  749. //
  750. // TX_STA_FIFO_STRUC: TX Result for specific PID status fifo register
  751. //
  752. typedef union PACKED _TX_STA_FIFO_STRUC {
  753. struct {
  754. UINT32 bValid:1; // 1:This register contains a valid TX result
  755. UINT32 PidType:4;
  756. UINT32 TxSuccess:1; // Tx No retry success
  757. UINT32 TxAggre:1; // Tx Retry Success
  758. UINT32 TxAckRequired:1; // Tx fail
  759. UINT32 wcid:8; //wireless client index
  760. // UINT32 SuccessRate:16; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
  761. UINT32 SuccessRate:13; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
  762. UINT32 TxBF:1;
  763. UINT32 Reserve:2;
  764. } field;
  765. UINT32 word;
  766. } TX_STA_FIFO_STRUC, *PTX_STA_FIFO_STRUC;
  767. // Debug counter
  768. #define TX_AGG_CNT 0x171c
  769. typedef union _TX_AGG_CNT_STRUC {
  770. struct {
  771. USHORT NonAggTxCount;
  772. USHORT AggTxCount;
  773. } field;
  774. UINT32 word;
  775. } TX_AGG_CNT_STRUC, *PTX_AGG_CNT_STRUC;
  776. // Debug counter
  777. #define TX_AGG_CNT0 0x1720
  778. typedef union _TX_AGG_CNT0_STRUC {
  779. struct {
  780. USHORT AggSize1Count;
  781. USHORT AggSize2Count;
  782. } field;
  783. UINT32 word;
  784. } TX_AGG_CNT0_STRUC, *PTX_AGG_CNT0_STRUC;
  785. // Debug counter
  786. #define TX_AGG_CNT1 0x1724
  787. typedef union _TX_AGG_CNT1_STRUC {
  788. struct {
  789. USHORT AggSize3Count;
  790. USHORT AggSize4Count;
  791. } field;
  792. UINT32 word;
  793. } TX_AGG_CNT1_STRUC, *PTX_AGG_CNT1_STRUC;
  794. #define TX_AGG_CNT2 0x1728
  795. typedef union _TX_AGG_CNT2_STRUC {
  796. struct {
  797. USHORT AggSize5Count;
  798. USHORT AggSize6Count;
  799. } field;
  800. UINT32 word;
  801. } TX_AGG_CNT2_STRUC, *PTX_AGG_CNT2_STRUC;
  802. // Debug counter
  803. #define TX_AGG_CNT3 0x172c
  804. typedef union _TX_AGG_CNT3_STRUC {
  805. struct {
  806. USHORT AggSize7Count;
  807. USHORT AggSize8Count;
  808. } field;
  809. UINT32 word;
  810. } TX_AGG_CNT3_STRUC, *PTX_AGG_CNT3_STRUC;
  811. // Debug counter
  812. #define TX_AGG_CNT4 0x1730
  813. typedef union _TX_AGG_CNT4_STRUC {
  814. struct {
  815. USHORT AggSize9Count;
  816. USHORT AggSize10Count;
  817. } field;
  818. UINT32 word;
  819. } TX_AGG_CNT4_STRUC, *PTX_AGG_CNT4_STRUC;
  820. #define TX_AGG_CNT5 0x1734
  821. typedef union _TX_AGG_CNT5_STRUC {
  822. struct {
  823. USHORT AggSize11Count;
  824. USHORT AggSize12Count;
  825. } field;
  826. UINT32 word;
  827. } TX_AGG_CNT5_STRUC, *PTX_AGG_CNT5_STRUC;
  828. #define TX_AGG_CNT6 0x1738
  829. typedef union _TX_AGG_CNT6_STRUC {
  830. struct {
  831. USHORT AggSize13Count;
  832. USHORT AggSize14Count;
  833. } field;
  834. UINT32 word;
  835. } TX_AGG_CNT6_STRUC, *PTX_AGG_CNT6_STRUC;
  836. #define TX_AGG_CNT7 0x173c
  837. typedef union _TX_AGG_CNT7_STRUC {
  838. struct {
  839. USHORT AggSize15Count;
  840. USHORT AggSize16Count;
  841. } field;
  842. UINT32 word;
  843. } TX_AGG_CNT7_STRUC, *PTX_AGG_CNT7_STRUC;
  844. #define MPDU_DENSITY_CNT 0x1740
  845. typedef union _MPDU_DEN_CNT_STRUC {
  846. struct {
  847. USHORT TXZeroDelCount; //TX zero length delimiter count
  848. USHORT RXZeroDelCount; //RX zero length delimiter count
  849. } field;
  850. UINT32 word;
  851. } MPDU_DEN_CNT_STRUC, *PMPDU_DEN_CNT_STRUC;
  852. //
  853. // TXRX control registers - base address 0x3000
  854. //
  855. // rt2860b UNKNOWN reg use R/O Reg Addr 0x77d0 first..
  856. #define TXRX_CSR1 0x77d0
  857. //
  858. // Security key table memory, base address = 0x1000
  859. //
  860. #define MAC_WCID_BASE 0x1800 //8-bytes(use only 6-bytes) * 256 entry =
  861. #define HW_WCID_ENTRY_SIZE 8
  862. #define PAIRWISE_KEY_TABLE_BASE 0x4000 // 32-byte * 256-entry = -byte
  863. #define HW_KEY_ENTRY_SIZE 0x20
  864. #define PAIRWISE_IVEIV_TABLE_BASE 0x6000 // 8-byte * 256-entry = -byte
  865. #define MAC_IVEIV_TABLE_BASE 0x6000 // 8-byte * 256-entry = -byte
  866. #define HW_IVEIV_ENTRY_SIZE 8
  867. #define MAC_WCID_ATTRIBUTE_BASE 0x6800 // 4-byte * 256-entry = -byte
  868. #define HW_WCID_ATTRI_SIZE 4
  869. #define WCID_RESERVED 0x6bfc
  870. #define SHARED_KEY_TABLE_BASE 0x6c00 // 32-byte * 16-entry = 512-byte
  871. #define SHARED_KEY_MODE_BASE 0x7000 // 32-byte * 16-entry = 512-byte
  872. #define HW_SHARED_KEY_MODE_SIZE 4
  873. #define SHAREDKEYTABLE 0
  874. #define PAIRWISEKEYTABLE 1
  875. typedef union _SHAREDKEY_MODE_STRUC {
  876. struct {
  877. UINT32 Bss0Key0CipherAlg:3;
  878. UINT32 :1;
  879. UINT32 Bss0Key1CipherAlg:3;
  880. UINT32 :1;
  881. UINT32 Bss0Key2CipherAlg:3;
  882. UINT32 :1;
  883. UINT32 Bss0Key3CipherAlg:3;
  884. UINT32 :1;
  885. UINT32 Bss1Key0CipherAlg:3;
  886. UINT32 :1;
  887. UINT32 Bss1Key1CipherAlg:3;
  888. UINT32 :1;
  889. UINT32 Bss1Key2CipherAlg:3;
  890. UINT32 :1;
  891. UINT32 Bss1Key3CipherAlg:3;
  892. UINT32 :1;
  893. } field;
  894. UINT32 word;
  895. } SHAREDKEY_MODE_STRUC, *PSHAREDKEY_MODE_STRUC;
  896. // 64-entry for pairwise key table
  897. typedef struct _HW_WCID_ENTRY { // 8-byte per entry
  898. UCHAR Address[6];
  899. UCHAR Rsv[2];
  900. } HW_WCID_ENTRY, PHW_WCID_ENTRY;
  901. //
  902. // Other on-chip shared memory space, base = 0x2000
  903. //
  904. // CIS space - base address = 0x2000
  905. #define HW_CIS_BASE 0x2000
  906. // Carrier-sense CTS frame base address. It's where mac stores carrier-sense frame for carrier-sense function.
  907. #define HW_CS_CTS_BASE 0x7700
  908. // DFS CTS frame base address. It's where mac stores CTS frame for DFS.
  909. #define HW_DFS_CTS_BASE 0x7780
  910. #define HW_CTS_FRAME_SIZE 0x80
  911. // 2004-11-08 john - since NULL frame won't be that long (256 byte). We steal 16 tail bytes
  912. // to save debugging settings
  913. #define HW_DEBUG_SETTING_BASE 0x77f0 // 0x77f0~0x77ff total 16 bytes
  914. #define HW_DEBUG_SETTING_BASE2 0x7770 // 0x77f0~0x77ff total 16 bytes
  915. // In order to support maximum 8 MBSS and its maximum length is 512 for each beacon
  916. // Three section discontinue memory segments will be used.
  917. // 1. The original region for BCN 0~3
  918. // 2. Extract memory from FCE table for BCN 4~5
  919. // 3. Extract memory from Pair-wise key table for BCN 6~7
  920. // It occupied those memory of wcid 238~253 for BCN 6
  921. // and wcid 222~237 for BCN 7
  922. #define HW_BEACON_MAX_SIZE 0x1000 /* unit: byte */
  923. #define HW_BEACON_BASE0 0x7800
  924. #define HW_BEACON_BASE1 0x7A00
  925. #define HW_BEACON_BASE2 0x7C00
  926. #define HW_BEACON_BASE3 0x7E00
  927. #define HW_BEACON_BASE4 0x7200
  928. #define HW_BEACON_BASE5 0x7400
  929. #define HW_BEACON_BASE6 0x5DC0
  930. #define HW_BEACON_BASE7 0x5BC0
  931. #define HW_BEACON_MAX_COUNT 8
  932. #define HW_BEACON_OFFSET 0x0200
  933. #define HW_BEACON_CONTENT_LEN (HW_BEACON_OFFSET - TXWI_SIZE)
  934. // HOST-MCU shared memory - base address = 0x2100
  935. #define HOST_CMD_CSR 0x404
  936. #define H2M_MAILBOX_CSR 0x7010
  937. #define H2M_MAILBOX_CID 0x7014
  938. #define H2M_MAILBOX_STATUS 0x701c
  939. #define H2M_INT_SRC 0x7024
  940. #define H2M_BBP_AGENT 0x7028
  941. #define M2H_CMD_DONE_CSR 0x000c
  942. #define MCU_TXOP_ARRAY_BASE 0x000c // TODO: to be provided by Albert
  943. #define MCU_TXOP_ENTRY_SIZE 32 // TODO: to be provided by Albert
  944. #define MAX_NUM_OF_TXOP_ENTRY 16 // TODO: must be same with 8051 firmware
  945. #define MCU_MBOX_VERSION 0x01 // TODO: to be confirmed by Albert
  946. #define MCU_MBOX_VERSION_OFFSET 5 // TODO: to be provided by Albert
  947. //
  948. // Host DMA registers - base address 0x200 . TX0-3=EDCAQid0-3, TX4=HCCA, TX5=MGMT,
  949. //
  950. //
  951. // DMA RING DESCRIPTOR
  952. //
  953. #define E2PROM_CSR 0x0004
  954. #define IO_CNTL_CSR 0x77d0
  955. #ifdef RT2860
  956. // 8051 firmware image for RT2860 - base address = 0x4000
  957. #define FIRMWARE_IMAGE_BASE 0x2000
  958. #define MAX_FIRMWARE_IMAGE_SIZE 0x2000 // 8kbyte
  959. #endif
  960. #ifdef RT2870
  961. // 8051 firmware image for usb - use last-half base address = 0x3000
  962. #define FIRMWARE_IMAGE_BASE 0x3000
  963. #define MAX_FIRMWARE_IMAGE_SIZE 0x1000 // 4kbyte
  964. #endif // RT2870 //
  965. // ================================================================
  966. // Tx / Rx / Mgmt ring descriptor definition
  967. // ================================================================
  968. // the following PID values are used to mark outgoing frame type in TXD->PID so that
  969. // proper TX statistics can be collected based on these categories
  970. // b3-2 of PID field -
  971. #define PID_MGMT 0x05
  972. #define PID_BEACON 0x0c
  973. #define PID_DATA_NORMALUCAST 0x02
  974. #define PID_DATA_AMPDU 0x04
  975. #define PID_DATA_NO_ACK 0x08
  976. #define PID_DATA_NOT_NORM_ACK 0x03
  977. // value domain of pTxD->HostQId (4-bit: 0~15)
  978. #define QID_AC_BK 1 // meet ACI definition in 802.11e
  979. #define QID_AC_BE 0 // meet ACI definition in 802.11e
  980. #define QID_AC_VI 2
  981. #define QID_AC_VO 3
  982. #define QID_HCCA 4
  983. #define NUM_OF_TX_RING 5
  984. #define QID_MGMT 13
  985. #define QID_RX 14
  986. #define QID_OTHER 15
  987. // ------------------------------------------------------
  988. // BBP & RF definition
  989. // ------------------------------------------------------
  990. #define BUSY 1
  991. #define IDLE 0
  992. #define RF_R00 0
  993. #define RF_R01 1
  994. #define RF_R02 2
  995. #define RF_R03 3
  996. #define RF_R04 4
  997. #define RF_R05 5
  998. #define RF_R06 6
  999. #define RF_R07 7
  1000. #define RF_R08 8
  1001. #define RF_R09 9
  1002. #define RF_R10 10
  1003. #define RF_R11 11
  1004. #define RF_R12 12
  1005. #define RF_R13 13
  1006. #define RF_R14 14
  1007. #define RF_R15 15
  1008. #define RF_R16 16
  1009. #define RF_R17 17
  1010. #define RF_R18 18
  1011. #define RF_R19 19
  1012. #define RF_R20 20
  1013. #define RF_R21 21
  1014. #define RF_R22 22
  1015. #define RF_R23 23
  1016. #define RF_R24 24
  1017. #define RF_R25 25
  1018. #define RF_R26 26
  1019. #define RF_R27 27
  1020. #define RF_R28 28
  1021. #define RF_R29 29
  1022. #define RF_R30 30
  1023. #define RF_R31 31
  1024. #define BBP_R0 0 // version
  1025. #define BBP_R1 1 // TSSI
  1026. #define BBP_R2 2 // TX configure
  1027. #define BBP_R3 3
  1028. #define BBP_R4 4
  1029. #define BBP_R5 5
  1030. #define BBP_R6 6
  1031. #define BBP_R14 14 // RX configure
  1032. #define BBP_R16 16
  1033. #define BBP_R17 17 // RX sensibility
  1034. #define BBP_R18 18
  1035. #define BBP_R21 21
  1036. #define BBP_R22 22
  1037. #define BBP_R24 24
  1038. #define BBP_R25 25
  1039. #define BBP_R31 31
  1040. #define BBP_R49 49 //TSSI
  1041. #define BBP_R50 50
  1042. #define BBP_R51 51
  1043. #define BBP_R52 52
  1044. #define BBP_R55 55
  1045. #define BBP_R62 62 // Rx SQ0 Threshold HIGH
  1046. #define BBP_R63 63
  1047. #define BBP_R64 64
  1048. #define BBP_R65 65
  1049. #define BBP_R66 66
  1050. #define BBP_R67 67
  1051. #define BBP_R68 68
  1052. #define BBP_R69 69
  1053. #define BBP_R70 70 // Rx AGC SQ CCK Xcorr threshold
  1054. #define BBP_R73 73
  1055. #define BBP_R75 75
  1056. #define BBP_R77 77
  1057. #define BBP_R79 79
  1058. #define BBP_R80 80
  1059. #define BBP_R81 81
  1060. #define BBP_R82 82
  1061. #define BBP_R83 83
  1062. #define BBP_R84 84
  1063. #define BBP_R86 86
  1064. #define BBP_R91 91
  1065. #define BBP_R92 92
  1066. #define BBP_R94 94 // Tx Gain Control
  1067. #define BBP_R103 103
  1068. #define BBP_R105 105
  1069. #define BBP_R113 113
  1070. #define BBP_R114 114
  1071. #define BBP_R115 115
  1072. #define BBP_R116 116
  1073. #define BBP_R117 117
  1074. #define BBP_R118 118
  1075. #define BBP_R119 119
  1076. #define BBP_R120 120
  1077. #define BBP_R121 121
  1078. #define BBP_R122 122
  1079. #define BBP_R123 123
  1080. #define BBP_R138 138 // add by johnli, RF power sequence setup, ADC dynamic on/off control
  1081. #define BBPR94_DEFAULT 0x06 // Add 1 value will gain 1db
  1082. #define RSSI_FOR_VERY_LOW_SENSIBILITY -35
  1083. #define RSSI_FOR_LOW_SENSIBILITY -58
  1084. #define RSSI_FOR_MID_LOW_SENSIBILITY -80
  1085. #define RSSI_FOR_MID_SENSIBILITY -90
  1086. //-------------------------------------------------------------------------
  1087. // EEPROM definition
  1088. //-------------------------------------------------------------------------
  1089. #define EEDO 0x08
  1090. #define EEDI 0x04
  1091. #define EECS 0x02
  1092. #define EESK 0x01
  1093. #define EERL 0x80
  1094. #define EEPROM_WRITE_OPCODE 0x05
  1095. #define EEPROM_READ_OPCODE 0x06
  1096. #define EEPROM_EWDS_OPCODE 0x10
  1097. #define EEPROM_EWEN_OPCODE 0x13
  1098. #define NUM_EEPROM_BBP_PARMS 19 // Include NIC Config 0, 1, CR, TX ALC step, BBPs
  1099. #define NUM_EEPROM_TX_G_PARMS 7
  1100. #define EEPROM_NIC1_OFFSET 0x34 // The address is from NIC config 0, not BBP register ID
  1101. #define EEPROM_NIC2_OFFSET 0x36 // The address is from NIC config 0, not BBP register ID
  1102. #define EEPROM_BBP_BASE_OFFSET 0xf0 // The address is from NIC config 0, not BBP register ID
  1103. #define EEPROM_G_TX_PWR_OFFSET 0x52
  1104. #define EEPROM_G_TX2_PWR_OFFSET 0x60
  1105. #define EEPROM_LED1_OFFSET 0x3c
  1106. #define EEPROM_LED2_OFFSET 0x3e
  1107. #define EEPROM_LED3_OFFSET 0x40
  1108. #define EEPROM_LNA_OFFSET 0x44
  1109. #define EEPROM_RSSI_BG_OFFSET 0x46
  1110. #define EEPROM_RSSI_A_OFFSET 0x4a
  1111. #define EEPROM_DEFINE_MAX_TXPWR 0x4e
  1112. #define EEPROM_TXPOWER_BYRATE_20MHZ_2_4G 0xde // 20MHZ 2.4G tx power.
  1113. #define EEPROM_TXPOWER_BYRATE_40MHZ_2_4G 0xee // 40MHZ 2.4G tx power.
  1114. #define EEPROM_TXPOWER_BYRATE_20MHZ_5G 0xfa // 20MHZ 5G tx power.
  1115. #define EEPROM_TXPOWER_BYRATE_40MHZ_5G 0x10a // 40MHZ 5G tx power.
  1116. #define EEPROM_A_TX_PWR_OFFSET 0x78
  1117. #define EEPROM_A_TX2_PWR_OFFSET 0xa6
  1118. #define EEPROM_VERSION_OFFSET 0x02
  1119. #define EEPROM_FREQ_OFFSET 0x3a
  1120. #define EEPROM_TXPOWER_BYRATE 0xde // 20MHZ power.
  1121. #define EEPROM_TXPOWER_DELTA 0x50 // 20MHZ AND 40 MHZ use different power. This is delta in 40MHZ.
  1122. #define VALID_EEPROM_VERSION 1
  1123. // PairKeyMode definition
  1124. #define PKMODE_NONE 0
  1125. #define PKMODE_WEP64 1
  1126. #define PKMODE_WEP128 2
  1127. #define PKMODE_TKIP 3
  1128. #define PKMODE_AES 4
  1129. #define PKMODE_CKIP64 5
  1130. #define PKMODE_CKIP128 6
  1131. #define PKMODE_TKIP_NO_MIC 7 // MIC appended by driver: not a valid value in hardware key table
  1132. // =================================================================================
  1133. // WCID format
  1134. // =================================================================================
  1135. //7.1 WCID ENTRY format : 8bytes
  1136. typedef struct _WCID_ENTRY_STRUC {
  1137. UCHAR RXBABitmap7; // bit0 for TID8, bit7 for TID 15
  1138. UCHAR RXBABitmap0; // bit0 for TID0, bit7 for TID 7
  1139. UCHAR MAC[6]; // 0 for shared key table. 1 for pairwise key table
  1140. } WCID_ENTRY_STRUC, *PWCID_ENTRY_STRUC;
  1141. //8.1.1 SECURITY KEY format : 8DW
  1142. // 32-byte per entry, total 16-entry for shared key table, 64-entry for pairwise key table
  1143. typedef struct _HW_KEY_ENTRY { // 32-byte per entry
  1144. UCHAR Key[16];
  1145. UCHAR TxMic[8];
  1146. UCHAR RxMic[8];
  1147. } HW_KEY_ENTRY, *PHW_KEY_ENTRY;
  1148. //8.1.2 IV/EIV format : 2DW
  1149. //8.1.3 RX attribute entry format : 1DW
  1150. typedef struct _MAC_ATTRIBUTE_STRUC {
  1151. UINT32 KeyTab:1; // 0 for shared key table. 1 for pairwise key table
  1152. UINT32 PairKeyMode:3;
  1153. UINT32 BSSIDIdx:3; //multipleBSS index for the WCID
  1154. UINT32 RXWIUDF:3;
  1155. UINT32 rsv:22;
  1156. } MAC_ATTRIBUTE_STRUC, *PMAC_ATTRIBUTE_STRUC;
  1157. // =================================================================================
  1158. // TX / RX ring descriptor format
  1159. // =================================================================================
  1160. // the first 24-byte in TXD is called TXINFO and will be DMAed to MAC block through TXFIFO.
  1161. // MAC block use this TXINFO to control the transmission behavior of this frame.
  1162. #define FIFO_MGMT 0
  1163. #define FIFO_HCCA 1
  1164. #define FIFO_EDCA 2
  1165. //
  1166. // TX descriptor format, Tx ring, Mgmt Ring
  1167. //
  1168. typedef struct PACKED _TXD_STRUC {
  1169. // Word 0
  1170. UINT32 SDPtr0;
  1171. // Word 1
  1172. UINT32 SDLen1:14;
  1173. UINT32 LastSec1:1;
  1174. UINT32 Burst:1;
  1175. UINT32 SDLen0:14;
  1176. UINT32 LastSec0:1;
  1177. UINT32 DMADONE:1;
  1178. //Word2
  1179. UINT32 SDPtr1;
  1180. //Word3
  1181. UINT32 rsv2:24;
  1182. UINT32 WIV:1; // Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition
  1183. UINT32 QSEL:2; // select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA
  1184. UINT32 rsv:2;
  1185. UINT32 TCO:1; //
  1186. UINT32 UCO:1; //
  1187. UINT32 ICO:1; //
  1188. } TXD_STRUC, *PTXD_STRUC;
  1189. //
  1190. // TXD Wireless Information format for Tx ring and Mgmt Ring
  1191. //
  1192. //txop : for txop mode
  1193. // 0:txop for the MPDU frame will be handles by ASIC by register
  1194. // 1/2/3:the MPDU frame is send after PIFS/backoff/SIFS
  1195. typedef struct PACKED _TXWI_STRUC {
  1196. // Word 0
  1197. UINT32 FRAG:1; // 1 to inform TKIP engine this is a fragment.
  1198. UINT32 MIMOps:1; // the remote peer is in dynamic MIMO-PS mode
  1199. UINT32 CFACK:1;
  1200. UINT32 TS:1;
  1201. UINT32 AMPDU:1;
  1202. UINT32 MpduDensity:3;
  1203. UINT32 txop:2; //FOR "THIS" frame. 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs only when previous frame exchange is successful.
  1204. UINT32 rsv:6;
  1205. UINT32 MCS:7;
  1206. UINT32 BW:1; //channel bandwidth 20MHz or 40 MHz
  1207. UINT32 ShortGI:1;
  1208. UINT32 STBC:2; // 1: STBC support MCS =0-7, 2,3 : RESERVE
  1209. UINT32 Ifs:1; //
  1210. UINT32 rsv2:1;
  1211. UINT32 TxBF:1; // 3*3
  1212. UINT32 PHYMODE:2;
  1213. // Word 1
  1214. UINT32 ACK:1;
  1215. UINT32 NSEQ:1;
  1216. UINT32 BAWinSize:6;
  1217. UINT32 WirelessCliID:8;
  1218. UINT32 MPDUtotalByteCount:12;
  1219. UINT32 PacketId:4;
  1220. //Word2
  1221. UINT32 IV;
  1222. //Word3
  1223. UINT32 EIV;
  1224. } TXWI_STRUC, *PTXWI_STRUC;
  1225. //
  1226. // Rx descriptor format, Rx Ring
  1227. //
  1228. #ifdef RT2860
  1229. typedef struct PACKED _RXD_STRUC {
  1230. // Word 0
  1231. UINT32 SDP0;
  1232. // Word 1
  1233. UINT32 SDL1:14;
  1234. UINT32 Rsv:2;
  1235. UINT32 SDL0:14;
  1236. UINT32 LS0:1;
  1237. UINT32 DDONE:1;
  1238. // Word 2
  1239. UINT32 SDP1;
  1240. // Word 3
  1241. UINT32 BA:1;
  1242. UINT32 DATA:1;
  1243. UINT32 NULLDATA:1;
  1244. UINT32 FRAG:1;
  1245. UINT32 U2M:1; // 1: this RX frame is unicast to me
  1246. UINT32 Mcast:1; // 1: this is a multicast frame
  1247. UINT32 Bcast:1; // 1: this is a broadcast frame
  1248. UINT32 MyBss:1; // 1: this frame belongs to the same BSSID
  1249. UINT32 Crc:1; // 1: CRC error
  1250. UINT32 CipherErr:2; // 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid
  1251. UINT32 AMSDU:1; // rx with 802.3 header, not 802.11 header.
  1252. UINT32 HTC:1;
  1253. UINT32 RSSI:1;
  1254. UINT32 L2PAD:1;
  1255. UINT32 AMPDU:1;
  1256. UINT32 Decrypted:1; // this frame is being decrypted.
  1257. UINT32 PlcpSignal:1; // To be moved
  1258. UINT32 PlcpRssil:1;// To be moved
  1259. UINT32 Rsv1:13;
  1260. } RXD_STRUC, *PRXD_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
  1261. #endif /* RT2860 */
  1262. //
  1263. // RXWI wireless information format, in PBF. invisible in driver.
  1264. //
  1265. typedef struct PACKED _RXWI_STRUC {
  1266. // Word 0
  1267. UINT32 WirelessCliID:8;
  1268. UINT32 KeyIndex:2;
  1269. UINT32 BSSID:3;
  1270. UINT32 UDF:3;
  1271. UINT32 MPDUtotalByteCount:12;
  1272. UINT32 TID:4;
  1273. // Word 1
  1274. UINT32 FRAG:4;
  1275. UINT32 SEQUENCE:12;
  1276. UINT32 MCS:7;
  1277. UINT32 BW:1;
  1278. UINT32 ShortGI:1;
  1279. UINT32 STBC:2;
  1280. UINT32 rsv:3;
  1281. UINT32 PHYMODE:2; // 1: this RX frame is unicast to me
  1282. //Word2
  1283. UINT32 RSSI0:8;
  1284. UINT32 RSSI1:8;
  1285. UINT32 RSSI2:8;
  1286. UINT32 rsv1:8;
  1287. //Word3
  1288. UINT32 SNR0:8;
  1289. UINT32 SNR1:8;
  1290. UINT32 rsv2:16;
  1291. } RXWI_STRUC, *PRXWI_STRUC;
  1292. // =================================================================================
  1293. // HOST-MCU communication data structure
  1294. // =================================================================================
  1295. //
  1296. // H2M_MAILBOX_CSR: Host-to-MCU Mailbox
  1297. //
  1298. typedef union _H2M_MAILBOX_STRUC {
  1299. struct {
  1300. UINT32 LowByte:8;
  1301. UINT32 HighByte:8;
  1302. UINT32 CmdToken:8;
  1303. UINT32 Owner:8;
  1304. } field;
  1305. UINT32 word;
  1306. } H2M_MAILBOX_STRUC, *PH2M_MAILBOX_STRUC;
  1307. //
  1308. // M2H_CMD_DONE_CSR: MCU-to-Host command complete indication
  1309. //
  1310. typedef union _M2H_CMD_DONE_STRUC {
  1311. struct {
  1312. UINT32 CmdToken0;
  1313. UINT32 CmdToken1;
  1314. UINT32 CmdToken2;
  1315. UINT32 CmdToken3;
  1316. } field;
  1317. UINT32 word;
  1318. } M2H_CMD_DONE_STRUC, *PM2H_CMD_DONE_STRUC;
  1319. //
  1320. // MCU_LEDCS: MCU LED Control Setting.
  1321. //
  1322. typedef union _MCU_LEDCS_STRUC {
  1323. struct {
  1324. UCHAR LedMode:7;
  1325. UCHAR Polarity:1;
  1326. } field;
  1327. UCHAR word;
  1328. } MCU_LEDCS_STRUC, *PMCU_LEDCS_STRUC;
  1329. // =================================================================================
  1330. // Register format
  1331. // =================================================================================
  1332. //NAV_TIME_CFG :NAV
  1333. typedef union _NAV_TIME_CFG_STRUC {
  1334. struct {
  1335. UCHAR Sifs; // in unit of 1-us
  1336. UCHAR SlotTime; // in unit of 1-us
  1337. USHORT Eifs:9; // in unit of 1-us
  1338. USHORT ZeroSifs:1; // Applied zero SIFS timer after OFDM RX 0: disable
  1339. USHORT rsv:6;
  1340. } field;
  1341. UINT32 word;
  1342. } NAV_TIME_CFG_STRUC, *PNAV_TIME_CFG_STRUC;
  1343. //
  1344. // RX_FILTR_CFG: /RX configuration register
  1345. //
  1346. typedef union _RX_FILTR_CFG_STRUC {
  1347. struct {
  1348. UINT32 DropCRCErr:1; // Drop CRC error
  1349. UINT32 DropPhyErr:1; // Drop physical error
  1350. UINT32 DropNotToMe:1; // Drop not to me unicast frame
  1351. UINT32 DropNotMyBSSID:1; // Drop fram ToDs bit is true
  1352. UINT32 DropVerErr:1; // Drop version error frame
  1353. UINT32 DropMcast:1; // Drop multicast frames
  1354. UINT32 DropBcast:1; // Drop broadcast frames
  1355. UINT32 DropDuplicate:1; // Drop duplicate frame
  1356. UINT32 DropCFEndAck:1; // Drop Ps-Poll
  1357. UINT32 DropCFEnd:1; // Drop Ps-Poll
  1358. UINT32 DropAck:1; // Drop Ps-Poll
  1359. UINT32 DropCts:1; // Drop Ps-Poll
  1360. UINT32 DropRts:1; // Drop Ps-Poll
  1361. UINT32 DropPsPoll:1; // Drop Ps-Poll
  1362. UINT32 DropBA:1; //
  1363. UINT32 DropBAR:1; //
  1364. UINT32 DropRsvCntlType:1;
  1365. UINT32 :15;
  1366. } field;
  1367. UINT32 word;
  1368. } RX_FILTR_CFG_STRUC, *PRX_FILTR_CFG_STRUC;
  1369. //
  1370. // PHY_CSR4: RF serial control register
  1371. //
  1372. typedef union _PHY_CSR4_STRUC {
  1373. struct {
  1374. UINT32 RFRegValue:24; // Register value (include register id) serial out to RF/IF chip.
  1375. UINT32 NumberOfBits:5; // Number of bits used in RFRegValue (I:20, RFMD:22)
  1376. UINT32 IFSelect:1; // 1: select IF to program, 0: select RF to program
  1377. UINT32 PLL_LD:1; // RF PLL_LD status
  1378. UINT32 Busy:1; // 1: ASIC is busy execute RF programming.
  1379. } field;
  1380. UINT32 word;
  1381. } PHY_CSR4_STRUC, *PPHY_CSR4_STRUC;
  1382. //
  1383. // SEC_CSR5: shared key table security mode register
  1384. //
  1385. typedef union _SEC_CSR5_STRUC {
  1386. struct {
  1387. UINT32 Bss2Key0CipherAlg:3;
  1388. UINT32 :1;
  1389. UINT32 Bss2Key1CipherAlg:3;
  1390. UINT32 :1;
  1391. UINT32 Bss2Key2CipherAlg:3;
  1392. UINT32 :1;
  1393. UINT32 Bss2Key3CipherAlg:3;
  1394. UINT32 :1;
  1395. UINT32 Bss3Key0CipherAlg:3;
  1396. UINT32 :1;
  1397. UINT32 Bss3Key1CipherAlg:3;
  1398. UINT32 :1;
  1399. UINT32 Bss3Key2CipherAlg:3;
  1400. UINT32 :1;
  1401. UINT32 Bss3Key3CipherAlg:3;
  1402. UINT32 :1;
  1403. } field;
  1404. UINT32 word;
  1405. } SEC_CSR5_STRUC, *PSEC_CSR5_STRUC;
  1406. //
  1407. // HOST_CMD_CSR: For HOST to interrupt embedded processor
  1408. //
  1409. typedef union _HOST_CMD_CSR_STRUC {
  1410. struct {
  1411. UINT32 HostCommand:8;
  1412. UINT32 Rsv:24;
  1413. } field;
  1414. UINT32 word;
  1415. } HOST_CMD_CSR_STRUC, *PHOST_CMD_CSR_STRUC;
  1416. //
  1417. // AIFSN_CSR: AIFSN for each EDCA AC
  1418. //
  1419. //
  1420. // E2PROM_CSR: EEPROM control register
  1421. //
  1422. typedef union _E2PROM_CSR_STRUC {
  1423. struct {
  1424. UINT32 Reload:1; // Reload EEPROM content, write one to reload, self-cleared.
  1425. UINT32 EepromSK:1;
  1426. UINT32 EepromCS:1;
  1427. UINT32 EepromDI:1;
  1428. UINT32 EepromDO:1;
  1429. UINT32 Type:1; // 1: 93C46, 0:93C66
  1430. UINT32 LoadStatus:1; // 1:loading, 0:done
  1431. UINT32 Rsvd:25;
  1432. } field;
  1433. UINT32 word;
  1434. } E2PROM_CSR_STRUC, *PE2PROM_CSR_STRUC;
  1435. // -------------------------------------------------------------------
  1436. // E2PROM data layout
  1437. // -------------------------------------------------------------------
  1438. //
  1439. // EEPROM antenna select…