aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-08-09 19:17:08 (GMT)
committerJouni Malinen <j@w1.fi>2012-08-09 20:18:31 (GMT)
commit7997ece468a8cd59d005e060ce36ccf70b065377 (patch)
tree14a4eaaab676dabeed2d3e50fe0150c9d28263c3
parent80cb85f69079627b7ab502b7693a4aa872d1d510 (diff)
downloadhostap-7997ece468a8cd59d005e060ce36ccf70b065377.zip
hostap-7997ece468a8cd59d005e060ce36ccf70b065377.tar.gz
hostap-7997ece468a8cd59d005e060ce36ccf70b065377.tar.bz2
AOSP: wext
-rw-r--r--src/drivers/android_drv.h2
-rw-r--r--src/drivers/driver_wext.c35
-rw-r--r--src/drivers/driver_wext.h1
3 files changed, 35 insertions, 3 deletions
diff --git a/src/drivers/android_drv.h b/src/drivers/android_drv.h
index 5906527..6df7160 100644
--- a/src/drivers/android_drv.h
+++ b/src/drivers/android_drv.h
@@ -14,6 +14,8 @@
#define WPA_EVENT_DRIVER_STATE "CTRL-EVENT-DRIVER-STATE "
+#define WEXT_CSCAN_AMOUNT 9
+
#define MAX_SSID_LEN 32
#define MAX_DRV_CMD_SIZE 248
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index 9be1665..823eeed 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -40,7 +40,10 @@ static int wpa_driver_wext_get_range(void *priv);
static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv);
static void wpa_driver_wext_disconnect(struct wpa_driver_wext_data *drv);
static int wpa_driver_wext_set_auth_alg(void *priv, int auth_alg);
-
+#ifdef ANDROID
+extern int wpa_driver_wext_combo_scan(void *priv,
+ struct wpa_driver_scan_params *params);
+#endif
int wpa_driver_wext_set_auth_param(struct wpa_driver_wext_data *drv,
int idx, u32 value)
@@ -478,10 +481,19 @@ static void wpa_driver_wext_event_wireless(struct wpa_driver_wext_data *drv,
drv->assoc_req_ies = NULL;
os_free(drv->assoc_resp_ies);
drv->assoc_resp_ies = NULL;
+#ifdef ANDROID
+ if (!drv->skip_disconnect) {
+ drv->skip_disconnect = 1;
+#endif
wpa_supplicant_event(drv->ctx, EVENT_DISASSOC,
NULL);
-
+#ifdef ANDROID
+ }
+#endif
} else {
+#ifdef ANDROID
+ drv->skip_disconnect = 0;
+#endif
wpa_driver_wext_event_assoc_ies(drv);
wpa_supplicant_event(drv->ctx, EVENT_ASSOC,
NULL);
@@ -828,6 +840,7 @@ void * wpa_driver_wext_init(void *ctx, const char *ifname)
#ifdef ANDROID
drv->errors = 0;
drv->driver_is_started = TRUE;
+ drv->skip_disconnect = 0;
drv->bgscan_enabled = 0;
#endif /* ANDROID */
@@ -991,6 +1004,13 @@ int wpa_driver_wext_scan(void *priv, struct wpa_driver_scan_params *params)
const u8 *ssid = params->ssids[0].ssid;
size_t ssid_len = params->ssids[0].ssid_len;
+#ifdef ANDROID
+ if (drv->capa.max_scan_ssids > 1) {
+ ret = wpa_driver_wext_combo_scan(priv, params);
+ goto scan_out;
+ }
+#endif
+
if (ssid_len > IW_ESSID_MAX_SIZE) {
wpa_printf(MSG_DEBUG, "%s: too long SSID (%lu)",
__FUNCTION__, (unsigned long) ssid_len);
@@ -1016,6 +1036,9 @@ int wpa_driver_wext_scan(void *priv, struct wpa_driver_scan_params *params)
ret = -1;
}
+#ifdef ANDROID
+scan_out:
+#endif
/* Not all drivers generate "scan completed" wireless event, so try to
* read results after a timeout. */
timeout = 10;
@@ -1549,7 +1572,11 @@ static int wpa_driver_wext_get_range(void *priv)
drv->capa.auth = WPA_DRIVER_AUTH_OPEN |
WPA_DRIVER_AUTH_SHARED |
WPA_DRIVER_AUTH_LEAP;
+#ifdef ANDROID
+ drv->capa.max_scan_ssids = WEXT_CSCAN_AMOUNT;
+#else
drv->capa.max_scan_ssids = 1;
+#endif
wpa_printf(MSG_DEBUG, " capabilities: key_mgmt 0x%x enc 0x%x "
"flags 0x%x",
@@ -2021,7 +2048,9 @@ int wpa_driver_wext_associate(void *priv,
int value;
wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
-
+#ifdef ANDROID
+ drv->skip_disconnect = 0;
+#endif
if (drv->cfg80211) {
/*
* Stop cfg80211 from trying to associate before we are done
diff --git a/src/drivers/driver_wext.h b/src/drivers/driver_wext.h
index c4a5bc9..7e0b28b 100644
--- a/src/drivers/driver_wext.h
+++ b/src/drivers/driver_wext.h
@@ -48,6 +48,7 @@ struct wpa_driver_wext_data {
#ifdef ANDROID
int errors;
int driver_is_started;
+ int skip_disconnect;
int bgscan_enabled;
#endif /* ANDROID */
};