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 <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2013-05-07 17:36:40 +03:00 committed by Jouni Malinen
parent 55293aaf4e
commit 66562e9c75
2 changed files with 4 additions and 6 deletions

View file

@ -1676,7 +1676,6 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
{ {
u8 bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
int ft_completed; int ft_completed;
struct wpa_driver_capa capa;
#ifdef CONFIG_AP #ifdef CONFIG_AP
if (wpa_s->ap_iface) { 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 || if ((wpa_s->key_mgmt == WPA_KEY_MGMT_NONE ||
wpa_s->key_mgmt == WPA_KEY_MGMT_IEEE8021X_NO_WPA) && wpa_s->key_mgmt == WPA_KEY_MGMT_IEEE8021X_NO_WPA) &&
wpa_s->current_ssid && wpa_drv_get_capa(wpa_s, &capa) == 0 && wpa_s->current_ssid &&
capa.flags & WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE) { (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE)) {
/* Set static WEP keys again */ /* Set static WEP keys again */
wpa_set_wep_keys(wpa_s, wpa_s->current_ssid); wpa_set_wep_keys(wpa_s, wpa_s->current_ssid);
} }

View file

@ -1265,7 +1265,6 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
enum wpa_cipher cipher_pairwise, cipher_group; enum wpa_cipher cipher_pairwise, cipher_group;
struct wpa_driver_associate_params params; struct wpa_driver_associate_params params;
int wep_keys_set = 0; int wep_keys_set = 0;
struct wpa_driver_capa capa;
int assoc_failed = 0; int assoc_failed = 0;
struct wpa_ssid *old_ssid; struct wpa_ssid *old_ssid;
u8 ext_capab[10]; 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); wpa_supplicant_req_auth_timeout(wpa_s, timeout, 0);
} }
if (wep_keys_set && wpa_drv_get_capa(wpa_s, &capa) == 0 && if (wep_keys_set &&
capa.flags & WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC) { (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC)) {
/* Set static WEP keys again */ /* Set static WEP keys again */
wpa_set_wep_keys(wpa_s, ssid); wpa_set_wep_keys(wpa_s, ssid);
} }