diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2011-10-25 11:42:12 +0800 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-10-25 11:42:12 +0800 |
commit | 162283117698c93ac0ce3850a0b48e6345551b64 (patch) | |
tree | c9d11e41f5f0e577dc8b76748e38763bdd3b5920 | |
parent | 8075b469f96c658578e6f0c1da829ae2ef84e6d5 (diff) |
net: wireless: bcmdhd: Fix wl_cfg80211_suspend() crash
- Eliminate wlan chip access during suspend
- Add DHD_CLEAR_ON_SUSPEND define to clear statuses on suspend
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r-- | drivers/net/wireless/bcmdhd/wl_cfg80211.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c index 13530d2063d..0c3854d17e4 100644 --- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c +++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c @@ -2881,6 +2881,7 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow) static s32 wl_cfg80211_suspend(struct wiphy *wiphy) #endif { +#ifdef DHD_CLEAR_ON_SUSPEND struct wl_priv *wl = wiphy_priv(wiphy); struct net_device *ndev = wl_to_prmry_ndev(wl); unsigned long flags; @@ -2893,11 +2894,6 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy) wl_set_drv_status(wl, SCAN_ABORTING); wl_term_iscan(wl); - if (wl_get_drv_status(wl, CONNECTING)) { - wl_bss_connect_done(wl, ndev, NULL, NULL, false); - wl_delay(500); - return -EAGAIN; - } flags = dhd_os_spin_lock((dhd_pub_t *)(wl->pub)); if (wl->scan_request) { cfg80211_scan_done(wl->scan_request, true); @@ -2906,6 +2902,13 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy) wl_clr_drv_status(wl, SCANNING); wl_clr_drv_status(wl, SCAN_ABORTING); dhd_os_spin_unlock((dhd_pub_t *)(wl->pub), flags); + + if (wl_get_drv_status(wl, CONNECTING)) { + wl_bss_connect_done(wl, ndev, NULL, NULL, false); + wl_delay(500); + return -EAGAIN; + } +#endif return 0; } |