aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2014-04-25 10:46:36 -0700
committerDmitry Shmidt <dimitrysh@google.com>2014-04-25 10:46:36 -0700
commitf9bdef99ce3b2858f2812c745a3d6bb093fb0e5d (patch)
tree8e2c35636aeb016e46a5113cedb56761c521ee22 /wpa_supplicant
parent61593f02176862f4880ddefcb1f54cb5f5d9f043 (diff)
downloadandroid_external_wpa_supplicant_8-f9bdef99ce3b2858f2812c745a3d6bb093fb0e5d.tar.gz
android_external_wpa_supplicant_8-f9bdef99ce3b2858f2812c745a3d6bb093fb0e5d.tar.bz2
android_external_wpa_supplicant_8-f9bdef99ce3b2858f2812c745a3d6bb093fb0e5d.zip
Cumulative patch from commit d0df64373561a8804c35e1900e5857096f5b73d8
d0df643 wpa_supplicant: Call frequency conflict handling during auth 0cf24fd scan: Reset normal scan counter when a connection succeeds dcdce14 radiotap: Fix compilation for systems without le16toh/le32toh 9176ec0 Android: Disable unused parameter warnings 2aa82e5 Interworking: Don't filter probe requests when interworking is disabled 13f6a07 Add SIM identifier to the network profile and cred block Change-Id: I9135d23aea91ca2950b5eeefa9f81c38ab1ff4d1 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/Android.mk3
-rw-r--r--wpa_supplicant/README-HS202
-rw-r--r--wpa_supplicant/config.c8
-rw-r--r--wpa_supplicant/config.h8
-rw-r--r--wpa_supplicant/config_file.c5
-rw-r--r--wpa_supplicant/config_ssid.h1
-rw-r--r--wpa_supplicant/interworking.c1
-rw-r--r--wpa_supplicant/sme.c26
-rw-r--r--wpa_supplicant/wpa_supplicant.c13
-rw-r--r--wpa_supplicant/wpa_supplicant.conf2
10 files changed, 65 insertions, 4 deletions
diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk
index c8fe1c2c..f56267c8 100644
--- a/wpa_supplicant/Android.mk
+++ b/wpa_supplicant/Android.mk
@@ -24,6 +24,9 @@ L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
# Set Android log name
L_CFLAGS += -DANDROID_LOG_NAME=\"wpa_supplicant\"
+# Disable unused parameter warnings
+L_CFLAGS += -Wno-unused-parameter
+
# Disable roaming in wpa_supplicant
ifdef CONFIG_NO_ROAMING
L_CFLAGS += -DCONFIG_NO_ROAMING
diff --git a/wpa_supplicant/README-HS20 b/wpa_supplicant/README-HS20
index d0b0b50a..58c24750 100644
--- a/wpa_supplicant/README-HS20
+++ b/wpa_supplicant/README-HS20
@@ -270,6 +270,8 @@ Credentials can be pre-configured for automatic network selection:
# 1 = try to use OCSP stapling, but not require response
# 2 = require valid OCSP stapling response
#
+# sim_num: Identifier for which SIM to use in multi-SIM devices
+#
# for example:
#
#cred={
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index b4ee1f5c..698b4592 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -1666,6 +1666,7 @@ static const struct parse_data ssid_fields[] = {
{ INTe(engine) },
{ INTe(engine2) },
{ INT(eapol_flags) },
+ { INTe(sim_num) },
#endif /* IEEE8021X_EAPOL */
{ FUNC_KEY(wep_key0) },
{ FUNC_KEY(wep_key1) },
@@ -2154,6 +2155,7 @@ void wpa_config_set_network_defaults(struct wpa_ssid *ssid)
ssid->eapol_flags = DEFAULT_EAPOL_FLAGS;
ssid->eap_workaround = DEFAULT_EAP_WORKAROUND;
ssid->eap.fragment_size = DEFAULT_FRAGMENT_SIZE;
+ ssid->eap.sim_num = DEFAULT_USER_SELECTED_SIM;
#endif /* IEEE8021X_EAPOL */
#ifdef CONFIG_HT_OVERRIDES
ssid->disable_ht = DEFAULT_DISABLE_HT;
@@ -2572,6 +2574,11 @@ int wpa_config_set_cred(struct wpa_cred *cred, const char *var,
return 0;
}
+ if (os_strcmp(var, "sim_num") == 0) {
+ cred->sim_num = atoi(value);
+ return 0;
+ }
+
val = wpa_config_parse_string(value, &len);
if (val == NULL) {
wpa_printf(MSG_ERROR, "Line %d: invalid field '%s' string "
@@ -3100,6 +3107,7 @@ struct wpa_cred * wpa_config_add_cred(struct wpa_config *config)
if (cred == NULL)
return NULL;
cred->id = id;
+ cred->sim_num = DEFAULT_USER_SELECTED_SIM;
if (last)
last->next = cred;
else
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index a3980494..26b1233a 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -288,6 +288,14 @@ struct wpa_cred {
* 2 = require valid OCSP stapling response
*/
int ocsp;
+
+ /**
+ * sim_num - User selected SIM identifier
+ *
+ * This variable is used for identifying which SIM is used if the system
+ * has more than one.
+ */
+ int sim_num;
};
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 8f0561a0..8d59f496 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -219,6 +219,7 @@ static struct wpa_cred * wpa_config_read_cred(FILE *f, int *line, int id)
if (cred == NULL)
return NULL;
cred->id = id;
+ cred->sim_num = DEFAULT_USER_SELECTED_SIM;
while (wpa_config_get_line(buf, sizeof(buf), f, line, &pos)) {
if (os_strcmp(pos, "}") == 0) {
@@ -712,6 +713,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
STR(pac_file);
INT_DEFe(fragment_size, DEFAULT_FRAGMENT_SIZE);
INTe(ocsp);
+ INT_DEFe(sim_num, DEFAULT_USER_SELECTED_SIM);
#endif /* IEEE8021X_EAPOL */
INT(mode);
INT(frequency);
@@ -858,6 +860,9 @@ static void wpa_config_write_cred(FILE *f, struct wpa_cred *cred)
cred->required_roaming_consortium[i]);
fprintf(f, "\n");
}
+
+ if (cred->sim_num != DEFAULT_USER_SELECTED_SIM)
+ fprintf(f, "\tsim_num=%d\n", cred->sim_num);
}
diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
index a458990d..18fb65bb 100644
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
@@ -34,6 +34,7 @@
#define DEFAULT_DISABLE_MAX_AMSDU -1 /* no change */
#define DEFAULT_AMPDU_FACTOR -1 /* no change */
#define DEFAULT_AMPDU_DENSITY -1 /* no change */
+#define DEFAULT_USER_SELECTED_SIM 1
struct psk_list_entry {
struct dl_list list;
diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c
index 3450ffea..f46c4cfc 100644
--- a/wpa_supplicant/interworking.c
+++ b/wpa_supplicant/interworking.c
@@ -925,6 +925,7 @@ static int interworking_connect_3gpp(struct wpa_supplicant *wpa_s,
goto fail;
os_memcpy(ssid->ssid, bss->ssid, bss->ssid_len);
ssid->ssid_len = bss->ssid_len;
+ ssid->eap.sim_num = cred->sim_num;
if (interworking_set_hs20_params(wpa_s, ssid) < 0)
goto fail;
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 2538ba0c..9b6667a6 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -416,6 +416,32 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
if (old_ssid != wpa_s->current_ssid)
wpas_notify_network_changed(wpa_s);
+#ifdef CONFIG_P2P
+ /*
+ * If multi-channel concurrency is not supported, check for any
+ * frequency conflict. In case of any frequency conflict, remove the
+ * least prioritized connection.
+ */
+ if (wpa_s->num_multichan_concurrent < 2) {
+ int freq, num;
+ num = get_shared_radio_freqs(wpa_s, &freq, 1);
+ if (num > 0 && freq > 0 && freq != params.freq) {
+ wpa_printf(MSG_DEBUG,
+ "Conflicting frequency found (%d != %d)",
+ freq, params.freq);
+ if (wpas_p2p_handle_frequency_conflicts(wpa_s,
+ params.freq,
+ ssid) < 0) {
+ wpas_connection_failed(wpa_s, bss->bssid);
+ wpa_supplicant_mark_disassoc(wpa_s);
+ wpabuf_free(resp);
+ wpas_connect_work_done(wpa_s);
+ return;
+ }
+ }
+ }
+#endif /* CONFIG_P2P */
+
wpa_s->sme.auth_alg = params.auth_alg;
if (wpa_drv_authenticate(wpa_s, &params) < 0) {
wpa_msg(wpa_s, MSG_INFO, "SME: Authentication request to the "
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 5d9cbf7a..af7b847b 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -673,8 +673,11 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
wpa_s->normal_scans = 0;
}
- if (state == WPA_COMPLETED)
+ if (state == WPA_COMPLETED) {
wpas_connect_work_done(wpa_s);
+ /* Reinitialize normal_scan counter */
+ wpa_s->normal_scans = 0;
+ }
if (state != WPA_SCANNING)
wpa_supplicant_notify_scanning(wpa_s, 0);
@@ -1819,9 +1822,11 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
* least prioritized connection.
*/
if (wpa_s->num_multichan_concurrent < 2) {
- int freq = wpa_drv_shared_freq(wpa_s);
- if (freq > 0 && freq != params.freq) {
- wpa_printf(MSG_DEBUG, "Shared interface with conflicting frequency found (%d != %d)",
+ int freq, num;
+ num = get_shared_radio_freqs(wpa_s, &freq, 1);
+ if (num > 0 && freq > 0 && freq != params.freq) {
+ wpa_printf(MSG_DEBUG,
+ "Assoc conflicting freq found (%d != %d)",
freq, params.freq);
if (wpas_p2p_handle_frequency_conflicts(wpa_s,
params.freq,
diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf
index 86a4621e..81fbdfb4 100644
--- a/wpa_supplicant/wpa_supplicant.conf
+++ b/wpa_supplicant/wpa_supplicant.conf
@@ -483,6 +483,8 @@ fast_reauth=1
# 1 = try to use OCSP stapling, but not require response
# 2 = require valid OCSP stapling response
#
+# sim_num: Identifier for which SIM to use in multi-SIM devices
+#
# for example:
#
#cred={