Commit 08db27dc authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: replaced typedef wlc_pub_t by struct wlc_pub

Code cleanup
Signed-off-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c41c858f
...@@ -60,7 +60,7 @@ struct wl_firmware { ...@@ -60,7 +60,7 @@ struct wl_firmware {
}; };
struct wl_info { struct wl_info {
wlc_pub_t *pub; /* pointer to public wlc state */ struct wlc_pub *pub; /* pointer to public wlc state */
void *wlc; /* pointer to private common os-independent data */ void *wlc; /* pointer to private common os-independent data */
struct osl_info *osh; /* pointer to os handler */ struct osl_info *osh; /* pointer to os handler */
u32 magic; u32 magic;
......
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
#include <wlc_alloc.h> #include <wlc_alloc.h>
#include <wl_dbg.h> #include <wl_dbg.h>
static wlc_pub_t *wlc_pub_malloc(struct osl_info *osh, uint unit, uint *err, static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit,
uint devid); uint *err, uint devid);
static void wlc_pub_mfree(struct osl_info *osh, wlc_pub_t *pub); static void wlc_pub_mfree(struct osl_info *osh, struct wlc_pub *pub);
static void wlc_tunables_init(wlc_tunables_t *tunables, uint devid); static void wlc_tunables_init(wlc_tunables_t *tunables, uint devid);
void *wlc_calloc(struct osl_info *osh, uint unit, uint size) void *wlc_calloc(struct osl_info *osh, uint unit, uint size)
...@@ -65,12 +65,12 @@ void wlc_tunables_init(wlc_tunables_t *tunables, uint devid) ...@@ -65,12 +65,12 @@ void wlc_tunables_init(wlc_tunables_t *tunables, uint devid)
tunables->txsbnd = TXSBND; tunables->txsbnd = TXSBND;
} }
static wlc_pub_t *wlc_pub_malloc(struct osl_info *osh, uint unit, uint *err, static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit,
uint devid) uint *err, uint devid)
{ {
wlc_pub_t *pub; struct wlc_pub *pub;
pub = (wlc_pub_t *) wlc_calloc(osh, unit, sizeof(wlc_pub_t)); pub = (struct wlc_pub *) wlc_calloc(osh, unit, sizeof(struct wlc_pub));
if (pub == NULL) { if (pub == NULL) {
*err = 1001; *err = 1001;
goto fail; goto fail;
...@@ -100,7 +100,7 @@ static wlc_pub_t *wlc_pub_malloc(struct osl_info *osh, uint unit, uint *err, ...@@ -100,7 +100,7 @@ static wlc_pub_t *wlc_pub_malloc(struct osl_info *osh, uint unit, uint *err,
return NULL; return NULL;
} }
static void wlc_pub_mfree(struct osl_info *osh, wlc_pub_t *pub) static void wlc_pub_mfree(struct osl_info *osh, struct wlc_pub *pub)
{ {
if (pub == NULL) if (pub == NULL)
return; return;
...@@ -179,7 +179,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err, ...@@ -179,7 +179,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
wlc->hwrxoff = WL_HWRXOFF; wlc->hwrxoff = WL_HWRXOFF;
/* allocate wlc_pub_t state structure */ /* allocate struct wlc_pub state structure */
wlc->pub = wlc_pub_malloc(osh, unit, err, devid); wlc->pub = wlc_pub_malloc(osh, unit, err, devid);
if (wlc->pub == NULL) { if (wlc->pub == NULL) {
*err = 1003; *err = 1003;
......
...@@ -96,7 +96,7 @@ const u8 mimo_2x3_div_antselid_tbl[16] = { ...@@ -96,7 +96,7 @@ const u8 mimo_2x3_div_antselid_tbl[16] = {
struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc, struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc,
struct osl_info *osh, struct osl_info *osh,
wlc_pub_t *pub, struct wlc_pub *pub,
struct wlc_hw_info *wlc_hw) { struct wlc_hw_info *wlc_hw) {
struct antsel_info *asi; struct antsel_info *asi;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#define _wlc_antsel_h_ #define _wlc_antsel_h_
extern struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc, extern struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc,
struct osl_info *osh, struct osl_info *osh,
wlc_pub_t *pub, struct wlc_pub *pub,
struct wlc_hw_info *wlc_hw); struct wlc_hw_info *wlc_hw);
extern void wlc_antsel_detach(struct antsel_info *asi); extern void wlc_antsel_detach(struct antsel_info *asi);
extern void wlc_antsel_init(struct antsel_info *asi); extern void wlc_antsel_init(struct antsel_info *asi);
......
...@@ -44,7 +44,7 @@ typedef struct wlc_cm_band { ...@@ -44,7 +44,7 @@ typedef struct wlc_cm_band {
} wlc_cm_band_t; } wlc_cm_band_t;
struct wlc_cm_info { struct wlc_cm_info {
wlc_pub_t *pub; struct wlc_pub *pub;
struct wlc_info *wlc; struct wlc_info *wlc;
char srom_ccode[WLC_CNTRY_BUF_SZ]; /* Country Code in SROM */ char srom_ccode[WLC_CNTRY_BUF_SZ]; /* Country Code in SROM */
uint srom_regrev; /* Regulatory Rev for the SROM ccode */ uint srom_regrev; /* Regulatory Rev for the SROM ccode */
...@@ -611,7 +611,7 @@ wlc_cm_info_t *wlc_channel_mgr_attach(struct wlc_info *wlc) ...@@ -611,7 +611,7 @@ wlc_cm_info_t *wlc_channel_mgr_attach(struct wlc_info *wlc)
wlc_cm_info_t *wlc_cm; wlc_cm_info_t *wlc_cm;
char country_abbrev[WLC_CNTRY_BUF_SZ]; char country_abbrev[WLC_CNTRY_BUF_SZ];
const country_info_t *country; const country_info_t *country;
wlc_pub_t *pub = wlc->pub; struct wlc_pub *pub = wlc->pub;
char *ccode; char *ccode;
WL_TRACE(("wl%d: wlc_channel_mgr_attach\n", wlc->pub->unit)); WL_TRACE(("wl%d: wlc_channel_mgr_attach\n", wlc->pub->unit));
......
...@@ -47,7 +47,7 @@ struct wlc_eventq { ...@@ -47,7 +47,7 @@ struct wlc_eventq {
wlc_event_t *tail; wlc_event_t *tail;
struct wlc_info *wlc; struct wlc_info *wlc;
void *wl; void *wl;
wlc_pub_t *pub; struct wlc_pub *pub;
bool tpending; bool tpending;
bool workpending; bool workpending;
struct wl_timer *timer; struct wl_timer *timer;
...@@ -58,7 +58,8 @@ struct wlc_eventq { ...@@ -58,7 +58,8 @@ struct wlc_eventq {
/* /*
* Export functions * Export functions
*/ */
wlc_eventq_t *wlc_eventq_attach(wlc_pub_t *pub, struct wlc_info *wlc, void *wl, wlc_eventq_t *wlc_eventq_attach(struct wlc_pub *pub, struct wlc_info *wlc,
void *wl,
wlc_eventq_cb_t cb) wlc_eventq_cb_t cb)
{ {
wlc_eventq_t *eq; wlc_eventq_t *eq;
......
...@@ -21,7 +21,8 @@ typedef struct wlc_eventq wlc_eventq_t; ...@@ -21,7 +21,8 @@ typedef struct wlc_eventq wlc_eventq_t;
typedef void (*wlc_eventq_cb_t) (void *arg); typedef void (*wlc_eventq_cb_t) (void *arg);
extern wlc_eventq_t *wlc_eventq_attach(wlc_pub_t *pub, struct wlc_info *wlc, extern wlc_eventq_t *wlc_eventq_attach(struct wlc_pub *pub,
struct wlc_info *wlc,
void *wl, wlc_eventq_cb_t cb); void *wl, wlc_eventq_cb_t cb);
extern int wlc_eventq_detach(wlc_eventq_t *eq); extern int wlc_eventq_detach(wlc_eventq_t *eq);
extern int wlc_eventq_down(wlc_eventq_t *eq); extern int wlc_eventq_down(wlc_eventq_t *eq);
......
...@@ -1697,7 +1697,7 @@ static uint wlc_attach_module(struct wlc_info *wlc) ...@@ -1697,7 +1697,7 @@ static uint wlc_attach_module(struct wlc_info *wlc)
return err; return err;
} }
wlc_pub_t *wlc_pub(void *wlc) struct wlc_pub *wlc_pub(void *wlc)
{ {
return ((struct wlc_info *) wlc)->pub; return ((struct wlc_info *) wlc)->pub;
} }
...@@ -1714,7 +1714,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode, ...@@ -1714,7 +1714,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
struct wlc_info *wlc; struct wlc_info *wlc;
uint err = 0; uint err = 0;
uint j; uint j;
wlc_pub_t *pub; struct wlc_pub *pub;
wlc_txq_info_t *qi; wlc_txq_info_t *qi;
uint n_disabled; uint n_disabled;
...@@ -4309,7 +4309,7 @@ int wlc_iovar_gets8(struct wlc_info *wlc, const char *name, s8 *arg) ...@@ -4309,7 +4309,7 @@ int wlc_iovar_gets8(struct wlc_info *wlc, const char *name, s8 *arg)
* calling function must keep 'iovars' until wlc_module_unregister is called. * calling function must keep 'iovars' until wlc_module_unregister is called.
* 'iovar' must have the last entry's name field being NULL as terminator. * 'iovar' must have the last entry's name field being NULL as terminator.
*/ */
int wlc_module_register(wlc_pub_t *pub, const bcm_iovar_t *iovars, int wlc_module_register(struct wlc_pub *pub, const bcm_iovar_t *iovars,
const char *name, void *hdl, iovar_fn_t i_fn, const char *name, void *hdl, iovar_fn_t i_fn,
watchdog_fn_t w_fn, down_fn_t d_fn) watchdog_fn_t w_fn, down_fn_t d_fn)
{ {
...@@ -4339,7 +4339,7 @@ int wlc_module_register(wlc_pub_t *pub, const bcm_iovar_t *iovars, ...@@ -4339,7 +4339,7 @@ int wlc_module_register(wlc_pub_t *pub, const bcm_iovar_t *iovars,
} }
/* unregister module callbacks */ /* unregister module callbacks */
int wlc_module_unregister(wlc_pub_t *pub, const char *name, void *hdl) int wlc_module_unregister(struct wlc_pub *pub, const char *name, void *hdl)
{ {
struct wlc_info *wlc = (struct wlc_info *) pub->wlc; struct wlc_info *wlc = (struct wlc_info *) pub->wlc;
int i; int i;
...@@ -4455,7 +4455,7 @@ wlc_iovar_op(struct wlc_info *wlc, const char *name, ...@@ -4455,7 +4455,7 @@ wlc_iovar_op(struct wlc_info *wlc, const char *name,
} }
int int
wlc_iovar_check(wlc_pub_t *pub, const bcm_iovar_t *vi, void *arg, int len, wlc_iovar_check(struct wlc_pub *pub, const bcm_iovar_t *vi, void *arg, int len,
bool set) bool set)
{ {
struct wlc_info *wlc = (struct wlc_info *) pub->wlc; struct wlc_info *wlc = (struct wlc_info *) pub->wlc;
......
...@@ -510,7 +510,7 @@ typedef struct wlc_txq_info { ...@@ -510,7 +510,7 @@ typedef struct wlc_txq_info {
* Principal common (os-independent) software data structure. * Principal common (os-independent) software data structure.
*/ */
struct wlc_info { struct wlc_info {
wlc_pub_t *pub; /* pointer to wlc public state */ struct wlc_pub *pub; /* pointer to wlc public state */
struct osl_info *osh; /* pointer to os handle */ struct osl_info *osh; /* pointer to os handle */
struct wl_info *wl; /* pointer to os-specific private state */ struct wl_info *wl; /* pointer to os-specific private state */
d11regs_t *regs; /* pointer to device registers */ d11regs_t *regs; /* pointer to device registers */
...@@ -787,7 +787,7 @@ struct wlc_info { ...@@ -787,7 +787,7 @@ struct wlc_info {
/* antsel module specific state */ /* antsel module specific state */
struct antsel_info { struct antsel_info {
struct wlc_info *wlc; /* pointer to main wlc structure */ struct wlc_info *wlc; /* pointer to main wlc structure */
wlc_pub_t *pub; /* pointer to public fn */ struct wlc_pub *pub; /* pointer to public fn */
u8 antsel_type; /* Type of boardlevel mimo antenna switch-logic u8 antsel_type; /* Type of boardlevel mimo antenna switch-logic
* 0 = N/A, 1 = 2x4 board, 2 = 2x3 CB2 board * 0 = N/A, 1 = 2x4 board, 2 = 2x3 CB2 board
*/ */
......
...@@ -251,7 +251,7 @@ typedef int (*iovar_fn_t) (void *handle, const bcm_iovar_t *vi, ...@@ -251,7 +251,7 @@ typedef int (*iovar_fn_t) (void *handle, const bcm_iovar_t *vi,
* Public portion of "common" os-independent state structure. * Public portion of "common" os-independent state structure.
* The wlc handle points at this. * The wlc handle points at this.
*/ */
typedef struct wlc_pub { struct wlc_pub {
void *wlc; void *wlc;
struct ieee80211_hw *ieee_hw; struct ieee80211_hw *ieee_hw;
...@@ -330,7 +330,7 @@ typedef struct wlc_pub { ...@@ -330,7 +330,7 @@ typedef struct wlc_pub {
bool _lmacproto; /* lmac protocol module included and enabled */ bool _lmacproto; /* lmac protocol module included and enabled */
bool phy_11ncapable; /* the PHY/HW is capable of 802.11N */ bool phy_11ncapable; /* the PHY/HW is capable of 802.11N */
bool _ampdumac; /* mac assist ampdu enabled or not */ bool _ampdumac; /* mac assist ampdu enabled or not */
} wlc_pub_t; };
/* wl_monitor rx status per packet */ /* wl_monitor rx status per packet */
typedef struct wl_rxsts { typedef struct wl_rxsts {
...@@ -528,7 +528,7 @@ extern void wlc_set_addrmatch(struct wlc_info *wlc, int match_reg_offset, ...@@ -528,7 +528,7 @@ extern void wlc_set_addrmatch(struct wlc_info *wlc, int match_reg_offset,
extern void wlc_wme_setparams(struct wlc_info *wlc, u16 aci, void *arg, extern void wlc_wme_setparams(struct wlc_info *wlc, u16 aci, void *arg,
bool suspend); bool suspend);
extern wlc_pub_t *wlc_pub(void *wlc); extern struct wlc_pub *wlc_pub(void *wlc);
/* common functions for every port */ /* common functions for every port */
extern int wlc_bmac_up_prep(struct wlc_hw_info *wlc_hw); extern int wlc_bmac_up_prep(struct wlc_hw_info *wlc_hw);
...@@ -554,13 +554,15 @@ extern void wlc_scb_ratesel_init_all(struct wlc_info *wlc); ...@@ -554,13 +554,15 @@ extern void wlc_scb_ratesel_init_all(struct wlc_info *wlc);
/* ioctl */ /* ioctl */
extern int wlc_iovar_gets8(struct wlc_info *wlc, const char *name, extern int wlc_iovar_gets8(struct wlc_info *wlc, const char *name,
s8 *arg); s8 *arg);
extern int wlc_iovar_check(wlc_pub_t *pub, const bcm_iovar_t *vi, void *arg, extern int wlc_iovar_check(struct wlc_pub *pub, const bcm_iovar_t *vi,
void *arg,
int len, bool set); int len, bool set);
extern int wlc_module_register(wlc_pub_t *pub, const bcm_iovar_t *iovars, extern int wlc_module_register(struct wlc_pub *pub, const bcm_iovar_t *iovars,
const char *name, void *hdl, iovar_fn_t iovar_fn, const char *name, void *hdl, iovar_fn_t iovar_fn,
watchdog_fn_t watchdog_fn, down_fn_t down_fn); watchdog_fn_t watchdog_fn, down_fn_t down_fn);
extern int wlc_module_unregister(wlc_pub_t *pub, const char *name, void *hdl); extern int wlc_module_unregister(struct wlc_pub *pub, const char *name,
void *hdl);
extern void wlc_event_if(struct wlc_info *wlc, struct wlc_bsscfg *cfg, extern void wlc_event_if(struct wlc_info *wlc, struct wlc_bsscfg *cfg,
wlc_event_t *e, const struct ether_addr *addr); wlc_event_t *e, const struct ether_addr *addr);
extern void wlc_suspend_mac_and_wait(struct wlc_info *wlc); extern void wlc_suspend_mac_and_wait(struct wlc_info *wlc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment