Go to the documentation of this file.
28 #define RX_TXSTATUS_FIFO 3
31 #define TX_AC_BK_FIFO 0
32 #define TX_AC_BE_FIFO 1
33 #define TX_AC_VI_FIFO 2
34 #define TX_AC_VO_FIFO 3
35 #define TX_BCMC_FIFO 4
36 #define TX_ATIM_FIFO 5
41 #define M_AC_TXLMT_BASE_ADDR (0x180 * 2)
42 #define M_AC_TXLMT_ADDR(_ac) (M_AC_TXLMT_BASE_ADDR + (2 * (_ac)))
45 #define TX_DATA_FIFO TX_AC_BE_FIFO
46 #define TX_CTL_FIFO TX_AC_VO_FIFO
48 #define WL_RSSI_ANT_MAX 4
434 #define D11REGOFFS(field) offsetof(struct d11regs, field)
436 #define PIHR_BASE 0x0400
439 #define BT_DONE (1U << 31)
440 #define BT_B2S (1 << 30)
443 #define I_PC (1 << 10)
444 #define I_PD (1 << 11)
445 #define I_DE (1 << 12)
446 #define I_RU (1 << 13)
447 #define I_RO (1 << 14)
448 #define I_XU (1 << 15)
449 #define I_RI (1 << 16)
450 #define I_XI (1 << 24)
453 #define IRL_TO_MASK 0x00ffffff
454 #define IRL_FC_MASK 0xff000000
455 #define IRL_FC_SHIFT 24
458 #define MCTL_GMODE (1U << 31)
459 #define MCTL_DISCARD_PMQ (1 << 30)
460 #define MCTL_WAKE (1 << 26)
461 #define MCTL_HPS (1 << 25)
462 #define MCTL_PROMISC (1 << 24)
463 #define MCTL_KEEPBADFCS (1 << 23)
464 #define MCTL_KEEPCONTROL (1 << 22)
465 #define MCTL_PHYLOCK (1 << 21)
466 #define MCTL_BCNS_PROMISC (1 << 20)
467 #define MCTL_LOCK_RADIO (1 << 19)
468 #define MCTL_AP (1 << 18)
469 #define MCTL_INFRA (1 << 17)
470 #define MCTL_BIGEND (1 << 16)
471 #define MCTL_GPOUT_SEL_MASK (3 << 14)
472 #define MCTL_GPOUT_SEL_SHIFT 14
473 #define MCTL_EN_PSMDBG (1 << 13)
474 #define MCTL_IHR_EN (1 << 10)
475 #define MCTL_SHM_UPPER (1 << 9)
476 #define MCTL_SHM_EN (1 << 8)
477 #define MCTL_PSM_JMP_0 (1 << 2)
478 #define MCTL_PSM_RUN (1 << 1)
479 #define MCTL_EN_MAC (1 << 0)
482 #define MCMD_BCN0VLD (1 << 0)
483 #define MCMD_BCN1VLD (1 << 1)
484 #define MCMD_DIRFRMQVAL (1 << 2)
485 #define MCMD_CCA (1 << 3)
486 #define MCMD_BG_NOISE (1 << 4)
487 #define MCMD_SKIP_SHMINIT (1 << 5)
488 #define MCMD_SAMPLECOLL MCMD_SKIP_SHMINIT
492 #define MI_MACSSPNDD (1 << 0)
494 #define MI_BCNTPL (1 << 1)
496 #define MI_TBTT (1 << 2)
498 #define MI_BCNSUCCESS (1 << 3)
500 #define MI_BCNCANCLD (1 << 4)
502 #define MI_ATIMWINEND (1 << 5)
504 #define MI_PMQ (1 << 6)
506 #define MI_NSPECGEN_0 (1 << 7)
508 #define MI_NSPECGEN_1 (1 << 8)
510 #define MI_MACTXERR (1 << 9)
512 #define MI_NSPECGEN_3 (1 << 10)
514 #define MI_PHYTXERR (1 << 11)
516 #define MI_PME (1 << 12)
518 #define MI_GP0 (1 << 13)
520 #define MI_GP1 (1 << 14)
522 #define MI_DMAINT (1 << 15)
524 #define MI_TXSTOP (1 << 16)
526 #define MI_CCA (1 << 17)
528 #define MI_BG_NOISE (1 << 18)
530 #define MI_DTIM_TBTT (1 << 19)
532 #define MI_PRQ (1 << 20)
534 #define MI_PWRUP (1 << 21)
535 #define MI_RESERVED3 (1 << 22)
536 #define MI_RESERVED2 (1 << 23)
537 #define MI_RESERVED1 (1 << 25)
539 #define MI_RFDISABLE (1 << 28)
541 #define MI_TFS (1 << 29)
543 #define MI_PHYCHANGED (1 << 30)
545 #define MI_TO (1U << 31)
549 #define MCAP_TKIPMIC 0x80000000
553 #define PMQH_DATA_MASK 0xffff0000
555 #define PMQH_BSSCFG 0x00100000
557 #define PMQH_PMOFF 0x00010000
559 #define PMQH_PMON 0x00020000
561 #define PMQH_DASAT 0x00040000
563 #define PMQH_ATIMFAIL 0x00080000
565 #define PMQH_DEL_ENTRY 0x00000001
567 #define PMQH_DEL_MULT 0x00000002
569 #define PMQH_OFLO 0x00000004
571 #define PMQH_NOT_EMPTY 0x00000008
575 #define PDBG_CRS (1 << 0)
577 #define PDBG_TXA (1 << 1)
579 #define PDBG_TXF (1 << 2)
581 #define PDBG_TXE (1 << 3)
583 #define PDBG_RXF (1 << 4)
585 #define PDBG_RXS (1 << 5)
587 #define PDBG_RXFRG (1 << 6)
589 #define PDBG_RXV (1 << 7)
591 #define PDBG_RFD (1 << 16)
594 #define OBJADDR_SEL_MASK 0x000F0000
595 #define OBJADDR_UCM_SEL 0x00000000
596 #define OBJADDR_SHM_SEL 0x00010000
597 #define OBJADDR_SCR_SEL 0x00020000
598 #define OBJADDR_IHR_SEL 0x00030000
599 #define OBJADDR_RCMTA_SEL 0x00040000
600 #define OBJADDR_SRCHM_SEL 0x00060000
601 #define OBJADDR_WINC 0x01000000
602 #define OBJADDR_RINC 0x02000000
603 #define OBJADDR_AUTO_INC 0x03000000
605 #define WEP_PCMADDR 0x07d4
606 #define WEP_PCMDATA 0x07d6
609 #define TXS_V (1 << 0)
610 #define TXS_STATUS_MASK 0xffff
611 #define TXS_FID_MASK 0xffff0000
612 #define TXS_FID_SHIFT 16
615 #define TXS_SEQ_MASK 0xffff
616 #define TXS_PTX_MASK 0xff0000
617 #define TXS_PTX_SHIFT 16
618 #define TXS_MU_MASK 0x01000000
619 #define TXS_MU_SHIFT 24
622 #define CCS_ERSRC_REQ_D11PLL 0x00000100
623 #define CCS_ERSRC_REQ_PHYPLL 0x00000200
624 #define CCS_ERSRC_AVAIL_D11PLL 0x01000000
625 #define CCS_ERSRC_AVAIL_PHYPLL 0x02000000
628 #define CCS_ERSRC_REQ_HT 0x00000010
629 #define CCS_ERSRC_AVAIL_HT 0x00020000
632 #define CFPREP_CBI_MASK 0xffffffc0
633 #define CFPREP_CBI_SHIFT 6
634 #define CFPREP_CFPP 0x00000001
637 #define TXFIFOCMD_RESET_MASK (1 << 15)
638 #define TXFIFOCMD_FIFOSEL_SHIFT 8
639 #define TXFIFO_FIFOTOP_SHIFT 8
641 #define TXFIFO_START_BLK16 65
642 #define TXFIFO_START_BLK 6
643 #define TXFIFO_SIZE_UNIT 256
644 #define MBSS16_TEMPLMEM_MINBLKS 65
648 #define PV_AV_MASK 0xf000
650 #define PV_AV_SHIFT 12
652 #define PV_PT_MASK 0x0f00
654 #define PV_PT_SHIFT 8
656 #define PV_PV_MASK 0x000f
657 #define PHY_TYPE(v) ((v & PV_PT_MASK) >> PV_PT_SHIFT)
661 #define PHY_TYPE_SSN 6
662 #define PHY_TYPE_LCN 8
663 #define PHY_TYPE_LCNXN 9
664 #define PHY_TYPE_NULL 0xf
667 #define ANA_11N_013 5
676 #define D11A_PHY_HDR_GRATE(phdr) ((phdr)->rlpt[0] & 0x0f)
677 #define D11A_PHY_HDR_GRES(phdr) (((phdr)->rlpt[0] >> 4) & 0x01)
678 #define D11A_PHY_HDR_GLENGTH(phdr) (((u32 *)((phdr)->rlpt) >> 5) & 0x0fff)
679 #define D11A_PHY_HDR_GPARITY(phdr) (((phdr)->rlpt[3] >> 1) & 0x01)
680 #define D11A_PHY_HDR_GTAIL(phdr) (((phdr)->rlpt[3] >> 2) & 0x3f)
683 #define D11A_PHY_HDR_SRATE(phdr, rate) \
684 ((phdr)->rlpt[0] = ((phdr)->rlpt[0] & 0xf0) | ((rate) & 0xf))
686 #define D11A_PHY_HDR_SRES(phdr) ((phdr)->rlpt[0] &= 0xef)
688 #define D11A_PHY_HDR_SLENGTH(phdr, length) \
689 (*(u32 *)((phdr)->rlpt) = *(u32 *)((phdr)->rlpt) | \
690 (((length) & 0x0fff) << 5))
692 #define D11A_PHY_HDR_STAIL(phdr) ((phdr)->rlpt[3] &= 0x03)
694 #define D11A_PHY_HDR_LEN_L 3
695 #define D11A_PHY_HDR_LEN_R 2
697 #define D11A_PHY_TX_DELAY (2)
699 #define D11A_PHY_HDR_TIME (4)
700 #define D11A_PHY_PRE_TIME (16)
701 #define D11A_PHY_PREHDR_TIME (D11A_PHY_PRE_TIME + D11A_PHY_HDR_TIME)
711 #define D11B_PHY_HDR_LEN 6
713 #define D11B_PHY_TX_DELAY (3)
715 #define D11B_PHY_LHDR_TIME (D11B_PHY_HDR_LEN << 3)
716 #define D11B_PHY_LPRE_TIME (144)
717 #define D11B_PHY_LPREHDR_TIME (D11B_PHY_LPRE_TIME + D11B_PHY_LHDR_TIME)
719 #define D11B_PHY_SHDR_TIME (D11B_PHY_LHDR_TIME >> 1)
720 #define D11B_PHY_SPRE_TIME (D11B_PHY_LPRE_TIME >> 1)
721 #define D11B_PHY_SPREHDR_TIME (D11B_PHY_SPRE_TIME + D11B_PHY_SHDR_TIME)
723 #define D11B_PLCP_SIGNAL_LOCKED (1 << 2)
724 #define D11B_PLCP_SIGNAL_LE (1 << 7)
726 #define MIMO_PLCP_MCS_MASK 0x7f
727 #define MIMO_PLCP_40MHZ 0x80
728 #define MIMO_PLCP_AMPDU 0x08
730 #define BRCMS_GET_CCK_PLCP_LEN(plcp) (plcp[4] + (plcp[5] << 8))
731 #define BRCMS_GET_MIMO_PLCP_LEN(plcp) (plcp[1] + (plcp[2] << 8))
732 #define BRCMS_SET_MIMO_PLCP_LEN(plcp, len) \
734 plcp[1] = len & 0xff; \
735 plcp[2] = ((len >> 8) & 0xff); \
738 #define BRCMS_SET_MIMO_PLCP_AMPDU(plcp) (plcp[3] |= MIMO_PLCP_AMPDU)
739 #define BRCMS_CLR_MIMO_PLCP_AMPDU(plcp) (plcp[3] &= ~MIMO_PLCP_AMPDU)
740 #define BRCMS_IS_MIMO_PLCP_AMPDU(plcp) (plcp[3] & MIMO_PLCP_AMPDU)
747 #define D11_PHY_HDR_LEN 6
787 #define D11_TXH_LEN 112
799 #define TXC_AMPDU_SHIFT 9
800 #define TXC_AMPDU_NONE 0
801 #define TXC_AMPDU_FIRST 1
802 #define TXC_AMPDU_MIDDLE 2
803 #define TXC_AMPDU_LAST 3
806 #define TXC_AMIC 0x8000
807 #define TXC_SENDCTS 0x0800
808 #define TXC_AMPDU_MASK 0x0600
809 #define TXC_BW_40 0x0100
810 #define TXC_FREQBAND_5G 0x0080
811 #define TXC_DFCS 0x0040
812 #define TXC_IGNOREPMQ 0x0020
813 #define TXC_HWSEQ 0x0010
814 #define TXC_STARTMSDU 0x0008
815 #define TXC_SENDRTS 0x0004
816 #define TXC_LONGFRAME 0x0002
817 #define TXC_IMMEDACK 0x0001
821 #define TXC_PREAMBLE_RTS_FB_SHORT 0x8000
823 #define TXC_PREAMBLE_RTS_MAIN_SHORT 0x4000
829 #define TXC_PREAMBLE_DATA_FB_SHORT 0x2000
833 #define TXC_AMPDU_FBR 0x1000
834 #define TXC_SECKEY_MASK 0x0FF0
835 #define TXC_SECKEY_SHIFT 4
837 #define TXC_ALT_TXPWR 0x0008
838 #define TXC_SECTYPE_MASK 0x0007
839 #define TXC_SECTYPE_SHIFT 0
842 #define AMPDU_FBR_NULL_DELIM 5
845 #define PHY_TXC_PWR_MASK 0xFC00
846 #define PHY_TXC_PWR_SHIFT 10
847 #define PHY_TXC_ANT_MASK 0x03C0
848 #define PHY_TXC_ANT_SHIFT 6
849 #define PHY_TXC_ANT_0_1 0x00C0
850 #define PHY_TXC_LCNPHY_ANT_LAST 0x0000
851 #define PHY_TXC_ANT_3 0x0200
852 #define PHY_TXC_ANT_2 0x0100
853 #define PHY_TXC_ANT_1 0x0080
854 #define PHY_TXC_ANT_0 0x0040
855 #define PHY_TXC_SHORT_HDR 0x0010
857 #define PHY_TXC_OLD_ANT_0 0x0000
858 #define PHY_TXC_OLD_ANT_1 0x0100
859 #define PHY_TXC_OLD_ANT_LAST 0x0300
862 #define PHY_TXC1_BW_MASK 0x0007
863 #define PHY_TXC1_BW_10MHZ 0
864 #define PHY_TXC1_BW_10MHZ_UP 1
865 #define PHY_TXC1_BW_20MHZ 2
866 #define PHY_TXC1_BW_20MHZ_UP 3
867 #define PHY_TXC1_BW_40MHZ 4
868 #define PHY_TXC1_BW_40MHZ_DUP 5
869 #define PHY_TXC1_MODE_SHIFT 3
870 #define PHY_TXC1_MODE_MASK 0x0038
871 #define PHY_TXC1_MODE_SISO 0
872 #define PHY_TXC1_MODE_CDD 1
873 #define PHY_TXC1_MODE_STBC 2
874 #define PHY_TXC1_MODE_SDM 3
877 #define PHY_TXC_HTANT_MASK 0x3fC0
880 #define XFTS_RTS_FT_SHIFT 2
881 #define XFTS_FBRRTS_FT_SHIFT 4
882 #define XFTS_CHANNEL_SHIFT 8
885 #define PHY_AWS_ANTDIV 0x2000
888 #define IFS_USEEDCF (1 << 2)
891 #define IFS_CTL1_EDCRS (1 << 3)
892 #define IFS_CTL1_EDCRS_20L (1 << 4)
893 #define IFS_CTL1_EDCRS_40 (1 << 5)
896 #define ABI_MAS_ADDR_BMP_IDX_MASK 0x0f00
897 #define ABI_MAS_ADDR_BMP_IDX_SHIFT 8
898 #define ABI_MAS_FBR_ANT_PTN_MASK 0x00f0
899 #define ABI_MAS_FBR_ANT_PTN_SHIFT 4
900 #define ABI_MAS_MRT_ANT_PTN_MASK 0x000f
914 #define TXSTATUS_LEN 16
917 #define TX_STATUS_FRM_RTX_MASK 0xF000
918 #define TX_STATUS_FRM_RTX_SHIFT 12
919 #define TX_STATUS_RTS_RTX_MASK 0x0F00
920 #define TX_STATUS_RTS_RTX_SHIFT 8
921 #define TX_STATUS_MASK 0x00FE
922 #define TX_STATUS_PMINDCTD (1 << 7)
923 #define TX_STATUS_INTERMEDIATE (1 << 6)
924 #define TX_STATUS_AMPDU (1 << 5)
925 #define TX_STATUS_SUPR_MASK 0x1C
926 #define TX_STATUS_SUPR_SHIFT 2
927 #define TX_STATUS_ACK_RCV (1 << 1)
928 #define TX_STATUS_VALID (1 << 0)
929 #define TX_STATUS_NO_ACK 0
932 #define TX_STATUS_SUPR_PMQ (1 << 2)
933 #define TX_STATUS_SUPR_FLUSH (2 << 2)
934 #define TX_STATUS_SUPR_FRAG (3 << 2)
935 #define TX_STATUS_SUPR_TBTT (3 << 2)
936 #define TX_STATUS_SUPR_BADCH (4 << 2)
937 #define TX_STATUS_SUPR_EXPTIME (5 << 2)
938 #define TX_STATUS_SUPR_UF (6 << 2)
941 #define TX_STATUS_UNEXP(status) \
942 ((((status) & TX_STATUS_INTERMEDIATE) != 0) && \
943 TX_STATUS_UNEXP_AMPDU(status))
946 #define TX_STATUS_UNEXP_AMPDU(status) \
947 ((((status) & TX_STATUS_SUPR_MASK) != 0) && \
948 (((status) & TX_STATUS_SUPR_MASK) != TX_STATUS_SUPR_EXPTIME))
950 #define TX_STATUS_BA_BMAP03_MASK 0xF000
951 #define TX_STATUS_BA_BMAP03_SHIFT 12
952 #define TX_STATUS_BA_BMAP47_MASK 0x001E
953 #define TX_STATUS_BA_BMAP47_SHIFT 3
958 #define RCM_INC_MASK_H 0x0080
959 #define RCM_INC_MASK_L 0x0040
960 #define RCM_INC_DATA 0x0020
961 #define RCM_INDEX_MASK 0x001F
964 #define RCM_MAC_OFFSET 0
965 #define RCM_BSSID_OFFSET 3
966 #define RCM_F_BSSID_0_OFFSET 6
967 #define RCM_F_BSSID_1_OFFSET 9
968 #define RCM_F_BSSID_2_OFFSET 12
970 #define RCM_WEP_TA0_OFFSET 16
971 #define RCM_WEP_TA1_OFFSET 19
972 #define RCM_WEP_TA2_OFFSET 22
973 #define RCM_WEP_TA3_OFFSET 25
978 #define MAC_PHY_RESET 1
979 #define MAC_PHY_CLOCK_EN 2
980 #define MAC_PHY_FORCE_CLK 4
985 #define WKEY_START (1 << 8)
986 #define WKEY_SEL_MASK 0x1F
991 #define RCMTA_SIZE 50
993 #define M_ADDR_BMP_BLK (0x37e * 2)
994 #define M_ADDR_BMP_BLK_SZ 12
996 #define ADDR_BMP_RA (1 << 0)
997 #define ADDR_BMP_TA (1 << 1)
998 #define ADDR_BMP_BSSID (1 << 2)
999 #define ADDR_BMP_AP (1 << 3)
1000 #define ADDR_BMP_STA (1 << 4)
1001 #define ADDR_BMP_RESERVED1 (1 << 5)
1002 #define ADDR_BMP_RESERVED2 (1 << 6)
1003 #define ADDR_BMP_RESERVED3 (1 << 7)
1004 #define ADDR_BMP_BSS_IDX_MASK (3 << 8)
1005 #define ADDR_BMP_BSS_IDX_SHIFT 8
1007 #define WSEC_MAX_RCMTA_KEYS 54
1010 #define WSEC_MAX_TKMIC_ENGINE_KEYS 12
1013 #define WSEC_MAX_RXE_KEYS 4
1017 #define SKL_ALGO_MASK 0x0007
1018 #define SKL_ALGO_SHIFT 0
1019 #define SKL_KEYID_MASK 0x0008
1020 #define SKL_KEYID_SHIFT 3
1021 #define SKL_INDEX_MASK 0x03F0
1022 #define SKL_INDEX_SHIFT 4
1023 #define SKL_GRP_ALGO_MASK 0x1c00
1024 #define SKL_GRP_ALGO_SHIFT 10
1027 #define SKL_IBSS_INDEX_MASK 0x01F0
1028 #define SKL_IBSS_INDEX_SHIFT 4
1029 #define SKL_IBSS_KEYID1_MASK 0x0600
1030 #define SKL_IBSS_KEYID1_SHIFT 9
1031 #define SKL_IBSS_KEYID2_MASK 0x1800
1032 #define SKL_IBSS_KEYID2_SHIFT 11
1033 #define SKL_IBSS_KEYALGO_MASK 0xE000
1034 #define SKL_IBSS_KEYALGO_SHIFT 13
1036 #define WSEC_MODE_OFF 0
1037 #define WSEC_MODE_HW 1
1038 #define WSEC_MODE_SW 2
1040 #define WSEC_ALGO_OFF 0
1041 #define WSEC_ALGO_WEP1 1
1042 #define WSEC_ALGO_TKIP 2
1043 #define WSEC_ALGO_AES 3
1044 #define WSEC_ALGO_WEP128 4
1045 #define WSEC_ALGO_AES_LEGACY 5
1046 #define WSEC_ALGO_NALG 6
1048 #define AES_MODE_NONE 0
1049 #define AES_MODE_CCM 1
1052 #define WECR0_KEYREG_SHIFT 0
1053 #define WECR0_KEYREG_MASK 0x7
1054 #define WECR0_DECRYPT (1 << 3)
1055 #define WECR0_IVINLINE (1 << 4)
1056 #define WECR0_WEPALG_SHIFT 5
1057 #define WECR0_WEPALG_MASK (0x7 << 5)
1058 #define WECR0_WKEYSEL_SHIFT 8
1059 #define WECR0_WKEYSEL_MASK (0x7 << 8)
1060 #define WECR0_WKEYSTART (1 << 11)
1061 #define WECR0_WEPINIT (1 << 14)
1062 #define WECR0_ICVERR (1 << 15)
1065 #define T_ACTS_TPL_BASE (0)
1066 #define T_NULL_TPL_BASE (0xc * 2)
1067 #define T_QNULL_TPL_BASE (0x1c * 2)
1068 #define T_RR_TPL_BASE (0x2c * 2)
1069 #define T_BCN0_TPL_BASE (0x34 * 2)
1070 #define T_PRS_TPL_BASE (0x134 * 2)
1071 #define T_BCN1_TPL_BASE (0x234 * 2)
1072 #define T_TX_FIFO_TXRAM_BASE (T_ACTS_TPL_BASE + \
1073 (TXFIFO_START_BLK * TXFIFO_SIZE_UNIT))
1075 #define T_BA_TPL_BASE T_QNULL_TPL_BASE
1077 #define T_RAM_ACCESS_SZ 4
1082 #define M_MACHW_VER (0x00b * 2)
1085 #define M_MACHW_CAP_L (0x060 * 2)
1086 #define M_MACHW_CAP_H (0x061 * 2)
1089 #define M_EDCF_STATUS_OFF (0x007 * 2)
1090 #define M_TXF_CUR_INDEX (0x018 * 2)
1091 #define M_EDCF_QINFO (0x120 * 2)
1094 #define M_DOT11_SLOT (0x008 * 2)
1095 #define M_DOT11_DTIMPERIOD (0x009 * 2)
1096 #define M_NOSLPZNATDTIM (0x026 * 2)
1099 #define M_BCN0_FRM_BYTESZ (0x00c * 2)
1100 #define M_BCN1_FRM_BYTESZ (0x00d * 2)
1101 #define M_BCN_TXTSF_OFFSET (0x00e * 2)
1102 #define M_TIMBPOS_INBEACON (0x00f * 2)
1103 #define M_SFRMTXCNTFBRTHSD (0x022 * 2)
1104 #define M_LFRMTXCNTFBRTHSD (0x023 * 2)
1105 #define M_BCN_PCTLWD (0x02a * 2)
1106 #define M_BCN_LI (0x05b * 2)
1109 #define M_MAXRXFRM_LEN (0x010 * 2)
1112 #define M_RSP_PCTLWD (0x011 * 2)
1115 #define M_TXPWR_N (0x012 * 2)
1116 #define M_TXPWR_TARGET (0x013 * 2)
1117 #define M_TXPWR_MAX (0x014 * 2)
1118 #define M_TXPWR_CUR (0x019 * 2)
1121 #define M_RX_PAD_DATA_OFFSET (0x01a * 2)
1124 #define M_SEC_DEFIVLOC (0x01e * 2)
1125 #define M_SEC_VALNUMSOFTMCHTA (0x01f * 2)
1126 #define M_PHYVER (0x028 * 2)
1127 #define M_PHYTYPE (0x029 * 2)
1128 #define M_SECRXKEYS_PTR (0x02b * 2)
1129 #define M_TKMICKEYS_PTR (0x059 * 2)
1130 #define M_SECKINDXALGO_BLK (0x2ea * 2)
1131 #define M_SECKINDXALGO_BLK_SZ 54
1132 #define M_SECPSMRXTAMCH_BLK (0x2fa * 2)
1133 #define M_TKIP_TSC_TTAK (0x18c * 2)
1134 #define D11_MAX_KEY_SIZE 16
1136 #define M_MAX_ANTCNT (0x02e * 2)
1139 #define M_SSIDLEN (0x024 * 2)
1140 #define M_PRB_RESP_FRM_LEN (0x025 * 2)
1141 #define M_PRS_MAXTIME (0x03a * 2)
1142 #define M_SSID (0xb0 * 2)
1143 #define M_CTXPRS_BLK (0xc0 * 2)
1144 #define C_CTX_PCTLWD_POS (0x4 * 2)
1147 #define M_OFDM_OFFSET (0x027 * 2)
1150 #define M_B_TSSI_0 (0x02c * 2)
1151 #define M_B_TSSI_1 (0x02d * 2)
1154 #define M_HOST_FLAGS1 (0x02f * 2)
1155 #define M_HOST_FLAGS2 (0x030 * 2)
1156 #define M_HOST_FLAGS3 (0x031 * 2)
1157 #define M_HOST_FLAGS4 (0x03c * 2)
1158 #define M_HOST_FLAGS5 (0x06a * 2)
1159 #define M_HOST_FLAGS_SZ 16
1161 #define M_RADAR_REG (0x033 * 2)
1164 #define M_A_TSSI_0 (0x034 * 2)
1165 #define M_A_TSSI_1 (0x035 * 2)
1168 #define M_NOISE_IF_COUNT (0x034 * 2)
1169 #define M_NOISE_IF_TIMEOUT (0x035 * 2)
1171 #define M_RF_RX_SP_REG1 (0x036 * 2)
1174 #define M_G_TSSI_0 (0x038 * 2)
1175 #define M_G_TSSI_1 (0x039 * 2)
1178 #define M_JSSI_0 (0x44 * 2)
1179 #define M_JSSI_1 (0x45 * 2)
1180 #define M_JSSI_AUX (0x46 * 2)
1182 #define M_CUR_2050_RADIOCODE (0x47 * 2)
1185 #define M_FIFOSIZE0 (0x4c * 2)
1186 #define M_FIFOSIZE1 (0x4d * 2)
1187 #define M_FIFOSIZE2 (0x4e * 2)
1188 #define M_FIFOSIZE3 (0x4f * 2)
1189 #define D11_MAX_TX_FRMS 32
1192 #define M_CURCHANNEL (0x50 * 2)
1193 #define D11_CURCHANNEL_5G 0x0100;
1194 #define D11_CURCHANNEL_40 0x0200;
1195 #define D11_CURCHANNEL_MAX 0x00FF;
1198 #define M_BCMC_FID (0x54 * 2)
1199 #define INVALIDFID 0xffff
1202 #define M_BCN_PCTL1WD (0x058 * 2)
1205 #define M_TX_IDLE_BUSY_RATIO_X_16_CCK (0x52 * 2)
1206 #define M_TX_IDLE_BUSY_RATIO_X_16_OFDM (0x5A * 2)
1209 #define M_LCN_RSSI_0 0x1332
1210 #define M_LCN_RSSI_1 0x1338
1211 #define M_LCN_RSSI_2 0x133e
1212 #define M_LCN_RSSI_3 0x1344
1215 #define M_LCN_SNR_A_0 0x1334
1216 #define M_LCN_SNR_B_0 0x1336
1218 #define M_LCN_SNR_A_1 0x133a
1219 #define M_LCN_SNR_B_1 0x133c
1221 #define M_LCN_SNR_A_2 0x1340
1222 #define M_LCN_SNR_B_2 0x1342
1224 #define M_LCN_SNR_A_3 0x1346
1225 #define M_LCN_SNR_B_3 0x1348
1227 #define M_LCN_LAST_RESET (81*2)
1228 #define M_LCN_LAST_LOC (63*2)
1229 #define M_LCNPHY_RESET_STATUS (4902)
1230 #define M_LCNPHY_DSC_TIME (0x98d*2)
1231 #define M_LCNPHY_RESET_CNT_DSC (0x98b*2)
1232 #define M_LCNPHY_RESET_CNT (0x98c*2)
1235 #define M_RT_DIRMAP_A (0xe0 * 2)
1236 #define M_RT_BBRSMAP_A (0xf0 * 2)
1237 #define M_RT_DIRMAP_B (0x100 * 2)
1238 #define M_RT_BBRSMAP_B (0x110 * 2)
1241 #define M_RT_PRS_PLCP_POS 10
1242 #define M_RT_PRS_DUR_POS 16
1243 #define M_RT_OFDM_PCTL1_POS 18
1245 #define M_20IN40_IQ (0x380 * 2)
1248 #define M_CURR_IDX1 (0x384 * 2)
1249 #define M_CURR_IDX2 (0x387 * 2)
1251 #define M_BSCALE_ANT0 (0x5e * 2)
1252 #define M_BSCALE_ANT1 (0x5f * 2)
1255 #define M_MIMO_ANTSEL_RXDFLT (0x63 * 2)
1256 #define M_ANTSEL_CLKDIV (0x61 * 2)
1257 #define M_MIMO_ANTSEL_TXDFLT (0x64 * 2)
1259 #define M_MIMO_MAXSYM (0x5d * 2)
1260 #define MIMO_MAXSYM_DEF 0x8000
1261 #define MIMO_MAXSYM_MAX 0xffff
1263 #define M_WATCHDOG_8TU (0x1e * 2)
1264 #define WATCHDOG_8TU_DEF 5
1265 #define WATCHDOG_8TU_MAX 10
1269 #define M_PKTENG_CTRL (0x6c * 2)
1271 #define M_PKTENG_IFS (0x6d * 2)
1273 #define M_PKTENG_FRMCNT_LO (0x6e * 2)
1275 #define M_PKTENG_FRMCNT_HI (0x6f * 2)
1278 #define M_LCN_PWR_IDX_MAX (0x67 * 2)
1279 #define M_LCN_PWR_IDX_MIN (0x66 * 2)
1282 #define M_PKTENG_MODE_TX 0x0001
1283 #define M_PKTENG_MODE_TX_RIFS 0x0004
1284 #define M_PKTENG_MODE_TX_CTS 0x0008
1285 #define M_PKTENG_MODE_RX 0x0002
1286 #define M_PKTENG_MODE_RX_WITH_ACK 0x0402
1287 #define M_PKTENG_MODE_MASK 0x0003
1289 #define M_PKTENG_FRMCNT_VLD 0x0100
1293 #define M_SMPL_COL_BMP (0x37d * 2)
1295 #define M_SMPL_COL_CTL (0x3b2 * 2)
1297 #define ANTSEL_CLKDIV_4MHZ 6
1298 #define MIMO_ANTSEL_BUSY 0x4000
1299 #define MIMO_ANTSEL_SEL 0x8000
1300 #define MIMO_ANTSEL_WAIT 50
1301 #define MIMO_ANTSEL_OVERRIDE 0x8000
1314 #define M_EDCF_QLEN (16 * 2)
1316 #define WME_STATUS_NEWAC (1 << 8)
1328 #define MHF1_ANTDIV 0x0001
1330 #define MHF1_EDCF 0x0100
1331 #define MHF1_IQSWAP_WAR 0x0200
1333 #define MHF1_FORCEFASTCLK 0x0400
1338 #define MHF2_TXBCMC_NOW 0x0040
1340 #define MHF2_HWPWRCTL 0x0080
1341 #define MHF2_NPHY40MHZ_WAR 0x0800
1345 #define MHF3_ANTSEL_EN 0x0001
1347 #define MHF3_ANTSEL_MODE 0x0002
1348 #define MHF3_RESERVED1 0x0004
1349 #define MHF3_RESERVED2 0x0008
1350 #define MHF3_NPHY_MLADV_WAR 0x0010
1354 #define MHF4_BPHY_TXCORE0 0x0080
1356 #define MHF4_EXTPA_ENABLE 0x4000
1359 #define MHF5_4313_GPIOCTRL 0x0001
1360 #define MHF5_RESERVED1 0x0002
1361 #define MHF5_RESERVED2 0x0004
1363 #define M_RADIO_PWR (0x32 * 2)
1366 #define M_PHY_NOISE (0x037 * 2)
1367 #define PHY_NOISE_MASK 0x00ff
1417 #define PRXS0_FT_MASK 0x0003
1419 #define PRXS0_CLIP_MASK 0x000C
1420 #define PRXS0_CLIP_SHIFT 2
1422 #define PRXS0_UNSRATE 0x0010
1424 #define PRXS0_RXANT_UPSUBBAND 0x0020
1426 #define PRXS0_LCRS 0x0040
1428 #define PRXS0_SHORTH 0x0080
1430 #define PRXS0_PLCPFV 0x0100
1432 #define PRXS0_PLCPHCF 0x0200
1434 #define PRXS0_GAIN_CTL 0x4000
1436 #define PRXS0_ANTSEL_MASK 0xF000
1437 #define PRXS0_ANTSEL_SHIFT 0x12
1440 #define PRXS0_CCK 0x0000
1442 #define PRXS0_OFDM 0x0001
1443 #define PRXS0_PREN 0x0002
1444 #define PRXS0_STDN 0x0003
1447 #define PRXS0_ANTSEL_0 0x0
1448 #define PRXS0_ANTSEL_1 0x2
1449 #define PRXS0_ANTSEL_2 0x4
1450 #define PRXS0_ANTSEL_3 0x8
1453 #define PRXS1_JSSI_MASK 0x00FF
1454 #define PRXS1_JSSI_SHIFT 0
1455 #define PRXS1_SQ_MASK 0xFF00
1456 #define PRXS1_SQ_SHIFT 8
1459 #define PRXS1_nphy_PWR0_MASK 0x00FF
1460 #define PRXS1_nphy_PWR1_MASK 0xFF00
1464 #define PRXS0_BAND 0x0400
1465 #define PRXS0_RSVD 0x0800
1466 #define PRXS0_UNUSED 0xF000
1470 #define PRXS1_HTPHY_CORE_MASK 0x000F
1472 #define PRXS1_HTPHY_ANTCFG_MASK 0x00F0
1474 #define PRXS1_HTPHY_MMPLCPLenL_MASK 0xFF00
1478 #define PRXS2_HTPHY_MMPLCPLenH_MASK 0x000F
1480 #define PRXS2_HTPHY_MMPLCH_RATE_MASK 0x00F0
1482 #define PRXS2_HTPHY_RXPWR_ANT0 0xFF00
1486 #define PRXS3_HTPHY_RXPWR_ANT1 0x00FF
1488 #define PRXS3_HTPHY_RXPWR_ANT2 0xFF00
1492 #define PRXS4_HTPHY_RXPWR_ANT3 0x00FF
1494 #define PRXS4_HTPHY_CFO 0xFF00
1498 #define PRXS5_HTPHY_FFO 0x00FF
1500 #define PRXS5_HTPHY_AR 0xFF00
1502 #define HTPHY_MMPLCPLen(rxs) \
1503 ((((rxs)->PhyRxStatus_1 & PRXS1_HTPHY_MMPLCPLenL_MASK) >> 8) | \
1504 (((rxs)->PhyRxStatus_2 & PRXS2_HTPHY_MMPLCPLenH_MASK) << 8))
1506 #define HTPHY_RXPWR_ANT0(rxs) \
1507 ((((rxs)->PhyRxStatus_2) & PRXS2_HTPHY_RXPWR_ANT0) >> 8)
1509 #define HTPHY_RXPWR_ANT1(rxs) \
1510 (((rxs)->PhyRxStatus_3) & PRXS3_HTPHY_RXPWR_ANT1)
1512 #define HTPHY_RXPWR_ANT2(rxs) \
1513 ((((rxs)->PhyRxStatus_3) & PRXS3_HTPHY_RXPWR_ANT2) >> 8)
1516 #define RXS_BCNSENT 0x8000
1517 #define RXS_SECKINDX_MASK 0x07e0
1518 #define RXS_SECKINDX_SHIFT 5
1519 #define RXS_DECERR (1 << 4)
1520 #define RXS_DECATMPT (1 << 3)
1522 #define RXS_PBPRES (1 << 2)
1523 #define RXS_RESPFRAMETX (1 << 1)
1524 #define RXS_FCSERR (1 << 0)
1527 #define RXS_AMSDU_MASK 1
1528 #define RXS_AGGTYPE_MASK 0x6
1529 #define RXS_AGGTYPE_SHIFT 1
1530 #define RXS_PHYRXST_VALID (1 << 8)
1531 #define RXS_RXANT_MASK 0x3
1532 #define RXS_RXANT_SHIFT 12
1535 #define RXS_CHAN_40 0x1000
1536 #define RXS_CHAN_5G 0x0800
1537 #define RXS_CHAN_ID_MASK 0x07f8
1538 #define RXS_CHAN_ID_SHIFT 3
1539 #define RXS_CHAN_PHYTYPE_MASK 0x0007
1540 #define RXS_CHAN_PHYTYPE_SHIFT 0
1543 #define M_PWRIND_BLKS (0x184 * 2)
1544 #define M_PWRIND_MAP0 (M_PWRIND_BLKS + 0x0)
1545 #define M_PWRIND_MAP1 (M_PWRIND_BLKS + 0x2)
1546 #define M_PWRIND_MAP2 (M_PWRIND_BLKS + 0x4)
1547 #define M_PWRIND_MAP3 (M_PWRIND_BLKS + 0x6)
1549 #define M_PWRIND_MAP(core) (M_PWRIND_BLKS + ((core)<<1))
1552 #define M_PSM_SOFT_REGS 0x0
1553 #define M_BOM_REV_MAJOR (M_PSM_SOFT_REGS + 0x0)
1554 #define M_BOM_REV_MINOR (M_PSM_SOFT_REGS + 0x2)
1555 #define M_UCODE_DBGST (M_PSM_SOFT_REGS + 0x40)
1556 #define M_UCODE_MACSTAT (M_PSM_SOFT_REGS + 0xE0)
1558 #define M_AGING_THRSH (0x3e * 2)
1559 #define M_MBURST_SIZE (0x40 * 2)
1560 #define M_MBURST_TXOP (0x41 * 2)
1561 #define M_SYNTHPU_DLY (0x4a * 2)
1562 #define M_PRETBTT (0x4b * 2)
1565 #define M_ALT_TXPWR_IDX (M_PSM_SOFT_REGS + (0x3b * 2))
1566 #define M_PHY_TX_FLT_PTR (M_PSM_SOFT_REGS + (0x3d * 2))
1567 #define M_CTS_DURATION (M_PSM_SOFT_REGS + (0x5c * 2))
1568 #define M_LP_RCCAL_OVR (M_PSM_SOFT_REGS + (0x6b * 2))
1571 #define M_RXSTATS_BLK_PTR (M_PSM_SOFT_REGS + (0x65 * 2))
1575 #define DBGST_INACTIVE 0
1577 #define DBGST_INIT 1
1579 #define DBGST_ACTIVE 2
1581 #define DBGST_SUSPENDED 3
1583 #define DBGST_ASLEEP 4
1666 #define S_BEACON_INDX S_OLD_BREM
1667 #define S_PRS_INDX S_OLD_CWWIN
1668 #define S_PHYTYPE S_SSRC
1669 #define S_PHYVER S_SLRC
1672 #define SLOW_CTRL_PDE (1 << 0)
1673 #define SLOW_CTRL_FD (1 << 8)
1737 #define SICF_PCLKE 0x0004
1738 #define SICF_PRST 0x0008
1739 #define SICF_MPCLKE 0x0010
1740 #define SICF_FREF 0x0020
1744 #define SICF_BWMASK 0x00c0
1745 #define SICF_BW40 0x0080
1746 #define SICF_BW20 0x0040
1747 #define SICF_BW10 0x0000
1748 #define SICF_GMODE 0x2000
1751 #define SISF_2G_PHY 0x0001
1752 #define SISF_5G_PHY 0x0002
1753 #define SISF_FCLKA 0x0004
1754 #define SISF_DB_PHY 0x0008
1759 #define BPHY_REG_OFT_BASE 0x0
1761 #define BPHY_BB_CONFIG 0x01
1762 #define BPHY_ADCBIAS 0x02
1763 #define BPHY_ANACORE 0x03
1764 #define BPHY_PHYCRSTH 0x06
1765 #define BPHY_TEST 0x0a
1766 #define BPHY_PA_TX_TO 0x10
1767 #define BPHY_SYNTH_DC_TO 0x11
1768 #define BPHY_PA_TX_TIME_UP 0x12
1769 #define BPHY_RX_FLTR_TIME_UP 0x13
1770 #define BPHY_TX_POWER_OVERRIDE 0x14
1771 #define BPHY_RF_OVERRIDE 0x15
1772 #define BPHY_RF_TR_LOOKUP1 0x16
1773 #define BPHY_RF_TR_LOOKUP2 0x17
1774 #define BPHY_COEFFS 0x18
1775 #define BPHY_PLL_OUT 0x19
1776 #define BPHY_REFRESH_MAIN 0x1a
1777 #define BPHY_REFRESH_TO0 0x1b
1778 #define BPHY_REFRESH_TO1 0x1c
1779 #define BPHY_RSSI_TRESH 0x20
1780 #define BPHY_IQ_TRESH_HH 0x21
1781 #define BPHY_IQ_TRESH_H 0x22
1782 #define BPHY_IQ_TRESH_L 0x23
1783 #define BPHY_IQ_TRESH_LL 0x24
1784 #define BPHY_GAIN 0x25
1785 #define BPHY_LNA_GAIN_RANGE 0x26
1786 #define BPHY_JSSI 0x27
1787 #define BPHY_TSSI_CTL 0x28
1788 #define BPHY_TSSI 0x29
1789 #define BPHY_TR_LOSS_CTL 0x2a
1790 #define BPHY_LO_LEAKAGE 0x2b
1791 #define BPHY_LO_RSSI_ACC 0x2c
1792 #define BPHY_LO_IQMAG_ACC 0x2d
1793 #define BPHY_TX_DC_OFF1 0x2e
1794 #define BPHY_TX_DC_OFF2 0x2f
1795 #define BPHY_PEAK_CNT_THRESH 0x30
1796 #define BPHY_FREQ_OFFSET 0x31
1797 #define BPHY_DIVERSITY_CTL 0x32
1798 #define BPHY_PEAK_ENERGY_LO 0x33
1799 #define BPHY_PEAK_ENERGY_HI 0x34
1800 #define BPHY_SYNC_CTL 0x35
1801 #define BPHY_TX_PWR_CTRL 0x36
1802 #define BPHY_TX_EST_PWR 0x37
1803 #define BPHY_STEP 0x38
1804 #define BPHY_WARMUP 0x39
1805 #define BPHY_LMS_CFF_READ 0x3a
1806 #define BPHY_LMS_COEFF_I 0x3b
1807 #define BPHY_LMS_COEFF_Q 0x3c
1808 #define BPHY_SIG_POW 0x3d
1809 #define BPHY_RFDC_CANCEL_CTL 0x3e
1810 #define BPHY_HDR_TYPE 0x40
1811 #define BPHY_SFD_TO 0x41
1812 #define BPHY_SFD_CTL 0x42
1813 #define BPHY_DEBUG 0x43
1814 #define BPHY_RX_DELAY_COMP 0x44
1815 #define BPHY_CRS_DROP_TO 0x45
1816 #define BPHY_SHORT_SFD_NZEROS 0x46
1817 #define BPHY_DSSS_COEFF1 0x48
1818 #define BPHY_DSSS_COEFF2 0x49
1819 #define BPHY_CCK_COEFF1 0x4a
1820 #define BPHY_CCK_COEFF2 0x4b
1821 #define BPHY_TR_CORR 0x4c
1822 #define BPHY_ANGLE_SCALE 0x4d
1823 #define BPHY_TX_PWR_BASE_IDX 0x4e
1824 #define BPHY_OPTIONAL_MODES2 0x4f
1825 #define BPHY_CCK_LMS_STEP 0x50
1826 #define BPHY_BYPASS 0x51
1827 #define BPHY_CCK_DELAY_LONG 0x52
1828 #define BPHY_CCK_DELAY_SHORT 0x53
1829 #define BPHY_PPROC_CHAN_DELAY 0x54
1830 #define BPHY_DDFS_ENABLE 0x58
1831 #define BPHY_PHASE_SCALE 0x59
1832 #define BPHY_FREQ_CONTROL 0x5a
1833 #define BPHY_LNA_GAIN_RANGE_10 0x5b
1834 #define BPHY_LNA_GAIN_RANGE_32 0x5c
1835 #define BPHY_OPTIONAL_MODES 0x5d
1836 #define BPHY_RX_STATUS2 0x5e
1837 #define BPHY_RX_STATUS3 0x5f
1838 #define BPHY_DAC_CONTROL 0x60
1839 #define BPHY_ANA11G_FILT_CTRL 0x62
1840 #define BPHY_REFRESH_CTRL 0x64
1841 #define BPHY_RF_OVERRIDE2 0x65
1842 #define BPHY_SPUR_CANCEL_CTRL 0x66
1843 #define BPHY_FINE_DIGIGAIN_CTRL 0x67
1844 #define BPHY_RSSI_LUT 0x88
1845 #define BPHY_RSSI_LUT_END 0xa7
1846 #define BPHY_TSSI_LUT 0xa8
1847 #define BPHY_TSSI_LUT_END 0xc7
1848 #define BPHY_TSSI2PWR_LUT 0x380
1849 #define BPHY_TSSI2PWR_LUT_END 0x39f
1850 #define BPHY_LOCOMP_LUT 0x3a0
1851 #define BPHY_LOCOMP_LUT_END 0x3bf
1852 #define BPHY_TXGAIN_LUT 0x3c0
1853 #define BPHY_TXGAIN_LUT_END 0x3ff
1856 #define PHY_BBC_ANT_MASK 0x0180
1857 #define PHY_BBC_ANT_SHIFT 7
1858 #define BB_DARWIN 0x1000
1859 #define BBCFG_RESETCCA 0x4000
1860 #define BBCFG_RESETRX 0x8000
1863 #define TST_DDFS 0x2000
1864 #define TST_TXFILT1 0x0800
1865 #define TST_UNSCRAM 0x0400
1866 #define TST_CARR_SUPP 0x0200
1867 #define TST_DC_COMP_LOOP 0x0100
1868 #define TST_LOOPBACK 0x0080
1869 #define TST_TXFILT0 0x0040
1870 #define TST_TXTEST_ENABLE 0x0020
1871 #define TST_TXTEST_RATE 0x0018
1872 #define TST_TXTEST_PHASE 0x0007
1875 #define TST_TXTEST_RATE_1MBPS 0
1876 #define TST_TXTEST_RATE_2MBPS 1
1877 #define TST_TXTEST_RATE_5_5MBPS 2
1878 #define TST_TXTEST_RATE_11MBPS 3
1879 #define TST_TXTEST_RATE_SHIFT 3
1881 #define SHM_BYT_CNT 0x2
1882 #define MAX_BYT_CNT 0x600