Skip to content

Commit

Permalink
driver: wifi: siwx917: Add active and passive dwell time
Browse files Browse the repository at this point in the history
This commit adds support for configuring dwell times for
both active and passive Wi-Fi scans. The dwell time specifies
the duration the device spends on each channel during a scan.

Signed-off-by: Arunmani Alagarsamy <[email protected]>
  • Loading branch information
ArunmaniAlagarsamy2710 authored and jerome-pouiller committed Feb 5, 2025
1 parent 91d9a74 commit d61c3f3
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions drivers/wifi/siwx917/siwx917_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,27 @@ static int siwx917_scan(const struct device *dev, struct wifi_scan_params *z_sca
return -EBUSY;
}

/* The enum values are same, no conversion needed */
sl_scan_config.type = z_scan_config->scan_type;
if (z_scan_config->scan_type == WIFI_SCAN_TYPE_ACTIVE) {
sl_scan_config.type = SL_WIFI_SCAN_TYPE_ACTIVE;
if (!z_scan_config->dwell_time_active) {
ret = sl_si91x_configure_timeout(SL_SI91X_CHANNEL_ACTIVE_SCAN_TIMEOUT,
SL_WIFI_DEFAULT_ACTIVE_CHANNEL_SCAN_TIME);
} else {
ret = sl_si91x_configure_timeout(SL_SI91X_CHANNEL_ACTIVE_SCAN_TIMEOUT,
z_scan_config->dwell_time_active);
}

if (ret) {
return -EINVAL;
}
} else {
sl_scan_config.type = SL_WIFI_SCAN_TYPE_PASSIVE;
ret = sl_si91x_configure_timeout(SL_SI91X_CHANNEL_PASSIVE_SCAN_TIMEOUT,
z_scan_config->dwell_time_passive);
if (ret) {
return -EINVAL;
}
}

for (int i = 0; i < WIFI_MGMT_SCAN_CHAN_MAX_MANUAL; i++) {
sl_scan_config.channel_bitmap_2g4 |= BIT(z_scan_config->band_chan[i].channel - 1);
Expand Down

0 comments on commit d61c3f3

Please sign in to comment.