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
Ralink Wireless Chip MAC related definition & structures
35
-------- ---------- ----------------------------------------------
38
#ifndef __RTMP_MAC_H__
39
#define __RTMP_MAC_H__
43
// =================================================================================
44
// TX / RX ring descriptor format
45
// =================================================================================
47
// the first 24-byte in TXD is called TXINFO and will be DMAed to MAC block through TXFIFO.
48
// MAC block use this TXINFO to control the transmission behavior of this frame.
55
// TXD Wireless Information format for Tx ring and Mgmt Ring
57
//txop : for txop mode
58
// 0:txop for the MPDU frame will be handles by ASIC by register
59
// 1/2/3:the MPDU frame is send after PIFS/backoff/SIFS
61
typedef struct PACKED _TXWI_STRUC {
68
UINT32 STBC:2; //channel bandwidth 20MHz or 40 MHz
70
UINT32 BW:1; //channel bandwidth 20MHz or 40 MHz
74
UINT32 txop:2; //tx back off mode 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs only when previous frame exchange is successful.
80
UINT32 MIMOps:1; // the remote peer is in dynamic MIMO-PS mode
81
UINT32 FRAG:1; // 1 to inform TKIP engine this is a fragment.
84
UINT32 MPDUtotalByteCount:12;
85
UINT32 WirelessCliID:8;
93
} TXWI_STRUC, *PTXWI_STRUC;
95
typedef struct PACKED _TXWI_STRUC {
97
// ex: 00 03 00 40 means txop = 3, PHYMODE = 1
98
UINT32 FRAG:1; // 1 to inform TKIP engine this is a fragment.
99
UINT32 MIMOps:1; // the remote peer is in dynamic MIMO-PS mode
104
UINT32 MpduDensity:3;
105
UINT32 txop:2; //FOR "THIS" frame. 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs only when previous frame exchange is successful.
109
UINT32 BW:1; //channel bandwidth 20MHz or 40 MHz
111
UINT32 STBC:2; // 1: STBC support MCS =0-7, 2,3 : RESERVE
113
// UINT32 rsv2:2; //channel bandwidth 20MHz or 40 MHz
115
UINT32 TxBF:1; // 3*3
118
// ex: 1c ff 38 00 means ACK=0, BAWinSize=7, MPDUtotalByteCount = 0x38
122
UINT32 WirelessCliID:8;
123
UINT32 MPDUtotalByteCount:12;
129
} TXWI_STRUC, *PTXWI_STRUC;
134
// RXWI wireless information format, in PBF. invisible in driver.
137
typedef struct PACKED _RXWI_STRUC {
140
UINT32 MPDUtotalByteCount:12;
144
UINT32 WirelessCliID:8;
146
UINT32 PHYMODE:2; // 1: this RX frame is unicast to me
162
UINT32 FOFFSET:8; // RT35xx
165
} RXWI_STRUC, *PRXWI_STRUC;
167
typedef struct PACKED _RXWI_STRUC {
169
UINT32 WirelessCliID:8;
173
UINT32 MPDUtotalByteCount:12;
183
UINT32 PHYMODE:2; // 1: this RX frame is unicast to me
192
UINT32 FOFFSET:8; // RT35xx
195
} RXWI_STRUC, *PRXWI_STRUC;
199
// =================================================================================
201
// =================================================================================
205
// SCH/DMA registers - base address 0x0200
207
// INT_SOURCE_CSR: Interrupt source register. Write one to clear corresponding bit
209
#define DMA_CSR0 0x200
210
#define INT_SOURCE_CSR 0x200
212
typedef union _INT_SOURCE_CSR_STRUC {
214
#ifdef TONE_RADAR_DETECT_SUPPORT
218
#else // original source code
220
#endif // TONE_RADAR_DETECT_SUPPORT //
224
UINT32 AutoWakeup:1;//bit14
225
UINT32 TXFifoStatusInt:1;//FIFO Statistics is full, sw should read 0x171c
228
UINT32 RxTxCoherent:1;
229
UINT32 MCUCommandINT:1;
230
UINT32 MgmtDmaDone:1;
231
UINT32 HccaDmaDone:1;
237
UINT32 TxDelayINT:1; //delayed interrupt, not interrupt until several int or time limit hit
238
UINT32 RxDelayINT:1; //dealyed interrupt
241
} INT_SOURCE_CSR_STRUC, *PINT_SOURCE_CSR_STRUC;
243
typedef union _INT_SOURCE_CSR_STRUC {
248
UINT32 Ac0DmaDone:1;//4
252
UINT32 HccaDmaDone:1; // bit7
253
UINT32 MgmtDmaDone:1;
254
UINT32 MCUCommandINT:1;//bit 9
255
UINT32 RxTxCoherent:1;
258
UINT32 TXFifoStatusInt:1;//FIFO Statistics is full, sw should read 0x171c
259
UINT32 AutoWakeup:1;//bit14
261
UINT32 RxCoherent:1;//bit16
263
#ifdef TONE_RADAR_DETECT_SUPPORT
269
#endif // TONE_RADAR_DETECT_SUPPORT //
272
} INT_SOURCE_CSR_STRUC, *PINT_SOURCE_CSR_STRUC;
276
// INT_MASK_CSR: Interrupt MASK register. 1: the interrupt is mask OFF
278
#define INT_MASK_CSR 0x204
280
typedef union _INT_MASK_CSR_STRUC {
284
#ifdef TONE_RADAR_DETECT_SUPPORT
290
#endif // TONE_RADAR_DETECT_SUPPORT //
291
UINT32 MCUCommandINT:1;
292
UINT32 MgmtDmaDone:1;
293
UINT32 HccaDmaDone:1;
300
UINT32 RXDelay_INT_MSK:1;
303
}INT_MASK_CSR_STRUC, *PINT_MASK_CSR_STRUC;
305
typedef union _INT_MASK_CSR_STRUC {
307
UINT32 RXDelay_INT_MSK:1;
314
UINT32 HccaDmaDone:1;
315
UINT32 MgmtDmaDone:1;
316
UINT32 MCUCommandINT:1;
317
#ifdef TONE_RADAR_DETECT_SUPPORT
323
#endif // TONE_RADAR_DETECT_SUPPORT //
328
} INT_MASK_CSR_STRUC, *PINT_MASK_CSR_STRUC;
331
#define WPDMA_GLO_CFG 0x208
333
typedef union _WPDMA_GLO_CFG_STRUC {
335
UINT32 HDR_SEG_LEN:16;
336
UINT32 RXHdrScater:8;
338
UINT32 EnTXWriteBackDDONE:1;
339
UINT32 WPDMABurstSIZE:2;
341
UINT32 EnableRxDMA:1;
343
UINT32 EnableTxDMA:1;
346
}WPDMA_GLO_CFG_STRUC, *PWPDMA_GLO_CFG_STRUC;
348
typedef union _WPDMA_GLO_CFG_STRUC {
350
UINT32 EnableTxDMA:1;
352
UINT32 EnableRxDMA:1;
354
UINT32 WPDMABurstSIZE:2;
355
UINT32 EnTXWriteBackDDONE:1;
357
UINT32 RXHdrScater:8;
358
UINT32 HDR_SEG_LEN:16;
361
} WPDMA_GLO_CFG_STRUC, *PWPDMA_GLO_CFG_STRUC;
364
#define WPDMA_RST_IDX 0x20c
366
typedef union _WPDMA_RST_IDX_STRUC {
369
UINT32 RST_DRX_IDX0:1;
371
UINT32 RST_DTX_IDX5:1;
372
UINT32 RST_DTX_IDX4:1;
373
UINT32 RST_DTX_IDX3:1;
374
UINT32 RST_DTX_IDX2:1;
375
UINT32 RST_DTX_IDX1:1;
376
UINT32 RST_DTX_IDX0:1;
379
}WPDMA_RST_IDX_STRUC, *PWPDMA_RST_IDX_STRUC;
381
typedef union _WPDMA_RST_IDX_STRUC {
383
UINT32 RST_DTX_IDX0:1;
384
UINT32 RST_DTX_IDX1:1;
385
UINT32 RST_DTX_IDX2:1;
386
UINT32 RST_DTX_IDX3:1;
387
UINT32 RST_DTX_IDX4:1;
388
UINT32 RST_DTX_IDX5:1;
390
UINT32 RST_DRX_IDX0:1;
394
} WPDMA_RST_IDX_STRUC, *PWPDMA_RST_IDX_STRUC;
396
#define DELAY_INT_CFG 0x0210
398
typedef union _DELAY_INT_CFG_STRUC {
400
UINT32 TXDLY_INT_EN:1;
402
UINT32 TXMAX_PTIME:8;
403
UINT32 RXDLY_INT_EN:1;
405
UINT32 RXMAX_PTIME:8;
408
}DELAY_INT_CFG_STRUC, *PDELAY_INT_CFG_STRUC;
410
typedef union _DELAY_INT_CFG_STRUC {
412
UINT32 RXMAX_PTIME:8;
414
UINT32 RXDLY_INT_EN:1;
415
UINT32 TXMAX_PTIME:8;
417
UINT32 TXDLY_INT_EN:1;
420
} DELAY_INT_CFG_STRUC, *PDELAY_INT_CFG_STRUC;
422
#define WMM_AIFSN_CFG 0x0214
424
typedef union _AIFSN_CSR_STRUC {
427
UINT32 Aifsn3:4; // for AC_VO
428
UINT32 Aifsn2:4; // for AC_VI
429
UINT32 Aifsn1:4; // for AC_BK
430
UINT32 Aifsn0:4; // for AC_BE
433
} AIFSN_CSR_STRUC, *PAIFSN_CSR_STRUC;
435
typedef union _AIFSN_CSR_STRUC {
437
UINT32 Aifsn0:4; // for AC_BE
438
UINT32 Aifsn1:4; // for AC_BK
439
UINT32 Aifsn2:4; // for AC_VI
440
UINT32 Aifsn3:4; // for AC_VO
444
} AIFSN_CSR_STRUC, *PAIFSN_CSR_STRUC;
447
// CWMIN_CSR: CWmin for each EDCA AC
449
#define WMM_CWMIN_CFG 0x0218
451
typedef union _CWMIN_CSR_STRUC {
454
UINT32 Cwmin3:4; // for AC_VO
455
UINT32 Cwmin2:4; // for AC_VI
456
UINT32 Cwmin1:4; // for AC_BK
457
UINT32 Cwmin0:4; // for AC_BE
460
} CWMIN_CSR_STRUC, *PCWMIN_CSR_STRUC;
462
typedef union _CWMIN_CSR_STRUC {
464
UINT32 Cwmin0:4; // for AC_BE
465
UINT32 Cwmin1:4; // for AC_BK
466
UINT32 Cwmin2:4; // for AC_VI
467
UINT32 Cwmin3:4; // for AC_VO
471
} CWMIN_CSR_STRUC, *PCWMIN_CSR_STRUC;
475
// CWMAX_CSR: CWmin for each EDCA AC
477
#define WMM_CWMAX_CFG 0x021c
479
typedef union _CWMAX_CSR_STRUC {
482
UINT32 Cwmax3:4; // for AC_VO
483
UINT32 Cwmax2:4; // for AC_VI
484
UINT32 Cwmax1:4; // for AC_BK
485
UINT32 Cwmax0:4; // for AC_BE
488
} CWMAX_CSR_STRUC, *PCWMAX_CSR_STRUC;
490
typedef union _CWMAX_CSR_STRUC {
492
UINT32 Cwmax0:4; // for AC_BE
493
UINT32 Cwmax1:4; // for AC_BK
494
UINT32 Cwmax2:4; // for AC_VI
495
UINT32 Cwmax3:4; // for AC_VO
499
} CWMAX_CSR_STRUC, *PCWMAX_CSR_STRUC;
504
// AC_TXOP_CSR0: AC_BK/AC_BE TXOP register
506
#define WMM_TXOP0_CFG 0x0220
508
typedef union _AC_TXOP_CSR0_STRUC {
510
USHORT Ac1Txop; // for AC_BE, in unit of 32us
511
USHORT Ac0Txop; // for AC_BK, in unit of 32us
514
} AC_TXOP_CSR0_STRUC, *PAC_TXOP_CSR0_STRUC;
516
typedef union _AC_TXOP_CSR0_STRUC {
518
USHORT Ac0Txop; // for AC_BK, in unit of 32us
519
USHORT Ac1Txop; // for AC_BE, in unit of 32us
522
} AC_TXOP_CSR0_STRUC, *PAC_TXOP_CSR0_STRUC;
526
// AC_TXOP_CSR1: AC_VO/AC_VI TXOP register
528
#define WMM_TXOP1_CFG 0x0224
530
typedef union _AC_TXOP_CSR1_STRUC {
532
USHORT Ac3Txop; // for AC_VO, in unit of 32us
533
USHORT Ac2Txop; // for AC_VI, in unit of 32us
536
} AC_TXOP_CSR1_STRUC, *PAC_TXOP_CSR1_STRUC;
538
typedef union _AC_TXOP_CSR1_STRUC {
540
USHORT Ac2Txop; // for AC_VI, in unit of 32us
541
USHORT Ac3Txop; // for AC_VO, in unit of 32us
544
} AC_TXOP_CSR1_STRUC, *PAC_TXOP_CSR1_STRUC;
548
#define RINGREG_DIFF 0x10
549
#define GPIO_CTRL_CFG 0x0228 //MAC_CSR13
550
#define MCU_CMD_CFG 0x022c
551
#define TX_BASE_PTR0 0x0230 //AC_BK base address
552
#define TX_MAX_CNT0 0x0234
553
#define TX_CTX_IDX0 0x0238
554
#define TX_DTX_IDX0 0x023c
555
#define TX_BASE_PTR1 0x0240 //AC_BE base address
556
#define TX_MAX_CNT1 0x0244
557
#define TX_CTX_IDX1 0x0248
558
#define TX_DTX_IDX1 0x024c
559
#define TX_BASE_PTR2 0x0250 //AC_VI base address
560
#define TX_MAX_CNT2 0x0254
561
#define TX_CTX_IDX2 0x0258
562
#define TX_DTX_IDX2 0x025c
563
#define TX_BASE_PTR3 0x0260 //AC_VO base address
564
#define TX_MAX_CNT3 0x0264
565
#define TX_CTX_IDX3 0x0268
566
#define TX_DTX_IDX3 0x026c
567
#define TX_BASE_PTR4 0x0270 //HCCA base address
568
#define TX_MAX_CNT4 0x0274
569
#define TX_CTX_IDX4 0x0278
570
#define TX_DTX_IDX4 0x027c
571
#define TX_BASE_PTR5 0x0280 //MGMT base address
572
#define TX_MAX_CNT5 0x0284
573
#define TX_CTX_IDX5 0x0288
574
#define TX_DTX_IDX5 0x028c
575
#define TX_MGMTMAX_CNT TX_MAX_CNT5
576
#define TX_MGMTCTX_IDX TX_CTX_IDX5
577
#define TX_MGMTDTX_IDX TX_DTX_IDX5
578
#define RX_BASE_PTR 0x0290 //RX base address
579
#define RX_MAX_CNT 0x0294
580
#define RX_CRX_IDX 0x0298
581
#define RX_DRX_IDX 0x029c
584
#define USB_DMA_CFG 0x02a0
586
typedef union _USB_DMA_CFG_STRUC {
588
UINT32 TxBusy:1; //USB DMA TX FSM busy . debug only
589
UINT32 RxBusy:1; //USB DMA RX FSM busy . debug only
590
UINT32 EpoutValid:6; //OUT endpoint data valid. debug only
591
UINT32 TxBulkEn:1; //Enable USB DMA Tx
592
UINT32 RxBulkEn:1; //Enable USB DMA Rx
593
UINT32 RxBulkAggEn:1; //Enable Rx Bulk Aggregation
594
UINT32 TxopHalt:1; //Halt TXOP count down when TX buffer is full.
595
UINT32 TxClear:1; //Clear USB DMA TX path
597
UINT32 phyclear:1; //phy watch dog enable. write 1
598
UINT32 RxBulkAggLmt:8; //Rx Bulk Aggregation Limit in unit of 1024 bytes
599
UINT32 RxBulkAggTOut:8; //Rx Bulk Aggregation TimeOut in unit of 33ns
602
} USB_DMA_CFG_STRUC, *PUSB_DMA_CFG_STRUC;
604
typedef union _USB_DMA_CFG_STRUC {
606
UINT32 RxBulkAggTOut:8; //Rx Bulk Aggregation TimeOut in unit of 33ns
607
UINT32 RxBulkAggLmt:8; //Rx Bulk Aggregation Limit in unit of 256 bytes
608
UINT32 phyclear:1; //phy watch dog enable. write 1
610
UINT32 TxClear:1; //Clear USB DMA TX path
611
UINT32 TxopHalt:1; //Halt TXOP count down when TX buffer is full.
612
UINT32 RxBulkAggEn:1; //Enable Rx Bulk Aggregation
613
UINT32 RxBulkEn:1; //Enable USB DMA Rx
614
UINT32 TxBulkEn:1; //Enable USB DMA Tx
615
UINT32 EpoutValid:6; //OUT endpoint data valid
616
UINT32 RxBusy:1; //USB DMA RX FSM busy
617
UINT32 TxBusy:1; //USB DMA TX FSM busy
620
} USB_DMA_CFG_STRUC, *PUSB_DMA_CFG_STRUC;
628
// Most are for debug. Driver doesn't touch PBF register.
629
#define PBF_SYS_CTRL 0x0400
630
#define PBF_CFG 0x0408
631
#define PBF_MAX_PCNT 0x040C
632
#define PBF_CTRL 0x0410
633
#define PBF_INT_STA 0x0414
634
#define PBF_INT_ENA 0x0418
635
#define TXRXQ_PCNT 0x0438
636
#define PBF_DBG 0x043c
637
#define PBF_CAP_CTRL 0x0440
640
#ifdef RTMP_EFUSE_SUPPORT
642
#define EFUSE_CTRL 0x0580
643
#define EFUSE_DATA0 0x0590
644
#define EFUSE_DATA1 0x0594
645
#define EFUSE_DATA2 0x0598
646
#define EFUSE_DATA3 0x059c
647
#endif // RTMP_EFUSE_SUPPORT //
650
#define OSC_CTRL 0x5a4
651
#define PCIE_PHY_TX_ATTENUATION_CTRL 0x05C8
652
#define LDO_CFG0 0x05d4
653
#define GPIO_SWITCH 0x05dc
660
// 4.1 MAC SYSTEM configuration registers (offset:0x1000)
662
#define MAC_CSR0 0x1000
664
typedef union _ASIC_VER_ID_STRUC {
666
USHORT ASICVer; // version : 2860
667
USHORT ASICRev; // reversion : 0
670
} ASIC_VER_ID_STRUC, *PASIC_VER_ID_STRUC;
672
typedef union _ASIC_VER_ID_STRUC {
674
USHORT ASICRev; // reversion : 0
675
USHORT ASICVer; // version : 2860
678
} ASIC_VER_ID_STRUC, *PASIC_VER_ID_STRUC;
680
#define MAC_SYS_CTRL 0x1004 //MAC_CSR1
681
#define MAC_ADDR_DW0 0x1008 // MAC ADDR DW0
682
#define MAC_ADDR_DW1 0x100c // MAC ADDR DW1
684
// MAC_CSR2: STA MAC register 0
687
typedef union _MAC_DW0_STRUC {
689
UCHAR Byte3; // MAC address byte 3
690
UCHAR Byte2; // MAC address byte 2
691
UCHAR Byte1; // MAC address byte 1
692
UCHAR Byte0; // MAC address byte 0
695
} MAC_DW0_STRUC, *PMAC_DW0_STRUC;
697
typedef union _MAC_DW0_STRUC {
699
UCHAR Byte0; // MAC address byte 0
700
UCHAR Byte1; // MAC address byte 1
701
UCHAR Byte2; // MAC address byte 2
702
UCHAR Byte3; // MAC address byte 3
705
} MAC_DW0_STRUC, *PMAC_DW0_STRUC;
709
// MAC_CSR3: STA MAC register 1
712
typedef union _MAC_DW1_STRUC {
716
UCHAR Byte5; // MAC address byte 5
717
UCHAR Byte4; // MAC address byte 4
720
} MAC_DW1_STRUC, *PMAC_DW1_STRUC;
722
typedef union _MAC_DW1_STRUC {
724
UCHAR Byte4; // MAC address byte 4
725
UCHAR Byte5; // MAC address byte 5
730
} MAC_DW1_STRUC, *PMAC_DW1_STRUC;
733
#define MAC_BSSID_DW0 0x1010 // MAC BSSID DW0
734
#define MAC_BSSID_DW1 0x1014 // MAC BSSID DW1
737
// MAC_CSR5: BSSID register 1
740
typedef union _MAC_CSR5_STRUC {
744
USHORT BssIdMode:2; // 0: one BSSID, 10: 4 BSSID, 01: 2 BSSID , 11: 8BSSID
745
UCHAR Byte5; // BSSID byte 5
746
UCHAR Byte4; // BSSID byte 4
749
} MAC_CSR5_STRUC, *PMAC_CSR5_STRUC;
751
typedef union _MAC_CSR5_STRUC {
753
UCHAR Byte4; // BSSID byte 4
754
UCHAR Byte5; // BSSID byte 5
755
USHORT BssIdMask:2; // 0: one BSSID, 10: 4 BSSID, 01: 2 BSSID , 11: 8BSSID
760
} MAC_CSR5_STRUC, *PMAC_CSR5_STRUC;
763
#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
764
#define BBP_CSR_CFG 0x101c //
766
// BBP_CSR_CFG: BBP serial control register
769
typedef union _BBP_CSR_CFG_STRUC {
772
UINT32 BBP_RW_MODE:1; // 0: use serial mode 1:parallel
773
UINT32 BBP_PAR_DUR:1; // 0: 4 MAC clock cycles 1: 8 MAC clock cycles
774
UINT32 Busy:1; // 1: ASIC is busy execute BBP programming.
775
UINT32 fRead:1; // 0: Write BBP, 1: Read BBP
776
UINT32 RegNum:8; // Selected BBP register
777
UINT32 Value:8; // Register value to program into BBP
780
} BBP_CSR_CFG_STRUC, *PBBP_CSR_CFG_STRUC;
782
typedef union _BBP_CSR_CFG_STRUC {
784
UINT32 Value:8; // Register value to program into BBP
785
UINT32 RegNum:8; // Selected BBP register
786
UINT32 fRead:1; // 0: Write BBP, 1: Read BBP
787
UINT32 Busy:1; // 1: ASIC is busy execute BBP programming.
788
UINT32 BBP_PAR_DUR:1; // 0: 4 MAC clock cycles 1: 8 MAC clock cycles
789
UINT32 BBP_RW_MODE:1; // 0: use serial mode 1:parallel
793
} BBP_CSR_CFG_STRUC, *PBBP_CSR_CFG_STRUC;
795
#define RF_CSR_CFG0 0x1020
797
// RF_CSR_CFG: RF control register
800
typedef union _RF_CSR_CFG0_STRUC {
802
UINT32 Busy:1; // 0: idle 1: 8busy
803
UINT32 Sel:1; // 0:RF_LE0 activate 1:RF_LE1 activate
804
UINT32 StandbyMode:1; // 0: high when stand by 1: low when standby
805
UINT32 bitwidth:5; // Selected BBP register
806
UINT32 RegIdAndContent:24; // Register value to program into BBP
809
} RF_CSR_CFG0_STRUC, *PRF_CSR_CFG0_STRUC;
811
typedef union _RF_CSR_CFG0_STRUC {
813
UINT32 RegIdAndContent:24; // Register value to program into BBP
814
UINT32 bitwidth:5; // Selected BBP register
815
UINT32 StandbyMode:1; // 0: high when stand by 1: low when standby
816
UINT32 Sel:1; // 0:RF_LE0 activate 1:RF_LE1 activate
817
UINT32 Busy:1; // 0: idle 1: 8busy
820
} RF_CSR_CFG0_STRUC, *PRF_CSR_CFG0_STRUC;
822
#define RF_CSR_CFG1 0x1024
824
typedef union _RF_CSR_CFG1_STRUC {
826
UINT32 rsv:7; // 0: idle 1: 8busy
827
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)
828
UINT32 RegIdAndContent:24; // Register value to program into BBP
831
} RF_CSR_CFG1_STRUC, *PRF_CSR_CFG1_STRUC;
833
typedef union _RF_CSR_CFG1_STRUC {
835
UINT32 RegIdAndContent:24; // Register value to program into BBP
836
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)
837
UINT32 rsv:7; // 0: idle 1: 8busy
840
} RF_CSR_CFG1_STRUC, *PRF_CSR_CFG1_STRUC;
842
#define RF_CSR_CFG2 0x1028 //
844
typedef union _RF_CSR_CFG2_STRUC {
846
UINT32 rsv:8; // 0: idle 1: 8busy
847
UINT32 RegIdAndContent:24; // Register value to program into BBP
850
} RF_CSR_CFG2_STRUC, *PRF_CSR_CFG2_STRUC;
852
typedef union _RF_CSR_CFG2_STRUC {
854
UINT32 RegIdAndContent:24; // Register value to program into BBP
855
UINT32 rsv:8; // 0: idle 1: 8busy
858
} RF_CSR_CFG2_STRUC, *PRF_CSR_CFG2_STRUC;
860
#define LED_CFG 0x102c // MAC_CSR14
862
typedef union _LED_CFG_STRUC {
865
UINT32 LedPolar:1; // Led Polarity. 0: active low1: active high
866
UINT32 YLedMode:2; // yellow Led Mode
867
UINT32 GLedMode:2; // green Led Mode
868
UINT32 RLedMode:2; // red Led Mode 0: off1: blinking upon TX2: periodic slow blinking3: always on
870
UINT32 SlowBlinkPeriod:6; // slow blinking period. unit:1ms
871
UINT32 OffPeriod:8; // blinking off period unit 1ms
872
UINT32 OnPeriod:8; // blinking on period unit 1ms
875
} LED_CFG_STRUC, *PLED_CFG_STRUC;
877
typedef union _LED_CFG_STRUC {
879
UINT32 OnPeriod:8; // blinking on period unit 1ms
880
UINT32 OffPeriod:8; // blinking off period unit 1ms
881
UINT32 SlowBlinkPeriod:6; // slow blinking period. unit:1ms
883
UINT32 RLedMode:2; // red Led Mode 0: off1: blinking upon TX2: periodic slow blinking3: always on
884
UINT32 GLedMode:2; // green Led Mode
885
UINT32 YLedMode:2; // yellow Led Mode
886
UINT32 LedPolar:1; // Led Polarity. 0: active low1: active high
890
} LED_CFG_STRUC, *PLED_CFG_STRUC;
893
// 4.2 MAC TIMING configuration registers (offset:0x1100)
895
#define XIFS_TIME_CFG 0x1100 // MAC_CSR8 MAC_CSR9
897
typedef union _IFS_SLOT_CFG_STRUC {
900
UINT32 BBRxendEnable:1; // reference RXEND signal to begin XIFS defer
901
UINT32 EIFS:9; // unit 1us
902
UINT32 OfdmXifsTime:4; //OFDM SIFS. unit 1us. Applied after OFDM RX when MAC doesn't reference BBP signal BBRXEND
903
UINT32 OfdmSifsTime:8; // unit 1us. Applied after OFDM RX/TX
904
UINT32 CckmSifsTime:8; // unit 1us. Applied after CCK RX/TX
907
} IFS_SLOT_CFG_STRUC, *PIFS_SLOT_CFG_STRUC;
909
typedef union _IFS_SLOT_CFG_STRUC {
911
UINT32 CckmSifsTime:8; // unit 1us. Applied after CCK RX/TX
912
UINT32 OfdmSifsTime:8; // unit 1us. Applied after OFDM RX/TX
913
UINT32 OfdmXifsTime:4; //OFDM SIFS. unit 1us. Applied after OFDM RX when MAC doesn't reference BBP signal BBRXEND
914
UINT32 EIFS:9; // unit 1us
915
UINT32 BBRxendEnable:1; // reference RXEND signal to begin XIFS defer
919
} IFS_SLOT_CFG_STRUC, *PIFS_SLOT_CFG_STRUC;
922
#define BKOFF_SLOT_CFG 0x1104 // mac_csr9 last 8 bits
923
#define NAV_TIME_CFG 0x1108 // NAV (MAC_CSR15)
924
#define CH_TIME_CFG 0x110C // Count as channel busy
925
#define PBF_LIFE_TIMER 0x1110 //TX/RX MPDU timestamp timer (free run)Unit: 1us
926
#define BCN_TIME_CFG 0x1114 // TXRX_CSR9
928
#define BCN_OFFSET0 0x042C
929
#define BCN_OFFSET1 0x0430
932
// BCN_TIME_CFG : Synchronization control register
935
typedef union _BCN_TIME_CFG_STRUC {
937
UINT32 TxTimestampCompensate:8;
939
UINT32 bBeaconGen:1; // Enable beacon generator
940
UINT32 bTBTTEnable:1;
941
UINT32 TsfSyncMode:2; // Enable TSF sync, 00: disable, 01: infra mode, 10: ad-hoc mode
942
UINT32 bTsfTicking:1; // Enable TSF auto counting
943
UINT32 BeaconInterval:16; // in unit of 1/16 TU
946
} BCN_TIME_CFG_STRUC, *PBCN_TIME_CFG_STRUC;
948
typedef union _BCN_TIME_CFG_STRUC {
950
UINT32 BeaconInterval:16; // in unit of 1/16 TU
951
UINT32 bTsfTicking:1; // Enable TSF auto counting
952
UINT32 TsfSyncMode:2; // Enable TSF sync, 00: disable, 01: infra mode, 10: ad-hoc mode
953
UINT32 bTBTTEnable:1;
954
UINT32 bBeaconGen:1; // Enable beacon generator
956
UINT32 TxTimestampCompensate:8;
959
} BCN_TIME_CFG_STRUC, *PBCN_TIME_CFG_STRUC;
961
#define TBTT_SYNC_CFG 0x1118 // txrx_csr10
962
#define TSF_TIMER_DW0 0x111C // Local TSF timer lsb 32 bits. Read-only
963
#define TSF_TIMER_DW1 0x1120 // msb 32 bits. Read-only.
964
#define TBTT_TIMER 0x1124 // TImer remains till next TBTT. Read-only. TXRX_CSR14
965
#define INT_TIMER_CFG 0x1128 //
966
#define INT_TIMER_EN 0x112c // GP-timer and pre-tbtt Int enable
967
#define CH_IDLE_STA 0x1130 // channel idle time
968
#define CH_BUSY_STA 0x1134 // channle busy time
970
// 4.2 MAC POWER configuration registers (offset:0x1200)
972
#define MAC_STATUS_CFG 0x1200 // old MAC_CSR12
973
#define PWR_PIN_CFG 0x1204 // old MAC_CSR12
974
#define AUTO_WAKEUP_CFG 0x1208 // old MAC_CSR10
976
// AUTO_WAKEUP_CFG: Manual power control / status register
979
typedef union _AUTO_WAKEUP_STRUC {
982
UINT32 EnableAutoWakeup:1; // 0:sleep, 1:awake
983
UINT32 NumofSleepingTbtt:7; // ForceWake has high privilege than PutToSleep when both set
984
UINT32 AutoLeadTime:8;
987
} AUTO_WAKEUP_STRUC, *PAUTO_WAKEUP_STRUC;
989
typedef union _AUTO_WAKEUP_STRUC {
991
UINT32 AutoLeadTime:8;
992
UINT32 NumofSleepingTbtt:7; // ForceWake has high privilege than PutToSleep when both set
993
UINT32 EnableAutoWakeup:1; // 0:sleep, 1:awake
997
} AUTO_WAKEUP_STRUC, *PAUTO_WAKEUP_STRUC;
1000
// 4.3 MAC TX configuration registers (offset:0x1300)
1003
#define EDCA_AC0_CFG 0x1300 //AC_TXOP_CSR0 0x3474
1004
#define EDCA_AC1_CFG 0x1304
1005
#define EDCA_AC2_CFG 0x1308
1006
#define EDCA_AC3_CFG 0x130c
1007
#ifdef RT_BIG_ENDIAN
1008
typedef union _EDCA_AC_CFG_STRUC {
1011
UINT32 Cwmax:4; //unit power of 2
1013
UINT32 Aifsn:4; // # of slot time
1014
UINT32 AcTxop:8; // in unit of 32us
1017
} EDCA_AC_CFG_STRUC, *PEDCA_AC_CFG_STRUC;
1019
typedef union _EDCA_AC_CFG_STRUC {
1021
UINT32 AcTxop:8; // in unit of 32us
1022
UINT32 Aifsn:4; // # of slot time
1024
UINT32 Cwmax:4; //unit power of 2
1028
} EDCA_AC_CFG_STRUC, *PEDCA_AC_CFG_STRUC;
1031
#define EDCA_TID_AC_MAP 0x1310
1032
#define TX_PWR_CFG_0 0x1314
1033
#define TX_PWR_CFG_1 0x1318
1034
#define TX_PWR_CFG_2 0x131C
1035
#define TX_PWR_CFG_3 0x1320
1036
#define TX_PWR_CFG_4 0x1324
1037
#define TX_PIN_CFG 0x1328
1038
#define TX_BAND_CFG 0x132c // 0x1 use upper 20MHz. 0 juse lower 20MHz
1039
#define TX_SW_CFG0 0x1330
1040
#define TX_SW_CFG1 0x1334
1041
#define TX_SW_CFG2 0x1338
1042
#define TXOP_THRES_CFG 0x133c
1043
#define TXOP_CTRL_CFG 0x1340
1044
#define TX_RTS_CFG 0x1344
1046
#ifdef RT_BIG_ENDIAN
1047
typedef union _TX_RTS_CFG_STRUC {
1050
UINT32 RtsFbkEn:1; // enable rts rate fallback
1051
UINT32 RtsThres:16; // unit:byte
1052
UINT32 AutoRtsRetryLimit:8;
1055
} TX_RTS_CFG_STRUC, *PTX_RTS_CFG_STRUC;
1057
typedef union _TX_RTS_CFG_STRUC {
1059
UINT32 AutoRtsRetryLimit:8;
1060
UINT32 RtsThres:16; // unit:byte
1061
UINT32 RtsFbkEn:1; // enable rts rate fallback
1062
UINT32 rsv:7; // 1: HT non-STBC control frame enable
1065
} TX_RTS_CFG_STRUC, *PTX_RTS_CFG_STRUC;
1067
#define TX_TIMEOUT_CFG 0x1348
1068
#ifdef RT_BIG_ENDIAN
1069
typedef union _TX_TIMEOUT_CFG_STRUC {
1072
UINT32 TxopTimeout:8; //TXOP timeout value for TXOP truncation. It is recommended that (SLOT_TIME) > (TX_OP_TIMEOUT) > (RX_ACK_TIMEOUT)
1073
UINT32 RxAckTimeout:8; // unit:slot. Used for TX precedure
1074
UINT32 MpduLifeTime:4; // expiration time = 2^(9+MPDU LIFE TIME) us
1078
} TX_TIMEOUT_CFG_STRUC, *PTX_TIMEOUT_CFG_STRUC;
1080
typedef union _TX_TIMEOUT_CFG_STRUC {
1083
UINT32 MpduLifeTime:4; // expiration time = 2^(9+MPDU LIFE TIME) us
1084
UINT32 RxAckTimeout:8; // unit:slot. Used for TX precedure
1085
UINT32 TxopTimeout:8; //TXOP timeout value for TXOP truncation. It is recommended that (SLOT_TIME) > (TX_OP_TIMEOUT) > (RX_ACK_TIMEOUT)
1086
UINT32 rsv2:8; // 1: HT non-STBC control frame enable
1089
} TX_TIMEOUT_CFG_STRUC, *PTX_TIMEOUT_CFG_STRUC;
1091
#define TX_RTY_CFG 0x134c
1092
#ifdef RT_BIG_ENDIAN
1093
typedef union PACKED _TX_RTY_CFG_STRUC {
1096
UINT32 TxautoFBEnable:1; // Tx retry PHY rate auto fallback enable
1097
UINT32 AggRtyMode:1; // Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer
1098
UINT32 NonAggRtyMode:1; // Non-Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer
1099
UINT32 LongRtyThre:12; // Long retry threshoold
1100
UINT32 LongRtyLimit:8; //long retry limit
1101
UINT32 ShortRtyLimit:8; // short retry limit
1105
} TX_RTY_CFG_STRUC, *PTX_RTY_CFG_STRUC;
1107
typedef union PACKED _TX_RTY_CFG_STRUC {
1109
UINT32 ShortRtyLimit:8; // short retry limit
1110
UINT32 LongRtyLimit:8; //long retry limit
1111
UINT32 LongRtyThre:12; // Long retry threshoold
1112
UINT32 NonAggRtyMode:1; // Non-Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer
1113
UINT32 AggRtyMode:1; // Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer
1114
UINT32 TxautoFBEnable:1; // Tx retry PHY rate auto fallback enable
1115
UINT32 rsv:1; // 1: HT non-STBC control frame enable
1118
} TX_RTY_CFG_STRUC, *PTX_RTY_CFG_STRUC;
1120
#define TX_LINK_CFG 0x1350
1121
#ifdef RT_BIG_ENDIAN
1122
typedef union PACKED _TX_LINK_CFG_STRUC {
1124
UINT32 RemotMFS:8; //remote MCS feedback sequence number
1125
UINT32 RemotMFB:8; // remote MCS feedback
1127
UINT32 TxCFAckEn:1; // Piggyback CF-ACK enable
1128
UINT32 TxRDGEn:1; // RDG TX enable
1129
UINT32 TxMRQEn:1; // MCS request TX enable
1130
UINT32 RemoteUMFSEnable:1; // remote unsolicit MFB enable. 0: not apply remote remote unsolicit (MFS=7)
1131
UINT32 MFBEnable:1; // TX apply remote MFB 1:enable
1132
UINT32 RemoteMFBLifeTime:8; //remote MFB life time. unit : 32us
1135
} TX_LINK_CFG_STRUC, *PTX_LINK_CFG_STRUC;
1137
typedef union PACKED _TX_LINK_CFG_STRUC {
1139
UINT32 RemoteMFBLifeTime:8; //remote MFB life time. unit : 32us
1140
UINT32 MFBEnable:1; // TX apply remote MFB 1:enable
1141
UINT32 RemoteUMFSEnable:1; // remote unsolicit MFB enable. 0: not apply remote remote unsolicit (MFS=7)
1142
UINT32 TxMRQEn:1; // MCS request TX enable
1143
UINT32 TxRDGEn:1; // RDG TX enable
1144
UINT32 TxCFAckEn:1; // Piggyback CF-ACK enable
1146
UINT32 RemotMFB:8; // remote MCS feedback
1147
UINT32 RemotMFS:8; //remote MCS feedback sequence number
1150
} TX_LINK_CFG_STRUC, *PTX_LINK_CFG_STRUC;
1152
#define HT_FBK_CFG0 0x1354
1153
#ifdef RT_BIG_ENDIAN
1154
typedef union PACKED _HT_FBK_CFG0_STRUC {
1166
} HT_FBK_CFG0_STRUC, *PHT_FBK_CFG0_STRUC;
1168
typedef union PACKED _HT_FBK_CFG0_STRUC {
1180
} HT_FBK_CFG0_STRUC, *PHT_FBK_CFG0_STRUC;
1182
#define HT_FBK_CFG1 0x1358
1183
#ifdef RT_BIG_ENDIAN
1184
typedef union _HT_FBK_CFG1_STRUC {
1186
UINT32 HTMCS15FBK:4;
1187
UINT32 HTMCS14FBK:4;
1188
UINT32 HTMCS13FBK:4;
1189
UINT32 HTMCS12FBK:4;
1190
UINT32 HTMCS11FBK:4;
1191
UINT32 HTMCS10FBK:4;
1196
} HT_FBK_CFG1_STRUC, *PHT_FBK_CFG1_STRUC;
1198
typedef union _HT_FBK_CFG1_STRUC {
1202
UINT32 HTMCS10FBK:4;
1203
UINT32 HTMCS11FBK:4;
1204
UINT32 HTMCS12FBK:4;
1205
UINT32 HTMCS13FBK:4;
1206
UINT32 HTMCS14FBK:4;
1207
UINT32 HTMCS15FBK:4;
1210
} HT_FBK_CFG1_STRUC, *PHT_FBK_CFG1_STRUC;
1212
#define LG_FBK_CFG0 0x135c
1213
#ifdef RT_BIG_ENDIAN
1214
typedef union _LG_FBK_CFG0_STRUC {
1216
UINT32 OFDMMCS7FBK:4; //initial value is 6
1217
UINT32 OFDMMCS6FBK:4; //initial value is 5
1218
UINT32 OFDMMCS5FBK:4; //initial value is 4
1219
UINT32 OFDMMCS4FBK:4; //initial value is 3
1220
UINT32 OFDMMCS3FBK:4; //initial value is 2
1221
UINT32 OFDMMCS2FBK:4; //initial value is 1
1222
UINT32 OFDMMCS1FBK:4; //initial value is 0
1223
UINT32 OFDMMCS0FBK:4; //initial value is 0
1226
} LG_FBK_CFG0_STRUC, *PLG_FBK_CFG0_STRUC;
1228
typedef union _LG_FBK_CFG0_STRUC {
1230
UINT32 OFDMMCS0FBK:4; //initial value is 0
1231
UINT32 OFDMMCS1FBK:4; //initial value is 0
1232
UINT32 OFDMMCS2FBK:4; //initial value is 1
1233
UINT32 OFDMMCS3FBK:4; //initial value is 2
1234
UINT32 OFDMMCS4FBK:4; //initial value is 3
1235
UINT32 OFDMMCS5FBK:4; //initial value is 4
1236
UINT32 OFDMMCS6FBK:4; //initial value is 5
1237
UINT32 OFDMMCS7FBK:4; //initial value is 6
1240
} LG_FBK_CFG0_STRUC, *PLG_FBK_CFG0_STRUC;
1242
#define LG_FBK_CFG1 0x1360
1243
#ifdef RT_BIG_ENDIAN
1244
typedef union _LG_FBK_CFG1_STRUC {
1247
UINT32 CCKMCS3FBK:4; //initial value is 2
1248
UINT32 CCKMCS2FBK:4; //initial value is 1
1249
UINT32 CCKMCS1FBK:4; //initial value is 0
1250
UINT32 CCKMCS0FBK:4; //initial value is 0
1253
} LG_FBK_CFG1_STRUC, *PLG_FBK_CFG1_STRUC;
1255
typedef union _LG_FBK_CFG1_STRUC {
1257
UINT32 CCKMCS0FBK:4; //initial value is 0
1258
UINT32 CCKMCS1FBK:4; //initial value is 0
1259
UINT32 CCKMCS2FBK:4; //initial value is 1
1260
UINT32 CCKMCS3FBK:4; //initial value is 2
1264
} LG_FBK_CFG1_STRUC, *PLG_FBK_CFG1_STRUC;
1268
//=======================================================
1269
//================ Protection Paramater================================
1270
//=======================================================
1271
#define CCK_PROT_CFG 0x1364 //CCK Protection
1272
#define ASIC_SHORTNAV 1
1273
#define ASIC_LONGNAV 2
1276
#ifdef RT_BIG_ENDIAN
1277
typedef union _PROT_CFG_STRUC {
1280
UINT32 RTSThEn:1; //RTS threshold enable on CCK TX
1281
UINT32 TxopAllowGF40:1; //CCK TXOP allowance.0:disallow.
1282
UINT32 TxopAllowGF20:1; //CCK TXOP allowance.0:disallow.
1283
UINT32 TxopAllowMM40:1; //CCK TXOP allowance.0:disallow.
1284
UINT32 TxopAllowMM20:1; //CCK TXOP allowance. 0:disallow.
1285
UINT32 TxopAllowOfdm:1; //CCK TXOP allowance.0:disallow.
1286
UINT32 TxopAllowCck:1; //CCK TXOP allowance.0:disallow.
1287
UINT32 ProtectNav:2; //TXOP protection type for CCK TX. 0:None, 1:ShortNAVprotect, 2:LongNAVProtect, 3:rsv
1288
UINT32 ProtectCtrl:2; //Protection control frame type for CCK TX. 1:RTS/CTS, 2:CTS-to-self, 0:None, 3:rsv
1289
UINT32 ProtectRate:16; //Protection control frame rate for CCK TX(RTS/CTS/CFEnd).
1292
} PROT_CFG_STRUC, *PPROT_CFG_STRUC;
1294
typedef union _PROT_CFG_STRUC {
1296
UINT32 ProtectRate:16; //Protection control frame rate for CCK TX(RTS/CTS/CFEnd).
1297
UINT32 ProtectCtrl:2; //Protection control frame type for CCK TX. 1:RTS/CTS, 2:CTS-to-self, 0:None, 3:rsv
1298
UINT32 ProtectNav:2; //TXOP protection type for CCK TX. 0:None, 1:ShortNAVprotect, 2:LongNAVProtect, 3:rsv
1299
UINT32 TxopAllowCck:1; //CCK TXOP allowance.0:disallow.
1300
UINT32 TxopAllowOfdm:1; //CCK TXOP allowance.0:disallow.
1301
UINT32 TxopAllowMM20:1; //CCK TXOP allowance. 0:disallow.
1302
UINT32 TxopAllowMM40:1; //CCK TXOP allowance.0:disallow.
1303
UINT32 TxopAllowGF20:1; //CCK TXOP allowance.0:disallow.
1304
UINT32 TxopAllowGF40:1; //CCK TXOP allowance.0:disallow.
1305
UINT32 RTSThEn:1; //RTS threshold enable on CCK TX
1309
} PROT_CFG_STRUC, *PPROT_CFG_STRUC;
1312
#define OFDM_PROT_CFG 0x1368 //OFDM Protection
1313
#define MM20_PROT_CFG 0x136C //MM20 Protection
1314
#define MM40_PROT_CFG 0x1370 //MM40 Protection
1315
#define GF20_PROT_CFG 0x1374 //GF20 Protection
1316
#define GF40_PROT_CFG 0x1378 //GR40 Protection
1317
#define EXP_CTS_TIME 0x137C //
1318
#define EXP_ACK_TIME 0x1380 //
1321
// 4.4 MAC RX configuration registers (offset:0x1400)
1323
#define RX_FILTR_CFG 0x1400 //TXRX_CSR0
1324
#define AUTO_RSP_CFG 0x1404 //TXRX_CSR4
1326
// TXRX_CSR4: Auto-Responder/
1328
#ifdef RT_BIG_ENDIAN
1329
typedef union _AUTO_RSP_CFG_STRUC {
1332
UINT32 AckCtsPsmBit:1; // Power bit value in conrtrol frame
1333
UINT32 DualCTSEn:1; // Power bit value in conrtrol frame
1334
UINT32 rsv:1; // Power bit value in conrtrol frame
1335
UINT32 AutoResponderPreamble:1; // 0:long, 1:short preamble
1336
UINT32 CTS40MRef:1; // Response CTS 40MHz duplicate mode
1337
UINT32 CTS40MMode:1; // Response CTS 40MHz duplicate mode
1338
UINT32 BACAckPolicyEnable:1; // 0:long, 1:short preamble
1339
UINT32 AutoResponderEnable:1;
1342
} AUTO_RSP_CFG_STRUC, *PAUTO_RSP_CFG_STRUC;
1344
typedef union _AUTO_RSP_CFG_STRUC {
1346
UINT32 AutoResponderEnable:1;
1347
UINT32 BACAckPolicyEnable:1; // 0:long, 1:short preamble
1348
UINT32 CTS40MMode:1; // Response CTS 40MHz duplicate mode
1349
UINT32 CTS40MRef:1; // Response CTS 40MHz duplicate mode
1350
UINT32 AutoResponderPreamble:1; // 0:long, 1:short preamble
1351
UINT32 rsv:1; // Power bit value in conrtrol frame
1352
UINT32 DualCTSEn:1; // Power bit value in conrtrol frame
1353
UINT32 AckCtsPsmBit:1; // Power bit value in conrtrol frame
1357
} AUTO_RSP_CFG_STRUC, *PAUTO_RSP_CFG_STRUC;
1360
#define LEGACY_BASIC_RATE 0x1408 // TXRX_CSR5 0x3054
1361
#define HT_BASIC_RATE 0x140c
1362
#define HT_CTRL_CFG 0x1410
1363
#define SIFS_COST_CFG 0x1414
1364
#define RX_PARSER_CFG 0x1418 //Set NAV for all received frames
1367
// 4.5 MAC Security configuration (offset:0x1500)
1369
#define TX_SEC_CNT0 0x1500 //
1370
#define RX_SEC_CNT0 0x1504 //
1371
#define CCMP_FC_MUTE 0x1508 //
1373
// 4.6 HCCA/PSMP (offset:0x1600)
1375
#define TXOP_HLDR_ADDR0 0x1600
1376
#define TXOP_HLDR_ADDR1 0x1604
1377
#define TXOP_HLDR_ET 0x1608
1378
#define QOS_CFPOLL_RA_DW0 0x160c
1379
#define QOS_CFPOLL_A1_DW1 0x1610
1380
#define QOS_CFPOLL_QC 0x1614
1382
// 4.7 MAC Statistis registers (offset:0x1700)
1384
#define RX_STA_CNT0 0x1700 //
1385
#define RX_STA_CNT1 0x1704 //
1386
#define RX_STA_CNT2 0x1708 //
1389
// RX_STA_CNT0_STRUC: RX PLCP error count & RX CRC error count
1391
#ifdef RT_BIG_ENDIAN
1392
typedef union _RX_STA_CNT0_STRUC {
1398
} RX_STA_CNT0_STRUC, *PRX_STA_CNT0_STRUC;
1400
typedef union _RX_STA_CNT0_STRUC {
1406
} RX_STA_CNT0_STRUC, *PRX_STA_CNT0_STRUC;
1410
// RX_STA_CNT1_STRUC: RX False CCA count & RX LONG frame count
1412
#ifdef RT_BIG_ENDIAN
1413
typedef union _RX_STA_CNT1_STRUC {
1419
} RX_STA_CNT1_STRUC, *PRX_STA_CNT1_STRUC;
1421
typedef union _RX_STA_CNT1_STRUC {
1427
} RX_STA_CNT1_STRUC, *PRX_STA_CNT1_STRUC;
1431
// RX_STA_CNT2_STRUC:
1433
#ifdef RT_BIG_ENDIAN
1434
typedef union _RX_STA_CNT2_STRUC {
1436
USHORT RxFifoOverflowCount;
1437
USHORT RxDupliCount;
1440
} RX_STA_CNT2_STRUC, *PRX_STA_CNT2_STRUC;
1442
typedef union _RX_STA_CNT2_STRUC {
1444
USHORT RxDupliCount;
1445
USHORT RxFifoOverflowCount;
1448
} RX_STA_CNT2_STRUC, *PRX_STA_CNT2_STRUC;
1450
#define TX_STA_CNT0 0x170C //
1452
// STA_CSR3: TX Beacon count
1454
#ifdef RT_BIG_ENDIAN
1455
typedef union _TX_STA_CNT0_STRUC {
1457
USHORT TxBeaconCount;
1461
} TX_STA_CNT0_STRUC, *PTX_STA_CNT0_STRUC;
1463
typedef union _TX_STA_CNT0_STRUC {
1466
USHORT TxBeaconCount;
1469
} TX_STA_CNT0_STRUC, *PTX_STA_CNT0_STRUC;
1471
#define TX_STA_CNT1 0x1710 //
1473
// TX_STA_CNT1: TX tx count
1475
#ifdef RT_BIG_ENDIAN
1476
typedef union _TX_STA_CNT1_STRUC {
1478
USHORT TxRetransmit;
1482
} TX_STA_CNT1_STRUC, *PTX_STA_CNT1_STRUC;
1484
typedef union _TX_STA_CNT1_STRUC {
1487
USHORT TxRetransmit;
1490
} TX_STA_CNT1_STRUC, *PTX_STA_CNT1_STRUC;
1492
#define TX_STA_CNT2 0x1714 //
1494
// TX_STA_CNT2: TX tx count
1496
#ifdef RT_BIG_ENDIAN
1497
typedef union _TX_STA_CNT2_STRUC {
1499
USHORT TxUnderFlowCount;
1500
USHORT TxZeroLenCount;
1503
} TX_STA_CNT2_STRUC, *PTX_STA_CNT2_STRUC;
1505
typedef union _TX_STA_CNT2_STRUC {
1507
USHORT TxZeroLenCount;
1508
USHORT TxUnderFlowCount;
1511
} TX_STA_CNT2_STRUC, *PTX_STA_CNT2_STRUC;
1513
#define TX_STA_FIFO 0x1718 //
1515
// TX_STA_FIFO_STRUC: TX Result for specific PID status fifo register
1517
#ifdef RT_BIG_ENDIAN
1518
typedef union PACKED _TX_STA_FIFO_STRUC {
1521
UINT32 TxBF:1; // 3*3
1522
UINT32 SuccessRate:13; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
1523
// UINT32 SuccessRate:16; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
1524
UINT32 wcid:8; //wireless client index
1525
UINT32 TxAckRequired:1; // ack required
1526
UINT32 TxAggre:1; // Tx is aggregated
1527
UINT32 TxSuccess:1; // Tx success. whether success or not
1529
UINT32 bValid:1; // 1:This register contains a valid TX result
1532
} TX_STA_FIFO_STRUC, *PTX_STA_FIFO_STRUC;
1534
typedef union PACKED _TX_STA_FIFO_STRUC {
1536
UINT32 bValid:1; // 1:This register contains a valid TX result
1538
UINT32 TxSuccess:1; // Tx No retry success
1539
UINT32 TxAggre:1; // Tx Retry Success
1540
UINT32 TxAckRequired:1; // Tx fail
1541
UINT32 wcid:8; //wireless client index
1542
// UINT32 SuccessRate:16; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
1543
UINT32 SuccessRate:13; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
1548
} TX_STA_FIFO_STRUC, *PTX_STA_FIFO_STRUC;
1551
#define TX_AGG_CNT 0x171c
1552
#ifdef RT_BIG_ENDIAN
1553
typedef union _TX_AGG_CNT_STRUC {
1556
USHORT NonAggTxCount;
1559
} TX_AGG_CNT_STRUC, *PTX_AGG_CNT_STRUC;
1561
typedef union _TX_AGG_CNT_STRUC {
1563
USHORT NonAggTxCount;
1567
} TX_AGG_CNT_STRUC, *PTX_AGG_CNT_STRUC;
1570
#define TX_AGG_CNT0 0x1720
1571
#ifdef RT_BIG_ENDIAN
1572
typedef union _TX_AGG_CNT0_STRUC {
1574
USHORT AggSize2Count;
1575
USHORT AggSize1Count;
1578
} TX_AGG_CNT0_STRUC, *PTX_AGG_CNT0_STRUC;
1580
typedef union _TX_AGG_CNT0_STRUC {
1582
USHORT AggSize1Count;
1583
USHORT AggSize2Count;
1586
} TX_AGG_CNT0_STRUC, *PTX_AGG_CNT0_STRUC;
1589
#define TX_AGG_CNT1 0x1724
1590
#ifdef RT_BIG_ENDIAN
1591
typedef union _TX_AGG_CNT1_STRUC {
1593
USHORT AggSize4Count;
1594
USHORT AggSize3Count;
1597
} TX_AGG_CNT1_STRUC, *PTX_AGG_CNT1_STRUC;
1599
typedef union _TX_AGG_CNT1_STRUC {
1601
USHORT AggSize3Count;
1602
USHORT AggSize4Count;
1605
} TX_AGG_CNT1_STRUC, *PTX_AGG_CNT1_STRUC;
1607
#define TX_AGG_CNT2 0x1728
1608
#ifdef RT_BIG_ENDIAN
1609
typedef union _TX_AGG_CNT2_STRUC {
1611
USHORT AggSize6Count;
1612
USHORT AggSize5Count;
1615
} TX_AGG_CNT2_STRUC, *PTX_AGG_CNT2_STRUC;
1617
typedef union _TX_AGG_CNT2_STRUC {
1619
USHORT AggSize5Count;
1620
USHORT AggSize6Count;
1623
} TX_AGG_CNT2_STRUC, *PTX_AGG_CNT2_STRUC;
1626
#define TX_AGG_CNT3 0x172c
1627
#ifdef RT_BIG_ENDIAN
1628
typedef union _TX_AGG_CNT3_STRUC {
1630
USHORT AggSize8Count;
1631
USHORT AggSize7Count;
1634
} TX_AGG_CNT3_STRUC, *PTX_AGG_CNT3_STRUC;
1636
typedef union _TX_AGG_CNT3_STRUC {
1638
USHORT AggSize7Count;
1639
USHORT AggSize8Count;
1642
} TX_AGG_CNT3_STRUC, *PTX_AGG_CNT3_STRUC;
1645
#define TX_AGG_CNT4 0x1730
1646
#ifdef RT_BIG_ENDIAN
1647
typedef union _TX_AGG_CNT4_STRUC {
1649
USHORT AggSize10Count;
1650
USHORT AggSize9Count;
1653
} TX_AGG_CNT4_STRUC, *PTX_AGG_CNT4_STRUC;
1655
typedef union _TX_AGG_CNT4_STRUC {
1657
USHORT AggSize9Count;
1658
USHORT AggSize10Count;
1661
} TX_AGG_CNT4_STRUC, *PTX_AGG_CNT4_STRUC;
1663
#define TX_AGG_CNT5 0x1734
1664
#ifdef RT_BIG_ENDIAN
1665
typedef union _TX_AGG_CNT5_STRUC {
1667
USHORT AggSize12Count;
1668
USHORT AggSize11Count;
1671
} TX_AGG_CNT5_STRUC, *PTX_AGG_CNT5_STRUC;
1673
typedef union _TX_AGG_CNT5_STRUC {
1675
USHORT AggSize11Count;
1676
USHORT AggSize12Count;
1679
} TX_AGG_CNT5_STRUC, *PTX_AGG_CNT5_STRUC;
1681
#define TX_AGG_CNT6 0x1738
1682
#ifdef RT_BIG_ENDIAN
1683
typedef union _TX_AGG_CNT6_STRUC {
1685
USHORT AggSize14Count;
1686
USHORT AggSize13Count;
1689
} TX_AGG_CNT6_STRUC, *PTX_AGG_CNT6_STRUC;
1691
typedef union _TX_AGG_CNT6_STRUC {
1693
USHORT AggSize13Count;
1694
USHORT AggSize14Count;
1697
} TX_AGG_CNT6_STRUC, *PTX_AGG_CNT6_STRUC;
1699
#define TX_AGG_CNT7 0x173c
1700
#ifdef RT_BIG_ENDIAN
1701
typedef union _TX_AGG_CNT7_STRUC {
1703
USHORT AggSize16Count;
1704
USHORT AggSize15Count;
1707
} TX_AGG_CNT7_STRUC, *PTX_AGG_CNT7_STRUC;
1709
typedef union _TX_AGG_CNT7_STRUC {
1711
USHORT AggSize15Count;
1712
USHORT AggSize16Count;
1715
} TX_AGG_CNT7_STRUC, *PTX_AGG_CNT7_STRUC;
1717
#define MPDU_DENSITY_CNT 0x1740
1718
#ifdef RT_BIG_ENDIAN
1719
typedef union _MPDU_DEN_CNT_STRUC {
1721
USHORT RXZeroDelCount; //RX zero length delimiter count
1722
USHORT TXZeroDelCount; //TX zero length delimiter count
1725
} MPDU_DEN_CNT_STRUC, *PMPDU_DEN_CNT_STRUC;
1727
typedef union _MPDU_DEN_CNT_STRUC {
1729
USHORT TXZeroDelCount; //TX zero length delimiter count
1730
USHORT RXZeroDelCount; //RX zero length delimiter count
1733
} MPDU_DEN_CNT_STRUC, *PMPDU_DEN_CNT_STRUC;
1736
// TXRX control registers - base address 0x3000
1738
// rt2860b UNKNOWN reg use R/O Reg Addr 0x77d0 first..
1739
#define TXRX_CSR1 0x77d0
1742
// Security key table memory, base address = 0x1000
1744
#define MAC_WCID_BASE 0x1800 //8-bytes(use only 6-bytes) * 256 entry =
1745
#define HW_WCID_ENTRY_SIZE 8
1746
#define PAIRWISE_KEY_TABLE_BASE 0x4000 // 32-byte * 256-entry = -byte
1747
#define HW_KEY_ENTRY_SIZE 0x20
1748
#define PAIRWISE_IVEIV_TABLE_BASE 0x6000 // 8-byte * 256-entry = -byte
1749
#define MAC_IVEIV_TABLE_BASE 0x6000 // 8-byte * 256-entry = -byte
1750
#define HW_IVEIV_ENTRY_SIZE 8
1751
#define MAC_WCID_ATTRIBUTE_BASE 0x6800 // 4-byte * 256-entry = -byte
1752
#define HW_WCID_ATTRI_SIZE 4
1753
#define WCID_RESERVED 0x6bfc
1754
#define SHARED_KEY_TABLE_BASE 0x6c00 // 32-byte * 16-entry = 512-byte
1755
#define SHARED_KEY_MODE_BASE 0x7000 // 32-byte * 16-entry = 512-byte
1756
#define HW_SHARED_KEY_MODE_SIZE 4
1757
#define SHAREDKEYTABLE 0
1758
#define PAIRWISEKEYTABLE 1
1761
#ifdef RT_BIG_ENDIAN
1762
typedef union _SHAREDKEY_MODE_STRUC {
1765
UINT32 Bss1Key3CipherAlg:3;
1767
UINT32 Bss1Key2CipherAlg:3;
1769
UINT32 Bss1Key1CipherAlg:3;
1771
UINT32 Bss1Key0CipherAlg:3;
1773
UINT32 Bss0Key3CipherAlg:3;
1775
UINT32 Bss0Key2CipherAlg:3;
1777
UINT32 Bss0Key1CipherAlg:3;
1779
UINT32 Bss0Key0CipherAlg:3;
1782
} SHAREDKEY_MODE_STRUC, *PSHAREDKEY_MODE_STRUC;
1784
typedef union _SHAREDKEY_MODE_STRUC {
1786
UINT32 Bss0Key0CipherAlg:3;
1788
UINT32 Bss0Key1CipherAlg:3;
1790
UINT32 Bss0Key2CipherAlg:3;
1792
UINT32 Bss0Key3CipherAlg:3;
1794
UINT32 Bss1Key0CipherAlg:3;
1796
UINT32 Bss1Key1CipherAlg:3;
1798
UINT32 Bss1Key2CipherAlg:3;
1800
UINT32 Bss1Key3CipherAlg:3;
1804
} SHAREDKEY_MODE_STRUC, *PSHAREDKEY_MODE_STRUC;
1806
// 64-entry for pairwise key table
1807
typedef struct _HW_WCID_ENTRY { // 8-byte per entry
1810
} HW_WCID_ENTRY, PHW_WCID_ENTRY;
1813
// =================================================================================
1815
// =================================================================================
1816
//7.1 WCID ENTRY format : 8bytes
1817
typedef struct _WCID_ENTRY_STRUC {
1818
UCHAR RXBABitmap7; // bit0 for TID8, bit7 for TID 15
1819
UCHAR RXBABitmap0; // bit0 for TID0, bit7 for TID 7
1820
UCHAR MAC[6]; // 0 for shared key table. 1 for pairwise key table
1821
} WCID_ENTRY_STRUC, *PWCID_ENTRY_STRUC;
1823
//8.1.1 SECURITY KEY format : 8DW
1824
// 32-byte per entry, total 16-entry for shared key table, 64-entry for pairwise key table
1825
typedef struct _HW_KEY_ENTRY { // 32-byte per entry
1829
} HW_KEY_ENTRY, *PHW_KEY_ENTRY;
1831
//8.1.2 IV/EIV format : 2DW
1833
//8.1.3 RX attribute entry format : 1DW
1834
#ifdef RT_BIG_ENDIAN
1835
typedef struct _MAC_ATTRIBUTE_STRUC {
1838
UINT32 BSSIDIdx:3; //multipleBSS index for the WCID
1839
UINT32 PairKeyMode:3;
1840
UINT32 KeyTab:1; // 0 for shared key table. 1 for pairwise key table
1841
} MAC_ATTRIBUTE_STRUC, *PMAC_ATTRIBUTE_STRUC;
1843
typedef struct _MAC_ATTRIBUTE_STRUC {
1844
UINT32 KeyTab:1; // 0 for shared key table. 1 for pairwise key table
1845
UINT32 PairKeyMode:3;
1846
UINT32 BSSIDIdx:3; //multipleBSS index for the WCID
1849
} MAC_ATTRIBUTE_STRUC, *PMAC_ATTRIBUTE_STRUC;
1853
// =================================================================================
1854
// HOST-MCU communication data structure
1855
// =================================================================================
1858
// H2M_MAILBOX_CSR: Host-to-MCU Mailbox
1860
#ifdef RT_BIG_ENDIAN
1861
typedef union _H2M_MAILBOX_STRUC {
1864
UINT32 CmdToken:8; // 0xff tells MCU not to report CmdDoneInt after excuting the command
1869
} H2M_MAILBOX_STRUC, *PH2M_MAILBOX_STRUC;
1871
typedef union _H2M_MAILBOX_STRUC {
1879
} H2M_MAILBOX_STRUC, *PH2M_MAILBOX_STRUC;
1883
// M2H_CMD_DONE_CSR: MCU-to-Host command complete indication
1885
#ifdef RT_BIG_ENDIAN
1886
typedef union _M2H_CMD_DONE_STRUC {
1894
} M2H_CMD_DONE_STRUC, *PM2H_CMD_DONE_STRUC;
1896
typedef union _M2H_CMD_DONE_STRUC {
1904
} M2H_CMD_DONE_STRUC, *PM2H_CMD_DONE_STRUC;
1909
#ifdef RT_BIG_ENDIAN
1910
typedef union _NAV_TIME_CFG_STRUC {
1913
USHORT ZeroSifs:1; // Applied zero SIFS timer after OFDM RX 0: disable
1914
USHORT Eifs:9; // in unit of 1-us
1915
UCHAR SlotTime; // in unit of 1-us
1916
UCHAR Sifs; // in unit of 1-us
1919
} NAV_TIME_CFG_STRUC, *PNAV_TIME_CFG_STRUC;
1921
typedef union _NAV_TIME_CFG_STRUC {
1923
UCHAR Sifs; // in unit of 1-us
1924
UCHAR SlotTime; // in unit of 1-us
1925
USHORT Eifs:9; // in unit of 1-us
1926
USHORT ZeroSifs:1; // Applied zero SIFS timer after OFDM RX 0: disable
1930
} NAV_TIME_CFG_STRUC, *PNAV_TIME_CFG_STRUC;
1935
// RX_FILTR_CFG: /RX configuration register
1937
#ifdef RT_BIG_ENDIAN
1938
typedef union RX_FILTR_CFG_STRUC {
1941
UINT32 DropRsvCntlType:1;
1943
UINT32 DropBAR:1; //
1945
UINT32 DropPsPoll:1; // Drop Ps-Poll
1946
UINT32 DropRts:1; // Drop Ps-Poll
1948
UINT32 DropCts:1; // Drop Ps-Poll
1949
UINT32 DropAck:1; // Drop Ps-Poll
1950
UINT32 DropCFEnd:1; // Drop Ps-Poll
1951
UINT32 DropCFEndAck:1; // Drop Ps-Poll
1953
UINT32 DropDuplicate:1; // Drop duplicate frame
1954
UINT32 DropBcast:1; // Drop broadcast frames
1955
UINT32 DropMcast:1; // Drop multicast frames
1956
UINT32 DropVerErr:1; // Drop version error frame
1958
UINT32 DropNotMyBSSID:1; // Drop fram ToDs bit is true
1959
UINT32 DropNotToMe:1; // Drop not to me unicast frame
1960
UINT32 DropPhyErr:1; // Drop physical error
1961
UINT32 DropCRCErr:1; // Drop CRC error
1964
} RX_FILTR_CFG_STRUC, *PRX_FILTR_CFG_STRUC;
1966
typedef union _RX_FILTR_CFG_STRUC {
1968
UINT32 DropCRCErr:1; // Drop CRC error
1969
UINT32 DropPhyErr:1; // Drop physical error
1970
UINT32 DropNotToMe:1; // Drop not to me unicast frame
1971
UINT32 DropNotMyBSSID:1; // Drop fram ToDs bit is true
1973
UINT32 DropVerErr:1; // Drop version error frame
1974
UINT32 DropMcast:1; // Drop multicast frames
1975
UINT32 DropBcast:1; // Drop broadcast frames
1976
UINT32 DropDuplicate:1; // Drop duplicate frame
1978
UINT32 DropCFEndAck:1; // Drop Ps-Poll
1979
UINT32 DropCFEnd:1; // Drop Ps-Poll
1980
UINT32 DropAck:1; // Drop Ps-Poll
1981
UINT32 DropCts:1; // Drop Ps-Poll
1983
UINT32 DropRts:1; // Drop Ps-Poll
1984
UINT32 DropPsPoll:1; // Drop Ps-Poll
1986
UINT32 DropBAR:1; //
1988
UINT32 DropRsvCntlType:1;
1992
} RX_FILTR_CFG_STRUC, *PRX_FILTR_CFG_STRUC;
1999
// PHY_CSR4: RF serial control register
2001
#ifdef RT_BIG_ENDIAN
2002
typedef union _PHY_CSR4_STRUC {
2004
UINT32 Busy:1; // 1: ASIC is busy execute RF programming.
2005
UINT32 PLL_LD:1; // RF PLL_LD status
2006
UINT32 IFSelect:1; // 1: select IF to program, 0: select RF to program
2007
UINT32 NumberOfBits:5; // Number of bits used in RFRegValue (I:20, RFMD:22)
2008
UINT32 RFRegValue:24; // Register value (include register id) serial out to RF/IF chip.
2011
} PHY_CSR4_STRUC, *PPHY_CSR4_STRUC;
2013
typedef union _PHY_CSR4_STRUC {
2015
UINT32 RFRegValue:24; // Register value (include register id) serial out to RF/IF chip.
2016
UINT32 NumberOfBits:5; // Number of bits used in RFRegValue (I:20, RFMD:22)
2017
UINT32 IFSelect:1; // 1: select IF to program, 0: select RF to program
2018
UINT32 PLL_LD:1; // RF PLL_LD status
2019
UINT32 Busy:1; // 1: ASIC is busy execute RF programming.
2022
} PHY_CSR4_STRUC, *PPHY_CSR4_STRUC;
2027
// SEC_CSR5: shared key table security mode register
2029
#ifdef RT_BIG_ENDIAN
2030
typedef union _SEC_CSR5_STRUC {
2033
UINT32 Bss3Key3CipherAlg:3;
2035
UINT32 Bss3Key2CipherAlg:3;
2037
UINT32 Bss3Key1CipherAlg:3;
2039
UINT32 Bss3Key0CipherAlg:3;
2041
UINT32 Bss2Key3CipherAlg:3;
2043
UINT32 Bss2Key2CipherAlg:3;
2045
UINT32 Bss2Key1CipherAlg:3;
2047
UINT32 Bss2Key0CipherAlg:3;
2050
} SEC_CSR5_STRUC, *PSEC_CSR5_STRUC;
2052
typedef union _SEC_CSR5_STRUC {
2054
UINT32 Bss2Key0CipherAlg:3;
2056
UINT32 Bss2Key1CipherAlg:3;
2058
UINT32 Bss2Key2CipherAlg:3;
2060
UINT32 Bss2Key3CipherAlg:3;
2062
UINT32 Bss3Key0CipherAlg:3;
2064
UINT32 Bss3Key1CipherAlg:3;
2066
UINT32 Bss3Key2CipherAlg:3;
2068
UINT32 Bss3Key3CipherAlg:3;
2072
} SEC_CSR5_STRUC, *PSEC_CSR5_STRUC;
2077
// HOST_CMD_CSR: For HOST to interrupt embedded processor
2079
#ifdef RT_BIG_ENDIAN
2080
typedef union _HOST_CMD_CSR_STRUC {
2083
UINT32 HostCommand:8;
2086
} HOST_CMD_CSR_STRUC, *PHOST_CMD_CSR_STRUC;
2088
typedef union _HOST_CMD_CSR_STRUC {
2090
UINT32 HostCommand:8;
2094
} HOST_CMD_CSR_STRUC, *PHOST_CMD_CSR_STRUC;
2099
// AIFSN_CSR: AIFSN for each EDCA AC
2105
// E2PROM_CSR: EEPROM control register
2107
#ifdef RT_BIG_ENDIAN
2108
typedef union _E2PROM_CSR_STRUC {
2111
UINT32 LoadStatus:1; // 1:loading, 0:done
2112
UINT32 Type:1; // 1: 93C46, 0:93C66
2117
UINT32 Reload:1; // Reload EEPROM content, write one to reload, self-cleared.
2120
} E2PROM_CSR_STRUC, *PE2PROM_CSR_STRUC;
2122
typedef union _E2PROM_CSR_STRUC {
2124
UINT32 Reload:1; // Reload EEPROM content, write one to reload, self-cleared.
2129
UINT32 Type:1; // 1: 93C46, 0:93C66
2130
UINT32 LoadStatus:1; // 1:loading, 0:done
2134
} E2PROM_CSR_STRUC, *PE2PROM_CSR_STRUC;
2138
// QOS_CSR0: TXOP holder address0 register
2140
#ifdef RT_BIG_ENDIAN
2141
typedef union _QOS_CSR0_STRUC {
2143
UCHAR Byte3; // MAC address byte 3
2144
UCHAR Byte2; // MAC address byte 2
2145
UCHAR Byte1; // MAC address byte 1
2146
UCHAR Byte0; // MAC address byte 0
2149
} QOS_CSR0_STRUC, *PQOS_CSR0_STRUC;
2151
typedef union _QOS_CSR0_STRUC {
2153
UCHAR Byte0; // MAC address byte 0
2154
UCHAR Byte1; // MAC address byte 1
2155
UCHAR Byte2; // MAC address byte 2
2156
UCHAR Byte3; // MAC address byte 3
2159
} QOS_CSR0_STRUC, *PQOS_CSR0_STRUC;
2163
// QOS_CSR1: TXOP holder address1 register
2165
#ifdef RT_BIG_ENDIAN
2166
typedef union _QOS_CSR1_STRUC {
2170
UCHAR Byte5; // MAC address byte 5
2171
UCHAR Byte4; // MAC address byte 4
2174
} QOS_CSR1_STRUC, *PQOS_CSR1_STRUC;
2176
typedef union _QOS_CSR1_STRUC {
2178
UCHAR Byte4; // MAC address byte 4
2179
UCHAR Byte5; // MAC address byte 5
2184
} QOS_CSR1_STRUC, *PQOS_CSR1_STRUC;
2187
#define RF_CSR_CFG 0x500
2188
#ifdef RT_BIG_ENDIAN
2189
typedef union _RF_CSR_CFG_STRUC {
2191
UINT Rsvd1:14; // Reserved
2192
UINT RF_CSR_KICK:1; // kick RF register read/write
2193
UINT RF_CSR_WR:1; // 0: read 1: write
2194
UINT Rsvd2:3; // Reserved
2195
UINT TESTCSR_RFACC_REGNUM:5; // RF register ID
2196
UINT RF_CSR_DATA:8; // DATA
2199
} RF_CSR_CFG_STRUC, *PRF_CSR_CFG_STRUC;
2201
typedef union _RF_CSR_CFG_STRUC {
2203
UINT RF_CSR_DATA:8; // DATA
2204
UINT TESTCSR_RFACC_REGNUM:5; // RF register ID
2205
UINT Rsvd2:3; // Reserved
2206
UINT RF_CSR_WR:1; // 0: read 1: write
2207
UINT RF_CSR_KICK:1; // kick RF register read/write
2208
UINT Rsvd1:14; // Reserved
2211
} RF_CSR_CFG_STRUC, *PRF_CSR_CFG_STRUC;
2216
// Other on-chip shared memory space, base = 0x2000
2219
// CIS space - base address = 0x2000
2220
#define HW_CIS_BASE 0x2000
2222
// Carrier-sense CTS frame base address. It's where mac stores carrier-sense frame for carrier-sense function.
2223
#define HW_CS_CTS_BASE 0x7700
2224
// DFS CTS frame base address. It's where mac stores CTS frame for DFS.
2225
#define HW_DFS_CTS_BASE 0x7780
2226
#define HW_CTS_FRAME_SIZE 0x80
2228
// 2004-11-08 john - since NULL frame won't be that long (256 byte). We steal 16 tail bytes
2229
// to save debugging settings
2230
#define HW_DEBUG_SETTING_BASE 0x77f0 // 0x77f0~0x77ff total 16 bytes
2231
#define HW_DEBUG_SETTING_BASE2 0x7770 // 0x77f0~0x77ff total 16 bytes
2233
// In order to support maximum 8 MBSS and its maximum length is 512 for each beacon
2234
// Three section discontinue memory segments will be used.
2235
// 1. The original region for BCN 0~3
2236
// 2. Extract memory from FCE table for BCN 4~5
2237
// 3. Extract memory from Pair-wise key table for BCN 6~7
2238
// It occupied those memory of wcid 238~253 for BCN 6
2239
// and wcid 222~237 for BCN 7
2240
#define HW_BEACON_MAX_SIZE 0x1000 /* unit: byte */
2241
#define HW_BEACON_BASE0 0x7800
2242
#define HW_BEACON_BASE1 0x7A00
2243
#define HW_BEACON_BASE2 0x7C00
2244
#define HW_BEACON_BASE3 0x7E00
2245
#define HW_BEACON_BASE4 0x7200
2246
#define HW_BEACON_BASE5 0x7400
2247
#define HW_BEACON_BASE6 0x5DC0
2248
#define HW_BEACON_BASE7 0x5BC0
2250
#define HW_BEACON_MAX_COUNT 8
2251
#define HW_BEACON_OFFSET 0x0200
2252
#define HW_BEACON_CONTENT_LEN (HW_BEACON_OFFSET - TXWI_SIZE)
2254
// HOST-MCU shared memory - base address = 0x2100
2255
#define HOST_CMD_CSR 0x404
2256
#define H2M_MAILBOX_CSR 0x7010
2257
#define H2M_MAILBOX_CID 0x7014
2258
#define H2M_MAILBOX_STATUS 0x701c
2259
#define H2M_INT_SRC 0x7024
2260
#define H2M_BBP_AGENT 0x7028
2261
#define M2H_CMD_DONE_CSR 0x000c
2262
#define MCU_TXOP_ARRAY_BASE 0x000c // TODO: to be provided by Albert
2263
#define MCU_TXOP_ENTRY_SIZE 32 // TODO: to be provided by Albert
2264
#define MAX_NUM_OF_TXOP_ENTRY 16 // TODO: must be same with 8051 firmware
2265
#define MCU_MBOX_VERSION 0x01 // TODO: to be confirmed by Albert
2266
#define MCU_MBOX_VERSION_OFFSET 5 // TODO: to be provided by Albert
2269
// Host DMA registers - base address 0x200 . TX0-3=EDCAQid0-3, TX4=HCCA, TX5=MGMT,
2272
// DMA RING DESCRIPTOR
2274
#define E2PROM_CSR 0x0004
2275
#define IO_CNTL_CSR 0x77d0
2279
// ================================================================
2280
// Tx / Rx / Mgmt ring descriptor definition
2281
// ================================================================
2283
// the following PID values are used to mark outgoing frame type in TXD->PID so that
2284
// proper TX statistics can be collected based on these categories
2285
// b3-2 of PID field -
2286
#define PID_MGMT 0x05
2287
#define PID_BEACON 0x0c
2288
#define PID_DATA_NORMALUCAST 0x02
2289
#define PID_DATA_AMPDU 0x04
2290
#define PID_DATA_NO_ACK 0x08
2291
#define PID_DATA_NOT_NORM_ACK 0x03
2292
// value domain of pTxD->HostQId (4-bit: 0~15)
2293
#define QID_AC_BK 1 // meet ACI definition in 802.11e
2294
#define QID_AC_BE 0 // meet ACI definition in 802.11e
2298
//#define NUM_OF_TX_RING 5
2299
#define NUM_OF_TX_RING 4
2302
#define QID_OTHER 15
2304
#endif // __RTMP_MAC_H__ //