Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 7717f76

Browse files
AshwinDmitry Shmidt
authored andcommitted
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>
1 parent f14ede6 commit 7717f76

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

drivers/net/wireless/bcmdhd/wl_cfg80211.c

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,6 +3212,9 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
32123212
}
32133213
#endif
32143214
#ifdef WL_SCHED_SCAN
3215+
/* Locks are taken in wl_cfg80211_sched_scan_stop()
3216+
* A start scan occuring during connect is unlikely
3217+
*/
32153218
if (wl->sched_scan_req) {
32163219
wl_cfg80211_sched_scan_stop(wiphy, wl_to_prmry_ndev(wl));
32173220
}
@@ -6500,6 +6503,7 @@ wl_cfg80211_sched_scan_start(struct wiphy *wiphy,
65006503
int ssid_cnt = 0;
65016504
int i;
65026505
int ret = 0;
6506+
unsigned long flags;
65036507

65046508
WL_DBG(("Enter \n"));
65056509
WL_PNO((">>> SCHED SCAN START\n"));
@@ -6542,7 +6546,9 @@ wl_cfg80211_sched_scan_start(struct wiphy *wiphy,
65426546
WL_ERR(("PNO setup failed!! ret=%d \n", ret));
65436547
return -EINVAL;
65446548
}
6549+
spin_lock_irqsave(&wl->cfgdrv_lock, flags);
65456550
wl->sched_scan_req = request;
6551+
spin_unlock_irqrestore(&wl->cfgdrv_lock, flags);
65466552
} else {
65476553
return -EINVAL;
65486554
}
@@ -6554,6 +6560,7 @@ static int
65546560
wl_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev)
65556561
{
65566562
struct wl_priv *wl = wiphy_priv(wiphy);
6563+
unsigned long flags;
65576564

65586565
WL_DBG(("Enter \n"));
65596566
WL_PNO((">>> SCHED SCAN STOP\n"));
@@ -6565,10 +6572,10 @@ wl_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev)
65656572
WL_PNO((">>> Sched scan running. Aborting it..\n"));
65666573
wl_notify_escan_complete(wl, dev, true, true);
65676574
}
6568-
6569-
wl->sched_scan_req = NULL;
6570-
wl->sched_scan_running = FALSE;
6571-
6575+
spin_lock_irqsave(&wl->cfgdrv_lock, flags);
6576+
wl->sched_scan_req = NULL;
6577+
wl->sched_scan_running = FALSE;
6578+
spin_unlock_irqrestore(&wl->cfgdrv_lock, flags);
65726579
return 0;
65736580
}
65746581
#endif /* WL_SCHED_SCAN */
@@ -8997,11 +9004,14 @@ static s32 wl_notify_escan_complete(struct wl_priv *wl,
89979004
spin_lock_irqsave(&wl->cfgdrv_lock, flags);
89989005
#ifdef WL_SCHED_SCAN
89999006
if (wl->sched_scan_req && !wl->scan_request) {
9000-
WL_PNO((">>> REPORTING SCHED SCAN RESULTS \n"));
9001-
if (!aborted)
9007+
int count;
9008+
9009+
count = wl->bss_list ? wl->bss_list->count : 0;
9010+
if (!aborted) {
90029011
cfg80211_sched_scan_results(wl->sched_scan_req->wiphy);
9012+
printk(">> SCHED SCAN RESULT %d\n", count);
9013+
}
90039014
wl->sched_scan_running = FALSE;
9004-
wl->sched_scan_req = NULL;
90059015
}
90069016
#endif /* WL_SCHED_SCAN */
90079017
if (likely(wl->scan_request)) {

0 commit comments

Comments
 (0)