aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorFranky Lin <frankyl@broadcom.com>2012-10-10 14:13:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-10-15 14:42:54 -0400
commit5dd161ff7b46029c9da4f4ef8b214b8ba4316445 (patch)
treedefea0d72f1fb5162f1f4dc8cfbef4acc8b4676a /drivers/net
parenta180b83bb1f036c587bdb93ac6171b94ff49133c (diff)
brcmfmac: set dongle mode accordingly when interface up
The mode of WiFi dongle should be initialized in brcmf_cfg80211_up which get called when network interface is brought up. Otherwise brcmf_cfg80211_get_station would return error. Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c38
1 files changed, 2 insertions, 36 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 48f08ae9062c..2c66bae77b37 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -5200,41 +5200,6 @@ brcmf_cfg80211_event(struct net_device *ndev,
5200 schedule_work(&cfg->event_work); 5200 schedule_work(&cfg->event_work);
5201} 5201}
5202 5202
5203static s32 brcmf_dongle_mode(struct net_device *ndev, s32 iftype)
5204{
5205 s32 infra = 0;
5206 s32 err = 0;
5207
5208 switch (iftype) {
5209 case NL80211_IFTYPE_MONITOR:
5210 case NL80211_IFTYPE_WDS:
5211 WL_ERR("type (%d) : currently we do not support this mode\n",
5212 iftype);
5213 err = -EINVAL;
5214 return err;
5215 case NL80211_IFTYPE_ADHOC:
5216 infra = 0;
5217 break;
5218 case NL80211_IFTYPE_STATION:
5219 infra = 1;
5220 break;
5221 case NL80211_IFTYPE_AP:
5222 infra = 1;
5223 break;
5224 default:
5225 err = -EINVAL;
5226 WL_ERR("invalid type (%d)\n", iftype);
5227 return err;
5228 }
5229 err = brcmf_exec_dcmd_u32(ndev, BRCMF_C_SET_INFRA, &infra);
5230 if (err) {
5231 WL_ERR("WLC_SET_INFRA error (%d)\n", err);
5232 return err;
5233 }
5234
5235 return 0;
5236}
5237
5238static s32 brcmf_dongle_eventmsg(struct net_device *ndev) 5203static s32 brcmf_dongle_eventmsg(struct net_device *ndev)
5239{ 5204{
5240 /* Room for "event_msgs" + '\0' + bitvec */ 5205 /* Room for "event_msgs" + '\0' + bitvec */
@@ -5453,7 +5418,8 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
5453 WL_BEACON_TIMEOUT); 5418 WL_BEACON_TIMEOUT);
5454 if (err) 5419 if (err)
5455 goto default_conf_out; 5420 goto default_conf_out;
5456 err = brcmf_dongle_mode(ndev, wdev->iftype); 5421 err = brcmf_cfg80211_change_iface(wdev->wiphy, ndev, wdev->iftype,
5422 NULL, NULL);
5457 if (err && err != -EINPROGRESS) 5423 if (err && err != -EINPROGRESS)
5458 goto default_conf_out; 5424 goto default_conf_out;
5459 err = brcmf_dongle_probecap(cfg); 5425 err = brcmf_dongle_probecap(cfg);