All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/20] staging: wfx: simplify filtering
@ 2020-04-15 16:11 ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

The frame filtering is more complex than necessary. This series simplify
the  whole process and hopefully fixes some corner cases.

Jérôme Pouiller (20):
  staging: wfx: update filtering even if not connected
  staging: wfx: simplify wfx_update_filtering()
  staging: wfx: rework wfx_configure_filter()
  staging: wfx: simplify handling of beacon filter during join process
  staging: wfx: wfx_update_filtering_work() is no more used
  staging: wfx: do not wait for a dtim before associate
  staging: wfx: disabling beacon filtering after hif_reset() is useless
  staging: wfx: do not use built-in AUTO_ERP feature
  staging: wfx: stop changing filtering rule in wfx_hw_scan()
  staging: wfx: ensure that probe requests are filtered when AP
  staging: wfx: drop useless wfx_fwd_probe_req()
  staging: wfx: align semantic of beacon filter with other filters
  staging: wfx: align semantic of probe request filter with other
    filters
  staging: wfx: drop struct wfx_grp_addr_table
  staging: wfx: drop useless call to hif_set_rx_filter()
  staging: wfx: drop useless attributes 'filter_prbreq' and
    'filter_bssid'
  staging: wfx: split out wfx_filter_beacon()
  staging: wfx: drop useless filter update when starting AP
  staging: wfx: drop useless attribute 'filter_mcast'
  staging: wfx: update TODO

 drivers/staging/wfx/TODO         |  40 +++-----
 drivers/staging/wfx/data_rx.c    |  12 ---
 drivers/staging/wfx/hif_tx_mib.c |   4 +-
 drivers/staging/wfx/main.c       |   1 -
 drivers/staging/wfx/scan.c       |   1 -
 drivers/staging/wfx/sta.c        | 171 +++++++++++++++----------------
 drivers/staging/wfx/sta.h        |   8 --
 drivers/staging/wfx/wfx.h        |   7 +-
 8 files changed, 101 insertions(+), 143 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 00/20] staging: wfx: simplify filtering
@ 2020-04-15 16:11 ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

The frame filtering is more complex than necessary. This series simplify
the  whole process and hopefully fixes some corner cases.

Jérôme Pouiller (20):
  staging: wfx: update filtering even if not connected
  staging: wfx: simplify wfx_update_filtering()
  staging: wfx: rework wfx_configure_filter()
  staging: wfx: simplify handling of beacon filter during join process
  staging: wfx: wfx_update_filtering_work() is no more used
  staging: wfx: do not wait for a dtim before associate
  staging: wfx: disabling beacon filtering after hif_reset() is useless
  staging: wfx: do not use built-in AUTO_ERP feature
  staging: wfx: stop changing filtering rule in wfx_hw_scan()
  staging: wfx: ensure that probe requests are filtered when AP
  staging: wfx: drop useless wfx_fwd_probe_req()
  staging: wfx: align semantic of beacon filter with other filters
  staging: wfx: align semantic of probe request filter with other
    filters
  staging: wfx: drop struct wfx_grp_addr_table
  staging: wfx: drop useless call to hif_set_rx_filter()
  staging: wfx: drop useless attributes 'filter_prbreq' and
    'filter_bssid'
  staging: wfx: split out wfx_filter_beacon()
  staging: wfx: drop useless filter update when starting AP
  staging: wfx: drop useless attribute 'filter_mcast'
  staging: wfx: update TODO

 drivers/staging/wfx/TODO         |  40 +++-----
 drivers/staging/wfx/data_rx.c    |  12 ---
 drivers/staging/wfx/hif_tx_mib.c |   4 +-
 drivers/staging/wfx/main.c       |   1 -
 drivers/staging/wfx/scan.c       |   1 -
 drivers/staging/wfx/sta.c        | 171 +++++++++++++++----------------
 drivers/staging/wfx/sta.h        |   8 --
 drivers/staging/wfx/wfx.h        |   7 +-
 8 files changed, 101 insertions(+), 143 deletions(-)

-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 01/20] staging: wfx: update filtering even if not connected
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Currently, filtering are not update if the device is not connected.
There is no obvious rationale for that. Updating filtering while it is
not necessary is harmless. On the other hand, it is difficult to ensure
that the filtering rule has been correctly sent to the firmware.

Just drop this useless condition.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index f1df7717d5f4..cb9d14471745 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -168,9 +168,6 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 		}
 	};
 
-	if (wvif->state == WFX_STATE_PASSIVE)
-		return;
-
 	if (wvif->disable_beacon_filter) {
 		bf_enable = 0;
 		bf_count = 1;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 01/20] staging: wfx: update filtering even if not connected
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Currently, filtering are not update if the device is not connected.
There is no obvious rationale for that. Updating filtering while it is
not necessary is harmless. On the other hand, it is difficult to ensure
that the filtering rule has been correctly sent to the firmware.

Just drop this useless condition.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index f1df7717d5f4..cb9d14471745 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -168,9 +168,6 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 		}
 	};
 
-	if (wvif->state == WFX_STATE_PASSIVE)
-		return;
-
 	if (wvif->disable_beacon_filter) {
 		bf_enable = 0;
 		bf_count = 1;
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 02/20] staging: wfx: simplify wfx_update_filtering()
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Inline wfx_set_mcast_filter() into wfx_update_filtering() and remove
useless intermediate variables.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 69 ++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 44 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index cb9d14471745..14e2f106b042 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -120,34 +120,9 @@ int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable)
 				 wvif->fwd_probe_req);
 }
 
-static int wfx_set_mcast_filter(struct wfx_vif *wvif,
-				    struct wfx_grp_addr_table *fp)
-{
-	int i;
-
-	// Temporary workaround for filters
-	return hif_set_data_filtering(wvif, false, true);
-
-	if (!fp->enable)
-		return hif_set_data_filtering(wvif, false, true);
-
-	for (i = 0; i < fp->num_addresses; i++)
-		hif_set_mac_addr_condition(wvif, i, fp->address_list[i]);
-	hif_set_uc_mc_bc_condition(wvif, 0,
-				   HIF_FILTER_UNICAST | HIF_FILTER_BROADCAST);
-	hif_set_config_data_filter(wvif, true, 0, BIT(1),
-				   BIT(fp->num_addresses) - 1);
-	hif_set_data_filtering(wvif, true, true);
-
-	return 0;
-}
-
 void wfx_update_filtering(struct wfx_vif *wvif)
 {
-	int ret;
-	int bf_enable;
-	int bf_count;
-	int n_filter_ies;
+	int i;
 	const struct hif_ie_table_entry filter_ies[] = {
 		{
 			.ie_id        = WLAN_EID_VENDOR_SPECIFIC,
@@ -168,29 +143,35 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 		}
 	};
 
+	hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->fwd_probe_req);
 	if (wvif->disable_beacon_filter) {
-		bf_enable = 0;
-		bf_count = 1;
-		n_filter_ies = 0;
+		hif_set_beacon_filter_table(wvif, 0, NULL);
+		hif_beacon_filter_control(wvif, 0, 1);
 	} else if (wvif->vif->type != NL80211_IFTYPE_STATION) {
-		bf_enable = HIF_BEACON_FILTER_ENABLE | HIF_BEACON_FILTER_AUTO_ERP;
-		bf_count = 0;
-		n_filter_ies = 2;
+		hif_set_beacon_filter_table(wvif, 2, filter_ies);
+		hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE |
+						HIF_BEACON_FILTER_AUTO_ERP, 0);
 	} else {
-		bf_enable = HIF_BEACON_FILTER_ENABLE;
-		bf_count = 0;
-		n_filter_ies = 3;
+		hif_set_beacon_filter_table(wvif, 3, filter_ies);
+		hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE, 0);
 	}
 
-	ret = hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->fwd_probe_req);
-	if (!ret)
-		ret = hif_set_beacon_filter_table(wvif, n_filter_ies, filter_ies);
-	if (!ret)
-		ret = hif_beacon_filter_control(wvif, bf_enable, bf_count);
-	if (!ret)
-		ret = wfx_set_mcast_filter(wvif, &wvif->mcast_filter);
-	if (ret)
-		dev_err(wvif->wdev->dev, "update filtering failed: %d\n", ret);
+	// Temporary workaround for filters
+	hif_set_data_filtering(wvif, false, true);
+	return;
+
+	if (!wvif->mcast_filter.enable) {
+		hif_set_data_filtering(wvif, false, true);
+		return;
+	}
+	for (i = 0; i < wvif->mcast_filter.num_addresses; i++)
+		hif_set_mac_addr_condition(wvif, i,
+					   wvif->mcast_filter.address_list[i]);
+	hif_set_uc_mc_bc_condition(wvif, 0,
+				   HIF_FILTER_UNICAST | HIF_FILTER_BROADCAST);
+	hif_set_config_data_filter(wvif, true, 0, BIT(1),
+				   BIT(wvif->mcast_filter.num_addresses) - 1);
+	hif_set_data_filtering(wvif, true, true);
 }
 
 static void wfx_update_filtering_work(struct work_struct *work)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 02/20] staging: wfx: simplify wfx_update_filtering()
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Inline wfx_set_mcast_filter() into wfx_update_filtering() and remove
useless intermediate variables.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 69 ++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 44 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index cb9d14471745..14e2f106b042 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -120,34 +120,9 @@ int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable)
 				 wvif->fwd_probe_req);
 }
 
-static int wfx_set_mcast_filter(struct wfx_vif *wvif,
-				    struct wfx_grp_addr_table *fp)
-{
-	int i;
-
-	// Temporary workaround for filters
-	return hif_set_data_filtering(wvif, false, true);
-
-	if (!fp->enable)
-		return hif_set_data_filtering(wvif, false, true);
-
-	for (i = 0; i < fp->num_addresses; i++)
-		hif_set_mac_addr_condition(wvif, i, fp->address_list[i]);
-	hif_set_uc_mc_bc_condition(wvif, 0,
-				   HIF_FILTER_UNICAST | HIF_FILTER_BROADCAST);
-	hif_set_config_data_filter(wvif, true, 0, BIT(1),
-				   BIT(fp->num_addresses) - 1);
-	hif_set_data_filtering(wvif, true, true);
-
-	return 0;
-}
-
 void wfx_update_filtering(struct wfx_vif *wvif)
 {
-	int ret;
-	int bf_enable;
-	int bf_count;
-	int n_filter_ies;
+	int i;
 	const struct hif_ie_table_entry filter_ies[] = {
 		{
 			.ie_id        = WLAN_EID_VENDOR_SPECIFIC,
@@ -168,29 +143,35 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 		}
 	};
 
+	hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->fwd_probe_req);
 	if (wvif->disable_beacon_filter) {
-		bf_enable = 0;
-		bf_count = 1;
-		n_filter_ies = 0;
+		hif_set_beacon_filter_table(wvif, 0, NULL);
+		hif_beacon_filter_control(wvif, 0, 1);
 	} else if (wvif->vif->type != NL80211_IFTYPE_STATION) {
-		bf_enable = HIF_BEACON_FILTER_ENABLE | HIF_BEACON_FILTER_AUTO_ERP;
-		bf_count = 0;
-		n_filter_ies = 2;
+		hif_set_beacon_filter_table(wvif, 2, filter_ies);
+		hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE |
+						HIF_BEACON_FILTER_AUTO_ERP, 0);
 	} else {
-		bf_enable = HIF_BEACON_FILTER_ENABLE;
-		bf_count = 0;
-		n_filter_ies = 3;
+		hif_set_beacon_filter_table(wvif, 3, filter_ies);
+		hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE, 0);
 	}
 
-	ret = hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->fwd_probe_req);
-	if (!ret)
-		ret = hif_set_beacon_filter_table(wvif, n_filter_ies, filter_ies);
-	if (!ret)
-		ret = hif_beacon_filter_control(wvif, bf_enable, bf_count);
-	if (!ret)
-		ret = wfx_set_mcast_filter(wvif, &wvif->mcast_filter);
-	if (ret)
-		dev_err(wvif->wdev->dev, "update filtering failed: %d\n", ret);
+	// Temporary workaround for filters
+	hif_set_data_filtering(wvif, false, true);
+	return;
+
+	if (!wvif->mcast_filter.enable) {
+		hif_set_data_filtering(wvif, false, true);
+		return;
+	}
+	for (i = 0; i < wvif->mcast_filter.num_addresses; i++)
+		hif_set_mac_addr_condition(wvif, i,
+					   wvif->mcast_filter.address_list[i]);
+	hif_set_uc_mc_bc_condition(wvif, 0,
+				   HIF_FILTER_UNICAST | HIF_FILTER_BROADCAST);
+	hif_set_config_data_filter(wvif, true, 0, BIT(1),
+				   BIT(wvif->mcast_filter.num_addresses) - 1);
+	hif_set_data_filtering(wvif, true, true);
 }
 
 static void wfx_update_filtering_work(struct work_struct *work)
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 03/20] staging: wfx: rework wfx_configure_filter()
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

wfx_configure_filter() lacks of coherency. In add, some corner cases
seems to not been handled properly. Rework the whole function().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 41 +++++++++++++++++++++++++++++++++------
 1 file changed, 35 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 14e2f106b042..ec949ce0b256 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -203,7 +203,6 @@ u64 wfx_prepare_multicast(struct ieee80211_hw *hw,
 					ha->addr);
 			i++;
 		}
-		wvif->mcast_filter.enable = true;
 		wvif->mcast_filter.num_addresses = count;
 	}
 
@@ -218,16 +217,46 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 	struct wfx_vif *wvif = NULL;
 	struct wfx_dev *wdev = hw->priv;
 
-	*total_flags &= FIF_OTHER_BSS | FIF_FCSFAIL | FIF_PROBE_REQ;
+	// Notes:
+	//   - Probe responses (FIF_BCN_PRBRESP_PROMISC) are never filtered
+	//   - PS-Poll (FIF_PSPOLL) are never filtered
+	//   - RTS, CTS and Ack (FIF_CONTROL) are always filtered
+	//   - Broken frames (FIF_FCSFAIL and FIF_PLCPFAIL) are always filtered
+	//   - Firmware does (yet) allow to forward unicast traffic sent to
+	//     other stations (aka. promiscuous mode)
+	*total_flags &= FIF_BCN_PRBRESP_PROMISC | FIF_ALLMULTI | FIF_OTHER_BSS |
+			FIF_PROBE_REQ | FIF_PSPOLL;
 
 	mutex_lock(&wdev->conf_mutex);
 	while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
 		mutex_lock(&wvif->scan_lock);
-		wvif->filter_bssid = (*total_flags &
-				      (FIF_OTHER_BSS | FIF_PROBE_REQ)) ? 0 : 1;
-		wvif->disable_beacon_filter = !(*total_flags & FIF_PROBE_REQ);
-		wfx_fwd_probe_req(wvif, true);
+
+		// Note: FIF_BCN_PRBRESP_PROMISC covers probe response and
+		// beacons from other BSS
+		if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
+			wvif->disable_beacon_filter = true;
+		else
+			wvif->disable_beacon_filter = false;
+
+		if (*total_flags & FIF_ALLMULTI) {
+			wvif->mcast_filter.enable = false;
+		} else if (!wvif->mcast_filter.num_addresses) {
+			dev_dbg(wdev->dev, "disabling unconfigured multicast filter");
+			wvif->mcast_filter.enable = false;
+		} else {
+			wvif->mcast_filter.enable = true;
+		}
 		wfx_update_filtering(wvif);
+
+		if (*total_flags & FIF_OTHER_BSS)
+			wvif->filter_bssid = false;
+		else
+			wvif->filter_bssid = true;
+
+		if (*total_flags & FIF_PROBE_REQ)
+			wfx_fwd_probe_req(wvif, true);
+		else
+			wfx_fwd_probe_req(wvif, false);
 		mutex_unlock(&wvif->scan_lock);
 	}
 	mutex_unlock(&wdev->conf_mutex);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 03/20] staging: wfx: rework wfx_configure_filter()
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

wfx_configure_filter() lacks of coherency. In add, some corner cases
seems to not been handled properly. Rework the whole function().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 41 +++++++++++++++++++++++++++++++++------
 1 file changed, 35 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 14e2f106b042..ec949ce0b256 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -203,7 +203,6 @@ u64 wfx_prepare_multicast(struct ieee80211_hw *hw,
 					ha->addr);
 			i++;
 		}
-		wvif->mcast_filter.enable = true;
 		wvif->mcast_filter.num_addresses = count;
 	}
 
@@ -218,16 +217,46 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 	struct wfx_vif *wvif = NULL;
 	struct wfx_dev *wdev = hw->priv;
 
-	*total_flags &= FIF_OTHER_BSS | FIF_FCSFAIL | FIF_PROBE_REQ;
+	// Notes:
+	//   - Probe responses (FIF_BCN_PRBRESP_PROMISC) are never filtered
+	//   - PS-Poll (FIF_PSPOLL) are never filtered
+	//   - RTS, CTS and Ack (FIF_CONTROL) are always filtered
+	//   - Broken frames (FIF_FCSFAIL and FIF_PLCPFAIL) are always filtered
+	//   - Firmware does (yet) allow to forward unicast traffic sent to
+	//     other stations (aka. promiscuous mode)
+	*total_flags &= FIF_BCN_PRBRESP_PROMISC | FIF_ALLMULTI | FIF_OTHER_BSS |
+			FIF_PROBE_REQ | FIF_PSPOLL;
 
 	mutex_lock(&wdev->conf_mutex);
 	while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
 		mutex_lock(&wvif->scan_lock);
-		wvif->filter_bssid = (*total_flags &
-				      (FIF_OTHER_BSS | FIF_PROBE_REQ)) ? 0 : 1;
-		wvif->disable_beacon_filter = !(*total_flags & FIF_PROBE_REQ);
-		wfx_fwd_probe_req(wvif, true);
+
+		// Note: FIF_BCN_PRBRESP_PROMISC covers probe response and
+		// beacons from other BSS
+		if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
+			wvif->disable_beacon_filter = true;
+		else
+			wvif->disable_beacon_filter = false;
+
+		if (*total_flags & FIF_ALLMULTI) {
+			wvif->mcast_filter.enable = false;
+		} else if (!wvif->mcast_filter.num_addresses) {
+			dev_dbg(wdev->dev, "disabling unconfigured multicast filter");
+			wvif->mcast_filter.enable = false;
+		} else {
+			wvif->mcast_filter.enable = true;
+		}
 		wfx_update_filtering(wvif);
+
+		if (*total_flags & FIF_OTHER_BSS)
+			wvif->filter_bssid = false;
+		else
+			wvif->filter_bssid = true;
+
+		if (*total_flags & FIF_PROBE_REQ)
+			wfx_fwd_probe_req(wvif, true);
+		else
+			wfx_fwd_probe_req(wvif, false);
 		mutex_unlock(&wvif->scan_lock);
 	}
 	mutex_unlock(&wdev->conf_mutex);
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 04/20] staging: wfx: simplify handling of beacon filter during join process
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

When the device joins an AP, beacon are forwarded to the host. Once has
retrieved all necessary parameters, we can start to filter the beacon
(and only beacon with changed/new data will be forwarded).

Currently, the driver detect beacons in data Rx process. It is far more
easier to just wait for the BSS_CHANGED_BEACON_INFO event.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/data_rx.c | 12 ------------
 drivers/staging/wfx/sta.c     | 10 +++++++++-
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c
index c5b83fedeb55..c3b3edae3420 100644
--- a/drivers/staging/wfx/data_rx.c
+++ b/drivers/staging/wfx/data_rx.c
@@ -118,18 +118,6 @@ void wfx_rx_cb(struct wfx_vif *wvif,
 	    arg->rx_flags.match_uc_addr &&
 	    mgmt->u.action.category == WLAN_CATEGORY_BACK)
 		goto drop;
-	if (ieee80211_is_beacon(frame->frame_control) &&
-	    !arg->status && wvif->vif &&
-	    ether_addr_equal(ieee80211_get_SA(frame),
-			     wvif->vif->bss_conf.bssid)) {
-		/* Disable beacon filter once we're associated... */
-		if (wvif->disable_beacon_filter &&
-		    (wvif->vif->bss_conf.assoc ||
-		     wvif->vif->bss_conf.ibss_joined)) {
-			wvif->disable_beacon_filter = false;
-			schedule_work(&wvif->update_filtering_work);
-		}
-	}
 	ieee80211_rx_irqsafe(wvif->wdev->hw, skb);
 
 	return;
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index ec949ce0b256..b01467f7606a 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -712,9 +712,17 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw,
 	if (changed & BSS_CHANGED_BEACON_ENABLED)
 		wfx_enable_beacon(wvif, info->enable_beacon);
 
-	if (changed & BSS_CHANGED_BEACON_INFO)
+	if (changed & BSS_CHANGED_BEACON_INFO) {
+		if (vif->type != NL80211_IFTYPE_STATION)
+			dev_warn(wdev->dev, "%s: misunderstood change: BEACON_INFO\n",
+				 __func__);
 		hif_set_beacon_wakeup_period(wvif, info->dtim_period,
 					     info->dtim_period);
+		// We temporary forwarded beacon for join process. It is now no
+		// more necessary.
+		wvif->disable_beacon_filter = false;
+		wfx_update_filtering(wvif);
+	}
 
 	/* assoc/disassoc, or maybe AID changed */
 	if (changed & BSS_CHANGED_ASSOC) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 04/20] staging: wfx: simplify handling of beacon filter during join process
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

When the device joins an AP, beacon are forwarded to the host. Once has
retrieved all necessary parameters, we can start to filter the beacon
(and only beacon with changed/new data will be forwarded).

Currently, the driver detect beacons in data Rx process. It is far more
easier to just wait for the BSS_CHANGED_BEACON_INFO event.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/data_rx.c | 12 ------------
 drivers/staging/wfx/sta.c     | 10 +++++++++-
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c
index c5b83fedeb55..c3b3edae3420 100644
--- a/drivers/staging/wfx/data_rx.c
+++ b/drivers/staging/wfx/data_rx.c
@@ -118,18 +118,6 @@ void wfx_rx_cb(struct wfx_vif *wvif,
 	    arg->rx_flags.match_uc_addr &&
 	    mgmt->u.action.category == WLAN_CATEGORY_BACK)
 		goto drop;
-	if (ieee80211_is_beacon(frame->frame_control) &&
-	    !arg->status && wvif->vif &&
-	    ether_addr_equal(ieee80211_get_SA(frame),
-			     wvif->vif->bss_conf.bssid)) {
-		/* Disable beacon filter once we're associated... */
-		if (wvif->disable_beacon_filter &&
-		    (wvif->vif->bss_conf.assoc ||
-		     wvif->vif->bss_conf.ibss_joined)) {
-			wvif->disable_beacon_filter = false;
-			schedule_work(&wvif->update_filtering_work);
-		}
-	}
 	ieee80211_rx_irqsafe(wvif->wdev->hw, skb);
 
 	return;
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index ec949ce0b256..b01467f7606a 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -712,9 +712,17 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw,
 	if (changed & BSS_CHANGED_BEACON_ENABLED)
 		wfx_enable_beacon(wvif, info->enable_beacon);
 
-	if (changed & BSS_CHANGED_BEACON_INFO)
+	if (changed & BSS_CHANGED_BEACON_INFO) {
+		if (vif->type != NL80211_IFTYPE_STATION)
+			dev_warn(wdev->dev, "%s: misunderstood change: BEACON_INFO\n",
+				 __func__);
 		hif_set_beacon_wakeup_period(wvif, info->dtim_period,
 					     info->dtim_period);
+		// We temporary forwarded beacon for join process. It is now no
+		// more necessary.
+		wvif->disable_beacon_filter = false;
+		wfx_update_filtering(wvif);
+	}
 
 	/* assoc/disassoc, or maybe AID changed */
 	if (changed & BSS_CHANGED_ASSOC) {
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 05/20] staging: wfx: wfx_update_filtering_work() is no more used
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Since we had simplified the join process, update_filtering_work is no
more used. Drop it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 10 ----------
 drivers/staging/wfx/sta.h |  1 -
 drivers/staging/wfx/wfx.h |  1 -
 3 files changed, 12 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index b01467f7606a..7255899b4a5a 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -174,14 +174,6 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 	hif_set_data_filtering(wvif, true, true);
 }
 
-static void wfx_update_filtering_work(struct work_struct *work)
-{
-	struct wfx_vif *wvif = container_of(work, struct wfx_vif,
-					    update_filtering_work);
-
-	wfx_update_filtering(wvif);
-}
-
 u64 wfx_prepare_multicast(struct ieee80211_hw *hw,
 			  struct netdev_hw_addr_list *mc_list)
 {
@@ -415,7 +407,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif)
 	if (wvif->state == WFX_STATE_AP)
 		return;
 
-	cancel_work_sync(&wvif->update_filtering_work);
 	wvif->state = WFX_STATE_PASSIVE;
 
 	/* Unjoin is a reset. */
@@ -934,7 +925,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 
 	init_completion(&wvif->set_pm_mode_complete);
 	complete(&wvif->set_pm_mode_complete);
-	INIT_WORK(&wvif->update_filtering_work, wfx_update_filtering_work);
 	INIT_WORK(&wvif->bss_params_work, wfx_bss_params_work);
 	INIT_WORK(&wvif->tx_policy_upload_work, wfx_tx_policy_upload_work);
 
diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h
index 3002d89dc871..8d76fba5f504 100644
--- a/drivers/staging/wfx/sta.h
+++ b/drivers/staging/wfx/sta.h
@@ -88,7 +88,6 @@ void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd);
 
 // Other Helpers
 void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad);
-void wfx_update_filtering(struct wfx_vif *wvif);
 int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable);
 u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates);
 
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 41d67dc091a6..a69d9c9c37b6 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -91,7 +91,6 @@ struct wfx_vif {
 	bool			filter_bssid;
 	bool			fwd_probe_req;
 	bool			disable_beacon_filter;
-	struct work_struct	update_filtering_work;
 
 	unsigned long		uapsd_mask;
 	struct hif_req_set_bss_params bss_params;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 05/20] staging: wfx: wfx_update_filtering_work() is no more used
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Since we had simplified the join process, update_filtering_work is no
more used. Drop it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 10 ----------
 drivers/staging/wfx/sta.h |  1 -
 drivers/staging/wfx/wfx.h |  1 -
 3 files changed, 12 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index b01467f7606a..7255899b4a5a 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -174,14 +174,6 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 	hif_set_data_filtering(wvif, true, true);
 }
 
-static void wfx_update_filtering_work(struct work_struct *work)
-{
-	struct wfx_vif *wvif = container_of(work, struct wfx_vif,
-					    update_filtering_work);
-
-	wfx_update_filtering(wvif);
-}
-
 u64 wfx_prepare_multicast(struct ieee80211_hw *hw,
 			  struct netdev_hw_addr_list *mc_list)
 {
@@ -415,7 +407,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif)
 	if (wvif->state == WFX_STATE_AP)
 		return;
 
-	cancel_work_sync(&wvif->update_filtering_work);
 	wvif->state = WFX_STATE_PASSIVE;
 
 	/* Unjoin is a reset. */
@@ -934,7 +925,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 
 	init_completion(&wvif->set_pm_mode_complete);
 	complete(&wvif->set_pm_mode_complete);
-	INIT_WORK(&wvif->update_filtering_work, wfx_update_filtering_work);
 	INIT_WORK(&wvif->bss_params_work, wfx_bss_params_work);
 	INIT_WORK(&wvif->tx_policy_upload_work, wfx_tx_policy_upload_work);
 
diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h
index 3002d89dc871..8d76fba5f504 100644
--- a/drivers/staging/wfx/sta.h
+++ b/drivers/staging/wfx/sta.h
@@ -88,7 +88,6 @@ void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd);
 
 // Other Helpers
 void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad);
-void wfx_update_filtering(struct wfx_vif *wvif);
 int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable);
 u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates);
 
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 41d67dc091a6..a69d9c9c37b6 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -91,7 +91,6 @@ struct wfx_vif {
 	bool			filter_bssid;
 	bool			fwd_probe_req;
 	bool			disable_beacon_filter;
-	struct work_struct	update_filtering_work;
 
 	unsigned long		uapsd_mask;
 	struct hif_req_set_bss_params bss_params;
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 06/20] staging: wfx: do not wait for a dtim before associate
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

The only reason we ask to mac80211 to wait for a dtim before to
associate is to get an accurate DTIM value. However, we can temporary
set the dtim period to 1. Then we can waiting for
BSS_CHANGED_BEACON_INFO for the real value. Thus, the association
process is faster.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/main.c | 1 -
 drivers/staging/wfx/sta.c  | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index b8a01ba0d381..8a2c96dacd63 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -288,7 +288,6 @@ struct wfx_dev *wfx_init_common(struct device *dev,
 
 	SET_IEEE80211_DEV(hw, dev);
 
-	ieee80211_hw_set(hw, NEED_DTIM_BEFORE_ASSOC);
 	ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW);
 	ieee80211_hw_set(hw, AMPDU_AGGREGATION);
 	ieee80211_hw_set(hw, CONNECTION_MONITOR);
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 7255899b4a5a..c8a23146cae0 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -630,8 +630,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif,
 		wvif->state = WFX_STATE_STA;
 		hif_keep_alive_period(wvif, 0);
 		hif_set_bss_params(wvif, &wvif->bss_params);
-		hif_set_beacon_wakeup_period(wvif, info->dtim_period,
-					     info->dtim_period);
+		hif_set_beacon_wakeup_period(wvif, 1, 1);
 		wfx_update_pm(wvif);
 	}
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 06/20] staging: wfx: do not wait for a dtim before associate
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

The only reason we ask to mac80211 to wait for a dtim before to
associate is to get an accurate DTIM value. However, we can temporary
set the dtim period to 1. Then we can waiting for
BSS_CHANGED_BEACON_INFO for the real value. Thus, the association
process is faster.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/main.c | 1 -
 drivers/staging/wfx/sta.c  | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index b8a01ba0d381..8a2c96dacd63 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -288,7 +288,6 @@ struct wfx_dev *wfx_init_common(struct device *dev,
 
 	SET_IEEE80211_DEV(hw, dev);
 
-	ieee80211_hw_set(hw, NEED_DTIM_BEFORE_ASSOC);
 	ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW);
 	ieee80211_hw_set(hw, AMPDU_AGGREGATION);
 	ieee80211_hw_set(hw, CONNECTION_MONITOR);
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 7255899b4a5a..c8a23146cae0 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -630,8 +630,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif,
 		wvif->state = WFX_STATE_STA;
 		hif_keep_alive_period(wvif, 0);
 		hif_set_bss_params(wvif, &wvif->bss_params);
-		hif_set_beacon_wakeup_period(wvif, info->dtim_period,
-					     info->dtim_period);
+		hif_set_beacon_wakeup_period(wvif, 1, 1);
 		wfx_update_pm(wvif);
 	}
 }
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 07/20] staging: wfx: disabling beacon filtering after hif_reset() is useless
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

After hif_reset(), device stop to receive any RF data. So, it is
useless to disable beacon filtering. In add, if necessary, mac80211 will
call wfx_configure_filter().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index c8a23146cae0..7c8ebd76114e 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -419,8 +419,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif)
 	cancel_work_sync(&wvif->event_handler_work);
 	wfx_cqm_bssloss_sm(wvif, 0, 0, 0);
 
-	wvif->disable_beacon_filter = false;
-	wfx_update_filtering(wvif);
 	memset(&wvif->bss_params, 0, sizeof(wvif->bss_params));
 	wfx_tx_unlock(wvif->wdev);
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 07/20] staging: wfx: disabling beacon filtering after hif_reset() is useless
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

After hif_reset(), device stop to receive any RF data. So, it is
useless to disable beacon filtering. In add, if necessary, mac80211 will
call wfx_configure_filter().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index c8a23146cae0..7c8ebd76114e 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -419,8 +419,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif)
 	cancel_work_sync(&wvif->event_handler_work);
 	wfx_cqm_bssloss_sm(wvif, 0, 0, 0);
 
-	wvif->disable_beacon_filter = false;
-	wfx_update_filtering(wvif);
 	memset(&wvif->bss_params, 0, sizeof(wvif->bss_params));
 	wfx_tx_unlock(wvif->wdev);
 }
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 08/20] staging: wfx: do not use built-in AUTO_ERP feature
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Firmware is able to detect detect changes about ERP protection in
beacons and automatically enable/disable ERP protection. However, it not
bring performance improvements and we are more confident in the ERP
handling of mac80211. So, the patch disable this feature.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 7c8ebd76114e..0b2ef2d3023b 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -147,10 +147,6 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 	if (wvif->disable_beacon_filter) {
 		hif_set_beacon_filter_table(wvif, 0, NULL);
 		hif_beacon_filter_control(wvif, 0, 1);
-	} else if (wvif->vif->type != NL80211_IFTYPE_STATION) {
-		hif_set_beacon_filter_table(wvif, 2, filter_ies);
-		hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE |
-						HIF_BEACON_FILTER_AUTO_ERP, 0);
 	} else {
 		hif_set_beacon_filter_table(wvif, 3, filter_ies);
 		hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE, 0);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 08/20] staging: wfx: do not use built-in AUTO_ERP feature
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Firmware is able to detect detect changes about ERP protection in
beacons and automatically enable/disable ERP protection. However, it not
bring performance improvements and we are more confident in the ERP
handling of mac80211. So, the patch disable this feature.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 7c8ebd76114e..0b2ef2d3023b 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -147,10 +147,6 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 	if (wvif->disable_beacon_filter) {
 		hif_set_beacon_filter_table(wvif, 0, NULL);
 		hif_beacon_filter_control(wvif, 0, 1);
-	} else if (wvif->vif->type != NL80211_IFTYPE_STATION) {
-		hif_set_beacon_filter_table(wvif, 2, filter_ies);
-		hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE |
-						HIF_BEACON_FILTER_AUTO_ERP, 0);
 	} else {
 		hif_set_beacon_filter_table(wvif, 3, filter_ies);
 		hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE, 0);
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 09/20] staging: wfx: stop changing filtering rule in wfx_hw_scan()
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

It is not very clear why driver ask to firmware to stop filtering probe
request during scan. It is particularly weird because scan is not
supported in AP mode. In add, it does not restore previous filtering
state after scanning.

It seems to be a mistake and should be dropped.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/scan.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c
index 0c7f4eef045c..276fdacd7143 100644
--- a/drivers/staging/wfx/scan.c
+++ b/drivers/staging/wfx/scan.c
@@ -89,7 +89,6 @@ void wfx_hw_scan_work(struct work_struct *work)
 	mutex_lock(&wvif->wdev->conf_mutex);
 	mutex_lock(&wvif->scan_lock);
 	update_probe_tmpl(wvif, &hw_req->req);
-	wfx_fwd_probe_req(wvif, true);
 	chan_cur = 0;
 	do {
 		ret = send_scan_req(wvif, &hw_req->req, chan_cur);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 09/20] staging: wfx: stop changing filtering rule in wfx_hw_scan()
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

It is not very clear why driver ask to firmware to stop filtering probe
request during scan. It is particularly weird because scan is not
supported in AP mode. In add, it does not restore previous filtering
state after scanning.

It seems to be a mistake and should be dropped.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/scan.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c
index 0c7f4eef045c..276fdacd7143 100644
--- a/drivers/staging/wfx/scan.c
+++ b/drivers/staging/wfx/scan.c
@@ -89,7 +89,6 @@ void wfx_hw_scan_work(struct work_struct *work)
 	mutex_lock(&wvif->wdev->conf_mutex);
 	mutex_lock(&wvif->scan_lock);
 	update_probe_tmpl(wvif, &hw_req->req);
-	wfx_fwd_probe_req(wvif, true);
 	chan_cur = 0;
 	do {
 		ret = send_scan_req(wvif, &hw_req->req, chan_cur);
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 10/20] staging: wfx: ensure that probe requests are filtered when AP
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Device is able to automatically reply to probe request (therefore, the
probe requests are not forwarded to host). This feature is enabled by
wfx_start_ap(). However, further calls to wfx_configure_filter() can
disable it.

So, relocate the handling of probe request filtering in
wfx_configure_filter().

Note that wfx_configure_filter() is always called by mac80211 when an AP
start.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 0b2ef2d3023b..b785b1b7d583 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -241,6 +241,13 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		else
 			wvif->filter_bssid = true;
 
+		// In AP mode, chip can reply to probe request itself
+		if (*total_flags & FIF_PROBE_REQ &&
+		    wvif->vif->type == NL80211_IFTYPE_AP) {
+			dev_dbg(wdev->dev, "do not forward probe request in AP mode\n");
+			*total_flags &= ~FIF_PROBE_REQ;
+		}
+
 		if (*total_flags & FIF_PROBE_REQ)
 			wfx_fwd_probe_req(wvif, true);
 		else
@@ -577,7 +584,6 @@ int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 	wvif->state = WFX_STATE_AP;
 	wfx_update_filtering(wvif);
 	wfx_upload_ap_templates(wvif);
-	wfx_fwd_probe_req(wvif, false);
 	hif_start(wvif, &vif->bss_conf, wvif->channel);
 	return 0;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 10/20] staging: wfx: ensure that probe requests are filtered when AP
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Device is able to automatically reply to probe request (therefore, the
probe requests are not forwarded to host). This feature is enabled by
wfx_start_ap(). However, further calls to wfx_configure_filter() can
disable it.

So, relocate the handling of probe request filtering in
wfx_configure_filter().

Note that wfx_configure_filter() is always called by mac80211 when an AP
start.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 0b2ef2d3023b..b785b1b7d583 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -241,6 +241,13 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		else
 			wvif->filter_bssid = true;
 
+		// In AP mode, chip can reply to probe request itself
+		if (*total_flags & FIF_PROBE_REQ &&
+		    wvif->vif->type == NL80211_IFTYPE_AP) {
+			dev_dbg(wdev->dev, "do not forward probe request in AP mode\n");
+			*total_flags &= ~FIF_PROBE_REQ;
+		}
+
 		if (*total_flags & FIF_PROBE_REQ)
 			wfx_fwd_probe_req(wvif, true);
 		else
@@ -577,7 +584,6 @@ int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 	wvif->state = WFX_STATE_AP;
 	wfx_update_filtering(wvif);
 	wfx_upload_ap_templates(wvif);
-	wfx_fwd_probe_req(wvif, false);
 	hif_start(wvif, &vif->bss_conf, wvif->channel);
 	return 0;
 }
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 11/20] staging: wfx: drop useless wfx_fwd_probe_req()
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

wfx_fwd_probe_req() is a function of two lines called from only one
place. In order to uniformize all filtering functions, drop
wfx_fwd_probe_req().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 14 +++++---------
 drivers/staging/wfx/sta.h |  1 -
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index b785b1b7d583..8d2365a2e35b 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -113,13 +113,6 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad)
 	mutex_unlock(&wvif->bss_loss_lock);
 }
 
-int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable)
-{
-	wvif->fwd_probe_req = enable;
-	return hif_set_rx_filter(wvif, wvif->filter_bssid,
-				 wvif->fwd_probe_req);
-}
-
 void wfx_update_filtering(struct wfx_vif *wvif)
 {
 	int i;
@@ -249,9 +242,12 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		}
 
 		if (*total_flags & FIF_PROBE_REQ)
-			wfx_fwd_probe_req(wvif, true);
+			wvif->fwd_probe_req = true;
 		else
-			wfx_fwd_probe_req(wvif, false);
+			wvif->fwd_probe_req = false;
+		hif_set_rx_filter(wvif, wvif->filter_bssid,
+				  wvif->fwd_probe_req);
+
 		mutex_unlock(&wvif->scan_lock);
 	}
 	mutex_unlock(&wdev->conf_mutex);
diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h
index 8d76fba5f504..a90eaf5043a8 100644
--- a/drivers/staging/wfx/sta.h
+++ b/drivers/staging/wfx/sta.h
@@ -88,7 +88,6 @@ void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd);
 
 // Other Helpers
 void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad);
-int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable);
 u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates);
 
 #endif /* WFX_STA_H */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 11/20] staging: wfx: drop useless wfx_fwd_probe_req()
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

wfx_fwd_probe_req() is a function of two lines called from only one
place. In order to uniformize all filtering functions, drop
wfx_fwd_probe_req().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 14 +++++---------
 drivers/staging/wfx/sta.h |  1 -
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index b785b1b7d583..8d2365a2e35b 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -113,13 +113,6 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad)
 	mutex_unlock(&wvif->bss_loss_lock);
 }
 
-int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable)
-{
-	wvif->fwd_probe_req = enable;
-	return hif_set_rx_filter(wvif, wvif->filter_bssid,
-				 wvif->fwd_probe_req);
-}
-
 void wfx_update_filtering(struct wfx_vif *wvif)
 {
 	int i;
@@ -249,9 +242,12 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		}
 
 		if (*total_flags & FIF_PROBE_REQ)
-			wfx_fwd_probe_req(wvif, true);
+			wvif->fwd_probe_req = true;
 		else
-			wfx_fwd_probe_req(wvif, false);
+			wvif->fwd_probe_req = false;
+		hif_set_rx_filter(wvif, wvif->filter_bssid,
+				  wvif->fwd_probe_req);
+
 		mutex_unlock(&wvif->scan_lock);
 	}
 	mutex_unlock(&wdev->conf_mutex);
diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h
index 8d76fba5f504..a90eaf5043a8 100644
--- a/drivers/staging/wfx/sta.h
+++ b/drivers/staging/wfx/sta.h
@@ -88,7 +88,6 @@ void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd);
 
 // Other Helpers
 void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad);
-int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable);
 u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates);
 
 #endif /* WFX_STA_H */
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 12/20] staging: wfx: align semantic of beacon filter with other filters
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Filters provided by HIF API are sometime inclusive, sometime exclusive.

This patch align the behavior and name of the beacon filter with the
other filters. Also avoid double negation: "disable filter"

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 10 +++++-----
 drivers/staging/wfx/wfx.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 8d2365a2e35b..963cac83b6a8 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -137,7 +137,7 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 	};
 
 	hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->fwd_probe_req);
-	if (wvif->disable_beacon_filter) {
+	if (!wvif->filter_beacon) {
 		hif_set_beacon_filter_table(wvif, 0, NULL);
 		hif_beacon_filter_control(wvif, 0, 1);
 	} else {
@@ -215,9 +215,9 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		// Note: FIF_BCN_PRBRESP_PROMISC covers probe response and
 		// beacons from other BSS
 		if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
-			wvif->disable_beacon_filter = true;
+			wvif->filter_beacon = false;
 		else
-			wvif->disable_beacon_filter = false;
+			wvif->filter_beacon = true;
 
 		if (*total_flags & FIF_ALLMULTI) {
 			wvif->mcast_filter.enable = false;
@@ -504,7 +504,7 @@ static void wfx_do_join(struct wfx_vif *wvif)
 		 * Disable filtering temporary to make sure the stack
 		 * receives at least one
 		 */
-		wvif->disable_beacon_filter = true;
+		wvif->filter_beacon = false;
 		wfx_update_filtering(wvif);
 	}
 	wfx_tx_unlock(wvif->wdev);
@@ -706,7 +706,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw,
 					     info->dtim_period);
 		// We temporary forwarded beacon for join process. It is now no
 		// more necessary.
-		wvif->disable_beacon_filter = false;
+		wvif->filter_beacon = true;
 		wfx_update_filtering(wvif);
 	}
 
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index a69d9c9c37b6..53ed4c137b19 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -90,7 +90,7 @@ struct wfx_vif {
 
 	bool			filter_bssid;
 	bool			fwd_probe_req;
-	bool			disable_beacon_filter;
+	bool			filter_beacon;
 
 	unsigned long		uapsd_mask;
 	struct hif_req_set_bss_params bss_params;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 12/20] staging: wfx: align semantic of beacon filter with other filters
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Filters provided by HIF API are sometime inclusive, sometime exclusive.

This patch align the behavior and name of the beacon filter with the
other filters. Also avoid double negation: "disable filter"

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 10 +++++-----
 drivers/staging/wfx/wfx.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 8d2365a2e35b..963cac83b6a8 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -137,7 +137,7 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 	};
 
 	hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->fwd_probe_req);
-	if (wvif->disable_beacon_filter) {
+	if (!wvif->filter_beacon) {
 		hif_set_beacon_filter_table(wvif, 0, NULL);
 		hif_beacon_filter_control(wvif, 0, 1);
 	} else {
@@ -215,9 +215,9 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		// Note: FIF_BCN_PRBRESP_PROMISC covers probe response and
 		// beacons from other BSS
 		if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
-			wvif->disable_beacon_filter = true;
+			wvif->filter_beacon = false;
 		else
-			wvif->disable_beacon_filter = false;
+			wvif->filter_beacon = true;
 
 		if (*total_flags & FIF_ALLMULTI) {
 			wvif->mcast_filter.enable = false;
@@ -504,7 +504,7 @@ static void wfx_do_join(struct wfx_vif *wvif)
 		 * Disable filtering temporary to make sure the stack
 		 * receives at least one
 		 */
-		wvif->disable_beacon_filter = true;
+		wvif->filter_beacon = false;
 		wfx_update_filtering(wvif);
 	}
 	wfx_tx_unlock(wvif->wdev);
@@ -706,7 +706,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw,
 					     info->dtim_period);
 		// We temporary forwarded beacon for join process. It is now no
 		// more necessary.
-		wvif->disable_beacon_filter = false;
+		wvif->filter_beacon = true;
 		wfx_update_filtering(wvif);
 	}
 
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index a69d9c9c37b6..53ed4c137b19 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -90,7 +90,7 @@ struct wfx_vif {
 
 	bool			filter_bssid;
 	bool			fwd_probe_req;
-	bool			disable_beacon_filter;
+	bool			filter_beacon;
 
 	unsigned long		uapsd_mask;
 	struct hif_req_set_bss_params bss_params;
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 13/20] staging: wfx: align semantic of probe request filter with other filters
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Filters provided by HIF API are sometime inclusive, sometime exclusive.

This patch align the behavior and name of the probe request filter with
the other filters.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/hif_tx_mib.c | 4 ++--
 drivers/staging/wfx/sta.c        | 8 ++++----
 drivers/staging/wfx/wfx.h        | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wfx/hif_tx_mib.c b/drivers/staging/wfx/hif_tx_mib.c
index 41f3090d29be..1d26d740bd0b 100644
--- a/drivers/staging/wfx/hif_tx_mib.c
+++ b/drivers/staging/wfx/hif_tx_mib.c
@@ -90,13 +90,13 @@ int hif_set_macaddr(struct wfx_vif *wvif, u8 *mac)
 }
 
 int hif_set_rx_filter(struct wfx_vif *wvif,
-		      bool filter_bssid, bool fwd_probe_req)
+		      bool filter_bssid, bool filter_prbreq)
 {
 	struct hif_mib_rx_filter val = { };
 
 	if (filter_bssid)
 		val.bssid_filter = 1;
-	if (fwd_probe_req)
+	if (!filter_prbreq)
 		val.fwd_probe_req = 1;
 	return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_RX_FILTER,
 			     &val, sizeof(val));
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 963cac83b6a8..3a105d485237 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -136,7 +136,7 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 		}
 	};
 
-	hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->fwd_probe_req);
+	hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->filter_prbreq);
 	if (!wvif->filter_beacon) {
 		hif_set_beacon_filter_table(wvif, 0, NULL);
 		hif_beacon_filter_control(wvif, 0, 1);
@@ -242,11 +242,11 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		}
 
 		if (*total_flags & FIF_PROBE_REQ)
-			wvif->fwd_probe_req = true;
+			wvif->filter_prbreq = false;
 		else
-			wvif->fwd_probe_req = false;
+			wvif->filter_prbreq = true;
 		hif_set_rx_filter(wvif, wvif->filter_bssid,
-				  wvif->fwd_probe_req);
+				  wvif->filter_prbreq);
 
 		mutex_unlock(&wvif->scan_lock);
 	}
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 53ed4c137b19..3941462097a4 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -89,7 +89,7 @@ struct wfx_vif {
 	struct work_struct	update_tim_work;
 
 	bool			filter_bssid;
-	bool			fwd_probe_req;
+	bool			filter_prbreq;
 	bool			filter_beacon;
 
 	unsigned long		uapsd_mask;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 13/20] staging: wfx: align semantic of probe request filter with other filters
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Filters provided by HIF API are sometime inclusive, sometime exclusive.

This patch align the behavior and name of the probe request filter with
the other filters.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/hif_tx_mib.c | 4 ++--
 drivers/staging/wfx/sta.c        | 8 ++++----
 drivers/staging/wfx/wfx.h        | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wfx/hif_tx_mib.c b/drivers/staging/wfx/hif_tx_mib.c
index 41f3090d29be..1d26d740bd0b 100644
--- a/drivers/staging/wfx/hif_tx_mib.c
+++ b/drivers/staging/wfx/hif_tx_mib.c
@@ -90,13 +90,13 @@ int hif_set_macaddr(struct wfx_vif *wvif, u8 *mac)
 }
 
 int hif_set_rx_filter(struct wfx_vif *wvif,
-		      bool filter_bssid, bool fwd_probe_req)
+		      bool filter_bssid, bool filter_prbreq)
 {
 	struct hif_mib_rx_filter val = { };
 
 	if (filter_bssid)
 		val.bssid_filter = 1;
-	if (fwd_probe_req)
+	if (!filter_prbreq)
 		val.fwd_probe_req = 1;
 	return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_RX_FILTER,
 			     &val, sizeof(val));
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 963cac83b6a8..3a105d485237 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -136,7 +136,7 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 		}
 	};
 
-	hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->fwd_probe_req);
+	hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->filter_prbreq);
 	if (!wvif->filter_beacon) {
 		hif_set_beacon_filter_table(wvif, 0, NULL);
 		hif_beacon_filter_control(wvif, 0, 1);
@@ -242,11 +242,11 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		}
 
 		if (*total_flags & FIF_PROBE_REQ)
-			wvif->fwd_probe_req = true;
+			wvif->filter_prbreq = false;
 		else
-			wvif->fwd_probe_req = false;
+			wvif->filter_prbreq = true;
 		hif_set_rx_filter(wvif, wvif->filter_bssid,
-				  wvif->fwd_probe_req);
+				  wvif->filter_prbreq);
 
 		mutex_unlock(&wvif->scan_lock);
 	}
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 53ed4c137b19..3941462097a4 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -89,7 +89,7 @@ struct wfx_vif {
 	struct work_struct	update_tim_work;
 
 	bool			filter_bssid;
-	bool			fwd_probe_req;
+	bool			filter_prbreq;
 	bool			filter_beacon;
 
 	unsigned long		uapsd_mask;
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 14/20] staging: wfx: drop struct wfx_grp_addr_table
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

The struct wfx_grp_addr_table is only instantiated on one place. There
is no justifiation for this struct. Moreover, it is not consistent with
other fields related to filtering (filter_bssid, etc...).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 28 +++++++++++++---------------
 drivers/staging/wfx/sta.h |  6 ------
 drivers/staging/wfx/wfx.h |  4 +++-
 3 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 3a105d485237..70342bdd9d96 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -149,17 +149,16 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 	hif_set_data_filtering(wvif, false, true);
 	return;
 
-	if (!wvif->mcast_filter.enable) {
+	if (!wvif->filter_mcast) {
 		hif_set_data_filtering(wvif, false, true);
 		return;
 	}
-	for (i = 0; i < wvif->mcast_filter.num_addresses; i++)
-		hif_set_mac_addr_condition(wvif, i,
-					   wvif->mcast_filter.address_list[i]);
+	for (i = 0; i < wvif->filter_mcast_count; i++)
+		hif_set_mac_addr_condition(wvif, i, wvif->filter_mcast_addr[i]);
 	hif_set_uc_mc_bc_condition(wvif, 0,
 				   HIF_FILTER_UNICAST | HIF_FILTER_BROADCAST);
 	hif_set_config_data_filter(wvif, true, 0, BIT(1),
-				   BIT(wvif->mcast_filter.num_addresses) - 1);
+				   BIT(wvif->filter_mcast_count) - 1);
 	hif_set_data_filtering(wvif, true, true);
 }
 
@@ -173,18 +172,17 @@ u64 wfx_prepare_multicast(struct ieee80211_hw *hw,
 	int count = netdev_hw_addr_list_count(mc_list);
 
 	while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
-		memset(&wvif->mcast_filter, 0x00, sizeof(wvif->mcast_filter));
-		if (!count ||
-		    count > ARRAY_SIZE(wvif->mcast_filter.address_list))
+		if (count > ARRAY_SIZE(wvif->filter_mcast_addr)) {
+			wvif->filter_mcast_count = 0;
 			continue;
+		}
+		wvif->filter_mcast_count = count;
 
 		i = 0;
 		netdev_hw_addr_list_for_each(ha, mc_list) {
-			ether_addr_copy(wvif->mcast_filter.address_list[i],
-					ha->addr);
+			ether_addr_copy(wvif->filter_mcast_addr[i], ha->addr);
 			i++;
 		}
-		wvif->mcast_filter.num_addresses = count;
 	}
 
 	return 0;
@@ -220,12 +218,12 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 			wvif->filter_beacon = true;
 
 		if (*total_flags & FIF_ALLMULTI) {
-			wvif->mcast_filter.enable = false;
-		} else if (!wvif->mcast_filter.num_addresses) {
+			wvif->filter_mcast = false;
+		} else if (!wvif->filter_mcast_count) {
 			dev_dbg(wdev->dev, "disabling unconfigured multicast filter");
-			wvif->mcast_filter.enable = false;
+			wvif->filter_mcast = false;
 		} else {
-			wvif->mcast_filter.enable = true;
+			wvif->filter_mcast = true;
 		}
 		wfx_update_filtering(wvif);
 
diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h
index a90eaf5043a8..31097057563a 100644
--- a/drivers/staging/wfx/sta.h
+++ b/drivers/staging/wfx/sta.h
@@ -28,12 +28,6 @@ struct wfx_hif_event {
 	struct hif_ind_event evt;
 };
 
-struct wfx_grp_addr_table {
-	bool enable;
-	int num_addresses;
-	u8 address_list[8][ETH_ALEN];
-};
-
 struct wfx_sta_priv {
 	int link_id;
 	int vif_id;
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 3941462097a4..53184fe2da4b 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -77,7 +77,6 @@ struct wfx_vif {
 	u32			link_id_map;
 
 	bool			after_dtim_tx_allowed;
-	struct wfx_grp_addr_table mcast_filter;
 
 	s8			wep_default_key_id;
 	struct sk_buff		*wep_pending_skb;
@@ -88,6 +87,9 @@ struct wfx_vif {
 
 	struct work_struct	update_tim_work;
 
+	int			filter_mcast_count;
+	u8			filter_mcast_addr[8][ETH_ALEN];
+	bool			filter_mcast;
 	bool			filter_bssid;
 	bool			filter_prbreq;
 	bool			filter_beacon;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 14/20] staging: wfx: drop struct wfx_grp_addr_table
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

The struct wfx_grp_addr_table is only instantiated on one place. There
is no justifiation for this struct. Moreover, it is not consistent with
other fields related to filtering (filter_bssid, etc...).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 28 +++++++++++++---------------
 drivers/staging/wfx/sta.h |  6 ------
 drivers/staging/wfx/wfx.h |  4 +++-
 3 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 3a105d485237..70342bdd9d96 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -149,17 +149,16 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 	hif_set_data_filtering(wvif, false, true);
 	return;
 
-	if (!wvif->mcast_filter.enable) {
+	if (!wvif->filter_mcast) {
 		hif_set_data_filtering(wvif, false, true);
 		return;
 	}
-	for (i = 0; i < wvif->mcast_filter.num_addresses; i++)
-		hif_set_mac_addr_condition(wvif, i,
-					   wvif->mcast_filter.address_list[i]);
+	for (i = 0; i < wvif->filter_mcast_count; i++)
+		hif_set_mac_addr_condition(wvif, i, wvif->filter_mcast_addr[i]);
 	hif_set_uc_mc_bc_condition(wvif, 0,
 				   HIF_FILTER_UNICAST | HIF_FILTER_BROADCAST);
 	hif_set_config_data_filter(wvif, true, 0, BIT(1),
-				   BIT(wvif->mcast_filter.num_addresses) - 1);
+				   BIT(wvif->filter_mcast_count) - 1);
 	hif_set_data_filtering(wvif, true, true);
 }
 
@@ -173,18 +172,17 @@ u64 wfx_prepare_multicast(struct ieee80211_hw *hw,
 	int count = netdev_hw_addr_list_count(mc_list);
 
 	while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
-		memset(&wvif->mcast_filter, 0x00, sizeof(wvif->mcast_filter));
-		if (!count ||
-		    count > ARRAY_SIZE(wvif->mcast_filter.address_list))
+		if (count > ARRAY_SIZE(wvif->filter_mcast_addr)) {
+			wvif->filter_mcast_count = 0;
 			continue;
+		}
+		wvif->filter_mcast_count = count;
 
 		i = 0;
 		netdev_hw_addr_list_for_each(ha, mc_list) {
-			ether_addr_copy(wvif->mcast_filter.address_list[i],
-					ha->addr);
+			ether_addr_copy(wvif->filter_mcast_addr[i], ha->addr);
 			i++;
 		}
-		wvif->mcast_filter.num_addresses = count;
 	}
 
 	return 0;
@@ -220,12 +218,12 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 			wvif->filter_beacon = true;
 
 		if (*total_flags & FIF_ALLMULTI) {
-			wvif->mcast_filter.enable = false;
-		} else if (!wvif->mcast_filter.num_addresses) {
+			wvif->filter_mcast = false;
+		} else if (!wvif->filter_mcast_count) {
 			dev_dbg(wdev->dev, "disabling unconfigured multicast filter");
-			wvif->mcast_filter.enable = false;
+			wvif->filter_mcast = false;
 		} else {
-			wvif->mcast_filter.enable = true;
+			wvif->filter_mcast = true;
 		}
 		wfx_update_filtering(wvif);
 
diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h
index a90eaf5043a8..31097057563a 100644
--- a/drivers/staging/wfx/sta.h
+++ b/drivers/staging/wfx/sta.h
@@ -28,12 +28,6 @@ struct wfx_hif_event {
 	struct hif_ind_event evt;
 };
 
-struct wfx_grp_addr_table {
-	bool enable;
-	int num_addresses;
-	u8 address_list[8][ETH_ALEN];
-};
-
 struct wfx_sta_priv {
 	int link_id;
 	int vif_id;
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 3941462097a4..53184fe2da4b 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -77,7 +77,6 @@ struct wfx_vif {
 	u32			link_id_map;
 
 	bool			after_dtim_tx_allowed;
-	struct wfx_grp_addr_table mcast_filter;
 
 	s8			wep_default_key_id;
 	struct sk_buff		*wep_pending_skb;
@@ -88,6 +87,9 @@ struct wfx_vif {
 
 	struct work_struct	update_tim_work;
 
+	int			filter_mcast_count;
+	u8			filter_mcast_addr[8][ETH_ALEN];
+	bool			filter_mcast;
 	bool			filter_bssid;
 	bool			filter_prbreq;
 	bool			filter_beacon;
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 15/20] staging: wfx: drop useless call to hif_set_rx_filter()
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

hif_set_rx_filter() apply changes on filter_prbreq and filter_bssid to
the hardware. Each time filter_prbreq and filter_bssid are changed,
hif_set_rx_filter() is called.

Currently, on extra call to hif_set_rx_filter() is made from
wfx_update_filtering(). This call is useless. Drop it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 70342bdd9d96..c7505b5d0947 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -136,7 +136,6 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 		}
 	};
 
-	hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->filter_prbreq);
 	if (!wvif->filter_beacon) {
 		hif_set_beacon_filter_table(wvif, 0, NULL);
 		hif_beacon_filter_control(wvif, 0, 1);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 15/20] staging: wfx: drop useless call to hif_set_rx_filter()
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

hif_set_rx_filter() apply changes on filter_prbreq and filter_bssid to
the hardware. Each time filter_prbreq and filter_bssid are changed,
hif_set_rx_filter() is called.

Currently, on extra call to hif_set_rx_filter() is made from
wfx_update_filtering(). This call is useless. Drop it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 70342bdd9d96..c7505b5d0947 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -136,7 +136,6 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 		}
 	};
 
-	hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->filter_prbreq);
 	if (!wvif->filter_beacon) {
 		hif_set_beacon_filter_table(wvif, 0, NULL);
 		hif_beacon_filter_control(wvif, 0, 1);
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 16/20] staging: wfx: drop useless attributes 'filter_prbreq' and 'filter_bssid'
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

It is now useless to store filter_prbreq and filter_bssid in struct
wfx_vif. We can just pass them as parameters to hif_set_rx_filter().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 12 ++++++------
 drivers/staging/wfx/wfx.h |  2 --
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index c7505b5d0947..a9261ef4b4c5 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -194,6 +194,7 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 {
 	struct wfx_vif *wvif = NULL;
 	struct wfx_dev *wdev = hw->priv;
+	bool filter_bssid, filter_prbreq;
 
 	// Notes:
 	//   - Probe responses (FIF_BCN_PRBRESP_PROMISC) are never filtered
@@ -227,9 +228,9 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		wfx_update_filtering(wvif);
 
 		if (*total_flags & FIF_OTHER_BSS)
-			wvif->filter_bssid = false;
+			filter_bssid = false;
 		else
-			wvif->filter_bssid = true;
+			filter_bssid = true;
 
 		// In AP mode, chip can reply to probe request itself
 		if (*total_flags & FIF_PROBE_REQ &&
@@ -239,11 +240,10 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		}
 
 		if (*total_flags & FIF_PROBE_REQ)
-			wvif->filter_prbreq = false;
+			filter_prbreq = false;
 		else
-			wvif->filter_prbreq = true;
-		hif_set_rx_filter(wvif, wvif->filter_bssid,
-				  wvif->filter_prbreq);
+			filter_prbreq = true;
+		hif_set_rx_filter(wvif, filter_bssid, filter_prbreq);
 
 		mutex_unlock(&wvif->scan_lock);
 	}
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 53184fe2da4b..310d95478824 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -90,8 +90,6 @@ struct wfx_vif {
 	int			filter_mcast_count;
 	u8			filter_mcast_addr[8][ETH_ALEN];
 	bool			filter_mcast;
-	bool			filter_bssid;
-	bool			filter_prbreq;
 	bool			filter_beacon;
 
 	unsigned long		uapsd_mask;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 16/20] staging: wfx: drop useless attributes 'filter_prbreq' and 'filter_bssid'
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

It is now useless to store filter_prbreq and filter_bssid in struct
wfx_vif. We can just pass them as parameters to hif_set_rx_filter().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 12 ++++++------
 drivers/staging/wfx/wfx.h |  2 --
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index c7505b5d0947..a9261ef4b4c5 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -194,6 +194,7 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 {
 	struct wfx_vif *wvif = NULL;
 	struct wfx_dev *wdev = hw->priv;
+	bool filter_bssid, filter_prbreq;
 
 	// Notes:
 	//   - Probe responses (FIF_BCN_PRBRESP_PROMISC) are never filtered
@@ -227,9 +228,9 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		wfx_update_filtering(wvif);
 
 		if (*total_flags & FIF_OTHER_BSS)
-			wvif->filter_bssid = false;
+			filter_bssid = false;
 		else
-			wvif->filter_bssid = true;
+			filter_bssid = true;
 
 		// In AP mode, chip can reply to probe request itself
 		if (*total_flags & FIF_PROBE_REQ &&
@@ -239,11 +240,10 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		}
 
 		if (*total_flags & FIF_PROBE_REQ)
-			wvif->filter_prbreq = false;
+			filter_prbreq = false;
 		else
-			wvif->filter_prbreq = true;
-		hif_set_rx_filter(wvif, wvif->filter_bssid,
-				  wvif->filter_prbreq);
+			filter_prbreq = true;
+		hif_set_rx_filter(wvif, filter_bssid, filter_prbreq);
 
 		mutex_unlock(&wvif->scan_lock);
 	}
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 53184fe2da4b..310d95478824 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -90,8 +90,6 @@ struct wfx_vif {
 	int			filter_mcast_count;
 	u8			filter_mcast_addr[8][ETH_ALEN];
 	bool			filter_mcast;
-	bool			filter_bssid;
-	bool			filter_prbreq;
 	bool			filter_beacon;
 
 	unsigned long		uapsd_mask;
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 17/20] staging: wfx: split out wfx_filter_beacon()
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Currently, wfx_update_filtering() is sometime called only to apply the
value of wvif->filter_beacon to the hardware. It is nicer to have a
specific function for beacon filtering.

In add, an attentive reader would note that wfx_update_filtering() is
always called after change of wvif->filter_beacon. Thus, it not
necessary to store filter_beacon in the struct wfx_vif. We can just pass
it as parameter.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 23 +++++++++++++----------
 drivers/staging/wfx/wfx.h |  1 -
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index a9261ef4b4c5..1ccd40a3322f 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -113,9 +113,8 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad)
 	mutex_unlock(&wvif->bss_loss_lock);
 }
 
-void wfx_update_filtering(struct wfx_vif *wvif)
+static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon)
 {
-	int i;
 	const struct hif_ie_table_entry filter_ies[] = {
 		{
 			.ie_id        = WLAN_EID_VENDOR_SPECIFIC,
@@ -136,13 +135,18 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 		}
 	};
 
-	if (!wvif->filter_beacon) {
+	if (!filter_beacon) {
 		hif_set_beacon_filter_table(wvif, 0, NULL);
 		hif_beacon_filter_control(wvif, 0, 1);
 	} else {
 		hif_set_beacon_filter_table(wvif, 3, filter_ies);
 		hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE, 0);
 	}
+}
+
+void wfx_update_filtering(struct wfx_vif *wvif)
+{
+	int i;
 
 	// Temporary workaround for filters
 	hif_set_data_filtering(wvif, false, true);
@@ -194,7 +198,7 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 {
 	struct wfx_vif *wvif = NULL;
 	struct wfx_dev *wdev = hw->priv;
-	bool filter_bssid, filter_prbreq;
+	bool filter_bssid, filter_prbreq, filter_beacon;
 
 	// Notes:
 	//   - Probe responses (FIF_BCN_PRBRESP_PROMISC) are never filtered
@@ -213,9 +217,10 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		// Note: FIF_BCN_PRBRESP_PROMISC covers probe response and
 		// beacons from other BSS
 		if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
-			wvif->filter_beacon = false;
+			filter_beacon = false;
 		else
-			wvif->filter_beacon = true;
+			filter_beacon = true;
+		wfx_filter_beacon(wvif, filter_beacon);
 
 		if (*total_flags & FIF_ALLMULTI) {
 			wvif->filter_mcast = false;
@@ -501,8 +506,7 @@ static void wfx_do_join(struct wfx_vif *wvif)
 		 * Disable filtering temporary to make sure the stack
 		 * receives at least one
 		 */
-		wvif->filter_beacon = false;
-		wfx_update_filtering(wvif);
+		wfx_filter_beacon(wvif, false);
 	}
 	wfx_tx_unlock(wvif->wdev);
 }
@@ -703,8 +707,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw,
 					     info->dtim_period);
 		// We temporary forwarded beacon for join process. It is now no
 		// more necessary.
-		wvif->filter_beacon = true;
-		wfx_update_filtering(wvif);
+		wfx_filter_beacon(wvif, true);
 	}
 
 	/* assoc/disassoc, or maybe AID changed */
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 310d95478824..c30e6984aec1 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -90,7 +90,6 @@ struct wfx_vif {
 	int			filter_mcast_count;
 	u8			filter_mcast_addr[8][ETH_ALEN];
 	bool			filter_mcast;
-	bool			filter_beacon;
 
 	unsigned long		uapsd_mask;
 	struct hif_req_set_bss_params bss_params;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 17/20] staging: wfx: split out wfx_filter_beacon()
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Currently, wfx_update_filtering() is sometime called only to apply the
value of wvif->filter_beacon to the hardware. It is nicer to have a
specific function for beacon filtering.

In add, an attentive reader would note that wfx_update_filtering() is
always called after change of wvif->filter_beacon. Thus, it not
necessary to store filter_beacon in the struct wfx_vif. We can just pass
it as parameter.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 23 +++++++++++++----------
 drivers/staging/wfx/wfx.h |  1 -
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index a9261ef4b4c5..1ccd40a3322f 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -113,9 +113,8 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad)
 	mutex_unlock(&wvif->bss_loss_lock);
 }
 
-void wfx_update_filtering(struct wfx_vif *wvif)
+static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon)
 {
-	int i;
 	const struct hif_ie_table_entry filter_ies[] = {
 		{
 			.ie_id        = WLAN_EID_VENDOR_SPECIFIC,
@@ -136,13 +135,18 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 		}
 	};
 
-	if (!wvif->filter_beacon) {
+	if (!filter_beacon) {
 		hif_set_beacon_filter_table(wvif, 0, NULL);
 		hif_beacon_filter_control(wvif, 0, 1);
 	} else {
 		hif_set_beacon_filter_table(wvif, 3, filter_ies);
 		hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE, 0);
 	}
+}
+
+void wfx_update_filtering(struct wfx_vif *wvif)
+{
+	int i;
 
 	// Temporary workaround for filters
 	hif_set_data_filtering(wvif, false, true);
@@ -194,7 +198,7 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 {
 	struct wfx_vif *wvif = NULL;
 	struct wfx_dev *wdev = hw->priv;
-	bool filter_bssid, filter_prbreq;
+	bool filter_bssid, filter_prbreq, filter_beacon;
 
 	// Notes:
 	//   - Probe responses (FIF_BCN_PRBRESP_PROMISC) are never filtered
@@ -213,9 +217,10 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		// Note: FIF_BCN_PRBRESP_PROMISC covers probe response and
 		// beacons from other BSS
 		if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
-			wvif->filter_beacon = false;
+			filter_beacon = false;
 		else
-			wvif->filter_beacon = true;
+			filter_beacon = true;
+		wfx_filter_beacon(wvif, filter_beacon);
 
 		if (*total_flags & FIF_ALLMULTI) {
 			wvif->filter_mcast = false;
@@ -501,8 +506,7 @@ static void wfx_do_join(struct wfx_vif *wvif)
 		 * Disable filtering temporary to make sure the stack
 		 * receives at least one
 		 */
-		wvif->filter_beacon = false;
-		wfx_update_filtering(wvif);
+		wfx_filter_beacon(wvif, false);
 	}
 	wfx_tx_unlock(wvif->wdev);
 }
@@ -703,8 +707,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw,
 					     info->dtim_period);
 		// We temporary forwarded beacon for join process. It is now no
 		// more necessary.
-		wvif->filter_beacon = true;
-		wfx_update_filtering(wvif);
+		wfx_filter_beacon(wvif, true);
 	}
 
 	/* assoc/disassoc, or maybe AID changed */
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 310d95478824..c30e6984aec1 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -90,7 +90,6 @@ struct wfx_vif {
 	int			filter_mcast_count;
 	u8			filter_mcast_addr[8][ETH_ALEN];
 	bool			filter_mcast;
-	bool			filter_beacon;
 
 	unsigned long		uapsd_mask;
 	struct hif_req_set_bss_params bss_params;
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 18/20] staging: wfx: drop useless filter update when starting AP
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

mac80211 explicitly call wfx_configure_filters() before/after starting
AP. Thus, it is not necessary to call wfx_update_filtering() from
wfx_start_ap().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 1ccd40a3322f..69a5823af284 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -579,7 +579,6 @@ int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 
 	wfx_upload_keys(wvif);
 	wvif->state = WFX_STATE_AP;
-	wfx_update_filtering(wvif);
 	wfx_upload_ap_templates(wvif);
 	hif_start(wvif, &vif->bss_conf, wvif->channel);
 	return 0;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 18/20] staging: wfx: drop useless filter update when starting AP
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

mac80211 explicitly call wfx_configure_filters() before/after starting
AP. Thus, it is not necessary to call wfx_update_filtering() from
wfx_start_ap().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 1ccd40a3322f..69a5823af284 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -579,7 +579,6 @@ int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 
 	wfx_upload_keys(wvif);
 	wvif->state = WFX_STATE_AP;
-	wfx_update_filtering(wvif);
 	wfx_upload_ap_templates(wvif);
 	hif_start(wvif, &vif->bss_conf, wvif->channel);
 	return 0;
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 19/20] staging: wfx: drop useless attribute 'filter_mcast'
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Currently, wfx_update_filtering() apply the value of wvif->filter_mcast
to the hardware. But an attentive reader will note that
wfx_update_filtering() is always called after set wvif->filter_mcast.
Thus, it not necessary to store filter_mcast in the struct wfx_vif. We
can just pass it as parameter.

Also rename wfx_update_filtering() in wfx_filter_mcast() to reflect this
change.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 14 +++++++-------
 drivers/staging/wfx/wfx.h |  1 -
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 69a5823af284..c73dbb3a0de8 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -144,7 +144,7 @@ static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon)
 	}
 }
 
-void wfx_update_filtering(struct wfx_vif *wvif)
+static void wfx_filter_mcast(struct wfx_vif *wvif, bool filter_mcast)
 {
 	int i;
 
@@ -152,7 +152,7 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 	hif_set_data_filtering(wvif, false, true);
 	return;
 
-	if (!wvif->filter_mcast) {
+	if (!filter_mcast) {
 		hif_set_data_filtering(wvif, false, true);
 		return;
 	}
@@ -198,7 +198,7 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 {
 	struct wfx_vif *wvif = NULL;
 	struct wfx_dev *wdev = hw->priv;
-	bool filter_bssid, filter_prbreq, filter_beacon;
+	bool filter_bssid, filter_prbreq, filter_beacon, filter_mcast;
 
 	// Notes:
 	//   - Probe responses (FIF_BCN_PRBRESP_PROMISC) are never filtered
@@ -223,14 +223,14 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		wfx_filter_beacon(wvif, filter_beacon);
 
 		if (*total_flags & FIF_ALLMULTI) {
-			wvif->filter_mcast = false;
+			filter_mcast = false;
 		} else if (!wvif->filter_mcast_count) {
 			dev_dbg(wdev->dev, "disabling unconfigured multicast filter");
-			wvif->filter_mcast = false;
+			filter_mcast = false;
 		} else {
-			wvif->filter_mcast = true;
+			filter_mcast = true;
 		}
-		wfx_update_filtering(wvif);
+		wfx_filter_mcast(wvif, filter_mcast);
 
 		if (*total_flags & FIF_OTHER_BSS)
 			filter_bssid = false;
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index c30e6984aec1..b5d2d0f07740 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -89,7 +89,6 @@ struct wfx_vif {
 
 	int			filter_mcast_count;
 	u8			filter_mcast_addr[8][ETH_ALEN];
-	bool			filter_mcast;
 
 	unsigned long		uapsd_mask;
 	struct hif_req_set_bss_params bss_params;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 19/20] staging: wfx: drop useless attribute 'filter_mcast'
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Currently, wfx_update_filtering() apply the value of wvif->filter_mcast
to the hardware. But an attentive reader will note that
wfx_update_filtering() is always called after set wvif->filter_mcast.
Thus, it not necessary to store filter_mcast in the struct wfx_vif. We
can just pass it as parameter.

Also rename wfx_update_filtering() in wfx_filter_mcast() to reflect this
change.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/sta.c | 14 +++++++-------
 drivers/staging/wfx/wfx.h |  1 -
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 69a5823af284..c73dbb3a0de8 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -144,7 +144,7 @@ static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon)
 	}
 }
 
-void wfx_update_filtering(struct wfx_vif *wvif)
+static void wfx_filter_mcast(struct wfx_vif *wvif, bool filter_mcast)
 {
 	int i;
 
@@ -152,7 +152,7 @@ void wfx_update_filtering(struct wfx_vif *wvif)
 	hif_set_data_filtering(wvif, false, true);
 	return;
 
-	if (!wvif->filter_mcast) {
+	if (!filter_mcast) {
 		hif_set_data_filtering(wvif, false, true);
 		return;
 	}
@@ -198,7 +198,7 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 {
 	struct wfx_vif *wvif = NULL;
 	struct wfx_dev *wdev = hw->priv;
-	bool filter_bssid, filter_prbreq, filter_beacon;
+	bool filter_bssid, filter_prbreq, filter_beacon, filter_mcast;
 
 	// Notes:
 	//   - Probe responses (FIF_BCN_PRBRESP_PROMISC) are never filtered
@@ -223,14 +223,14 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
 		wfx_filter_beacon(wvif, filter_beacon);
 
 		if (*total_flags & FIF_ALLMULTI) {
-			wvif->filter_mcast = false;
+			filter_mcast = false;
 		} else if (!wvif->filter_mcast_count) {
 			dev_dbg(wdev->dev, "disabling unconfigured multicast filter");
-			wvif->filter_mcast = false;
+			filter_mcast = false;
 		} else {
-			wvif->filter_mcast = true;
+			filter_mcast = true;
 		}
-		wfx_update_filtering(wvif);
+		wfx_filter_mcast(wvif, filter_mcast);
 
 		if (*total_flags & FIF_OTHER_BSS)
 			filter_bssid = false;
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index c30e6984aec1..b5d2d0f07740 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -89,7 +89,6 @@ struct wfx_vif {
 
 	int			filter_mcast_count;
 	u8			filter_mcast_addr[8][ETH_ALEN];
-	bool			filter_mcast;
 
 	unsigned long		uapsd_mask;
 	struct hif_req_set_bss_params bss_params;
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 20/20] staging: wfx: update TODO
  2020-04-15 16:11 ` Jerome Pouiller
@ 2020-04-15 16:11   ` Jerome Pouiller
  -1 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, Kalle Valo,
	David S . Miller, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Update the TODO list associated to the wfx driver with the last
progresses and last remarks made by reviewers.

The items about support for P2P and mesh have also been removed. Indeed,
it seems that the device does not fully support them.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/TODO | 40 ++++++++++++----------------------------
 1 file changed, 12 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/wfx/TODO b/drivers/staging/wfx/TODO
index efcb7c6a5aa7..fca3332e42ce 100644
--- a/drivers/staging/wfx/TODO
+++ b/drivers/staging/wfx/TODO
@@ -1,26 +1,18 @@
 This is a list of things that need to be done to get this driver out of the
 staging directory.
 
-  - All structures defined in hif_api_*.h are intended to sent/received to/from
-    hardware. All their members whould be declared __le32 or __le16.
-    See:
+  - The HIF API is not yet clean enough.
+
+  - Fix support for big endian architectures. See:
        https://lore.kernel.org/lkml/20191111202852.GX26530@ZenIV.linux.org.uk
 
-  - Once previous item done, it will be possible to audit the driver with
-    `sparse'. It will probably find tons of problems with big endian
-    architectures.
+  - The pointers returned by allocation functions are always checked.
 
-  - hif_api_*.h whave been imported from firmware code. Some of the structures
-    are never used in driver.
+  - The code that check the corectness of received message (in rx_helper()) can
+    be improved. See:
+       https://lore.kernel.org/driverdev-devel/2302785.6C7ODC2LYm@pc-42/
 
-  - Driver try to maintains power save status of the stations. However, this
-    work is already done by mac80211. sta_asleep_mask and pspoll_mask should be
-    dropped.
-
-  - wfx_tx_queues_get() should be reworked. It currently try compute itself the
-    QoS policy. However, firmware already do the job. Firmware would prefer to
-    have a few packets in each queue and be able to choose itself which queue to
-    use.
+  - Support for SDIO with external IRQ is broken.
 
   - As suggested by Felix, rate control could be improved following this idea:
         https://lore.kernel.org/lkml/3099559.gv3Q75KnN1@pc-42/
@@ -28,17 +20,8 @@ staging directory.
   - When driver is about to loose BSS, it forge its own Null Func request (see
     wfx_cqm_bssloss_sm()). It should use mechanism provided by mac80211.
 
-  - AP is actually is setup after a call to wfx_bss_info_changed(). Yet,
-    ieee80211_ops provide callback start_ap().
-
-  - The current process for joining a network is incredibly complex. Should be
-    reworked.
-
   - Monitoring mode is not implemented despite being mandatory by mac80211.
 
-  - "compatible" value are not correct. They should be "vendor,chip". See:
-       https://lore.kernel.org/driverdev-devel/5226570.CMH5hVlZcI@pc-42
-
   - The "state" field from wfx_vif should be replaced by "vif->type".
 
   - It seems that wfx_upload_keys() is useless.
@@ -49,12 +32,13 @@ staging directory.
   - Feature called "secure link" should be either developed (using kernel
     crypto API) or dropped.
 
+  - The device allows to filter multicast traffic. The code to support these
+    filters exists in the driver but it is disabled because it has never been
+    tested.
+
   - In wfx_cmd_send(), "async" allow to send command without waiting the reply.
     It may help in some situation, but it is not yet used. In add, it may cause
     some trouble:
       https://lore.kernel.org/driverdev-devel/alpine.DEB.2.21.1910041317381.2992@hadrien/
     So, fix it (by replacing the mutex with a semaphore) or drop it.
 
-  - Chip support P2P, but driver does not implement it.
-
-  - Chip support kind of Mesh, but driver does not implement it.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 20/20] staging: wfx: update TODO
@ 2020-04-15 16:11   ` Jerome Pouiller
  0 siblings, 0 replies; 44+ messages in thread
From: Jerome Pouiller @ 2020-04-15 16:11 UTC (permalink / raw)
  To: devel, linux-wireless
  Cc: netdev, linux-kernel, Greg Kroah-Hartman, David S . Miller, Kalle Valo

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Update the TODO list associated to the wfx driver with the last
progresses and last remarks made by reviewers.

The items about support for P2P and mesh have also been removed. Indeed,
it seems that the device does not fully support them.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/TODO | 40 ++++++++++++----------------------------
 1 file changed, 12 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/wfx/TODO b/drivers/staging/wfx/TODO
index efcb7c6a5aa7..fca3332e42ce 100644
--- a/drivers/staging/wfx/TODO
+++ b/drivers/staging/wfx/TODO
@@ -1,26 +1,18 @@
 This is a list of things that need to be done to get this driver out of the
 staging directory.
 
-  - All structures defined in hif_api_*.h are intended to sent/received to/from
-    hardware. All their members whould be declared __le32 or __le16.
-    See:
+  - The HIF API is not yet clean enough.
+
+  - Fix support for big endian architectures. See:
        https://lore.kernel.org/lkml/20191111202852.GX26530@ZenIV.linux.org.uk
 
-  - Once previous item done, it will be possible to audit the driver with
-    `sparse'. It will probably find tons of problems with big endian
-    architectures.
+  - The pointers returned by allocation functions are always checked.
 
-  - hif_api_*.h whave been imported from firmware code. Some of the structures
-    are never used in driver.
+  - The code that check the corectness of received message (in rx_helper()) can
+    be improved. See:
+       https://lore.kernel.org/driverdev-devel/2302785.6C7ODC2LYm@pc-42/
 
-  - Driver try to maintains power save status of the stations. However, this
-    work is already done by mac80211. sta_asleep_mask and pspoll_mask should be
-    dropped.
-
-  - wfx_tx_queues_get() should be reworked. It currently try compute itself the
-    QoS policy. However, firmware already do the job. Firmware would prefer to
-    have a few packets in each queue and be able to choose itself which queue to
-    use.
+  - Support for SDIO with external IRQ is broken.
 
   - As suggested by Felix, rate control could be improved following this idea:
         https://lore.kernel.org/lkml/3099559.gv3Q75KnN1@pc-42/
@@ -28,17 +20,8 @@ staging directory.
   - When driver is about to loose BSS, it forge its own Null Func request (see
     wfx_cqm_bssloss_sm()). It should use mechanism provided by mac80211.
 
-  - AP is actually is setup after a call to wfx_bss_info_changed(). Yet,
-    ieee80211_ops provide callback start_ap().
-
-  - The current process for joining a network is incredibly complex. Should be
-    reworked.
-
   - Monitoring mode is not implemented despite being mandatory by mac80211.
 
-  - "compatible" value are not correct. They should be "vendor,chip". See:
-       https://lore.kernel.org/driverdev-devel/5226570.CMH5hVlZcI@pc-42
-
   - The "state" field from wfx_vif should be replaced by "vif->type".
 
   - It seems that wfx_upload_keys() is useless.
@@ -49,12 +32,13 @@ staging directory.
   - Feature called "secure link" should be either developed (using kernel
     crypto API) or dropped.
 
+  - The device allows to filter multicast traffic. The code to support these
+    filters exists in the driver but it is disabled because it has never been
+    tested.
+
   - In wfx_cmd_send(), "async" allow to send command without waiting the reply.
     It may help in some situation, but it is not yet used. In add, it may cause
     some trouble:
       https://lore.kernel.org/driverdev-devel/alpine.DEB.2.21.1910041317381.2992@hadrien/
     So, fix it (by replacing the mutex with a semaphore) or drop it.
 
-  - Chip support P2P, but driver does not implement it.
-
-  - Chip support kind of Mesh, but driver does not implement it.
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* Re: [PATCH 12/20] staging: wfx: align semantic of beacon filter with other filters
  2020-04-15 16:11   ` Jerome Pouiller
@ 2020-04-16 13:52     ` Dan Carpenter
  -1 siblings, 0 replies; 44+ messages in thread
From: Dan Carpenter @ 2020-04-16 13:52 UTC (permalink / raw)
  To: Jerome Pouiller
  Cc: devel, linux-wireless, netdev, linux-kernel, Greg Kroah-Hartman,
	David S . Miller, Kalle Valo

On Wed, Apr 15, 2020 at 06:11:39PM +0200, Jerome Pouiller wrote:
> From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> 
> Filters provided by HIF API are sometime inclusive, sometime exclusive.
> 
> This patch align the behavior and name of the beacon filter with the
> other filters. Also avoid double negation: "disable filter"

Hooray!  I have been wanting to suggest this every time I see the
->disable_beacon_filter name, especially for patch 7/20.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 12/20] staging: wfx: align semantic of beacon filter with other filters
@ 2020-04-16 13:52     ` Dan Carpenter
  0 siblings, 0 replies; 44+ messages in thread
From: Dan Carpenter @ 2020-04-16 13:52 UTC (permalink / raw)
  To: Jerome Pouiller
  Cc: devel, netdev, linux-wireless, linux-kernel, Greg Kroah-Hartman,
	David S . Miller, Kalle Valo

On Wed, Apr 15, 2020 at 06:11:39PM +0200, Jerome Pouiller wrote:
> From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> 
> Filters provided by HIF API are sometime inclusive, sometime exclusive.
> 
> This patch align the behavior and name of the beacon filter with the
> other filters. Also avoid double negation: "disable filter"

Hooray!  I have been wanting to suggest this every time I see the
->disable_beacon_filter name, especially for patch 7/20.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2020-04-16 14:59 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 16:11 [PATCH 00/20] staging: wfx: simplify filtering Jerome Pouiller
2020-04-15 16:11 ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 01/20] staging: wfx: update filtering even if not connected Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 02/20] staging: wfx: simplify wfx_update_filtering() Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 03/20] staging: wfx: rework wfx_configure_filter() Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 04/20] staging: wfx: simplify handling of beacon filter during join process Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 05/20] staging: wfx: wfx_update_filtering_work() is no more used Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 06/20] staging: wfx: do not wait for a dtim before associate Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 07/20] staging: wfx: disabling beacon filtering after hif_reset() is useless Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 08/20] staging: wfx: do not use built-in AUTO_ERP feature Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 09/20] staging: wfx: stop changing filtering rule in wfx_hw_scan() Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 10/20] staging: wfx: ensure that probe requests are filtered when AP Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 11/20] staging: wfx: drop useless wfx_fwd_probe_req() Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 12/20] staging: wfx: align semantic of beacon filter with other filters Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-16 13:52   ` Dan Carpenter
2020-04-16 13:52     ` Dan Carpenter
2020-04-15 16:11 ` [PATCH 13/20] staging: wfx: align semantic of probe request " Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 14/20] staging: wfx: drop struct wfx_grp_addr_table Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 15/20] staging: wfx: drop useless call to hif_set_rx_filter() Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 16/20] staging: wfx: drop useless attributes 'filter_prbreq' and 'filter_bssid' Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 17/20] staging: wfx: split out wfx_filter_beacon() Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 18/20] staging: wfx: drop useless filter update when starting AP Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 19/20] staging: wfx: drop useless attribute 'filter_mcast' Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller
2020-04-15 16:11 ` [PATCH 20/20] staging: wfx: update TODO Jerome Pouiller
2020-04-15 16:11   ` Jerome Pouiller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.