Go to the documentation of this file.
42 #define DEFAULT_RSSI_OFFSET 120
47 #define CSR_REG_BASE 0x3000
48 #define CSR_REG_SIZE 0x04b0
49 #define EEPROM_BASE 0x0000
50 #define EEPROM_SIZE 0x0100
51 #define BBP_BASE 0x0000
52 #define BBP_SIZE 0x0080
53 #define RF_BASE 0x0004
54 #define RF_SIZE 0x0010
59 #define NUM_TX_QUEUES 4
68 #define MCU_LEDCS_LED_MODE FIELD16(0x001f)
69 #define MCU_LEDCS_RADIO_STATUS FIELD16(0x0020)
70 #define MCU_LEDCS_LINK_BG_STATUS FIELD16(0x0040)
71 #define MCU_LEDCS_LINK_A_STATUS FIELD16(0x0080)
72 #define MCU_LEDCS_POLARITY_GPIO_0 FIELD16(0x0100)
73 #define MCU_LEDCS_POLARITY_GPIO_1 FIELD16(0x0200)
74 #define MCU_LEDCS_POLARITY_GPIO_2 FIELD16(0x0400)
75 #define MCU_LEDCS_POLARITY_GPIO_3 FIELD16(0x0800)
76 #define MCU_LEDCS_POLARITY_GPIO_4 FIELD16(0x1000)
77 #define MCU_LEDCS_POLARITY_ACT FIELD16(0x2000)
78 #define MCU_LEDCS_POLARITY_READY_BG FIELD16(0x4000)
79 #define MCU_LEDCS_POLARITY_READY_A FIELD16(0x8000)
84 #define FIRMWARE_RT2571 "rt73.bin"
85 #define FIRMWARE_IMAGE_BASE 0x0800
93 #define SHARED_KEY_TABLE_BASE 0x1000
94 #define PAIRWISE_KEY_TABLE_BASE 0x1200
95 #define PAIRWISE_TA_TABLE_BASE 0x1a00
97 #define SHARED_KEY_ENTRY(__idx) \
98 ( SHARED_KEY_TABLE_BASE + \
99 ((__idx) * sizeof(struct hw_key_entry)) )
100 #define PAIRWISE_KEY_ENTRY(__idx) \
101 ( PAIRWISE_KEY_TABLE_BASE + \
102 ((__idx) * sizeof(struct hw_key_entry)) )
103 #define PAIRWISE_TA_ENTRY(__idx) \
104 ( PAIRWISE_TA_TABLE_BASE + \
105 ((__idx) * sizeof(struct hw_pairwise_ta_entry)) )
123 #define HW_DEBUG_SETTING_BASE 0x2bf0
128 #define HW_BEACON_BASE0 0x2400
129 #define HW_BEACON_BASE1 0x2500
130 #define HW_BEACON_BASE2 0x2600
131 #define HW_BEACON_BASE3 0x2700
133 #define HW_BEACON_OFFSET(__index) \
134 ( HW_BEACON_BASE0 + (__index * 0x0100) )
144 #define MAC_CSR0 0x3000
145 #define MAC_CSR0_REVISION FIELD32(0x0000000f)
146 #define MAC_CSR0_CHIPSET FIELD32(0x000ffff0)
154 #define MAC_CSR1 0x3004
155 #define MAC_CSR1_SOFT_RESET FIELD32(0x00000001)
156 #define MAC_CSR1_BBP_RESET FIELD32(0x00000002)
157 #define MAC_CSR1_HOST_READY FIELD32(0x00000004)
162 #define MAC_CSR2 0x3008
163 #define MAC_CSR2_BYTE0 FIELD32(0x000000ff)
164 #define MAC_CSR2_BYTE1 FIELD32(0x0000ff00)
165 #define MAC_CSR2_BYTE2 FIELD32(0x00ff0000)
166 #define MAC_CSR2_BYTE3 FIELD32(0xff000000)
176 #define MAC_CSR3 0x300c
177 #define MAC_CSR3_BYTE4 FIELD32(0x000000ff)
178 #define MAC_CSR3_BYTE5 FIELD32(0x0000ff00)
179 #define MAC_CSR3_UNICAST_TO_ME_MASK FIELD32(0x00ff0000)
184 #define MAC_CSR4 0x3010
185 #define MAC_CSR4_BYTE0 FIELD32(0x000000ff)
186 #define MAC_CSR4_BYTE1 FIELD32(0x0000ff00)
187 #define MAC_CSR4_BYTE2 FIELD32(0x00ff0000)
188 #define MAC_CSR4_BYTE3 FIELD32(0xff000000)
201 #define MAC_CSR5 0x3014
202 #define MAC_CSR5_BYTE4 FIELD32(0x000000ff)
203 #define MAC_CSR5_BYTE5 FIELD32(0x0000ff00)
204 #define MAC_CSR5_BSS_ID_MASK FIELD32(0x00ff0000)
209 #define MAC_CSR6 0x3018
210 #define MAC_CSR6_MAX_FRAME_UNIT FIELD32(0x00000fff)
215 #define MAC_CSR7 0x301c
221 #define MAC_CSR8 0x3020
222 #define MAC_CSR8_SIFS FIELD32(0x000000ff)
223 #define MAC_CSR8_SIFS_AFTER_RX_OFDM FIELD32(0x0000ff00)
224 #define MAC_CSR8_EIFS FIELD32(0xffff0000)
233 #define MAC_CSR9 0x3024
234 #define MAC_CSR9_SLOT_TIME FIELD32(0x000000ff)
235 #define MAC_CSR9_CWMIN FIELD32(0x00000f00)
236 #define MAC_CSR9_CWMAX FIELD32(0x0000f000)
237 #define MAC_CSR9_CW_SELECT FIELD32(0x00010000)
242 #define MAC_CSR10 0x3028
250 #define MAC_CSR11 0x302c
251 #define MAC_CSR11_DELAY_AFTER_TBCN FIELD32(0x000000ff)
252 #define MAC_CSR11_TBCN_BEFORE_WAKEUP FIELD32(0x00007f00)
253 #define MAC_CSR11_AUTOWAKE FIELD32(0x00008000)
254 #define MAC_CSR11_WAKEUP_LATENCY FIELD32(0x000f0000)
262 #define MAC_CSR12 0x3030
263 #define MAC_CSR12_CURRENT_STATE FIELD32(0x00000001)
264 #define MAC_CSR12_PUT_TO_SLEEP FIELD32(0x00000002)
265 #define MAC_CSR12_FORCE_WAKEUP FIELD32(0x00000004)
266 #define MAC_CSR12_BBP_CURRENT_STATE FIELD32(0x00000008)
273 #define MAC_CSR13 0x3034
274 #define MAC_CSR13_VAL0 FIELD32(0x00000001)
275 #define MAC_CSR13_VAL1 FIELD32(0x00000002)
276 #define MAC_CSR13_VAL2 FIELD32(0x00000004)
277 #define MAC_CSR13_VAL3 FIELD32(0x00000008)
278 #define MAC_CSR13_VAL4 FIELD32(0x00000010)
279 #define MAC_CSR13_VAL5 FIELD32(0x00000020)
280 #define MAC_CSR13_VAL6 FIELD32(0x00000040)
281 #define MAC_CSR13_VAL7 FIELD32(0x00000080)
282 #define MAC_CSR13_DIR0 FIELD32(0x00000100)
283 #define MAC_CSR13_DIR1 FIELD32(0x00000200)
284 #define MAC_CSR13_DIR2 FIELD32(0x00000400)
285 #define MAC_CSR13_DIR3 FIELD32(0x00000800)
286 #define MAC_CSR13_DIR4 FIELD32(0x00001000)
287 #define MAC_CSR13_DIR5 FIELD32(0x00002000)
288 #define MAC_CSR13_DIR6 FIELD32(0x00004000)
289 #define MAC_CSR13_DIR7 FIELD32(0x00008000)
299 #define MAC_CSR14 0x3038
300 #define MAC_CSR14_ON_PERIOD FIELD32(0x000000ff)
301 #define MAC_CSR14_OFF_PERIOD FIELD32(0x0000ff00)
302 #define MAC_CSR14_HW_LED FIELD32(0x00010000)
303 #define MAC_CSR14_SW_LED FIELD32(0x00020000)
304 #define MAC_CSR14_HW_LED_POLARITY FIELD32(0x00040000)
305 #define MAC_CSR14_SW_LED2 FIELD32(0x00080000)
310 #define MAC_CSR15 0x303c
332 #define TXRX_CSR0 0x3040
333 #define TXRX_CSR0_RX_ACK_TIMEOUT FIELD32(0x000001ff)
334 #define TXRX_CSR0_TSF_OFFSET FIELD32(0x00007e00)
335 #define TXRX_CSR0_AUTO_TX_SEQ FIELD32(0x00008000)
336 #define TXRX_CSR0_DISABLE_RX FIELD32(0x00010000)
337 #define TXRX_CSR0_DROP_CRC FIELD32(0x00020000)
338 #define TXRX_CSR0_DROP_PHYSICAL FIELD32(0x00040000)
339 #define TXRX_CSR0_DROP_CONTROL FIELD32(0x00080000)
340 #define TXRX_CSR0_DROP_NOT_TO_ME FIELD32(0x00100000)
341 #define TXRX_CSR0_DROP_TO_DS FIELD32(0x00200000)
342 #define TXRX_CSR0_DROP_VERSION_ERROR FIELD32(0x00400000)
343 #define TXRX_CSR0_DROP_MULTICAST FIELD32(0x00800000)
344 #define TXRX_CSR0_DROP_BROADCAST FIELD32(0x01000000)
345 #define TXRX_CSR0_DROP_ACK_CTS FIELD32(0x02000000)
346 #define TXRX_CSR0_TX_WITHOUT_WAITING FIELD32(0x04000000)
351 #define TXRX_CSR1 0x3044
352 #define TXRX_CSR1_BBP_ID0 FIELD32(0x0000007f)
353 #define TXRX_CSR1_BBP_ID0_VALID FIELD32(0x00000080)
354 #define TXRX_CSR1_BBP_ID1 FIELD32(0x00007f00)
355 #define TXRX_CSR1_BBP_ID1_VALID FIELD32(0x00008000)
356 #define TXRX_CSR1_BBP_ID2 FIELD32(0x007f0000)
357 #define TXRX_CSR1_BBP_ID2_VALID FIELD32(0x00800000)
358 #define TXRX_CSR1_BBP_ID3 FIELD32(0x7f000000)
359 #define TXRX_CSR1_BBP_ID3_VALID FIELD32(0x80000000)
364 #define TXRX_CSR2 0x3048
365 #define TXRX_CSR2_BBP_ID0 FIELD32(0x0000007f)
366 #define TXRX_CSR2_BBP_ID0_VALID FIELD32(0x00000080)
367 #define TXRX_CSR2_BBP_ID1 FIELD32(0x00007f00)
368 #define TXRX_CSR2_BBP_ID1_VALID FIELD32(0x00008000)
369 #define TXRX_CSR2_BBP_ID2 FIELD32(0x007f0000)
370 #define TXRX_CSR2_BBP_ID2_VALID FIELD32(0x00800000)
371 #define TXRX_CSR2_BBP_ID3 FIELD32(0x7f000000)
372 #define TXRX_CSR2_BBP_ID3_VALID FIELD32(0x80000000)
377 #define TXRX_CSR3 0x304c
378 #define TXRX_CSR3_BBP_ID0 FIELD32(0x0000007f)
379 #define TXRX_CSR3_BBP_ID0_VALID FIELD32(0x00000080)
380 #define TXRX_CSR3_BBP_ID1 FIELD32(0x00007f00)
381 #define TXRX_CSR3_BBP_ID1_VALID FIELD32(0x00008000)
382 #define TXRX_CSR3_BBP_ID2 FIELD32(0x007f0000)
383 #define TXRX_CSR3_BBP_ID2_VALID FIELD32(0x00800000)
384 #define TXRX_CSR3_BBP_ID3 FIELD32(0x7f000000)
385 #define TXRX_CSR3_BBP_ID3_VALID FIELD32(0x80000000)
394 #define TXRX_CSR4 0x3050
395 #define TXRX_CSR4_TX_ACK_TIMEOUT FIELD32(0x000000ff)
396 #define TXRX_CSR4_CNTL_ACK_POLICY FIELD32(0x00000700)
397 #define TXRX_CSR4_ACK_CTS_PSM FIELD32(0x00010000)
398 #define TXRX_CSR4_AUTORESPOND_ENABLE FIELD32(0x00020000)
399 #define TXRX_CSR4_AUTORESPOND_PREAMBLE FIELD32(0x00040000)
400 #define TXRX_CSR4_OFDM_TX_RATE_DOWN FIELD32(0x00080000)
401 #define TXRX_CSR4_OFDM_TX_RATE_STEP FIELD32(0x00300000)
402 #define TXRX_CSR4_OFDM_TX_FALLBACK_CCK FIELD32(0x00400000)
403 #define TXRX_CSR4_LONG_RETRY_LIMIT FIELD32(0x0f000000)
404 #define TXRX_CSR4_SHORT_RETRY_LIMIT FIELD32(0xf0000000)
409 #define TXRX_CSR5 0x3054
414 #define TXRX_CSR6 0x3058
419 #define TXRX_CSR7 0x305c
420 #define TXRX_CSR7_ACK_CTS_6MBS FIELD32(0x000000ff)
421 #define TXRX_CSR7_ACK_CTS_9MBS FIELD32(0x0000ff00)
422 #define TXRX_CSR7_ACK_CTS_12MBS FIELD32(0x00ff0000)
423 #define TXRX_CSR7_ACK_CTS_18MBS FIELD32(0xff000000)
428 #define TXRX_CSR8 0x3060
429 #define TXRX_CSR8_ACK_CTS_24MBS FIELD32(0x000000ff)
430 #define TXRX_CSR8_ACK_CTS_36MBS FIELD32(0x0000ff00)
431 #define TXRX_CSR8_ACK_CTS_48MBS FIELD32(0x00ff0000)
432 #define TXRX_CSR8_ACK_CTS_54MBS FIELD32(0xff000000)
441 #define TXRX_CSR9 0x3064
442 #define TXRX_CSR9_BEACON_INTERVAL FIELD32(0x0000ffff)
443 #define TXRX_CSR9_TSF_TICKING FIELD32(0x00010000)
444 #define TXRX_CSR9_TSF_SYNC FIELD32(0x00060000)
445 #define TXRX_CSR9_TBTT_ENABLE FIELD32(0x00080000)
446 #define TXRX_CSR9_BEACON_GEN FIELD32(0x00100000)
447 #define TXRX_CSR9_TIMESTAMP_COMPENSATE FIELD32(0xff000000)
452 #define TXRX_CSR10 0x3068
457 #define TXRX_CSR11 0x306c
462 #define TXRX_CSR12 0x3070
463 #define TXRX_CSR12_LOW_TSFTIMER FIELD32(0xffffffff)
468 #define TXRX_CSR13 0x3074
469 #define TXRX_CSR13_HIGH_TSFTIMER FIELD32(0xffffffff)
474 #define TXRX_CSR14 0x3078
479 #define TXRX_CSR15 0x307c
489 #define PHY_CSR0 0x3080
490 #define PHY_CSR0_PA_PE_BG FIELD32(0x00010000)
491 #define PHY_CSR0_PA_PE_A FIELD32(0x00020000)
496 #define PHY_CSR1 0x3084
497 #define PHY_CSR1_RF_RPI FIELD32(0x00010000)
502 #define PHY_CSR2 0x3088
511 #define PHY_CSR3 0x308c
512 #define PHY_CSR3_VALUE FIELD32(0x000000ff)
513 #define PHY_CSR3_REGNUM FIELD32(0x00007f00)
514 #define PHY_CSR3_READ_CONTROL FIELD32(0x00008000)
515 #define PHY_CSR3_BUSY FIELD32(0x00010000)
525 #define PHY_CSR4 0x3090
526 #define PHY_CSR4_VALUE FIELD32(0x00ffffff)
527 #define PHY_CSR4_NUMBER_OF_BITS FIELD32(0x1f000000)
528 #define PHY_CSR4_IF_SELECT FIELD32(0x20000000)
529 #define PHY_CSR4_PLL_LD FIELD32(0x40000000)
530 #define PHY_CSR4_BUSY FIELD32(0x80000000)
535 #define PHY_CSR5 0x3094
536 #define PHY_CSR5_IQ_FLIP FIELD32(0x00000004)
541 #define PHY_CSR6 0x3098
542 #define PHY_CSR6_IQ_FLIP FIELD32(0x00000004)
547 #define PHY_CSR7 0x309c
556 #define SEC_CSR0 0x30a0
557 #define SEC_CSR0_BSS0_KEY0_VALID FIELD32(0x00000001)
558 #define SEC_CSR0_BSS0_KEY1_VALID FIELD32(0x00000002)
559 #define SEC_CSR0_BSS0_KEY2_VALID FIELD32(0x00000004)
560 #define SEC_CSR0_BSS0_KEY3_VALID FIELD32(0x00000008)
561 #define SEC_CSR0_BSS1_KEY0_VALID FIELD32(0x00000010)
562 #define SEC_CSR0_BSS1_KEY1_VALID FIELD32(0x00000020)
563 #define SEC_CSR0_BSS1_KEY2_VALID FIELD32(0x00000040)
564 #define SEC_CSR0_BSS1_KEY3_VALID FIELD32(0x00000080)
565 #define SEC_CSR0_BSS2_KEY0_VALID FIELD32(0x00000100)
566 #define SEC_CSR0_BSS2_KEY1_VALID FIELD32(0x00000200)
567 #define SEC_CSR0_BSS2_KEY2_VALID FIELD32(0x00000400)
568 #define SEC_CSR0_BSS2_KEY3_VALID FIELD32(0x00000800)
569 #define SEC_CSR0_BSS3_KEY0_VALID FIELD32(0x00001000)
570 #define SEC_CSR0_BSS3_KEY1_VALID FIELD32(0x00002000)
571 #define SEC_CSR0_BSS3_KEY2_VALID FIELD32(0x00004000)
572 #define SEC_CSR0_BSS3_KEY3_VALID FIELD32(0x00008000)
577 #define SEC_CSR1 0x30a4
578 #define SEC_CSR1_BSS0_KEY0_CIPHER_ALG FIELD32(0x00000007)
579 #define SEC_CSR1_BSS0_KEY1_CIPHER_ALG FIELD32(0x00000070)
580 #define SEC_CSR1_BSS0_KEY2_CIPHER_ALG FIELD32(0x00000700)
581 #define SEC_CSR1_BSS0_KEY3_CIPHER_ALG FIELD32(0x00007000)
582 #define SEC_CSR1_BSS1_KEY0_CIPHER_ALG FIELD32(0x00070000)
583 #define SEC_CSR1_BSS1_KEY1_CIPHER_ALG FIELD32(0x00700000)
584 #define SEC_CSR1_BSS1_KEY2_CIPHER_ALG FIELD32(0x07000000)
585 #define SEC_CSR1_BSS1_KEY3_CIPHER_ALG FIELD32(0x70000000)
592 #define SEC_CSR2 0x30a8
593 #define SEC_CSR3 0x30ac
598 #define SEC_CSR4 0x30b0
599 #define SEC_CSR4_ENABLE_BSS0 FIELD32(0x00000001)
600 #define SEC_CSR4_ENABLE_BSS1 FIELD32(0x00000002)
601 #define SEC_CSR4_ENABLE_BSS2 FIELD32(0x00000004)
602 #define SEC_CSR4_ENABLE_BSS3 FIELD32(0x00000008)
607 #define SEC_CSR5 0x30b4
608 #define SEC_CSR5_BSS2_KEY0_CIPHER_ALG FIELD32(0x00000007)
609 #define SEC_CSR5_BSS2_KEY1_CIPHER_ALG FIELD32(0x00000070)
610 #define SEC_CSR5_BSS2_KEY2_CIPHER_ALG FIELD32(0x00000700)
611 #define SEC_CSR5_BSS2_KEY3_CIPHER_ALG FIELD32(0x00007000)
612 #define SEC_CSR5_BSS3_KEY0_CIPHER_ALG FIELD32(0x00070000)
613 #define SEC_CSR5_BSS3_KEY1_CIPHER_ALG FIELD32(0x00700000)
614 #define SEC_CSR5_BSS3_KEY2_CIPHER_ALG FIELD32(0x07000000)
615 #define SEC_CSR5_BSS3_KEY3_CIPHER_ALG FIELD32(0x70000000)
624 #define STA_CSR0 0x30c0
625 #define STA_CSR0_FCS_ERROR FIELD32(0x0000ffff)
626 #define STA_CSR0_PLCP_ERROR FIELD32(0xffff0000)
631 #define STA_CSR1 0x30c4
632 #define STA_CSR1_PHYSICAL_ERROR FIELD32(0x0000ffff)
633 #define STA_CSR1_FALSE_CCA_ERROR FIELD32(0xffff0000)
638 #define STA_CSR2 0x30c8
639 #define STA_CSR2_RX_FIFO_OVERFLOW_COUNT FIELD32(0x0000ffff)
640 #define STA_CSR2_RX_OVERFLOW_COUNT FIELD32(0xffff0000)
645 #define STA_CSR3 0x30cc
646 #define STA_CSR3_TX_BEACON_COUNT FIELD32(0x0000ffff)
651 #define STA_CSR4 0x30d0
652 #define STA_CSR4_TX_NO_RETRY_COUNT FIELD32(0x0000ffff)
653 #define STA_CSR4_TX_ONE_RETRY_COUNT FIELD32(0xffff0000)
658 #define STA_CSR5 0x30d4
659 #define STA_CSR4_TX_MULTI_RETRY_COUNT FIELD32(0x0000ffff)
660 #define STA_CSR4_TX_RETRY_FAIL_COUNT FIELD32(0xffff0000)
669 #define QOS_CSR1 0x30e4
670 #define QOS_CSR1_BYTE4 FIELD32(0x000000ff)
671 #define QOS_CSR1_BYTE5 FIELD32(0x0000ff00)
676 #define QOS_CSR2 0x30e8
683 #define QOS_CSR3 0x30ec
684 #define QOS_CSR4 0x30f0
689 #define QOS_CSR5 0x30f4
702 #define AIFSN_CSR 0x0400
703 #define AIFSN_CSR_AIFSN0 FIELD32(0x0000000f)
704 #define AIFSN_CSR_AIFSN1 FIELD32(0x000000f0)
705 #define AIFSN_CSR_AIFSN2 FIELD32(0x00000f00)
706 #define AIFSN_CSR_AIFSN3 FIELD32(0x0000f000)
715 #define CWMIN_CSR 0x0404
716 #define CWMIN_CSR_CWMIN0 FIELD32(0x0000000f)
717 #define CWMIN_CSR_CWMIN1 FIELD32(0x000000f0)
718 #define CWMIN_CSR_CWMIN2 FIELD32(0x00000f00)
719 #define CWMIN_CSR_CWMIN3 FIELD32(0x0000f000)
728 #define CWMAX_CSR 0x0408
729 #define CWMAX_CSR_CWMAX0 FIELD32(0x0000000f)
730 #define CWMAX_CSR_CWMAX1 FIELD32(0x000000f0)
731 #define CWMAX_CSR_CWMAX2 FIELD32(0x00000f00)
732 #define CWMAX_CSR_CWMAX3 FIELD32(0x0000f000)
739 #define AC_TXOP_CSR0 0x040c
740 #define AC_TXOP_CSR0_AC0_TX_OP FIELD32(0x0000ffff)
741 #define AC_TXOP_CSR0_AC1_TX_OP FIELD32(0xffff0000)
748 #define AC_TXOP_CSR1 0x0410
749 #define AC_TXOP_CSR1_AC2_TX_OP FIELD32(0x0000ffff)
750 #define AC_TXOP_CSR1_AC3_TX_OP FIELD32(0xffff0000)
760 #define BBP_R2_BG_MODE FIELD8(0x20)
765 #define BBP_R3_SMART_MODE FIELD8(0x01)
777 #define BBP_R4_RX_ANTENNA_CONTROL FIELD8(0x03)
778 #define BBP_R4_RX_FRAME_END FIELD8(0x20)
783 #define BBP_R77_RX_ANTENNA FIELD8(0x03)
792 #define RF3_TXPOWER FIELD32(0x00003e00)
797 #define RF4_FREQ_OFFSET FIELD32(0x0003f000)
807 #define EEPROM_MAC_ADDR_0 0x0002
808 #define EEPROM_MAC_ADDR_BYTE0 FIELD16(0x00ff)
809 #define EEPROM_MAC_ADDR_BYTE1 FIELD16(0xff00)
810 #define EEPROM_MAC_ADDR1 0x0003
811 #define EEPROM_MAC_ADDR_BYTE2 FIELD16(0x00ff)
812 #define EEPROM_MAC_ADDR_BYTE3 FIELD16(0xff00)
813 #define EEPROM_MAC_ADDR_2 0x0004
814 #define EEPROM_MAC_ADDR_BYTE4 FIELD16(0x00ff)
815 #define EEPROM_MAC_ADDR_BYTE5 FIELD16(0xff00)
827 #define EEPROM_ANTENNA 0x0010
828 #define EEPROM_ANTENNA_NUM FIELD16(0x0003)
829 #define EEPROM_ANTENNA_TX_DEFAULT FIELD16(0x000c)
830 #define EEPROM_ANTENNA_RX_DEFAULT FIELD16(0x0030)
831 #define EEPROM_ANTENNA_FRAME_TYPE FIELD16(0x0040)
832 #define EEPROM_ANTENNA_DYN_TXAGC FIELD16(0x0200)
833 #define EEPROM_ANTENNA_HARDWARE_RADIO FIELD16(0x0400)
834 #define EEPROM_ANTENNA_RF_TYPE FIELD16(0xf800)
840 #define EEPROM_NIC 0x0011
841 #define EEPROM_NIC_EXTERNAL_LNA FIELD16(0x0010)
848 #define EEPROM_GEOGRAPHY 0x0012
849 #define EEPROM_GEOGRAPHY_GEO_A FIELD16(0x00ff)
850 #define EEPROM_GEOGRAPHY_GEO FIELD16(0xff00)
855 #define EEPROM_BBP_START 0x0013
856 #define EEPROM_BBP_SIZE 16
857 #define EEPROM_BBP_VALUE FIELD16(0x00ff)
858 #define EEPROM_BBP_REG_ID FIELD16(0xff00)
863 #define EEPROM_TXPOWER_G_START 0x0023
864 #define EEPROM_TXPOWER_G_SIZE 7
865 #define EEPROM_TXPOWER_G_1 FIELD16(0x00ff)
866 #define EEPROM_TXPOWER_G_2 FIELD16(0xff00)
871 #define EEPROM_FREQ 0x002f
872 #define EEPROM_FREQ_OFFSET FIELD16(0x00ff)
873 #define EEPROM_FREQ_SEQ_MASK FIELD16(0xff00)
874 #define EEPROM_FREQ_SEQ FIELD16(0x0300)
888 #define EEPROM_LED 0x0030
889 #define EEPROM_LED_POLARITY_RDY_G FIELD16(0x0001)
890 #define EEPROM_LED_POLARITY_RDY_A FIELD16(0x0002)
891 #define EEPROM_LED_POLARITY_ACT FIELD16(0x0004)
892 #define EEPROM_LED_POLARITY_GPIO_0 FIELD16(0x0008)
893 #define EEPROM_LED_POLARITY_GPIO_1 FIELD16(0x0010)
894 #define EEPROM_LED_POLARITY_GPIO_2 FIELD16(0x0020)
895 #define EEPROM_LED_POLARITY_GPIO_3 FIELD16(0x0040)
896 #define EEPROM_LED_POLARITY_GPIO_4 FIELD16(0x0080)
897 #define EEPROM_LED_LED_MODE FIELD16(0x1f00)
902 #define EEPROM_TXPOWER_A_START 0x0031
903 #define EEPROM_TXPOWER_A_SIZE 12
904 #define EEPROM_TXPOWER_A_1 FIELD16(0x00ff)
905 #define EEPROM_TXPOWER_A_2 FIELD16(0xff00)
910 #define EEPROM_RSSI_OFFSET_BG 0x004d
911 #define EEPROM_RSSI_OFFSET_BG_1 FIELD16(0x00ff)
912 #define EEPROM_RSSI_OFFSET_BG_2 FIELD16(0xff00)
917 #define EEPROM_RSSI_OFFSET_A 0x004e
918 #define EEPROM_RSSI_OFFSET_A_1 FIELD16(0x00ff)
919 #define EEPROM_RSSI_OFFSET_A_2 FIELD16(0xff00)
924 #define TXD_DESC_SIZE ( 6 * sizeof(__le32) )
925 #define TXINFO_SIZE ( 6 * sizeof(__le32) )
926 #define RXD_DESC_SIZE ( 6 * sizeof(__le32) )
945 #define TXD_W0_BURST FIELD32(0x00000001)
946 #define TXD_W0_VALID FIELD32(0x00000002)
947 #define TXD_W0_MORE_FRAG FIELD32(0x00000004)
948 #define TXD_W0_ACK FIELD32(0x00000008)
949 #define TXD_W0_TIMESTAMP FIELD32(0x00000010)
950 #define TXD_W0_OFDM FIELD32(0x00000020)
951 #define TXD_W0_IFS FIELD32(0x00000040)
952 #define TXD_W0_RETRY_MODE FIELD32(0x00000080)
953 #define TXD_W0_TKIP_MIC FIELD32(0x00000100)
954 #define TXD_W0_KEY_TABLE FIELD32(0x00000200)
955 #define TXD_W0_KEY_INDEX FIELD32(0x0000fc00)
956 #define TXD_W0_DATABYTE_COUNT FIELD32(0x0fff0000)
957 #define TXD_W0_BURST2 FIELD32(0x10000000)
958 #define TXD_W0_CIPHER_ALG FIELD32(0xe0000000)
966 #define TXD_W1_HOST_Q_ID FIELD32(0x0000000f)
967 #define TXD_W1_AIFSN FIELD32(0x000000f0)
968 #define TXD_W1_CWMIN FIELD32(0x00000f00)
969 #define TXD_W1_CWMAX FIELD32(0x0000f000)
970 #define TXD_W1_IV_OFFSET FIELD32(0x003f0000)
971 #define TXD_W1_HW_SEQUENCE FIELD32(0x10000000)
972 #define TXD_W1_BUFFER_COUNT FIELD32(0xe0000000)
977 #define TXD_W2_PLCP_SIGNAL FIELD32(0x000000ff)
978 #define TXD_W2_PLCP_SERVICE FIELD32(0x0000ff00)
979 #define TXD_W2_PLCP_LENGTH_LOW FIELD32(0x00ff0000)
980 #define TXD_W2_PLCP_LENGTH_HIGH FIELD32(0xff000000)
985 #define TXD_W3_IV FIELD32(0xffffffff)
990 #define TXD_W4_EIV FIELD32(0xffffffff)
999 #define TXD_W5_FRAME_OFFSET FIELD32(0x000000ff)
1000 #define TXD_W5_PACKET_ID FIELD32(0x0000ff00)
1001 #define TXD_W5_TX_POWER FIELD32(0x00ff0000)
1002 #define TXD_W5_WAITING_DMA_DONE_INT FIELD32(0x01000000)
1013 #define RXD_W0_OWNER_NIC FIELD32(0x00000001)
1014 #define RXD_W0_DROP FIELD32(0x00000002)
1015 #define RXD_W0_UNICAST_TO_ME FIELD32(0x00000004)
1016 #define RXD_W0_MULTICAST FIELD32(0x00000008)
1017 #define RXD_W0_BROADCAST FIELD32(0x00000010)
1018 #define RXD_W0_MY_BSS FIELD32(0x00000020)
1019 #define RXD_W0_CRC_ERROR FIELD32(0x00000040)
1020 #define RXD_W0_OFDM FIELD32(0x00000080)
1021 #define RXD_W0_CIPHER_ERROR FIELD32(0x00000300)
1022 #define RXD_W0_KEY_INDEX FIELD32(0x0000fc00)
1023 #define RXD_W0_DATABYTE_COUNT FIELD32(0x0fff0000)
1024 #define RXD_W0_CIPHER_ALG FIELD32(0xe0000000)
1031 #define RXD_W1_SIGNAL FIELD32(0x000000ff)
1032 #define RXD_W1_RSSI_AGC FIELD32(0x00001f00)
1033 #define RXD_W1_RSSI_LNA FIELD32(0x00006000)
1034 #define RXD_W1_FRAME_OFFSET FIELD32(0x7f000000)
1040 #define RXD_W2_IV FIELD32(0xffffffff)
1046 #define RXD_W3_EIV FIELD32(0xffffffff)
1053 #define RXD_W4_ICV FIELD32(0xffffffff)
1065 #define RXD_W5_RESERVED FIELD32(0xffffffff)
1071 #define MIN_TXPOWER 0
1072 #define MAX_TXPOWER 31
1073 #define DEFAULT_TXPOWER 24
1075 #define TXPOWER_FROM_DEV(__txpower) \
1076 (((u8)(__txpower)) > MAX_TXPOWER) ? DEFAULT_TXPOWER : (__txpower)
1078 #define TXPOWER_TO_DEV(__txpower) \
1079 clamp_t(char, __txpower, MIN_TXPOWER, MAX_TXPOWER)