2 *************************************************************************
4 * 5F., No.36, Taiyuan St., Jhubei City,
8 * (c) Copyright 2002-2007, Ralink Technology, Inc.
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. *
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. *
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. *
25 *************************************************************************
31 RT28xx ASIC related definition & structures
35 -------- ---------- ----------------------------------------------
36 Jan Lee Jan-3-2006 created for RT2860c
44 // PCI registers - base address 0x0000
46 #define PCI_CFG 0x0000
47 #define PCI_EECTRL 0x0004
48 #define PCI_MCUCTRL 0x0008
53 #define RETRY_LIMIT 10
54 #define STATUS_SUCCESS 0x00
55 #define STATUS_UNSUCCESSFUL 0x01
58 // SCH/DMA registers - base address 0x0200
60 // INT_SOURCE_CSR: Interrupt source register. Write one to clear corresponding bit
62 #define DMA_CSR0 0x200
63 #define INT_SOURCE_CSR 0x200
64 typedef union _INT_SOURCE_CSR_STRUC {
69 UINT32 Ac0DmaDone:1;//4
73 UINT32 HccaDmaDone:1; // bit7
75 UINT32 MCUCommandINT:1;//bit 9
76 UINT32 RxTxCoherent:1;
79 UINT32 TXFifoStatusInt:1;//FIFO Statistics is full, sw should read 0x171c
80 UINT32 AutoWakeup:1;//bit14
82 UINT32 RxCoherent:1;//bit16
87 } INT_SOURCE_CSR_STRUC, *PINT_SOURCE_CSR_STRUC;
90 // INT_MASK_CSR: Interrupt MASK register. 1: the interrupt is mask OFF
92 #define INT_MASK_CSR 0x204
93 typedef union _INT_MASK_CSR_STRUC {
95 UINT32 RXDelay_INT_MSK:1;
102 UINT32 HccaDmaDone:1;
103 UINT32 MgmtDmaDone:1;
104 UINT32 MCUCommandINT:1;
110 } INT_MASK_CSR_STRUC, *PINT_MASK_CSR_STRUC;
112 #define WPDMA_GLO_CFG 0x208
113 typedef union _WPDMA_GLO_CFG_STRUC {
115 UINT32 EnableTxDMA:1;
117 UINT32 EnableRxDMA:1;
119 UINT32 WPDMABurstSIZE:2;
120 UINT32 EnTXWriteBackDDONE:1;
122 UINT32 RXHdrScater:8;
123 UINT32 HDR_SEG_LEN:16;
126 } WPDMA_GLO_CFG_STRUC, *PWPDMA_GLO_CFG_STRUC;
128 #define WPDMA_RST_IDX 0x20c
129 typedef union _WPDMA_RST_IDX_STRUC {
131 UINT32 RST_DTX_IDX0:1;
132 UINT32 RST_DTX_IDX1:1;
133 UINT32 RST_DTX_IDX2:1;
134 UINT32 RST_DTX_IDX3:1;
135 UINT32 RST_DTX_IDX4:1;
136 UINT32 RST_DTX_IDX5:1;
138 UINT32 RST_DRX_IDX0:1;
142 } WPDMA_RST_IDX_STRUC, *PWPDMA_RST_IDX_STRUC;
144 #define DELAY_INT_CFG 0x0210
145 typedef union _DELAY_INT_CFG_STRUC {
147 UINT32 RXMAX_PTIME:8;
149 UINT32 RXDLY_INT_EN:1;
150 UINT32 TXMAX_PTIME:8;
152 UINT32 TXDLY_INT_EN:1;
155 } DELAY_INT_CFG_STRUC, *PDELAY_INT_CFG_STRUC;
157 #define WMM_AIFSN_CFG 0x0214
158 typedef union _AIFSN_CSR_STRUC {
160 UINT32 Aifsn0:4; // for AC_BE
161 UINT32 Aifsn1:4; // for AC_BK
162 UINT32 Aifsn2:4; // for AC_VI
163 UINT32 Aifsn3:4; // for AC_VO
167 } AIFSN_CSR_STRUC, *PAIFSN_CSR_STRUC;
170 // CWMIN_CSR: CWmin for each EDCA AC
172 #define WMM_CWMIN_CFG 0x0218
173 typedef union _CWMIN_CSR_STRUC {
175 UINT32 Cwmin0:4; // for AC_BE
176 UINT32 Cwmin1:4; // for AC_BK
177 UINT32 Cwmin2:4; // for AC_VI
178 UINT32 Cwmin3:4; // for AC_VO
182 } CWMIN_CSR_STRUC, *PCWMIN_CSR_STRUC;
185 // CWMAX_CSR: CWmin for each EDCA AC
187 #define WMM_CWMAX_CFG 0x021c
188 typedef union _CWMAX_CSR_STRUC {
190 UINT32 Cwmax0:4; // for AC_BE
191 UINT32 Cwmax1:4; // for AC_BK
192 UINT32 Cwmax2:4; // for AC_VI
193 UINT32 Cwmax3:4; // for AC_VO
197 } CWMAX_CSR_STRUC, *PCWMAX_CSR_STRUC;
200 // AC_TXOP_CSR0: AC_BK/AC_BE TXOP register
202 #define WMM_TXOP0_CFG 0x0220
203 typedef union _AC_TXOP_CSR0_STRUC {
205 USHORT Ac0Txop; // for AC_BK, in unit of 32us
206 USHORT Ac1Txop; // for AC_BE, in unit of 32us
209 } AC_TXOP_CSR0_STRUC, *PAC_TXOP_CSR0_STRUC;
212 // AC_TXOP_CSR1: AC_VO/AC_VI TXOP register
214 #define WMM_TXOP1_CFG 0x0224
215 typedef union _AC_TXOP_CSR1_STRUC {
217 USHORT Ac2Txop; // for AC_VI, in unit of 32us
218 USHORT Ac3Txop; // for AC_VO, in unit of 32us
221 } AC_TXOP_CSR1_STRUC, *PAC_TXOP_CSR1_STRUC;
223 #define RINGREG_DIFF 0x10
224 #define GPIO_CTRL_CFG 0x0228 //MAC_CSR13
225 #define MCU_CMD_CFG 0x022c
226 #define TX_BASE_PTR0 0x0230 //AC_BK base address
227 #define TX_MAX_CNT0 0x0234
228 #define TX_CTX_IDX0 0x0238
229 #define TX_DTX_IDX0 0x023c
230 #define TX_BASE_PTR1 0x0240 //AC_BE base address
231 #define TX_MAX_CNT1 0x0244
232 #define TX_CTX_IDX1 0x0248
233 #define TX_DTX_IDX1 0x024c
234 #define TX_BASE_PTR2 0x0250 //AC_VI base address
235 #define TX_MAX_CNT2 0x0254
236 #define TX_CTX_IDX2 0x0258
237 #define TX_DTX_IDX2 0x025c
238 #define TX_BASE_PTR3 0x0260 //AC_VO base address
239 #define TX_MAX_CNT3 0x0264
240 #define TX_CTX_IDX3 0x0268
241 #define TX_DTX_IDX3 0x026c
242 #define TX_BASE_PTR4 0x0270 //HCCA base address
243 #define TX_MAX_CNT4 0x0274
244 #define TX_CTX_IDX4 0x0278
245 #define TX_DTX_IDX4 0x027c
246 #define TX_BASE_PTR5 0x0280 //MGMT base address
247 #define TX_MAX_CNT5 0x0284
248 #define TX_CTX_IDX5 0x0288
249 #define TX_DTX_IDX5 0x028c
250 #define TX_MGMTMAX_CNT TX_MAX_CNT5
251 #define TX_MGMTCTX_IDX TX_CTX_IDX5
252 #define TX_MGMTDTX_IDX TX_DTX_IDX5
253 #define RX_BASE_PTR 0x0290 //RX base address
254 #define RX_MAX_CNT 0x0294
255 #define RX_CRX_IDX 0x0298
256 #define RX_DRX_IDX 0x029c
257 #define USB_DMA_CFG 0x02a0
259 typedef union _USB_DMA_CFG_STRUC {
261 UINT32 RxBulkAggTOut:8; //Rx Bulk Aggregation TimeOut in unit of 33ns
262 UINT32 RxBulkAggLmt:8; //Rx Bulk Aggregation Limit in unit of 256 bytes
263 UINT32 phyclear:1; //phy watch dog enable. write 1
265 UINT32 TxClear:1; //Clear USB DMA TX path
266 UINT32 TxopHalt:1; //Halt TXOP count down when TX buffer is full.
267 UINT32 RxBulkAggEn:1; //Enable Rx Bulk Aggregation
268 UINT32 RxBulkEn:1; //Enable USB DMA Rx
269 UINT32 TxBulkEn:1; //Enable USB DMA Tx
270 UINT32 EpoutValid:6; //OUT endpoint data valid
271 UINT32 RxBusy:1; //USB DMA RX FSM busy
272 UINT32 TxBusy:1; //USB DMA TX FSM busy
275 } USB_DMA_CFG_STRUC, *PUSB_DMA_CFG_STRUC;
281 // Most are for debug. Driver doesn't touch PBF register.
282 #define PBF_SYS_CTRL 0x0400
283 #define PBF_CFG 0x0408
284 #define PBF_MAX_PCNT 0x040C
285 #define PBF_CTRL 0x0410
286 #define PBF_INT_STA 0x0414
287 #define PBF_INT_ENA 0x0418
288 #define TXRXQ_PCNT 0x0438
289 #define PBF_DBG 0x043c
290 #define PBF_CAP_CTRL 0x0440
294 #define EFUSE_CTRL 0x0580
295 #define EFUSE_DATA0 0x0590
296 #define EFUSE_DATA1 0x0594
297 #define EFUSE_DATA2 0x0598
298 #define EFUSE_DATA3 0x059c
299 #define EFUSE_USAGE_MAP_START 0x2d0
300 #define EFUSE_USAGE_MAP_END 0x2fc
301 #define EFUSE_TAG 0x2fe
302 #define EFUSE_USAGE_MAP_SIZE 45
304 typedef union _EFUSE_CTRL_STRUC {
306 UINT32 EFSROM_AOUT:6;
307 UINT32 EFSROM_MODE:2;
308 UINT32 EFSROM_LDO_OFF_TIME:6;
309 UINT32 EFSROM_LDO_ON_TIME:2;
310 UINT32 EFSROM_AIN:10;
312 UINT32 EFSROM_KICK:1;
316 } EFUSE_CTRL_STRUC, *PEFUSE_CTRL_STRUC;
318 #define LDO_CFG0 0x05d4
319 #define GPIO_SWITCH 0x05dc
325 // 4.1 MAC SYSTEM configuration registers (offset:0x1000)
327 #define MAC_CSR0 0x1000
328 typedef union _ASIC_VER_ID_STRUC {
330 USHORT ASICRev; // reversion : 0
331 USHORT ASICVer; // version : 2860
334 } ASIC_VER_ID_STRUC, *PASIC_VER_ID_STRUC;
336 #define MAC_SYS_CTRL 0x1004 //MAC_CSR1
337 #define MAC_ADDR_DW0 0x1008 // MAC ADDR DW0
338 #define MAC_ADDR_DW1 0x100c // MAC ADDR DW1
340 // MAC_CSR2: STA MAC register 0
342 typedef union _MAC_DW0_STRUC {
344 UCHAR Byte0; // MAC address byte 0
345 UCHAR Byte1; // MAC address byte 1
346 UCHAR Byte2; // MAC address byte 2
347 UCHAR Byte3; // MAC address byte 3
350 } MAC_DW0_STRUC, *PMAC_DW0_STRUC;
353 // MAC_CSR3: STA MAC register 1
355 typedef union _MAC_DW1_STRUC {
357 UCHAR Byte4; // MAC address byte 4
358 UCHAR Byte5; // MAC address byte 5
363 } MAC_DW1_STRUC, *PMAC_DW1_STRUC;
365 #define MAC_BSSID_DW0 0x1010 // MAC BSSID DW0
366 #define MAC_BSSID_DW1 0x1014 // MAC BSSID DW1
369 // MAC_CSR5: BSSID register 1
371 typedef union _MAC_CSR5_STRUC {
373 UCHAR Byte4; // BSSID byte 4
374 UCHAR Byte5; // BSSID byte 5
375 USHORT BssIdMask:2; // 0: one BSSID, 10: 4 BSSID, 01: 2 BSSID , 11: 8BSSID
380 } MAC_CSR5_STRUC, *PMAC_CSR5_STRUC;
382 #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
383 #define BBP_CSR_CFG 0x101c //
385 // BBP_CSR_CFG: BBP serial control register
387 typedef union _BBP_CSR_CFG_STRUC {
389 UINT32 Value:8; // Register value to program into BBP
390 UINT32 RegNum:8; // Selected BBP register
391 UINT32 fRead:1; // 0: Write BBP, 1: Read BBP
392 UINT32 Busy:1; // 1: ASIC is busy execute BBP programming.
393 UINT32 BBP_PAR_DUR:1; // 0: 4 MAC clock cycles 1: 8 MAC clock cycles
394 UINT32 BBP_RW_MODE:1; // 0: use serial mode 1:parallel
398 } BBP_CSR_CFG_STRUC, *PBBP_CSR_CFG_STRUC;
400 #define RF_CSR_CFG0 0x1020
402 // RF_CSR_CFG: RF control register
404 typedef union _RF_CSR_CFG0_STRUC {
406 UINT32 RegIdAndContent:24; // Register value to program into BBP
407 UINT32 bitwidth:5; // Selected BBP register
408 UINT32 StandbyMode:1; // 0: high when stand by 1: low when standby
409 UINT32 Sel:1; // 0:RF_LE0 activate 1:RF_LE1 activate
410 UINT32 Busy:1; // 0: idle 1: 8busy
413 } RF_CSR_CFG0_STRUC, *PRF_CSR_CFG0_STRUC;
415 #define RF_CSR_CFG1 0x1024
416 typedef union _RF_CSR_CFG1_STRUC {
418 UINT32 RegIdAndContent:24; // Register value to program into BBP
419 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)
420 UINT32 rsv:7; // 0: idle 1: 8busy
423 } RF_CSR_CFG1_STRUC, *PRF_CSR_CFG1_STRUC;
425 #define RF_CSR_CFG2 0x1028 //
426 typedef union _RF_CSR_CFG2_STRUC {
428 UINT32 RegIdAndContent:24; // Register value to program into BBP
429 UINT32 rsv:8; // 0: idle 1: 8busy
432 } RF_CSR_CFG2_STRUC, *PRF_CSR_CFG2_STRUC;
434 #define LED_CFG 0x102c // MAC_CSR14
435 typedef union _LED_CFG_STRUC {
437 UINT32 OnPeriod:8; // blinking on period unit 1ms
438 UINT32 OffPeriod:8; // blinking off period unit 1ms
439 UINT32 SlowBlinkPeriod:6; // slow blinking period. unit:1ms
441 UINT32 RLedMode:2; // red Led Mode 0: off1: blinking upon TX2: periodic slow blinking3: always on
442 UINT32 GLedMode:2; // green Led Mode
443 UINT32 YLedMode:2; // yellow Led Mode
444 UINT32 LedPolar:1; // Led Polarity. 0: active low1: active high
448 } LED_CFG_STRUC, *PLED_CFG_STRUC;
451 // 4.2 MAC TIMING configuration registers (offset:0x1100)
453 #define XIFS_TIME_CFG 0x1100 // MAC_CSR8 MAC_CSR9
454 typedef union _IFS_SLOT_CFG_STRUC {
456 UINT32 CckmSifsTime:8; // unit 1us. Applied after CCK RX/TX
457 UINT32 OfdmSifsTime:8; // unit 1us. Applied after OFDM RX/TX
458 UINT32 OfdmXifsTime:4; //OFDM SIFS. unit 1us. Applied after OFDM RX when MAC doesn't reference BBP signal BBRXEND
459 UINT32 EIFS:9; // unit 1us
460 UINT32 BBRxendEnable:1; // reference RXEND signal to begin XIFS defer
464 } IFS_SLOT_CFG_STRUC, *PIFS_SLOT_CFG_STRUC;
466 #define BKOFF_SLOT_CFG 0x1104 // mac_csr9 last 8 bits
467 #define NAV_TIME_CFG 0x1108 // NAV (MAC_CSR15)
468 #define CH_TIME_CFG 0x110C // Count as channel busy
469 #define PBF_LIFE_TIMER 0x1110 //TX/RX MPDU timestamp timer (free run)Unit: 1us
470 #define BCN_TIME_CFG 0x1114 // TXRX_CSR9
472 #define BCN_OFFSET0 0x042C
473 #define BCN_OFFSET1 0x0430
476 // BCN_TIME_CFG : Synchronization control register
478 typedef union _BCN_TIME_CFG_STRUC {
480 UINT32 BeaconInterval:16; // in unit of 1/16 TU
481 UINT32 bTsfTicking:1; // Enable TSF auto counting
482 UINT32 TsfSyncMode:2; // Enable TSF sync, 00: disable, 01: infra mode, 10: ad-hoc mode
483 UINT32 bTBTTEnable:1;
484 UINT32 bBeaconGen:1; // Enable beacon generator
486 UINT32 TxTimestampCompensate:8;
489 } BCN_TIME_CFG_STRUC, *PBCN_TIME_CFG_STRUC;
491 #define TBTT_SYNC_CFG 0x1118 // txrx_csr10
492 #define TSF_TIMER_DW0 0x111C // Local TSF timer lsb 32 bits. Read-only
493 #define TSF_TIMER_DW1 0x1120 // msb 32 bits. Read-only.
494 #define TBTT_TIMER 0x1124 // TImer remains till next TBTT. Read-only. TXRX_CSR14
495 #define INT_TIMER_CFG 0x1128 //
496 #define INT_TIMER_EN 0x112c // GP-timer and pre-tbtt Int enable
497 #define CH_IDLE_STA 0x1130 // channel idle time
498 #define CH_BUSY_STA 0x1134 // channle busy time
500 // 4.2 MAC POWER configuration registers (offset:0x1200)
502 #define MAC_STATUS_CFG 0x1200 // old MAC_CSR12
503 #define PWR_PIN_CFG 0x1204 // old MAC_CSR12
504 #define AUTO_WAKEUP_CFG 0x1208 // old MAC_CSR10
506 // AUTO_WAKEUP_CFG: Manual power control / status register
508 typedef union _AUTO_WAKEUP_STRUC {
510 UINT32 AutoLeadTime:8;
511 UINT32 NumofSleepingTbtt:7; // ForceWake has high privilege than PutToSleep when both set
512 UINT32 EnableAutoWakeup:1; // 0:sleep, 1:awake
516 } AUTO_WAKEUP_STRUC, *PAUTO_WAKEUP_STRUC;
519 // 4.3 MAC TX configuration registers (offset:0x1300)
522 #define EDCA_AC0_CFG 0x1300 //AC_TXOP_CSR0 0x3474
523 #define EDCA_AC1_CFG 0x1304
524 #define EDCA_AC2_CFG 0x1308
525 #define EDCA_AC3_CFG 0x130c
526 typedef union _EDCA_AC_CFG_STRUC {
528 UINT32 AcTxop:8; // in unit of 32us
529 UINT32 Aifsn:4; // # of slot time
531 UINT32 Cwmax:4; //unit power of 2
535 } EDCA_AC_CFG_STRUC, *PEDCA_AC_CFG_STRUC;
537 #define EDCA_TID_AC_MAP 0x1310
538 #define TX_PWR_CFG_0 0x1314
539 #define TX_PWR_CFG_1 0x1318
540 #define TX_PWR_CFG_2 0x131C
541 #define TX_PWR_CFG_3 0x1320
542 #define TX_PWR_CFG_4 0x1324
543 #define TX_PIN_CFG 0x1328
544 #define TX_BAND_CFG 0x132c // 0x1 use upper 20MHz. 0 juse lower 20MHz
545 #define TX_SW_CFG0 0x1330
546 #define TX_SW_CFG1 0x1334
547 #define TX_SW_CFG2 0x1338
548 #define TXOP_THRES_CFG 0x133c
549 #define TXOP_CTRL_CFG 0x1340
550 #define TX_RTS_CFG 0x1344
552 typedef union _TX_RTS_CFG_STRUC {
554 UINT32 AutoRtsRetryLimit:8;
555 UINT32 RtsThres:16; // unit:byte
556 UINT32 RtsFbkEn:1; // enable rts rate fallback
557 UINT32 rsv:7; // 1: HT non-STBC control frame enable
560 } TX_RTS_CFG_STRUC, *PTX_RTS_CFG_STRUC;
562 #define TX_TIMEOUT_CFG 0x1348
563 typedef union _TX_TIMEOUT_CFG_STRUC {
566 UINT32 MpduLifeTime:4; // expiration time = 2^(9+MPDU LIFE TIME) us
567 UINT32 RxAckTimeout:8; // unit:slot. Used for TX precedure
568 UINT32 TxopTimeout:8; //TXOP timeout value for TXOP truncation. It is recommended that (SLOT_TIME) > (TX_OP_TIMEOUT) > (RX_ACK_TIMEOUT)
569 UINT32 rsv2:8; // 1: HT non-STBC control frame enable
572 } TX_TIMEOUT_CFG_STRUC, *PTX_TIMEOUT_CFG_STRUC;
574 #define TX_RTY_CFG 0x134c
575 typedef union PACKED _TX_RTY_CFG_STRUC {
577 UINT32 ShortRtyLimit:8; // short retry limit
578 UINT32 LongRtyLimit:8; //long retry limit
579 UINT32 LongRtyThre:12; // Long retry threshoold
580 UINT32 NonAggRtyMode:1; // Non-Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer
581 UINT32 AggRtyMode:1; // Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer
582 UINT32 TxautoFBEnable:1; // Tx retry PHY rate auto fallback enable
583 UINT32 rsv:1; // 1: HT non-STBC control frame enable
586 } TX_RTY_CFG_STRUC, *PTX_RTY_CFG_STRUC;
588 #define TX_LINK_CFG 0x1350
589 typedef union PACKED _TX_LINK_CFG_STRUC {
591 UINT32 RemoteMFBLifeTime:8; //remote MFB life time. unit : 32us
592 UINT32 MFBEnable:1; // TX apply remote MFB 1:enable
593 UINT32 RemoteUMFSEnable:1; // remote unsolicit MFB enable. 0: not apply remote remote unsolicit (MFS=7)
594 UINT32 TxMRQEn:1; // MCS request TX enable
595 UINT32 TxRDGEn:1; // RDG TX enable
596 UINT32 TxCFAckEn:1; // Piggyback CF-ACK enable
598 UINT32 RemotMFB:8; // remote MCS feedback
599 UINT32 RemotMFS:8; //remote MCS feedback sequence number
602 } TX_LINK_CFG_STRUC, *PTX_LINK_CFG_STRUC;
604 #define HT_FBK_CFG0 0x1354
605 typedef union PACKED _HT_FBK_CFG0_STRUC {
617 } HT_FBK_CFG0_STRUC, *PHT_FBK_CFG0_STRUC;
619 #define HT_FBK_CFG1 0x1358
620 typedef union _HT_FBK_CFG1_STRUC {
632 } HT_FBK_CFG1_STRUC, *PHT_FBK_CFG1_STRUC;
634 #define LG_FBK_CFG0 0x135c
635 typedef union _LG_FBK_CFG0_STRUC {
637 UINT32 OFDMMCS0FBK:4; //initial value is 0
638 UINT32 OFDMMCS1FBK:4; //initial value is 0
639 UINT32 OFDMMCS2FBK:4; //initial value is 1
640 UINT32 OFDMMCS3FBK:4; //initial value is 2
641 UINT32 OFDMMCS4FBK:4; //initial value is 3
642 UINT32 OFDMMCS5FBK:4; //initial value is 4
643 UINT32 OFDMMCS6FBK:4; //initial value is 5
644 UINT32 OFDMMCS7FBK:4; //initial value is 6
647 } LG_FBK_CFG0_STRUC, *PLG_FBK_CFG0_STRUC;
649 #define LG_FBK_CFG1 0x1360
650 typedef union _LG_FBK_CFG1_STRUC {
652 UINT32 CCKMCS0FBK:4; //initial value is 0
653 UINT32 CCKMCS1FBK:4; //initial value is 0
654 UINT32 CCKMCS2FBK:4; //initial value is 1
655 UINT32 CCKMCS3FBK:4; //initial value is 2
659 } LG_FBK_CFG1_STRUC, *PLG_FBK_CFG1_STRUC;
661 //=======================================================
662 //================ Protection Paramater================================
663 //=======================================================
664 #define CCK_PROT_CFG 0x1364 //CCK Protection
665 #define ASIC_SHORTNAV 1
666 #define ASIC_LONGNAV 2
669 typedef union _PROT_CFG_STRUC {
671 UINT32 ProtectRate:16; //Protection control frame rate for CCK TX(RTS/CTS/CFEnd).
672 UINT32 ProtectCtrl:2; //Protection control frame type for CCK TX. 1:RTS/CTS, 2:CTS-to-self, 0:None, 3:rsv
673 UINT32 ProtectNav:2; //TXOP protection type for CCK TX. 0:None, 1:ShortNAVprotect, 2:LongNAVProtect, 3:rsv
674 UINT32 TxopAllowCck:1; //CCK TXOP allowance.0:disallow.
675 UINT32 TxopAllowOfdm:1; //CCK TXOP allowance.0:disallow.
676 UINT32 TxopAllowMM20:1; //CCK TXOP allowance. 0:disallow.
677 UINT32 TxopAllowMM40:1; //CCK TXOP allowance.0:disallow.
678 UINT32 TxopAllowGF20:1; //CCK TXOP allowance.0:disallow.
679 UINT32 TxopAllowGF40:1; //CCK TXOP allowance.0:disallow.
680 UINT32 RTSThEn:1; //RTS threshold enable on CCK TX
684 } PROT_CFG_STRUC, *PPROT_CFG_STRUC;
686 #define OFDM_PROT_CFG 0x1368 //OFDM Protection
687 #define MM20_PROT_CFG 0x136C //MM20 Protection
688 #define MM40_PROT_CFG 0x1370 //MM40 Protection
689 #define GF20_PROT_CFG 0x1374 //GF20 Protection
690 #define GF40_PROT_CFG 0x1378 //GR40 Protection
691 #define EXP_CTS_TIME 0x137C //
692 #define EXP_ACK_TIME 0x1380 //
695 // 4.4 MAC RX configuration registers (offset:0x1400)
697 #define RX_FILTR_CFG 0x1400 //TXRX_CSR0
698 #define AUTO_RSP_CFG 0x1404 //TXRX_CSR4
700 // TXRX_CSR4: Auto-Responder/
702 typedef union _AUTO_RSP_CFG_STRUC {
704 UINT32 AutoResponderEnable:1;
705 UINT32 BACAckPolicyEnable:1; // 0:long, 1:short preamble
706 UINT32 CTS40MMode:1; // Response CTS 40MHz duplicate mode
707 UINT32 CTS40MRef:1; // Response CTS 40MHz duplicate mode
708 UINT32 AutoResponderPreamble:1; // 0:long, 1:short preamble
709 UINT32 rsv:1; // Power bit value in conrtrol frame
710 UINT32 DualCTSEn:1; // Power bit value in conrtrol frame
711 UINT32 AckCtsPsmBit:1; // Power bit value in conrtrol frame
715 } AUTO_RSP_CFG_STRUC, *PAUTO_RSP_CFG_STRUC;
717 #define LEGACY_BASIC_RATE 0x1408 // TXRX_CSR5 0x3054
718 #define HT_BASIC_RATE 0x140c
719 #define HT_CTRL_CFG 0x1410
720 #define SIFS_COST_CFG 0x1414
721 #define RX_PARSER_CFG 0x1418 //Set NAV for all received frames
724 // 4.5 MAC Security configuration (offset:0x1500)
726 #define TX_SEC_CNT0 0x1500 //
727 #define RX_SEC_CNT0 0x1504 //
728 #define CCMP_FC_MUTE 0x1508 //
730 // 4.6 HCCA/PSMP (offset:0x1600)
732 #define TXOP_HLDR_ADDR0 0x1600
733 #define TXOP_HLDR_ADDR1 0x1604
734 #define TXOP_HLDR_ET 0x1608
735 #define QOS_CFPOLL_RA_DW0 0x160c
736 #define QOS_CFPOLL_A1_DW1 0x1610
737 #define QOS_CFPOLL_QC 0x1614
739 // 4.7 MAC Statistis registers (offset:0x1700)
741 #define RX_STA_CNT0 0x1700 //
742 #define RX_STA_CNT1 0x1704 //
743 #define RX_STA_CNT2 0x1708 //
746 // RX_STA_CNT0_STRUC: RX PLCP error count & RX CRC error count
748 typedef union _RX_STA_CNT0_STRUC {
754 } RX_STA_CNT0_STRUC, *PRX_STA_CNT0_STRUC;
757 // RX_STA_CNT1_STRUC: RX False CCA count & RX LONG frame count
759 typedef union _RX_STA_CNT1_STRUC {
765 } RX_STA_CNT1_STRUC, *PRX_STA_CNT1_STRUC;
768 // RX_STA_CNT2_STRUC:
770 typedef union _RX_STA_CNT2_STRUC {
773 USHORT RxFifoOverflowCount;
776 } RX_STA_CNT2_STRUC, *PRX_STA_CNT2_STRUC;
778 #define TX_STA_CNT0 0x170C //
780 // STA_CSR3: TX Beacon count
782 typedef union _TX_STA_CNT0_STRUC {
785 USHORT TxBeaconCount;
788 } TX_STA_CNT0_STRUC, *PTX_STA_CNT0_STRUC;
790 #define TX_STA_CNT1 0x1710 //
792 // TX_STA_CNT1: TX tx count
794 typedef union _TX_STA_CNT1_STRUC {
800 } TX_STA_CNT1_STRUC, *PTX_STA_CNT1_STRUC;
802 #define TX_STA_CNT2 0x1714 //
804 // TX_STA_CNT2: TX tx count
806 typedef union _TX_STA_CNT2_STRUC {
808 USHORT TxZeroLenCount;
809 USHORT TxUnderFlowCount;
812 } TX_STA_CNT2_STRUC, *PTX_STA_CNT2_STRUC;
814 #define TX_STA_FIFO 0x1718 //
816 // TX_STA_FIFO_STRUC: TX Result for specific PID status fifo register
818 typedef union PACKED _TX_STA_FIFO_STRUC {
820 UINT32 bValid:1; // 1:This register contains a valid TX result
822 UINT32 TxSuccess:1; // Tx No retry success
823 UINT32 TxAggre:1; // Tx Retry Success
824 UINT32 TxAckRequired:1; // Tx fail
825 UINT32 wcid:8; //wireless client index
826 // UINT32 SuccessRate:16; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
827 UINT32 SuccessRate:13; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
832 } TX_STA_FIFO_STRUC, *PTX_STA_FIFO_STRUC;
835 #define TX_AGG_CNT 0x171c
836 typedef union _TX_AGG_CNT_STRUC {
838 USHORT NonAggTxCount;
842 } TX_AGG_CNT_STRUC, *PTX_AGG_CNT_STRUC;
845 #define TX_AGG_CNT0 0x1720
846 typedef union _TX_AGG_CNT0_STRUC {
848 USHORT AggSize1Count;
849 USHORT AggSize2Count;
852 } TX_AGG_CNT0_STRUC, *PTX_AGG_CNT0_STRUC;
855 #define TX_AGG_CNT1 0x1724
856 typedef union _TX_AGG_CNT1_STRUC {
858 USHORT AggSize3Count;
859 USHORT AggSize4Count;
862 } TX_AGG_CNT1_STRUC, *PTX_AGG_CNT1_STRUC;
864 #define TX_AGG_CNT2 0x1728
865 typedef union _TX_AGG_CNT2_STRUC {
867 USHORT AggSize5Count;
868 USHORT AggSize6Count;
871 } TX_AGG_CNT2_STRUC, *PTX_AGG_CNT2_STRUC;
874 #define TX_AGG_CNT3 0x172c
875 typedef union _TX_AGG_CNT3_STRUC {
877 USHORT AggSize7Count;
878 USHORT AggSize8Count;
881 } TX_AGG_CNT3_STRUC, *PTX_AGG_CNT3_STRUC;
884 #define TX_AGG_CNT4 0x1730
885 typedef union _TX_AGG_CNT4_STRUC {
887 USHORT AggSize9Count;
888 USHORT AggSize10Count;
891 } TX_AGG_CNT4_STRUC, *PTX_AGG_CNT4_STRUC;
893 #define TX_AGG_CNT5 0x1734
894 typedef union _TX_AGG_CNT5_STRUC {
896 USHORT AggSize11Count;
897 USHORT AggSize12Count;
900 } TX_AGG_CNT5_STRUC, *PTX_AGG_CNT5_STRUC;
902 #define TX_AGG_CNT6 0x1738
903 typedef union _TX_AGG_CNT6_STRUC {
905 USHORT AggSize13Count;
906 USHORT AggSize14Count;
909 } TX_AGG_CNT6_STRUC, *PTX_AGG_CNT6_STRUC;
911 #define TX_AGG_CNT7 0x173c
912 typedef union _TX_AGG_CNT7_STRUC {
914 USHORT AggSize15Count;
915 USHORT AggSize16Count;
918 } TX_AGG_CNT7_STRUC, *PTX_AGG_CNT7_STRUC;
920 #define MPDU_DENSITY_CNT 0x1740
921 typedef union _MPDU_DEN_CNT_STRUC {
923 USHORT TXZeroDelCount; //TX zero length delimiter count
924 USHORT RXZeroDelCount; //RX zero length delimiter count
927 } MPDU_DEN_CNT_STRUC, *PMPDU_DEN_CNT_STRUC;
930 // TXRX control registers - base address 0x3000
932 // rt2860b UNKNOWN reg use R/O Reg Addr 0x77d0 first..
933 #define TXRX_CSR1 0x77d0
936 // Security key table memory, base address = 0x1000
938 #define MAC_WCID_BASE 0x1800 //8-bytes(use only 6-bytes) * 256 entry =
939 #define HW_WCID_ENTRY_SIZE 8
940 #define PAIRWISE_KEY_TABLE_BASE 0x4000 // 32-byte * 256-entry = -byte
941 #define HW_KEY_ENTRY_SIZE 0x20
942 #define PAIRWISE_IVEIV_TABLE_BASE 0x6000 // 8-byte * 256-entry = -byte
943 #define MAC_IVEIV_TABLE_BASE 0x6000 // 8-byte * 256-entry = -byte
944 #define HW_IVEIV_ENTRY_SIZE 8
945 #define MAC_WCID_ATTRIBUTE_BASE 0x6800 // 4-byte * 256-entry = -byte
946 #define HW_WCID_ATTRI_SIZE 4
947 #define WCID_RESERVED 0x6bfc
948 #define SHARED_KEY_TABLE_BASE 0x6c00 // 32-byte * 16-entry = 512-byte
949 #define SHARED_KEY_MODE_BASE 0x7000 // 32-byte * 16-entry = 512-byte
950 #define HW_SHARED_KEY_MODE_SIZE 4
951 #define SHAREDKEYTABLE 0
952 #define PAIRWISEKEYTABLE 1
954 typedef union _SHAREDKEY_MODE_STRUC {
956 UINT32 Bss0Key0CipherAlg:3;
958 UINT32 Bss0Key1CipherAlg:3;
960 UINT32 Bss0Key2CipherAlg:3;
962 UINT32 Bss0Key3CipherAlg:3;
964 UINT32 Bss1Key0CipherAlg:3;
966 UINT32 Bss1Key1CipherAlg:3;
968 UINT32 Bss1Key2CipherAlg:3;
970 UINT32 Bss1Key3CipherAlg:3;
974 } SHAREDKEY_MODE_STRUC, *PSHAREDKEY_MODE_STRUC;
976 // 64-entry for pairwise key table
977 typedef struct _HW_WCID_ENTRY { // 8-byte per entry
980 } HW_WCID_ENTRY, PHW_WCID_ENTRY;
985 // Other on-chip shared memory space, base = 0x2000
988 // CIS space - base address = 0x2000
989 #define HW_CIS_BASE 0x2000
991 // Carrier-sense CTS frame base address. It's where mac stores carrier-sense frame for carrier-sense function.
992 #define HW_CS_CTS_BASE 0x7700
993 // DFS CTS frame base address. It's where mac stores CTS frame for DFS.
994 #define HW_DFS_CTS_BASE 0x7780
995 #define HW_CTS_FRAME_SIZE 0x80
997 // 2004-11-08 john - since NULL frame won't be that long (256 byte). We steal 16 tail bytes
998 // to save debugging settings
999 #define HW_DEBUG_SETTING_BASE 0x77f0 // 0x77f0~0x77ff total 16 bytes
1000 #define HW_DEBUG_SETTING_BASE2 0x7770 // 0x77f0~0x77ff total 16 bytes
1002 // In order to support maximum 8 MBSS and its maximum length is 512 for each beacon
1003 // Three section discontinue memory segments will be used.
1004 // 1. The original region for BCN 0~3
1005 // 2. Extract memory from FCE table for BCN 4~5
1006 // 3. Extract memory from Pair-wise key table for BCN 6~7
1007 // It occupied those memory of wcid 238~253 for BCN 6
1008 // and wcid 222~237 for BCN 7
1009 #define HW_BEACON_MAX_SIZE 0x1000 /* unit: byte */
1010 #define HW_BEACON_BASE0 0x7800
1011 #define HW_BEACON_BASE1 0x7A00
1012 #define HW_BEACON_BASE2 0x7C00
1013 #define HW_BEACON_BASE3 0x7E00
1014 #define HW_BEACON_BASE4 0x7200
1015 #define HW_BEACON_BASE5 0x7400
1016 #define HW_BEACON_BASE6 0x5DC0
1017 #define HW_BEACON_BASE7 0x5BC0
1019 #define HW_BEACON_MAX_COUNT 8
1020 #define HW_BEACON_OFFSET 0x0200
1021 #define HW_BEACON_CONTENT_LEN (HW_BEACON_OFFSET - TXWI_SIZE)
1023 // HOST-MCU shared memory - base address = 0x2100
1024 #define HOST_CMD_CSR 0x404
1025 #define H2M_MAILBOX_CSR 0x7010
1026 #define H2M_MAILBOX_CID 0x7014
1027 #define H2M_MAILBOX_STATUS 0x701c
1028 #define H2M_INT_SRC 0x7024
1029 #define H2M_BBP_AGENT 0x7028
1030 #define M2H_CMD_DONE_CSR 0x000c
1031 #define MCU_TXOP_ARRAY_BASE 0x000c // TODO: to be provided by Albert
1032 #define MCU_TXOP_ENTRY_SIZE 32 // TODO: to be provided by Albert
1033 #define MAX_NUM_OF_TXOP_ENTRY 16 // TODO: must be same with 8051 firmware
1034 #define MCU_MBOX_VERSION 0x01 // TODO: to be confirmed by Albert
1035 #define MCU_MBOX_VERSION_OFFSET 5 // TODO: to be provided by Albert
1038 // Host DMA registers - base address 0x200 . TX0-3=EDCAQid0-3, TX4=HCCA, TX5=MGMT,
1041 // DMA RING DESCRIPTOR
1043 #define E2PROM_CSR 0x0004
1044 #define IO_CNTL_CSR 0x77d0
1047 // 8051 firmware image for usb - use last-half base address = 0x3000
1048 #define FIRMWARE_IMAGE_BASE 0x3000
1049 #define MAX_FIRMWARE_IMAGE_SIZE 0x1000 // 4kbyte
1052 // ================================================================
1053 // Tx / Rx / Mgmt ring descriptor definition
1054 // ================================================================
1056 // the following PID values are used to mark outgoing frame type in TXD->PID so that
1057 // proper TX statistics can be collected based on these categories
1058 // b3-2 of PID field -
1059 #define PID_MGMT 0x05
1060 #define PID_BEACON 0x0c
1061 #define PID_DATA_NORMALUCAST 0x02
1062 #define PID_DATA_AMPDU 0x04
1063 #define PID_DATA_NO_ACK 0x08
1064 #define PID_DATA_NOT_NORM_ACK 0x03
1065 // value domain of pTxD->HostQId (4-bit: 0~15)
1066 #define QID_AC_BK 1 // meet ACI definition in 802.11e
1067 #define QID_AC_BE 0 // meet ACI definition in 802.11e
1071 #define NUM_OF_TX_RING 5
1074 #define QID_OTHER 15
1077 // ------------------------------------------------------
1078 // BBP & RF definition
1079 // ------------------------------------------------------
1116 #define BBP_R0 0 // version
1117 #define BBP_R1 1 // TSSI
1118 #define BBP_R2 2 // TX configure
1123 #define BBP_R14 14 // RX configure
1125 #define BBP_R17 17 // RX sensibility
1132 #define BBP_R49 49 //TSSI
1137 #define BBP_R62 62 // Rx SQ0 Threshold HIGH
1145 #define BBP_R70 70 // Rx AGC SQ CCK Xcorr threshold
1158 #define BBP_R94 94 // Tx Gain Control
1159 #define BBP_R103 103
1160 #define BBP_R105 105
1161 #define BBP_R113 113
1162 #define BBP_R114 114
1163 #define BBP_R115 115
1164 #define BBP_R116 116
1165 #define BBP_R117 117
1166 #define BBP_R118 118
1167 #define BBP_R119 119
1168 #define BBP_R120 120
1169 #define BBP_R121 121
1170 #define BBP_R122 122
1171 #define BBP_R123 123
1173 #define BBP_R138 138 // add by johnli, RF power sequence setup, ADC dynamic on/off control
1177 #define BBPR94_DEFAULT 0x06 // Add 1 value will gain 1db
1179 #define RSSI_FOR_VERY_LOW_SENSIBILITY -35
1180 #define RSSI_FOR_LOW_SENSIBILITY -58
1181 #define RSSI_FOR_MID_LOW_SENSIBILITY -80
1182 #define RSSI_FOR_MID_SENSIBILITY -90
1184 //-------------------------------------------------------------------------
1185 // EEPROM definition
1186 //-------------------------------------------------------------------------
1193 #define EEPROM_WRITE_OPCODE 0x05
1194 #define EEPROM_READ_OPCODE 0x06
1195 #define EEPROM_EWDS_OPCODE 0x10
1196 #define EEPROM_EWEN_OPCODE 0x13
1198 #define NUM_EEPROM_BBP_PARMS 19 // Include NIC Config 0, 1, CR, TX ALC step, BBPs
1199 #define NUM_EEPROM_TX_G_PARMS 7
1200 #define EEPROM_NIC1_OFFSET 0x34 // The address is from NIC config 0, not BBP register ID
1201 #define EEPROM_NIC2_OFFSET 0x36 // The address is from NIC config 0, not BBP register ID
1202 #define EEPROM_BBP_BASE_OFFSET 0xf0 // The address is from NIC config 0, not BBP register ID
1203 #define EEPROM_G_TX_PWR_OFFSET 0x52
1204 #define EEPROM_G_TX2_PWR_OFFSET 0x60
1205 #define EEPROM_LED1_OFFSET 0x3c
1206 #define EEPROM_LED2_OFFSET 0x3e
1207 #define EEPROM_LED3_OFFSET 0x40
1208 #define EEPROM_LNA_OFFSET 0x44
1209 #define EEPROM_RSSI_BG_OFFSET 0x46
1210 #define EEPROM_RSSI_A_OFFSET 0x4a
1211 #define EEPROM_DEFINE_MAX_TXPWR 0x4e
1212 #define EEPROM_TXPOWER_BYRATE_20MHZ_2_4G 0xde // 20MHZ 2.4G tx power.
1213 #define EEPROM_TXPOWER_BYRATE_40MHZ_2_4G 0xee // 40MHZ 2.4G tx power.
1214 #define EEPROM_TXPOWER_BYRATE_20MHZ_5G 0xfa // 20MHZ 5G tx power.
1215 #define EEPROM_TXPOWER_BYRATE_40MHZ_5G 0x10a // 40MHZ 5G tx power.
1216 #define EEPROM_A_TX_PWR_OFFSET 0x78
1217 #define EEPROM_A_TX2_PWR_OFFSET 0xa6
1218 #define EEPROM_VERSION_OFFSET 0x02
1219 #define EEPROM_FREQ_OFFSET 0x3a
1220 #define EEPROM_TXPOWER_BYRATE 0xde // 20MHZ power.
1221 #define EEPROM_TXPOWER_DELTA 0x50 // 20MHZ AND 40 MHZ use different power. This is delta in 40MHZ.
1222 #define VALID_EEPROM_VERSION 1
1224 // PairKeyMode definition
1225 #define PKMODE_NONE 0
1226 #define PKMODE_WEP64 1
1227 #define PKMODE_WEP128 2
1228 #define PKMODE_TKIP 3
1229 #define PKMODE_AES 4
1230 #define PKMODE_CKIP64 5
1231 #define PKMODE_CKIP128 6
1232 #define PKMODE_TKIP_NO_MIC 7 // MIC appended by driver: not a valid value in hardware key table
1234 // =================================================================================
1236 // =================================================================================
1237 //7.1 WCID ENTRY format : 8bytes
1238 typedef struct _WCID_ENTRY_STRUC {
1239 UCHAR RXBABitmap7; // bit0 for TID8, bit7 for TID 15
1240 UCHAR RXBABitmap0; // bit0 for TID0, bit7 for TID 7
1241 UCHAR MAC[6]; // 0 for shared key table. 1 for pairwise key table
1242 } WCID_ENTRY_STRUC, *PWCID_ENTRY_STRUC;
1244 //8.1.1 SECURITY KEY format : 8DW
1245 // 32-byte per entry, total 16-entry for shared key table, 64-entry for pairwise key table
1246 typedef struct _HW_KEY_ENTRY { // 32-byte per entry
1250 } HW_KEY_ENTRY, *PHW_KEY_ENTRY;
1252 //8.1.2 IV/EIV format : 2DW
1254 //8.1.3 RX attribute entry format : 1DW
1255 typedef struct _MAC_ATTRIBUTE_STRUC {
1256 UINT32 KeyTab:1; // 0 for shared key table. 1 for pairwise key table
1257 UINT32 PairKeyMode:3;
1258 UINT32 BSSIDIdx:3; //multipleBSS index for the WCID
1261 } MAC_ATTRIBUTE_STRUC, *PMAC_ATTRIBUTE_STRUC;
1263 // =================================================================================
1264 // TX / RX ring descriptor format
1265 // =================================================================================
1267 // the first 24-byte in TXD is called TXINFO and will be DMAed to MAC block through TXFIFO.
1268 // MAC block use this TXINFO to control the transmission behavior of this frame.
1274 // TX descriptor format, Tx ring, Mgmt Ring
1276 typedef struct PACKED _TXD_STRUC {
1290 UINT32 WIV:1; // Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition
1291 UINT32 QSEL:2; // select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA
1296 } TXD_STRUC, *PTXD_STRUC;
1299 // TXD Wireless Information format for Tx ring and Mgmt Ring
1301 //txop : for txop mode
1302 // 0:txop for the MPDU frame will be handles by ASIC by register
1303 // 1/2/3:the MPDU frame is send after PIFS/backoff/SIFS
1304 typedef struct PACKED _TXWI_STRUC {
1306 UINT32 FRAG:1; // 1 to inform TKIP engine this is a fragment.
1307 UINT32 MIMOps:1; // the remote peer is in dynamic MIMO-PS mode
1312 UINT32 MpduDensity:3;
1313 UINT32 txop:2; //FOR "THIS" frame. 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs only when previous frame exchange is successful.
1317 UINT32 BW:1; //channel bandwidth 20MHz or 40 MHz
1319 UINT32 STBC:2; // 1: STBC support MCS =0-7, 2,3 : RESERVE
1322 UINT32 TxBF:1; // 3*3
1328 UINT32 WirelessCliID:8;
1329 UINT32 MPDUtotalByteCount:12;
1335 } TXWI_STRUC, *PTXWI_STRUC;
1338 // Rx descriptor format, Rx Ring
1341 // RXWI wireless information format, in PBF. invisible in driver.
1343 typedef struct PACKED _RXWI_STRUC {
1345 UINT32 WirelessCliID:8;
1349 UINT32 MPDUtotalByteCount:12;
1359 UINT32 PHYMODE:2; // 1: this RX frame is unicast to me
1369 } RXWI_STRUC, *PRXWI_STRUC;
1371 // =================================================================================
1372 // HOST-MCU communication data structure
1373 // =================================================================================
1376 // H2M_MAILBOX_CSR: Host-to-MCU Mailbox
1378 typedef union _H2M_MAILBOX_STRUC {
1386 } H2M_MAILBOX_STRUC, *PH2M_MAILBOX_STRUC;
1389 // M2H_CMD_DONE_CSR: MCU-to-Host command complete indication
1391 typedef union _M2H_CMD_DONE_STRUC {
1399 } M2H_CMD_DONE_STRUC, *PM2H_CMD_DONE_STRUC;
1402 // MCU_LEDCS: MCU LED Control Setting.
1404 typedef union _MCU_LEDCS_STRUC {
1410 } MCU_LEDCS_STRUC, *PMCU_LEDCS_STRUC;
1412 // =================================================================================
1414 // =================================================================================
1419 typedef union _NAV_TIME_CFG_STRUC {
1421 UCHAR Sifs; // in unit of 1-us
1422 UCHAR SlotTime; // in unit of 1-us
1423 USHORT Eifs:9; // in unit of 1-us
1424 USHORT ZeroSifs:1; // Applied zero SIFS timer after OFDM RX 0: disable
1428 } NAV_TIME_CFG_STRUC, *PNAV_TIME_CFG_STRUC;
1431 // RX_FILTR_CFG: /RX configuration register
1433 typedef union _RX_FILTR_CFG_STRUC {
1435 UINT32 DropCRCErr:1; // Drop CRC error
1436 UINT32 DropPhyErr:1; // Drop physical error
1437 UINT32 DropNotToMe:1; // Drop not to me unicast frame
1438 UINT32 DropNotMyBSSID:1; // Drop fram ToDs bit is true
1440 UINT32 DropVerErr:1; // Drop version error frame
1441 UINT32 DropMcast:1; // Drop multicast frames
1442 UINT32 DropBcast:1; // Drop broadcast frames
1443 UINT32 DropDuplicate:1; // Drop duplicate frame
1445 UINT32 DropCFEndAck:1; // Drop Ps-Poll
1446 UINT32 DropCFEnd:1; // Drop Ps-Poll
1447 UINT32 DropAck:1; // Drop Ps-Poll
1448 UINT32 DropCts:1; // Drop Ps-Poll
1450 UINT32 DropRts:1; // Drop Ps-Poll
1451 UINT32 DropPsPoll:1; // Drop Ps-Poll
1453 UINT32 DropBAR:1; //
1455 UINT32 DropRsvCntlType:1;
1459 } RX_FILTR_CFG_STRUC, *PRX_FILTR_CFG_STRUC;
1462 // PHY_CSR4: RF serial control register
1464 typedef union _PHY_CSR4_STRUC {
1466 UINT32 RFRegValue:24; // Register value (include register id) serial out to RF/IF chip.
1467 UINT32 NumberOfBits:5; // Number of bits used in RFRegValue (I:20, RFMD:22)
1468 UINT32 IFSelect:1; // 1: select IF to program, 0: select RF to program
1469 UINT32 PLL_LD:1; // RF PLL_LD status
1470 UINT32 Busy:1; // 1: ASIC is busy execute RF programming.
1473 } PHY_CSR4_STRUC, *PPHY_CSR4_STRUC;
1476 // SEC_CSR5: shared key table security mode register
1478 typedef union _SEC_CSR5_STRUC {
1480 UINT32 Bss2Key0CipherAlg:3;
1482 UINT32 Bss2Key1CipherAlg:3;
1484 UINT32 Bss2Key2CipherAlg:3;
1486 UINT32 Bss2Key3CipherAlg:3;
1488 UINT32 Bss3Key0CipherAlg:3;
1490 UINT32 Bss3Key1CipherAlg:3;
1492 UINT32 Bss3Key2CipherAlg:3;
1494 UINT32 Bss3Key3CipherAlg:3;
1498 } SEC_CSR5_STRUC, *PSEC_CSR5_STRUC;
1501 // HOST_CMD_CSR: For HOST to interrupt embedded processor
1503 typedef union _HOST_CMD_CSR_STRUC {
1505 UINT32 HostCommand:8;
1509 } HOST_CMD_CSR_STRUC, *PHOST_CMD_CSR_STRUC;
1512 // AIFSN_CSR: AIFSN for each EDCA AC
1518 // E2PROM_CSR: EEPROM control register
1520 typedef union _E2PROM_CSR_STRUC {
1522 UINT32 Reload:1; // Reload EEPROM content, write one to reload, self-cleared.
1527 UINT32 Type:1; // 1: 93C46, 0:93C66
1528 UINT32 LoadStatus:1; // 1:loading, 0:done
1532 } E2PROM_CSR_STRUC, *PE2PROM_CSR_STRUC;
1534 // -------------------------------------------------------------------
1535 // E2PROM data layout
1536 // -------------------------------------------------------------------
1539 // EEPROM antenna select format
1541 typedef union _EEPROM_ANTENNA_STRUC {
1543 USHORT RxPath:4; // 1: 1R, 2: 2R, 3: 3R
1544 USHORT TxPath:4; // 1: 1T, 2: 2T
1545 USHORT RfIcType:4; // see E2PROM document
1549 } EEPROM_ANTENNA_STRUC, *PEEPROM_ANTENNA_STRUC;
1551 typedef union _EEPROM_NIC_CINFIG2_STRUC {
1553 USHORT HardwareRadioControl:1; // 1:enable, 0:disable
1554 USHORT DynamicTxAgcControl:1; //
1555 USHORT ExternalLNAForG:1; //
1556 USHORT ExternalLNAForA:1; // external LNA enable for 2.4G
1557 USHORT CardbusAcceleration:1; // !!! NOTE: 0 - enable, 1 - disable
1558 USHORT BW40MSidebandForG:1;
1559 USHORT BW40MSidebandForA:1;
1560 USHORT EnableWPSPBC:1; // WPS PBC Control bit
1561 USHORT BW40MAvailForG:1; // 0:enable, 1:disable
1562 USHORT BW40MAvailForA:1; // 0:enable, 1:disable
1563 USHORT Rsv1:1; // must be 0
1564 USHORT AntDiversity:1; // Antenna diversity
1565 USHORT Rsv2:3; // must be 0
1566 USHORT DACTestBit:1; // control if driver should patch the DAC issue
1569 } EEPROM_NIC_CONFIG2_STRUC, *PEEPROM_NIC_CONFIG2_STRUC;
1572 // TX_PWR Value valid range 0xFA(-6) ~ 0x24(36)
1574 typedef union _EEPROM_TX_PWR_STRUC {
1576 CHAR Byte0; // Low Byte
1577 CHAR Byte1; // High Byte
1580 } EEPROM_TX_PWR_STRUC, *PEEPROM_TX_PWR_STRUC;
1582 typedef union _EEPROM_VERSION_STRUC {
1584 UCHAR FaeReleaseNumber; // Low Byte
1585 UCHAR Version; // High Byte
1588 } EEPROM_VERSION_STRUC, *PEEPROM_VERSION_STRUC;
1590 typedef union _EEPROM_LED_STRUC {
1592 USHORT PolarityRDY_G:1; // Polarity RDY_G setting.
1593 USHORT PolarityRDY_A:1; // Polarity RDY_A setting.
1594 USHORT PolarityACT:1; // Polarity ACT setting.
1595 USHORT PolarityGPIO_0:1; // Polarity GPIO#0 setting.
1596 USHORT PolarityGPIO_1:1; // Polarity GPIO#1 setting.
1597 USHORT PolarityGPIO_2:1; // Polarity GPIO#2 setting.
1598 USHORT PolarityGPIO_3:1; // Polarity GPIO#3 setting.
1599 USHORT PolarityGPIO_4:1; // Polarity GPIO#4 setting.
1600 USHORT LedMode:5; // Led mode.
1601 USHORT Rsvd:3; // Reserved
1604 } EEPROM_LED_STRUC, *PEEPROM_LED_STRUC;
1606 typedef union _EEPROM_TXPOWER_DELTA_STRUC {
1608 UCHAR DeltaValue:6; // Tx Power dalta value (MAX=4)
1609 UCHAR Type:1; // 1: plus the delta value, 0: minus the delta value
1610 UCHAR TxPowerEnable:1;// Enable
1613 } EEPROM_TXPOWER_DELTA_STRUC, *PEEPROM_TXPOWER_DELTA_STRUC;
1616 // QOS_CSR0: TXOP holder address0 register
1618 typedef union _QOS_CSR0_STRUC {
1620 UCHAR Byte0; // MAC address byte 0
1621 UCHAR Byte1; // MAC address byte 1
1622 UCHAR Byte2; // MAC address byte 2
1623 UCHAR Byte3; // MAC address byte 3
1626 } QOS_CSR0_STRUC, *PQOS_CSR0_STRUC;
1629 // QOS_CSR1: TXOP holder address1 register
1631 typedef union _QOS_CSR1_STRUC {
1633 UCHAR Byte4; // MAC address byte 4
1634 UCHAR Byte5; // MAC address byte 5
1639 } QOS_CSR1_STRUC, *PQOS_CSR1_STRUC;
1641 #define RF_CSR_CFG 0x500
1642 typedef union _RF_CSR_CFG_STRUC {
1644 UINT RF_CSR_DATA:8; // DATA
1645 UINT TESTCSR_RFACC_REGNUM:5; // RF register ID
1646 UINT Rsvd2:3; // Reserved
1647 UINT RF_CSR_WR:1; // 0: read 1: write
1648 UINT RF_CSR_KICK:1; // kick RF register read/write
1649 UINT Rsvd1:14; // Reserved
1652 } RF_CSR_CFG_STRUC, *PRF_CSR_CFG_STRUC;
1654 #endif // __RT28XX_H__