Skip to content

Commit

Permalink
driver: wifi: siwx917: Add support for direct SSID scanning
Browse files Browse the repository at this point in the history
Added support for scanning a specific SSID by passing the desired SSID
directly to the scan configuration.

Signed-off-by: Arunmani Alagarsamy <[email protected]>
  • Loading branch information
ArunmaniAlagarsamy2710 committed Jan 22, 2025
1 parent 1517c5a commit ea3f583
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/wifi/siwx917/siwx917_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ static int siwx917_scan(const struct device *dev, struct wifi_scan_params *z_sca
{
sl_wifi_scan_configuration_t sl_scan_config = { };
struct siwx917_dev *sidev = dev->data;
sl_wifi_ssid_t direct_ssid = { };
int ret;

Check notice on line 201 in drivers/wifi/siwx917/siwx917_wifi.c

View workflow job for this annotation

GitHub Actions / compliance

You may want to run clang-format on this change

drivers/wifi/siwx917/siwx917_wifi.c:201 - sl_wifi_ssid_t direct_ssid = { }; + sl_wifi_ssid_t direct_ssid = {};

if (sidev->state != WIFI_STATE_INACTIVE) {
Expand All @@ -211,7 +212,15 @@ static int siwx917_scan(const struct device *dev, struct wifi_scan_params *z_sca
memset(sl_scan_config.channel_bitmap_5g, 0xFF, sizeof(sl_scan_config.channel_bitmap_5g));

sidev->scan_res_cb = cb;
ret = sl_wifi_start_scan(SL_WIFI_CLIENT_INTERFACE, NULL, &sl_scan_config);

#if (CONFIG_WIFI_MGMT_SCAN_SSID_FILT_MAX > 0)
if (z_scan_config->ssids[0]) {
strncpy(direct_ssid.value, z_scan_config->ssids[0], WIFI_SSID_MAX_LEN);
direct_ssid.length = strlen(z_scan_config->ssids[0]);
}
#endif
ret = sl_wifi_start_scan(SL_WIFI_CLIENT_INTERFACE,
(direct_ssid.length > 0) ? &direct_ssid : NULL, &sl_scan_config);
if (ret != SL_STATUS_IN_PROGRESS) {
return -EIO;
}
Expand Down

0 comments on commit ea3f583

Please sign in to comment.