Skip to content

Commit 3be10b7

Browse files
rado17anangl
authored andcommitted
[nrf fromlist] wifi: utils: Get correct channel count
For 2.4GHz and 6GHz bands, while counting the channels in configured range, start of the range is being counted twice. Correct this by advancing the index by 1 while counting channels in range. Upstream PR: zephyrproject-rtos/zephyr#74063 Signed-off-by: Ravi Dondaputi <[email protected]>
1 parent 41b063f commit 3be10b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/net/l2/wifi/wifi_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static int wifi_utils_get_all_chans_in_range(uint8_t chan_start,
135135
case WIFI_FREQ_BAND_2_4_GHZ:
136136
idx = *chan_idx;
137137

138-
for (i = chan_start; i <= chan_end; i++) {
138+
for (i = chan_start+1; i <= chan_end; i++) {
139139
band_chan[idx].band = band_idx;
140140
band_chan[idx].channel = i;
141141
idx++;
@@ -173,7 +173,7 @@ static int wifi_utils_get_all_chans_in_range(uint8_t chan_start,
173173
case WIFI_FREQ_BAND_6_GHZ:
174174
idx = *chan_idx;
175175

176-
i = chan_start;
176+
i = chan_start+1;
177177

178178
while (i <= chan_end) {
179179
band_chan[idx].band = band_idx;

0 commit comments

Comments
 (0)