#include <wlc_cfg.h>
#include <qmath.h>
#include <osl.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linuxver.h>
#include <siutils.h>
#include <bitfuncs.h>
#include <hndpmu.h>
wlapi_bmac_read_shm((pi)->sh->physhim, M_UCODE_MACSTAT + OFFSETOF(macstat_t, txallfrm))
typedef struct {
- uint16 gm_gain;
- uint16 pga_gain;
- uint16 pad_gain;
- uint16 dac_gain;
+ u16 gm_gain;
+ u16 pga_gain;
+ u16 pad_gain;
+ u16 dac_gain;
} lcnphy_txgains_t;
typedef enum {
typedef struct {
lcnphy_txgains_t gains;
bool useindex;
- uint8 index;
+ u8 index;
} lcnphy_txcalgains_t;
typedef struct {
- uint8 chan;
+ u8 chan;
int16 a;
int16 b;
} lcnphy_rx_iqcomp_t;
} lcnphy_spb_tone_t;
typedef struct {
- uint16 re;
- uint16 im;
+ u16 re;
+ u16 im;
} lcnphy_unsign16_struct;
typedef struct {
} lcnphy_iq_est_t;
typedef struct {
- uint16 ptcentreTs20;
- uint16 ptcentreFactor;
+ u16 ptcentreTs20;
+ u16 ptcentreFactor;
} lcnphy_sfo_cfg_t;
typedef enum {
LCNPHY_PAPD_CAL_OFDM
} lcnphy_papd_cal_type_t;
-typedef uint16 iqcal_gain_params_lcnphy[9];
+typedef u16 iqcal_gain_params_lcnphy[9];
static const iqcal_gain_params_lcnphy tbl_iqcal_gainparams_lcnphy_2G[] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0},
tbl_iqcal_gainparams_lcnphy_2G,
};
-static const uint16 iqcal_gainparams_numgains_lcnphy[1] = {
+static const u16 iqcal_gainparams_numgains_lcnphy[1] = {
sizeof(tbl_iqcal_gainparams_lcnphy_2G) /
sizeof(*tbl_iqcal_gainparams_lcnphy_2G),
};
};
static const
-uint16 lcnphy_iqcal_loft_gainladder[] = {
+u16 lcnphy_iqcal_loft_gainladder[] = {
((2 << 8) | 0),
((3 << 8) | 0),
((4 << 8) | 0),
};
static const
-uint16 lcnphy_iqcal_ir_gainladder[] = {
+u16 lcnphy_iqcal_ir_gainladder[] = {
((1 << 8) | 0),
((2 << 8) | 0),
((4 << 8) | 0),
};
static const
-uint16 iqlo_loopback_rf_regs[20] = {
+u16 iqlo_loopback_rf_regs[20] = {
RADIO_2064_REG036,
RADIO_2064_REG11A,
RADIO_2064_REG03A,
};
static const
-uint16 tempsense_phy_regs[14] = {
+u16 tempsense_phy_regs[14] = {
0x503,
0x4a4,
0x4d0,
};
static const
-uint16 rxiq_cal_rf_reg[11] = {
+u16 rxiq_cal_rf_reg[11] = {
RADIO_2064_REG098,
RADIO_2064_REG116,
RADIO_2064_REG12C,
0x04464f,
};
-static const int8 lcnphy_gain_table[] = {
+static const s8 lcnphy_gain_table[] = {
-16,
-13,
10,
92,
};
-static const int8 lcnphy_gain_index_offset_for_rssi[] = {
+static const s8 lcnphy_gain_index_offset_for_rssi[] = {
7,
7,
7,
-2
};
-extern CONST uint8 spur_tbl_rev0[];
-extern CONST uint32 dot11lcnphytbl_rx_gain_info_sz_rev1;
-extern CONST dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_rev1[];
-extern CONST dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_bt_epa;
-extern CONST dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250;
+extern const u8 spur_tbl_rev0[];
+extern const uint32 dot11lcnphytbl_rx_gain_info_sz_rev1;
+extern const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_rev1[];
+extern const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_bt_epa;
+extern const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250;
typedef struct _chan_info_2064_lcnphy {
uint chan;
uint freq;
- uint8 logen_buftune;
- uint8 logen_rccr_tx;
- uint8 txrf_mix_tune_ctrl;
- uint8 pa_input_tune_g;
- uint8 logen_rccr_rx;
- uint8 pa_rxrf_lna1_freq_tune;
- uint8 pa_rxrf_lna2_freq_tune;
- uint8 rxrf_rxrf_spare1;
+ u8 logen_buftune;
+ u8 logen_rccr_tx;
+ u8 txrf_mix_tune_ctrl;
+ u8 pa_input_tune_g;
+ u8 logen_rccr_rx;
+ u8 pa_rxrf_lna1_freq_tune;
+ u8 pa_rxrf_lna2_freq_tune;
+ u8 rxrf_rxrf_spare1;
} chan_info_2064_lcnphy_t;
static chan_info_2064_lcnphy_t chan_info_2064_lcnphy[] = {
#define LCNPHY_NUM_DIG_FILT_COEFFS 16
#define LCNPHY_NUM_TX_DIG_FILTERS_CCK 13
-uint16
+u16
LCNPHY_txdigfiltcoeffs_cck[LCNPHY_NUM_TX_DIG_FILTERS_CCK]
[LCNPHY_NUM_DIG_FILT_COEFFS + 1] = {
{0, 1, 415, 1874, 64, 128, 64, 792, 1656, 64, 128, 64, 778, 1582, 64,
};
#define LCNPHY_NUM_TX_DIG_FILTERS_OFDM 3
-uint16
+u16
LCNPHY_txdigfiltcoeffs_ofdm[LCNPHY_NUM_TX_DIG_FILTERS_OFDM]
[LCNPHY_NUM_DIG_FILT_COEFFS + 1] = {
{0, 0, 0xa2, 0x0, 0x100, 0x100, 0x0, 0x0, 0x0, 0x100, 0x0, 0x0,
#define wlc_lcnphy_set_start_tx_pwr_idx(pi, idx) \
mod_phy_reg(pi, 0x4a4, \
(0x1ff << 0), \
- (uint16)(idx) << 0)
+ (u16)(idx) << 0)
#define wlc_lcnphy_set_tx_pwr_npt(pi, npt) \
mod_phy_reg(pi, 0x4a5, \
(0x7 << 8), \
- (uint16)(npt) << 8)
+ (u16)(npt) << 8)
#define wlc_lcnphy_get_tx_pwr_ctrl(pi) \
(read_phy_reg((pi), 0x4a4) & \
#define wlc_lcnphy_set_target_tx_pwr(pi, target) \
mod_phy_reg(pi, 0x4a7, \
(0xff << 0), \
- (uint16)(target) << 0)
+ (u16)(target) << 0)
#define wlc_radio_2064_rcal_done(pi) (0 != (read_radio_reg(pi, RADIO_2064_REG05C) & 0x20))
#define tempsense_done(pi) (0x8000 == (read_phy_reg(pi, 0x476) & 0x8000))
-#define LCNPHY_IQLOCC_READ(val) ((uint8)(-(int8)(((val) & 0xf0) >> 4) + (int8)((val) & 0x0f)))
+#define LCNPHY_IQLOCC_READ(val) ((u8)(-(s8)(((val) & 0xf0) >> 4) + (s8)((val) & 0x0f)))
#define FIXED_TXPWR 78
#define LCNPHY_TEMPSENSE(val) ((int16)((val > 255) ? (val - 512) : val))
static uint32 wlc_lcnphy_qdiv_roundup(uint32 divident, uint32 divisor,
- uint8 precision);
+ u8 precision);
static void wlc_lcnphy_set_rx_gain_by_distribution(phy_info_t *pi,
- uint16 ext_lna, uint16 trsw,
- uint16 biq2, uint16 biq1,
- uint16 tia, uint16 lna2,
- uint16 lna1);
+ u16 ext_lna, u16 trsw,
+ u16 biq2, u16 biq1,
+ u16 tia, u16 lna2,
+ u16 lna1);
static void wlc_lcnphy_clear_tx_power_offsets(phy_info_t *pi);
-static void wlc_lcnphy_set_pa_gain(phy_info_t *pi, uint16 gain);
+static void wlc_lcnphy_set_pa_gain(phy_info_t *pi, u16 gain);
static void wlc_lcnphy_set_trsw_override(phy_info_t *pi, bool tx, bool rx);
-static void wlc_lcnphy_set_bbmult(phy_info_t *pi, uint8 m0);
-static uint8 wlc_lcnphy_get_bbmult(phy_info_t *pi);
+static void wlc_lcnphy_set_bbmult(phy_info_t *pi, u8 m0);
+static u8 wlc_lcnphy_get_bbmult(phy_info_t *pi);
static void wlc_lcnphy_get_tx_gain(phy_info_t *pi, lcnphy_txgains_t *gains);
static void wlc_lcnphy_set_tx_gain_override(phy_info_t *pi, bool bEnable);
static void wlc_lcnphy_toggle_afe_pwdn(phy_info_t *pi);
static void wlc_lcnphy_rx_gain_override_enable(phy_info_t *pi, bool enable);
static void wlc_lcnphy_set_tx_gain(phy_info_t *pi,
lcnphy_txgains_t *target_gains);
-static bool wlc_lcnphy_rx_iq_est(phy_info_t *pi, uint16 num_samps,
- uint8 wait_time, lcnphy_iq_est_t *iq_est);
-static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, uint16 num_samps);
-static uint16 wlc_lcnphy_get_pa_gain(phy_info_t *pi);
-static void wlc_lcnphy_afe_clk_init(phy_info_t *pi, uint8 mode);
+static bool wlc_lcnphy_rx_iq_est(phy_info_t *pi, u16 num_samps,
+ u8 wait_time, lcnphy_iq_est_t *iq_est);
+static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, u16 num_samps);
+static u16 wlc_lcnphy_get_pa_gain(phy_info_t *pi);
+static void wlc_lcnphy_afe_clk_init(phy_info_t *pi, u8 mode);
extern void wlc_lcnphy_tx_pwr_ctrl_init(wlc_phy_t *ppi);
extern void wlc_lcnphy_pktengtx(wlc_phy_t *ppi, wl_pkteng_t *pkteng,
- uint8 rate, struct ether_addr *sa,
+ u8 rate, struct ether_addr *sa,
uint32 wait_delay);
static void wlc_lcnphy_radio_2064_channel_tune_4313(phy_info_t *pi,
- uint8 channel);
+ u8 channel);
static void wlc_lcnphy_load_tx_gain_table(phy_info_t *pi,
const lcnphy_tx_gain_tbl_entry *g);
static void wlc_lcnphy_samp_cap(phy_info_t *pi, int clip_detect_algo,
- uint16 thresh, int16 *ptr, int mode);
+ u16 thresh, int16 *ptr, int mode);
static int wlc_lcnphy_calc_floor(int16 coeff, int type);
static void wlc_lcnphy_tx_iqlo_loopback(phy_info_t *pi,
- uint16 *values_to_save);
+ u16 *values_to_save);
static void wlc_lcnphy_tx_iqlo_loopback_cleanup(phy_info_t *pi,
- uint16 *values_to_save);
+ u16 *values_to_save);
static void wlc_lcnphy_set_cc(phy_info_t *pi, int cal_type, int16 coeff_x,
int16 coeff_y);
static lcnphy_unsign16_struct wlc_lcnphy_get_cc(phy_info_t *pi, int cal_type);
static void wlc_lcnphy_txrx_spur_avoidance_mode(phy_info_t *pi, bool enable);
static int wlc_lcnphy_load_tx_iir_filter(phy_info_t *pi, bool is_ofdm,
int16 filt_type);
-static void wlc_lcnphy_set_rx_iq_comp(phy_info_t *pi, uint16 a, uint16 b);
+static void wlc_lcnphy_set_rx_iq_comp(phy_info_t *pi, u16 a, u16 b);
void wlc_lcnphy_write_table(phy_info_t *pi, const phytbl_info_t *pti)
{
static void
wlc_lcnphy_common_read_table(phy_info_t *pi, uint32 tbl_id,
- CONST void *tbl_ptr, uint32 tbl_len,
+ const void *tbl_ptr, uint32 tbl_len,
uint32 tbl_width, uint32 tbl_offset)
{
phytbl_info_t tab;
static void
wlc_lcnphy_common_write_table(phy_info_t *pi, uint32 tbl_id,
- CONST void *tbl_ptr, uint32 tbl_len,
+ const void *tbl_ptr, uint32 tbl_len,
uint32 tbl_width, uint32 tbl_offset)
{
}
static uint32
-wlc_lcnphy_qdiv_roundup(uint32 dividend, uint32 divisor, uint8 precision)
+wlc_lcnphy_qdiv_roundup(uint32 dividend, uint32 divisor, u8 precision)
{
uint32 quotient, remainder, roundup, rbit;
return k;
}
-int8 wlc_lcnphy_get_current_tx_pwr_idx(phy_info_t *pi)
+s8 wlc_lcnphy_get_current_tx_pwr_idx(phy_info_t *pi)
{
- int8 index;
+ s8 index;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
if (txpwrctrl_off(pi))
index = pi_lcn->lcnphy_current_index;
else if (wlc_lcnphy_tssi_based_pwr_ctrl_enabled(pi))
index =
- (int8) (wlc_lcnphy_get_current_tx_pwr_idx_if_pwrctrl_on(pi)
+ (s8) (wlc_lcnphy_get_current_tx_pwr_idx_if_pwrctrl_on(pi)
/ 2);
else
index = pi_lcn->lcnphy_current_index;
return index;
}
-static uint32 wlc_lcnphy_measure_digital_power(phy_info_t *pi, uint16 nsamples)
+static uint32 wlc_lcnphy_measure_digital_power(phy_info_t *pi, u16 nsamples)
{
lcnphy_iq_est_t iq_est = { 0, 0, 0 };
void wlc_lcnphy_crsuprs(phy_info_t *pi, int channel)
{
- uint16 afectrlovr, afectrlovrval;
+ u16 afectrlovr, afectrlovrval;
afectrlovr = read_phy_reg(pi, 0x43b);
afectrlovrval = read_phy_reg(pi, 0x43c);
if (channel != 0) {
static void wlc_lcnphy_toggle_afe_pwdn(phy_info_t *pi)
{
- uint16 save_AfeCtrlOvrVal, save_AfeCtrlOvr;
+ u16 save_AfeCtrlOvrVal, save_AfeCtrlOvr;
save_AfeCtrlOvrVal = read_phy_reg(pi, 0x43c);
save_AfeCtrlOvr = read_phy_reg(pi, 0x43b);
void wlc_phy_chanspec_set_lcnphy(phy_info_t *pi, chanspec_t chanspec)
{
- uint8 channel = CHSPEC_CHANNEL(chanspec);
+ u8 channel = CHSPEC_CHANNEL(chanspec);
wlc_phy_chanspec_radio_set((wlc_phy_t *) pi, chanspec);
}
-static void wlc_lcnphy_set_dac_gain(phy_info_t *pi, uint16 dac_gain)
+static void wlc_lcnphy_set_dac_gain(phy_info_t *pi, u16 dac_gain)
{
- uint16 dac_ctrl;
+ u16 dac_ctrl;
dac_ctrl = (read_phy_reg(pi, 0x439) >> 0);
dac_ctrl = dac_ctrl & 0xc7f;
static void wlc_lcnphy_set_tx_gain_override(phy_info_t *pi, bool bEnable)
{
- uint16 bit = bEnable ? 1 : 0;
+ u16 bit = bEnable ? 1 : 0;
mod_phy_reg(pi, 0x4b0, (0x1 << 7), bit << 7);
mod_phy_reg(pi, 0x43b, (0x1 << 6), bit << 6);
}
-static uint16 wlc_lcnphy_get_pa_gain(phy_info_t *pi)
+static u16 wlc_lcnphy_get_pa_gain(phy_info_t *pi)
{
- uint16 pa_gain;
+ u16 pa_gain;
pa_gain = (read_phy_reg(pi, 0x4fb) &
LCNPHY_txgainctrlovrval1_pagain_ovr_val1_MASK) >>
static void
wlc_lcnphy_set_tx_gain(phy_info_t *pi, lcnphy_txgains_t *target_gains)
{
- uint16 pa_gain = wlc_lcnphy_get_pa_gain(pi);
+ u16 pa_gain = wlc_lcnphy_get_pa_gain(pi);
mod_phy_reg(pi, 0x4b5,
(0xffff << 0),
wlc_lcnphy_enable_tx_gain_override(pi);
}
-static void wlc_lcnphy_set_bbmult(phy_info_t *pi, uint8 m0)
+static void wlc_lcnphy_set_bbmult(phy_info_t *pi, u8 m0)
{
- uint16 m0m1 = (uint16) m0 << 8;
+ u16 m0m1 = (u16) m0 << 8;
phytbl_info_t tab;
tab.tbl_ptr = &m0m1;
}
}
-static uint16 wlc_lcnphy_rfseq_tbl_adc_pwrup(phy_info_t *pi)
+static u16 wlc_lcnphy_rfseq_tbl_adc_pwrup(phy_info_t *pi)
{
- uint16 N1, N2, N3, N4, N5, N6, N;
+ u16 N1, N2, N3, N4, N5, N6, N;
N1 = ((read_phy_reg(pi, 0x4a5) & (0xff << 0))
>> 0);
N2 = 1 << ((read_phy_reg(pi, 0x4a5) & (0x7 << 12))
static void wlc_lcnphy_pwrctrl_rssiparams(phy_info_t *pi)
{
- uint16 auxpga_vmid, auxpga_vmid_temp, auxpga_gain_temp;
+ u16 auxpga_vmid, auxpga_vmid_temp, auxpga_gain_temp;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
auxpga_vmid =
void wlc_lcnphy_tx_pwr_update_npt(phy_info_t *pi)
{
- uint16 tx_cnt, tx_total, npt;
+ u16 tx_cnt, tx_total, npt;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
tx_total = wlc_lcnphy_total_tx_frames(pi);
}
}
-static void wlc_lcnphy_set_tx_pwr_soft_ctrl(phy_info_t *pi, int8 index)
+static void wlc_lcnphy_set_tx_pwr_soft_ctrl(phy_info_t *pi, s8 index)
{
uint32 cck_offset[4] = { 22, 22, 22, 22 };
uint32 ofdm_offset, reg_offset_cck;
int i;
- uint16 index2;
+ u16 index2;
phytbl_info_t tab;
if (wlc_lcnphy_tssi_based_pwr_ctrl_enabled(pi))
mod_phy_reg(pi, 0x4a9, (0x1 << 15), (1) << 15);
- index2 = (uint16) (index * 2);
+ index2 = (u16) (index * 2);
mod_phy_reg(pi, 0x4a9, (0x1ff << 0), (index2) << 0);
mod_phy_reg(pi, 0x6a3, (0x1 << 4), (0) << 4);
}
-static int8 wlc_lcnphy_tempcompensated_txpwrctrl(phy_info_t *pi)
+static s8 wlc_lcnphy_tempcompensated_txpwrctrl(phy_info_t *pi)
{
- int8 index, delta_brd, delta_temp, new_index, tempcorrx;
+ s8 index, delta_brd, delta_temp, new_index, tempcorrx;
int16 manp, meas_temp, temp_diff;
bool neg = 0;
- uint16 temp;
+ u16 temp;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
if (wlc_lcnphy_tssi_based_pwr_ctrl_enabled(pi))
if (pi_lcn->lcnphy_tempsense_slope == 0) {
return index;
}
- temp = (uint16) wlc_lcnphy_tempsense(pi, 0);
+ temp = (u16) wlc_lcnphy_tempsense(pi, 0);
meas_temp = LCNPHY_TEMPSENSE(temp);
if (pi->tx_power_min != 0) {
temp_diff = -temp_diff;
}
- delta_temp = (int8) wlc_lcnphy_qdiv_roundup((uint32) (temp_diff * 192),
+ delta_temp = (s8) wlc_lcnphy_qdiv_roundup((uint32) (temp_diff * 192),
(uint32) (pi_lcn->
lcnphy_tempsense_slope
* 10), 0);
&& LCNREV_IS(pi->pubpi.phy_rev, 0))
delta_temp = 0;
if (pi_lcn->lcnphy_tempcorrx > 31)
- tempcorrx = (int8) (pi_lcn->lcnphy_tempcorrx - 64);
+ tempcorrx = (s8) (pi_lcn->lcnphy_tempcorrx - 64);
else
- tempcorrx = (int8) pi_lcn->lcnphy_tempcorrx;
+ tempcorrx = (s8) pi_lcn->lcnphy_tempcorrx;
if (LCNREV_IS(pi->pubpi.phy_rev, 1))
tempcorrx = 4;
new_index =
return new_index;
}
-static uint16 wlc_lcnphy_set_tx_pwr_ctrl_mode(phy_info_t *pi, uint16 mode)
+static u16 wlc_lcnphy_set_tx_pwr_ctrl_mode(phy_info_t *pi, u16 mode)
{
- uint16 current_mode = mode;
+ u16 current_mode = mode;
if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi) &&
mode == LCNPHY_TX_PWR_CTRL_HW)
current_mode = LCNPHY_TX_PWR_CTRL_TEMPBASED;
return current_mode;
}
-void wlc_lcnphy_set_tx_pwr_ctrl(phy_info_t *pi, uint16 mode)
+void wlc_lcnphy_set_tx_pwr_ctrl(phy_info_t *pi, u16 mode)
{
- uint16 old_mode = wlc_lcnphy_get_tx_pwr_ctrl(pi);
- int8 index;
+ u16 old_mode = wlc_lcnphy_get_tx_pwr_ctrl(pi);
+ s8 index;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
ASSERT((LCNPHY_TX_PWR_CTRL_OFF == mode) ||
if (mode == LCNPHY_TX_PWR_CTRL_TEMPBASED) {
index = wlc_lcnphy_tempcompensated_txpwrctrl(pi);
wlc_lcnphy_set_tx_pwr_soft_ctrl(pi, index);
- pi_lcn->lcnphy_current_index = (int8)
+ pi_lcn->lcnphy_current_index = (s8)
((read_phy_reg(pi, 0x4a9) & 0xFF) / 2);
}
}
{
lcnphy_txgains_t cal_gains, temp_gains;
- uint16 hash;
- uint8 band_idx;
+ u16 hash;
+ u8 band_idx;
int j;
- uint16 ncorr_override[5];
- uint16 syst_coeffs[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ u16 ncorr_override[5];
+ u16 syst_coeffs[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};
- uint16 commands_fullcal[] = {
+ u16 commands_fullcal[] = {
0x8434, 0x8334, 0x8084, 0x8267, 0x8056, 0x8234 };
- uint16 commands_recal[] = {
+ u16 commands_recal[] = {
0x8434, 0x8334, 0x8084, 0x8267, 0x8056, 0x8234 };
- uint16 command_nums_fullcal[] = {
+ u16 command_nums_fullcal[] = {
0x7a97, 0x7a97, 0x7a97, 0x7a87, 0x7a87, 0x7b97 };
- uint16 command_nums_recal[] = {
+ u16 command_nums_recal[] = {
0x7a97, 0x7a97, 0x7a97, 0x7a87, 0x7a87, 0x7b97 };
- uint16 *command_nums = command_nums_fullcal;
+ u16 *command_nums = command_nums_fullcal;
- uint16 *start_coeffs = NULL, *cal_cmds = NULL, cal_type, diq_start;
- uint16 tx_pwr_ctrl_old, save_txpwrctrlrfctrl2;
- uint16 save_sslpnCalibClkEnCtrl, save_sslpnRxFeClkEnCtrl;
+ u16 *start_coeffs = NULL, *cal_cmds = NULL, cal_type, diq_start;
+ u16 tx_pwr_ctrl_old, save_txpwrctrlrfctrl2;
+ u16 save_sslpnCalibClkEnCtrl, save_sslpnRxFeClkEnCtrl;
bool tx_gain_override_old;
lcnphy_txgains_t old_gains;
uint i, n_cal_cmds = 0, n_cal_start = 0;
- uint16 *values_to_save;
+ u16 *values_to_save;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
if (NORADIO_ENAB(pi->pubpi))
return;
- values_to_save = MALLOC(pi->sh->osh, sizeof(uint16) * 20);
+ values_to_save = MALLOC(pi->sh->osh, sizeof(u16) * 20);
if (NULL == values_to_save) {
return;
}
write_phy_reg(pi, 0x93d, 0xc0);
wlc_lcnphy_common_write_table(pi, LCNPHY_TBL_ID_IQLOCAL,
- (CONST void *)
+ (const void *)
lcnphy_iqcal_loft_gainladder,
ARRAYSIZE(lcnphy_iqcal_loft_gainladder),
16, 0);
wlc_lcnphy_common_write_table(pi, LCNPHY_TBL_ID_IQLOCAL,
- (CONST void *)lcnphy_iqcal_ir_gainladder,
+ (const void *)lcnphy_iqcal_ir_gainladder,
ARRAYSIZE(lcnphy_iqcal_ir_gainladder), 16,
32);
write_phy_reg(pi, 0x6da, 0xffff);
for (i = n_cal_start; i < n_cal_cmds; i++) {
- uint16 zero_diq = 0;
- uint16 best_coeffs[11];
- uint16 command_num;
+ u16 zero_diq = 0;
+ u16 best_coeffs[11];
+ u16 command_num;
cal_type = (cal_cmds[i] & 0x0f00) >> 8;
cleanup:
wlc_lcnphy_tx_iqlo_loopback_cleanup(pi, values_to_save);
- MFREE(pi->sh->osh, values_to_save, 20 * sizeof(uint16));
+ MFREE(pi->sh->osh, values_to_save, 20 * sizeof(u16));
if (!keep_tone)
wlc_lcnphy_stop_tx_tone(pi);
bool suspend, tx_gain_override_old;
lcnphy_txgains_t old_gains;
phy_info_t *pi = (phy_info_t *) ppi;
- uint16 idleTssi, idleTssi0_2C, idleTssi0_OB, idleTssi0_regvalue_OB,
+ u16 idleTssi, idleTssi0_2C, idleTssi0_OB, idleTssi0_regvalue_OB,
idleTssi0_regvalue_2C;
- uint16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
- uint16 SAVE_lpfgain = read_radio_reg(pi, RADIO_2064_REG112);
- uint16 SAVE_jtag_bb_afe_switch =
+ u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
+ u16 SAVE_lpfgain = read_radio_reg(pi, RADIO_2064_REG112);
+ u16 SAVE_jtag_bb_afe_switch =
read_radio_reg(pi, RADIO_2064_REG007) & 1;
- uint16 SAVE_jtag_auxpga = read_radio_reg(pi, RADIO_2064_REG0FF) & 0x10;
- uint16 SAVE_iqadc_aux_en = read_radio_reg(pi, RADIO_2064_REG11F) & 4;
+ u16 SAVE_jtag_auxpga = read_radio_reg(pi, RADIO_2064_REG0FF) & 0x10;
+ u16 SAVE_iqadc_aux_en = read_radio_reg(pi, RADIO_2064_REG11F) & 4;
idleTssi = read_phy_reg(pi, 0x4ab);
suspend =
(0 ==
wlapi_enable_mac(pi->sh->physhim);
}
-static void wlc_lcnphy_vbat_temp_sense_setup(phy_info_t *pi, uint8 mode)
+static void wlc_lcnphy_vbat_temp_sense_setup(phy_info_t *pi, u8 mode)
{
bool suspend;
- uint16 save_txpwrCtrlEn;
- uint8 auxpga_vmidcourse, auxpga_vmidfine, auxpga_gain;
- uint16 auxpga_vmid;
+ u16 save_txpwrCtrlEn;
+ u8 auxpga_vmidcourse, auxpga_vmidfine, auxpga_gain;
+ u16 auxpga_vmid;
phytbl_info_t tab;
uint32 val;
- uint8 save_reg007, save_reg0FF, save_reg11F, save_reg005, save_reg025,
+ u8 save_reg007, save_reg0FF, save_reg11F, save_reg005, save_reg025,
save_reg112;
- uint16 values_to_save[14];
- int8 index;
+ u16 values_to_save[14];
+ s8 index;
int i;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
OSL_DELAY(999);
- save_reg007 = (uint8) read_radio_reg(pi, RADIO_2064_REG007);
- save_reg0FF = (uint8) read_radio_reg(pi, RADIO_2064_REG0FF);
- save_reg11F = (uint8) read_radio_reg(pi, RADIO_2064_REG11F);
- save_reg005 = (uint8) read_radio_reg(pi, RADIO_2064_REG005);
- save_reg025 = (uint8) read_radio_reg(pi, RADIO_2064_REG025);
- save_reg112 = (uint8) read_radio_reg(pi, RADIO_2064_REG112);
+ save_reg007 = (u8) read_radio_reg(pi, RADIO_2064_REG007);
+ save_reg0FF = (u8) read_radio_reg(pi, RADIO_2064_REG0FF);
+ save_reg11F = (u8) read_radio_reg(pi, RADIO_2064_REG11F);
+ save_reg005 = (u8) read_radio_reg(pi, RADIO_2064_REG005);
+ save_reg025 = (u8) read_radio_reg(pi, RADIO_2064_REG025);
+ save_reg112 = (u8) read_radio_reg(pi, RADIO_2064_REG112);
for (i = 0; i < 14; i++)
values_to_save[i] = read_phy_reg(pi, tempsense_phy_regs[i]);
auxpga_gain = 2;
}
auxpga_vmid =
- (uint16) ((2 << 8) | (auxpga_vmidcourse << 4) | auxpga_vmidfine);
+ (u16) ((2 << 8) | (auxpga_vmidcourse << 4) | auxpga_vmidfine);
mod_phy_reg(pi, 0x4d8, (0x1 << 0), (1) << 0);
mod_phy_reg(pi, 0x4d8, (0x3ff << 2), (auxpga_vmid) << 2);
if (!tempsense_done(pi))
OSL_DELAY(10);
- write_radio_reg(pi, RADIO_2064_REG007, (uint16) save_reg007);
- write_radio_reg(pi, RADIO_2064_REG0FF, (uint16) save_reg0FF);
- write_radio_reg(pi, RADIO_2064_REG11F, (uint16) save_reg11F);
- write_radio_reg(pi, RADIO_2064_REG005, (uint16) save_reg005);
- write_radio_reg(pi, RADIO_2064_REG025, (uint16) save_reg025);
- write_radio_reg(pi, RADIO_2064_REG112, (uint16) save_reg112);
+ write_radio_reg(pi, RADIO_2064_REG007, (u16) save_reg007);
+ write_radio_reg(pi, RADIO_2064_REG0FF, (u16) save_reg0FF);
+ write_radio_reg(pi, RADIO_2064_REG11F, (u16) save_reg11F);
+ write_radio_reg(pi, RADIO_2064_REG005, (u16) save_reg005);
+ write_radio_reg(pi, RADIO_2064_REG025, (u16) save_reg025);
+ write_radio_reg(pi, RADIO_2064_REG112, (u16) save_reg112);
for (i = 0; i < 14; i++)
write_phy_reg(pi, tempsense_phy_regs[i], values_to_save[i]);
wlc_lcnphy_set_tx_pwr_by_index(pi, (int)index);
void WLBANDINITFN(wlc_lcnphy_tx_pwr_ctrl_init) (wlc_phy_t *ppi)
{
lcnphy_txgains_t tx_gains;
- uint8 bbmult;
+ u8 bbmult;
phytbl_info_t tab;
int32 a1, b0, b1;
int32 tssi, pwr, maxtargetpwr, mintargetpwr;
wlapi_enable_mac(pi->sh->physhim);
}
-static uint8 wlc_lcnphy_get_bbmult(phy_info_t *pi)
+static u8 wlc_lcnphy_get_bbmult(phy_info_t *pi)
{
- uint16 m0m1;
+ u16 m0m1;
phytbl_info_t tab;
tab.tbl_ptr = &m0m1;
tab.tbl_width = 16;
wlc_lcnphy_read_table(pi, &tab);
- return (uint8) ((m0m1 & 0xff00) >> 8);
+ return (u8) ((m0m1 & 0xff00) >> 8);
}
-static void wlc_lcnphy_set_pa_gain(phy_info_t *pi, uint16 gain)
+static void wlc_lcnphy_set_pa_gain(phy_info_t *pi, u16 gain)
{
mod_phy_reg(pi, 0x4fb,
LCNPHY_txgainctrlovrval1_pagain_ovr_val1_MASK,
void
wlc_lcnphy_get_radio_loft(phy_info_t *pi,
- uint8 *ei0, uint8 *eq0, uint8 *fi0, uint8 *fq0)
+ u8 *ei0, u8 *eq0, u8 *fi0, u8 *fq0)
{
*ei0 = LCNPHY_IQLOCC_READ(read_radio_reg(pi, RADIO_2064_REG089));
*eq0 = LCNPHY_IQLOCC_READ(read_radio_reg(pi, RADIO_2064_REG08A));
static void wlc_lcnphy_get_tx_gain(phy_info_t *pi, lcnphy_txgains_t *gains)
{
- uint16 dac_gain;
+ u16 dac_gain;
dac_gain = read_phy_reg(pi, 0x439) >> 0;
gains->dac_gain = (dac_gain & 0x380) >> 7;
{
- uint16 rfgain0, rfgain1;
+ u16 rfgain0, rfgain1;
rfgain0 = (read_phy_reg(pi, 0x4b5) & (0xffff << 0)) >> 0;
rfgain1 = (read_phy_reg(pi, 0x4fb) & (0x7fff << 0)) >> 0;
}
}
-void wlc_lcnphy_set_tx_iqcc(phy_info_t *pi, uint16 a, uint16 b)
+void wlc_lcnphy_set_tx_iqcc(phy_info_t *pi, u16 a, u16 b)
{
phytbl_info_t tab;
- uint16 iqcc[2];
+ u16 iqcc[2];
iqcc[0] = a;
iqcc[1] = b;
wlc_lcnphy_write_table(pi, &tab);
}
-void wlc_lcnphy_set_tx_locc(phy_info_t *pi, uint16 didq)
+void wlc_lcnphy_set_tx_locc(phy_info_t *pi, u16 didq)
{
phytbl_info_t tab;
void wlc_lcnphy_set_tx_pwr_by_index(phy_info_t *pi, int index)
{
phytbl_info_t tab;
- uint16 a, b;
- uint8 bb_mult;
+ u16 a, b;
+ u8 bb_mult;
uint32 bbmultiqcomp, txgain, locoeffs, rfpower;
lcnphy_txgains_t gains;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
ASSERT(index <= LCNPHY_MAX_TX_POWER_INDEX);
- pi_lcn->lcnphy_tx_power_idx_override = (int8) index;
- pi_lcn->lcnphy_current_index = (uint8) index;
+ pi_lcn->lcnphy_tx_power_idx_override = (s8) index;
+ pi_lcn->lcnphy_current_index = (u8) index;
tab.tbl_id = LCNPHY_TBL_ID_TXPWRCTL;
tab.tbl_width = 32;
tab.tbl_ptr = &txgain;
wlc_lcnphy_read_table(pi, &tab);
- gains.gm_gain = (uint16) (txgain & 0xff);
- gains.pga_gain = (uint16) (txgain >> 8) & 0xff;
- gains.pad_gain = (uint16) (txgain >> 16) & 0xff;
- gains.dac_gain = (uint16) (bbmultiqcomp >> 28) & 0x07;
+ gains.gm_gain = (u16) (txgain & 0xff);
+ gains.pga_gain = (u16) (txgain >> 8) & 0xff;
+ gains.pad_gain = (u16) (txgain >> 16) & 0xff;
+ gains.dac_gain = (u16) (bbmultiqcomp >> 28) & 0x07;
wlc_lcnphy_set_tx_gain(pi, &gains);
- wlc_lcnphy_set_pa_gain(pi, (uint16) (txgain >> 24) & 0x7f);
+ wlc_lcnphy_set_pa_gain(pi, (u16) (txgain >> 24) & 0x7f);
- bb_mult = (uint8) ((bbmultiqcomp >> 20) & 0xff);
+ bb_mult = (u8) ((bbmultiqcomp >> 20) & 0xff);
wlc_lcnphy_set_bbmult(pi, bb_mult);
wlc_lcnphy_enable_tx_gain_override(pi);
if (!wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi)) {
- a = (uint16) ((bbmultiqcomp >> 10) & 0x3ff);
- b = (uint16) (bbmultiqcomp & 0x3ff);
+ a = (u16) ((bbmultiqcomp >> 10) & 0x3ff);
+ b = (u16) (bbmultiqcomp & 0x3ff);
wlc_lcnphy_set_tx_iqcc(pi, a, b);
tab.tbl_offset = LCNPHY_TX_PWR_CTRL_LO_OFFSET + index;
tab.tbl_ptr = &locoeffs;
wlc_lcnphy_read_table(pi, &tab);
- wlc_lcnphy_set_tx_locc(pi, (uint16) locoeffs);
+ wlc_lcnphy_set_tx_locc(pi, (u16) locoeffs);
tab.tbl_offset = LCNPHY_TX_PWR_CTRL_PWR_OFFSET + index;
tab.tbl_ptr = &rfpower;
static void
wlc_lcnphy_set_rx_gain_by_distribution(phy_info_t *pi,
- uint16 trsw,
- uint16 ext_lna,
- uint16 biq2,
- uint16 biq1,
- uint16 tia, uint16 lna2, uint16 lna1)
+ u16 trsw,
+ u16 ext_lna,
+ u16 biq2,
+ u16 biq1,
+ u16 tia, u16 lna2, u16 lna1)
{
- uint16 gain0_15, gain16_19;
+ u16 gain0_15, gain16_19;
gain16_19 = biq2 & 0xf;
gain0_15 = ((biq1 & 0xf) << 12) |
static void wlc_lcnphy_rx_gain_override_enable(phy_info_t *pi, bool enable)
{
- uint16 ebit = enable ? 1 : 0;
+ u16 ebit = enable ? 1 : 0;
mod_phy_reg(pi, 0x4b0, (0x1 << 8), ebit << 8);
{
if (!bEnable) {
- and_phy_reg(pi, 0x43b, ~(uint16) ((0x1 << 1) | (0x1 << 4)));
+ and_phy_reg(pi, 0x43b, ~(u16) ((0x1 << 1) | (0x1 << 4)));
mod_phy_reg(pi, 0x43c, (0x1 << 1), 1 << 1);
and_phy_reg(pi, 0x44c,
- ~(uint16) ((0x1 << 3) |
+ ~(u16) ((0x1 << 3) |
(0x1 << 5) |
(0x1 << 12) |
(0x1 << 0) | (0x1 << 1) | (0x1 << 2)));
and_phy_reg(pi, 0x44d,
- ~(uint16) ((0x1 << 3) | (0x1 << 5) | (0x1 << 14)));
+ ~(u16) ((0x1 << 3) | (0x1 << 5) | (0x1 << 14)));
mod_phy_reg(pi, 0x44d, (0x1 << 2), 1 << 2);
mod_phy_reg(pi, 0x44d, (0x1 << 1) | (0x1 << 0), (0x1 << 0));
and_phy_reg(pi, 0x4f9,
- ~(uint16) ((0x1 << 0) | (0x1 << 1) | (0x1 << 2)));
+ ~(u16) ((0x1 << 0) | (0x1 << 1) | (0x1 << 2)));
and_phy_reg(pi, 0x4fa,
- ~(uint16) ((0x1 << 0) | (0x1 << 1) | (0x1 << 2)));
+ ~(u16) ((0x1 << 0) | (0x1 << 1) | (0x1 << 2)));
} else {
mod_phy_reg(pi, 0x43b, (0x1 << 1), 1 << 1);
static void
wlc_lcnphy_run_samples(phy_info_t *pi,
- uint16 num_samps,
- uint16 num_loops, uint16 wait, bool iqcalmode)
+ u16 num_samps,
+ u16 num_loops, u16 wait, bool iqcalmode)
{
or_phy_reg(pi, 0x6da, 0x8080);
if (iqcalmode) {
- and_phy_reg(pi, 0x453, (uint16) ~(0x1 << 15));
+ and_phy_reg(pi, 0x453, (u16) ~(0x1 << 15));
or_phy_reg(pi, 0x453, (0x1 << 15));
} else {
write_phy_reg(pi, 0x63f, 1);
void wlc_lcnphy_deaf_mode(phy_info_t *pi, bool mode)
{
- uint8 phybw40;
+ u8 phybw40;
phybw40 = CHSPEC_IS40(pi->radio_chanspec);
if (LCNREV_LT(pi->pubpi.phy_rev, 2)) {
}
void
-wlc_lcnphy_start_tx_tone(phy_info_t *pi, int32 f_kHz, uint16 max_val,
+wlc_lcnphy_start_tx_tone(phy_info_t *pi, int32 f_kHz, u16 max_val,
bool iqcalmode)
{
- uint8 phy_bw;
- uint16 num_samps, t, k;
+ u8 phy_bw;
+ u16 num_samps, t, k;
uint32 bw;
fixed theta = 0, rot = 0;
cint32 tone_samp;
uint32 data_buf[64];
- uint16 i_samp, q_samp;
+ u16 i_samp, q_samp;
phytbl_info_t tab;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
theta += rot;
- i_samp = (uint16) (FLOAT(tone_samp.i * max_val) & 0x3ff);
- q_samp = (uint16) (FLOAT(tone_samp.q * max_val) & 0x3ff);
+ i_samp = (u16) (FLOAT(tone_samp.i * max_val) & 0x3ff);
+ q_samp = (u16) (FLOAT(tone_samp.q * max_val) & 0x3ff);
data_buf[t] = (i_samp << 10) | q_samp;
}
static void wlc_lcnphy_clear_trsw_override(phy_info_t *pi)
{
- and_phy_reg(pi, 0x44c, (uint16) ~((0x1 << 1) | (0x1 << 0)));
+ and_phy_reg(pi, 0x44c, (u16) ~((0x1 << 1) | (0x1 << 0)));
}
-void wlc_lcnphy_get_tx_iqcc(phy_info_t *pi, uint16 *a, uint16 *b)
+void wlc_lcnphy_get_tx_iqcc(phy_info_t *pi, u16 *a, u16 *b)
{
- uint16 iqcc[2];
+ u16 iqcc[2];
phytbl_info_t tab;
tab.tbl_ptr = iqcc;
*b = iqcc[1];
}
-uint16 wlc_lcnphy_get_tx_locc(phy_info_t *pi)
+u16 wlc_lcnphy_get_tx_locc(phy_info_t *pi)
{
phytbl_info_t tab;
- uint16 didq;
+ u16 didq;
tab.tbl_id = 0;
tab.tbl_width = 16;
{
lcnphy_txgains_t target_gains, old_gains;
- uint8 save_bb_mult;
- uint16 a, b, didq, save_pa_gain = 0;
+ u8 save_bb_mult;
+ u16 a, b, didq, save_pa_gain = 0;
uint idx, SAVE_txpwrindex = 0xFF;
uint32 val;
- uint16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
+ u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
phytbl_info_t tab;
- uint8 ei0, eq0, fi0, fq0;
+ u8 ei0, eq0, fi0, fq0;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
wlc_lcnphy_get_tx_gain(pi, &old_gains);
}
wlc_lcnphy_get_radio_loft(pi, &ei0, &eq0, &fi0, &fq0);
- if ((ABS((int8) fi0) == 15) && (ABS((int8) fq0) == 15)) {
+ if ((ABS((s8) fi0) == 15) && (ABS((s8) fq0) == 15)) {
if (CHSPEC_IS5G(pi->radio_chanspec)) {
target_gains.gm_gain = 255;
target_gains.pga_gain = 255;
int16 wlc_lcnphy_tempsense_new(phy_info_t *pi, bool mode)
{
- uint16 tempsenseval1, tempsenseval2;
+ u16 tempsenseval1, tempsenseval2;
int16 avg = 0;
bool suspend = 0;
return avg;
}
-uint16 wlc_lcnphy_tempsense(phy_info_t *pi, bool mode)
+u16 wlc_lcnphy_tempsense(phy_info_t *pi, bool mode)
{
- uint16 tempsenseval1, tempsenseval2;
+ u16 tempsenseval1, tempsenseval2;
int32 avg = 0;
bool suspend = 0;
- uint16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
+ u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
if (NORADIO_ENAB(pi->pubpi))
if (!suspend)
wlapi_enable_mac(pi->sh->physhim);
}
- return (uint16) avg;
+ return (u16) avg;
}
-int8 wlc_lcnphy_tempsense_degree(phy_info_t *pi, bool mode)
+s8 wlc_lcnphy_tempsense_degree(phy_info_t *pi, bool mode)
{
int32 degree = wlc_lcnphy_tempsense_new(pi, mode);
degree =
((degree << 10) + LCN_TEMPSENSE_OFFSET + (LCN_TEMPSENSE_DEN >> 1))
/ LCN_TEMPSENSE_DEN;
- return (int8) degree;
+ return (s8) degree;
}
-int8 wlc_lcnphy_vbatsense(phy_info_t *pi, bool mode)
+s8 wlc_lcnphy_vbatsense(phy_info_t *pi, bool mode)
{
- uint16 vbatsenseval;
+ u16 vbatsenseval;
int32 avg = 0;
bool suspend = 0;
if (!suspend)
wlapi_enable_mac(pi->sh->physhim);
}
- return (int8) avg;
+ return (s8) avg;
}
-static void wlc_lcnphy_afe_clk_init(phy_info_t *pi, uint8 mode)
+static void wlc_lcnphy_afe_clk_init(phy_info_t *pi, u8 mode)
{
- uint8 phybw40;
+ u8 phybw40;
phybw40 = CHSPEC_IS40(pi->radio_chanspec);
mod_phy_reg(pi, 0x6d1, (0x1 << 7), (1) << 7);
static bool
wlc_lcnphy_rx_iq_est(phy_info_t *pi,
- uint16 num_samps,
- uint8 wait_time, lcnphy_iq_est_t *iq_est)
+ u16 num_samps,
+ u8 wait_time, lcnphy_iq_est_t *iq_est)
{
int wait_count = 0;
bool result = TRUE;
- uint8 phybw40;
+ u8 phybw40;
phybw40 = CHSPEC_IS40(pi->radio_chanspec);
mod_phy_reg(pi, 0x6da, (0x1 << 5), (1) << 5);
mod_phy_reg(pi, 0x482, (0xffff << 0), (num_samps) << 0);
- mod_phy_reg(pi, 0x481, (0xff << 0), ((uint16) wait_time) << 0);
+ mod_phy_reg(pi, 0x481, (0xff << 0), ((u16) wait_time) << 0);
mod_phy_reg(pi, 0x481, (0x1 << 8), (0) << 8);
return result;
}
-static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, uint16 num_samps)
+static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, u16 num_samps)
{
#define LCNPHY_MIN_RXIQ_PWR 2
bool result;
- uint16 a0_new, b0_new;
+ u16 a0_new, b0_new;
lcnphy_iq_est_t iq_est = { 0, 0, 0 };
int32 a, b, temp;
int16 iq_nbits, qq_nbits, arsh, brsh;
b -= a * a;
b = (int32) wlc_phy_sqrt_int((uint32) b);
b -= (1 << 10);
- a0_new = (uint16) (a & 0x3ff);
- b0_new = (uint16) (b & 0x3ff);
+ a0_new = (u16) (a & 0x3ff);
+ b0_new = (u16) (b & 0x3ff);
cleanup:
wlc_lcnphy_set_rx_iq_comp(pi, a0_new, b0_new);
int tx_gain_idx)
{
lcnphy_txgains_t old_gains;
- uint16 tx_pwr_ctrl;
- uint8 tx_gain_index_old = 0;
+ u16 tx_pwr_ctrl;
+ u8 tx_gain_index_old = 0;
bool result = FALSE, tx_gain_override_old = FALSE;
- uint16 i, Core1TxControl_old, RFOverride0_old,
+ u16 i, Core1TxControl_old, RFOverride0_old,
RFOverrideVal0_old, rfoverride2_old, rfoverride2val_old,
rfoverride3_old, rfoverride3val_old, rfoverride4_old,
rfoverride4val_old, afectrlovr_old, afectrlovrval_old;
int tia_gain;
uint32 received_power, rx_pwr_threshold;
- uint16 old_sslpnCalibClkEnCtrl, old_sslpnRxFeClkEnCtrl;
- uint16 values_to_save[11];
+ u16 old_sslpnCalibClkEnCtrl, old_sslpnRxFeClkEnCtrl;
+ u16 values_to_save[11];
int16 *ptr;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
CHSPEC_CHANNEL(pi->radio_chanspec)) {
wlc_lcnphy_set_rx_iq_comp(pi,
- (uint16)
+ (u16)
iqcomp[iqcomp_sz].a,
- (uint16)
+ (u16)
iqcomp[iqcomp_sz].b);
result = TRUE;
break;
tia_gain -= 1;
wlc_lcnphy_set_rx_gain_by_distribution(pi,
0, 0, 2, 2,
- (uint16)
+ (u16)
tia_gain, 1, 0);
OSL_DELAY(500);
static void wlc_lcnphy_glacial_timer_based_cal(phy_info_t *pi)
{
bool suspend;
- int8 index;
- uint16 SAVE_pwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
+ s8 index;
+ u16 SAVE_pwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
suspend =
(0 == (R_REG(pi->sh->osh, &pi->regs->maccontrol) & MCTL_EN_MAC));
bool suspend, full_cal;
const lcnphy_rx_iqcomp_t *rx_iqcomp;
int rx_iqcomp_sz;
- uint16 SAVE_pwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
- int8 index;
+ u16 SAVE_pwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
+ s8 index;
phytbl_info_t tab;
int32 a1, b0, b1;
int32 tssi, pwr, maxtargetpwr, mintargetpwr;
void wlc_lcnphy_calib_modes(phy_info_t *pi, uint mode)
{
- uint16 temp_new;
+ u16 temp_new;
int temp1, temp2, temp_diff;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
}
}
-void wlc_lcnphy_get_tssi(phy_info_t *pi, int8 *ofdm_pwr, int8 *cck_pwr)
+void wlc_lcnphy_get_tssi(phy_info_t *pi, s8 *ofdm_pwr, s8 *cck_pwr)
{
- int8 cck_offset;
- uint16 status;
+ s8 cck_offset;
+ u16 status;
status = (read_phy_reg(pi, 0x4ab));
if (wlc_lcnphy_tssi_based_pwr_ctrl_enabled(pi) &&
(status & (0x1 << 15))) {
- *ofdm_pwr = (int8) (((read_phy_reg(pi, 0x4ab) & (0x1ff << 0))
+ *ofdm_pwr = (s8) (((read_phy_reg(pi, 0x4ab) & (0x1ff << 0))
>> 0) >> 1);
if (wlc_phy_tpc_isenabled_lcnphy(pi))
static void wlc_lcnphy_set_chanspec_tweaks(phy_info_t *pi, chanspec_t chanspec)
{
- uint8 channel = CHSPEC_CHANNEL(chanspec);
+ u8 channel = CHSPEC_CHANNEL(chanspec);
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
if (NORADIO_ENAB(pi->pubpi))
}
void
-wlc_lcnphy_pktengtx(wlc_phy_t *ppi, wl_pkteng_t *pkteng, uint8 rate,
+wlc_lcnphy_pktengtx(wlc_phy_t *ppi, wl_pkteng_t *pkteng, u8 rate,
struct ether_addr *sa, uint32 wait_delay)
{
}
void wlc_lcnphy_tx_power_adjustment(wlc_phy_t *ppi)
{
- int8 index;
- uint16 index2;
+ s8 index;
+ u16 index2;
phy_info_t *pi = (phy_info_t *) ppi;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
- uint16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
+ u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi) && SAVE_txpwrctrl) {
index = wlc_lcnphy_tempcompensated_txpwrctrl(pi);
- index2 = (uint16) (index * 2);
+ index2 = (u16) (index * 2);
mod_phy_reg(pi, 0x4a9, (0x1ff << 0), (index2) << 0);
- pi_lcn->lcnphy_current_index = (int8)
+ pi_lcn->lcnphy_current_index = (s8)
((read_phy_reg(pi, 0x4a9) & 0xFF) / 2);
}
}
-static void wlc_lcnphy_set_rx_iq_comp(phy_info_t *pi, uint16 a, uint16 b)
+static void wlc_lcnphy_set_rx_iq_comp(phy_info_t *pi, u16 a, u16 b)
{
mod_phy_reg(pi, 0x645, (0x3ff << 0), (a) << 0);
void WLBANDINITFN(wlc_phy_init_lcnphy) (phy_info_t *pi)
{
- uint8 phybw40;
+ u8 phybw40;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
phybw40 = CHSPEC_IS40(pi->radio_chanspec);
}
static void
-wlc_lcnphy_tx_iqlo_loopback(phy_info_t *pi, uint16 *values_to_save)
+wlc_lcnphy_tx_iqlo_loopback(phy_info_t *pi, u16 *values_to_save)
{
- uint16 vmid;
+ u16 vmid;
int i;
for (i = 0; i < 20; i++) {
values_to_save[i] =
}
static void
-wlc_lcnphy_samp_cap(phy_info_t *pi, int clip_detect_algo, uint16 thresh,
+wlc_lcnphy_samp_cap(phy_info_t *pi, int clip_detect_algo, u16 thresh,
int16 *ptr, int mode)
{
uint32 curval1, curval2, stpptr, curptr, strptr, val;
- uint16 sslpnCalibClkEnCtrl, timer;
- uint16 old_sslpnCalibClkEnCtrl;
+ u16 sslpnCalibClkEnCtrl, timer;
+ u16 old_sslpnCalibClkEnCtrl;
int16 imag, real;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
write_phy_reg(pi, 0x555, 0x0);
write_phy_reg(pi, 0x5a6, 0x5);
- write_phy_reg(pi, 0x5a2, (uint16) (mode | mode << 6));
+ write_phy_reg(pi, 0x5a2, (u16) (mode | mode << 6));
write_phy_reg(pi, 0x5cf, 3);
write_phy_reg(pi, 0x5a5, 0x3);
write_phy_reg(pi, 0x583, 0x0);
static void
wlc_lcnphy_set_cc(phy_info_t *pi, int cal_type, int16 coeff_x, int16 coeff_y)
{
- uint16 di0dq0;
- uint16 x, y, data_rf;
+ u16 di0dq0;
+ u16 x, y, data_rf;
int k;
switch (cal_type) {
case 0:
static lcnphy_unsign16_struct wlc_lcnphy_get_cc(phy_info_t *pi, int cal_type)
{
- uint16 a, b, didq;
- uint8 di0, dq0, ei, eq, fi, fq;
+ u16 a, b, didq;
+ u8 di0, dq0, ei, eq, fi, fq;
lcnphy_unsign16_struct cc;
cc.re = 0;
cc.im = 0;
didq = wlc_lcnphy_get_tx_locc(pi);
di0 = (((didq & 0xff00) << 16) >> 24);
dq0 = (((didq & 0x00ff) << 24) >> 24);
- cc.re = (uint16) di0;
- cc.im = (uint16) dq0;
+ cc.re = (u16) di0;
+ cc.im = (u16) dq0;
break;
case 3:
wlc_lcnphy_get_radio_loft(pi, &ei, &eq, &fi, &fq);
- cc.re = (uint16) ei;
- cc.im = (uint16) eq;
+ cc.re = (u16) ei;
+ cc.im = (u16) eq;
break;
case 4:
wlc_lcnphy_get_radio_loft(pi, &ei, &eq, &fi, &fq);
- cc.re = (uint16) fi;
- cc.im = (uint16) fq;
+ cc.re = (u16) fi;
+ cc.im = (u16) fq;
break;
}
return cc;
lcnphy_spb_tone_t phy_c2;
lcnphy_unsign16_struct phy_c3;
int phy_c4, phy_c5, k, l, j, phy_c6;
- uint16 phy_c7, phy_c8, phy_c9;
+ u16 phy_c7, phy_c8, phy_c9;
int16 phy_c10, phy_c11, phy_c12, phy_c13, phy_c14, phy_c15, phy_c16;
int16 *ptr, phy_c17;
int32 phy_c18, phy_c19;
uint32 phy_c20, phy_c21;
bool phy_c22, phy_c23, phy_c24, phy_c25;
- uint16 phy_c26, phy_c27;
- uint16 phy_c28, phy_c29, phy_c30;
- uint16 phy_c31;
- uint16 *phy_c32;
+ u16 phy_c26, phy_c27;
+ u16 phy_c28, phy_c29, phy_c30;
+ u16 phy_c31;
+ u16 *phy_c32;
phy_c21 = 0;
phy_c10 = phy_c13 = phy_c14 = phy_c8 = 0;
ptr = MALLOC(pi->sh->osh, sizeof(int16) * 131);
return;
}
- phy_c32 = MALLOC(pi->sh->osh, sizeof(uint16) * 20);
+ phy_c32 = MALLOC(pi->sh->osh, sizeof(u16) * 20);
if (NULL == phy_c32) {
return;
}
write_phy_reg(pi, 0x4d8, phy_c30);
write_radio_reg(pi, RADIO_2064_REG026, phy_c31);
- MFREE(pi->sh->osh, phy_c32, 20 * sizeof(uint16));
+ MFREE(pi->sh->osh, phy_c32, 20 * sizeof(u16));
MFREE(pi->sh->osh, ptr, 131 * sizeof(int16));
}
static void
-wlc_lcnphy_tx_iqlo_loopback_cleanup(phy_info_t *pi, uint16 *values_to_save)
+wlc_lcnphy_tx_iqlo_loopback_cleanup(phy_info_t *pi, u16 *values_to_save)
{
int i;
uint32 j;
phytbl_info_t tab;
uint32 val;
- uint16 pa_gain;
- uint16 gm_gain;
+ u16 pa_gain;
+ u16 gm_gain;
if (CHSPEC_IS5G(pi->radio_chanspec))
pa_gain = 0x70;
{
phytbl_info_t tab;
uint32 val, bbmult, rfgain;
- uint8 index;
- uint8 scale_factor = 1;
+ u8 index;
+ u8 scale_factor = 1;
int16 temp, temp1, temp2, qQ, qQ1, qQ2, shift;
tab.tbl_id = LCNPHY_TBL_ID_TXPWRCTL;
static void WLBANDINITFN(wlc_lcnphy_tbl_init) (phy_info_t *pi)
{
uint idx;
- uint8 phybw40;
+ u8 phybw40;
phytbl_info_t tab;
uint32 val;
static void WLBANDINITFN(wlc_lcnphy_rev0_baseband_init) (phy_info_t *pi)
{
- uint16 afectrl1;
+ u16 afectrl1;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
write_radio_reg(pi, RADIO_2064_REG11C, 0x0);
if (0) {
afectrl1 = 0;
- afectrl1 = (uint16) ((pi_lcn->lcnphy_rssi_vf) |
+ afectrl1 = (u16) ((pi_lcn->lcnphy_rssi_vf) |
(pi_lcn->lcnphy_rssi_vc << 4) | (pi_lcn->
lcnphy_rssi_gs
<< 10));
& (0xff << 0));
if (temp > 127)
temp -= 256;
- pi_lcn->lcnphy_input_pwr_offset_db = (int8) temp;
+ pi_lcn->lcnphy_input_pwr_offset_db = (s8) temp;
pi_lcn->lcnphy_Med_Low_Gain_db = (read_phy_reg(pi, 0x424)
& (0xff << 8))
write_radio_reg(pi,
((lcnphyregs[i].address & 0x3fff) |
RADIO_DEFAULT_CORE),
- (uint16) lcnphyregs[i].init_a);
+ (u16) lcnphyregs[i].init_a);
else if (lcnphyregs[i].do_init_g)
write_radio_reg(pi,
((lcnphyregs[i].address & 0x3fff) |
RADIO_DEFAULT_CORE),
- (uint16) lcnphyregs[i].init_g);
+ (u16) lcnphyregs[i].init_g);
write_radio_reg(pi, RADIO_2064_REG032, 0x62);
write_radio_reg(pi, RADIO_2064_REG033, 0x19);
static void wlc_lcnphy_rcal(phy_info_t *pi)
{
- uint8 rcal_value;
+ u8 rcal_value;
if (NORADIO_ENAB(pi->pubpi))
return;
SPINWAIT(!wlc_radio_2064_rcal_done(pi), 10 * 1000 * 1000);
if (wlc_radio_2064_rcal_done(pi)) {
- rcal_value = (uint8) read_radio_reg(pi, RADIO_2064_REG05C);
+ rcal_value = (u8) read_radio_reg(pi, RADIO_2064_REG05C);
rcal_value = rcal_value & 0x1f;
}
static void wlc_lcnphy_rc_cal(phy_info_t *pi)
{
- uint8 dflt_rc_cal_val;
- uint16 flt_val;
+ u8 dflt_rc_cal_val;
+ u16 flt_val;
if (NORADIO_ENAB(pi->pubpi))
return;
static bool BCMATTACHFN(wlc_phy_txpwr_srom_read_lcnphy) (phy_info_t *pi)
{
- int8 txpwr = 0;
+ s8 txpwr = 0;
int i;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
if (CHSPEC_IS2G(pi->radio_chanspec)) {
- uint16 cckpo = 0;
+ u16 cckpo = 0;
uint32 offset_ofdm, offset_mcs;
pi_lcn->lcnphy_tr_isolation_mid =
- (uint8) PHY_GETINTVAR(pi, "triso2g");
+ (u8) PHY_GETINTVAR(pi, "triso2g");
pi_lcn->lcnphy_rx_power_offset =
- (uint8) PHY_GETINTVAR(pi, "rxpo2g");
+ (u8) PHY_GETINTVAR(pi, "rxpo2g");
pi->txpa_2g[0] = (int16) PHY_GETINTVAR(pi, "pa0b0");
pi->txpa_2g[1] = (int16) PHY_GETINTVAR(pi, "pa0b1");
pi->txpa_2g[2] = (int16) PHY_GETINTVAR(pi, "pa0b2");
- pi_lcn->lcnphy_rssi_vf = (uint8) PHY_GETINTVAR(pi, "rssismf2g");
- pi_lcn->lcnphy_rssi_vc = (uint8) PHY_GETINTVAR(pi, "rssismc2g");
- pi_lcn->lcnphy_rssi_gs = (uint8) PHY_GETINTVAR(pi, "rssisav2g");
+ pi_lcn->lcnphy_rssi_vf = (u8) PHY_GETINTVAR(pi, "rssismf2g");
+ pi_lcn->lcnphy_rssi_vc = (u8) PHY_GETINTVAR(pi, "rssismc2g");
+ pi_lcn->lcnphy_rssi_gs = (u8) PHY_GETINTVAR(pi, "rssisav2g");
{
pi_lcn->lcnphy_rssi_vf_lowtemp = pi_lcn->lcnphy_rssi_vf;
pi_lcn->lcnphy_rssi_gs;
}
- txpwr = (int8) PHY_GETINTVAR(pi, "maxp2ga0");
+ txpwr = (s8) PHY_GETINTVAR(pi, "maxp2ga0");
pi->tx_srom_max_2g = txpwr;
for (i = 0; i < PWRTBL_NUM_COEFF; i++) {
pi->txpa_2g_high_temp[i] = pi->txpa_2g[i];
}
- cckpo = (uint16) PHY_GETINTVAR(pi, "cck2gpo");
+ cckpo = (u16) PHY_GETINTVAR(pi, "cck2gpo");
if (cckpo) {
uint max_pwr_chan = txpwr;
offset_ofdm >>= 4;
}
} else {
- uint8 opo = 0;
+ u8 opo = 0;
- opo = (uint8) PHY_GETINTVAR(pi, "opo");
+ opo = (u8) PHY_GETINTVAR(pi, "opo");
for (i = TXP_FIRST_CCK; i <= TXP_LAST_CCK; i++) {
pi->tx_srom_max_rate_2g[i] = txpwr;
offset_ofdm >>= 4;
}
offset_mcs =
- ((uint16) PHY_GETINTVAR(pi, "mcs2gpo1") << 16) |
- (uint16) PHY_GETINTVAR(pi, "mcs2gpo0");
+ ((u16) PHY_GETINTVAR(pi, "mcs2gpo1") << 16) |
+ (u16) PHY_GETINTVAR(pi, "mcs2gpo0");
pi_lcn->lcnphy_mcs20_po = offset_mcs;
for (i = TXP_FIRST_SISO_MCS_20;
i <= TXP_LAST_SISO_MCS_20; i++) {
}
pi_lcn->lcnphy_rawtempsense =
- (uint16) PHY_GETINTVAR(pi, "rawtempsense");
+ (u16) PHY_GETINTVAR(pi, "rawtempsense");
pi_lcn->lcnphy_measPower =
- (uint8) PHY_GETINTVAR(pi, "measpower");
+ (u8) PHY_GETINTVAR(pi, "measpower");
pi_lcn->lcnphy_tempsense_slope =
- (uint8) PHY_GETINTVAR(pi, "tempsense_slope");
+ (u8) PHY_GETINTVAR(pi, "tempsense_slope");
pi_lcn->lcnphy_hw_iqcal_en =
(bool) PHY_GETINTVAR(pi, "hw_iqcal_en");
pi_lcn->lcnphy_iqcal_swp_dis =
(bool) PHY_GETINTVAR(pi, "iqcal_swp_dis");
pi_lcn->lcnphy_tempcorrx =
- (uint8) PHY_GETINTVAR(pi, "tempcorrx");
+ (u8) PHY_GETINTVAR(pi, "tempcorrx");
pi_lcn->lcnphy_tempsense_option =
- (uint8) PHY_GETINTVAR(pi, "tempsense_option");
+ (u8) PHY_GETINTVAR(pi, "tempsense_option");
pi_lcn->lcnphy_freqoffset_corr =
- (uint8) PHY_GETINTVAR(pi, "freqoffset_corr");
- if ((uint8) getintvar(pi->vars, "aa2g") > 1)
+ (u8) PHY_GETINTVAR(pi, "freqoffset_corr");
+ if ((u8) getintvar(pi->vars, "aa2g") > 1)
wlc_phy_ant_rxdiv_set((wlc_phy_t *) pi,
- (uint8) getintvar(pi->vars,
+ (u8) getintvar(pi->vars,
"aa2g"));
}
pi_lcn->lcnphy_cck_dig_filt_type = -1;
void wlc_2064_vco_cal(phy_info_t *pi)
{
- uint8 calnrst;
+ u8 calnrst;
mod_radio_reg(pi, RADIO_2064_REG057, 1 << 3, 1 << 3);
- calnrst = (uint8) read_radio_reg(pi, RADIO_2064_REG056) & 0xf8;
+ calnrst = (u8) read_radio_reg(pi, RADIO_2064_REG056) & 0xf8;
write_radio_reg(pi, RADIO_2064_REG056, calnrst);
OSL_DELAY(1);
write_radio_reg(pi, RADIO_2064_REG056, calnrst | 0x03);
}
static void
-wlc_lcnphy_radio_2064_channel_tune_4313(phy_info_t *pi, uint8 channel)
+wlc_lcnphy_radio_2064_channel_tune_4313(phy_info_t *pi, u8 channel)
{
uint i;
const chan_info_2064_lcnphy_t *ci;
- uint8 rfpll_doubler = 0;
- uint8 pll_pwrup, pll_pwrup_ovr;
+ u8 rfpll_doubler = 0;
+ u8 pll_pwrup, pll_pwrup_ovr;
fixed qFxtal, qFref, qFvco, qFcal;
- uint8 d15, d16, f16, e44, e45;
+ u8 d15, d16, f16, e44, e45;
uint32 div_int, div_frac, fvco3, fpfd, fref3, fcal_div;
- uint16 loop_bw, d30, setCount;
+ u16 loop_bw, d30, setCount;
if (NORADIO_ENAB(pi->pubpi))
return;
ci = &chan_info_2064_lcnphy[0];
write_radio_reg(pi, RADIO_2064_REG06C, ci->rxrf_rxrf_spare1);
- pll_pwrup = (uint8) read_radio_reg(pi, RADIO_2064_REG044);
- pll_pwrup_ovr = (uint8) read_radio_reg(pi, RADIO_2064_REG12B);
+ pll_pwrup = (u8) read_radio_reg(pi, RADIO_2064_REG044);
+ pll_pwrup_ovr = (u8) read_radio_reg(pi, RADIO_2064_REG12B);
or_radio_reg(pi, RADIO_2064_REG044, 0x07);
f16 = ((d16 + 1) * (d15 + 1)) / qFcal;
setCount = f16 * 3 * (ci->freq) / 32 - 1;
mod_radio_reg(pi, RADIO_2064_REG053, (0x0f << 0),
- (uint8) (setCount >> 8));
+ (u8) (setCount >> 8));
or_radio_reg(pi, RADIO_2064_REG053, 0x10);
- write_radio_reg(pi, RADIO_2064_REG054, (uint8) (setCount & 0xff));
+ write_radio_reg(pi, RADIO_2064_REG054, (u8) (setCount & 0xff));
div_int = ((fvco3 * (PLL_2064_MHZ >> 4)) / fref3) << 4;
div_frac = wlc_lcnphy_qdiv_roundup(div_frac, fref3, 20);
mod_radio_reg(pi, RADIO_2064_REG045, (0x1f << 0),
- (uint8) (div_int >> 4));
+ (u8) (div_int >> 4));
mod_radio_reg(pi, RADIO_2064_REG046, (0x1f << 4),
- (uint8) (div_int << 4));
+ (u8) (div_int << 4));
mod_radio_reg(pi, RADIO_2064_REG046, (0x0f << 0),
- (uint8) (div_frac >> 16));
- write_radio_reg(pi, RADIO_2064_REG047, (uint8) (div_frac >> 8) & 0xff);
- write_radio_reg(pi, RADIO_2064_REG048, (uint8) div_frac & 0xff);
+ (u8) (div_frac >> 16));
+ write_radio_reg(pi, RADIO_2064_REG047, (u8) (div_frac >> 8) & 0xff);
+ write_radio_reg(pi, RADIO_2064_REG048, (u8) div_frac & 0xff);
write_radio_reg(pi, RADIO_2064_REG040, 0xfb);
write_radio_reg(pi, RADIO_2064_REG043, 0x0C);
{
- uint8 h29, h23, c28, d29, h28_ten, e30, h30_ten, cp_current;
- uint16 c29, c38, c30, g30, d28;
+ u8 h29, h23, c28, d29, h28_ten, e30, h30_ten, cp_current;
+ u16 c29, c38, c30, g30, d28;
c29 = loop_bw;
d29 = 200;
c38 = 1250;
void wlc_phy_txpower_recalc_target_lcnphy(phy_info_t *pi)
{
- uint16 pwr_ctrl;
+ u16 pwr_ctrl;
if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi)) {
wlc_lcnphy_calib_modes(pi, LCNPHY_PERICAL_TEMPBASED_TXPWRCTRL);
} else if (wlc_lcnphy_tssi_based_pwr_ctrl_enabled(pi)) {
static void wlc_lcnphy_set_rx_gain(phy_info_t *pi, uint32 gain)
{
- uint16 trsw, ext_lna, lna1, lna2, tia, biq0, biq1, gain0_15, gain16_19;
+ u16 trsw, ext_lna, lna1, lna2, tia, biq0, biq1, gain0_15, gain16_19;
trsw = (gain & ((uint32) 1 << 28)) ? 0 : 1;
- ext_lna = (uint16) (gain >> 29) & 0x01;
- lna1 = (uint16) (gain >> 0) & 0x0f;
- lna2 = (uint16) (gain >> 4) & 0x0f;
- tia = (uint16) (gain >> 8) & 0xf;
- biq0 = (uint16) (gain >> 12) & 0xf;
- biq1 = (uint16) (gain >> 16) & 0xf;
-
- gain0_15 = (uint16) ((lna1 & 0x3) | ((lna1 & 0x3) << 2) |
+ ext_lna = (u16) (gain >> 29) & 0x01;
+ lna1 = (u16) (gain >> 0) & 0x0f;
+ lna2 = (u16) (gain >> 4) & 0x0f;
+ tia = (u16) (gain >> 8) & 0xf;
+ biq0 = (u16) (gain >> 12) & 0xf;
+ biq1 = (u16) (gain >> 16) & 0xf;
+
+ gain0_15 = (u16) ((lna1 & 0x3) | ((lna1 & 0x3) << 2) |
((lna2 & 0x3) << 4) | ((lna2 & 0x3) << 6) |
((tia & 0xf) << 8) | ((biq0 & 0xf) << 12));
gain16_19 = biq1;
int16 filt_index = -1;
int j;
- uint16 addr[] = {
+ u16 addr[] = {
0x910,
0x91e,
0x91f,
0x932
};
- uint16 addr_ofdm[] = {
+ u16 addr_ofdm[] = {
0x90f,
0x900,
0x901,