Skip to content

Commit

Permalink
net: wireless: bcmdhd: Clean scan status if request is empty
Browse files Browse the repository at this point in the history
Change-Id: I1c00b5a84846faf316305f57a6a74ded2288a6fd
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
  • Loading branch information
Dmitry Shmidt authored and imoseyon committed Sep 22, 2013
1 parent ef39404 commit 5cb865e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/net/wireless/bcmdhd/wl_cfg80211.c
Expand Up @@ -1572,8 +1572,13 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,

WL_DBG(("Enter wiphy (%p)\n", wiphy));
if (wl_get_drv_status_all(wl, SCANNING)) {
WL_ERR(("Scanning already\n"));
return -EAGAIN;
if (wl->scan_request == NULL) {
wl_clr_drv_status_all(wl, SCANNING);
WL_DBG(("<<<<<<<<<<<Force Clear Scanning Status>>>>>>>>>>>\n"));
} else {
WL_ERR(("Scanning already\n"));
return -EAGAIN;
}
}
if (wl_get_drv_status(wl, SCAN_ABORTING, ndev)) {
WL_ERR(("Scanning being aborted\n"));
Expand Down
25 changes: 25 additions & 0 deletions drivers/net/wireless/bcmdhd/wl_cfg80211.h
Expand Up @@ -549,6 +549,29 @@ wl_get_status_all(struct wl_priv *wl, s32 status)
return cnt? true: false;
}


static inline void
wl_set_status_all(struct wl_priv *wl, s32 status, u32 op)
{
struct net_info *_net_info, *next;

list_for_each_entry_safe(_net_info, next, &wl->net_list, list) {
switch (op) {
case 1:
return; /* set all status is not allowed */
case 2:
clear_bit(status, &_net_info->sme_state);
break;
case 4:
return; /* change all status is not allowed */
default:
return; /* unknown operation */
}
}

}


static inline void
wl_set_status_by_netdev(struct wl_priv *wl, s32 status,
struct net_device *ndev, u32 op)
Expand Down Expand Up @@ -639,6 +662,8 @@ wl_get_profile_by_netdev(struct wl_priv *wl, struct net_device *ndev)
(wl_set_status_by_netdev(wl, WL_STATUS_ ## stat, ndev, 1))
#define wl_clr_drv_status(wl, stat, ndev) \
(wl_set_status_by_netdev(wl, WL_STATUS_ ## stat, ndev, 2))
#define wl_clr_drv_status_all(wl, stat) \
(wl_set_status_all(wl, WL_STATUS_ ## stat, 2))
#define wl_chg_drv_status(wl, stat, ndev) \
(wl_set_status_by_netdev(wl, WL_STATUS_ ## stat, ndev, 4))

Expand Down

0 comments on commit 5cb865e

Please sign in to comment.