diff options
author | Arend van Spriel <arend@broadcom.com> | 2012-10-22 16:55:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-29 15:28:55 -0400 |
commit | 7d641072c3fc526ebdd78a605ea0d7851e9492f1 (patch) | |
tree | cdebff3974cc51040c0fd569d003680063d45f58 /drivers | |
parent | ba40d16696c86165744c89e0dae649df78dd82f4 (diff) |
brcmfmac: add virtual interface support in brcmf_cfg80211_suspend()
With multiple interfaces suspend will need to iterate over all and
bring down the link.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index 94c619ab20f7..82c7c771c0c9 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -3008,46 +3008,49 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, | |||
3008 | { | 3008 | { |
3009 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 3009 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
3010 | struct net_device *ndev = cfg_to_ndev(cfg); | 3010 | struct net_device *ndev = cfg_to_ndev(cfg); |
3011 | struct brcmf_if *ifp = netdev_priv(ndev); | 3011 | struct brcmf_cfg80211_vif *vif; |
3012 | 3012 | ||
3013 | WL_TRACE("Enter\n"); | 3013 | WL_TRACE("Enter\n"); |
3014 | 3014 | ||
3015 | /* | 3015 | /* |
3016 | * Check for BRCMF_VIF_STATUS_READY before any function call which | 3016 | * if the primary net_device is not READY there is nothing |
3017 | * could result is bus access. Don't block the suspend for | 3017 | * we can do but pray resume goes smoothly. |
3018 | * any driver error conditions | ||
3019 | */ | ||
3020 | |||
3021 | /* | ||
3022 | * While going to suspend if associated with AP disassociate | ||
3023 | * from AP to save power while system is in suspended state | ||
3024 | */ | 3018 | */ |
3025 | if ((test_bit(BRCMF_VIF_STATUS_CONNECTED, &ifp->vif->sme_state) || | 3019 | vif = ((struct brcmf_if *)netdev_priv(ndev))->vif; |
3026 | test_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state)) && | 3020 | if (!check_vif_up(vif)) |
3027 | check_vif_up(ifp->vif)) { | 3021 | goto exit; |
3028 | WL_INFO("Disassociating from AP" | ||
3029 | " while entering suspend state\n"); | ||
3030 | brcmf_link_down(cfg); | ||
3031 | 3022 | ||
3023 | list_for_each_entry(vif, &cfg->vif_list, list) { | ||
3024 | if (!test_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state)) | ||
3025 | continue; | ||
3032 | /* | 3026 | /* |
3033 | * Make sure WPA_Supplicant receives all the event | 3027 | * While going to suspend if associated with AP disassociate |
3034 | * generated due to DISASSOC call to the fw to keep | 3028 | * from AP to save power while system is in suspended state |
3035 | * the state fw and WPA_Supplicant state consistent | ||
3036 | */ | 3029 | */ |
3037 | brcmf_delay(500); | 3030 | if (test_bit(BRCMF_VIF_STATUS_CONNECTED, &vif->sme_state) || |
3031 | test_bit(BRCMF_VIF_STATUS_CONNECTING, &vif->sme_state)) { | ||
3032 | WL_INFO("Disassociating from AP before suspend\n"); | ||
3033 | brcmf_link_down(cfg); | ||
3034 | |||
3035 | /* Make sure WPA_Supplicant receives all the event | ||
3036 | * generated due to DISASSOC call to the fw to keep | ||
3037 | * the state fw and WPA_Supplicant state consistent | ||
3038 | */ | ||
3039 | brcmf_delay(500); | ||
3040 | } | ||
3038 | } | 3041 | } |
3039 | 3042 | ||
3040 | if (test_bit(BRCMF_VIF_STATUS_READY, &ifp->vif->sme_state)) | 3043 | /* end any scanning */ |
3044 | if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) | ||
3041 | brcmf_abort_scanning(cfg); | 3045 | brcmf_abort_scanning(cfg); |
3042 | else | ||
3043 | clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status); | ||
3044 | 3046 | ||
3045 | /* Turn off watchdog timer */ | 3047 | /* Turn off watchdog timer */ |
3046 | if (test_bit(BRCMF_VIF_STATUS_READY, &ifp->vif->sme_state)) | 3048 | brcmf_set_mpc(ndev, 1); |
3047 | brcmf_set_mpc(ndev, 1); | ||
3048 | 3049 | ||
3050 | exit: | ||
3049 | WL_TRACE("Exit\n"); | 3051 | WL_TRACE("Exit\n"); |
3050 | 3052 | /* clear any scanning activity */ | |
3053 | cfg->scan_status = 0; | ||
3051 | return 0; | 3054 | return 0; |
3052 | } | 3055 | } |
3053 | 3056 | ||