Commit d89a4c80 authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman
Browse files

staging: brcm80211: removed void * from softmac phy



Code cleanup. Replacing void * by other pointer types improves code
readability and enforces stronger type checking.

Reported-by: default avatarJulian Calaby <julian.calaby@gmail.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 28e3edfe
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -4528,8 +4528,9 @@ int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit,
		    xmtfifo_sz[(wlc_hw->corerev - XMTFIFOTBL_STARTREV)];

		/* Get a phy for this band */
		wlc_hw->band->pi = wlc_phy_attach(wlc_hw->phy_sh,
			(void *)regs, brcms_b_bandtype(wlc_hw), vars,
		wlc_hw->band->pi =
			wlc_phy_attach(wlc_hw->phy_sh, regs,
				       brcms_b_bandtype(wlc_hw), vars,
				       wlc->wiphy);
		if (wlc_hw->band->pi == NULL) {
			wiphy_err(wiphy, "wl%d: brcms_b_attach: wlc_phy_"
+6 −7
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ const u8 ofdm_rate_lookup[] = {

static void wlc_set_phy_uninitted(struct brcms_phy *pi);
static u32 wlc_phy_get_radio_ver(struct brcms_phy *pi);
static void wlc_phy_timercb_phycal(void *arg);
static void wlc_phy_timercb_phycal(struct brcms_phy *pi);

static bool wlc_phy_noise_calc_phy(struct brcms_phy *pi, u32 *cmplx_pwr,
				   s8 *pwr_ant);
@@ -509,7 +509,7 @@ struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp)
}

struct brcms_phy_pub *
wlc_phy_attach(struct shared_phy *sh, void *regs, int bandtype,
wlc_phy_attach(struct shared_phy *sh, struct d11regs *regs, int bandtype,
	       char *vars, struct wiphy *wiphy)
{
	struct brcms_phy *pi;
@@ -539,7 +539,7 @@ wlc_phy_attach(struct shared_phy *sh, void *regs, int bandtype,
	if (pi == NULL)
		return NULL;
	pi->wiphy = wiphy;
	pi->regs = (struct d11regs *) regs;
	pi->regs = regs;
	pi->sh = sh;
	pi->phy_init_por = true;
	pi->phy_wreg_limit = PHY_WREG_LIMIT;
@@ -720,9 +720,8 @@ u32 wlc_phy_get_coreflags(struct brcms_phy_pub *pih)
	return pi->pubpi.coreflags;
}

static void wlc_phy_timercb_phycal(void *arg)
static void wlc_phy_timercb_phycal(struct brcms_phy *pi)
{
	struct brcms_phy *pi = (struct brcms_phy *) arg;
	uint delay = 5;

	if (PHY_PERICAL_MPHASE_PENDING(pi)) {
@@ -2619,9 +2618,9 @@ void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_cmplx_pwr_dB, u8 core)
	}
}

void wlc_phy_rssi_compute(struct brcms_phy_pub *pih, void *ctx)
void wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
			  struct brcms_d11rxhdr *wlc_rxhdr)
{
	struct brcms_d11rxhdr *wlc_rxhdr = (struct brcms_d11rxhdr *) ctx;
	struct d11rxhdr *rxh = &wlc_rxhdr->rxhdr;
	int rssi = le16_to_cpu(rxh->PhyRxStatus_1) & PRXS1_JSSI_MASK;
	uint radioid = pih->radioid;
+8 −3
Original line number Diff line number Diff line
@@ -103,6 +103,9 @@

#define	BRCMS_RSSI_INVALID	 0	/* invalid RSSI value */

struct d11regs;
struct phy_shim_info;

struct txpwr_limits {
	u8 cck[BRCMS_NUM_RATES_CCK];
	u8 ofdm[BRCMS_NUM_RATES_OFDM];
@@ -160,7 +163,7 @@ struct brcms_chanvec {

struct shared_phy_params {
	struct si_pub *sih;
	void *physhim;
	struct phy_shim_info *physhim;
	uint unit;
	uint corerev;
	uint bustype;
@@ -181,7 +184,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,
extern struct brcms_phy_pub *wlc_phy_attach(struct shared_phy *sh,
					    struct d11regs *regs,
					    int bandtype, char *vars,
					    struct wiphy *wiphy);
extern void wlc_phy_detach(struct brcms_phy_pub *ppi);
@@ -209,7 +213,8 @@ extern void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi,
extern u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi);
extern void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw);

extern void wlc_phy_rssi_compute(struct brcms_phy_pub *pih, void *ctx);
extern void wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
				 struct brcms_d11rxhdr *wlc_rxhdr);
extern void wlc_phy_por_inform(struct brcms_phy_pub *ppi);
extern void wlc_phy_noise_sample_intr(struct brcms_phy_pub *ppi);
extern bool wlc_phy_bist_check_phy(struct brcms_phy_pub *ppi);
+3 −2
Original line number Diff line number Diff line
@@ -41,6 +41,8 @@ extern u32 phyhal_msg_level;

#define LCNXN_BASEREV		16

struct phy_shim_info;

struct brcms_phy_srom_fem {
	/* TSSI positive slope, 1: positive, 0: negative */
	u8 tssipos;
@@ -546,7 +548,7 @@ struct shared_phy {
	struct brcms_phy *phy_head;
	uint unit;
	struct si_pub *sih;
	void *physhim;
	struct phy_shim_info *physhim;
	uint corerev;
	u32 machwcap;
	bool up;
@@ -611,7 +613,6 @@ struct brcms_phy {
	struct brcms_phy_pub pubpi_ro;
	struct shared_phy *sh;
	struct phy_func_ptr pi_fptr;
	void *pi_ptr;

	union {
		struct brcms_phy_lcnphy *pi_lcnphy;
+3 −4
Original line number Diff line number Diff line
@@ -1041,7 +1041,7 @@ void wlc_lcnphy_read_table(struct brcms_phy *pi, struct phytbl_info *pti)

static void
wlc_lcnphy_common_read_table(struct brcms_phy *pi, u32 tbl_id,
			     const void *tbl_ptr, u32 tbl_len,
			     const u16 *tbl_ptr, u32 tbl_len,
			     u32 tbl_width, u32 tbl_offset)
{
	struct phytbl_info tab;
@@ -1055,7 +1055,7 @@ wlc_lcnphy_common_read_table(struct brcms_phy *pi, u32 tbl_id,

static void
wlc_lcnphy_common_write_table(struct brcms_phy *pi, u32 tbl_id,
			      const void *tbl_ptr, u32 tbl_len,
			      const u16 *tbl_ptr, u32 tbl_len,
			      u32 tbl_width, u32 tbl_offset)
{

@@ -1965,13 +1965,12 @@ wlc_lcnphy_tx_iqlo_cal(struct brcms_phy *pi,
	write_phy_reg(pi, 0x93d, 0xc0);

	wlc_lcnphy_common_write_table(pi, LCNPHY_TBL_ID_IQLOCAL,
				      (const void *)
				      lcnphy_iqcal_loft_gainladder,
				      ARRAY_SIZE(lcnphy_iqcal_loft_gainladder),
				      16, 0);

	wlc_lcnphy_common_write_table(pi, LCNPHY_TBL_ID_IQLOCAL,
				      (const void *)lcnphy_iqcal_ir_gainladder,
				      lcnphy_iqcal_ir_gainladder,
				      ARRAY_SIZE(
					      lcnphy_iqcal_ir_gainladder), 16,
				      32);
Loading