fix(esp_wifi): Add changes to enable 5ghz scan

This commit is contained in:
Kapil Gupta 2024-09-19 21:23:19 +05:30
parent 903c11ff1a
commit 1d7241acc1

View File

@ -167,22 +167,31 @@ int esp_handle_beacon_probe(u8 type, u8 *frame, size_t len, u8 *sender,
return 0;
}
#ifdef CONFIG_WNM
void get_scan_channel_bitmap(struct wpa_supplicant *wpa_s, wifi_scan_config_t *params)
static void get_scan_channel_bitmap(struct wpa_supplicant *wpa_s, wifi_scan_config_t *params)
{
const int MAX_2GHZ_CHANNEL = 14;
if (!wpa_s->wnm_num_neighbor_report) {
wpa_printf(MSG_DEBUG, "No Neighbor Report to gather scan channel list");
return;
}
params->channel_bitmap.ghz_2_channels = 0;
params->channel_bitmap.ghz_5_channels = 0;
for (int i = 0; i < wpa_s->wnm_num_neighbor_report; i++) {
struct neighbor_report *nei;
nei = &wpa_s->wnm_neighbor_report_elements[i];
params->channel_bitmap.ghz_2_channels |= (1 << nei->channel_number);
struct neighbor_report *nei = &wpa_s->wnm_neighbor_report_elements[i];
if (nei->channel_number <= MAX_2GHZ_CHANNEL) {
params->channel_bitmap.ghz_2_channels |= CHANNEL_TO_BIT(nei->channel_number);
} else {
params->channel_bitmap.ghz_5_channels |= CHANNEL_TO_BIT(nei->channel_number);
}
}
}
#endif /*CONFIG_WNM*/
static int issue_scan(struct wpa_supplicant *wpa_s,
struct wpa_driver_scan_params *scan_params)
{