Skip to content

Commit

Permalink
brcmfmac: remove brcmf_update_prof() function
Browse files Browse the repository at this point in the history
The function brcmf_update_prof() only add complexity that is not
needed.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Arend van Spriel authored and John W. Linville committed Sep 28, 2012
1 parent 06bb123 commit 6c8c4f7
Showing 1 changed file with 19 additions and 62 deletions.
81 changes: 19 additions & 62 deletions drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,47 +1283,6 @@ static s32 brcmf_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
return err;
}

static s32
brcmf_update_prof(struct brcmf_cfg80211_info *cfg,
const struct brcmf_event_msg *e, void *data, s32 item)
{
s32 err = 0;
struct brcmf_ssid *ssid;

switch (item) {
case WL_PROF_SSID:
ssid = (struct brcmf_ssid *) data;
memset(cfg->profile->ssid.SSID, 0,
sizeof(cfg->profile->ssid.SSID));
memcpy(cfg->profile->ssid.SSID,
ssid->SSID, ssid->SSID_len);
cfg->profile->ssid.SSID_len = ssid->SSID_len;
break;
case WL_PROF_BSSID:
if (data)
memcpy(cfg->profile->bssid, data, ETH_ALEN);
else
memset(cfg->profile->bssid, 0, ETH_ALEN);
break;
case WL_PROF_SEC:
memcpy(&cfg->profile->sec, data,
sizeof(cfg->profile->sec));
break;
case WL_PROF_BEACONINT:
cfg->profile->beacon_interval = *(u16 *)data;
break;
case WL_PROF_DTIMPERIOD:
cfg->profile->dtim_period = *(u8 *)data;
break;
default:
WL_ERR("unsupported item (%d)\n", item);
err = -EOPNOTSUPP;
break;
}

return err;
}

static void brcmf_init_prof(struct brcmf_cfg80211_profile *prof)
{
memset(prof, 0, sizeof(*prof));
Expand Down Expand Up @@ -1379,12 +1338,12 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_ibss_params *params)
{
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
struct brcmf_cfg80211_profile *profile = cfg->profile;
struct brcmf_join_params join_params;
size_t join_params_size = 0;
s32 err = 0;
s32 wsec = 0;
s32 bcnprd;
struct brcmf_ssid ssid;

WL_TRACE("Enter\n");
if (!check_sys_up(wiphy))
Expand Down Expand Up @@ -1460,25 +1419,23 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *ndev,
memset(&join_params, 0, sizeof(struct brcmf_join_params));

/* SSID */
ssid.SSID_len = min_t(u32, params->ssid_len, 32);
memcpy(ssid.SSID, params->ssid, ssid.SSID_len);
memcpy(join_params.ssid_le.SSID, params->ssid, ssid.SSID_len);
join_params.ssid_le.SSID_len = cpu_to_le32(ssid.SSID_len);
profile->ssid.SSID_len = min_t(u32, params->ssid_len, 32);
memcpy(profile->ssid.SSID, params->ssid, profile->ssid.SSID_len);
memcpy(join_params.ssid_le.SSID, params->ssid, profile->ssid.SSID_len);
join_params.ssid_le.SSID_len = cpu_to_le32(profile->ssid.SSID_len);
join_params_size = sizeof(join_params.ssid_le);
brcmf_update_prof(cfg, NULL, &ssid, WL_PROF_SSID);

/* BSSID */
if (params->bssid) {
memcpy(join_params.params_le.bssid, params->bssid, ETH_ALEN);
join_params_size = sizeof(join_params.ssid_le) +
BRCMF_ASSOC_PARAMS_FIXED_SIZE;
memcpy(profile->bssid, params->bssid, ETH_ALEN);
} else {
memcpy(join_params.params_le.bssid, ether_bcast, ETH_ALEN);
memset(profile->bssid, 0, ETH_ALEN);
}

brcmf_update_prof(cfg, NULL,
&join_params.params_le.bssid, WL_PROF_BSSID);

/* Channel */
if (params->channel) {
u32 target_channel;
Expand Down Expand Up @@ -1800,6 +1757,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_connect_params *sme)
{
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
struct brcmf_cfg80211_profile *profile = cfg->profile;
struct ieee80211_channel *chan = sme->channel;
struct brcmf_join_params join_params;
size_t join_params_size;
Expand Down Expand Up @@ -1861,11 +1819,11 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
memset(&join_params, 0, sizeof(join_params));
join_params_size = sizeof(join_params.ssid_le);

ssid.SSID_len = min_t(u32, sizeof(ssid.SSID), (u32)sme->ssid_len);
memcpy(&join_params.ssid_le.SSID, sme->ssid, ssid.SSID_len);
memcpy(&ssid.SSID, sme->ssid, ssid.SSID_len);
join_params.ssid_le.SSID_len = cpu_to_le32(ssid.SSID_len);
brcmf_update_prof(cfg, NULL, &ssid, WL_PROF_SSID);
profile->ssid.SSID_len = min_t(u32,
sizeof(ssid.SSID), (u32)sme->ssid_len);
memcpy(&join_params.ssid_le.SSID, sme->ssid, profile->ssid.SSID_len);
memcpy(&profile->ssid.SSID, sme->ssid, profile->ssid.SSID_len);
join_params.ssid_le.SSID_len = cpu_to_le32(profile->ssid.SSID_len);

memcpy(join_params.params_le.bssid, ether_bcast, ETH_ALEN);

Expand Down Expand Up @@ -2781,8 +2739,8 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg)
dtim_period = (u8)var;
}

brcmf_update_prof(cfg, NULL, &beacon_interval, WL_PROF_BEACONINT);
brcmf_update_prof(cfg, NULL, &dtim_period, WL_PROF_DTIMPERIOD);
profile->beacon_interval = beacon_interval;
profile->dtim_period = dtim_period;

update_bss_info_out:
WL_TRACE("Exit");
Expand Down Expand Up @@ -4656,7 +4614,7 @@ brcmf_bss_roaming_done(struct brcmf_cfg80211_info *cfg,
WL_TRACE("Enter\n");

brcmf_get_assoc_ies(cfg);
brcmf_update_prof(cfg, NULL, &e->addr, WL_PROF_BSSID);
memcpy(profile->bssid, e->addr, ETH_ALEN);
brcmf_update_bss_info(cfg);

brcmf_exec_dcmd(ndev, BRCMF_C_GET_CHANNEL, &channel_le,
Expand Down Expand Up @@ -4697,8 +4655,7 @@ brcmf_bss_connect_done(struct brcmf_cfg80211_info *cfg,
if (test_and_clear_bit(WL_STATUS_CONNECTING, &cfg->status)) {
if (completed) {
brcmf_get_assoc_ies(cfg);
brcmf_update_prof(cfg, NULL, &e->addr,
WL_PROF_BSSID);
memcpy(profile->bssid, e->addr, ETH_ALEN);
brcmf_update_bss_info(cfg);
}
cfg80211_connect_result(ndev,
Expand Down Expand Up @@ -4763,15 +4720,15 @@ brcmf_notify_connect_status(struct brcmf_cfg80211_info *cfg,
struct net_device *ndev,
const struct brcmf_event_msg *e, void *data)
{
struct brcmf_cfg80211_profile *profile = cfg->profile;
s32 err = 0;

if (cfg->conf->mode == WL_MODE_AP) {
err = brcmf_notify_connect_status_ap(cfg, ndev, e, data);
} else if (brcmf_is_linkup(cfg, e)) {
WL_CONN("Linkup\n");
if (brcmf_is_ibssmode(cfg)) {
brcmf_update_prof(cfg, NULL, (void *)e->addr,
WL_PROF_BSSID);
memcpy(profile->bssid, e->addr, ETH_ALEN);
wl_inform_ibss(cfg, ndev, e->addr);
cfg80211_ibss_joined(ndev, e->addr, GFP_KERNEL);
clear_bit(WL_STATUS_CONNECTING, &cfg->status);
Expand Down

0 comments on commit 6c8c4f7

Please sign in to comment.