Commit 6cab9150 authored by Arend van Spriel's avatar Arend van Spriel Committed by Greg Kroah-Hartman

staging: brcm80211: remove struct osl_info parameter from wlc_alloc

The functions within wlc_alloc had parameter of struct osl_info type
but it was never used. As part of osl concept removal this parameter
has been removed from the function prototypes.
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Reviewed-by: default avatarBrett Rudley <brudley@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d6075c9c
...@@ -37,14 +37,14 @@ ...@@ -37,14 +37,14 @@
#include "wlc_channel.h" #include "wlc_channel.h"
#include "wlc_mac80211.h" #include "wlc_mac80211.h"
static struct wlc_bsscfg *wlc_bsscfg_malloc(struct osl_info *osh, uint unit); static struct wlc_bsscfg *wlc_bsscfg_malloc(uint unit);
static void wlc_bsscfg_mfree(struct osl_info *osh, struct wlc_bsscfg *cfg); static void wlc_bsscfg_mfree(struct wlc_bsscfg *cfg);
static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit, static struct wlc_pub *wlc_pub_malloc(uint unit,
uint *err, uint devid); uint *err, uint devid);
static void wlc_pub_mfree(struct osl_info *osh, struct wlc_pub *pub); static void wlc_pub_mfree(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(uint unit, uint size)
{ {
void *item; void *item;
...@@ -72,18 +72,17 @@ void wlc_tunables_init(wlc_tunables_t *tunables, uint devid) ...@@ -72,18 +72,17 @@ void wlc_tunables_init(wlc_tunables_t *tunables, uint devid)
tunables->txsbnd = TXSBND; tunables->txsbnd = TXSBND;
} }
static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit, static struct wlc_pub *wlc_pub_malloc(uint unit, uint *err, uint devid)
uint *err, uint devid)
{ {
struct wlc_pub *pub; struct wlc_pub *pub;
pub = wlc_calloc(osh, unit, sizeof(struct wlc_pub)); pub = wlc_calloc(unit, sizeof(struct wlc_pub));
if (pub == NULL) { if (pub == NULL) {
*err = 1001; *err = 1001;
goto fail; goto fail;
} }
pub->tunables = wlc_calloc(osh, unit, pub->tunables = wlc_calloc(unit,
sizeof(wlc_tunables_t)); sizeof(wlc_tunables_t));
if (pub->tunables == NULL) { if (pub->tunables == NULL) {
*err = 1028; *err = 1028;
...@@ -93,11 +92,11 @@ static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit, ...@@ -93,11 +92,11 @@ static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit,
/* need to init the tunables now */ /* need to init the tunables now */
wlc_tunables_init(pub->tunables, devid); wlc_tunables_init(pub->tunables, devid);
pub->_cnt = wlc_calloc(osh, unit, sizeof(struct wl_cnt)); pub->_cnt = wlc_calloc(unit, sizeof(struct wl_cnt));
if (pub->_cnt == NULL) if (pub->_cnt == NULL)
goto fail; goto fail;
pub->multicast = (u8 *)wlc_calloc(osh, unit, pub->multicast = (u8 *)wlc_calloc(unit,
(ETH_ALEN * MAXMULTILIST)); (ETH_ALEN * MAXMULTILIST));
if (pub->multicast == NULL) { if (pub->multicast == NULL) {
*err = 1003; *err = 1003;
...@@ -107,11 +106,11 @@ static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit, ...@@ -107,11 +106,11 @@ static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit,
return pub; return pub;
fail: fail:
wlc_pub_mfree(osh, pub); wlc_pub_mfree(pub);
return NULL; return NULL;
} }
static void wlc_pub_mfree(struct osl_info *osh, struct wlc_pub *pub) static void wlc_pub_mfree(struct wlc_pub *pub)
{ {
if (pub == NULL) if (pub == NULL)
return; return;
...@@ -122,15 +121,15 @@ static void wlc_pub_mfree(struct osl_info *osh, struct wlc_pub *pub) ...@@ -122,15 +121,15 @@ static void wlc_pub_mfree(struct osl_info *osh, struct wlc_pub *pub)
kfree(pub); kfree(pub);
} }
static wlc_bsscfg_t *wlc_bsscfg_malloc(struct osl_info *osh, uint unit) static wlc_bsscfg_t *wlc_bsscfg_malloc(uint unit)
{ {
wlc_bsscfg_t *cfg; wlc_bsscfg_t *cfg;
cfg = (wlc_bsscfg_t *) wlc_calloc(osh, unit, sizeof(wlc_bsscfg_t)); cfg = (wlc_bsscfg_t *) wlc_calloc(unit, sizeof(wlc_bsscfg_t));
if (cfg == NULL) if (cfg == NULL)
goto fail; goto fail;
cfg->current_bss = (wlc_bss_info_t *)wlc_calloc(osh, unit, cfg->current_bss = (wlc_bss_info_t *)wlc_calloc(unit,
sizeof(wlc_bss_info_t)); sizeof(wlc_bss_info_t));
if (cfg->current_bss == NULL) if (cfg->current_bss == NULL)
goto fail; goto fail;
...@@ -138,11 +137,11 @@ static wlc_bsscfg_t *wlc_bsscfg_malloc(struct osl_info *osh, uint unit) ...@@ -138,11 +137,11 @@ static wlc_bsscfg_t *wlc_bsscfg_malloc(struct osl_info *osh, uint unit)
return cfg; return cfg;
fail: fail:
wlc_bsscfg_mfree(osh, cfg); wlc_bsscfg_mfree(cfg);
return NULL; return NULL;
} }
static void wlc_bsscfg_mfree(struct osl_info *osh, wlc_bsscfg_t *cfg) static void wlc_bsscfg_mfree(wlc_bsscfg_t *cfg)
{ {
if (cfg == NULL) if (cfg == NULL)
return; return;
...@@ -170,13 +169,11 @@ void wlc_bsscfg_ID_assign(struct wlc_info *wlc, wlc_bsscfg_t *bsscfg) ...@@ -170,13 +169,11 @@ void wlc_bsscfg_ID_assign(struct wlc_info *wlc, wlc_bsscfg_t *bsscfg)
/* /*
* The common driver entry routine. Error codes should be unique * The common driver entry routine. Error codes should be unique
*/ */
struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err, struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
uint devid)
{ {
struct wlc_info *wlc; struct wlc_info *wlc;
wlc = (struct wlc_info *) wlc_calloc(osh, unit, wlc = (struct wlc_info *) wlc_calloc(unit, sizeof(struct wlc_info));
sizeof(struct wlc_info));
if (wlc == NULL) { if (wlc == NULL) {
*err = 1002; *err = 1002;
goto fail; goto fail;
...@@ -185,7 +182,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err, ...@@ -185,7 +182,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
wlc->hwrxoff = WL_HWRXOFF; wlc->hwrxoff = WL_HWRXOFF;
/* allocate struct wlc_pub state structure */ /* allocate struct wlc_pub state structure */
wlc->pub = wlc_pub_malloc(osh, unit, err, devid); wlc->pub = wlc_pub_malloc(unit, err, devid);
if (wlc->pub == NULL) { if (wlc->pub == NULL) {
*err = 1003; *err = 1003;
goto fail; goto fail;
...@@ -194,7 +191,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err, ...@@ -194,7 +191,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
/* allocate struct wlc_hw_info state structure */ /* allocate struct wlc_hw_info state structure */
wlc->hw = (struct wlc_hw_info *)wlc_calloc(osh, unit, wlc->hw = (struct wlc_hw_info *)wlc_calloc(unit,
sizeof(struct wlc_hw_info)); sizeof(struct wlc_hw_info));
if (wlc->hw == NULL) { if (wlc->hw == NULL) {
*err = 1005; *err = 1005;
...@@ -202,7 +199,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err, ...@@ -202,7 +199,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
} }
wlc->hw->wlc = wlc; wlc->hw->wlc = wlc;
wlc->hw->bandstate[0] = wlc_calloc(osh, unit, wlc->hw->bandstate[0] = wlc_calloc(unit,
(sizeof(struct wlc_hwband) * MAXBANDS)); (sizeof(struct wlc_hwband) * MAXBANDS));
if (wlc->hw->bandstate[0] == NULL) { if (wlc->hw->bandstate[0] == NULL) {
*err = 1006; *err = 1006;
...@@ -217,35 +214,35 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err, ...@@ -217,35 +214,35 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
} }
} }
wlc->modulecb = wlc_calloc(osh, unit, wlc->modulecb = wlc_calloc(unit,
sizeof(struct modulecb) * WLC_MAXMODULES); sizeof(struct modulecb) * WLC_MAXMODULES);
if (wlc->modulecb == NULL) { if (wlc->modulecb == NULL) {
*err = 1009; *err = 1009;
goto fail; goto fail;
} }
wlc->default_bss = (wlc_bss_info_t *)wlc_calloc(osh, unit, wlc->default_bss = (wlc_bss_info_t *)wlc_calloc(unit,
sizeof(wlc_bss_info_t)); sizeof(wlc_bss_info_t));
if (wlc->default_bss == NULL) { if (wlc->default_bss == NULL) {
*err = 1010; *err = 1010;
goto fail; goto fail;
} }
wlc->cfg = wlc_bsscfg_malloc(osh, unit); wlc->cfg = wlc_bsscfg_malloc(unit);
if (wlc->cfg == NULL) { if (wlc->cfg == NULL) {
*err = 1011; *err = 1011;
goto fail; goto fail;
} }
wlc_bsscfg_ID_assign(wlc, wlc->cfg); wlc_bsscfg_ID_assign(wlc, wlc->cfg);
wlc->pkt_callback = wlc_calloc(osh, unit, wlc->pkt_callback = wlc_calloc(unit,
(sizeof(struct pkt_cb) * (wlc->pub->tunables->maxpktcb + 1))); (sizeof(struct pkt_cb) * (wlc->pub->tunables->maxpktcb + 1)));
if (wlc->pkt_callback == NULL) { if (wlc->pkt_callback == NULL) {
*err = 1013; *err = 1013;
goto fail; goto fail;
} }
wlc->wsec_def_keys[0] = (wsec_key_t *)wlc_calloc(osh, unit, wlc->wsec_def_keys[0] = (wsec_key_t *)wlc_calloc(unit,
(sizeof(wsec_key_t) * WLC_DEFAULT_KEYS)); (sizeof(wsec_key_t) * WLC_DEFAULT_KEYS));
if (wlc->wsec_def_keys[0] == NULL) { if (wlc->wsec_def_keys[0] == NULL) {
*err = 1015; *err = 1015;
...@@ -259,20 +256,20 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err, ...@@ -259,20 +256,20 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
} }
} }
wlc->protection = wlc_calloc(osh, unit, wlc->protection = wlc_calloc(unit,
sizeof(struct wlc_protection)); sizeof(struct wlc_protection));
if (wlc->protection == NULL) { if (wlc->protection == NULL) {
*err = 1016; *err = 1016;
goto fail; goto fail;
} }
wlc->stf = wlc_calloc(osh, unit, sizeof(struct wlc_stf)); wlc->stf = wlc_calloc(unit, sizeof(struct wlc_stf));
if (wlc->stf == NULL) { if (wlc->stf == NULL) {
*err = 1017; *err = 1017;
goto fail; goto fail;
} }
wlc->bandstate[0] = (struct wlcband *)wlc_calloc(osh, unit, wlc->bandstate[0] = (struct wlcband *)wlc_calloc(unit,
(sizeof(struct wlcband)*MAXBANDS)); (sizeof(struct wlcband)*MAXBANDS));
if (wlc->bandstate[0] == NULL) { if (wlc->bandstate[0] == NULL) {
*err = 1025; *err = 1025;
...@@ -287,7 +284,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err, ...@@ -287,7 +284,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
} }
} }
wlc->corestate = (struct wlccore *)wlc_calloc(osh, unit, wlc->corestate = (struct wlccore *)wlc_calloc(unit,
sizeof(struct wlccore)); sizeof(struct wlccore));
if (wlc->corestate == NULL) { if (wlc->corestate == NULL) {
*err = 1026; *err = 1026;
...@@ -295,7 +292,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err, ...@@ -295,7 +292,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
} }
wlc->corestate->macstat_snapshot = wlc->corestate->macstat_snapshot =
(macstat_t *)wlc_calloc(osh, unit, sizeof(macstat_t)); (macstat_t *)wlc_calloc(unit, sizeof(macstat_t));
if (wlc->corestate->macstat_snapshot == NULL) { if (wlc->corestate->macstat_snapshot == NULL) {
*err = 1027; *err = 1027;
goto fail; goto fail;
...@@ -304,11 +301,11 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err, ...@@ -304,11 +301,11 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
return wlc; return wlc;
fail: fail:
wlc_detach_mfree(wlc, osh); wlc_detach_mfree(wlc);
return NULL; return NULL;
} }
void wlc_detach_mfree(struct wlc_info *wlc, struct osl_info *osh) void wlc_detach_mfree(struct wlc_info *wlc)
{ {
if (wlc == NULL) if (wlc == NULL)
return; return;
...@@ -349,7 +346,8 @@ void wlc_detach_mfree(struct wlc_info *wlc, struct osl_info *osh) ...@@ -349,7 +346,8 @@ void wlc_detach_mfree(struct wlc_info *wlc, struct osl_info *osh)
if (wlc->corestate) { if (wlc->corestate) {
if (wlc->corestate->macstat_snapshot) { if (wlc->corestate->macstat_snapshot) {
kfree(wlc->corestate->macstat_snapshot); wlc->corestate->macstat_snapshot = NULL; kfree(wlc->corestate->macstat_snapshot);
wlc->corestate->macstat_snapshot = NULL;
} }
kfree(wlc->corestate); kfree(wlc->corestate);
wlc->corestate = NULL; wlc->corestate = NULL;
......
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
extern void *wlc_calloc(struct osl_info *osh, uint unit, uint size); extern void *wlc_calloc(uint unit, uint size);
extern struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, extern struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid);
uint *err, uint devid); extern void wlc_detach_mfree(struct wlc_info *wlc);
extern void wlc_detach_mfree(struct wlc_info *wlc, struct osl_info *osh);
...@@ -1770,7 +1770,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode, ...@@ -1770,7 +1770,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
&& 4 == WLC_NUMRXIVS)); && 4 == WLC_NUMRXIVS));
/* allocate struct wlc_info state and its substructures */ /* allocate struct wlc_info state and its substructures */
wlc = (struct wlc_info *) wlc_attach_malloc(osh, unit, &err, device); wlc = (struct wlc_info *) wlc_attach_malloc(unit, &err, device);
if (wlc == NULL) if (wlc == NULL)
goto fail; goto fail;
wlc->osh = osh; wlc->osh = osh;
...@@ -2194,7 +2194,7 @@ uint wlc_detach(struct wlc_info *wlc) ...@@ -2194,7 +2194,7 @@ uint wlc_detach(struct wlc_info *wlc)
for (i = 0; i < WLC_MAXMODULES; i++) for (i = 0; i < WLC_MAXMODULES; i++)
ASSERT(wlc->modulecb[i].name[0] == '\0'); ASSERT(wlc->modulecb[i].name[0] == '\0');
wlc_detach_mfree(wlc, wlc->osh); wlc_detach_mfree(wlc);
return callbacks; return callbacks;
} }
...@@ -8450,7 +8450,7 @@ static struct wlc_txq_info *wlc_txq_alloc(struct wlc_info *wlc, ...@@ -8450,7 +8450,7 @@ static struct wlc_txq_info *wlc_txq_alloc(struct wlc_info *wlc,
{ {
struct wlc_txq_info *qi, *p; struct wlc_txq_info *qi, *p;
qi = wlc_calloc(osh, wlc->pub->unit, sizeof(struct wlc_txq_info)); qi = wlc_calloc(wlc->pub->unit, sizeof(struct wlc_txq_info));
if (qi != NULL) { if (qi != NULL) {
/* /*
* Have enough room for control packets along with HI watermark * Have enough room for control packets along with HI watermark
......
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