Skip to content

Commit a087a40

Browse files
kapbhcarlescufi
authored andcommitted
net: wifi: Remove constraints for dwell time
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]>
1 parent 16ec531 commit a087a40

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

include/zephyr/net/wifi_mgmt.h

-6
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ extern "C" {
4848
#endif /* CONFIG_WIFI_MGMT_SCAN_CHAN_MAX_MANUAL */
4949

5050
#define WIFI_MGMT_BAND_STR_SIZE_MAX 8
51-
#define WIFI_MGMT_SCAN_MIN_DWELL_TIME_ACTIVE 5
52-
#define WIFI_MGMT_SCAN_MAX_DWELL_TIME_ACTIVE 1000
53-
#define WIFI_MGMT_SCAN_MIN_DWELL_TIME_PASSIVE 10
54-
#define WIFI_MGMT_SCAN_MAX_DWELL_TIME_PASSIVE 1000
55-
#define WIFI_MGMT_SCAN_DEFAULT_DWELL_TIME_ACTIVE 50
56-
#define WIFI_MGMT_SCAN_DEFAULT_DWELL_TIME_PASSIVE 130
5751
#define WIFI_MGMT_SCAN_MAX_BSS_CNT 65535
5852

5953
/** Wi-Fi management commands */

subsys/net/l2/wifi/wifi_shell.c

+3-8
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,7 @@ static int wifi_scan_args_to_params(const struct shell *sh,
683683
case 'a':
684684
val = atoi(state->optarg);
685685

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

698-
if ((val < WIFI_MGMT_SCAN_MIN_DWELL_TIME_PASSIVE) ||
699-
(val > WIFI_MGMT_SCAN_MAX_DWELL_TIME_PASSIVE)) {
697+
if (val < 0) {
700698
PR_ERROR("Invalid dwell_time_passive val\n");
701699
return -ENOEXEC;
702700
}
@@ -754,10 +752,7 @@ static int wifi_scan_args_to_params(const struct shell *sh,
754752
static int cmd_wifi_scan(const struct shell *sh, size_t argc, char *argv[])
755753
{
756754
struct net_if *iface = net_if_get_first_wifi();
757-
struct wifi_scan_params params = { .dwell_time_active =
758-
WIFI_MGMT_SCAN_DEFAULT_DWELL_TIME_ACTIVE,
759-
.dwell_time_passive =
760-
WIFI_MGMT_SCAN_DEFAULT_DWELL_TIME_PASSIVE, };
755+
struct wifi_scan_params params = { 0 };
761756
bool do_scan = true;
762757
int opt_num;
763758

0 commit comments

Comments
 (0)