Skip to content

Commit 2b92598

Browse files
Jordan Yatescarlescufi
authored andcommitted
net: wifi: re-add WIFI_MGMT_FORCED_PASSIVE_SCAN
Re-add the `WIFI_MGMT_FORCED_PASSIVE_SCAN` option removed in #62751. Now that `struct wifi_scan_params` is a reasonable size, we can enforce the passive scan request even when no parameter struct is supplied by the user. Signed-off-by: Jordan Yates <[email protected]>
1 parent 3b7237e commit 2b92598

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

subsys/net/l2/wifi/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ config WIFI_MGMT_TWT_CHECK_IP
3939
even when it is awake intervals. Rejecting TWT setup till Wi-Fi
4040
interface has a valid IP address might be desirable in most scenarios.
4141

42+
config WIFI_MGMT_FORCED_PASSIVE_SCAN
43+
bool "Force passive Wi-Fi scanning"
44+
help
45+
Always request a passive scan, regardless of the user supplied parameters.
46+
This is typically used when the underlying hardware is not certified for
47+
RF transmissions. This doesn't guarantee that passive scan will be used,
48+
it depends on the underlying chip implementation to support and honour
49+
scan type.
50+
4251
config WIFI_MGMT_SCAN_SSID_FILT_MAX
4352
int "Maximum number of SSIDs that can be specified for SSID filtering"
4453
default 1

subsys/net/l2/wifi/wifi_mgmt.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,15 @@ static int wifi_scan(uint32_t mgmt_request, struct net_if *iface,
326326
return -ENOTSUP;
327327
}
328328

329+
#ifdef CONFIG_WIFI_MGMT_FORCED_PASSIVE_SCAN
330+
struct wifi_scan_params default_params = {0};
331+
332+
if (params == NULL) {
333+
params = &default_params;
334+
}
335+
params->scan_type = WIFI_SCAN_TYPE_PASSIVE;
336+
#endif /* CONFIG_WIFI_MGMT_FORCED_PASSIVE_SCAN */
337+
329338
return wifi_mgmt_api->scan(dev, params, scan_result_cb);
330339
}
331340

0 commit comments

Comments
 (0)