diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2011-10-09 02:28:45 +0100 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-10-09 02:28:45 +0100 |
commit | 8fcb73d4ee58936b46d884d589af0a502f49e779 (patch) | |
tree | 77561b50f54f153263ed1785610dc876d2d49378 | |
parent | 5f9642fa9da6697cf5b2cc8e788e0a485deb9270 (diff) |
net: wireless: bcmdhd: Fix CFG80211 suspend/resume if interface is down
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r-- | drivers/net/wireless/bcmdhd/wl_cfg80211.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c index 3196da3559b..d9c7e658769 100644 --- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c +++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c @@ -2594,10 +2594,16 @@ wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev, static s32 wl_cfg80211_resume(struct wiphy *wiphy) { + struct wl_priv *wl = WL_PRIV_GET(); s32 err = 0; - CHECK_SYS_UP(); - wl_invoke_iscan(WL_PRIV_GET()); + if (unlikely(!test_bit(WL_STATUS_READY, &wl->status))) { + WL_INFO(("device is not ready : status (%d)\n", + (int)wl->status)); + return 0; + } + + wl_invoke_iscan(wl); return err; } @@ -2611,7 +2617,11 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy) struct wl_priv *wl = WL_PRIV_GET(); s32 err = 0; - CHECK_SYS_UP(); + if (unlikely(!test_bit(WL_STATUS_READY, &wl->status))) { + WL_INFO(("device is not ready : status (%d)\n", + (int)wl->status)); + return 0; + } set_bit(WL_STATUS_SCAN_ABORTING, &wl->status); wl_term_iscan(wl); |