From patchwork Wed Apr 1 11:04:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 1265135 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-silabs-onmicrosoft-com header.b=a8cySrl6; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk065jpjz9sSr for ; Wed, 1 Apr 2020 22:06:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732634AbgDALGK (ORCPT ); Wed, 1 Apr 2020 07:06:10 -0400 Received: from mail-bn7nam10on2084.outbound.protection.outlook.com ([40.107.92.84]:6083 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732371AbgDALFU (ORCPT ); Wed, 1 Apr 2020 07:05:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DuIakfpLclIhvC08MDL/J8knykQsinZFlpg5IPJGTIXMgLQ2M7hLeionptugLsxuTKHfKYz+2V8k0bxkMl0Fj572jkWoEpzUm2T14IkxMfgjvzN4HTLRHtERbSF7MLUbRYjlyyh1CH9L6Pyc3QYZRwJgDEmV8t/cYU0ijypBqCzonKIT2DozlZOX71bCd6Nue38dImEo23NsSkHdzDO9ZX+Ah8Yrd21bKObIPKx3LM2rokLC1N7NtgY0EsqfqRt0DVfIyamX5CxI3IFdGMAdqP4yEvnEil3lZi8QqeRiNmaLkvsFO1D8hXNb3hhcMZQX+gIIcZAw5RMTiysjTFUEwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ipe2aWSSMB78BnIB4Y4LFB4IIbiiUl6mWBkN44tREXU=; b=IIi/uduRDDQfP7kFQecOJZqBIr1Ebqw7dj63N2eEKe9zivY/1tWtZnxEVPn+MPI0w3wbBrbYxxOZ3Z2gOLj1fxvhsPyfz6uvUQOccPbTb/Nx4U45JT2AGHJA5UZOd5cdq0Ud8TLjjllyuZAvo3/3J2kKvP5fGwOJnLwYpuoJUSOIE9z1JHtaBojS64lwrwXJPt+xs5/qWAO4m7PDQpqtO7Omx57IN8cMw8vNEup2HTTg4nWR9ZQwdpnwogDtO/zZhQkzm7L0exZUQRUN3pIClVfUTvY3FTkXtte8TA8gRO1TqaKaHei5rVttZ2gQP1p7aIjOh9gQy4B3INmEdsn5gA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ipe2aWSSMB78BnIB4Y4LFB4IIbiiUl6mWBkN44tREXU=; b=a8cySrl6iFH6icN+yjjognMfL52vVldCG/9+vaE4GdDU8Sh2TzRDBY27GDUDLCxoervqR1rWAZyFAQbghqNIIrSCSlzOZYZb9P99Hj4MISdIgyvqaJmnauWLrrmYiEvMAI3AMY12ehm5YkDwPx0i7BQLj0VKV/yxV4bG4Bihfy8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:16 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:16 +0000 From: Jerome Pouiller To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 27/32] staging: wfx: relocate wfx_skb_dtor() prior its callers Date: Wed, 1 Apr 2020 13:04:00 +0200 Message-Id: <20200401110405.80282-28-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:14 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 98face08-f269-438a-e95a-08d7d62c8ede X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VVVq+4BeHiIgyQUhbAaFp5+TuAjBw1M8BMgUj1Cf8dNjWCgGwFBMpetIYRindcY6XvKbjVF0pQgm4R+dJ8u0uSkTtubIDzuyDtMmwwpexl8c++KLurn96N3r873GlkpURHkQykcPIelS3buv6kHWjOGrNTo7UIMOjKpGryhjlVRHqFcYPDNnYx9Y/KR028rZ08bYGrgGmKYKkRC89TQUZhXajofrzojKQMxye+aBbhnsFOx7QBdDg7wt1Mz1uW4RcogZelNS30cZPM5xYV5hpNn66zDmNg1kcywye4pO5wzoJMOdRKjkGc/1pC4BJMBuv+fgLn/0bwuxwxAmSq5FjDshkYioLGkoX4dUVipenrSAfyXMr6LzdocR2h+y6olis5cilk7zqVSZovk7R8Mgeza/AGUV7uQEgKsEyqfXsFaTKuSqm1DwZJQp+GAwmOCZ X-MS-Exchange-AntiSpam-MessageData: VvsOg203fCxAOgFw5SmD5eD+P87gc4+3aDNcVDpkydevIe9l425L3qH+1dMtt+ol+2TWzFppmQwcUM3HAak0PMpD+HJDNJdMARtYfNylJWsRv89FevyUW6nAyPqJ+Yk/4JUX98F1s+KrmrArjnQAUkfCNzRhkLX33pSlxFUBIFUH60DzIl1+uDsOymCov22hNVWOSjvqoTlIIl/JVqem9w== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98face08-f269-438a-e95a-08d7d62c8ede X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:16.3141 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eT0dG2VgO0kqVvrWsd962Ro2Q/uv2294PB9ZTQESTHZRP0WzcKSGG2Ms13svaZ39Bm/PAUYbeE2Ct4tdlUK3RQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller In a next commit, we would like to mark wfx_skb_dtor as static and stop to declare it in data_tx.h. Relocate wfx_skb_dtor() prior its callers to avoid compile error. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 72 ++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 17209f645e4b..ec95518c9167 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -503,6 +503,43 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, ieee80211_tx_status_irqsafe(wdev->hw, skb); } +static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb) +{ + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + struct ieee80211_sta *sta; + struct wfx_sta_priv *sta_priv; + int tid = ieee80211_get_tid(hdr); + + rcu_read_lock(); // protect sta + sta = ieee80211_find_sta(wvif->vif, hdr->addr1); + if (sta) { + sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; + spin_lock_bh(&sta_priv->lock); + WARN(!sta_priv->buffered[tid], "inconsistent notification"); + sta_priv->buffered[tid]--; + if (!sta_priv->buffered[tid]) + ieee80211_sta_set_buffered(sta, tid, false); + spin_unlock_bh(&sta_priv->lock); + } + rcu_read_unlock(); +} + +void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb) +{ + struct hif_msg *hif = (struct hif_msg *)skb->data; + struct hif_req_tx *req = (struct hif_req_tx *)hif->body; + struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); + unsigned int offset = sizeof(struct hif_req_tx) + + sizeof(struct hif_msg) + + req->data_flags.fc_offset; + + WARN_ON(!wvif); + skb_pull(skb, offset); + wfx_notify_buffered_tx(wvif, skb); + wfx_tx_policy_put(wvif, req->tx_flags.retry_policy_index); + ieee80211_tx_status_irqsafe(wdev->hw, skb); +} + void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) { int i; @@ -589,39 +626,4 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) wfx_skb_dtor(wvif->wdev, skb); } -static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb) -{ - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; - struct ieee80211_sta *sta; - struct wfx_sta_priv *sta_priv; - int tid = ieee80211_get_tid(hdr); - rcu_read_lock(); // protect sta - sta = ieee80211_find_sta(wvif->vif, hdr->addr1); - if (sta) { - sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; - spin_lock_bh(&sta_priv->lock); - WARN(!sta_priv->buffered[tid], "inconsistent notification"); - sta_priv->buffered[tid]--; - if (!sta_priv->buffered[tid]) - ieee80211_sta_set_buffered(sta, tid, false); - spin_unlock_bh(&sta_priv->lock); - } - rcu_read_unlock(); -} - -void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb) -{ - struct hif_msg *hif = (struct hif_msg *)skb->data; - struct hif_req_tx *req = (struct hif_req_tx *)hif->body; - struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); - unsigned int offset = sizeof(struct hif_req_tx) + - sizeof(struct hif_msg) + - req->data_flags.fc_offset; - - WARN_ON(!wvif); - skb_pull(skb, offset); - wfx_notify_buffered_tx(wvif, skb); - wfx_tx_policy_put(wvif, req->tx_flags.retry_policy_index); - ieee80211_tx_status_irqsafe(wdev->hw, skb); -}