diff options
author | Hante Meuleman <meuleman@broadcom.com> | 2013-01-02 09:22:51 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-01-07 15:16:58 -0500 |
commit | 40a23296854dded596fda33e0df4a7373229d75e (patch) | |
tree | 0de86c5d450f4b07d3ad593b209c193ba5f758df /drivers/net/wireless | |
parent | 88d1239a1b9713cd505314fe9a1031c775b3eb3c (diff) |
brcmfmac: Update init code routines from interface up.
On interface up dongle gets inialized. Move UP command to common
routine and update these common init routines using ifp.
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 30 |
2 files changed, 15 insertions, 24 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index d655501305b0..e3326a58bdb1 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | |||
@@ -585,14 +585,9 @@ static int brcmf_netdev_open(struct net_device *ndev) | |||
585 | /* Get current TOE mode from dongle */ | 585 | /* Get current TOE mode from dongle */ |
586 | if (brcmf_fil_iovar_int_get(ifp, "toe_ol", &toe_ol) >= 0 | 586 | if (brcmf_fil_iovar_int_get(ifp, "toe_ol", &toe_ol) >= 0 |
587 | && (toe_ol & TOE_TX_CSUM_OL) != 0) | 587 | && (toe_ol & TOE_TX_CSUM_OL) != 0) |
588 | drvr->iflist[ifp->idx]->ndev->features |= | 588 | ndev->features |= NETIF_F_IP_CSUM; |
589 | NETIF_F_IP_CSUM; | ||
590 | else | 589 | else |
591 | drvr->iflist[ifp->idx]->ndev->features &= | 590 | ndev->features &= ~NETIF_F_IP_CSUM; |
592 | ~NETIF_F_IP_CSUM; | ||
593 | |||
594 | /* make sure RF is ready for work */ | ||
595 | brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 0); | ||
596 | 591 | ||
597 | /* Allow transmit calls */ | 592 | /* Allow transmit calls */ |
598 | netif_start_queue(ndev); | 593 | netif_start_queue(ndev); |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index 1ec2d573abc2..730da84edb01 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -4265,9 +4265,8 @@ void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg) | |||
4265 | } | 4265 | } |
4266 | 4266 | ||
4267 | static s32 | 4267 | static s32 |
4268 | brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout) | 4268 | brcmf_dongle_roam(struct brcmf_if *ifp, u32 roamvar, u32 bcn_timeout) |
4269 | { | 4269 | { |
4270 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
4271 | s32 err = 0; | 4270 | s32 err = 0; |
4272 | __le32 roamtrigger[2]; | 4271 | __le32 roamtrigger[2]; |
4273 | __le32 roam_delta[2]; | 4272 | __le32 roam_delta[2]; |
@@ -4318,10 +4317,9 @@ dongle_rom_out: | |||
4318 | } | 4317 | } |
4319 | 4318 | ||
4320 | static s32 | 4319 | static s32 |
4321 | brcmf_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time, | 4320 | brcmf_dongle_scantime(struct brcmf_if *ifp, s32 scan_assoc_time, |
4322 | s32 scan_unassoc_time, s32 scan_passive_time) | 4321 | s32 scan_unassoc_time, s32 scan_passive_time) |
4323 | { | 4322 | { |
4324 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
4325 | s32 err = 0; | 4323 | s32 err = 0; |
4326 | 4324 | ||
4327 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME, | 4325 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME, |
@@ -4391,6 +4389,7 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) | |||
4391 | { | 4389 | { |
4392 | struct net_device *ndev; | 4390 | struct net_device *ndev; |
4393 | struct wireless_dev *wdev; | 4391 | struct wireless_dev *wdev; |
4392 | struct brcmf_if *ifp; | ||
4394 | s32 power_mode; | 4393 | s32 power_mode; |
4395 | s32 err = 0; | 4394 | s32 err = 0; |
4396 | 4395 | ||
@@ -4399,35 +4398,34 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) | |||
4399 | 4398 | ||
4400 | ndev = cfg_to_ndev(cfg); | 4399 | ndev = cfg_to_ndev(cfg); |
4401 | wdev = ndev->ieee80211_ptr; | 4400 | wdev = ndev->ieee80211_ptr; |
4401 | ifp = netdev_priv(ndev); | ||
4402 | |||
4403 | /* make sure RF is ready for work */ | ||
4404 | brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 0); | ||
4402 | 4405 | ||
4403 | brcmf_dongle_scantime(ndev, WL_SCAN_CHANNEL_TIME, | 4406 | brcmf_dongle_scantime(ifp, WL_SCAN_CHANNEL_TIME, |
4404 | WL_SCAN_UNASSOC_TIME, WL_SCAN_PASSIVE_TIME); | 4407 | WL_SCAN_UNASSOC_TIME, WL_SCAN_PASSIVE_TIME); |
4405 | 4408 | ||
4406 | power_mode = cfg->pwr_save ? PM_FAST : PM_OFF; | 4409 | power_mode = cfg->pwr_save ? PM_FAST : PM_OFF; |
4407 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), BRCMF_C_SET_PM, | 4410 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, power_mode); |
4408 | power_mode); | ||
4409 | if (err) | 4411 | if (err) |
4410 | goto default_conf_out; | 4412 | goto default_conf_out; |
4411 | brcmf_dbg(INFO, "power save set to %s\n", | 4413 | brcmf_dbg(INFO, "power save set to %s\n", |
4412 | (power_mode ? "enabled" : "disabled")); | 4414 | (power_mode ? "enabled" : "disabled")); |
4413 | 4415 | ||
4414 | err = brcmf_dongle_roam(ndev, (cfg->roam_on ? 0 : 1), | 4416 | err = brcmf_dongle_roam(ifp, (cfg->roam_on ? 0 : 1), WL_BEACON_TIMEOUT); |
4415 | WL_BEACON_TIMEOUT); | ||
4416 | if (err) | 4417 | if (err) |
4417 | goto default_conf_out; | 4418 | goto default_conf_out; |
4418 | err = brcmf_cfg80211_change_iface(wdev->wiphy, ndev, wdev->iftype, | 4419 | err = brcmf_cfg80211_change_iface(wdev->wiphy, ndev, wdev->iftype, |
4419 | NULL, NULL); | 4420 | NULL, NULL); |
4420 | if (err && err != -EINPROGRESS) | 4421 | if (err) |
4421 | goto default_conf_out; | 4422 | goto default_conf_out; |
4422 | err = brcmf_dongle_probecap(cfg); | 4423 | err = brcmf_dongle_probecap(cfg); |
4423 | if (err) | 4424 | if (err) |
4424 | goto default_conf_out; | 4425 | goto default_conf_out; |
4425 | 4426 | ||
4426 | /* -EINPROGRESS: Call commit handler */ | ||
4427 | |||
4428 | default_conf_out: | ||
4429 | |||
4430 | cfg->dongle_up = true; | 4427 | cfg->dongle_up = true; |
4428 | default_conf_out: | ||
4431 | 4429 | ||
4432 | return err; | 4430 | return err; |
4433 | 4431 | ||
@@ -4436,8 +4434,6 @@ default_conf_out: | |||
4436 | static s32 __brcmf_cfg80211_up(struct brcmf_if *ifp) | 4434 | static s32 __brcmf_cfg80211_up(struct brcmf_if *ifp) |
4437 | { | 4435 | { |
4438 | set_bit(BRCMF_VIF_STATUS_READY, &ifp->vif->sme_state); | 4436 | set_bit(BRCMF_VIF_STATUS_READY, &ifp->vif->sme_state); |
4439 | if (ifp->idx) | ||
4440 | return 0; | ||
4441 | 4437 | ||
4442 | return brcmf_config_dongle(ifp->drvr->config); | 4438 | return brcmf_config_dongle(ifp->drvr->config); |
4443 | } | 4439 | } |