Skip to content
Permalink
Browse files

net: wireless: bcmdhd: Send all pno scans' results

Remove ptr clearance so as to allow sched scan results as
long as supplicant doesnt issue stop.
Protect access to the sched_scan_req ptr.

Bug: 25394415

Change-Id: I381d586a2fb0a42462855e7aa80fe0d7ed723ce1
Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>
  • Loading branch information
Ashwin Dmitry Shmidt
Ashwin authored and Dmitry Shmidt committed Nov 4, 2015
1 parent f14ede6 commit 7717f769b2d0bf26db19598d8826a01b82ab6540
Showing with 17 additions and 7 deletions.
  1. +17 −7 drivers/net/wireless/bcmdhd/wl_cfg80211.c
@@ -3212,6 +3212,9 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
}
#endif
#ifdef WL_SCHED_SCAN
/* Locks are taken in wl_cfg80211_sched_scan_stop()
* A start scan occuring during connect is unlikely
*/
if (wl->sched_scan_req) {
wl_cfg80211_sched_scan_stop(wiphy, wl_to_prmry_ndev(wl));
}
@@ -6500,6 +6503,7 @@ wl_cfg80211_sched_scan_start(struct wiphy *wiphy,
int ssid_cnt = 0;
int i;
int ret = 0;
unsigned long flags;

WL_DBG(("Enter \n"));
WL_PNO((">>> SCHED SCAN START\n"));
@@ -6542,7 +6546,9 @@ wl_cfg80211_sched_scan_start(struct wiphy *wiphy,
WL_ERR(("PNO setup failed!! ret=%d \n", ret));
return -EINVAL;
}
spin_lock_irqsave(&wl->cfgdrv_lock, flags);
wl->sched_scan_req = request;
spin_unlock_irqrestore(&wl->cfgdrv_lock, flags);
} else {
return -EINVAL;
}
@@ -6554,6 +6560,7 @@ static int
wl_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev)
{
struct wl_priv *wl = wiphy_priv(wiphy);
unsigned long flags;

WL_DBG(("Enter \n"));
WL_PNO((">>> SCHED SCAN STOP\n"));
@@ -6565,10 +6572,10 @@ wl_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev)
WL_PNO((">>> Sched scan running. Aborting it..\n"));
wl_notify_escan_complete(wl, dev, true, true);
}

wl->sched_scan_req = NULL;
wl->sched_scan_running = FALSE;

spin_lock_irqsave(&wl->cfgdrv_lock, flags);
wl->sched_scan_req = NULL;
wl->sched_scan_running = FALSE;
spin_unlock_irqrestore(&wl->cfgdrv_lock, flags);
return 0;
}
#endif /* WL_SCHED_SCAN */
@@ -8997,11 +9004,14 @@ static s32 wl_notify_escan_complete(struct wl_priv *wl,
spin_lock_irqsave(&wl->cfgdrv_lock, flags);
#ifdef WL_SCHED_SCAN
if (wl->sched_scan_req && !wl->scan_request) {
WL_PNO((">>> REPORTING SCHED SCAN RESULTS \n"));
if (!aborted)
int count;

count = wl->bss_list ? wl->bss_list->count : 0;
if (!aborted) {
cfg80211_sched_scan_results(wl->sched_scan_req->wiphy);
printk(">> SCHED SCAN RESULT %d\n", count);
}
wl->sched_scan_running = FALSE;
wl->sched_scan_req = NULL;
}
#endif /* WL_SCHED_SCAN */
if (likely(wl->scan_request)) {

0 comments on commit 7717f76

Please sign in to comment.
You can’t perform that action at this time.