diff options
author | Eyal Shapira <eyal@wizery.com> | 2012-08-08 20:38:34 +0300 |
---|---|---|
committer | Arik Nemtsov <arik@wizery.com> | 2012-08-08 23:11:58 +0300 |
commit | 7b5660da67dd03f932f2de91d7ce7858ebe0bc6b (patch) | |
tree | 4bfab50cdf1ba78c1b90c3dd4b462296d25f0b11 | |
parent | adc2670ced918251a534d1ed8d158f0d3f450dad (diff) | |
download | external_wpa_supplicant_8_ti-7b5660da67dd03f932f2de91d7ce7858ebe0bc6b.zip external_wpa_supplicant_8_ti-7b5660da67dd03f932f2de91d7ce7858ebe0bc6b.tar.gz external_wpa_supplicant_8_ti-7b5660da67dd03f932f2de91d7ce7858ebe0bc6b.tar.bz2 |
Add p2p_go_max_inactivity config option (UPSTREAM)
This enables setting a different max inactivity timeout for P2P GO.
This timeout is used to detect inactive clients. In some scenarios
it may be useful to have control over this and set a shorter timeout
than the default 300s. For example when running STA and P2P GO interfaces
concurrently, the STA interface may perform scans which may cause the
GO to miss a disassoc / deauth frames from a client and keep assuming
that the client is connected until the inactivity detection kicks in.
300 secs is a bit too long for such scenarios and creates a bad user
experience.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
-rw-r--r-- | wpa_supplicant/config.c | 2 | ||||
-rw-r--r-- | wpa_supplicant/config.h | 11 | ||||
-rw-r--r-- | wpa_supplicant/config_file.c | 3 | ||||
-rw-r--r-- | wpa_supplicant/p2p_supplicant.c | 1 |
4 files changed, 17 insertions, 0 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index de633b8..886cff9 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -2554,6 +2554,7 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface, config->fast_reauth = DEFAULT_FAST_REAUTH; config->p2p_go_intent = DEFAULT_P2P_GO_INTENT; config->p2p_intra_bss = DEFAULT_P2P_INTRA_BSS; + config->p2p_go_max_inactivity = DEFAULT_P2P_GO_MAX_INACTIVITY; config->bss_max_count = DEFAULT_BSS_MAX_COUNT; config->bss_expiration_age = DEFAULT_BSS_EXPIRATION_AGE; config->bss_expiration_scan_count = DEFAULT_BSS_EXPIRATION_SCAN_COUNT; @@ -2992,6 +2993,7 @@ static const struct global_parse_data global_fields[] = { { BIN(wps_nfc_dh_pubkey), 0 }, { BIN(wps_nfc_dh_privkey), 0 }, { BIN(wps_nfc_dev_pw), 0 }, + { INT(p2p_go_max_inactivity), 0 }, { INT_RANGE(sched_scan_num_short_intervals, 0, MAX_NUM_SCHED_SCAN_SHORT_INTERVALS), 0 }, { INT_RANGE(sched_scan_short_interval, 1, MAX_SCHED_SCAN_INTERVAL), 0 }, diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index 8624e40..fd9ba78 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -18,6 +18,7 @@ #define DEFAULT_FAST_REAUTH 1 #define DEFAULT_P2P_GO_INTENT 7 #define DEFAULT_P2P_INTRA_BSS 1 +#define DEFAULT_P2P_GO_MAX_INACTIVITY (5*60) #define DEFAULT_BSS_MAX_COUNT 200 #define DEFAULT_BSS_EXPIRATION_AGE 180 #define DEFAULT_BSS_EXPIRATION_SCAN_COUNT 2 @@ -680,6 +681,16 @@ struct wpa_config { */ struct wpabuf *wps_nfc_dev_pw; + + /** + * p2p_go_max_inactivity - Timeout in seconds to detect STA's inactivity + * + * This timeout value is used in P2P GO mode to clean up + * inactive stations. + * By default: 300 seconds. + */ + int p2p_go_max_inactivity; + /** * sched_scan_short_interval - Initial interval for sched scan in secs * sched scan will start with this interval for num_short_intervals diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index a365b09..b99517b 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -893,6 +893,9 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config) write_global_bin(f, "wps_nfc_dh_pubkey", config->wps_nfc_dh_pubkey); write_global_bin(f, "wps_nfc_dh_privkey", config->wps_nfc_dh_privkey); write_global_bin(f, "wps_nfc_dev_pw", config->wps_nfc_dev_pw); + if (config->p2p_go_max_inactivity != DEFAULT_P2P_GO_MAX_INACTIVITY) + fprintf(f, "p2p_go_max_inactivity=%u\n", + config->p2p_go_max_inactivity); if (config->sched_scan_num_short_intervals != DEFAULT_SCHED_SCAN_NUM_SHORT_INTERVALS) fprintf(f, "sched_scan_num_short_intervals=%u\n", diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 30e8fd7..cc83feb 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -842,6 +842,7 @@ static void wpas_start_wps_go(struct wpa_supplicant *wpa_s, ssid->proto = WPA_PROTO_RSN; ssid->pairwise_cipher = WPA_CIPHER_CCMP; ssid->passphrase = os_strdup(params->passphrase); + ssid->ap_max_inactivity = wpa_s->parent->conf->p2p_go_max_inactivity; wpa_s->ap_configured_cb = p2p_go_configured; wpa_s->ap_configured_cb_ctx = wpa_s; |