summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2011-10-09 02:34:08 +0100
committerAndy Green <andy.green@linaro.org>2011-10-09 02:34:08 +0100
commit6083e287e760e6cfd7b218449fe1e62e9eb5d33d (patch)
tree25168d02392ea81a213426fdc5ef1f121db756a8
parent223b70c37eef22d580428b1bf83c1d9b017b0a90 (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.c13
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;
}