]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use wpa_radio data for wpas_p2p_search_delay()
authorJouni Malinen <j@w1.fi>
Sun, 24 Nov 2013 18:01:07 +0000 (20:01 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 24 Nov 2013 19:20:14 +0000 (21:20 +0200)
This replaces the now unnecessary iteration of get_radio_name() calls.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/p2p_supplicant.c

index fecc25936c69c6bc1e13cac54f8a1c517edf287b..eb2648a3a0a2a48347bc88cd1a73e88747048abb 100644 (file)
@@ -6265,7 +6265,6 @@ int wpas_p2p_scan_no_go_seen(struct wpa_supplicant *wpa_s)
 
 unsigned int wpas_p2p_search_delay(struct wpa_supplicant *wpa_s)
 {
-       const char *rn, *rn2;
        struct wpa_supplicant *ifs;
 
        if (wpa_s->wpa_state > WPA_SCANNING) {
@@ -6275,20 +6274,9 @@ unsigned int wpas_p2p_search_delay(struct wpa_supplicant *wpa_s)
                return P2P_CONCURRENT_SEARCH_DELAY;
        }
 
-       if (!wpa_s->driver->get_radio_name)
-               return 0;
-       rn = wpa_s->driver->get_radio_name(wpa_s->drv_priv);
-       if (rn == NULL || rn[0] == '\0')
-               return 0;
-
-       for (ifs = wpa_s->global->ifaces; ifs; ifs = ifs->next) {
-               if (ifs == wpa_s || !ifs->driver->get_radio_name)
-                       continue;
-
-               rn2 = ifs->driver->get_radio_name(ifs->drv_priv);
-               if (!rn2 || os_strcmp(rn, rn2) != 0)
-                       continue;
-               if (ifs->wpa_state > WPA_SCANNING) {
+       dl_list_for_each(ifs, &wpa_s->radio->ifaces, struct wpa_supplicant,
+                        radio_list) {
+               if (ifs != wpa_s && ifs->wpa_state > WPA_SCANNING) {
                        wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Use %u ms search "
                                "delay due to concurrent operation on "
                                "interface %s",