Skip to content

Commit 1d76250

Browse files
AviSternjmberg-intel
authored andcommitted
nl80211: support beacon report scanning
Beacon report radio measurement requires reporting observed BSSs on the channels specified in the beacon request. If the measurement mode is set to passive or active, it requires actually performing a scan (passive or active, accordingly), and reporting the time that the scan was started and the time each beacon/probe was received (both in terms of TSF of the BSS of the requesting AP). If the request mode is table, this information is optional. In addition, the radio measurement request specifies the channel dwell time for the measurement. In order to use scan for beacon report when the mode is active or passive, add a parameter to scan request that specifies the channel dwell time, and add scan start time and beacon received time to scan results information. Supporting beacon report is required for Multi Band Operation (MBO). Signed-off-by: Assaf Krauss <[email protected]> Signed-off-by: David Spinadel <[email protected]> Signed-off-by: Avraham Stern <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent f1724b0 commit 1d76250

File tree

23 files changed

+279
-52
lines changed

23 files changed

+279
-52
lines changed

drivers/net/wireless/ath/ath6kl/cfg80211.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,11 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl_vif *vif, u8 reason,
859859
struct ath6kl *ar = vif->ar;
860860

861861
if (vif->scan_req) {
862-
cfg80211_scan_done(vif->scan_req, true);
862+
struct cfg80211_scan_info info = {
863+
.aborted = true,
864+
};
865+
866+
cfg80211_scan_done(vif->scan_req, &info);
863867
vif->scan_req = NULL;
864868
}
865869

@@ -1069,6 +1073,9 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy,
10691073
void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted)
10701074
{
10711075
struct ath6kl *ar = vif->ar;
1076+
struct cfg80211_scan_info info = {
1077+
.aborted = aborted,
1078+
};
10721079
int i;
10731080

10741081
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: status%s\n", __func__,
@@ -1089,7 +1096,7 @@ void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted)
10891096
}
10901097

10911098
out:
1092-
cfg80211_scan_done(vif->scan_req, aborted);
1099+
cfg80211_scan_done(vif->scan_req, &info);
10931100
vif->scan_req = NULL;
10941101
}
10951102

@@ -3614,7 +3621,11 @@ void ath6kl_cfg80211_vif_stop(struct ath6kl_vif *vif, bool wmi_ready)
36143621
}
36153622

36163623
if (vif->scan_req) {
3617-
cfg80211_scan_done(vif->scan_req, true);
3624+
struct cfg80211_scan_info info = {
3625+
.aborted = true,
3626+
};
3627+
3628+
cfg80211_scan_done(vif->scan_req, &info);
36183629
vif->scan_req = NULL;
36193630
}
36203631

drivers/net/wireless/ath/wil6210/cfg80211.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,11 @@ static void wil_cfg80211_stop_p2p_device(struct wiphy *wiphy,
13691369
mutex_lock(&wil->mutex);
13701370
started = wil_p2p_stop_discovery(wil);
13711371
if (started && wil->scan_request) {
1372-
cfg80211_scan_done(wil->scan_request, 1);
1372+
struct cfg80211_scan_info info = {
1373+
.aborted = true,
1374+
};
1375+
1376+
cfg80211_scan_done(wil->scan_request, &info);
13731377
wil->scan_request = NULL;
13741378
wil->radio_wdev = wil->wdev;
13751379
}

drivers/net/wireless/ath/wil6210/main.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,10 +850,14 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
850850
mutex_unlock(&wil->wmi_mutex);
851851

852852
if (wil->scan_request) {
853+
struct cfg80211_scan_info info = {
854+
.aborted = true,
855+
};
856+
853857
wil_dbg_misc(wil, "Abort scan_request 0x%p\n",
854858
wil->scan_request);
855859
del_timer_sync(&wil->scan_timer);
856-
cfg80211_scan_done(wil->scan_request, true);
860+
cfg80211_scan_done(wil->scan_request, &info);
857861
wil->scan_request = NULL;
858862
}
859863

@@ -1049,10 +1053,14 @@ int __wil_down(struct wil6210_priv *wil)
10491053
(void)wil_p2p_stop_discovery(wil);
10501054

10511055
if (wil->scan_request) {
1056+
struct cfg80211_scan_info info = {
1057+
.aborted = true,
1058+
};
1059+
10521060
wil_dbg_misc(wil, "Abort scan_request 0x%p\n",
10531061
wil->scan_request);
10541062
del_timer_sync(&wil->scan_timer);
1055-
cfg80211_scan_done(wil->scan_request, true);
1063+
cfg80211_scan_done(wil->scan_request, &info);
10561064
wil->scan_request = NULL;
10571065
}
10581066

drivers/net/wireless/ath/wil6210/p2p.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,12 @@ void wil_p2p_search_expired(struct work_struct *work)
252252
mutex_unlock(&wil->mutex);
253253

254254
if (started) {
255+
struct cfg80211_scan_info info = {
256+
.aborted = false,
257+
};
258+
255259
mutex_lock(&wil->p2p_wdev_mutex);
256-
cfg80211_scan_done(wil->scan_request, 0);
260+
cfg80211_scan_done(wil->scan_request, &info);
257261
wil->scan_request = NULL;
258262
wil->radio_wdev = wil->wdev;
259263
mutex_unlock(&wil->p2p_wdev_mutex);

drivers/net/wireless/ath/wil6210/wmi.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,15 +426,17 @@ static void wmi_evt_scan_complete(struct wil6210_priv *wil, int id,
426426
{
427427
if (wil->scan_request) {
428428
struct wmi_scan_complete_event *data = d;
429-
bool aborted = (data->status != WMI_SCAN_SUCCESS);
429+
struct cfg80211_scan_info info = {
430+
.aborted = (data->status != WMI_SCAN_SUCCESS),
431+
};
430432

431433
wil_dbg_wmi(wil, "SCAN_COMPLETE(0x%08x)\n", data->status);
432434
wil_dbg_misc(wil, "Complete scan_request 0x%p aborted %d\n",
433-
wil->scan_request, aborted);
435+
wil->scan_request, info.aborted);
434436

435437
del_timer_sync(&wil->scan_timer);
436438
mutex_lock(&wil->p2p_wdev_mutex);
437-
cfg80211_scan_done(wil->scan_request, aborted);
439+
cfg80211_scan_done(wil->scan_request, &info);
438440
wil->radio_wdev = wil->wdev;
439441
mutex_unlock(&wil->p2p_wdev_mutex);
440442
wil->scan_request = NULL;

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,9 +775,13 @@ s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
775775
if (!aborted)
776776
cfg80211_sched_scan_results(cfg_to_wiphy(cfg));
777777
} else if (scan_request) {
778+
struct cfg80211_scan_info info = {
779+
.aborted = aborted,
780+
};
781+
778782
brcmf_dbg(SCAN, "ESCAN Completed scan: %s\n",
779783
aborted ? "Aborted" : "Done");
780-
cfg80211_scan_done(scan_request, aborted);
784+
cfg80211_scan_done(scan_request, &info);
781785
}
782786
if (!test_and_clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status))
783787
brcmf_dbg(SCAN, "Scan complete, probably P2P scan\n");

drivers/net/wireless/intersil/orinoco/scan.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,23 @@ void orinoco_add_hostscan_results(struct orinoco_private *priv,
237237

238238
scan_abort:
239239
if (priv->scan_request) {
240-
cfg80211_scan_done(priv->scan_request, abort);
240+
struct cfg80211_scan_info info = {
241+
.aborted = abort,
242+
};
243+
244+
cfg80211_scan_done(priv->scan_request, &info);
241245
priv->scan_request = NULL;
242246
}
243247
}
244248

245249
void orinoco_scan_done(struct orinoco_private *priv, bool abort)
246250
{
247251
if (priv->scan_request) {
248-
cfg80211_scan_done(priv->scan_request, abort);
252+
struct cfg80211_scan_info info = {
253+
.aborted = abort,
254+
};
255+
256+
cfg80211_scan_done(priv->scan_request, &info);
249257
priv->scan_request = NULL;
250258
}
251259
}

drivers/net/wireless/marvell/libertas/cfg.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,10 +796,15 @@ void lbs_scan_done(struct lbs_private *priv)
796796
{
797797
WARN_ON(!priv->scan_req);
798798

799-
if (priv->internal_scan)
799+
if (priv->internal_scan) {
800800
kfree(priv->scan_req);
801-
else
802-
cfg80211_scan_done(priv->scan_req, false);
801+
} else {
802+
struct cfg80211_scan_info info = {
803+
.aborted = false,
804+
};
805+
806+
cfg80211_scan_done(priv->scan_req, &info);
807+
}
803808

804809
priv->scan_req = NULL;
805810
}

drivers/net/wireless/marvell/mwifiex/cmdevt.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,8 +1057,12 @@ mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter)
10571057
if (!priv)
10581058
continue;
10591059
if (priv->scan_request) {
1060+
struct cfg80211_scan_info info = {
1061+
.aborted = true,
1062+
};
1063+
10601064
mwifiex_dbg(adapter, WARN, "info: aborting scan\n");
1061-
cfg80211_scan_done(priv->scan_request, 1);
1065+
cfg80211_scan_done(priv->scan_request, &info);
10621066
priv->scan_request = NULL;
10631067
}
10641068
}
@@ -1112,8 +1116,12 @@ mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter)
11121116
if (!priv)
11131117
continue;
11141118
if (priv->scan_request) {
1119+
struct cfg80211_scan_info info = {
1120+
.aborted = true,
1121+
};
1122+
11151123
mwifiex_dbg(adapter, WARN, "info: aborting scan\n");
1116-
cfg80211_scan_done(priv->scan_request, 1);
1124+
cfg80211_scan_done(priv->scan_request, &info);
11171125
priv->scan_request = NULL;
11181126
}
11191127
}

drivers/net/wireless/marvell/mwifiex/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,13 @@ mwifiex_close(struct net_device *dev)
697697
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
698698

699699
if (priv->scan_request) {
700+
struct cfg80211_scan_info info = {
701+
.aborted = true,
702+
};
703+
700704
mwifiex_dbg(priv->adapter, INFO,
701705
"aborting scan on ndo_stop\n");
702-
cfg80211_scan_done(priv->scan_request, 1);
706+
cfg80211_scan_done(priv->scan_request, &info);
703707
priv->scan_request = NULL;
704708
priv->scan_aborting = true;
705709
}

drivers/net/wireless/marvell/mwifiex/scan.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,9 +1956,13 @@ static void mwifiex_check_next_scan_command(struct mwifiex_private *priv)
19561956
mwifiex_complete_scan(priv);
19571957

19581958
if (priv->scan_request) {
1959+
struct cfg80211_scan_info info = {
1960+
.aborted = false,
1961+
};
1962+
19591963
mwifiex_dbg(adapter, INFO,
19601964
"info: notifying scan done\n");
1961-
cfg80211_scan_done(priv->scan_request, 0);
1965+
cfg80211_scan_done(priv->scan_request, &info);
19621966
priv->scan_request = NULL;
19631967
} else {
19641968
priv->scan_aborting = false;
@@ -1977,9 +1981,13 @@ static void mwifiex_check_next_scan_command(struct mwifiex_private *priv)
19771981

19781982
if (!adapter->active_scan_triggered) {
19791983
if (priv->scan_request) {
1984+
struct cfg80211_scan_info info = {
1985+
.aborted = true,
1986+
};
1987+
19801988
mwifiex_dbg(adapter, INFO,
19811989
"info: aborting scan\n");
1982-
cfg80211_scan_done(priv->scan_request, 1);
1990+
cfg80211_scan_done(priv->scan_request, &info);
19831991
priv->scan_request = NULL;
19841992
} else {
19851993
priv->scan_aborting = false;

drivers/net/wireless/rndis_wlan.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,6 +2134,7 @@ static void rndis_get_scan_results(struct work_struct *work)
21342134
struct rndis_wlan_private *priv =
21352135
container_of(work, struct rndis_wlan_private, scan_work.work);
21362136
struct usbnet *usbdev = priv->usbdev;
2137+
struct cfg80211_scan_info info = {};
21372138
int ret;
21382139

21392140
netdev_dbg(usbdev->net, "get_scan_results\n");
@@ -2143,7 +2144,8 @@ static void rndis_get_scan_results(struct work_struct *work)
21432144

21442145
ret = rndis_check_bssid_list(usbdev, NULL, NULL);
21452146

2146-
cfg80211_scan_done(priv->scan_request, ret < 0);
2147+
info.aborted = ret < 0;
2148+
cfg80211_scan_done(priv->scan_request, &info);
21472149

21482150
priv->scan_request = NULL;
21492151
}
@@ -3574,7 +3576,11 @@ static int rndis_wlan_stop(struct usbnet *usbdev)
35743576
flush_workqueue(priv->workqueue);
35753577

35763578
if (priv->scan_request) {
3577-
cfg80211_scan_done(priv->scan_request, true);
3579+
struct cfg80211_scan_info info = {
3580+
.aborted = true,
3581+
};
3582+
3583+
cfg80211_scan_done(priv->scan_request, &info);
35783584
priv->scan_request = NULL;
35793585
}
35803586

drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,10 +1256,15 @@ void rtw_cfg80211_indicate_scan_done(struct rtw_wdev_priv *pwdev_priv,
12561256
DBG_8723A("%s with scan req\n", __func__);
12571257

12581258
if (pwdev_priv->scan_request->wiphy !=
1259-
pwdev_priv->rtw_wdev->wiphy)
1259+
pwdev_priv->rtw_wdev->wiphy) {
12601260
DBG_8723A("error wiphy compare\n");
1261-
else
1262-
cfg80211_scan_done(pwdev_priv->scan_request, aborted);
1261+
} else {
1262+
struct cfg80211_scan_info info = {
1263+
.aborted = aborted,
1264+
};
1265+
1266+
cfg80211_scan_done(pwdev_priv->scan_request, &info);
1267+
}
12631268

12641269
pwdev_priv->scan_request = NULL;
12651270
} else {

drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,11 @@ static void CfgScanResult(enum scan_event scan_event,
454454
mutex_lock(&priv->scan_req_lock);
455455

456456
if (priv->pstrScanReq) {
457-
cfg80211_scan_done(priv->pstrScanReq, false);
457+
struct cfg80211_scan_info info = {
458+
.aborted = false,
459+
};
460+
461+
cfg80211_scan_done(priv->pstrScanReq, &info);
458462
priv->u32RcvdChCount = 0;
459463
priv->bCfgScanning = false;
460464
priv->pstrScanReq = NULL;
@@ -464,10 +468,14 @@ static void CfgScanResult(enum scan_event scan_event,
464468
mutex_lock(&priv->scan_req_lock);
465469

466470
if (priv->pstrScanReq) {
471+
struct cfg80211_scan_info info = {
472+
.aborted = false,
473+
};
474+
467475
update_scan_time();
468476
refresh_scan(priv, 1, false);
469477

470-
cfg80211_scan_done(priv->pstrScanReq, false);
478+
cfg80211_scan_done(priv->pstrScanReq, &info);
471479
priv->bCfgScanning = false;
472480
priv->pstrScanReq = NULL;
473481
}

drivers/staging/wlan-ng/cfg80211.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ static int prism2_scan(struct wiphy *wiphy,
338338
struct p80211msg_dot11req_scan msg1;
339339
struct p80211msg_dot11req_scan_results msg2;
340340
struct cfg80211_bss *bss;
341+
struct cfg80211_scan_info info = {};
342+
341343
int result;
342344
int err = 0;
343345
int numbss = 0;
@@ -440,7 +442,8 @@ static int prism2_scan(struct wiphy *wiphy,
440442
err = prism2_result2err(msg2.resultcode.data);
441443

442444
exit:
443-
cfg80211_scan_done(request, err ? 1 : 0);
445+
info.aborted = !!(err);
446+
cfg80211_scan_done(request, &info);
444447
priv->scan_request = NULL;
445448
return err;
446449
}

0 commit comments

Comments
 (0)