From 66562e9c7530f85ee9970da10ef5ae96be4f1b10 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 7 May 2013 17:36:40 +0300 Subject: [PATCH] Use cached driver capabilities instead of new fetch for each operation There is no need to repeat the driver capability fetch for each operation since we already cache driver flags in wpa_s->drv_flags. Signed-hostap: Jouni Malinen --- wpa_supplicant/events.c | 5 ++--- wpa_supplicant/wpa_supplicant.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 887acb228..f0f5d1caf 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1676,7 +1676,6 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s, { u8 bssid[ETH_ALEN]; int ft_completed; - struct wpa_driver_capa capa; #ifdef CONFIG_AP if (wpa_s->ap_iface) { @@ -1838,8 +1837,8 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s, if ((wpa_s->key_mgmt == WPA_KEY_MGMT_NONE || wpa_s->key_mgmt == WPA_KEY_MGMT_IEEE8021X_NO_WPA) && - wpa_s->current_ssid && wpa_drv_get_capa(wpa_s, &capa) == 0 && - capa.flags & WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE) { + wpa_s->current_ssid && + (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE)) { /* Set static WEP keys again */ wpa_set_wep_keys(wpa_s, wpa_s->current_ssid); } diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 5d5051571..4c2e6ecf5 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -1265,7 +1265,6 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, enum wpa_cipher cipher_pairwise, cipher_group; struct wpa_driver_associate_params params; int wep_keys_set = 0; - struct wpa_driver_capa capa; int assoc_failed = 0; struct wpa_ssid *old_ssid; u8 ext_capab[10]; @@ -1665,8 +1664,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, wpa_supplicant_req_auth_timeout(wpa_s, timeout, 0); } - if (wep_keys_set && wpa_drv_get_capa(wpa_s, &capa) == 0 && - capa.flags & WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC) { + if (wep_keys_set && + (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC)) { /* Set static WEP keys again */ wpa_set_wep_keys(wpa_s, ssid); }