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

Commit 4db89e14 authored by John W. Linville's avatar John W. Linville
Browse files
parents 4978705d d86aa4f8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -893,6 +893,8 @@ struct tpt_led_trigger {
 *	that the scan completed.
 * @SCAN_ABORTED: Set for our scan work function when the driver reported
 *	a scan complete for an aborted scan.
 * @SCAN_HW_CANCELLED: Set for our scan work function when the scan is being
 *	cancelled.
 */
enum {
	SCAN_SW_SCANNING,
@@ -900,6 +902,7 @@ enum {
	SCAN_ONCHANNEL_SCANNING,
	SCAN_COMPLETED,
	SCAN_ABORTED,
	SCAN_HW_CANCELLED,
};

/**
+19 −0
Original line number Diff line number Diff line
@@ -238,6 +238,9 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local)
	enum ieee80211_band band;
	int i, ielen, n_chans;

	if (test_bit(SCAN_HW_CANCELLED, &local->scanning))
		return false;

	do {
		if (local->hw_scan_band == IEEE80211_NUM_BANDS)
			return false;
@@ -940,7 +943,23 @@ void ieee80211_scan_cancel(struct ieee80211_local *local)
	if (!local->scan_req)
		goto out;

	/*
	 * We have a scan running and the driver already reported completion,
	 * but the worker hasn't run yet or is stuck on the mutex - mark it as
	 * cancelled.
	 */
	if (test_bit(SCAN_HW_SCANNING, &local->scanning) &&
	    test_bit(SCAN_COMPLETED, &local->scanning)) {
		set_bit(SCAN_HW_CANCELLED, &local->scanning);
		goto out;
	}

	if (test_bit(SCAN_HW_SCANNING, &local->scanning)) {
		/*
		 * Make sure that __ieee80211_scan_completed doesn't trigger a
		 * scan on another band.
		 */
		set_bit(SCAN_HW_CANCELLED, &local->scanning);
		if (local->ops->cancel_hw_scan)
			drv_cancel_hw_scan(local,
				rcu_dereference_protected(local->scan_sdata,
+4 −0
Original line number Diff line number Diff line
@@ -2238,6 +2238,10 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local,
	}

	rate = cfg80211_calculate_bitrate(&ri);
	if (WARN_ONCE(!rate,
		      "Invalid bitrate: flags=0x%x, idx=%d, vht_nss=%d\n",
		      status->flag, status->rate_idx, status->vht_nss))
		return 0;

	/* rewind from end of MPDU */
	if (status->flag & RX_FLAG_MACTIME_END)
+0 −2
Original line number Diff line number Diff line
@@ -958,8 +958,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
	case NETDEV_PRE_UP:
		if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
			return notifier_from_errno(-EOPNOTSUPP);
		if (rfkill_blocked(rdev->rfkill))
			return notifier_from_errno(-ERFKILL);
		ret = cfg80211_can_add_interface(rdev, wdev->iftype);
		if (ret)
			return notifier_from_errno(ret);
+3 −0
Original line number Diff line number Diff line
@@ -411,6 +411,9 @@ static inline int
cfg80211_can_add_interface(struct cfg80211_registered_device *rdev,
			   enum nl80211_iftype iftype)
{
	if (rfkill_blocked(rdev->rfkill))
		return -ERFKILL;

	return cfg80211_can_change_interface(rdev, NULL, iftype);
}

Loading