diff options
| author | Jouni Malinen <j@w1.fi> | 2011-07-17 20:03:25 +0300 |
|---|---|---|
| committer | Keith Deacon <kdeacon@ti.com> | 2011-11-15 20:45:50 -0600 |
| commit | bfadf669db19b7abd16465631cc56ea4c26858b3 (patch) | |
| tree | 09cf24c3f46b3ff60a2e24bcd65282ec911084e4 | |
| parent | 3e2218521bce7deddeb094156d7d781b5f7d4612 (diff) | |
| download | android_external_wpa_supplicant_8-bfadf669db19b7abd16465631cc56ea4c26858b3.tar.gz android_external_wpa_supplicant_8-bfadf669db19b7abd16465631cc56ea4c26858b3.tar.bz2 android_external_wpa_supplicant_8-bfadf669db19b7abd16465631cc56ea4c26858b3.zip | |
nl80211: Do not re-set iftype when initializing added interface
There is no need to force the interface into station mode when
wpa_supplicant adds a new interface (e.g., P2P group) with the correct
iftype.
Change-Id: If8a100ffff73cf932ca11e7e2eeba906ebefea92
Signed-off-by: Vishal Mahaveer <a0271468@ti.com>
| -rw-r--r-- | src/drivers/driver_nl80211.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index b9932646..c38663d2 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -110,6 +110,7 @@ static void nl80211_handle_destroy(struct nl_handle *handle) struct nl80211_global { struct dl_list interfaces; + int if_add_ifindex; }; struct i802_bss { @@ -2153,7 +2154,14 @@ wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv) drv->first_bss.ifindex = drv->ifindex; #ifndef HOSTAPD - if (wpa_driver_nl80211_set_mode(bss, IEEE80211_MODE_INFRA) < 0) { + /* + * Make sure the interface starts up in station mode unless this is a + * dynamically added interface (e.g., P2P) that was already configured + * with proper iftype. + */ + if ((drv->global == NULL || + drv->ifindex != drv->global->if_add_ifindex) && + wpa_driver_nl80211_set_mode(bss, IEEE80211_MODE_INFRA) < 0) { wpa_printf(MSG_DEBUG, "nl80211: Could not configure driver to " "use managed mode"); } @@ -6132,6 +6140,9 @@ static int wpa_driver_nl80211_if_add(void *priv, enum wpa_driver_if_type type, } #endif /* HOSTAPD */ + if (drv->global) + drv->global->if_add_ifindex = ifidx; + return 0; } @@ -6741,6 +6752,7 @@ static void * nl80211_global_init(void) if (global == NULL) return NULL; dl_list_init(&global->interfaces); + global->if_add_ifindex = -1; return global; } |
