mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(esp_wifi): Add changes to enable 5ghz scan
This commit is contained in:
parent
903c11ff1a
commit
1d7241acc1
@ -167,22 +167,31 @@ int esp_handle_beacon_probe(u8 type, u8 *frame, size_t len, u8 *sender,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_WNM
|
#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) {
|
if (!wpa_s->wnm_num_neighbor_report) {
|
||||||
wpa_printf(MSG_DEBUG, "No Neighbor Report to gather scan channel list");
|
wpa_printf(MSG_DEBUG, "No Neighbor Report to gather scan channel list");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
params->channel_bitmap.ghz_2_channels = 0;
|
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++) {
|
for (int i = 0; i < wpa_s->wnm_num_neighbor_report; i++) {
|
||||||
struct neighbor_report *nei;
|
struct neighbor_report *nei = &wpa_s->wnm_neighbor_report_elements[i];
|
||||||
nei = &wpa_s->wnm_neighbor_report_elements[i];
|
|
||||||
params->channel_bitmap.ghz_2_channels |= (1 << nei->channel_number);
|
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*/
|
#endif /*CONFIG_WNM*/
|
||||||
|
|
||||||
static int issue_scan(struct wpa_supplicant *wpa_s,
|
static int issue_scan(struct wpa_supplicant *wpa_s,
|
||||||
struct wpa_driver_scan_params *scan_params)
|
struct wpa_driver_scan_params *scan_params)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user