aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/drivers/driver.h7
-rw-r--r--src/drivers/driver_nl80211.c12
-rw-r--r--wpa_supplicant/config.c2
-rw-r--r--wpa_supplicant/config_file.c1
-rw-r--r--wpa_supplicant/config_ssid.h7
-rw-r--r--wpa_supplicant/sme.c2
-rw-r--r--wpa_supplicant/wpa_supplicant.c1
7 files changed, 32 insertions, 0 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 6eb0421..c4f6b5f 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -333,6 +333,13 @@ struct wpa_driver_associate_params {
int freq;
/**
+ * bg_scan_period - Background scan period in seconds, 0 to disable
+ * background scan, or -1 to indicate no change to default driver
+ * configuration
+ */
+ int bg_scan_period;
+
+ /**
* wpa_ie - WPA information element for (Re)Association Request
* WPA information element to be included in (Re)Association
* Request (including information element id and length). Use
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 94fbca1..1cbbbad 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -6575,6 +6575,12 @@ static int wpa_driver_nl80211_connect(
wpa_printf(MSG_DEBUG, " * freq=%d", params->freq);
NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, params->freq);
}
+ if (params->bg_scan_period >= 0) {
+ wpa_printf(MSG_DEBUG, " * bg scan period=%d",
+ params->bg_scan_period);
+ NLA_PUT_U16(msg, NL80211_ATTR_BG_SCAN_PERIOD,
+ params->bg_scan_period);
+ }
if (params->ssid) {
wpa_hexdump_ascii(MSG_DEBUG, " * SSID",
params->ssid, params->ssid_len);
@@ -6772,6 +6778,12 @@ static int wpa_driver_nl80211_associate(
drv->assoc_freq = params->freq;
} else
drv->assoc_freq = 0;
+ if (params->bg_scan_period >= 0) {
+ wpa_printf(MSG_DEBUG, " * bg scan period=%d",
+ params->bg_scan_period);
+ NLA_PUT_U16(msg, NL80211_ATTR_BG_SCAN_PERIOD,
+ params->bg_scan_period);
+ }
if (params->ssid) {
wpa_hexdump_ascii(MSG_DEBUG, " * SSID",
params->ssid, params->ssid_len);
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 5675d2e..ea0b6f4 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -1525,6 +1525,7 @@ static const struct parse_data ssid_fields[] = {
{ FUNC_KEY(psk) },
{ FUNC(proto) },
{ FUNC(key_mgmt) },
+ { INT(bg_scan_period) },
{ FUNC(pairwise) },
{ FUNC(group) },
{ FUNC(auth_alg) },
@@ -1978,6 +1979,7 @@ void wpa_config_set_network_defaults(struct wpa_ssid *ssid)
ssid->pairwise_cipher = DEFAULT_PAIRWISE;
ssid->group_cipher = DEFAULT_GROUP;
ssid->key_mgmt = DEFAULT_KEY_MGMT;
+ ssid->bg_scan_period = DEFAULT_BG_SCAN_PERIOD;
#ifdef IEEE8021X_EAPOL
ssid->eapol_flags = DEFAULT_EAPOL_FLAGS;
ssid->eap_workaround = DEFAULT_EAP_WORKAROUND;
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index cf53320..e7f3a7c 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -588,6 +588,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
write_psk(f, ssid);
write_proto(f, ssid);
write_key_mgmt(f, ssid);
+ INT(bg_scan_period);
write_pairwise(f, ssid);
write_group(f, ssid);
write_auth_alg(f, ssid);
diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
index fa18826..80d4382 100644
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
@@ -25,6 +25,7 @@
WPA_CIPHER_WEP104 | WPA_CIPHER_WEP40)
#define DEFAULT_FRAGMENT_SIZE 1398
+#define DEFAULT_BG_SCAN_PERIOD -1
#define DEFAULT_DISABLE_HT 0
#define DEFAULT_DISABLE_HT40 0
#define DEFAULT_DISABLE_MAX_AMSDU -1 /* no change */
@@ -157,6 +158,12 @@ struct wpa_ssid {
int key_mgmt;
/**
+ * bg_scan_period - Background scan period in seconds, 0 to disable, or
+ * -1 to indicate no change to default driver configuration
+ */
+ int bg_scan_period;
+
+ /**
* proto - Bitfield of allowed protocols, WPA_PROTO_*
*/
int proto;
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 690f395..b366847 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -371,6 +371,8 @@ void sme_associate(struct wpa_supplicant *wpa_s, enum wpas_mode mode,
params.ssid = wpa_s->sme.ssid;
params.ssid_len = wpa_s->sme.ssid_len;
params.freq = wpa_s->sme.freq;
+ params.bg_scan_period = wpa_s->current_ssid ?
+ wpa_s->current_ssid->bg_scan_period : -1;
params.wpa_ie = wpa_s->sme.assoc_req_ie_len ?
wpa_s->sme.assoc_req_ie : NULL;
params.wpa_ie_len = wpa_s->sme.assoc_req_ie_len;
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 36074d5..71542f0 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1355,6 +1355,7 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
params.wpa_proto = wpa_s->wpa_proto;
params.auth_alg = algs;
params.mode = ssid->mode;
+ params.bg_scan_period = ssid->bg_scan_period;
for (i = 0; i < NUM_WEP_KEYS; i++) {
if (ssid->wep_key_len[i])
params.wep_key[i] = ssid->wep_key[i];