From patchwork Wed Apr 1 11:03:46 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: 221506 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE2ADC43331 for ; Wed, 1 Apr 2020 11:07:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F12B2082F for ; Wed, 1 Apr 2020 11:07:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="a7Xk/QAo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732413AbgDALFH (ORCPT ); Wed, 1 Apr 2020 07:05:07 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732342AbgDALFD (ORCPT ); Wed, 1 Apr 2020 07:05:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kqwDvwWpu9EOyjjL45spTvaufqYvVAEdMRDKfq4E0g9JteIy6liea/orSsOn03zobvFBCLiWBFYqSuEjwTyDMhrKIEWiWRG+MCi15ocJKSumFMYpFnUN8DMDS/uEiOzqxkkTLzXbaFSQese2OXRvHf8GFVju7muwpx4810Pcfyy+aK88tCh4P+BOpDZhsMkYAeVk7e1mJZ3HcSw2ng7FbNJLl7pBB5Z+tlAvJQhhvaOlSLRCM+DwoU69LTZiipQF2kVEXAzhooxDC9OJrzMdhcC/Y+1xRLypxG2xuWogOO1xAzQtXaHGD1PLYR+W4oeAe2d3g3VD2wRmVf/G0tLD8w== 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=g9coPk8RKrRy4Cc4Jt799tpxHC3TTIwZMKSK8VkA+ZA=; b=gDw9bdur37DNPZK1kUDsoq/8FZOa0/GpjNT1OsaxWdBTpeidh39FbsChzuMiz/kOTIWPKt/uquVw+d8kVapYlBP8g93qKFArAQgD8juy2DUnW1Cg3qFO3mDOcUT5DdNrsQI98tT+QFTEDyi8Df5ZkIvOHmls+KJaJWwNwd7I7+u60GqrNR9aEnEejU9xXltnBZwJT5ObKmv1UBjL6r6/Lxrc12QsAx57GDM+VWeMLqNaY+w8ynbBY+lh7k8Irgw+Z/+/hFx2yDpA454XX85udryJ5TNDPhrF/aa1LHirs5m0MOpRPyPC6++J62YG6FjK96TNmRhgL6SAmiLiEQXQ9Q== 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=g9coPk8RKrRy4Cc4Jt799tpxHC3TTIwZMKSK8VkA+ZA=; b=a7Xk/QAoo3uua27vCJ/esbFjzIr38NBX07tgzT9s9l/fIncQPQ+9+6o+69QulQ2wDs4gtIjz/VN6/EE3sERSRFUZJ/Xy8uPt9822qwt0vFc52H8MF2TM9Ja0gbO1zxtQ6+vksbdBDkVUwOnhnk23vD2mv+tVoEKvgvbkX4al7V8= 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:04:46 +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:04:46 +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 13/32] staging: wfx: drop argument tx_allowed_mask since it is constant now Date: Wed, 1 Apr 2020 13:03:46 +0200 Message-Id: <20200401110405.80282-14-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:04:44 +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: cdae392a-cdbe-41ba-ff2e-08d7d62c7d07 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; 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)(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: D9YcBb/cPXoCz8WKacl2zAxaW+wS9bD/FVyieYLC5D9p9BqDo43hpxnzAQ7YV6eZSjY7UmwuG/PWcjHxbabr7Bo++X4rpPcD4PXnRnhJiHjHMjiyMPaG0fL3QvczUet1gDty3fgWFc3UnLZtLWyj6P1okPS28wogo/6U7aKgZvust0CVLiWFsDl6m8j2YQVEE9XNq/EeiAqViXU/LzHPUo8xXxS8AhZLhQMzRqJ5g4R3HsKdzZazNQsFN4DOxQgWe73vHq2ZUFnzfwoXY5psQgdxa1jtUq1FFgh8Le8LFC9NMuoaKW+XOM0w2PnwvDw+QWIu+r1M6au7OL4gyAJdbCUKFHvdrdKm+YjtluIhi8RZOSrQ0EcHATtTWXKleN4Ad3e3N/N4TaqJEzLXxotYkHCnlfdxjiM2mEmw9DCiaYceMBbUGHxpjGrvgupc1CoW X-MS-Exchange-AntiSpam-MessageData: o4/B18IYZrKVQshBLlqeZ/bseWHsPBiBP22IpK6rRD5KHkjLXTM+tvwFIJ16VuxmgjtQudp5iBzXMIJJ5bzD5d8TWKBr+DfXr7J89w2shYsbKfOUKpw7j0Df4zZ4euiVa1Gx7JFr2YxiIanPpMUbBYMHnDkJlU6rLRsNhalfqsakZgFcZs5S6//f6DGDtOhGflR8wy/DXmHrXIXTbB3XRQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdae392a-cdbe-41ba-ff2e-08d7d62c7d07 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:46.3184 (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: pyU8L/9m0q9tiZqwj/IaefHJTATMIVCmyCS6ysC5CnA5wMe5CtKNSRbug+FpPZRzwbHRW5u4KSnsq5DqkLIzHw== 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 Following the remove of asleep_mask, the tx_allowed_mask argument passed to various functions is now always the same. Drop this argument and simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 48 +++++++++---------------------------- drivers/staging/wfx/queue.h | 2 +- 2 files changed, 12 insertions(+), 38 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index e66debd60e3f..cecf9aa7b3ca 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -144,22 +144,15 @@ void wfx_tx_queues_deinit(struct wfx_dev *wdev) wfx_tx_queues_clear(wdev); } -int wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map) +int wfx_tx_queue_get_num_queued(struct wfx_queue *queue) { int ret, i; - if (!link_id_map) - return 0; - + ret = 0; spin_lock_bh(&queue->queue.lock); - if (link_id_map == (u32)-1) { - ret = skb_queue_len(&queue->queue); - } else { - ret = 0; - for (i = 0; i < ARRAY_SIZE(queue->link_map_cache); i++) - if (link_id_map & BIT(i)) - ret += queue->link_map_cache[i]; - } + for (i = 0; i < ARRAY_SIZE(queue->link_map_cache); i++) + if (i != WFX_LINK_ID_AFTER_DTIM) + ret += queue->link_map_cache[i]; spin_unlock_bh(&queue->queue.lock); return ret; } @@ -354,7 +347,7 @@ static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) } } -static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask) +static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif) { const struct ieee80211_tx_queue_params *edca; unsigned int score, best = -1; @@ -366,8 +359,7 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask) int queued; edca = &wvif->edca_params[i]; - queued = wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[i], - tx_allowed_mask); + queued = wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[i]); if (!queued) continue; score = ((edca->aifs + edca->cw_min) << 16) + @@ -379,23 +371,9 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask) } } - return winner; -} - -static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif, - u32 *tx_allowed_mask_p) -{ - int idx; - u32 tx_allowed_mask; - - tx_allowed_mask = BIT(WFX_LINK_ID_MAX) - 1; - tx_allowed_mask &= ~BIT(WFX_LINK_ID_AFTER_DTIM); - idx = wfx_get_prio_queue(wvif, tx_allowed_mask); - if (idx < 0) + if (winner < 0) return NULL; - - *tx_allowed_mask_p = tx_allowed_mask; - return &wvif->wdev->tx_queue[idx]; + return &wvif->wdev->tx_queue[winner]; } struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif) @@ -424,8 +402,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) struct hif_msg *hif = NULL; struct wfx_queue *queue = NULL; struct wfx_queue *vif_queue = NULL; - u32 tx_allowed_mask = 0; - u32 vif_tx_allowed_mask = 0; struct wfx_vif *wvif; int i; @@ -459,12 +435,10 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - vif_queue = wfx_tx_queue_mask_get(wvif, - &vif_tx_allowed_mask); + vif_queue = wfx_tx_queue_mask_get(wvif); if (vif_queue) { if (queue && queue != vif_queue) dev_info(wdev->dev, "vifs disagree about queue priority\n"); - tx_allowed_mask |= vif_tx_allowed_mask; queue = vif_queue; ret = 0; } @@ -475,7 +449,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) queue_num = queue - wdev->tx_queue; - skb = wfx_tx_queue_get(wdev, queue, tx_allowed_mask); + skb = wfx_tx_queue_get(wdev, queue, ~BIT(WFX_LINK_ID_AFTER_DTIM)); if (!skb) continue; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 5a5aa38dbb2f..58da216d47dd 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -47,7 +47,7 @@ struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif); void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb); -int wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map); +int wfx_tx_queue_get_num_queued(struct wfx_queue *queue); struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb);