Skip to content

Commit

Permalink
staging: brcm80211: fix for checkpatch warnings in phy directory
Browse files Browse the repository at this point in the history
Most of them being 'line exceeds 80 chars'. Still checkpatch warnings
for the phy dir left, these will be resolved in the subsequent commits.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Henry Ptasinski <henryp@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Roland Vossen authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent 85567f5 commit 7b4d189
Show file tree
Hide file tree
Showing 9 changed files with 2,897 additions and 2,954 deletions.
237 changes: 118 additions & 119 deletions drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c

Large diffs are not rendered by default.

51 changes: 28 additions & 23 deletions drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,28 +126,32 @@ struct txpwr_limits {

struct tx_power {
u32 flags;
u16 chanspec; /* txpwr report for this channel */
u16 local_chanspec; /* channel on which we are associated */
u8 local_max; /* local max according to the AP */
u8 local_constraint; /* local constraint according to the AP */
s8 antgain[2]; /* Ant gain for each band - from SROM */
u8 rf_cores; /* count of RF Cores being reported */
u8 est_Pout[4]; /* Latest tx power out estimate per RF chain */
u8 est_Pout_act[4]; /* Latest tx power out estimate per RF chain
* without adjustment
*/
u8 est_Pout_cck; /* Latest CCK tx power out estimate */
u8 tx_power_max[4]; /* Maximum target power among all rates */
u8 tx_power_max_rate_ind[4]; /* Index of the rate with the max target power */
u8 user_limit[WL_TX_POWER_RATES]; /* User limit */
u8 reg_limit[WL_TX_POWER_RATES]; /* Regulatory power limit */
u8 board_limit[WL_TX_POWER_RATES]; /* Max power board can support (SROM) */
u8 target[WL_TX_POWER_RATES]; /* Latest target power */
u16 chanspec; /* txpwr report for this channel */
u16 local_chanspec; /* channel on which we are associated */
u8 local_max; /* local max according to the AP */
u8 local_constraint; /* local constraint according to the AP */
s8 antgain[2]; /* Ant gain for each band - from SROM */
u8 rf_cores; /* count of RF Cores being reported */
u8 est_Pout[4]; /* Latest tx power out estimate per RF chain */
u8 est_Pout_act[4]; /* Latest tx power out estimate per RF chain
* without adjustment */
u8 est_Pout_cck; /* Latest CCK tx power out estimate */
u8 tx_power_max[4]; /* Maximum target power among all rates */
/* Index of the rate with the max target power */
u8 tx_power_max_rate_ind[4];
/* User limit */
u8 user_limit[WL_TX_POWER_RATES];
/* Regulatory power limit */
u8 reg_limit[WL_TX_POWER_RATES];
/* Max power board can support (SROM) */
u8 board_limit[WL_TX_POWER_RATES];
/* Latest target power */
u8 target[WL_TX_POWER_RATES];
};

struct tx_inst_power {
u8 txpwr_est_Pout[2]; /* Latest estimate for 2.4 and 5 Ghz */
u8 txpwr_est_Pout_gofdm; /* Pwr estimate for 2.4 OFDM */
u8 txpwr_est_Pout[2]; /* Latest estimate for 2.4 and 5 Ghz */
u8 txpwr_est_Pout_gofdm; /* Pwr estimate for 2.4 OFDM */
};

struct brcms_chanvec {
Expand Down Expand Up @@ -178,7 +182,8 @@ struct shared_phy_params {

extern struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp);
extern struct brcms_phy_pub *wlc_phy_attach(struct shared_phy *sh, void *regs,
int bandtype, char *vars, struct wiphy *wiphy);
int bandtype, char *vars,
struct wiphy *wiphy);
extern void wlc_phy_detach(struct brcms_phy_pub *ppi);

extern bool wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype,
Expand Down Expand Up @@ -222,7 +227,7 @@ extern void wlc_phy_chanspec_ch14_widefilter_set(struct brcms_phy_pub *ppi,
extern void wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band,
struct brcms_chanvec *channels);
extern u16 wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi,
uint band);
uint band);

extern void wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint chan,
u8 *_min_, u8 *_max_, int rate);
Expand Down Expand Up @@ -289,6 +294,6 @@ extern void wlc_phy_freqtrack_end(struct brcms_phy_pub *ppi);
extern const u8 *wlc_phy_get_ofdm_rate_lookup(void);

extern s8 wlc_phy_get_tx_power_offset_by_mcs(struct brcms_phy_pub *ppi,
u8 mcs_offset);
u8 mcs_offset);
extern s8 wlc_phy_get_tx_power_offset(struct brcms_phy_pub *ppi, u8 tbl_offset);
#endif /* _BRCM_PHY_HAL_H_ */
#endif /* _BRCM_PHY_HAL_H_ */
138 changes: 85 additions & 53 deletions drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ extern u32 phyhal_msg_level;
#define LCNXN_BASEREV 16

struct brcms_phy_srom_fem {
u8 tssipos; /* TSSI positive slope, 1: positive, 0: negative */
u8 extpagain; /* Ext PA gain-type: full-gain: 0, pa-lite: 1, no_pa: 2 */
u8 pdetrange; /* support 32 combinations of different Pdet dynamic ranges */
u8 triso; /* TR switch isolation */
u8 antswctrllut; /* antswctrl lookup table configuration: 32 possible choices */
/* TSSI positive slope, 1: positive, 0: negative */
u8 tssipos;
/* Ext PA gain-type: full-gain: 0, pa-lite: 1, no_pa: 2 */
u8 extpagain;
/* support 32 combinations of different Pdet dynamic ranges */
u8 pdetrange;
/* TR switch isolation */
u8 triso;
/* antswctrl lookup table configuration: 32 possible choices */
u8 antswctrllut;
};

#undef ISNPHY
Expand Down Expand Up @@ -192,7 +197,9 @@ struct brcms_phy_srom_fem {
#define PHY_PERICAL_WDOG_DELAY 5

#define MPHASE_TXCAL_NUMCMDS 2
#define PHY_PERICAL_MPHASE_PENDING(pi) (pi->mphase_cal_phase_id > MPHASE_CAL_STATE_IDLE)

#define PHY_PERICAL_MPHASE_PENDING(pi) \
(pi->mphase_cal_phase_id > MPHASE_CAL_STATE_IDLE)

enum {
MPHASE_CAL_STATE_IDLE = 0,
Expand Down Expand Up @@ -237,38 +244,56 @@ enum phy_cal_mode {
#define CORDIC_AG 39797
#define CORDIC_NI 18
#define FIXED(X) ((s32)((X) << 16))
#define FLOAT(X) (((X) >= 0) ? ((((X) >> 15) + 1) >> 1) : -((((-(X)) >> 15) + 1) >> 1))

#define FLOAT(X) \
(((X) >= 0) ? ((((X) >> 15) + 1) >> 1) : -((((-(X)) >> 15) + 1) >> 1))

#define PHY_CHAIN_TX_DISABLE_TEMP 115
#define PHY_HYSTERESIS_DELTATEMP 5

#define PHY_BITSCNT(x) brcmu_bitcount((u8 *)&(x), sizeof(u8))

#define MOD_PHY_REG(pi, phy_type, reg_name, field, value) \
mod_phy_reg(pi, phy_type##_##reg_name, phy_type##_##reg_name##_##field##_MASK, \
(value) << phy_type##_##reg_name##_##field##_##SHIFT)
mod_phy_reg(pi, phy_type##_##reg_name, \
phy_type##_##reg_name##_##field##_MASK, \
(value) << phy_type##_##reg_name##_##field##_##SHIFT)

#define READ_PHY_REG(pi, phy_type, reg_name, field) \
((read_phy_reg(pi, phy_type##_##reg_name) & phy_type##_##reg_name##_##field##_##MASK)\
>> phy_type##_##reg_name##_##field##_##SHIFT)
((read_phy_reg(pi, phy_type##_##reg_name) & \
phy_type##_##reg_name##_##field##_##MASK) \
>> phy_type##_##reg_name##_##field##_##SHIFT)

#define VALID_PHYTYPE(phytype) (((uint)phytype == PHY_TYPE_N) || \
((uint)phytype == PHY_TYPE_LCN))

#define VALID_N_RADIO(radioid) ((radioid == BCM2055_ID) || (radioid == BCM2056_ID) || \
(radioid == BCM2057_ID))
#define VALID_N_RADIO(radioid) ((radioid == BCM2055_ID) || \
(radioid == BCM2056_ID) || \
(radioid == BCM2057_ID))

#define VALID_LCN_RADIO(radioid) (radioid == BCM2064_ID)

#define VALID_RADIO(pi, radioid) (\
(ISNPHY(pi) ? VALID_N_RADIO(radioid) : false) || \
(ISLCNPHY(pi) ? VALID_LCN_RADIO(radioid) : false))
#define VALID_RADIO(pi, radioid) ( \
(ISNPHY(pi) ? VALID_N_RADIO(radioid) : false) || \
(ISLCNPHY(pi) ? VALID_LCN_RADIO(radioid) : false))

#define SCAN_INPROG_PHY(pi) \
(mboolisset(pi->measure_hold, PHY_HOLD_FOR_SCAN))

#define RM_INPROG_PHY(pi) (mboolisset(pi->measure_hold, PHY_HOLD_FOR_RM))

#define PLT_INPROG_PHY(pi) (mboolisset(pi->measure_hold, PHY_HOLD_FOR_PLT))

#define ASSOC_INPROG_PHY(pi) \
(mboolisset(pi->measure_hold, PHY_HOLD_FOR_ASSOC))

#define SCAN_INPROG_PHY(pi) (mboolisset(pi->measure_hold, PHY_HOLD_FOR_SCAN))
#define RM_INPROG_PHY(pi) (mboolisset(pi->measure_hold, PHY_HOLD_FOR_RM))
#define PLT_INPROG_PHY(pi) (mboolisset(pi->measure_hold, PHY_HOLD_FOR_PLT))
#define ASSOC_INPROG_PHY(pi) (mboolisset(pi->measure_hold, PHY_HOLD_FOR_ASSOC))
#define SCAN_RM_IN_PROGRESS(pi) (mboolisset(pi->measure_hold, PHY_HOLD_FOR_SCAN | PHY_HOLD_FOR_RM))
#define PHY_MUTED(pi) (mboolisset(pi->measure_hold, PHY_HOLD_FOR_MUTE))
#define PUB_NOT_ASSOC(pi) (mboolisset(pi->measure_hold, PHY_HOLD_FOR_NOT_ASSOC))
#define SCAN_RM_IN_PROGRESS(pi) \
(mboolisset(pi->measure_hold, PHY_HOLD_FOR_SCAN | PHY_HOLD_FOR_RM))

#define PHY_MUTED(pi) \
(mboolisset(pi->measure_hold, PHY_HOLD_FOR_MUTE))

#define PUB_NOT_ASSOC(pi) \
(mboolisset(pi->measure_hold, PHY_HOLD_FOR_NOT_ASSOC))

#if defined(EXT_CBALL)
#define NORADIO_ENAB(pub) ((pub).radioid == NORADIO_ID)
Expand Down Expand Up @@ -568,18 +593,18 @@ struct brcms_phy_pub {
};

struct phy_func_ptr {
void (*init) (struct brcms_phy *);
void (*calinit) (struct brcms_phy *);
void (*chanset) (struct brcms_phy *, u16 chanspec);
void (*txpwrrecalc) (struct brcms_phy *);
int (*longtrn) (struct brcms_phy *, int);
void (*txiqccget) (struct brcms_phy *, u16 *, u16 *);
void (*txiqccset) (struct brcms_phy *, u16, u16);
u16(*txloccget) (struct brcms_phy *);
void (*radioloftget) (struct brcms_phy *, u8 *, u8 *, u8 *, u8 *);
void (*carrsuppr) (struct brcms_phy *);
s32(*rxsigpwr) (struct brcms_phy *, s32);
void (*detach) (struct brcms_phy *);
void (*init)(struct brcms_phy *);
void (*calinit)(struct brcms_phy *);
void (*chanset)(struct brcms_phy *, u16 chanspec);
void (*txpwrrecalc)(struct brcms_phy *);
int (*longtrn)(struct brcms_phy *, int);
void (*txiqccget)(struct brcms_phy *, u16 *, u16 *);
void (*txiqccset)(struct brcms_phy *, u16, u16);
u16 (*txloccget)(struct brcms_phy *);
void (*radioloftget)(struct brcms_phy *, u8 *, u8 *, u8 *, u8 *);
void (*carrsuppr)(struct brcms_phy *);
s32 (*rxsigpwr)(struct brcms_phy *, s32);
void (*detach)(struct brcms_phy *);
};

struct brcms_phy {
Expand Down Expand Up @@ -712,7 +737,7 @@ struct brcms_phy {
u16 mintxbias;
u16 mintxmag;
struct lo_complex_abgphy_info gphy_locomp_iq
[STATIC_NUM_RF][STATIC_NUM_BB];
[STATIC_NUM_RF][STATIC_NUM_BB];
s8 stats_11b_txpower[STATIC_NUM_RF][STATIC_NUM_BB];
u16 gain_table[TX_GAIN_TABLE_LENGTH];
bool loopback_gain;
Expand Down Expand Up @@ -955,26 +980,29 @@ struct lcnphy_radio_regs {

extern struct lcnphy_radio_regs lcnphy_radio_regs_2064[];
extern struct lcnphy_radio_regs lcnphy_radio_regs_2066[];

extern struct radio_regs regs_2055[], regs_SYN_2056[], regs_TX_2056[],
regs_RX_2056[];
regs_RX_2056[];
extern struct radio_regs regs_SYN_2056_A1[], regs_TX_2056_A1[],
regs_RX_2056_A1[];
regs_RX_2056_A1[];
extern struct radio_regs regs_SYN_2056_rev5[], regs_TX_2056_rev5[],
regs_RX_2056_rev5[];
regs_RX_2056_rev5[];
extern struct radio_regs regs_SYN_2056_rev6[], regs_TX_2056_rev6[],
regs_RX_2056_rev6[];
regs_RX_2056_rev6[];
extern struct radio_regs regs_SYN_2056_rev7[], regs_TX_2056_rev7[],
regs_RX_2056_rev7[];
regs_RX_2056_rev7[];
extern struct radio_regs regs_SYN_2056_rev8[], regs_TX_2056_rev8[],
regs_RX_2056_rev8[];
regs_RX_2056_rev8[];

extern struct radio_20xx_regs regs_2057_rev4[], regs_2057_rev5[],
regs_2057_rev5v1[];
regs_2057_rev5v1[];
extern struct radio_20xx_regs regs_2057_rev7[], regs_2057_rev8[];

extern char *phy_getvar(struct brcms_phy *pi, const char *name);
extern int phy_getintvar(struct brcms_phy *pi, const char *name);
#define PHY_GETVAR(pi, name) phy_getvar(pi, name)
#define PHY_GETINTVAR(pi, name) phy_getintvar(pi, name)

#define PHY_GETVAR(pi, name) phy_getvar(pi, name)
#define PHY_GETINTVAR(pi, name) phy_getintvar(pi, name)

extern u16 read_phy_reg(struct brcms_phy *pi, u16 addr);
extern void write_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
Expand Down Expand Up @@ -1131,13 +1159,17 @@ extern void wlc_phy_stay_in_carriersearch_nphy(struct brcms_phy *pi,
bool enable);
extern void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);

#define wlc_phy_write_table_nphy(pi, pti) wlc_phy_write_table(pi, pti, 0x72, \
0x74, 0x73)
#define wlc_phy_read_table_nphy(pi, pti) wlc_phy_read_table(pi, pti, 0x72, \
0x74, 0x73)
#define wlc_nphy_table_addr(pi, id, off) wlc_phy_table_addr((pi), (id), (off), \
0x72, 0x74, 0x73)
#define wlc_nphy_table_data_write(pi, w, v) wlc_phy_table_data_write((pi), (w), (v))
#define wlc_phy_write_table_nphy(pi, pti) \
wlc_phy_write_table(pi, pti, 0x72, 0x74, 0x73)

#define wlc_phy_read_table_nphy(pi, pti) \
wlc_phy_read_table(pi, pti, 0x72, 0x74, 0x73)

#define wlc_nphy_table_addr(pi, id, off) \
wlc_phy_table_addr((pi), (id), (off), 0x72, 0x74, 0x73)

#define wlc_nphy_table_data_write(pi, w, v) \
wlc_phy_table_data_write((pi), (w), (v))

extern void wlc_phy_table_read_nphy(struct brcms_phy *pi, u32, u32 l, u32 o,
u32 w, void *d);
Expand Down Expand Up @@ -1218,7 +1250,7 @@ extern void wlc_phy_nphy_tkip_rifs_war(struct brcms_phy *pi, u8 rifs);
void wlc_phy_get_pwrdet_offsets(struct brcms_phy *pi, s8 *cckoffset,
s8 *ofdmoffset);
extern s8 wlc_phy_upd_rssi_offset(struct brcms_phy *pi, s8 rssi,
u16 chanspec);
u16 chanspec);

extern bool wlc_phy_n_txpower_ipa_ison(struct brcms_phy *pih);
#endif /* _BRCM_PHY_INT_H_ */
Loading

0 comments on commit 7b4d189

Please sign in to comment.