Skip to content

Commit

Permalink
nl80211: support beacon report scanning
Browse files Browse the repository at this point in the history
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 <assaf.krauss@intel.com>
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Avraham Stern authored and Johannes Berg committed Jul 6, 2016
1 parent f1724b0 commit 1d76250
Show file tree
Hide file tree
Showing 23 changed files with 279 additions and 52 deletions.
17 changes: 14 additions & 3 deletions drivers/net/wireless/ath/ath6kl/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,11 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl_vif *vif, u8 reason,
struct ath6kl *ar = vif->ar;

if (vif->scan_req) {
cfg80211_scan_done(vif->scan_req, true);
struct cfg80211_scan_info info = {
.aborted = true,
};

cfg80211_scan_done(vif->scan_req, &info);
vif->scan_req = NULL;
}

Expand Down Expand Up @@ -1069,6 +1073,9 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy,
void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted)
{
struct ath6kl *ar = vif->ar;
struct cfg80211_scan_info info = {
.aborted = aborted,
};
int i;

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

out:
cfg80211_scan_done(vif->scan_req, aborted);
cfg80211_scan_done(vif->scan_req, &info);
vif->scan_req = NULL;
}

Expand Down Expand Up @@ -3614,7 +3621,11 @@ void ath6kl_cfg80211_vif_stop(struct ath6kl_vif *vif, bool wmi_ready)
}

if (vif->scan_req) {
cfg80211_scan_done(vif->scan_req, true);
struct cfg80211_scan_info info = {
.aborted = true,
};

cfg80211_scan_done(vif->scan_req, &info);
vif->scan_req = NULL;
}

Expand Down
6 changes: 5 additions & 1 deletion drivers/net/wireless/ath/wil6210/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,11 @@ static void wil_cfg80211_stop_p2p_device(struct wiphy *wiphy,
mutex_lock(&wil->mutex);
started = wil_p2p_stop_discovery(wil);
if (started && wil->scan_request) {
cfg80211_scan_done(wil->scan_request, 1);
struct cfg80211_scan_info info = {
.aborted = true,
};

cfg80211_scan_done(wil->scan_request, &info);
wil->scan_request = NULL;
wil->radio_wdev = wil->wdev;
}
Expand Down
12 changes: 10 additions & 2 deletions drivers/net/wireless/ath/wil6210/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,10 +850,14 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
mutex_unlock(&wil->wmi_mutex);

if (wil->scan_request) {
struct cfg80211_scan_info info = {
.aborted = true,
};

wil_dbg_misc(wil, "Abort scan_request 0x%p\n",
wil->scan_request);
del_timer_sync(&wil->scan_timer);
cfg80211_scan_done(wil->scan_request, true);
cfg80211_scan_done(wil->scan_request, &info);
wil->scan_request = NULL;
}

Expand Down Expand Up @@ -1049,10 +1053,14 @@ int __wil_down(struct wil6210_priv *wil)
(void)wil_p2p_stop_discovery(wil);

if (wil->scan_request) {
struct cfg80211_scan_info info = {
.aborted = true,
};

wil_dbg_misc(wil, "Abort scan_request 0x%p\n",
wil->scan_request);
del_timer_sync(&wil->scan_timer);
cfg80211_scan_done(wil->scan_request, true);
cfg80211_scan_done(wil->scan_request, &info);
wil->scan_request = NULL;
}

Expand Down
6 changes: 5 additions & 1 deletion drivers/net/wireless/ath/wil6210/p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,12 @@ void wil_p2p_search_expired(struct work_struct *work)
mutex_unlock(&wil->mutex);

if (started) {
struct cfg80211_scan_info info = {
.aborted = false,
};

mutex_lock(&wil->p2p_wdev_mutex);
cfg80211_scan_done(wil->scan_request, 0);
cfg80211_scan_done(wil->scan_request, &info);
wil->scan_request = NULL;
wil->radio_wdev = wil->wdev;
mutex_unlock(&wil->p2p_wdev_mutex);
Expand Down
8 changes: 5 additions & 3 deletions drivers/net/wireless/ath/wil6210/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,15 +426,17 @@ static void wmi_evt_scan_complete(struct wil6210_priv *wil, int id,
{
if (wil->scan_request) {
struct wmi_scan_complete_event *data = d;
bool aborted = (data->status != WMI_SCAN_SUCCESS);
struct cfg80211_scan_info info = {
.aborted = (data->status != WMI_SCAN_SUCCESS),
};

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

del_timer_sync(&wil->scan_timer);
mutex_lock(&wil->p2p_wdev_mutex);
cfg80211_scan_done(wil->scan_request, aborted);
cfg80211_scan_done(wil->scan_request, &info);
wil->radio_wdev = wil->wdev;
mutex_unlock(&wil->p2p_wdev_mutex);
wil->scan_request = NULL;
Expand Down
6 changes: 5 additions & 1 deletion drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,9 +775,13 @@ s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
if (!aborted)
cfg80211_sched_scan_results(cfg_to_wiphy(cfg));
} else if (scan_request) {
struct cfg80211_scan_info info = {
.aborted = aborted,
};

brcmf_dbg(SCAN, "ESCAN Completed scan: %s\n",
aborted ? "Aborted" : "Done");
cfg80211_scan_done(scan_request, aborted);
cfg80211_scan_done(scan_request, &info);
}
if (!test_and_clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status))
brcmf_dbg(SCAN, "Scan complete, probably P2P scan\n");
Expand Down
12 changes: 10 additions & 2 deletions drivers/net/wireless/intersil/orinoco/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,23 @@ void orinoco_add_hostscan_results(struct orinoco_private *priv,

scan_abort:
if (priv->scan_request) {
cfg80211_scan_done(priv->scan_request, abort);
struct cfg80211_scan_info info = {
.aborted = abort,
};

cfg80211_scan_done(priv->scan_request, &info);
priv->scan_request = NULL;
}
}

void orinoco_scan_done(struct orinoco_private *priv, bool abort)
{
if (priv->scan_request) {
cfg80211_scan_done(priv->scan_request, abort);
struct cfg80211_scan_info info = {
.aborted = abort,
};

cfg80211_scan_done(priv->scan_request, &info);
priv->scan_request = NULL;
}
}
11 changes: 8 additions & 3 deletions drivers/net/wireless/marvell/libertas/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,15 @@ void lbs_scan_done(struct lbs_private *priv)
{
WARN_ON(!priv->scan_req);

if (priv->internal_scan)
if (priv->internal_scan) {
kfree(priv->scan_req);
else
cfg80211_scan_done(priv->scan_req, false);
} else {
struct cfg80211_scan_info info = {
.aborted = false,
};

cfg80211_scan_done(priv->scan_req, &info);
}

priv->scan_req = NULL;
}
Expand Down
12 changes: 10 additions & 2 deletions drivers/net/wireless/marvell/mwifiex/cmdevt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1057,8 +1057,12 @@ mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter)
if (!priv)
continue;
if (priv->scan_request) {
struct cfg80211_scan_info info = {
.aborted = true,
};

mwifiex_dbg(adapter, WARN, "info: aborting scan\n");
cfg80211_scan_done(priv->scan_request, 1);
cfg80211_scan_done(priv->scan_request, &info);
priv->scan_request = NULL;
}
}
Expand Down Expand Up @@ -1112,8 +1116,12 @@ mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter)
if (!priv)
continue;
if (priv->scan_request) {
struct cfg80211_scan_info info = {
.aborted = true,
};

mwifiex_dbg(adapter, WARN, "info: aborting scan\n");
cfg80211_scan_done(priv->scan_request, 1);
cfg80211_scan_done(priv->scan_request, &info);
priv->scan_request = NULL;
}
}
Expand Down
6 changes: 5 additions & 1 deletion drivers/net/wireless/marvell/mwifiex/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,9 +697,13 @@ mwifiex_close(struct net_device *dev)
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);

if (priv->scan_request) {
struct cfg80211_scan_info info = {
.aborted = true,
};

mwifiex_dbg(priv->adapter, INFO,
"aborting scan on ndo_stop\n");
cfg80211_scan_done(priv->scan_request, 1);
cfg80211_scan_done(priv->scan_request, &info);
priv->scan_request = NULL;
priv->scan_aborting = true;
}
Expand Down
12 changes: 10 additions & 2 deletions drivers/net/wireless/marvell/mwifiex/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1956,9 +1956,13 @@ static void mwifiex_check_next_scan_command(struct mwifiex_private *priv)
mwifiex_complete_scan(priv);

if (priv->scan_request) {
struct cfg80211_scan_info info = {
.aborted = false,
};

mwifiex_dbg(adapter, INFO,
"info: notifying scan done\n");
cfg80211_scan_done(priv->scan_request, 0);
cfg80211_scan_done(priv->scan_request, &info);
priv->scan_request = NULL;
} else {
priv->scan_aborting = false;
Expand All @@ -1977,9 +1981,13 @@ static void mwifiex_check_next_scan_command(struct mwifiex_private *priv)

if (!adapter->active_scan_triggered) {
if (priv->scan_request) {
struct cfg80211_scan_info info = {
.aborted = true,
};

mwifiex_dbg(adapter, INFO,
"info: aborting scan\n");
cfg80211_scan_done(priv->scan_request, 1);
cfg80211_scan_done(priv->scan_request, &info);
priv->scan_request = NULL;
} else {
priv->scan_aborting = false;
Expand Down
10 changes: 8 additions & 2 deletions drivers/net/wireless/rndis_wlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2134,6 +2134,7 @@ static void rndis_get_scan_results(struct work_struct *work)
struct rndis_wlan_private *priv =
container_of(work, struct rndis_wlan_private, scan_work.work);
struct usbnet *usbdev = priv->usbdev;
struct cfg80211_scan_info info = {};
int ret;

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

ret = rndis_check_bssid_list(usbdev, NULL, NULL);

cfg80211_scan_done(priv->scan_request, ret < 0);
info.aborted = ret < 0;
cfg80211_scan_done(priv->scan_request, &info);

priv->scan_request = NULL;
}
Expand Down Expand Up @@ -3574,7 +3576,11 @@ static int rndis_wlan_stop(struct usbnet *usbdev)
flush_workqueue(priv->workqueue);

if (priv->scan_request) {
cfg80211_scan_done(priv->scan_request, true);
struct cfg80211_scan_info info = {
.aborted = true,
};

cfg80211_scan_done(priv->scan_request, &info);
priv->scan_request = NULL;
}

Expand Down
11 changes: 8 additions & 3 deletions drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,10 +1256,15 @@ void rtw_cfg80211_indicate_scan_done(struct rtw_wdev_priv *pwdev_priv,
DBG_8723A("%s with scan req\n", __func__);

if (pwdev_priv->scan_request->wiphy !=
pwdev_priv->rtw_wdev->wiphy)
pwdev_priv->rtw_wdev->wiphy) {
DBG_8723A("error wiphy compare\n");
else
cfg80211_scan_done(pwdev_priv->scan_request, aborted);
} else {
struct cfg80211_scan_info info = {
.aborted = aborted,
};

cfg80211_scan_done(pwdev_priv->scan_request, &info);
}

pwdev_priv->scan_request = NULL;
} else {
Expand Down
12 changes: 10 additions & 2 deletions drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,11 @@ static void CfgScanResult(enum scan_event scan_event,
mutex_lock(&priv->scan_req_lock);

if (priv->pstrScanReq) {
cfg80211_scan_done(priv->pstrScanReq, false);
struct cfg80211_scan_info info = {
.aborted = false,
};

cfg80211_scan_done(priv->pstrScanReq, &info);
priv->u32RcvdChCount = 0;
priv->bCfgScanning = false;
priv->pstrScanReq = NULL;
Expand All @@ -464,10 +468,14 @@ static void CfgScanResult(enum scan_event scan_event,
mutex_lock(&priv->scan_req_lock);

if (priv->pstrScanReq) {
struct cfg80211_scan_info info = {
.aborted = false,
};

update_scan_time();
refresh_scan(priv, 1, false);

cfg80211_scan_done(priv->pstrScanReq, false);
cfg80211_scan_done(priv->pstrScanReq, &info);
priv->bCfgScanning = false;
priv->pstrScanReq = NULL;
}
Expand Down
5 changes: 4 additions & 1 deletion drivers/staging/wlan-ng/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ static int prism2_scan(struct wiphy *wiphy,
struct p80211msg_dot11req_scan msg1;
struct p80211msg_dot11req_scan_results msg2;
struct cfg80211_bss *bss;
struct cfg80211_scan_info info = {};

int result;
int err = 0;
int numbss = 0;
Expand Down Expand Up @@ -440,7 +442,8 @@ static int prism2_scan(struct wiphy *wiphy,
err = prism2_result2err(msg2.resultcode.data);

exit:
cfg80211_scan_done(request, err ? 1 : 0);
info.aborted = !!(err);
cfg80211_scan_done(request, &info);
priv->scan_request = NULL;
return err;
}
Expand Down
Loading

0 comments on commit 1d76250

Please sign in to comment.