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

Commit fbe9c429 authored by Helmut Schaa's avatar Helmut Schaa Committed by John W. Linville
Browse files

mac80211: Replace {sw, hw}_scanning variables with a bitfield



Use a bitfield to store the current scan mode instead of two boolean
variables {sw,hw}_scanning. This patch does not introduce functional
changes but allows us to enhance the scan flags later (for example
for background scanning).

Signed-off-by: default avatarHelmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2fb3f028
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -742,7 +742,7 @@ static void ieee80211_ibss_work(struct work_struct *work)
	if (!netif_running(sdata->dev))
		return;

	if (local->sw_scanning || local->hw_scanning)
	if (local->scanning)
		return;

	if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_ADHOC))
+6 −1
Original line number Diff line number Diff line
@@ -570,6 +570,11 @@ enum queue_stop_reason {
	IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
};

enum {
	SCAN_SW_SCANNING,
	SCAN_HW_SCANNING
};

struct ieee80211_local {
	/* embed the driver visible part.
	 * don't cast (use the static inlines below), but we keep
@@ -668,7 +673,7 @@ struct ieee80211_local {

	/* Scanning and BSS list */
	struct mutex scan_mtx;
	bool sw_scanning, hw_scanning;
	unsigned long scanning;
	struct cfg80211_ssid scan_ssid;
	struct cfg80211_scan_request int_scan_req;
	struct cfg80211_scan_request *scan_req;
+2 −2
Original line number Diff line number Diff line
@@ -518,7 +518,7 @@ static int ieee80211_stop(struct net_device *dev)
			 * the scan_sdata is NULL already don't send out a
			 * scan event to userspace -- the scan is incomplete.
			 */
			if (local->sw_scanning)
			if (test_bit(SCAN_SW_SCANNING, &local->scanning))
				ieee80211_scan_completed(&local->hw, true);
		}

@@ -920,7 +920,7 @@ u32 __ieee80211_recalc_idle(struct ieee80211_local *local)
	struct ieee80211_sub_if_data *sdata;
	int count = 0;

	if (local->hw_scanning || local->sw_scanning)
	if (local->scanning)
		return ieee80211_idle_off(local, "scanning");

	list_for_each_entry(sdata, &local->interfaces, list) {
+1 −1
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
	}

	if (changed & BSS_CHANGED_BEACON_ENABLED) {
		if (local->sw_scanning) {
		if (test_bit(SCAN_SW_SCANNING, &local->scanning)) {
			sdata->vif.bss_conf.enable_beacon = false;
		} else {
			/*
+1 −1
Original line number Diff line number Diff line
@@ -597,7 +597,7 @@ static void ieee80211_mesh_work(struct work_struct *work)
	if (!netif_running(sdata->dev))
		return;

	if (local->sw_scanning || local->hw_scanning)
	if (local->scanning)
		return;

	while ((skb = skb_dequeue(&ifmsh->skb_queue)))
Loading