wpa_supplicant: Configurable fast-associate timer threshold
For Android the default value of 5 seconds is usually too short for scan results from last scan initiated from settings app to be considered for fast-associate. Make the fast-associate timer value configurable so that a suitable value can be set based on a systems regular scan interval. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
This commit is contained in:
parent
b829b7003a
commit
f7bbad5768
7 changed files with 28 additions and 9 deletions
|
@ -4309,6 +4309,7 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
|
||||||
config->ap_isolate = DEFAULT_AP_ISOLATE;
|
config->ap_isolate = DEFAULT_AP_ISOLATE;
|
||||||
config->access_network_type = DEFAULT_ACCESS_NETWORK_TYPE;
|
config->access_network_type = DEFAULT_ACCESS_NETWORK_TYPE;
|
||||||
config->scan_cur_freq = DEFAULT_SCAN_CUR_FREQ;
|
config->scan_cur_freq = DEFAULT_SCAN_CUR_FREQ;
|
||||||
|
config->scan_res_valid_for_connect = DEFAULT_SCAN_RES_VALID_FOR_CONNECT;
|
||||||
config->wmm_ac_params[0] = ac_be;
|
config->wmm_ac_params[0] = ac_be;
|
||||||
config->wmm_ac_params[1] = ac_bk;
|
config->wmm_ac_params[1] = ac_bk;
|
||||||
config->wmm_ac_params[2] = ac_vi;
|
config->wmm_ac_params[2] = ac_vi;
|
||||||
|
@ -5105,6 +5106,7 @@ static const struct global_parse_data global_fields[] = {
|
||||||
{ FUNC(freq_list), 0 },
|
{ FUNC(freq_list), 0 },
|
||||||
{ FUNC(initial_freq_list), 0},
|
{ FUNC(initial_freq_list), 0},
|
||||||
{ INT(scan_cur_freq), 0 },
|
{ INT(scan_cur_freq), 0 },
|
||||||
|
{ INT(scan_res_valid_for_connect), 0},
|
||||||
{ INT(sched_scan_interval), 0 },
|
{ INT(sched_scan_interval), 0 },
|
||||||
{ INT(sched_scan_start_delay), 0 },
|
{ INT(sched_scan_start_delay), 0 },
|
||||||
{ INT(tdls_external_control), 0},
|
{ INT(tdls_external_control), 0},
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
#define DEFAULT_DISASSOC_IMMINENT_RSSI_THRESHOLD -75
|
#define DEFAULT_DISASSOC_IMMINENT_RSSI_THRESHOLD -75
|
||||||
#define DEFAULT_OCE_SUPPORT OCE_STA
|
#define DEFAULT_OCE_SUPPORT OCE_STA
|
||||||
#define DEFAULT_EXTENDED_KEY_ID 0
|
#define DEFAULT_EXTENDED_KEY_ID 0
|
||||||
|
#define DEFAULT_SCAN_RES_VALID_FOR_CONNECT 5
|
||||||
|
|
||||||
#include "config_ssid.h"
|
#include "config_ssid.h"
|
||||||
#include "wps/wps.h"
|
#include "wps/wps.h"
|
||||||
|
@ -937,6 +938,15 @@ struct wpa_config {
|
||||||
*/
|
*/
|
||||||
int scan_cur_freq;
|
int scan_cur_freq;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* scan_res_valid_for_connect - Seconds scans are valid for association
|
||||||
|
*
|
||||||
|
* This configures the number of seconds old scan results are considered
|
||||||
|
* valid for association. When scan results are older than this value
|
||||||
|
* a new scan is triggered prior to the association.
|
||||||
|
*/
|
||||||
|
int scan_res_valid_for_connect;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* changed_parameters - Bitmap of changed parameters since last update
|
* changed_parameters - Bitmap of changed parameters since last update
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1487,6 +1487,11 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
|
||||||
if (config->scan_cur_freq != DEFAULT_SCAN_CUR_FREQ)
|
if (config->scan_cur_freq != DEFAULT_SCAN_CUR_FREQ)
|
||||||
fprintf(f, "scan_cur_freq=%d\n", config->scan_cur_freq);
|
fprintf(f, "scan_cur_freq=%d\n", config->scan_cur_freq);
|
||||||
|
|
||||||
|
if (config->scan_res_valid_for_connect !=
|
||||||
|
DEFAULT_SCAN_RES_VALID_FOR_CONNECT)
|
||||||
|
fprintf(f, "scan_res_valid_for_connect=%d\n",
|
||||||
|
config->scan_res_valid_for_connect);
|
||||||
|
|
||||||
if (config->sched_scan_interval)
|
if (config->sched_scan_interval)
|
||||||
fprintf(f, "sched_scan_interval=%u\n",
|
fprintf(f, "sched_scan_interval=%u\n",
|
||||||
config->sched_scan_interval);
|
config->sched_scan_interval);
|
||||||
|
|
|
@ -2449,7 +2449,7 @@ int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s)
|
||||||
|
|
||||||
os_get_reltime(&now);
|
os_get_reltime(&now);
|
||||||
if (os_reltime_expired(&now, &wpa_s->last_scan,
|
if (os_reltime_expired(&now, &wpa_s->last_scan,
|
||||||
SCAN_RES_VALID_FOR_CONNECT)) {
|
wpa_s->conf->scan_res_valid_for_connect)) {
|
||||||
wpa_printf(MSG_DEBUG, "Fast associate: Old scan results");
|
wpa_printf(MSG_DEBUG, "Fast associate: Old scan results");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -5313,13 +5313,13 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
|
||||||
}
|
}
|
||||||
wpa_supplicant_mark_disassoc(wpa_s);
|
wpa_supplicant_mark_disassoc(wpa_s);
|
||||||
os_reltime_age(&wpa_s->last_scan, &age);
|
os_reltime_age(&wpa_s->last_scan, &age);
|
||||||
if (age.sec >= SCAN_RES_VALID_FOR_CONNECT) {
|
if (age.sec >= wpa_s->conf->scan_res_valid_for_connect) {
|
||||||
clear_at.sec = SCAN_RES_VALID_FOR_CONNECT;
|
clear_at.sec = wpa_s->conf->scan_res_valid_for_connect;
|
||||||
clear_at.usec = 0;
|
clear_at.usec = 0;
|
||||||
} else {
|
} else {
|
||||||
struct os_reltime tmp;
|
struct os_reltime tmp;
|
||||||
|
|
||||||
tmp.sec = SCAN_RES_VALID_FOR_CONNECT;
|
tmp.sec = wpa_s->conf->scan_res_valid_for_connect;
|
||||||
tmp.usec = 0;
|
tmp.usec = 0;
|
||||||
os_reltime_sub(&tmp, &age, &clear_at);
|
os_reltime_sub(&tmp, &age, &clear_at);
|
||||||
}
|
}
|
||||||
|
|
|
@ -493,7 +493,8 @@ static char ** wpa_cli_complete_set(const char *str, int pos)
|
||||||
"p2p_go_max_inactivity", "auto_interworking", "okc", "pmf",
|
"p2p_go_max_inactivity", "auto_interworking", "okc", "pmf",
|
||||||
"sae_groups", "dtim_period", "beacon_int",
|
"sae_groups", "dtim_period", "beacon_int",
|
||||||
"ap_vendor_elements", "ignore_old_scan_res", "freq_list",
|
"ap_vendor_elements", "ignore_old_scan_res", "freq_list",
|
||||||
"scan_cur_freq", "sched_scan_interval",
|
"scan_cur_freq", "scan_res_valid_for_connect",
|
||||||
|
"sched_scan_interval",
|
||||||
"tdls_external_control", "osu_dir", "wowlan_triggers",
|
"tdls_external_control", "osu_dir", "wowlan_triggers",
|
||||||
"p2p_search_delay", "mac_addr", "rand_addr_lifetime",
|
"p2p_search_delay", "mac_addr", "rand_addr_lifetime",
|
||||||
"preassoc_mac_addr", "key_mgmt_offload", "passive_scan",
|
"preassoc_mac_addr", "key_mgmt_offload", "passive_scan",
|
||||||
|
@ -589,7 +590,8 @@ static char ** wpa_cli_complete_get(const char *str, int pos)
|
||||||
"wps_nfc_dev_pw_id", "ext_password_backend",
|
"wps_nfc_dev_pw_id", "ext_password_backend",
|
||||||
"p2p_go_max_inactivity", "auto_interworking", "okc", "pmf",
|
"p2p_go_max_inactivity", "auto_interworking", "okc", "pmf",
|
||||||
"dtim_period", "beacon_int", "ignore_old_scan_res",
|
"dtim_period", "beacon_int", "ignore_old_scan_res",
|
||||||
"scan_cur_freq", "sched_scan_interval",
|
"scan_cur_freq", "scan_res_valid_for_connect",
|
||||||
|
"sched_scan_interval",
|
||||||
"sched_scan_start_delay",
|
"sched_scan_start_delay",
|
||||||
"tdls_external_control", "osu_dir", "wowlan_triggers",
|
"tdls_external_control", "osu_dir", "wowlan_triggers",
|
||||||
"p2p_search_delay", "mac_addr", "rand_addr_lifetime",
|
"p2p_search_delay", "mac_addr", "rand_addr_lifetime",
|
||||||
|
|
|
@ -458,6 +458,9 @@ fast_reauth=1
|
||||||
# 1: Scan current operating frequency if another VIF on the same radio
|
# 1: Scan current operating frequency if another VIF on the same radio
|
||||||
# is already associated.
|
# is already associated.
|
||||||
|
|
||||||
|
# Seconds to consider old scan results valid for association (default: 5)
|
||||||
|
#scan_res_valid_for_connect=5
|
||||||
|
|
||||||
# MAC address policy default
|
# MAC address policy default
|
||||||
# 0 = use permanent MAC address
|
# 0 = use permanent MAC address
|
||||||
# 1 = use random MAC address for each ESS connection
|
# 1 = use random MAC address for each ESS connection
|
||||||
|
|
|
@ -49,9 +49,6 @@ struct ctrl_iface_global_priv;
|
||||||
struct wpas_dbus_priv;
|
struct wpas_dbus_priv;
|
||||||
struct wpas_binder_priv;
|
struct wpas_binder_priv;
|
||||||
|
|
||||||
/* How many seconds to consider old scan results valid for association. */
|
|
||||||
#define SCAN_RES_VALID_FOR_CONNECT 5
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct wpa_interface - Parameters for wpa_supplicant_add_iface()
|
* struct wpa_interface - Parameters for wpa_supplicant_add_iface()
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue