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: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Brett Rudley <brudley@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Arend van Spriel 2011-02-25 16:39:22 +01:00 committed by Greg Kroah-Hartman
parent d6075c9c0c
commit 6cab915077
3 changed files with 43 additions and 46 deletions

View file

@ -37,14 +37,14 @@
#include "wlc_channel.h"
#include "wlc_mac80211.h"
static struct wlc_bsscfg *wlc_bsscfg_malloc(struct osl_info *osh, uint unit);
static void wlc_bsscfg_mfree(struct osl_info *osh, struct wlc_bsscfg *cfg);
static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit,
static struct wlc_bsscfg *wlc_bsscfg_malloc(uint unit);
static void wlc_bsscfg_mfree(struct wlc_bsscfg *cfg);
static struct wlc_pub *wlc_pub_malloc(uint unit,
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);
void *wlc_calloc(struct osl_info *osh, uint unit, uint size)
void *wlc_calloc(uint unit, uint size)
{
void *item;
@ -72,18 +72,17 @@ void wlc_tunables_init(wlc_tunables_t *tunables, uint devid)
tunables->txsbnd = TXSBND;
}
static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit,
uint *err, uint devid)
static struct wlc_pub *wlc_pub_malloc(uint unit, uint *err, uint devid)
{
struct wlc_pub *pub;
pub = wlc_calloc(osh, unit, sizeof(struct wlc_pub));
pub = wlc_calloc(unit, sizeof(struct wlc_pub));
if (pub == NULL) {
*err = 1001;
goto fail;
}
pub->tunables = wlc_calloc(osh, unit,
pub->tunables = wlc_calloc(unit,
sizeof(wlc_tunables_t));
if (pub->tunables == NULL) {
*err = 1028;
@ -93,11 +92,11 @@ static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit,
/* need to init the tunables now */
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)
goto fail;
pub->multicast = (u8 *)wlc_calloc(osh, unit,
pub->multicast = (u8 *)wlc_calloc(unit,
(ETH_ALEN * MAXMULTILIST));
if (pub->multicast == NULL) {
*err = 1003;
@ -107,11 +106,11 @@ static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit,
return pub;
fail:
wlc_pub_mfree(osh, pub);
wlc_pub_mfree(pub);
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)
return;
@ -122,15 +121,15 @@ static void wlc_pub_mfree(struct osl_info *osh, struct wlc_pub *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;
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)
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));
if (cfg->current_bss == NULL)
goto fail;
@ -138,11 +137,11 @@ static wlc_bsscfg_t *wlc_bsscfg_malloc(struct osl_info *osh, uint unit)
return cfg;
fail:
wlc_bsscfg_mfree(osh, cfg);
wlc_bsscfg_mfree(cfg);
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)
return;
@ -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
*/
struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
uint devid)
struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
{
struct wlc_info *wlc;
wlc = (struct wlc_info *) wlc_calloc(osh, unit,
sizeof(struct wlc_info));
wlc = (struct wlc_info *) wlc_calloc(unit, sizeof(struct wlc_info));
if (wlc == NULL) {
*err = 1002;
goto fail;
@ -185,7 +182,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
wlc->hwrxoff = WL_HWRXOFF;
/* 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) {
*err = 1003;
goto fail;
@ -194,15 +191,15 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
/* allocate struct wlc_hw_info state structure */
wlc->hw = (struct wlc_hw_info *)wlc_calloc(osh, unit,
sizeof(struct wlc_hw_info));
wlc->hw = (struct wlc_hw_info *)wlc_calloc(unit,
sizeof(struct wlc_hw_info));
if (wlc->hw == NULL) {
*err = 1005;
goto fail;
}
wlc->hw->wlc = wlc;
wlc->hw->bandstate[0] = wlc_calloc(osh, unit,
wlc->hw->bandstate[0] = wlc_calloc(unit,
(sizeof(struct wlc_hwband) * MAXBANDS));
if (wlc->hw->bandstate[0] == NULL) {
*err = 1006;
@ -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);
if (wlc->modulecb == NULL) {
*err = 1009;
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));
if (wlc->default_bss == NULL) {
*err = 1010;
goto fail;
}
wlc->cfg = wlc_bsscfg_malloc(osh, unit);
wlc->cfg = wlc_bsscfg_malloc(unit);
if (wlc->cfg == NULL) {
*err = 1011;
goto fail;
}
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)));
if (wlc->pkt_callback == NULL) {
*err = 1013;
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));
if (wlc->wsec_def_keys[0] == NULL) {
*err = 1015;
@ -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));
if (wlc->protection == NULL) {
*err = 1016;
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) {
*err = 1017;
goto fail;
}
wlc->bandstate[0] = (struct wlcband *)wlc_calloc(osh, unit,
wlc->bandstate[0] = (struct wlcband *)wlc_calloc(unit,
(sizeof(struct wlcband)*MAXBANDS));
if (wlc->bandstate[0] == NULL) {
*err = 1025;
@ -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));
if (wlc->corestate == NULL) {
*err = 1026;
@ -295,7 +292,7 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
}
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) {
*err = 1027;
goto fail;
@ -304,11 +301,11 @@ struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
return wlc;
fail:
wlc_detach_mfree(wlc, osh);
wlc_detach_mfree(wlc);
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)
return;
@ -349,7 +346,8 @@ void wlc_detach_mfree(struct wlc_info *wlc, struct osl_info *osh)
if (wlc->corestate) {
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);
wlc->corestate = NULL;

View file

@ -14,8 +14,7 @@
* 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,
uint *err, uint devid);
extern void wlc_detach_mfree(struct wlc_info *wlc, struct osl_info *osh);
extern struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid);
extern void wlc_detach_mfree(struct wlc_info *wlc);

View file

@ -1770,7 +1770,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
&& 4 == WLC_NUMRXIVS));
/* 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)
goto fail;
wlc->osh = osh;
@ -2194,7 +2194,7 @@ uint wlc_detach(struct wlc_info *wlc)
for (i = 0; i < WLC_MAXMODULES; i++)
ASSERT(wlc->modulecb[i].name[0] == '\0');
wlc_detach_mfree(wlc, wlc->osh);
wlc_detach_mfree(wlc);
return callbacks;
}
@ -8450,7 +8450,7 @@ static struct wlc_txq_info *wlc_txq_alloc(struct wlc_info *wlc,
{
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) {
/*
* Have enough room for control packets along with HI watermark