Skip to content

Commit

Permalink
net: wifi: Remove constraints for dwell time
Browse files Browse the repository at this point in the history
There is no limitations for dwell time. Just add
valid condition for positive value. So , it's better
to remove those constraints.

Signed-off-by: Kapil Bhatt <[email protected]>
  • Loading branch information
kapbh authored and carlescufi committed Apr 9, 2024
1 parent 16ec531 commit a087a40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
6 changes: 0 additions & 6 deletions include/zephyr/net/wifi_mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ extern "C" {
#endif /* CONFIG_WIFI_MGMT_SCAN_CHAN_MAX_MANUAL */

#define WIFI_MGMT_BAND_STR_SIZE_MAX 8
#define WIFI_MGMT_SCAN_MIN_DWELL_TIME_ACTIVE 5
#define WIFI_MGMT_SCAN_MAX_DWELL_TIME_ACTIVE 1000
#define WIFI_MGMT_SCAN_MIN_DWELL_TIME_PASSIVE 10
#define WIFI_MGMT_SCAN_MAX_DWELL_TIME_PASSIVE 1000
#define WIFI_MGMT_SCAN_DEFAULT_DWELL_TIME_ACTIVE 50
#define WIFI_MGMT_SCAN_DEFAULT_DWELL_TIME_PASSIVE 130
#define WIFI_MGMT_SCAN_MAX_BSS_CNT 65535

/** Wi-Fi management commands */
Expand Down
11 changes: 3 additions & 8 deletions subsys/net/l2/wifi/wifi_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,7 @@ static int wifi_scan_args_to_params(const struct shell *sh,
case 'a':
val = atoi(state->optarg);

if ((val < WIFI_MGMT_SCAN_MIN_DWELL_TIME_ACTIVE) ||
(val > WIFI_MGMT_SCAN_MAX_DWELL_TIME_ACTIVE)) {
if (val < 0) {
PR_ERROR("Invalid dwell_time_active val\n");
return -ENOEXEC;
}
Expand All @@ -695,8 +694,7 @@ static int wifi_scan_args_to_params(const struct shell *sh,
case 'p':
val = atoi(state->optarg);

if ((val < WIFI_MGMT_SCAN_MIN_DWELL_TIME_PASSIVE) ||
(val > WIFI_MGMT_SCAN_MAX_DWELL_TIME_PASSIVE)) {
if (val < 0) {
PR_ERROR("Invalid dwell_time_passive val\n");
return -ENOEXEC;
}
Expand Down Expand Up @@ -754,10 +752,7 @@ static int wifi_scan_args_to_params(const struct shell *sh,
static int cmd_wifi_scan(const struct shell *sh, size_t argc, char *argv[])
{
struct net_if *iface = net_if_get_first_wifi();
struct wifi_scan_params params = { .dwell_time_active =
WIFI_MGMT_SCAN_DEFAULT_DWELL_TIME_ACTIVE,
.dwell_time_passive =
WIFI_MGMT_SCAN_DEFAULT_DWELL_TIME_PASSIVE, };
struct wifi_scan_params params = { 0 };
bool do_scan = true;
int opt_num;

Expand Down

0 comments on commit a087a40

Please sign in to comment.