Go to the documentation of this file.
17 #ifndef _BRCM_PHY_INT_H_
18 #define _BRCM_PHY_INT_H_
24 #define PHY_VERSION { 1, 82, 8, 0 }
26 #define LCNXN_BASEREV 16
43 #define ISNPHY(pi) PHYTYPE_IS((pi)->pubpi.phy_type, PHY_TYPE_N)
44 #define ISLCNPHY(pi) PHYTYPE_IS((pi)->pubpi.phy_type, PHY_TYPE_LCN)
46 #define PHY_GET_RFATTN(rfgain) ((rfgain) & 0x0f)
47 #define PHY_GET_PADMIX(rfgain) (((rfgain) & 0x10) >> 4)
48 #define PHY_GET_RFGAINID(rfattn, padmix, width) ((rfattn) + ((padmix)*(width)))
49 #define PHY_SAT(x, n) ((x) > ((1<<((n)-1))-1) ? ((1<<((n)-1))-1) : \
50 ((x) < -(1<<((n)-1)) ? -(1<<((n)-1)) : (x)))
51 #define PHY_SHIFT_ROUND(x, n) ((x) >= 0 ? ((x)+(1<<((n)-1)))>>(n) : (x)>>(n))
52 #define PHY_HW_ROUND(x, s) ((x >> s) + ((x >> (s-1)) & (s != 0)))
57 #define A_HIGH_CHANS 2
61 #define FIRST_REF5_CHANNUM 149
62 #define LAST_REF5_CHANNUM 165
63 #define FIRST_5G_CHAN 14
64 #define LAST_5G_CHAN 50
65 #define FIRST_MID_5G_CHAN 14
66 #define LAST_MID_5G_CHAN 35
67 #define FIRST_HIGH_5G_CHAN 36
68 #define LAST_HIGH_5G_CHAN 41
69 #define FIRST_LOW_5G_CHAN 42
70 #define LAST_LOW_5G_CHAN 50
72 #define BASE_LOW_5G_CHAN 4900
73 #define BASE_MID_5G_CHAN 5100
74 #define BASE_HIGH_5G_CHAN 5500
76 #define CHAN5G_FREQ(chan) (5000 + chan*5)
77 #define CHAN2G_FREQ(chan) (2407 + chan*5)
79 #define TXP_FIRST_CCK 0
80 #define TXP_LAST_CCK 3
81 #define TXP_FIRST_OFDM 4
82 #define TXP_LAST_OFDM 11
83 #define TXP_FIRST_OFDM_20_CDD 12
84 #define TXP_LAST_OFDM_20_CDD 19
85 #define TXP_FIRST_MCS_20_SISO 20
86 #define TXP_LAST_MCS_20_SISO 27
87 #define TXP_FIRST_MCS_20_CDD 28
88 #define TXP_LAST_MCS_20_CDD 35
89 #define TXP_FIRST_MCS_20_STBC 36
90 #define TXP_LAST_MCS_20_STBC 43
91 #define TXP_FIRST_MCS_20_SDM 44
92 #define TXP_LAST_MCS_20_SDM 51
93 #define TXP_FIRST_OFDM_40_SISO 52
94 #define TXP_LAST_OFDM_40_SISO 59
95 #define TXP_FIRST_OFDM_40_CDD 60
96 #define TXP_LAST_OFDM_40_CDD 67
97 #define TXP_FIRST_MCS_40_SISO 68
98 #define TXP_LAST_MCS_40_SISO 75
99 #define TXP_FIRST_MCS_40_CDD 76
100 #define TXP_LAST_MCS_40_CDD 83
101 #define TXP_FIRST_MCS_40_STBC 84
102 #define TXP_LAST_MCS_40_STBC 91
103 #define TXP_FIRST_MCS_40_SDM 92
104 #define TXP_LAST_MCS_40_SDM 99
105 #define TXP_MCS_32 100
106 #define TXP_NUM_RATES 101
107 #define ADJ_PWR_TBL_LEN 84
109 #define TXP_FIRST_SISO_MCS_20 20
110 #define TXP_LAST_SISO_MCS_20 27
112 #define PHY_CORE_NUM_1 1
113 #define PHY_CORE_NUM_2 2
114 #define PHY_CORE_NUM_3 3
115 #define PHY_CORE_NUM_4 4
116 #define PHY_CORE_MAX PHY_CORE_NUM_4
122 #define MA_WINDOW_SZ 8
124 #define PHY_NOISE_SAMPLE_MON 1
125 #define PHY_NOISE_SAMPLE_EXTERNAL 2
126 #define PHY_NOISE_WINDOW_SZ 16
127 #define PHY_NOISE_GLITCH_INIT_MA 10
128 #define PHY_NOISE_GLITCH_INIT_MA_BADPlCP 10
129 #define PHY_NOISE_STATE_MON 0x1
130 #define PHY_NOISE_STATE_EXTERNAL 0x2
131 #define PHY_NOISE_SAMPLE_LOG_NUM_NPHY 10
132 #define PHY_NOISE_SAMPLE_LOG_NUM_UCODE 9
134 #define PHY_NOISE_OFFSETFACT_4322 (-103)
135 #define PHY_NOISE_MA_WINDOW_SZ 2
137 #define PHY_RSSI_TABLE_SIZE 64
138 #define RSSI_ANT_MERGE_MAX 0
139 #define RSSI_ANT_MERGE_MIN 1
140 #define RSSI_ANT_MERGE_AVG 2
142 #define PHY_TSSI_TABLE_SIZE 64
143 #define APHY_TSSI_TABLE_SIZE 256
144 #define TX_GAIN_TABLE_LENGTH 64
145 #define DEFAULT_11A_TXP_IDX 24
146 #define NUM_TSSI_FRAMES 4
147 #define NULL_TSSI 0x7f
148 #define NULL_TSSI_W 0x7f7f
150 #define PHY_PAPD_EPS_TBL_SIZE_LCNPHY 64
152 #define LCNPHY_PERICAL_TEMPBASED_TXPWRCTRL 9
154 #define PHY_TXPWR_MIN 10
155 #define PHY_TXPWR_MIN_NPHY 8
156 #define RADIOPWR_OVERRIDE_DEF (-1)
158 #define PWRTBL_NUM_COEFF 3
160 #define SPURAVOID_DISABLE 0
161 #define SPURAVOID_AUTO 1
162 #define SPURAVOID_FORCEON 2
163 #define SPURAVOID_FORCEON2 3
165 #define PHY_SW_TIMER_FAST 15
166 #define PHY_SW_TIMER_SLOW 60
167 #define PHY_SW_TIMER_GLACIAL 120
169 #define PHY_PERICAL_AUTO 0
170 #define PHY_PERICAL_FULL 1
171 #define PHY_PERICAL_PARTIAL 2
173 #define PHY_PERICAL_NODELAY 0
174 #define PHY_PERICAL_INIT_DELAY 5
175 #define PHY_PERICAL_ASSOC_DELAY 5
176 #define PHY_PERICAL_WDOG_DELAY 5
178 #define MPHASE_TXCAL_NUMCMDS 2
180 #define PHY_PERICAL_MPHASE_PENDING(pi) \
181 (pi->mphase_cal_phase_id > MPHASE_CAL_STATE_IDLE)
209 #define RDR_TIER_SIZE 64
210 #define RDR_LIST_SIZE (512/3)
211 #define RDR_EPOCH_SIZE 40
212 #define RDR_NANTENNAS 2
213 #define RDR_NTIER_SIZE RDR_LIST_SIZE
214 #define RDR_LP_BUFFER_SIZE 64
215 #define LP_LEN_HIS_SIZE 10
217 #define STATIC_NUM_RF 32
218 #define STATIC_NUM_BB 9
220 #define BB_MULT_MASK 0x0000ffff
221 #define BB_MULT_VALID_MASK 0x80000000
223 #define CORDIC_AG 39797
225 #define FIXED(X) ((s32)((X) << 16))
228 (((X) >= 0) ? ((((X) >> 15) + 1) >> 1) : -((((-(X)) >> 15) + 1) >> 1))
230 #define PHY_CHAIN_TX_DISABLE_TEMP 115
231 #define PHY_HYSTERESIS_DELTATEMP 5
233 #define SCAN_INPROG_PHY(pi) \
234 (mboolisset(pi->measure_hold, PHY_HOLD_FOR_SCAN))
236 #define PLT_INPROG_PHY(pi) (mboolisset(pi->measure_hold, PHY_HOLD_FOR_PLT))
238 #define ASSOC_INPROG_PHY(pi) \
239 (mboolisset(pi->measure_hold, PHY_HOLD_FOR_ASSOC))
241 #define SCAN_RM_IN_PROGRESS(pi) \
242 (mboolisset(pi->measure_hold, PHY_HOLD_FOR_SCAN | PHY_HOLD_FOR_RM))
244 #define PHY_MUTED(pi) \
245 (mboolisset(pi->measure_hold, PHY_HOLD_FOR_MUTE))
247 #define PUB_NOT_ASSOC(pi) \
248 (mboolisset(pi->measure_hold, PHY_HOLD_FOR_NOT_ASSOC))
445 #define PHY_NOISEVAR_BUFSIZE 10
936 u16 tblAddr,
u16 tblDataHi,
940 u16 tblAddr,
u16 tblDataHi,
u16 tblDatalo);
999 u16 max_val,
bool iqcalmode);
1002 u8 *max_pwr,
u8 rate_id);
1005 u8 rate_ofdm_start);
1022 #define LCNPHY_TBL_ID_PAPDCOMPDELTATBL 0x18
1023 #define LCNPHY_TX_POWER_TABLE_SIZE 128
1024 #define LCNPHY_MAX_TX_POWER_INDEX (LCNPHY_TX_POWER_TABLE_SIZE - 1)
1025 #define LCNPHY_TBL_ID_TXPWRCTL 0x07
1026 #define LCNPHY_TX_PWR_CTRL_OFF 0
1027 #define LCNPHY_TX_PWR_CTRL_SW (0x1 << 15)
1028 #define LCNPHY_TX_PWR_CTRL_HW ((0x1 << 15) | \
1032 #define LCNPHY_TX_PWR_CTRL_TEMPBASED 0xE001
1043 u8 *eq0,
u8 *fi0,
u8 *fq0);
1055 #define NPHY_MAX_HPVGA1_INDEX 10
1056 #define NPHY_DEF_HPVGA1_INDEXLIMIT 7
1068 #define wlc_phy_write_table_nphy(pi, pti) \
1069 wlc_phy_write_table(pi, pti, 0x72, 0x74, 0x73)
1071 #define wlc_phy_read_table_nphy(pi, pti) \
1072 wlc_phy_read_table(pi, pti, 0x72, 0x74, 0x73)
1074 #define wlc_nphy_table_addr(pi, id, off) \
1075 wlc_phy_table_addr((pi), (id), (off), 0x72, 0x74, 0x73)
1077 #define wlc_nphy_table_data_write(pi, w, v) \
1078 wlc_phy_table_data_write((pi), (w), (v))
1085 #define PHY_IPA(pi) \
1086 ((pi->ipa2g_on && CHSPEC_IS2G(pi->radio_chanspec)) || \
1087 (pi->ipa5g_on && CHSPEC_IS5G(pi->radio_chanspec)))
1089 #define BRCMS_PHY_WAR_PR51571(pi) \
1090 if (NREV_LT((pi)->pubpi.phy_rev, 3)) \
1091 (void)bcma_read32(pi->d11core, D11REGOFFS(maccontrol))
1133 s8 txpwrindex,
bool res);
1136 s32 *rssi_buf,
u8 nsamps);
1151 #define NPHY_TESTPATTERN_BPHY_EVM 0
1152 #define NPHY_TESTPATTERN_BPHY_RFCS 1