|
@@ -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;
|