Wireless Daemon for Linux
 help / color / mirror / Atom feed
* [PATCH 1/2] station: skip disabled frequencies in neighbor report
@ 2022-10-10 19:40 James Prestwood
  2022-10-10 19:40 ` [PATCH 2/2] station: contrain known frequencies before roam scan James Prestwood
  2022-10-11 19:31 ` [PATCH 1/2] station: skip disabled frequencies in neighbor report Denis Kenzior
  0 siblings, 2 replies; 3+ messages in thread
From: James Prestwood @ 2022-10-10 19:40 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

Use the disabled frequency list to check if the neighbor report is
including a frequency which IWD cannot use.
---
 src/station.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/station.c b/src/station.c
index 19cba680..f138846d 100644
--- a/src/station.c
+++ b/src/station.c
@@ -1813,6 +1813,8 @@ static void parse_neighbor_report(struct station *station,
 	struct handshake_state *hs = netdev_get_handshake(station->netdev);
 	const struct scan_freq_set *supported =
 				wiphy_get_supported_freqs(station->wiphy);
+	const struct scan_freq_set *disabled =
+				wiphy_get_disabled_freqs(station->wiphy);
 
 	freq_set_md = scan_freq_set_new();
 	freq_set_no_md = scan_freq_set_new();
@@ -1849,8 +1851,9 @@ static void parse_neighbor_report(struct station *station,
 		if (!(band & wiphy_get_supported_bands(station->wiphy)))
 			continue;
 
-		/* Skip if frequency is not supported */
-		if (!scan_freq_set_contains(supported, freq))
+		/* Skip if frequency is not supported or disabled */
+		if (!scan_freq_set_contains(supported, freq) ||
+				scan_freq_set_contains(disabled, freq))
 			continue;
 
 		if (!memcmp(info.addr,
-- 
2.34.3


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

* [PATCH 2/2] station: contrain known frequencies before roam scan
  2022-10-10 19:40 [PATCH 1/2] station: skip disabled frequencies in neighbor report James Prestwood
@ 2022-10-10 19:40 ` James Prestwood
  2022-10-11 19:31 ` [PATCH 1/2] station: skip disabled frequencies in neighbor report Denis Kenzior
  1 sibling, 0 replies; 3+ messages in thread
From: James Prestwood @ 2022-10-10 19:40 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

The known frequency list may include frequencies that once were
allowed but are now disabled due to regulatory restrictions. Don't
include these frequencies in the roam scan.
---
 src/station.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/station.c b/src/station.c
index f138846d..986d6757 100644
--- a/src/station.c
+++ b/src/station.c
@@ -2659,12 +2659,17 @@ static int station_roam_scan_known_freqs(struct station *station)
 						station->connected_network);
 	struct scan_freq_set *freqs = network_info_get_roam_frequencies(info,
 					station->connected_bss->frequency, 5);
-	int r;
+	int r = -ENODATA;
 
 	if (!freqs)
-		return -ENODATA;
+		return r;
+
+	if (!wiphy_constrain_freq_set(station->wiphy, freqs))
+		goto free_set;
 
 	r = station_roam_scan(station, freqs);
+
+free_set:
 	scan_freq_set_free(freqs);
 	return r;
 }
-- 
2.34.3


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

* Re: [PATCH 1/2] station: skip disabled frequencies in neighbor report
  2022-10-10 19:40 [PATCH 1/2] station: skip disabled frequencies in neighbor report James Prestwood
  2022-10-10 19:40 ` [PATCH 2/2] station: contrain known frequencies before roam scan James Prestwood
@ 2022-10-11 19:31 ` Denis Kenzior
  1 sibling, 0 replies; 3+ messages in thread
From: Denis Kenzior @ 2022-10-11 19:31 UTC (permalink / raw)
  To: James Prestwood, iwd

Hi James,

On 10/10/22 14:40, James Prestwood wrote:
> Use the disabled frequency list to check if the neighbor report is
> including a frequency which IWD cannot use.
> ---
>   src/station.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 

Both applied, thanks.

Regards,
-Denis


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

end of thread, other threads:[~2022-10-11 19:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-10 19:40 [PATCH 1/2] station: skip disabled frequencies in neighbor report James Prestwood
2022-10-10 19:40 ` [PATCH 2/2] station: contrain known frequencies before roam scan James Prestwood
2022-10-11 19:31 ` [PATCH 1/2] station: skip disabled frequencies in neighbor report Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox