Use wpa_radio data for get_shared_radio_freqs()

This replaces the now unnecessary iteration of get_radio_name() calls.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-11-24 20:06:00 +02:00
parent 1b544ffa74
commit 0ad3b9c402

View file

@ -4137,7 +4137,6 @@ void dump_freq_array(struct wpa_supplicant *wpa_s, const char *title,
int get_shared_radio_freqs(struct wpa_supplicant *wpa_s, int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
int *freq_array, unsigned int len) int *freq_array, unsigned int len)
{ {
const char *rn, *rn2;
struct wpa_supplicant *ifs; struct wpa_supplicant *ifs;
u8 bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
int freq; int freq;
@ -4166,20 +4165,9 @@ int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
return idx; return idx;
} }
rn = wpa_s->driver->get_radio_name(wpa_s->drv_priv); dl_list_for_each(ifs, &wpa_s->radio->ifaces, struct wpa_supplicant,
if (rn == NULL || rn[0] == '\0') { radio_list) {
dump_freq_array(wpa_s, "get_radio_name failed", if (wpa_s == ifs)
freq_array, idx);
return idx;
}
for (ifs = wpa_s->global->ifaces; ifs && idx < len;
ifs = ifs->next) {
if (wpa_s == ifs || !ifs->driver->get_radio_name)
continue;
rn2 = ifs->driver->get_radio_name(ifs->drv_priv);
if (!rn2 || os_strcmp(rn, rn2) != 0)
continue; continue;
if (ifs->current_ssid == NULL || ifs->assoc_freq == 0) if (ifs->current_ssid == NULL || ifs->assoc_freq == 0)