Skip to contentSkip to conversation

station: skip disabled frequencies in neighbor report

PATCH In review James Prestwood 2 participants 3 messages Oct 10, 2022 – Oct 11, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 station: skip disabled frequencies in neighbor report

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(-)
src/station.c +5 -2
index 19cba680..f138846d 100644
@@ -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,
Signature · 1 line
2.34.3
#1 lore raw

PATCH 2/2 station: contrain known frequencies before roam scan

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(-)
src/station.c +7 -2
index f138846d..986d6757 100644
@@ -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;
 }
Signature · 1 line
2.34.3
#2 lore raw
In reply to James Prestwood

Hi James,

Quoted 6 lines · 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(-)

Both applied, thanks.

Regards,
-Denis