diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 8e7dc9627..0afc9fc51 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -505,6 +505,11 @@ struct wpa_driver_capa { unsigned int flags; int max_scan_ssids; + + /** + * max_remain_on_chan - Maximum remain-on-channel duration in msec + */ + unsigned int max_remain_on_chan; }; diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index a06fa8435..4f574cfa3 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -1157,6 +1157,7 @@ static int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv) } drv->capa.flags |= WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE; + drv->capa.max_remain_on_chan = 5000; return 0; } diff --git a/src/drivers/driver_test.c b/src/drivers/driver_test.c index 338bc7625..fb2467350 100644 --- a/src/drivers/driver_test.c +++ b/src/drivers/driver_test.c @@ -2386,6 +2386,7 @@ static int wpa_driver_test_get_capa(void *priv, struct wpa_driver_capa *capa) capa->flags |= WPA_DRIVER_FLAGS_USER_SPACE_MLME; capa->flags |= WPA_DRIVER_FLAGS_AP; capa->max_scan_ssids = 2; + capa->max_remain_on_chan = 60000; return 0; } diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 15ca6dbda..2ad0309c3 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2015,6 +2015,18 @@ next_driver: return -1; } + if (wpa_drv_get_capa(wpa_s, &capa) == 0) { + wpa_s->drv_flags = capa.flags; + if (capa.flags & WPA_DRIVER_FLAGS_USER_SPACE_MLME) { + if (ieee80211_sta_init(wpa_s)) + return -1; + } + wpa_s->max_scan_ssids = capa.max_scan_ssids; + wpa_s->max_remain_on_chan = capa.max_remain_on_chan; + } + if (wpa_s->max_remain_on_chan == 0) + wpa_s->max_remain_on_chan = 1000; + if (wpa_supplicant_driver_init(wpa_s) < 0) return -1; @@ -2047,15 +2059,6 @@ next_driver: return -1; } - if (wpa_drv_get_capa(wpa_s, &capa) == 0) { - wpa_s->drv_flags = capa.flags; - if (capa.flags & WPA_DRIVER_FLAGS_USER_SPACE_MLME) { - if (ieee80211_sta_init(wpa_s)) - return -1; - } - wpa_s->max_scan_ssids = capa.max_scan_ssids; - } - #ifdef CONFIG_IBSS_RSN wpa_s->ibss_rsn = ibss_rsn_init(wpa_s); if (!wpa_s->ibss_rsn) { diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 84d642cf6..2ac882685 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -384,6 +384,7 @@ struct wpa_supplicant { struct wpa_client_mlme mlme; unsigned int drv_flags; int max_scan_ssids; + unsigned int max_remain_on_chan; int pending_mic_error_report; int pending_mic_error_pairwise;