Allow driver wrappers to indicate maximum remain-on-channel duration

This commit is contained in:
Jouni Malinen 2010-04-11 19:42:37 +03:00 committed by Jouni Malinen
parent de12717a56
commit 814782b9fe
5 changed files with 20 additions and 9 deletions

View File

@ -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;
};

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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) {

View File

@ -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;