From 0a816e8cbf8a0447b63816395a0b1ec55ae94e5f Mon Sep 17 00:00:00 2001 From: Avraham Stern Date: Mon, 19 May 2014 10:05:36 +0300 Subject: [PATCH] P2P: Remove duplicated code from get_shared_radio_freqs_data() Remove the seperation between getting the local interface frequency and other interfaces frequencies since going over all the radio interfaces includes the local interface. Signed-off-by: Avraham Stern --- wpa_supplicant/wpa_supplicant.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 91e66b2..d6d3b24 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -4674,29 +4674,11 @@ int get_shared_radio_freqs_data(struct wpa_supplicant *wpa_s, "Determining shared radio frequencies (max len %u)", len); os_memset(freqs_data, 0, sizeof(struct wpa_used_freq_data) * len); - /* First add the frequency of the local interface */ - if (wpa_s->current_ssid != NULL && wpa_s->assoc_freq != 0) { - if (wpa_s->current_ssid->mode == WPAS_MODE_AP || - wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO) - freqs_data[idx++].freq = wpa_s->current_ssid->frequency; - else if (wpa_drv_get_bssid(wpa_s, bssid) == 0) - freqs_data[idx++].freq = wpa_s->assoc_freq; - - if (idx && wpa_s->current_ssid->mode == WPAS_MODE_INFRA) { - freqs_data[0].flags = wpa_s->current_ssid->p2p_group ? - WPA_FREQ_USED_BY_P2P_CLIENT : - WPA_FREQ_USED_BY_INFRA_STATION; - } - } - dl_list_for_each(ifs, &wpa_s->radio->ifaces, struct wpa_supplicant, radio_list) { if (idx == len) break; - if (wpa_s == ifs) - continue; - if (ifs->current_ssid == NULL || ifs->assoc_freq == 0) continue; -- 2.1.4