From: Roland Vossen <rvossen@xxxxxxxxxxxx> Code cleanup. Signed-off-by: Roland Vossen <rvossen@xxxxxxxxxxxx> Reviewed-by: Arend van Spriel <arend@xxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx> --- drivers/staging/brcm80211/brcmsmac/wlc_alloc.c | 10 ++-- drivers/staging/brcm80211/brcmsmac/wlc_bsscfg.h | 5 +- drivers/staging/brcm80211/brcmsmac/wlc_main.c | 50 ++++++++++++----------- drivers/staging/brcm80211/brcmsmac/wlc_main.h | 28 +++++++------ 4 files changed, 49 insertions(+), 44 deletions(-) diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_alloc.c b/drivers/staging/brcm80211/brcmsmac/wlc_alloc.c index 0768496..e928fa1 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_alloc.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_alloc.c @@ -120,11 +120,11 @@ static void wlc_pub_mfree(struct wlc_pub *pub) kfree(pub); } -static wlc_bsscfg_t *wlc_bsscfg_malloc(uint unit) +static struct wlc_bsscfg *wlc_bsscfg_malloc(uint unit) { - wlc_bsscfg_t *cfg; + struct wlc_bsscfg *cfg; - cfg = (wlc_bsscfg_t *) wlc_calloc(unit, sizeof(wlc_bsscfg_t)); + cfg = (struct wlc_bsscfg *) wlc_calloc(unit, sizeof(struct wlc_bsscfg)); if (cfg == NULL) goto fail; @@ -140,7 +140,7 @@ static wlc_bsscfg_t *wlc_bsscfg_malloc(uint unit) return NULL; } -static void wlc_bsscfg_mfree(wlc_bsscfg_t *cfg) +static void wlc_bsscfg_mfree(struct wlc_bsscfg *cfg) { if (cfg == NULL) return; @@ -150,7 +150,7 @@ static void wlc_bsscfg_mfree(wlc_bsscfg_t *cfg) kfree(cfg); } -void wlc_bsscfg_ID_assign(struct wlc_info *wlc, wlc_bsscfg_t *bsscfg) +void wlc_bsscfg_ID_assign(struct wlc_info *wlc, struct wlc_bsscfg *bsscfg) { bsscfg->ID = wlc->next_bsscfg_ID; wlc->next_bsscfg_ID++; diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_bsscfg.h b/drivers/staging/brcm80211/brcmsmac/wlc_bsscfg.h index 0951574..cd5cfbb 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_bsscfg.h +++ b/drivers/staging/brcm80211/brcmsmac/wlc_bsscfg.h @@ -31,7 +31,7 @@ typedef struct wlc_bsscfg wlc_bsscfg_t; #define BCN_TEMPLATE_COUNT 2 /* Iterator for "associated" STA bss configs: - (struct wlc_info *wlc, int idx, wlc_bsscfg_t *cfg) */ + (struct wlc_info *wlc, int idx, struct wlc_bsscfg *cfg) */ #define FOREACH_AS_STA(wlc, idx, cfg) \ for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \ if ((cfg = (wlc)->bsscfg[idx]) && BSSCFG_STA(cfg) && cfg->associated) @@ -125,7 +125,8 @@ struct wlc_bsscfg { #define HWBCN_ENAB(cfg) (((cfg)->flags & WLC_BSSCFG_HW_BCN) != 0) #define HWPRB_ENAB(cfg) (((cfg)->flags & WLC_BSSCFG_HW_PRB) != 0) -extern void wlc_bsscfg_ID_assign(struct wlc_info *wlc, wlc_bsscfg_t * bsscfg); +extern void wlc_bsscfg_ID_assign(struct wlc_info *wlc, + struct wlc_bsscfg *bsscfg); /* Extend N_ENAB to per-BSS */ #define BSS_N_ENAB(wlc, cfg) \ diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_main.c b/drivers/staging/brcm80211/brcmsmac/wlc_main.c index 38330e7..97b320d 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_main.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_main.c @@ -354,7 +354,7 @@ bool wlc_stay_awake(struct wlc_info *wlc) bool wlc_ps_allowed(struct wlc_info *wlc) { int idx; - wlc_bsscfg_t *cfg; + struct wlc_bsscfg *cfg; /* disallow PS when one of the following global conditions meets */ if (!wlc->pub->associated || !wlc->PMenabled || wlc->PM_override) @@ -437,7 +437,7 @@ void wlc_init(struct wlc_info *wlc) d11regs_t *regs; chanspec_t chanspec; int i; - wlc_bsscfg_t *bsscfg; + struct wlc_bsscfg *bsscfg; bool mute = false; WL_TRACE("wl%d: wlc_init\n", wlc->pub->unit); @@ -630,7 +630,7 @@ bool wlc_ps_check(struct wlc_info *wlc) if (hps != ((tmp & MCTL_HPS) != 0)) { int idx; - wlc_bsscfg_t *cfg; + struct wlc_bsscfg *cfg; WL_ERROR("wl%d: hps not sync, sw %d, maccontrol 0x%x\n", wlc->pub->unit, hps, tmp); FOREACH_BSS(wlc, idx, cfg) { @@ -688,7 +688,7 @@ void wlc_set_ps_ctrl(struct wlc_info *wlc) * Write this BSS config's MAC address to core. * Updates RXE match engine. */ -int wlc_set_mac(wlc_bsscfg_t *cfg) +int wlc_set_mac(struct wlc_bsscfg *cfg) { int err = 0; struct wlc_info *wlc = cfg->wlc; @@ -706,7 +706,7 @@ int wlc_set_mac(wlc_bsscfg_t *cfg) /* Write the BSS config's BSSID address to core (set_bssid in d11procs.tcl). * Updates RXE match engine. */ -void wlc_set_bssid(wlc_bsscfg_t *cfg) +void wlc_set_bssid(struct wlc_bsscfg *cfg) { struct wlc_info *wlc = cfg->wlc; @@ -728,7 +728,7 @@ void wlc_set_bssid(wlc_bsscfg_t *cfg) void wlc_switch_shortslot(struct wlc_info *wlc, bool shortslot) { int idx; - wlc_bsscfg_t *cfg; + struct wlc_bsscfg *cfg; ASSERT(wlc->band->gmode); @@ -786,7 +786,7 @@ void wlc_set_home_chanspec(struct wlc_info *wlc, chanspec_t chanspec) { if (wlc->home_chanspec != chanspec) { int idx; - wlc_bsscfg_t *cfg; + struct wlc_bsscfg *cfg; wlc->home_chanspec = chanspec; @@ -1313,7 +1313,7 @@ static void WLBANDINITFN(wlc_bsinit) (struct wlc_info *wlc) static void WLBANDINITFN(wlc_setband) (struct wlc_info *wlc, uint bandunit) { int idx; - wlc_bsscfg_t *cfg; + struct wlc_bsscfg *cfg; ASSERT(NBANDS(wlc) > 1); ASSERT(!wlc->bandlocked); @@ -1439,7 +1439,7 @@ void wlc_wme_setparams(struct wlc_info *wlc, u16 aci, void *arg, bool suspend) } -void wlc_edcf_setparams(wlc_bsscfg_t *cfg, bool suspend) +void wlc_edcf_setparams(struct wlc_bsscfg *cfg, bool suspend) { struct wlc_info *wlc = cfg->wlc; uint aci, i, j; @@ -2450,7 +2450,7 @@ static void wlc_watchdog(void *arg) { struct wlc_info *wlc = (struct wlc_info *) arg; int i; - wlc_bsscfg_t *cfg; + struct wlc_bsscfg *cfg; WL_TRACE("wl%d: wlc_watchdog\n", wlc->pub->unit); @@ -2566,7 +2566,7 @@ int wlc_up(struct wlc_info *wlc) if (!mboolisset (wlc->pub->radio_disabled, WL_RADIO_HW_DISABLE)) { int idx; - wlc_bsscfg_t *bsscfg; + struct wlc_bsscfg *bsscfg; mboolset(wlc->pub->radio_disabled, WL_RADIO_HW_DISABLE); @@ -3065,7 +3065,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, bool ta_ok; uint band; rw_reg_t *r; - wlc_bsscfg_t *bsscfg; + struct wlc_bsscfg *bsscfg; wlc_bss_info_t *current_bss; /* update bsscfg pointer */ @@ -4506,7 +4506,7 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid, int val_size, struct wlc_if *wlcif) { struct wlc_info *wlc = hdl; - wlc_bsscfg_t *bsscfg; + struct wlc_bsscfg *bsscfg; int err = 0; s32 int_val = 0; s32 int_val2 = 0; @@ -5277,7 +5277,8 @@ void BCMFASTPATH wlc_send_q(struct wlc_info *wlc, struct wlc_txq_info *qi) * for MC frames so is used as part of the sequence number. */ static inline u16 -bcmc_fid_generate(struct wlc_info *wlc, wlc_bsscfg_t *bsscfg, d11txh_t *txh) +bcmc_fid_generate(struct wlc_info *wlc, struct wlc_bsscfg *bsscfg, + d11txh_t *txh) { u16 frameid; @@ -6378,7 +6379,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, void wlc_tbtt(struct wlc_info *wlc, d11regs_t *regs) { - wlc_bsscfg_t *cfg = wlc->cfg; + struct wlc_bsscfg *cfg = wlc->cfg; wlc->pub->_cnt->tbtt++; @@ -6514,7 +6515,7 @@ void wlc_high_dpc(struct wlc_info *wlc, u32 macintstatus) /* delay the cleanup to wl_down in IBSS case */ if ((R_REG(®s->phydebug) & PDBG_RFD)) { int idx; - wlc_bsscfg_t *bsscfg; + struct wlc_bsscfg *bsscfg; FOREACH_BSS(wlc, idx, bsscfg) { if (!BSSCFG_STA(bsscfg) || !bsscfg->enable || !bsscfg->BSS) @@ -7629,7 +7630,7 @@ wlc_compute_bcntsfoff(struct wlc_info *wlc, ratespec_t rspec, */ static void wlc_bcn_prb_template(struct wlc_info *wlc, u16 type, ratespec_t bcn_rspec, - wlc_bsscfg_t *cfg, u16 *buf, int *len) + struct wlc_bsscfg *cfg, u16 *buf, int *len) { static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255}; cck_phy_hdr_t *plcp; @@ -7696,7 +7697,7 @@ int wlc_get_header_len() * template updated. * Otherwise, it updates the hardware template. */ -void wlc_bss_update_beacon(struct wlc_info *wlc, wlc_bsscfg_t *cfg) +void wlc_bss_update_beacon(struct wlc_info *wlc, struct wlc_bsscfg *cfg) { int len = BCN_TMPL_LEN; @@ -7750,7 +7751,7 @@ void wlc_bss_update_beacon(struct wlc_info *wlc, wlc_bsscfg_t *cfg) void wlc_update_beacon(struct wlc_info *wlc) { int idx; - wlc_bsscfg_t *bsscfg; + struct wlc_bsscfg *bsscfg; /* update AP or IBSS beacons */ FOREACH_BSS(wlc, idx, bsscfg) { @@ -7760,7 +7761,7 @@ void wlc_update_beacon(struct wlc_info *wlc) } /* Write ssid into shared memory */ -void wlc_shm_ssid_upd(struct wlc_info *wlc, wlc_bsscfg_t *cfg) +void wlc_shm_ssid_upd(struct wlc_info *wlc, struct wlc_bsscfg *cfg) { u8 *ssidptr = cfg->SSID; u16 base = M_SSID; @@ -7779,7 +7780,7 @@ void wlc_shm_ssid_upd(struct wlc_info *wlc, wlc_bsscfg_t *cfg) void wlc_update_probe_resp(struct wlc_info *wlc, bool suspend) { int idx; - wlc_bsscfg_t *bsscfg; + struct wlc_bsscfg *bsscfg; /* update AP or IBSS probe responses */ FOREACH_BSS(wlc, idx, bsscfg) { @@ -7789,7 +7790,8 @@ void wlc_update_probe_resp(struct wlc_info *wlc, bool suspend) } void -wlc_bss_update_probe_resp(struct wlc_info *wlc, wlc_bsscfg_t *cfg, bool suspend) +wlc_bss_update_probe_resp(struct wlc_info *wlc, struct wlc_bsscfg *cfg, + bool suspend) { u16 prb_resp[BCN_TMPL_LEN / 2]; int len = BCN_TMPL_LEN; @@ -7867,7 +7869,7 @@ int wlc_prep_pdu(struct wlc_info *wlc, struct sk_buff *pdu, uint *fifop) void wlc_reprate_init(struct wlc_info *wlc) { int i; - wlc_bsscfg_t *bsscfg; + struct wlc_bsscfg *bsscfg; FOREACH_BSS(wlc, i, bsscfg) { wlc_bsscfg_reprate_init(bsscfg); @@ -7875,7 +7877,7 @@ void wlc_reprate_init(struct wlc_info *wlc) } /* per bsscfg init tx reported rate mechanism */ -void wlc_bsscfg_reprate_init(wlc_bsscfg_t *bsscfg) +void wlc_bsscfg_reprate_init(struct wlc_bsscfg *bsscfg) { bsscfg->txrspecidx = 0; memset((char *)bsscfg->txrspec, 0, sizeof(bsscfg->txrspec)); diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_main.h b/drivers/staging/brcm80211/brcmsmac/wlc_main.h index 0eaef07..960f82c 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_main.h +++ b/drivers/staging/brcm80211/brcmsmac/wlc_main.h @@ -621,11 +621,12 @@ struct wlc_info { u16 tx_prec_map; /* Precedence map based on HW FIFO space */ u16 fifo2prec_map[NFIFO]; /* pointer to fifo2_prec map based on WME */ - /* BSS Configurations */ - wlc_bsscfg_t *bsscfg[WLC_MAXBSSCFG]; /* set of BSS configurations, idx 0 is default and - * always valid - */ - wlc_bsscfg_t *cfg; /* the primary bsscfg (can be AP or STA) */ + /* + * BSS Configurations set of BSS configurations, idx 0 is default and + * always valid + */ + struct wlc_bsscfg *bsscfg[WLC_MAXBSSCFG]; + struct wlc_bsscfg *cfg; /* the primary bsscfg (can be AP or STA) */ u8 stas_associated; /* count of ASSOCIATED STA bsscfgs */ u8 aps_associated; /* count of UP AP bsscfgs */ u8 block_datafifo; /* prohibit posting frames to data fifos */ @@ -846,7 +847,7 @@ extern bool wlc_valid_rate(struct wlc_info *wlc, ratespec_t rate, int band, extern void wlc_ap_upd(struct wlc_info *wlc); /* helper functions */ -extern void wlc_shm_ssid_upd(struct wlc_info *wlc, wlc_bsscfg_t *cfg); +extern void wlc_shm_ssid_upd(struct wlc_info *wlc, struct wlc_bsscfg *cfg); extern int wlc_set_gmode(struct wlc_info *wlc, u8 gmode, bool config); extern void wlc_mac_bcn_promisc_change(struct wlc_info *wlc, bool promisc); @@ -884,7 +885,7 @@ extern void wlc_dump_ie(struct wlc_info *wlc, bcm_tlv_t *ie, extern bool wlc_ps_check(struct wlc_info *wlc); extern void wlc_reprate_init(struct wlc_info *wlc); -extern void wlc_bsscfg_reprate_init(wlc_bsscfg_t *bsscfg); +extern void wlc_bsscfg_reprate_init(struct wlc_bsscfg *bsscfg); extern void wlc_uint64_sub(u32 *a_high, u32 *a_low, u32 b_high, u32 b_low); extern u32 wlc_calc_tbtt_offset(u32 bi, u32 tsf_h, u32 tsf_l); @@ -903,8 +904,8 @@ extern void wlc_bss_update_beacon(struct wlc_info *wlc, struct wlc_bsscfg *bsscfg); extern void wlc_update_probe_resp(struct wlc_info *wlc, bool suspend); -extern void wlc_bss_update_probe_resp(struct wlc_info *wlc, wlc_bsscfg_t *cfg, - bool suspend); +extern void wlc_bss_update_probe_resp(struct wlc_info *wlc, + struct wlc_bsscfg *cfg, bool suspend); extern bool wlc_ismpc(struct wlc_info *wlc); extern bool wlc_is_non_delay_mpc(struct wlc_info *wlc); @@ -936,14 +937,15 @@ extern void wlc_print_ies(struct wlc_info *wlc, u8 *ies, uint ies_len); extern int wlc_set_nmode(struct wlc_info *wlc, s32 nmode); extern void wlc_ht_mimops_cap_update(struct wlc_info *wlc, u8 mimops_mode); extern void wlc_mimops_action_ht_send(struct wlc_info *wlc, - wlc_bsscfg_t *bsscfg, u8 mimops_mode); + struct wlc_bsscfg *bsscfg, + u8 mimops_mode); extern void wlc_switch_shortslot(struct wlc_info *wlc, bool shortslot); -extern void wlc_set_bssid(wlc_bsscfg_t *cfg); -extern void wlc_edcf_setparams(wlc_bsscfg_t *cfg, bool suspend); +extern void wlc_set_bssid(struct wlc_bsscfg *cfg); +extern void wlc_edcf_setparams(struct wlc_bsscfg *cfg, bool suspend); extern void wlc_set_ratetable(struct wlc_info *wlc); -extern int wlc_set_mac(wlc_bsscfg_t *cfg); +extern int wlc_set_mac(struct wlc_bsscfg *cfg); extern void wlc_beacon_phytxctl_txant_upd(struct wlc_info *wlc, ratespec_t bcn_rate); extern void wlc_mod_prb_rsp_rate_table(struct wlc_info *wlc, uint frame_len); -- 1.7.4.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel