mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
wifi: brcm80211: change current_bss to value
Change to a single allocation and remove some boilerplate. Signed-off-by: Rosen Penev <rosenp@gmail.com> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Link: https://patch.msgid.link/20260608052854.11718-1-rosenp@gmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
17126c9333
commit
2fd1926686
|
|
@ -418,21 +418,12 @@ static int brcms_chspec_bw(u16 chanspec)
|
|||
return BRCMS_10_MHZ;
|
||||
}
|
||||
|
||||
static void brcms_c_bsscfg_mfree(struct brcms_bss_cfg *cfg)
|
||||
{
|
||||
if (cfg == NULL)
|
||||
return;
|
||||
|
||||
kfree(cfg->current_bss);
|
||||
kfree(cfg);
|
||||
}
|
||||
|
||||
static void brcms_c_detach_mfree(struct brcms_c_info *wlc)
|
||||
{
|
||||
if (wlc == NULL)
|
||||
return;
|
||||
|
||||
brcms_c_bsscfg_mfree(wlc->bsscfg);
|
||||
kfree(wlc->bsscfg);
|
||||
kfree(wlc->pub);
|
||||
kfree(wlc->modulecb);
|
||||
kfree(wlc->default_bss);
|
||||
|
|
@ -453,25 +444,6 @@ static void brcms_c_detach_mfree(struct brcms_c_info *wlc)
|
|||
kfree(wlc);
|
||||
}
|
||||
|
||||
static struct brcms_bss_cfg *brcms_c_bsscfg_malloc(uint unit)
|
||||
{
|
||||
struct brcms_bss_cfg *cfg;
|
||||
|
||||
cfg = kzalloc_obj(*cfg, GFP_ATOMIC);
|
||||
if (cfg == NULL)
|
||||
goto fail;
|
||||
|
||||
cfg->current_bss = kzalloc_obj(*cfg->current_bss, GFP_ATOMIC);
|
||||
if (cfg->current_bss == NULL)
|
||||
goto fail;
|
||||
|
||||
return cfg;
|
||||
|
||||
fail:
|
||||
brcms_c_bsscfg_mfree(cfg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct brcms_c_info *
|
||||
brcms_c_attach_malloc(uint unit, uint *err, uint devid)
|
||||
{
|
||||
|
|
@ -527,7 +499,7 @@ brcms_c_attach_malloc(uint unit, uint *err, uint devid)
|
|||
goto fail;
|
||||
}
|
||||
|
||||
wlc->bsscfg = brcms_c_bsscfg_malloc(unit);
|
||||
wlc->bsscfg = kzalloc_obj(*wlc->bsscfg, GFP_ATOMIC);
|
||||
if (wlc->bsscfg == NULL) {
|
||||
*err = 1011;
|
||||
goto fail;
|
||||
|
|
@ -3813,7 +3785,7 @@ static void brcms_c_set_home_chanspec(struct brcms_c_info *wlc, u16 chanspec)
|
|||
wlc->home_chanspec = chanspec;
|
||||
|
||||
if (wlc->pub->associated)
|
||||
wlc->bsscfg->current_bss->chanspec = chanspec;
|
||||
wlc->bsscfg->current_bss.chanspec = chanspec;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5423,7 +5395,7 @@ void brcms_c_get_current_rateset(struct brcms_c_info *wlc,
|
|||
struct brcms_c_rateset *rs;
|
||||
|
||||
if (wlc->pub->associated)
|
||||
rs = &wlc->bsscfg->current_bss->rateset;
|
||||
rs = &wlc->bsscfg->current_bss.rateset;
|
||||
else
|
||||
rs = &wlc->default_bss->rateset;
|
||||
|
||||
|
|
@ -5450,7 +5422,7 @@ int brcms_c_set_rateset(struct brcms_c_info *wlc, struct brcm_rateset *rs)
|
|||
if (wlc->pub->_n_enab & SUPPORT_11N) {
|
||||
struct brcms_bss_info *mcsset_bss;
|
||||
if (wlc->pub->associated)
|
||||
mcsset_bss = wlc->bsscfg->current_bss;
|
||||
mcsset_bss = &wlc->bsscfg->current_bss;
|
||||
else
|
||||
mcsset_bss = wlc->default_bss;
|
||||
memcpy(internal_rs.mcs, &mcsset_bss->rateset.mcs[0],
|
||||
|
|
@ -7809,7 +7781,7 @@ void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx)
|
|||
u32 bi;
|
||||
|
||||
/* get beacon period and convert to uS */
|
||||
bi = wlc->bsscfg->current_bss->beacon_period << 10;
|
||||
bi = wlc->bsscfg->current_bss.beacon_period << 10;
|
||||
/*
|
||||
* update since init path would reset
|
||||
* to default value
|
||||
|
|
|
|||
|
|
@ -614,7 +614,7 @@ struct brcms_bss_cfg {
|
|||
u8 SSID_len;
|
||||
u8 SSID[IEEE80211_MAX_SSID_LEN];
|
||||
u8 BSSID[ETH_ALEN];
|
||||
struct brcms_bss_info *current_bss;
|
||||
struct brcms_bss_info current_bss;
|
||||
};
|
||||
|
||||
int brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, struct sk_buff *p);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user