From patchwork Thu Oct 5 06:08:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akolli@qti.qualcomm.com X-Patchwork-Id: 9986447 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3D3E4602B8 for ; Thu, 5 Oct 2017 06:05:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CA7428B5E for ; Thu, 5 Oct 2017 06:05:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E11E28B96; Thu, 5 Oct 2017 06:05:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4BF728B5E for ; Thu, 5 Oct 2017 06:05:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751267AbdJEGFm (ORCPT ); Thu, 5 Oct 2017 02:05:42 -0400 Received: from sabertooth01.qualcomm.com ([65.197.215.72]:22599 "EHLO sabertooth01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750811AbdJEGFl (ORCPT ); Thu, 5 Oct 2017 02:05:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1507183541; x=1538719541; h=from:to:cc:subject:date:message-id:mime-version; bh=Lv2iAFZOT8c5dGC6MkkSaF1hJq5lAafnfmSTCTXDIcU=; b=vhyKMpmhmOR6witaZ4XqoW5a0596odoV0RySHuwJGtdD+aUCtKAeSpyn qm/AJCpO60BsME2CsPikB+6TKuXG0r1+z/sXPb65AHw0fRh35PnKTpnHy r8PWaf2zRbmkDEKshc2v+aIQurikJYeW25brS+V+BKB/s7rFMRurzWnYl I=; X-IronPort-AV: E=Sophos;i="5.42,480,1500966000"; d="scan'208";a="115528457" Received: from unknown (HELO Ironmsg03-R.qualcomm.com) ([10.53.140.107]) by sabertooth01.qualcomm.com with ESMTP; 04 Oct 2017 23:05:41 -0700 X-IronPort-AV: E=McAfee;i="5900,7806,8674"; a="1455424163" X-MGA-submission: =?us-ascii?q?MDGhotaJ16gx8dsLe2rWQbwC3gekb0Zz0ZtjQs?= =?us-ascii?q?jjZRHUMrfzF9g4efsBtsWIXFeSYVrQbktH+UkMSYcHF6rxOCJuZacJLP?= =?us-ascii?q?scUkC+VLiTO8wsRT7wxp3F5ucuUdHASlJPJA+GDfEvkiD9A2n59pSFzr?= =?us-ascii?q?9y?= Received: from nasanexm01b.na.qualcomm.com ([10.85.0.82]) by Ironmsg03-R.qualcomm.com with ESMTP/TLS/AES256-SHA; 04 Oct 2017 23:05:40 -0700 Received: from aphydexm01a.ap.qualcomm.com (10.252.127.10) by NASANEXM01B.na.qualcomm.com (10.85.0.82) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Wed, 4 Oct 2017 23:05:39 -0700 Received: from localhost (10.80.80.8) by aphydexm01a.ap.qualcomm.com (10.252.127.10) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Thu, 5 Oct 2017 11:35:34 +0530 From: To: CC: , , Anilkumar Kolli Subject: [PATCH 1/2] ath10k: move ath10k_mac_tdls_vif*() functions Date: Thu, 5 Oct 2017 11:38:28 +0530 Message-ID: <1507183709-585-1-git-send-email-akolli@qti.qualcomm.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01C.na.qualcomm.com (10.85.0.83) To aphydexm01a.ap.qualcomm.com (10.252.127.10) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Anilkumar Kolli To be able to use ath10k_mac_tdls_vif_stations_count() in ath10k_hw_scan() in the following patch, move the functions earlier in the file. This commit is pure code move, no functional changes. Signed-off-by: Anilkumar Kolli --- drivers/net/wireless/ath/ath10k/mac.c | 106 ++++++++++++++++----------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 5683f1a5330e..0f14da73cf64 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -5575,6 +5575,59 @@ static void ath10k_mac_op_set_coverage_class(struct ieee80211_hw *hw, s16 value) ar->hw_params.hw_ops->set_coverage_class(ar, value); } +struct ath10k_mac_tdls_iter_data { + u32 num_tdls_stations; + struct ieee80211_vif *curr_vif; +}; + +static void ath10k_mac_tdls_vif_stations_count_iter(void *data, + struct ieee80211_sta *sta) +{ + struct ath10k_mac_tdls_iter_data *iter_data = data; + struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; + struct ieee80211_vif *sta_vif = arsta->arvif->vif; + + if (sta->tdls && sta_vif == iter_data->curr_vif) + iter_data->num_tdls_stations++; +} + +static int ath10k_mac_tdls_vif_stations_count(struct ieee80211_hw *hw, + struct ieee80211_vif *vif) +{ + struct ath10k_mac_tdls_iter_data data = {}; + + data.curr_vif = vif; + + ieee80211_iterate_stations_atomic(hw, + ath10k_mac_tdls_vif_stations_count_iter, + &data); + return data.num_tdls_stations; +} + +static void ath10k_mac_tdls_vifs_count_iter(void *data, u8 *mac, + struct ieee80211_vif *vif) +{ + struct ath10k_vif *arvif = (void *)vif->drv_priv; + int *num_tdls_vifs = data; + + if (vif->type != NL80211_IFTYPE_STATION) + return; + + if (ath10k_mac_tdls_vif_stations_count(arvif->ar->hw, vif) > 0) + (*num_tdls_vifs)++; +} + +static int ath10k_mac_tdls_vifs_count(struct ieee80211_hw *hw) +{ + int num_tdls_vifs = 0; + + ieee80211_iterate_active_interfaces_atomic(hw, + IEEE80211_IFACE_ITER_NORMAL, + ath10k_mac_tdls_vifs_count_iter, + &num_tdls_vifs); + return num_tdls_vifs; +} + static int ath10k_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_scan_request *hw_req) @@ -6000,59 +6053,6 @@ static void ath10k_mac_dec_num_stations(struct ath10k_vif *arvif, ar->num_stations--; } -struct ath10k_mac_tdls_iter_data { - u32 num_tdls_stations; - struct ieee80211_vif *curr_vif; -}; - -static void ath10k_mac_tdls_vif_stations_count_iter(void *data, - struct ieee80211_sta *sta) -{ - struct ath10k_mac_tdls_iter_data *iter_data = data; - struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; - struct ieee80211_vif *sta_vif = arsta->arvif->vif; - - if (sta->tdls && sta_vif == iter_data->curr_vif) - iter_data->num_tdls_stations++; -} - -static int ath10k_mac_tdls_vif_stations_count(struct ieee80211_hw *hw, - struct ieee80211_vif *vif) -{ - struct ath10k_mac_tdls_iter_data data = {}; - - data.curr_vif = vif; - - ieee80211_iterate_stations_atomic(hw, - ath10k_mac_tdls_vif_stations_count_iter, - &data); - return data.num_tdls_stations; -} - -static void ath10k_mac_tdls_vifs_count_iter(void *data, u8 *mac, - struct ieee80211_vif *vif) -{ - struct ath10k_vif *arvif = (void *)vif->drv_priv; - int *num_tdls_vifs = data; - - if (vif->type != NL80211_IFTYPE_STATION) - return; - - if (ath10k_mac_tdls_vif_stations_count(arvif->ar->hw, vif) > 0) - (*num_tdls_vifs)++; -} - -static int ath10k_mac_tdls_vifs_count(struct ieee80211_hw *hw) -{ - int num_tdls_vifs = 0; - - ieee80211_iterate_active_interfaces_atomic(hw, - IEEE80211_IFACE_ITER_NORMAL, - ath10k_mac_tdls_vifs_count_iter, - &num_tdls_vifs); - return num_tdls_vifs; -} - static int ath10k_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta,