Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7947d3e0 authored by Avraham Stern's avatar Avraham Stern Committed by Johannes Berg
Browse files

mac80211: Add support for beacon report radio measurement



Add the following to support beacon report radio measurement
with the measurement mode field set to passive or active:
1. Propagate the required scan duration to the device
2. Report the scan start time (in terms of TSF)
3. Report each BSS's detection time (also in terms of TSF)

TSF times refer to the BSS that the interface that requested the
scan is connected to.

Signed-off-by: default avatarAssaf Krauss <assaf.krauss@intel.com>
Signed-off-by: default avatarAvraham Stern <avraham.stern@intel.com>
[changed ath9k/10k, at76c59x-usb, iwlegacy, wl1251 and wlcore to match
the new API]
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 1d76250b
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -3858,12 +3858,16 @@ void __ath10k_scan_finish(struct ath10k *ar)
		break;
	case ATH10K_SCAN_RUNNING:
	case ATH10K_SCAN_ABORTING:
		if (!ar->scan.is_roc)
			ieee80211_scan_completed(ar->hw,
						 (ar->scan.state ==
						  ATH10K_SCAN_ABORTING));
		else if (ar->scan.roc_notify)
		if (!ar->scan.is_roc) {
			struct cfg80211_scan_info info = {
				.aborted = (ar->scan.state ==
					    ATH10K_SCAN_ABORTING),
			};

			ieee80211_scan_completed(ar->hw, &info);
		} else if (ar->scan.roc_notify) {
			ieee80211_remain_on_channel_expired(ar->hw);
		}
		/* fall through */
	case ATH10K_SCAN_STARTING:
		ar->scan.state = ATH10K_SCAN_IDLE;
+4 −1
Original line number Diff line number Diff line
@@ -960,6 +960,9 @@ void ath_roc_complete(struct ath_softc *sc, enum ath_roc_complete_reason reason)
void ath_scan_complete(struct ath_softc *sc, bool abort)
{
	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
	struct cfg80211_scan_info info = {
		.aborted = abort,
	};

	if (abort)
		ath_dbg(common, CHAN_CTX, "HW scan aborted\n");
@@ -969,7 +972,7 @@ void ath_scan_complete(struct ath_softc *sc, bool abort)
	sc->offchannel.scan_req = NULL;
	sc->offchannel.scan_vif = NULL;
	sc->offchannel.state = ATH_OFFCHANNEL_IDLE;
	ieee80211_scan_completed(sc->hw, abort);
	ieee80211_scan_completed(sc->hw, &info);
	clear_bit(ATH_OP_SCANNING, &common->op_flags);
	spin_lock_bh(&sc->chan_lock);
	if (test_bit(ATH_OP_MULTI_CHANNEL, &common->op_flags))
+4 −1
Original line number Diff line number Diff line
@@ -1922,6 +1922,9 @@ static void at76_dwork_hw_scan(struct work_struct *work)
{
	struct at76_priv *priv = container_of(work, struct at76_priv,
					      dwork_hw_scan.work);
	struct cfg80211_scan_info info = {
		.aborted = false,
	};
	int ret;

	if (priv->device_unplugged)
@@ -1948,7 +1951,7 @@ static void at76_dwork_hw_scan(struct work_struct *work)

	mutex_unlock(&priv->mtx);

	ieee80211_scan_completed(priv->hw, false);
	ieee80211_scan_completed(priv->hw, &info);

	ieee80211_wake_queues(priv->hw);
}
+5 −1
Original line number Diff line number Diff line
@@ -1305,10 +1305,14 @@ il_send_scan_abort(struct il_priv *il)
static void
il_complete_scan(struct il_priv *il, bool aborted)
{
	struct cfg80211_scan_info info = {
		.aborted = aborted,
	};

	/* check if scan was requested from mac80211 */
	if (il->scan_request) {
		D_SCAN("Complete scan in mac80211\n");
		ieee80211_scan_completed(il->hw, aborted);
		ieee80211_scan_completed(il->hw, &info);
	}

	il->scan_vif = NULL;
+5 −1
Original line number Diff line number Diff line
@@ -94,10 +94,14 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)

static void iwl_complete_scan(struct iwl_priv *priv, bool aborted)
{
	struct cfg80211_scan_info info = {
		.aborted = aborted,
	};

	/* check if scan was requested from mac80211 */
	if (priv->scan_request) {
		IWL_DEBUG_SCAN(priv, "Complete scan in mac80211\n");
		ieee80211_scan_completed(priv->hw, aborted);
		ieee80211_scan_completed(priv->hw, &info);
	}

	priv->scan_type = IWL_SCAN_NORMAL;
Loading