diff options
author | Tony Lindgren <tony@atomide.com> | 2012-11-13 16:25:38 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-11-13 16:25:38 -0500 |
commit | 89ab216b33ba9405880fd3d89531305a931bc70f (patch) | |
tree | 8f6428ce51ecaed6f6e1379c036dbe341eb71e34 /drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |
parent | c9d501e5cb0238910337213e12a09127221c35d8 (diff) | |
parent | 46bf4a562207c5ebd24e1dde5e5ee326cd3d6b91 (diff) |
Merge branch 'omap-for-v3.8/pm' into omap-for-v3.8/clock
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 70 |
1 files changed, 25 insertions, 45 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index c1abaa6db59e..a6f1e8166008 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -3569,7 +3569,7 @@ brcmf_cfg80211_sched_scan_start(struct wiphy *wiphy, | |||
3569 | 3569 | ||
3570 | if (!request || !request->n_ssids || !request->n_match_sets) { | 3570 | if (!request || !request->n_ssids || !request->n_match_sets) { |
3571 | WL_ERR("Invalid sched scan req!! n_ssids:%d\n", | 3571 | WL_ERR("Invalid sched scan req!! n_ssids:%d\n", |
3572 | request->n_ssids); | 3572 | request ? request->n_ssids : 0); |
3573 | return -EINVAL; | 3573 | return -EINVAL; |
3574 | } | 3574 | } |
3575 | 3575 | ||
@@ -3972,7 +3972,7 @@ brcmf_set_management_ie(struct brcmf_cfg80211_info *cfg, | |||
3972 | u8 *iovar_ie_buf; | 3972 | u8 *iovar_ie_buf; |
3973 | u8 *curr_ie_buf; | 3973 | u8 *curr_ie_buf; |
3974 | u8 *mgmt_ie_buf = NULL; | 3974 | u8 *mgmt_ie_buf = NULL; |
3975 | u32 mgmt_ie_buf_len = 0; | 3975 | int mgmt_ie_buf_len; |
3976 | u32 *mgmt_ie_len = 0; | 3976 | u32 *mgmt_ie_len = 0; |
3977 | u32 del_add_ie_buf_len = 0; | 3977 | u32 del_add_ie_buf_len = 0; |
3978 | u32 total_ie_buf_len = 0; | 3978 | u32 total_ie_buf_len = 0; |
@@ -3982,7 +3982,7 @@ brcmf_set_management_ie(struct brcmf_cfg80211_info *cfg, | |||
3982 | struct parsed_vndr_ie_info *vndrie_info; | 3982 | struct parsed_vndr_ie_info *vndrie_info; |
3983 | s32 i; | 3983 | s32 i; |
3984 | u8 *ptr; | 3984 | u8 *ptr; |
3985 | u32 remained_buf_len; | 3985 | int remained_buf_len; |
3986 | 3986 | ||
3987 | WL_TRACE("bssidx %d, pktflag : 0x%02X\n", bssidx, pktflag); | 3987 | WL_TRACE("bssidx %d, pktflag : 0x%02X\n", bssidx, pktflag); |
3988 | iovar_ie_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL); | 3988 | iovar_ie_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL); |
@@ -4606,12 +4606,13 @@ brcmf_bss_roaming_done(struct brcmf_cfg80211_info *cfg, | |||
4606 | struct brcmf_cfg80211_profile *profile = cfg->profile; | 4606 | struct brcmf_cfg80211_profile *profile = cfg->profile; |
4607 | struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg); | 4607 | struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg); |
4608 | struct wiphy *wiphy = cfg_to_wiphy(cfg); | 4608 | struct wiphy *wiphy = cfg_to_wiphy(cfg); |
4609 | struct brcmf_channel_info_le channel_le; | 4609 | struct ieee80211_channel *notify_channel = NULL; |
4610 | struct ieee80211_channel *notify_channel; | ||
4611 | struct ieee80211_supported_band *band; | 4610 | struct ieee80211_supported_band *band; |
4611 | struct brcmf_bss_info_le *bi; | ||
4612 | u32 freq; | 4612 | u32 freq; |
4613 | s32 err = 0; | 4613 | s32 err = 0; |
4614 | u32 target_channel; | 4614 | u32 target_channel; |
4615 | u8 *buf; | ||
4615 | 4616 | ||
4616 | WL_TRACE("Enter\n"); | 4617 | WL_TRACE("Enter\n"); |
4617 | 4618 | ||
@@ -4619,11 +4620,22 @@ brcmf_bss_roaming_done(struct brcmf_cfg80211_info *cfg, | |||
4619 | memcpy(profile->bssid, e->addr, ETH_ALEN); | 4620 | memcpy(profile->bssid, e->addr, ETH_ALEN); |
4620 | brcmf_update_bss_info(cfg); | 4621 | brcmf_update_bss_info(cfg); |
4621 | 4622 | ||
4622 | brcmf_exec_dcmd(ndev, BRCMF_C_GET_CHANNEL, &channel_le, | 4623 | buf = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL); |
4623 | sizeof(channel_le)); | 4624 | if (buf == NULL) { |
4625 | err = -ENOMEM; | ||
4626 | goto done; | ||
4627 | } | ||
4628 | |||
4629 | /* data sent to dongle has to be little endian */ | ||
4630 | *(__le32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX); | ||
4631 | err = brcmf_exec_dcmd(ndev, BRCMF_C_GET_BSS_INFO, buf, WL_BSS_INFO_MAX); | ||
4632 | |||
4633 | if (err) | ||
4634 | goto done; | ||
4624 | 4635 | ||
4625 | target_channel = le32_to_cpu(channel_le.target_channel); | 4636 | bi = (struct brcmf_bss_info_le *)(buf + 4); |
4626 | WL_CONN("Roamed to channel %d\n", target_channel); | 4637 | target_channel = bi->ctl_ch ? bi->ctl_ch : |
4638 | CHSPEC_CHANNEL(le16_to_cpu(bi->chanspec)); | ||
4627 | 4639 | ||
4628 | if (target_channel <= CH_MAX_2G_CHANNEL) | 4640 | if (target_channel <= CH_MAX_2G_CHANNEL) |
4629 | band = wiphy->bands[IEEE80211_BAND_2GHZ]; | 4641 | band = wiphy->bands[IEEE80211_BAND_2GHZ]; |
@@ -4633,6 +4645,8 @@ brcmf_bss_roaming_done(struct brcmf_cfg80211_info *cfg, | |||
4633 | freq = ieee80211_channel_to_frequency(target_channel, band->band); | 4645 | freq = ieee80211_channel_to_frequency(target_channel, band->band); |
4634 | notify_channel = ieee80211_get_channel(wiphy, freq); | 4646 | notify_channel = ieee80211_get_channel(wiphy, freq); |
4635 | 4647 | ||
4648 | done: | ||
4649 | kfree(buf); | ||
4636 | cfg80211_roamed(ndev, notify_channel, (u8 *)profile->bssid, | 4650 | cfg80211_roamed(ndev, notify_channel, (u8 *)profile->bssid, |
4637 | conn_info->req_ie, conn_info->req_ie_len, | 4651 | conn_info->req_ie, conn_info->req_ie_len, |
4638 | conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL); | 4652 | conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL); |
@@ -5186,41 +5200,6 @@ brcmf_cfg80211_event(struct net_device *ndev, | |||
5186 | schedule_work(&cfg->event_work); | 5200 | schedule_work(&cfg->event_work); |
5187 | } | 5201 | } |
5188 | 5202 | ||
5189 | static s32 brcmf_dongle_mode(struct net_device *ndev, s32 iftype) | ||
5190 | { | ||
5191 | s32 infra = 0; | ||
5192 | s32 err = 0; | ||
5193 | |||
5194 | switch (iftype) { | ||
5195 | case NL80211_IFTYPE_MONITOR: | ||
5196 | case NL80211_IFTYPE_WDS: | ||
5197 | WL_ERR("type (%d) : currently we do not support this mode\n", | ||
5198 | iftype); | ||
5199 | err = -EINVAL; | ||
5200 | return err; | ||
5201 | case NL80211_IFTYPE_ADHOC: | ||
5202 | infra = 0; | ||
5203 | break; | ||
5204 | case NL80211_IFTYPE_STATION: | ||
5205 | infra = 1; | ||
5206 | break; | ||
5207 | case NL80211_IFTYPE_AP: | ||
5208 | infra = 1; | ||
5209 | break; | ||
5210 | default: | ||
5211 | err = -EINVAL; | ||
5212 | WL_ERR("invalid type (%d)\n", iftype); | ||
5213 | return err; | ||
5214 | } | ||
5215 | err = brcmf_exec_dcmd_u32(ndev, BRCMF_C_SET_INFRA, &infra); | ||
5216 | if (err) { | ||
5217 | WL_ERR("WLC_SET_INFRA error (%d)\n", err); | ||
5218 | return err; | ||
5219 | } | ||
5220 | |||
5221 | return 0; | ||
5222 | } | ||
5223 | |||
5224 | static s32 brcmf_dongle_eventmsg(struct net_device *ndev) | 5203 | static s32 brcmf_dongle_eventmsg(struct net_device *ndev) |
5225 | { | 5204 | { |
5226 | /* Room for "event_msgs" + '\0' + bitvec */ | 5205 | /* Room for "event_msgs" + '\0' + bitvec */ |
@@ -5439,7 +5418,8 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) | |||
5439 | WL_BEACON_TIMEOUT); | 5418 | WL_BEACON_TIMEOUT); |
5440 | if (err) | 5419 | if (err) |
5441 | goto default_conf_out; | 5420 | goto default_conf_out; |
5442 | err = brcmf_dongle_mode(ndev, wdev->iftype); | 5421 | err = brcmf_cfg80211_change_iface(wdev->wiphy, ndev, wdev->iftype, |
5422 | NULL, NULL); | ||
5443 | if (err && err != -EINPROGRESS) | 5423 | if (err && err != -EINPROGRESS) |
5444 | goto default_conf_out; | 5424 | goto default_conf_out; |
5445 | err = brcmf_dongle_probecap(cfg); | 5425 | err = brcmf_dongle_probecap(cfg); |