Go to the documentation of this file.
37 #define RF2525E 0x0005
43 #define RT2570_VERSION_B 2
44 #define RT2570_VERSION_C 3
45 #define RT2570_VERSION_D 4
51 #define DEFAULT_RSSI_OFFSET 120
56 #define CSR_REG_BASE 0x0400
57 #define CSR_REG_SIZE 0x0100
58 #define EEPROM_BASE 0x0000
59 #define EEPROM_SIZE 0x006a
60 #define BBP_BASE 0x0000
61 #define BBP_SIZE 0x0060
62 #define RF_BASE 0x0004
63 #define RF_SIZE 0x0010
68 #define NUM_TX_QUEUES 2
78 #define MAC_CSR0 0x0400
86 #define MAC_CSR1 0x0402
87 #define MAC_CSR1_SOFT_RESET FIELD16(0x00000001)
88 #define MAC_CSR1_BBP_RESET FIELD16(0x00000002)
89 #define MAC_CSR1_HOST_READY FIELD16(0x00000004)
94 #define MAC_CSR2 0x0404
95 #define MAC_CSR2_BYTE0 FIELD16(0x00ff)
96 #define MAC_CSR2_BYTE1 FIELD16(0xff00)
101 #define MAC_CSR3 0x0406
102 #define MAC_CSR3_BYTE2 FIELD16(0x00ff)
103 #define MAC_CSR3_BYTE3 FIELD16(0xff00)
108 #define MAC_CSR4 0X0408
109 #define MAC_CSR4_BYTE4 FIELD16(0x00ff)
110 #define MAC_CSR4_BYTE5 FIELD16(0xff00)
115 #define MAC_CSR5 0x040a
116 #define MAC_CSR5_BYTE0 FIELD16(0x00ff)
117 #define MAC_CSR5_BYTE1 FIELD16(0xff00)
122 #define MAC_CSR6 0x040c
123 #define MAC_CSR6_BYTE2 FIELD16(0x00ff)
124 #define MAC_CSR6_BYTE3 FIELD16(0xff00)
129 #define MAC_CSR7 0x040e
130 #define MAC_CSR7_BYTE4 FIELD16(0x00ff)
131 #define MAC_CSR7_BYTE5 FIELD16(0xff00)
136 #define MAC_CSR8 0x0410
137 #define MAC_CSR8_MAX_FRAME_UNIT FIELD16(0x0fff)
150 #define MAC_CSR9 0x0412
151 #define MAC_CSR10 0x0414
152 #define MAC_CSR11 0x0416
153 #define MAC_CSR12 0x0418
154 #define MAC_CSR13 0x041a
155 #define MAC_CSR14 0x041c
156 #define MAC_CSR15 0x041e
157 #define MAC_CSR16 0x0420
169 #define MAC_CSR17 0x0422
170 #define MAC_CSR17_SET_STATE FIELD16(0x0001)
171 #define MAC_CSR17_BBP_DESIRE_STATE FIELD16(0x0006)
172 #define MAC_CSR17_RF_DESIRE_STATE FIELD16(0x0018)
173 #define MAC_CSR17_BBP_CURR_STATE FIELD16(0x0060)
174 #define MAC_CSR17_RF_CURR_STATE FIELD16(0x0180)
175 #define MAC_CSR17_PUT_TO_SLEEP FIELD16(0x0200)
183 #define MAC_CSR18 0x0424
184 #define MAC_CSR18_DELAY_AFTER_BEACON FIELD16(0x00ff)
185 #define MAC_CSR18_BEACONS_BEFORE_WAKEUP FIELD16(0x7f00)
186 #define MAC_CSR18_AUTO_WAKE FIELD16(0x8000)
193 #define MAC_CSR19 0x0426
194 #define MAC_CSR19_VAL0 FIELD16(0x0001)
195 #define MAC_CSR19_VAL1 FIELD16(0x0002)
196 #define MAC_CSR19_VAL2 FIELD16(0x0004)
197 #define MAC_CSR19_VAL3 FIELD16(0x0008)
198 #define MAC_CSR19_VAL4 FIELD16(0x0010)
199 #define MAC_CSR19_VAL5 FIELD16(0x0020)
200 #define MAC_CSR19_VAL6 FIELD16(0x0040)
201 #define MAC_CSR19_VAL7 FIELD16(0x0080)
202 #define MAC_CSR19_DIR0 FIELD16(0x0100)
203 #define MAC_CSR19_DIR1 FIELD16(0x0200)
204 #define MAC_CSR19_DIR2 FIELD16(0x0400)
205 #define MAC_CSR19_DIR3 FIELD16(0x0800)
206 #define MAC_CSR19_DIR4 FIELD16(0x1000)
207 #define MAC_CSR19_DIR5 FIELD16(0x2000)
208 #define MAC_CSR19_DIR6 FIELD16(0x4000)
209 #define MAC_CSR19_DIR7 FIELD16(0x8000)
217 #define MAC_CSR20 0x0428
218 #define MAC_CSR20_ACTIVITY FIELD16(0x0001)
219 #define MAC_CSR20_LINK FIELD16(0x0002)
220 #define MAC_CSR20_ACTIVITY_POLARITY FIELD16(0x0004)
227 #define MAC_CSR21 0x042a
228 #define MAC_CSR21_ON_PERIOD FIELD16(0x00ff)
229 #define MAC_CSR21_OFF_PERIOD FIELD16(0xff00)
234 #define MAC_CSR22 0x042c
244 #define TXRX_CSR0 0x0440
245 #define TXRX_CSR0_ALGORITHM FIELD16(0x0007)
246 #define TXRX_CSR0_IV_OFFSET FIELD16(0x01f8)
247 #define TXRX_CSR0_KEY_ID FIELD16(0x1e00)
255 #define TXRX_CSR1 0x0442
256 #define TXRX_CSR1_ACK_TIMEOUT FIELD16(0x00ff)
257 #define TXRX_CSR1_TSF_OFFSET FIELD16(0x7f00)
258 #define TXRX_CSR1_AUTO_SEQUENCE FIELD16(0x8000)
272 #define TXRX_CSR2 0x0444
273 #define TXRX_CSR2_DISABLE_RX FIELD16(0x0001)
274 #define TXRX_CSR2_DROP_CRC FIELD16(0x0002)
275 #define TXRX_CSR2_DROP_PHYSICAL FIELD16(0x0004)
276 #define TXRX_CSR2_DROP_CONTROL FIELD16(0x0008)
277 #define TXRX_CSR2_DROP_NOT_TO_ME FIELD16(0x0010)
278 #define TXRX_CSR2_DROP_TODS FIELD16(0x0020)
279 #define TXRX_CSR2_DROP_VERSION_ERROR FIELD16(0x0040)
280 #define TXRX_CSR2_DROP_MULTICAST FIELD16(0x0200)
281 #define TXRX_CSR2_DROP_BROADCAST FIELD16(0x0400)
288 #define TXRX_CSR3 0x0446
289 #define TXRX_CSR4 0x0448
294 #define TXRX_CSR5 0x044a
295 #define TXRX_CSR5_BBP_ID0 FIELD16(0x007f)
296 #define TXRX_CSR5_BBP_ID0_VALID FIELD16(0x0080)
297 #define TXRX_CSR5_BBP_ID1 FIELD16(0x7f00)
298 #define TXRX_CSR5_BBP_ID1_VALID FIELD16(0x8000)
303 #define TXRX_CSR6 0x044c
304 #define TXRX_CSR6_BBP_ID0 FIELD16(0x007f)
305 #define TXRX_CSR6_BBP_ID0_VALID FIELD16(0x0080)
306 #define TXRX_CSR6_BBP_ID1 FIELD16(0x7f00)
307 #define TXRX_CSR6_BBP_ID1_VALID FIELD16(0x8000)
312 #define TXRX_CSR7 0x044e
313 #define TXRX_CSR7_BBP_ID0 FIELD16(0x007f)
314 #define TXRX_CSR7_BBP_ID0_VALID FIELD16(0x0080)
315 #define TXRX_CSR7_BBP_ID1 FIELD16(0x7f00)
316 #define TXRX_CSR7_BBP_ID1_VALID FIELD16(0x8000)
321 #define TXRX_CSR8 0x0450
322 #define TXRX_CSR8_BBP_ID0 FIELD16(0x007f)
323 #define TXRX_CSR8_BBP_ID0_VALID FIELD16(0x0080)
324 #define TXRX_CSR8_BBP_ID1 FIELD16(0x7f00)
325 #define TXRX_CSR8_BBP_ID1_VALID FIELD16(0x8000)
330 #define TXRX_CSR9 0x0452
335 #define TXRX_CSR10 0x0454
336 #define TXRX_CSR10_AUTORESPOND_PREAMBLE FIELD16(0x0004)
341 #define TXRX_CSR11 0x0456
346 #define TXRX_CSR12 0x0458
347 #define TXRX_CSR13 0x045a
348 #define TXRX_CSR14 0x045c
349 #define TXRX_CSR15 0x045e
350 #define TXRX_CSR16 0x0460
351 #define TXRX_CSR17 0x0462
356 #define TXRX_CSR18 0x0464
357 #define TXRX_CSR18_OFFSET FIELD16(0x000f)
358 #define TXRX_CSR18_INTERVAL FIELD16(0xfff0)
367 #define TXRX_CSR19 0x0466
368 #define TXRX_CSR19_TSF_COUNT FIELD16(0x0001)
369 #define TXRX_CSR19_TSF_SYNC FIELD16(0x0006)
370 #define TXRX_CSR19_TBCN FIELD16(0x0008)
371 #define TXRX_CSR19_BEACON_GEN FIELD16(0x0010)
378 #define TXRX_CSR20 0x0468
379 #define TXRX_CSR20_OFFSET FIELD16(0x1fff)
380 #define TXRX_CSR20_BCN_EXPECT_WINDOW FIELD16(0xe000)
385 #define TXRX_CSR21 0x046a
402 #define SEC_CSR0 0x0480
403 #define SEC_CSR1 0x0482
404 #define SEC_CSR2 0x0484
405 #define SEC_CSR3 0x0486
406 #define SEC_CSR4 0x0488
407 #define SEC_CSR5 0x048a
408 #define SEC_CSR6 0x048c
409 #define SEC_CSR7 0x048e
421 #define SEC_CSR8 0x0490
422 #define SEC_CSR9 0x0492
423 #define SEC_CSR10 0x0494
424 #define SEC_CSR11 0x0496
425 #define SEC_CSR12 0x0498
426 #define SEC_CSR13 0x049a
427 #define SEC_CSR14 0x049c
428 #define SEC_CSR15 0x049e
440 #define SEC_CSR16 0x04a0
441 #define SEC_CSR17 0x04a2
442 #define SEC_CSR18 0X04A4
443 #define SEC_CSR19 0x04a6
444 #define SEC_CSR20 0x04a8
445 #define SEC_CSR21 0x04aa
446 #define SEC_CSR22 0x04ac
447 #define SEC_CSR23 0x04ae
459 #define SEC_CSR24 0x04b0
460 #define SEC_CSR25 0x04b2
461 #define SEC_CSR26 0x04b4
462 #define SEC_CSR27 0x04b6
463 #define SEC_CSR28 0x04b8
464 #define SEC_CSR29 0x04ba
465 #define SEC_CSR30 0x04bc
466 #define SEC_CSR31 0x04be
468 #define KEY_ENTRY(__idx) \
469 ( SEC_CSR0 + ((__idx) * 16) )
478 #define PHY_CSR0 0x04c0
483 #define PHY_CSR1 0x04c2
495 #define PHY_CSR2 0x04c4
496 #define PHY_CSR2_LNA FIELD16(0x0002)
497 #define PHY_CSR2_LNA_MODE FIELD16(0x3000)
502 #define PHY_CSR3 0x04c6
507 #define PHY_CSR4 0x04c8
508 #define PHY_CSR4_LOW_RF_LE FIELD16(0x0001)
514 #define PHY_CSR5 0x04ca
515 #define PHY_CSR5_CCK FIELD16(0x0003)
516 #define PHY_CSR5_CCK_FLIP FIELD16(0x0004)
522 #define PHY_CSR6 0x04cc
523 #define PHY_CSR6_OFDM FIELD16(0x0003)
524 #define PHY_CSR6_OFDM_FLIP FIELD16(0x0004)
532 #define PHY_CSR7 0x04ce
533 #define PHY_CSR7_DATA FIELD16(0x00ff)
534 #define PHY_CSR7_REG_ID FIELD16(0x7f00)
535 #define PHY_CSR7_READ_CONTROL FIELD16(0x8000)
541 #define PHY_CSR8 0x04d0
542 #define PHY_CSR8_BUSY FIELD16(0x0001)
548 #define PHY_CSR9 0x04d2
549 #define PHY_CSR9_RF_VALUE FIELD16(0xffff)
559 #define PHY_CSR10 0x04d4
560 #define PHY_CSR10_RF_VALUE FIELD16(0x00ff)
561 #define PHY_CSR10_RF_NUMBER_OF_BITS FIELD16(0x1f00)
562 #define PHY_CSR10_RF_IF_SELECT FIELD16(0x2000)
563 #define PHY_CSR10_RF_PLL_LD FIELD16(0x4000)
564 #define PHY_CSR10_RF_BUSY FIELD16(0x8000)
570 #define STA_CSR0 0x04e0
571 #define STA_CSR0_FCS_ERROR FIELD16(0xffff)
576 #define STA_CSR1 0x04e2
581 #define STA_CSR2 0x04e4
587 #define STA_CSR3 0x04e6
588 #define STA_CSR3_FALSE_CCA_ERROR FIELD16(0xffff)
593 #define STA_CSR4 0x04e8
598 #define STA_CSR5 0x04ea
603 #define STA_CSR6 0x04ec
604 #define STA_CSR7 0x04ee
605 #define STA_CSR8 0x04f0
606 #define STA_CSR9 0x04f2
607 #define STA_CSR10 0x04f4
617 #define BBP_R2_TX_ANTENNA FIELD8(0x03)
618 #define BBP_R2_TX_IQ_FLIP FIELD8(0x04)
623 #define BBP_R14_RX_ANTENNA FIELD8(0x03)
624 #define BBP_R14_RX_IQ_FLIP FIELD8(0x04)
633 #define RF1_TUNER FIELD32(0x00020000)
638 #define RF3_TUNER FIELD32(0x00000100)
639 #define RF3_TXPOWER FIELD32(0x00003e00)
648 #define EEPROM_MAC_ADDR_0 0x0002
649 #define EEPROM_MAC_ADDR_BYTE0 FIELD16(0x00ff)
650 #define EEPROM_MAC_ADDR_BYTE1 FIELD16(0xff00)
651 #define EEPROM_MAC_ADDR1 0x0003
652 #define EEPROM_MAC_ADDR_BYTE2 FIELD16(0x00ff)
653 #define EEPROM_MAC_ADDR_BYTE3 FIELD16(0xff00)
654 #define EEPROM_MAC_ADDR_2 0x0004
655 #define EEPROM_MAC_ADDR_BYTE4 FIELD16(0x00ff)
656 #define EEPROM_MAC_ADDR_BYTE5 FIELD16(0xff00)
668 #define EEPROM_ANTENNA 0x000b
669 #define EEPROM_ANTENNA_NUM FIELD16(0x0003)
670 #define EEPROM_ANTENNA_TX_DEFAULT FIELD16(0x000c)
671 #define EEPROM_ANTENNA_RX_DEFAULT FIELD16(0x0030)
672 #define EEPROM_ANTENNA_LED_MODE FIELD16(0x01c0)
673 #define EEPROM_ANTENNA_DYN_TXAGC FIELD16(0x0200)
674 #define EEPROM_ANTENNA_HARDWARE_RADIO FIELD16(0x0400)
675 #define EEPROM_ANTENNA_RF_TYPE FIELD16(0xf800)
683 #define EEPROM_NIC 0x000c
684 #define EEPROM_NIC_CARDBUS_ACCEL FIELD16(0x0001)
685 #define EEPROM_NIC_DYN_BBP_TUNE FIELD16(0x0002)
686 #define EEPROM_NIC_CCK_TX_POWER FIELD16(0x000c)
692 #define EEPROM_GEOGRAPHY 0x000d
693 #define EEPROM_GEOGRAPHY_GEO FIELD16(0x0f00)
698 #define EEPROM_BBP_START 0x000e
699 #define EEPROM_BBP_SIZE 16
700 #define EEPROM_BBP_VALUE FIELD16(0x00ff)
701 #define EEPROM_BBP_REG_ID FIELD16(0xff00)
706 #define EEPROM_TXPOWER_START 0x001e
707 #define EEPROM_TXPOWER_SIZE 7
708 #define EEPROM_TXPOWER_1 FIELD16(0x00ff)
709 #define EEPROM_TXPOWER_2 FIELD16(0xff00)
714 #define EEPROM_BBPTUNE 0x0030
715 #define EEPROM_BBPTUNE_THRESHOLD FIELD16(0x00ff)
720 #define EEPROM_BBPTUNE_R24 0x0031
721 #define EEPROM_BBPTUNE_R24_LOW FIELD16(0x00ff)
722 #define EEPROM_BBPTUNE_R24_HIGH FIELD16(0xff00)
727 #define EEPROM_BBPTUNE_R25 0x0032
728 #define EEPROM_BBPTUNE_R25_LOW FIELD16(0x00ff)
729 #define EEPROM_BBPTUNE_R25_HIGH FIELD16(0xff00)
734 #define EEPROM_BBPTUNE_R61 0x0033
735 #define EEPROM_BBPTUNE_R61_LOW FIELD16(0x00ff)
736 #define EEPROM_BBPTUNE_R61_HIGH FIELD16(0xff00)
741 #define EEPROM_BBPTUNE_VGC 0x0034
742 #define EEPROM_BBPTUNE_VGCUPPER FIELD16(0x00ff)
743 #define EEPROM_BBPTUNE_VGCLOWER FIELD16(0xff00)
748 #define EEPROM_BBPTUNE_R17 0x0035
749 #define EEPROM_BBPTUNE_R17_LOW FIELD16(0x00ff)
750 #define EEPROM_BBPTUNE_R17_HIGH FIELD16(0xff00)
755 #define EEPROM_CALIBRATE_OFFSET 0x0036
756 #define EEPROM_CALIBRATE_OFFSET_RSSI FIELD16(0x00ff)
761 #define TXD_DESC_SIZE ( 5 * sizeof(__le32) )
762 #define RXD_DESC_SIZE ( 4 * sizeof(__le32) )
771 #define TXD_W0_PACKET_ID FIELD32(0x0000000f)
772 #define TXD_W0_RETRY_LIMIT FIELD32(0x000000f0)
773 #define TXD_W0_MORE_FRAG FIELD32(0x00000100)
774 #define TXD_W0_ACK FIELD32(0x00000200)
775 #define TXD_W0_TIMESTAMP FIELD32(0x00000400)
776 #define TXD_W0_OFDM FIELD32(0x00000800)
777 #define TXD_W0_NEW_SEQ FIELD32(0x00001000)
778 #define TXD_W0_IFS FIELD32(0x00006000)
779 #define TXD_W0_DATABYTE_COUNT FIELD32(0x0fff0000)
780 #define TXD_W0_CIPHER FIELD32(0x20000000)
781 #define TXD_W0_KEY_ID FIELD32(0xc0000000)
786 #define TXD_W1_IV_OFFSET FIELD32(0x0000003f)
787 #define TXD_W1_AIFS FIELD32(0x000000c0)
788 #define TXD_W1_CWMIN FIELD32(0x00000f00)
789 #define TXD_W1_CWMAX FIELD32(0x0000f000)
794 #define TXD_W2_PLCP_SIGNAL FIELD32(0x000000ff)
795 #define TXD_W2_PLCP_SERVICE FIELD32(0x0000ff00)
796 #define TXD_W2_PLCP_LENGTH_LOW FIELD32(0x00ff0000)
797 #define TXD_W2_PLCP_LENGTH_HIGH FIELD32(0xff000000)
802 #define TXD_W3_IV FIELD32(0xffffffff)
807 #define TXD_W4_EIV FIELD32(0xffffffff)
816 #define RXD_W0_UNICAST_TO_ME FIELD32(0x00000002)
817 #define RXD_W0_MULTICAST FIELD32(0x00000004)
818 #define RXD_W0_BROADCAST FIELD32(0x00000008)
819 #define RXD_W0_MY_BSS FIELD32(0x00000010)
820 #define RXD_W0_CRC_ERROR FIELD32(0x00000020)
821 #define RXD_W0_OFDM FIELD32(0x00000040)
822 #define RXD_W0_PHYSICAL_ERROR FIELD32(0x00000080)
823 #define RXD_W0_CIPHER FIELD32(0x00000100)
824 #define RXD_W0_CIPHER_ERROR FIELD32(0x00000200)
825 #define RXD_W0_DATABYTE_COUNT FIELD32(0x0fff0000)
830 #define RXD_W1_RSSI FIELD32(0x000000ff)
831 #define RXD_W1_SIGNAL FIELD32(0x0000ff00)
836 #define RXD_W2_IV FIELD32(0xffffffff)
841 #define RXD_W3_EIV FIELD32(0xffffffff)
847 #define MIN_TXPOWER 0
848 #define MAX_TXPOWER 31
849 #define DEFAULT_TXPOWER 24
851 #define TXPOWER_FROM_DEV(__txpower) \
852 (((u8)(__txpower)) > MAX_TXPOWER) ? DEFAULT_TXPOWER : (__txpower)
854 #define TXPOWER_TO_DEV(__txpower) \
855 clamp_t(char, __txpower, MIN_TXPOWER, MAX_TXPOWER)