]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use cached driver capabilities instead of new fetch for each operation
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 7 May 2013 14:36:40 +0000 (17:36 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 7 May 2013 14:36:40 +0000 (17:36 +0300)
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>

wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c

index 887acb2281ca39a39ba1c46d0e9a266be9a6ba1f..f0f5d1caf464c495bab53c25b40811a1290ce3f8 100644 (file)
@@ -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);
        }
index 5d505157120e00f811dad61ec32af9eadb764908..4c2e6ecf52452b1d16a8e7304c222ef68330a497 100644 (file)
@@ -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);
        }