summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2011-09-16 14:03:13 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:39:06 -0800
commit030dbc1407e4e727bc00d13c5cf0c5042b8b2ceb (patch)
treee172b9126bbe182e0e00c67c399d19d12872a166 /drivers/net
parent88dd0e29b6390220fca5c2800bf16feb245004c7 (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>
Diffstat (limited to 'drivers/net')
-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 13530d2063db..0c3854d17e4c 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;
}