From patchwork Mon May 19 07:05:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilan Peer X-Patchwork-Id: 350104 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6A90F14008B for ; Mon, 19 May 2014 18:02:52 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 0C4549C1E3; Mon, 19 May 2014 04:02:43 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lCWn+vGbb1ZM; Mon, 19 May 2014 04:02:42 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B758B9C194; Mon, 19 May 2014 04:02:12 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 421CC9C194 for ; Mon, 19 May 2014 04:02:11 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nqNZy1lI7gl4 for ; Mon, 19 May 2014 04:02:04 -0400 (EDT) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id C32CF9C170 for ; Mon, 19 May 2014 04:02:01 -0400 (EDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 19 May 2014 01:01:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,865,1392192000"; d="scan'208";a="542674959" Received: from unknown (HELO ipeer-e6430-1.jer.intel.com) ([10.12.217.172]) by orsmga002.jf.intel.com with ESMTP; 19 May 2014 01:01:40 -0700 From: Ilan Peer To: hostap@lists.shmoo.com Subject: [PATCH 2/5] wpa_supplicant: remove unused code from %get_shared_radio_freqs_data Date: Mon, 19 May 2014 10:05:36 +0300 Message-Id: <1400483139-10247-3-git-send-email-ilan.peer@intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1400483139-10247-1-git-send-email-ilan.peer@intel.com> References: <1400483139-10247-1-git-send-email-ilan.peer@intel.com> Cc: Avraham Stern X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Avraham Stern Remove the check for %get_radio_name support from %get_shared_radio_freqs_data since %get_radio_name is no longer in use in this function. In addition, 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 | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index ec347be..85eb1fa 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -4679,46 +4679,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) { - if (wpa_s->current_ssid->mode == WPAS_MODE_INFRA) { - if (wpa_s->p2p_group_interface == - P2P_GROUP_INTERFACE_CLIENT) - freqs_data[0].flags = - WPA_FREQ_USED_BY_P2P_CLIENT; - else - freqs_data[0].flags = - WPA_FREQ_USED_BY_BSS; - } - } - } - - /* If get_radio_name is not supported, use only the local freq */ - if (!wpa_driver_get_radio_name(wpa_s)) { - freq = wpa_drv_shared_freq(wpa_s); - if (freq > 0 && idx < len && - (idx == 0 || freqs_data[0].freq != freq)) { - freqs_data[idx++].freq = freq; - } - dump_freq_data(wpa_s, "No get_radio_name", freqs_data, idx); - return idx; - } - 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;