From patchwork Wed Apr 1 11:03:35 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: 221516 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=ham 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 22950C43331 for ; Wed, 1 Apr 2020 11:04:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E00142078B for ; Wed, 1 Apr 2020 11:04:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="c7MOUuXf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732273AbgDALEq (ORCPT ); Wed, 1 Apr 2020 07:04:46 -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 S1732006AbgDALEm (ORCPT ); Wed, 1 Apr 2020 07:04:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hg8qBwBTc1cAkmcmuKTtaz6nesFi3aAqY4HRF4FXLUZs6mQyr1rhnWAZrF+TRag3Ko8P3a1TeQh60BaXwinRaQrUq0nokFNUVGAJD5b618QmM4CULnMYSXHlNEGwmAYU0jUMVnqjjG09wenExR30wV6bCMcdg+ytpfkGMnTADoe2NavDjRezljI4pnCrOWRdgvq1FXmscNpKTXGUAsuVdehWGZURMKt/+UD/hAvuLGAgmf0Gh5rkAjjQIJnDkaZnfbGzbQ3Vp3yleqjlxgNXShTxZaBgtYJYB1vQCij1fHDebJa73tqzbP773KSIEQPrkhmVuQ1JgHv7Z3LI/rFSyw== 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=fGM4LaUSzkuToWuyg8sMCdYGN32WYJxK4Mm/t0pV04M=; b=PhCBuTuQc7xGXzOkGh9jBohIFrImsX7K+gkLZIJorIgajuE3jDj7ff95dWCeCjpJXZn+XvfI+6xQFgKhl+f+DWMwdnbbik9+JB7vthHhUMTWwc2c0B0cUurXSVmO36hTW7EYesoZDUMzxY3byA2Ifn2+squgQue1sKLqFwzW5B8hXBNYlOBRsdqJMOyMwQr8zzjZScgDl4l10ikx8Qcl6dgV9VP/1rYy2irgl6f84PHN7BDtRRJYQwo7bsdcBor27iBR/wMnphVGllaO2NGnRnBTg+e9/0+i346Mh0262BOJGOU+o7rpVb0BYKYP2OpZEy0RpU4YNQvCWvMpWx5zZg== 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=fGM4LaUSzkuToWuyg8sMCdYGN32WYJxK4Mm/t0pV04M=; b=c7MOUuXf1OA0Hlg4SI8AiorhmGrDQ6TfGDW4UnD/xsIqjtEGuM5oPHjJwtxy4cgfcpOikRhXDBKCPBZkakZt/vNpWB8uCzoEEghhfrGtyYGNpGfnIWD5xeSRpCcfdiRvq4l0S2qcBN/EZAE/T1tk4QMyRvs7u9dC35HMsVRdE34= 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:24 +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:24 +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 02/32] staging: wfx: do not stop mac80211 queueing during tx_policy upload Date: Wed, 1 Apr 2020 13:03:35 +0200 Message-Id: <20200401110405.80282-3-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:22 +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: 7cbcb3bf-019b-461b-4a1e-08d7d62c6fe6 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: YLOTzXVBTgigxc+OSBOA2VrCqEVsYglHdCb3CT02YkokFpBuDWPkxqmnu7Rt3kwXKB2NqM0h9bzKXM39EOvLJxfO+ppH8BJedjARqlyARGXn57EWbMPKX3wjf5mQC34acEktjjIIbct8soYzglvLg5Rjpq3afDiW02K/k/Mp8UvFhgVXB2gl7HavBroI/rtEyf72xzh6PxEQ89t7slstpTh/m7T+a7CwopO8c+Burj/RkbktJ5WHJkjuSqCJF0YHzsnSahS5ZAFz9dyXTnUuUQ76U6rYCx8hZt4sr9wzA9X3KI0ji9k1crB3j8dWkmC9Zc41iSqpIMApVahRmNh6oDfxyFQkiyAjCI2b5B/fxmJ7rKEqG5ZehaQW2C7I1QJtJSPB4WCE9MCpDTuN5DdJ1t040cWs2B+8Ey8uDlUIPH9kHXgjnlrv0mgGQtgC9hfw X-MS-Exchange-AntiSpam-MessageData: EeBVRa+tU8VKDBSXqi1Wi2J4b2+lfI93NywDoOg6qHeFI6fFwB8yKiCGDBazNGuXmJW00X3u9gnoyYoQsEouBjVDjGXzF1p8H+9Aey3weIkuv9tUdB7mtVC92J8pEtygnE5naGi0DrBU4Neki07+/elpuksGtyIlbH0vRsNMupTwSKVYRXRefmegHeUf7EC26RclwMhcVmoR0DpkwoOL/g== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7cbcb3bf-019b-461b-4a1e-08d7d62c6fe6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:24.2401 (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: sjTAoAcXVPHktbHSsst/XcRONJHO6OOrGGVPu/YRfKXQGWMnplVAz8V6fM1TRE8kiLT+sEJNb78cY/4xaljMaA== 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 When a new tx_policy has to be uploaded, it is necessary to avoid any race between the frame and the policy. So, the driver stops the tx queue during tx_policy upload. However, it is not necessary to stop mac80211 queuing. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 42183c70d4df..7a7c2518f6cf 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -244,9 +244,7 @@ void wfx_tx_policy_upload_work(struct work_struct *work) container_of(work, struct wfx_vif, tx_policy_upload_work); wfx_tx_policy_upload(wvif); - wfx_tx_unlock(wvif->wdev); - wfx_tx_queues_unlock(wvif->wdev); } void wfx_tx_policy_init(struct wfx_vif *wvif) @@ -379,15 +377,9 @@ static u8 wfx_tx_get_rate_id(struct wfx_vif *wvif, dev_warn(wvif->wdev->dev, "unable to get a valid Tx policy"); if (tx_policy_renew) { - /* FIXME: It's not so optimal to stop TX queues every now and - * then. Better to reimplement task scheduling with a counter. - */ wfx_tx_lock(wvif->wdev); - wfx_tx_queues_lock(wvif->wdev); - if (!schedule_work(&wvif->tx_policy_upload_work)) { - wfx_tx_queues_unlock(wvif->wdev); + if (!schedule_work(&wvif->tx_policy_upload_work)) wfx_tx_unlock(wvif->wdev); - } } return rate_id; } From patchwork Wed Apr 1 11:03:38 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: 221515 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=ham 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 ACC7DC2D0F4 for ; Wed, 1 Apr 2020 11:04:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7209F2078B for ; Wed, 1 Apr 2020 11:04:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="WSt+Ctn8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732330AbgDALE5 (ORCPT ); Wed, 1 Apr 2020 07:04:57 -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 S1732006AbgDALEw (ORCPT ); Wed, 1 Apr 2020 07:04:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LV+GGhhN1PfZQVyarp2rAuF2N0/5pyOdkXKcasWfDZI0NrqUI1eskowd/IwqtdW6l5kkCZukkC0+HjBYpaXb2Ax3Z/W4aWqKhKr37/dYj1GP2RVBa4UALOsHNVYo6OPAhHLS7O1lyAlkMzBpV9Dg0Y11U68nK66OOwcm9nIhN2WO0tTyQAlCdlxhN3UMErzGEc+ncyi4wb0L6Fakp2p3J8J+dVXfPYUQ7htVK15d2Emyy8P6wyzb7Iu4ONnehO7Psh4GxKGFEQIUVgKg3jQMvyWx7uy06wPs0bMb+0ppWWD2OiD3kYCoEskZ3EPezkt/mGEubiRppov4GINyXUnzfA== 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=xwzLi39Wa5dbbIqW+KIiPUyRPUxGUWTSuGfHKr1JGww=; b=BQ+gH+GiyEWrasPSNZnALUzI9TrPyyXoe08bPypf/4cTheRVbC3d3YBO5v1GwNZ+KGr4wiAlGcZf5y+9lfi1aZwXnylGDgON3ZKUH+l1NCytEl5DzpMVgQa4BE6YNnsv3mC0Ey0i+GvoOsk/ii3wmr80c9oQWgJ8l2HTjQbAYBCiH/nyL8KMVTf3+CpMKf8fAjjz6jN0woM70obxNFwL1ES+aJCU7VcZcOsY1RDoj560s+WstPUYm1ae+oa2vE+7H/gle496yvJTGgkHI3hUdVuECoeG9gNfLSi2DGc73I8jKT7xRA3/ETTnwFgRLqiZEg0SaYu3ezHYYat6aYZT7w== 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=xwzLi39Wa5dbbIqW+KIiPUyRPUxGUWTSuGfHKr1JGww=; b=WSt+Ctn8mdWM5BsemkEDUyUzbswdAFV2OaPc/yRs/i3Y3MIpF5I8L5wD07P2Ef4AY61NwfIoHUDXkQ3pzW4QHU2n7oywMeNBc76HbpfNRHSW8DEq7MkPmGL7fg+zYcPA/aGIZPorJUf3TqLEXxpyBPw81K5PoU0wht2LoOPK9/Q= 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:30 +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:30 +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 05/32] staging: wfx: uniformize queue_id retrieval Date: Wed, 1 Apr 2020 13:03:38 +0200 Message-Id: <20200401110405.80282-6-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:28 +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: dd866c81-bd41-4c12-7423-08d7d62c7389 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; 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: VBwNRmTRajLY+BRz45GtG05M22OMZYBifqWQr9itaZYIK1DDVjkcXP14FHMJ+DCfd7/dN8VDkIjdTsxaFfmlwa+oVq/1KmuGgiUb4hps4qwzk8bZ4UcCnRTrif0WGagW1djejUTP6zDnfqKYGt6Yx9/esetp6t0bKOdTGJZ6UkIDs4celrcUEdO+6RfbhaWo2Xu+Q9iBj7/oHvxB8o4Jih+Ltisq2ymkuKjG4jcxADfZeK5rVtrnhJxU3WF75kxGkSuODbS1+F915VupWt5Dvfz8xX7cMv+V/LQ66lPuu92//65bO8IGQChh4fQxDlRhOb1LBreS5x4v9hg5ixi1+ja2BCmAWLYPJdXj3NG8DGrICCZ3bxboPfdcOxK5WBopWgs2/FBPb8FBohiCx1gX8jEssIYYpFn9G30CbTLU6uKCUORFmPUBWBegUyMx8Zq9 X-MS-Exchange-AntiSpam-MessageData: y8f3sTb/7OndmjxeMPrechCp6v96URdKMCmH47vvOKFiBaTT0cq0J+71P+nSSSULzh75W9gS7LXzK8j5T3Zpbl4hBxOniYUG1edAYEWJlj4kU5HEiWRLiTU+ryOSmQH19mK/3mGt1uSGDde+AwDLwAk9FNYJodjJYfAyfgpu4PsLkFhhApZHstDCLq5ThyOBPoCAJj4xaconXTwoJdt4Kg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd866c81-bd41-4c12-7423-08d7d62c7389 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:30.4316 (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: NJIgiSsRErFSIoUlGcfFJ/gbyj8S5HpuOog6O864WCKjICJlOKOZyyv+OP4uaF/7yCG7In5ks3briHD2DHoVuA== 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 tx_info->hw_queue contains "vif.hw_queue[skb_get_queue_mapping(skb)]". For now, it is equivalent of "skb_get_queue_mapping(skb)". However, it is not the same semantic. In wfx_tx_inner(), we want to get the mac80211 queue index, not the hardware queue index. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 889ebc2f5d83..8e4c3e1aadfd 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -417,7 +417,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; - int queue_id = tx_info->hw_queue; + int queue_id = skb_get_queue_mapping(skb); size_t offset = (size_t)skb->data & 3; int wmsg_len = sizeof(struct hif_msg) + sizeof(struct hif_req_tx) + offset; From patchwork Wed Apr 1 11:03:39 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: 221501 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.8 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, 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 BFE89C2D0F1 for ; Wed, 1 Apr 2020 11:08:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 956C02082F for ; Wed, 1 Apr 2020 11:08:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="fiaS0vLE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732767AbgDALIK (ORCPT ); Wed, 1 Apr 2020 07:08:10 -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 S1732299AbgDALEx (ORCPT ); Wed, 1 Apr 2020 07:04:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pk/2UwYSZf0B50QLgcFDU0VB/yRWHdyhG4+uJenrjkaOsuXMZ8AtCSQg3OYOIvEBCe7vVePE35QFXB15uFCfc1AiV2+eDSox8W5+laAMZZbm+k95mgADI2oQJU04u3embjJ2k5ac9P/hdbo0syFg+iWr+3eu9Qh/ReELxGi0F2NvraS51mugW4ShHL0/dzyOOmzY8RL46QO8Mv2YFb7jx1nj7z5/21JnypqeCeI5xEQLVdnOaDJebdpFmV0BSSMY6rvdVfTjJhiMteI7vBnd9WAf3bk49TCnGveBGEorbtr+fAId+nTiHO6suLjkZPbeJIM0Y/mVOm+squc3b4s1kw== 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=elWr9kqCLKIQtMXJG2yerf++exc0/sxLlm3itODnK0Q=; b=DMWbS7RN5I2X/Lv/v6tHn5HbbKjYWMXTyi9ZQrdATmcdzsxbqjgP4TE4kqEYJF6Iqyg5WWIboayJE0zeg3KETHXiDHQXZE5NvhOPAo/LAsKfgV9b8xUerDK0PDUkrIJchLNMyGYJXhMcFuKI9Vh0qfJrqrzUc8bCnX8nBdzweyvo4k7xKAjZEn3GSppexxbrc/TldQDVV6Ce26Ab8qXe49eqie/uU2Auv0j98FIkGGkpAJ6Yi7k9gpHmmMWQ+5R+1BOPaVjhxgTWEOFwyNKk9MipKpsknCIFPvbTEDVPtx2HDN+UcrqHMVP48If3KxdB/ruugMXEDHPyjgG9sB0LVA== 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=elWr9kqCLKIQtMXJG2yerf++exc0/sxLlm3itODnK0Q=; b=fiaS0vLEt0Y77Ublwuc63p1Wv5lwA9QLjSpseagDXy1btpNYjMvqLh72E9X8+3lVkiJwGYWgP+Ier0oj+L/wZmmG8BZiJ+R+OlAvUqYq7n6P7BydhezDcLl7I/yxHtPdjyDO+htE2vXTgxR9Xp7f7E1TMAkn9eHuDaLA9FklF9A= 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:32 +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:32 +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 06/32] staging: wfx: drop useless queue_id field Date: Wed, 1 Apr 2020 13:03:39 +0200 Message-Id: <20200401110405.80282-7-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:30 +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: 8cb5b941-49c3-45f5-a747-08d7d62c74c6 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:517; 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: FjUcVrc19b77UE/LiC27DwDMgUwvkJbR+aRlrppbIQWcwLFhBWuaaUA1RkuvGH69gAHm7gDeuHBBEeNLQfJybiMimVOvP2U6d+PZ4frMwvto3CT50JxQNGAMSxngPKg3fOmwpghaYDjnrzMuJTgnoPiCFJxvnwoCkCk+o40exdj8KZFVi99L2X8jDqOzCARVb4fGvxsjzovj7v5CYNzKSpMMsZSXihQ/9YZMgOSPgichLuBmJ38DMwWvUavcPMDWjrRC2IlzwltgwZPD+c+mG9UYFTWmMLEEMDrvNjmrYr5vuvpYDoYhyfEvYr1EhWgym3iMEinPWDdkRyOcoV2iT+WeNDb354AXmPlu8gfhtQ1jl4E6PyQEsUofVJzU+3f99VZ4eoHSCTgptB73wq8/eRpSNT1743ieSAHpHbKF4gJzclQItXNmk3faQtTUE+dK X-MS-Exchange-AntiSpam-MessageData: 1fVJeU1LCqREDUVC00LynFiDFG/9UjDT2vtZteXmP4A8ahTBmJ9cLlfAoRclG5MpXYi3CKxytpP66u94/lg9UhJxACE+EmVEv/Dl69W5tLktn+C/SkWIEPR+c8YVIEmUk94lq3cyq2HXVuk5DkS+6rFrOBE0VO/nEctfBs5u7A2Fxf0yqpdrXTy/E9eRq+g2JFXAESEUAE7M8RxNMtW9+g== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cb5b941-49c3-45f5-a747-08d7d62c74c6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:32.4984 (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: tLrsWnjKSwbpKVtnFYVZgJqRtpll81G5EzGF0ybC0YPNksrA6tFN4GZ2c3wQYeoJclR86mwwOmFXlTV2Y0oNSA== 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 The field queue_id is no more used. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 4 +--- drivers/staging/wfx/queue.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 712ac783514b..1df3b6f28c67 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -134,10 +134,8 @@ void wfx_tx_queues_init(struct wfx_dev *wdev) skb_queue_head_init(&wdev->tx_queue_stats.pending); init_waitqueue_head(&wdev->tx_queue_stats.wait_link_id_empty); - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - wdev->tx_queue[i].queue_id = i; + for (i = 0; i < IEEE80211_NUM_ACS; ++i) skb_queue_head_init(&wdev->tx_queue[i].queue); - } } void wfx_tx_queues_deinit(struct wfx_dev *wdev) diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 88ee2bf56d11..2284fa64b625 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -24,7 +24,6 @@ struct wfx_vif; struct wfx_queue { struct sk_buff_head queue; int link_map_cache[WFX_LINK_ID_MAX]; - u8 queue_id; }; struct wfx_queue_stats { From patchwork Wed Apr 1 11:03:41 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: 221502 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 1241FC43331 for ; Wed, 1 Apr 2020 11:07:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CDBF12078B for ; Wed, 1 Apr 2020 11:07:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="TSzlJPgT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732615AbgDALHw (ORCPT ); Wed, 1 Apr 2020 07:07:52 -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 S1732312AbgDALEz (ORCPT ); Wed, 1 Apr 2020 07:04:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AVxqCNBlB0I8Pcq4tmBXgOUuuEWsInjRfMH/UdAyEnUmXYSX1XLaoSPk6aUfPoOmPFqM5JzW7mR3SZ7WUji2YJm/c10SbeiTjLt2dIOGGaHyBE3E1DGrzAkNbcW20nSLJNlt7ccpd/Ky8y2Hgl3n6ur6C6OAdcN0WDM+Glg77MiQJRRKeIWKz3xM2lzO5vmcaGbMRlgS2F6IS0pvqf75IkCIFOt1ATQZEsszTqOZeWK+cWlryDCMwPNIjp4vlDa/dqVoDRo+29yo9W5xTXel9C2yDA2/Q6h2Snbziu//MK0gA7CY/G/IB0tytIWohlAusiJVWPYqBELGjDUK0zut5g== 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=Ixh1kI1Qt5S2Eb+CPATQzrHK332RntXNptR9YznsozY=; b=HQM2AMzCl2XTn3EEl8sOhUgWWD01rhARF4Bpoxiggj6uhtT57qwLu759R+IwMSUyJO92IYd7iIcfolIn6HRZ8094oKYXIVnQkraOUWPzMeYk+MQXc7MpA7SAhRWY1jwF1R0Vcout8kx/Y7b1q87PhQzUBaMdBAPfLnVPUHs30IuHLmyzXiaRP2rtah2QjfwFICgPGGZDB3Z/2VeNq1TBB5r3T8Pmr0mMoW9M3JdG0SBAjmnB7iDok3XHyzKRS72N1orTwxE5Hd5tF++n/B742gZDoGkMG2ICm5ZZGTZ19SntVumGUurPdSKybCUDmeG9PeYKqTYxapV/AdKWnaYuug== 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=Ixh1kI1Qt5S2Eb+CPATQzrHK332RntXNptR9YznsozY=; b=TSzlJPgTZ7w9XMBwS2lLw+soowe8HXWRb6J3CiRIG+Hg8C49fWlNePomosDZ4ISRx4kVWqwlv4lQ/ct0qE1NITBDvCQomS0sgzw7lrUJKhsoEeXwuzRFvujxMpIdgjPxYxEw3LSM/szt98ORgvSEvj6fejejxQzVFFNIZtQdrZo= 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:36 +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:36 +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 08/32] staging: wfx: simplify hif_handle_tx_data() Date: Wed, 1 Apr 2020 13:03:41 +0200 Message-Id: <20200401110405.80282-9-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:34 +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: 8ebcc93b-d074-446a-d67e-08d7d62c772d X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; 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: 4hp4Kt/JEx7J1c18Z1udEV141S4a1O84JN6cYovakw+E1NDq8V+OI2hVeQ975qTCum45wGxT3R8KxwGNDHpWLBKWlhIL4gJLjrMO84PmxawjVtehcKWUkKUI2T3zp/JHWO6z6KAjFvS0LpMIT9lgyJZ8wUfWUZ4r/vKQ/diq97q/iZo7jzKtUcnudubdaTIWiT70IhMNdzmp9ucg28QlP5fI2/2A0tqwQQYl+m0vuUg5KnH4kJa3atob8Q1XisXx+CoSxBmFEzgTcL4FiDm4eP81x20gXnvOCFPCauKTFHMADh8PoLbcLBI1E0GxL2Aw3q6n0odvuHRPO6qS+6WBKf9McSi2HI831hNzShZnoKgRlOOphuYTjBwBT0Q0o87m9FN1yHr0kLsmPqI4ecNrjU82WEO0kDHopwns4Jntwy5SAmz0/rkGVEsIGw8MuZ5X X-MS-Exchange-AntiSpam-MessageData: gv7ksC2TDwtcWJ9daevmbuJkZg6g0VnZ7v6tHGvbsT1AmwO9aJB9n0jBvVdBmc3v7569SInypzY2u5jqhnWT34yT+/zc74FxPMCTjoHiS6T5UQid0XAlE8mNisTsZlrZ6H+7QZ7o+aMnLtroF2j2A9qwfywHaw7bvygHw06ilnSi1XEAXTvkPBVWmRNjzE5PtiKtCVnOcDo1o8rvgMEQYQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ebcc93b-d074-446a-d67e-08d7d62c772d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:36.5210 (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: pl2jMYeIPnlCPCtKJIwj/rOaHclvqIqB9r3IAT9s90e1J5ZFbLATsjs2El3hk5J6x0qFPexL7BUNUFnCBK50cQ== 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 The last argument of hif_handle_tx_data() was now unused. In add, hif_handle_tx_data() has nothing to do with HIF layer and should be renamed. Finally, it not convenient to pass a wfx_vif as parameter. It is easier to let hif_handle_tx_data() find the interface itself. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 2553f77522d9..8647731e02c0 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -319,13 +319,17 @@ bool wfx_tx_queues_is_empty(struct wfx_dev *wdev) return ret; } -static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, - struct wfx_queue *queue) +static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) { struct hif_req_tx *req = wfx_skb_txreq(skb); struct ieee80211_key_conf *hw_key = wfx_skb_tx_priv(skb)->hw_key; struct ieee80211_hdr *frame = (struct ieee80211_hdr *)(req->frame + req->data_flags.fc_offset); + struct wfx_vif *wvif = + wdev_to_wvif(wdev, ((struct hif_msg *)skb->data)->interface); + + if (!wvif) + return false; // FIXME: mac80211 is smart enough to handle BSS loss. Driver should not // try to do anything about that. @@ -344,12 +348,12 @@ static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, hw_key && hw_key->keyidx != wvif->wep_default_key_id && (hw_key->cipher == WLAN_CIPHER_SUITE_WEP40 || hw_key->cipher == WLAN_CIPHER_SUITE_WEP104)) { - wfx_tx_lock(wvif->wdev); + wfx_tx_lock(wdev); WARN_ON(wvif->wep_pending_skb); wvif->wep_default_key_id = hw_key->keyidx; wvif->wep_pending_skb = skb; if (!schedule_work(&wvif->wep_key_work)) - wfx_tx_unlock(wvif->wdev); + wfx_tx_unlock(wdev); return true; } else { return false; @@ -496,13 +500,10 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) skb = wfx_tx_queue_get(wdev, queue, tx_allowed_mask); if (!skb) continue; - hif = (struct hif_msg *)skb->data; - wvif = wdev_to_wvif(wdev, hif->interface); - WARN_ON(!wvif); - if (hif_handle_tx_data(wvif, skb, queue)) + if (wfx_handle_tx_data(wdev, skb)) continue; /* Handled by WSM */ - return hif; + return (struct hif_msg *)skb->data; } } From patchwork Wed Apr 1 11:03:42 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: 221505 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 EF9F1C43331 for ; Wed, 1 Apr 2020 11:07:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA23B2080C for ; Wed, 1 Apr 2020 11:07:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="JkRezrZF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732376AbgDALFF (ORCPT ); Wed, 1 Apr 2020 07:05:05 -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 S1732336AbgDALE7 (ORCPT ); Wed, 1 Apr 2020 07:04:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EXpNqxVZ36DKGXSO4zUy6HJII2UTmqpgYtmHHc5vF2vzycgIxxIG84xLs+Y7r00fn/ttXekr/HZEsnRo4S0xALBpdqxrMZeLGcldpT+iO/JBhXSjuEnWkVZsOmKUWBaORAmAox3Kh4j7scLPXjsAXHBTLGFdAI5rPMV1rY7XUkIx44OtKHtxKEwUVsalYjcEOpN97DiNUXmwVMYiUrCmyS9rlRg5FQnA7eMtcJTrDZYryulAx3o+s1g9d9HLiZDkbwVwlfm4dgoU7Sx8D3JdZQ5BcssuRSp6r+sVG1PaBhiWVC3ok5W2sPnsKLI5FLWrtkn36m4vlbA2CPU4JLqWvg== 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=x+eX5nf2XUfm/gzl2JO527/3MkvsW0eUhq6lGEQMTLQ=; b=EOWq9n8zYJ0n/2PtF7llRg38kqrDT8fDWto1smtC8JCdDWBjL6nvkIrl5iIjBcsjqPswyBj+QNv/UNcDq4Pn8R4XGEkzLAMmTQV6JxerbkBEPuo78I6T7jg6r+nAvS2IOiPHTaDEh91yUDXqzArCLWO/vM/k3t3x9WYMRxwXvsa3HKTHqaqxhlpKlROV1QGeBE+xSSUMfGEorJTLpMO4s6M68lL4c5X/zefUUFyfLHtcyYvUFO4TYl6cfo+HjGEvEOUXWOB/lBbldklpZwFQKAvSOaO+JqvcT+A0nW4t7/UTwLao194IJMfxwYSrZMgo4xgMX42yyJRdpVPP0kdUVQ== 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=x+eX5nf2XUfm/gzl2JO527/3MkvsW0eUhq6lGEQMTLQ=; b=JkRezrZFi0T8U20gHfu3OTHCwWTrS4U5vU34154jj/XLcdpl7iUw0MlPnwXyuDGnKsHvGYRiHhh6dCkR2jUXTc5tR8xEOCVSg64aoT77p0qtsWhaeAHBAfz7Xz05O8wnCLg4ldL6sigZCGSsw2JCRNEXSYQlJ1Wx1WxWSmczPi4= 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:38 +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:38 +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 09/32] staging: wfx: simplify wfx_tx_queues_empty() Date: Wed, 1 Apr 2020 13:03:42 +0200 Message-Id: <20200401110405.80282-10-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:36 +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: 89ec6921-7e35-4b4b-8487-08d7d62c7857 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; 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: iN0tFBjk/Ff/Imcr0m8ioARP9oqpF6JFePGGsJw137nnI1zrjx/QZXKbBToEQVUTYlbTplRnGiAoS3eimYyo8VHEQmnan7z6jcP3NLhdSXBWZKNUBqpzBgjq407Ig2NVwY6yU5PJklidHvZj3T3UrK5SwrKwHLnG8uxXO+ZySBykEzh7DdqZTfLu8p271TvTrlnF4E+dlbGyirFG15b6i0WZfBvJA+oUeK0fxnYREZ7hmz6ZTDrVVH/8R/i69+HBzxBS3QDcMk06yK9hKeM112AVH/G06Hq3VCGCRCQgyKlsaHDvxC/0DTNGFLVt6zoNplXmel3E4nfq7OVv3oeSzq3PeSJuHCZ6EqUyVNVGRUPXlpikagxJB65MMxdpqKQPByyHy6zmuRkNFi3e6AyY8MVxit460ulNyP4d1a1vwtcB4ZXvfhoY43XxD3LuiwMK X-MS-Exchange-AntiSpam-MessageData: 0tl48AQxG9HbRamJmOO/lLtYySxapJK/1fijyp7SPfELAmCbtWzansTV+lE9fuTO+iopeaRQuXYVnr8weWz0T087TgFhsuSz5a6qIaLcdUpJT1BMevKa4VKl+w0RJN5E/JK5WHJ/Bsk5o2vf5vyid6nnRVGyH9TMEerLuOA+ZIrRWK0uTo9gtvY39emfFtfGFXa8Gxx2KDfssFDLmIEbXg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89ec6921-7e35-4b4b-8487-08d7d62c7857 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:38.5489 (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: XRa6XDyMQlaqq1PJxZMRF1c43d6kAHeNYaneluqMTnLz+IKj2Bq03MKJ5VRQ2g1+UDg9JCXezqw0ADHXMiWxQQ== 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 Thanks to skb_queue_empty_lockless(), it is not necessary to acquire the spin_lock before to check if the queue is empty. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 16 +++++----------- drivers/staging/wfx/queue.h | 2 +- drivers/staging/wfx/sta.c | 4 ++-- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 8647731e02c0..09f823929fb6 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -303,20 +303,14 @@ unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, return ktime_us_delta(now, tx_priv->xmit_timestamp); } -bool wfx_tx_queues_is_empty(struct wfx_dev *wdev) +bool wfx_tx_queues_empty(struct wfx_dev *wdev) { int i; - struct sk_buff_head *queue; - bool ret = true; - for (i = 0; i < IEEE80211_NUM_ACS; i++) { - queue = &wdev->tx_queue[i].queue; - spin_lock_bh(&queue->lock); - if (!skb_queue_empty(queue)) - ret = false; - spin_unlock_bh(&queue->lock); - } - return ret; + for (i = 0; i < IEEE80211_NUM_ACS; i++) + if (!skb_queue_empty_lockless(&wdev->tx_queue[i].queue)) + return false; + return true; } static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 2284fa64b625..5a5aa38dbb2f 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -40,7 +40,7 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev); void wfx_tx_queues_init(struct wfx_dev *wdev); void wfx_tx_queues_deinit(struct wfx_dev *wdev); void wfx_tx_queues_clear(struct wfx_dev *wdev); -bool wfx_tx_queues_is_empty(struct wfx_dev *wdev); +bool wfx_tx_queues_empty(struct wfx_dev *wdev); void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index a275330f5518..be493b5f2b5d 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -325,11 +325,11 @@ static int __wfx_flush(struct wfx_dev *wdev, bool drop) if (drop) wfx_tx_queues_clear(wdev); if (wait_event_timeout(wdev->tx_queue_stats.wait_link_id_empty, - wfx_tx_queues_is_empty(wdev), + wfx_tx_queues_empty(wdev), 2 * HZ) <= 0) return -ETIMEDOUT; wfx_tx_flush(wdev); - if (wfx_tx_queues_is_empty(wdev)) + if (wfx_tx_queues_empty(wdev)) return 0; dev_warn(wdev->dev, "frames queued while flushing tx queues"); } 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); From patchwork Wed Apr 1 11:03:47 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: 221503 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=ham 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 8A683C2D0E7 for ; Wed, 1 Apr 2020 11:07:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 57E8420857 for ; Wed, 1 Apr 2020 11:07:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="HKlUuyyB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732738AbgDALHf (ORCPT ); Wed, 1 Apr 2020 07:07:35 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732355AbgDALFE (ORCPT ); Wed, 1 Apr 2020 07:05:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OVZ2WkU3+oZ/Etyshh7qNrv6oMtMf+E83o6ZJA6sQC0zO4b9bnffQnrQilLN6FlEEUYh7+5FTJNdUe7CGpALDWbITv735Fq9CBE9qpPUFqcHKTw690x9l3cCPhr6EKsrEOTdFMcB7qJ2zlu8RHvIbmxE7NRFuxM4iLkILpZcpVsXTbB9jV3lZBD5ueD2fPR7n+bEIFCmereCYs3cfoOElWG+WU/MSklE6Q+4dA+o7zZapyIjojxkm/VwIQCzgoD2HveR/Z22qxC7PrpgrYAnf9f4dZl2V6bvQYO815tYYy/I2Kn8o9/r42054o7ZANSkDgHJjueNqVKivi/OB2FhTg== 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=pbnuxLmWt0iP2LUq7bC8yC8POuBwjQxzXFwbeIfTZ7g=; b=VdyPbXIPoIyWKCDqulbzn+ilaFfNG5vVBnjY/hq9kg4+TaokLq/cP3nd+yiGc2TUDihBUC8Pc9QzENtDfbOdQgR7HHwEaJLHJPzwRzkS7uL0GI+Di0TTIVQANETTggAEI401sBpDmhZG3rPJhITfv62qBvGAshJ1IK7zfqme8i21XSgWtLq6M1SKJqAMHMlUslR8+80ILOewwpqE1BOl81Wev1vcT079mB+WHK4bLfsN+LuD+TZI8blHb0Mtq/pu6kPuXcepQkEYDDXnd7VcoNIiuldd/49LB8SKtLVE5tUApDdtuJtDaky1icTVQm1Sui0Lbr1b22JHMnJAXmLsAQ== 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=pbnuxLmWt0iP2LUq7bC8yC8POuBwjQxzXFwbeIfTZ7g=; b=HKlUuyyBsEAnZXoQ2GaA8RECA3p+QDHlPwQTW2xhNEp83mABmdOj3MqqIhpqcO1ywS9l6OVpeYin14VprWjJGZKBtqcunuCEzdcBVtWf6OElg1htkoDO8dUxy4ryp1lcrxrvVPyyPTR+i688A+KBeulFv1+xBoSb93sjYR8nQ34= 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:48 +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:48 +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 14/32] staging: wfx: do not use link_map_cache to track CAB Date: Wed, 1 Apr 2020 13:03:47 +0200 Message-Id: <20200401110405.80282-15-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:46 +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: 0341eeeb-cb58-4f04-3813-08d7d62c7e31 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; 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: 78+wAF+ciFFoFdDotlwHqDguclQmPp09Y+nyOV8kFVaS5kjEthyK8rGS2XaprJvMT5bNqXUogzKyh1yGe64AOi0BifUPHwuBMLxdL+Rn7vymXen+CSbw98GtnWXVrEc9mqq7EOrfdQRZbN4vUwJ9QIAei19AUKB88Rl3OpehUyDAjVA+8+kBzttPU973vtjnwFWsBASfxY7su5pOPhwa5dHI/Z3F57hIy9pzrtTpdm+uT8u6gUm32Gh+fD1fmjIxKPgd5N9hhlLZLb6i6m4Cwx2gyyY7Nwjl4Wx0uzEsaW2baKi66It5xk4giFH2q+/WN+VyJkOkqXfuXcwfcNl2E0sp9eDbGClI41RC/Dl6n1HuZ8iPjBVpeeFflRpGQ/2suG1J9OHQO0sCi5oms79Cj+cduL0rudKshH369anhGFpakNyOzt7YNWLZSYbCaIB2 X-MS-Exchange-AntiSpam-MessageData: IMmLxwnemGja3xtPGfqg3og1MDGS73uZzdUqdE9YL8DTsqHSsR289wvbOSgj3Z5pKJf9PgZ795ePPNpMU9ONgmEZbol+8BLK6g0Fjg9WsATY5pKm331fMjX4R8tN3+2Yaq1jVlduILvHkv5DEBLw9hzU/zC5PaY4MWS7AiYov3iO6NsAtddF7AlpEA1vt2HQJUdnh+S6evYZsz6QdyPMKA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0341eeeb-cb58-4f04-3813-08d7d62c7e31 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:48.3202 (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: 2hpk/YpQ2Nxe+lw29/IayF67oEQjjcJAFEmaW7x7iLADta44LSANfMedxqWi+ug0phvoGl2wR9Jqm9gHAAql0w== 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 Since we do not track power save status of the stations anymore, link_map_cache is now only used to track "Content After (DTIM) Beacon". We prefer to rely on flags from tx_info. So we will be able to drop link_map_cache. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index cecf9aa7b3ca..6fa8f4e083d3 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -146,13 +146,16 @@ void wfx_tx_queues_deinit(struct wfx_dev *wdev) int wfx_tx_queue_get_num_queued(struct wfx_queue *queue) { - int ret, i; + struct ieee80211_tx_info *tx_info; + struct sk_buff *skb; + int ret = 0; - ret = 0; spin_lock_bh(&queue->queue.lock); - for (i = 0; i < ARRAY_SIZE(queue->link_map_cache); i++) - if (i != WFX_LINK_ID_AFTER_DTIM) - ret += queue->link_map_cache[i]; + skb_queue_walk(&queue->queue, skb) { + tx_info = IEEE80211_SKB_CB(skb); + if (!(tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)) + ret++; + } spin_unlock_bh(&queue->queue.lock); return ret; } From patchwork Wed Apr 1 11:03:49 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: 221504 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 6FAD8C2D0E7 for ; Wed, 1 Apr 2020 11:07:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B4C220857 for ; Wed, 1 Apr 2020 11:07:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="e4XAfeQZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732360AbgDALHS (ORCPT ); Wed, 1 Apr 2020 07:07:18 -0400 Received: from mail-bn7nam10on2089.outbound.protection.outlook.com ([40.107.92.89]:6053 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732363AbgDALFF (ORCPT ); Wed, 1 Apr 2020 07:05:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=euKpgOBqfmicGLOb6g3zoGBoUZCZQx3qzaV/iIUBBOaqvGFOivr8ljOB/V1fmNpPMrufKjA18ekGonmzeHQ3B6LwiwurwSIfgQCwm9bBvdlT1o2kPuV0zlS4H2LmBFTaJsGmBp/2K/bYnsCZn+TGsYclqYrr1v7/onWsGQ1S/SN1UmSkqSUR8cASAnT3SKpXk6JLoZAyU7q3v7VZDPvGSxAC0Ks4Zk6AtqgNy3vp67H5UYKTB3JDRlaKssFH/U9lAxwNE+TlP37CIXW6hGTdcA1YbElQgg5g6ccyaWklBmMnCpfgIcg6kPTzJQuL26ybLbena9SOzxEqUmDsBRAmJQ== 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=77gQiqNqTu8gkEiMjIxwEnynF727rXFv9lLt0W2uKIY=; b=R1jyV6ZmpiyTeODFRN5oj1lDAJpaoNx9LiNuGTFt4M8DFLeB/eJxKMzJaPt/hgdxB1UA9MkGqYtY5QnPNYfC4ZXIGQ/rW4V2mWatmcb04D0aCfwSMazOK8IBKjTSB1X0J+27aIre6MpumUlfrf5ohqHOGqAOAA0BB5UEVFmdK77B5ccYkL6OTadX5vDP5bnAJrTiB5OVmzOc0aaFutolX2KjEhC5UDycgCcWtaWKZqdnx8f143YO0KfcQnz1eZ3nSOpeAZFDQaizX3gkCKZgFMbfbgRJ6GjRG7UPBnR/Ml0ZJ9APmV1C8+Tdh1znnbzCEk/4ZA4ODpBD5wXS2Fw0cQ== 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=77gQiqNqTu8gkEiMjIxwEnynF727rXFv9lLt0W2uKIY=; b=e4XAfeQZ2cVRxMUZOahTsBTCr70cM/XTnmL9KlfCJnsOGEinwQzG2d1RohlqOnaEh9DAbUgyPlvABcHTgs5XNV17KrZhpuqdRNBJkn+u+ml4oXgerzj39l9RwQSh4Yz1FI2qP6H9Faxs8Coryd/DKUjqo+06kLB8qdMirVYe0jQ= 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:52 +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:52 +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 16/32] staging: wfx: do not rely anymore on link_id to choose packet in queue Date: Wed, 1 Apr 2020 13:03:49 +0200 Message-Id: <20200401110405.80282-17-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:50 +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: 3f5f50cc-3dcd-4c24-360c-08d7d62c80ae X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; 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: G2z9tuh274ARHIwheXGSt3TCVuwChHBom4pLMjIGAoS+/KXQZ+RF/UmZAN6Mc2lfKE+jJjeH7DTJJYqZhN4eFXKZC1HhY0CRbPBd4gZnxmFbFpu8o/OdJdqNA3uvCMZUOt1dqa3lp5hRJdkbUekULx5EUSfumdVVD2eKamnsIeOIzqKwJ82MMaRVAtxpXmh2VXf+1d35w7QhUx4ZvX5oqs9TPv6pRsA69WMagUAx00sPMG5Wndnv7+8OztcXEw/ph2sazHo9QFotOBZytRstR4ApwrGNWGBWd/AMCKNHC7w7I1FmRbQlrYwBAi2QKOowVAaeOpyi/WIl8d0zmNvfeusCSRsYv48+ugcHCKNmnDnMiH0+SMDRwjRGVTE40NkLCTgansCirbIY2F5LpPv8Y4olDdB1Gw5yruMUmZm9JtgBAngWR9Mzdl48Fh9T/EWI X-MS-Exchange-AntiSpam-MessageData: T2ryQobBzi7NqWWFHTc+TRgIXiwIH510hLcNTxbJscVN4cMNgMnG1FFD8F5g97Os+FOX8QxePwOvJR6JKHDo4AJneqO72Z++2hSm1IPLINWuCcvUEasiSjhVEdcFVmvN/n5iIVj5l63dwzJ5PU6gtYIGQ2nZXRvHf0MWlLUg5/6w7iyvL/IqBHJ2va/m6ltHuiUHcyRqVwDq6GTjDYKjVQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f5f50cc-3dcd-4c24-360c-08d7d62c80ae X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:52.4129 (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: zij2WY1dl7SM3KQ2X4OyBal7jl8lBC5jzkQTv+UwgFutv8DJvagZGtogMFNOb8pVBMZ3ghSXOAfanRwinWdQpg== 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 link_id was expected to contain identifier of a station. It was also used to mark frames that has to sent after dtim. We do not use the further purpose. For the last purpose, we can directly check the flag value in tx_info. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 82c2781b1f78..046aba77618a 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -158,16 +158,17 @@ void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, struct wfx_queue *queue, - u32 link_id_map) + bool mcast) { struct wfx_queue_stats *stats = &wdev->tx_queue_stats; + struct ieee80211_tx_info *tx_info; struct sk_buff *item, *skb = NULL; struct wfx_tx_priv *tx_priv; spin_lock_bh(&queue->queue.lock); skb_queue_walk(&queue->queue, item) { - tx_priv = wfx_skb_tx_priv(item); - if (link_id_map & BIT(tx_priv->link_id)) { + tx_info = IEEE80211_SKB_CB(item); + if (mcast == !!(tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)) { skb = item; break; } @@ -381,7 +382,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) for (i = 0; i < IEEE80211_NUM_ACS; ++i) { skb = wfx_tx_queue_get(wvif->wdev, &wdev->tx_queue[i], - BIT(WFX_LINK_ID_AFTER_DTIM)); + true); if (skb) { hif = (struct hif_msg *)skb->data; // Cannot happen since only one vif can @@ -416,7 +417,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, ~BIT(WFX_LINK_ID_AFTER_DTIM)); + skb = wfx_tx_queue_get(wdev, queue, false); if (!skb) continue; From patchwork Wed Apr 1 11:03:52 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: 221507 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 4A4B0C43331 for ; Wed, 1 Apr 2020 11:07:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1058C2078B for ; Wed, 1 Apr 2020 11:07:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="kUGyQSZj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732688AbgDALGv (ORCPT ); Wed, 1 Apr 2020 07:06:51 -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 S1732385AbgDALFK (ORCPT ); Wed, 1 Apr 2020 07:05:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JxfSdp57Nq9P/jYpqx9XaKnWBVffmbQkY7aRCRV+5k4TIJ1izReozZ93PEtWY4+x7oN5xCzTw8kMmG20bdBY/1OoxLzu1ldlfHFOnff4SeTYMcuXwDb5a00PfHXhiZrZ48RIEG5XjoGLvUe6pdxqn2zdhFKSxqwHBa75kFQgfOps6ukh6DJ1UaQItyxvaUwtVmwPHtAw/68yVXKWIsiByordJymrJd7mSyl6qKWAvyM5G+nHztR3apDdKDUWXgL8E0QI5Gn/LukQsv9I2gveR18TtKdNpA87xcfF8XBKuyf4rJ2z2BN8QaN5znAW3x7+vXMCb6ur6iv18yBcMMVJaw== 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=GuQDNbxb4F3YogEifT9Q+oCjESVIo3OH/9JiW5IStck=; b=NeGo4z0d0c/rsyMjnNWVNSdmqj/gE4B6Gk9TajDPSbEG1QPbE5frQ/W1TB3Rsd0j7oJHz6IeBMspSOHvy3h2lGRWH+G4Ly+s59y9od4SKp37mmjx77SCnvYgpqL5IqgS0AmB3ucSHJSAsmITUJUd+eiyabbggKCBvBbzqwcQpZyF7WqCbzvVq5hBolCV1AnL6aRsf0uxsAK+RwZppZqVa1h7h9Z8bufwbtXqdO8XOEQz2Mso5cCzIgLMBgBQtMjqXs+QGr0slTZWpxxIDq8crnrhUzJG6wWSKaypgLIhZmlb2o7IcPT6C9f35xM+fSH+jNsWwvyC01Hqu4mjGrRKow== 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=GuQDNbxb4F3YogEifT9Q+oCjESVIo3OH/9JiW5IStck=; b=kUGyQSZj6XrveZvStbiTZeiKsrQ3zRDz2HJlZFHBWdmgMWW+CeLnsZCuzrwDzlTAVV9dXQIUTdf1PpXw6e7tU9XP6XSkBh1/eflQDxFkC8nDVluNWklV+t+oTZVKvNn5kUyGWiXklsF9hxHCdqoPPoEOJmL6qbLiOyxfXJKnJ7I= 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:58 +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:58 +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 19/32] staging: wfx: rename wfx_tx_get_raw_link_id() Date: Wed, 1 Apr 2020 13:03:52 +0200 Message-Id: <20200401110405.80282-20-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:56 +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: 82a0ee3a-1600-4cf3-1d93-08d7d62c8466 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1417; 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)(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: Q9zUhpqgxqqv8ZjaFNhaYMXt7WrZ4GuYgSVd4M0wAL1wqvyGv93PT0loDcZn7P9WCdv+QamHuHaI68x+apVucqYj5j5oV14pJCcEpXncPFwHJ3Bh6bb+6y/d5Zbb0n0eIgutooJtEnTfOGVcmeSoNlMagkcjrpeq/LGep0/ZguaueX2diNIontXTw4xkRlHbBwQSMHo7jSgSFcV2HSYUCBhgharNJYWuMtUpa2TLBK5lW17GF+WLOdemhS5j+ibEfLMcmBXtyHlkNyGzEecVOUAO29CTg1cSQFpJUQXzEol3w/sFlcEVmbw+sge55v1RQ/n2IWtzS3h2bUS96RWROIb0DgQcE4pLmm1k2Ku0QcMapraywjcXnW9Yd4KXo2Jt9RKzn4w2+E/Pb68GtorTnJt2EMBVfVVpjZ+kxzaz4lUdlDMw46yoTKDaFyMPDVtT X-MS-Exchange-AntiSpam-MessageData: Pvz7a6q0XqtwnaQ5tjvPVXv7TK3DEAMy57hvDsaNvQfrmyHLEJtYTUdwEvOzU03VfJLQv1hUO7eRhawpyy9STf7dAY6uUQ7dif7aFRnxStKmz7VMxMeGNJgQGPgzq3jO2ZhhwRmvhD1d1rwJLGYO37mRdCzaV/LOTrpEPVVwrfz2HZB7cC/G7uGwaXYbDRDFCUmgWYSXyWgSxa5tIVWSXA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82a0ee3a-1600-4cf3-1d93-08d7d62c8466 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:58.6613 (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: TWKqyKnNVh8EygrHsI4t0lsmLbND3oBWnRJgPcENrSIwJ1mtWYujRSa5x2+0ElDfbXcTPYnW84Rt2yHJtSAUag== 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 Since concept of "raw_link_id" does not exist anymore, rename wfx_tx_get_raw_link_id() in wfx_tx_get_link_id(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 57afabc102a7..2533d4f53f83 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -287,9 +287,8 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, } } -static u8 wfx_tx_get_raw_link_id(struct wfx_vif *wvif, - struct ieee80211_sta *sta, - struct ieee80211_hdr *hdr) +static u8 wfx_tx_get_link_id(struct wfx_vif *wvif, struct ieee80211_sta *sta, + struct ieee80211_hdr *hdr) { struct wfx_sta_priv *sta_priv = sta ? (struct wfx_sta_priv *)&sta->drv_priv : NULL; @@ -454,7 +453,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, req->data_flags.fc_offset = offset; if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) req->data_flags.after_dtim = 1; - req->queue_id.peer_sta_id = wfx_tx_get_raw_link_id(wvif, sta, hdr); + req->queue_id.peer_sta_id = wfx_tx_get_link_id(wvif, sta, hdr); // Queue index are inverted between firmware and Linux req->queue_id.queue_id = 3 - queue_id; req->ht_tx_parameters = wfx_tx_get_tx_parms(wvif->wdev, tx_info); From patchwork Wed Apr 1 11:03:53 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: 221514 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 8F9D3C2D0F4 for ; Wed, 1 Apr 2020 11:05:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 666022078B for ; Wed, 1 Apr 2020 11:05:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="bryt0T8F" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732470AbgDALFO (ORCPT ); Wed, 1 Apr 2020 07:05:14 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732397AbgDALFH (ORCPT ); Wed, 1 Apr 2020 07:05:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h1JZye9hiymctHsY/I0hLU9FKhbmtUAVd+aQCpzPfJkwD6CddKrYqb3PuYx3ZUwnqJJbP6EBa4coeeEcHXZ2OAEximizbTBX0RqyBdM3DrS6nmBeJjRbCHGYtpemSm6EuP2VO+N7/DX0SmylHJ+wzHdQ1W/wDdSKlL8tca8RBByrgqi4UglkIpU73sduPjEOGAhLfMzD/W2x/viWgJEjNmvISYNNL/WLJchYBu5D8NQqy5V2mPYhf113oCGMC4yt1DyTe7tobhKVqwTuY41S0JpFvPAm0vQhw9zJi/NF9VzJpA+ksQ84K6GaDe9UKO03m9tnIK16tO+2zNf3T9fyTA== 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=ckRI9VlPgVa5+jADj0msC+suM5ZwBwbWygxuwsP1SDM=; b=mXxh2OSbGdxfFmLcgUEfihfU9viqMROuuHVsZo1+xMAE75rMTdiMw9NocsXIBARdee0kosRoXBD6SMUXpu9tsaZb5cQ32bM77t7/jXYl0+LofKwkbSj1toyu6k2NPpF/F43/JGXQUAjIOrzeSlINhl5rLgnHYEPNYUnMZxsKOGWRA55bBbU0GrCIp3pzFqie0pfAuPwhSHzFmoni7zCQptGFceSdnawzYp1HV3KmuMGdAyXOdXdajxFvTxKq+lR3qimJ60kZu80//Q2HuK8YgrJOLwb6Rm2hrk4VICQqefCnywdaaXV8Xs2cKKfoKAi6lBnruuVXJ6CrbnxdP1Hg2g== 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=ckRI9VlPgVa5+jADj0msC+suM5ZwBwbWygxuwsP1SDM=; b=bryt0T8F32rI02mleVev5MQRbgh1DYd8Ey17BHwy02QS0RqsWjbvAZJyBgkMCViJUs0twZixW8lnaXERHCBkH9ozwtTxDmgnQDWfr89epJlIiLfSPdKJnK3W2ZZmX+NAV2u4I4SdhGAz49B9lyxtJsSPxZnNa9P768mCTAVMPmU= 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:00 +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:00 +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 20/32] staging: wfx: replace wfx_tx_queues_get_after_dtim() by wfx_tx_queues_has_cab() Date: Wed, 1 Apr 2020 13:03:53 +0200 Message-Id: <20200401110405.80282-21-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:59 +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: 06119e87-49bb-4b4b-4862-08d7d62c859e X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; 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: BcnC5xBsteWgenmoLkOeOIhZq7fwBzlwql+JhuLgLy9xPgaRW3LYkQcupxSTn4j+GM00iwEdrdjxJrf4CjHT4iWpitLMnbkedDhGGl2zAjCwGP7/Fp6pV4P6umlsgwe0Kpcfaptv500BovdS8OidimiTinP0U9VsiXM5sPFIHepVwnJI0vNVr8tog85ARnk7fK5m7Y6RcVyaX9i1qXpbKnUXe9w/RqQ1IxweIUTyylUQ5Yz2x84OwABCro5yd1/5JfXRWnWKtCGLJ0a8UEQZRT17Vxh+KECUoE9A3BAezh/f9ttisxpcOYbdGVOPl7dsaHwNQT8dDDzCt8/9LraZv8fjR7TGnLnl9iDc3ZacpuHYM6E2SZPxYsQeyylEskxMWh8GIU0lJYMifL7XbqjgndTb11TYTj0xCPxnvIfU5Wbw4kCq3uAklmwDcFb7iNuy X-MS-Exchange-AntiSpam-MessageData: yQSkw2LqeoUlc/ZYk9Ski8UbP7shmi3p6woKBAaUIRaXDeCSutir5LBsthHwFWaOf/gzH6kcQhG74g+PomE29gVygnS2fGp8zuafhUw0fCaRGyXhcpQMO7Iou84MbCAIeth9MAiJkr2lF8Suh0I/syJbUZjIS1jv2YfpCYKaY4tvRm/kd/HdXGG9alFO9vBeS/vJu4vVWEAD/z6SGL/ViA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06119e87-49bb-4b4b-4862-08d7d62c859e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:00.7800 (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: fIr9lblWd1l+RDm6AVoB/qK2S/kH4IzzQJcvXjuy20xb5o92i9XpcTABrSeg/DbfbWNSPI45KNM5Pl03d2kj5A== 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 It is not necessary to return a skb. Just getting the information if there is traffic to be sent after DTIM is sufficient. In add, the acronym "cab" (Content After (DTIM) Beacon) is used in mac80211 to designate this kind of traffic. So, make wfx_tx_queues_get_after_dtim() return a boolean and rename accordingly. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 40 ++++++++++++++++++------------------- drivers/staging/wfx/queue.h | 2 +- drivers/staging/wfx/sta.c | 4 ++-- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 046aba77618a..4ddb2c7370cd 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -264,6 +264,26 @@ unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, return ktime_us_delta(now, tx_priv->xmit_timestamp); } +bool wfx_tx_queues_has_cab(struct wfx_vif *wvif) +{ + struct wfx_dev *wdev = wvif->wdev; + struct ieee80211_tx_info *tx_info; + struct hif_msg *hif; + struct sk_buff *skb; + int i; + + for (i = 0; i < IEEE80211_NUM_ACS; ++i) { + skb_queue_walk(&wdev->tx_queue[i].queue, skb) { + tx_info = IEEE80211_SKB_CB(skb); + hif = (struct hif_msg *)skb->data; + if ((tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) && + (hif->interface == wvif->id)) + return true; + } + } + return false; +} + bool wfx_tx_queues_empty(struct wfx_dev *wdev) { int i; @@ -344,26 +364,6 @@ static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif) return &wvif->wdev->tx_queue[winner]; } -struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif) -{ - struct wfx_dev *wdev = wvif->wdev; - struct ieee80211_tx_info *tx_info; - struct hif_msg *hif; - struct sk_buff *skb; - int i; - - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - skb_queue_walk(&wdev->tx_queue[i].queue, skb) { - tx_info = IEEE80211_SKB_CB(skb); - hif = (struct hif_msg *)skb->data; - if ((tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) && - (hif->interface == wvif->id)) - return (struct hif_msg *)skb->data; - } - } - return NULL; -} - struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) { struct sk_buff *skb; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 39c265e4b86e..2c4724699ed0 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -36,9 +36,9 @@ void wfx_tx_queues_init(struct wfx_dev *wdev); void wfx_tx_queues_deinit(struct wfx_dev *wdev); void wfx_tx_queues_clear(struct wfx_dev *wdev); bool wfx_tx_queues_empty(struct wfx_dev *wdev); +bool wfx_tx_queues_has_cab(struct wfx_vif *wvif); void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); -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); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 5c5b52dc7bdd..e1d7a0670c9d 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -857,7 +857,7 @@ static int wfx_update_tim(struct wfx_vif *wvif) tim_ptr[2] = 0; /* Set/reset aid0 bit */ - if (wfx_tx_queues_get_after_dtim(wvif)) + if (wfx_tx_queues_has_cab(wvif)) tim_ptr[4] |= 1; else tim_ptr[4] &= ~1; @@ -888,7 +888,7 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) { - WARN(!wfx_tx_queues_get_after_dtim(wvif), "incorrect sequence"); + WARN(!wfx_tx_queues_has_cab(wvif), "incorrect sequence"); WARN(wvif->after_dtim_tx_allowed, "incorrect sequence"); wvif->after_dtim_tx_allowed = true; wfx_bh_request_tx(wvif->wdev); From patchwork Wed Apr 1 11:03:56 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: 221508 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=ham 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 2704CC2D0E7 for ; Wed, 1 Apr 2020 11:06:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D737A2080C for ; Wed, 1 Apr 2020 11:06:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="RgY7f7V0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732677AbgDALGm (ORCPT ); Wed, 1 Apr 2020 07:06:42 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732431AbgDALFL (ORCPT ); Wed, 1 Apr 2020 07:05:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OyuqE/tBDSZxMzwEkCKdSiIy+kgsn0n/RLXKFXvnXHoSgjte5T4e0TMHUgx9CEfu/hvYW2vje2l+RwS3ra32EOV0QRzkcTfv/Wq90ez4aV0a0hr/K/KIKf+lg93Uuc8cPtN40AWr3xEE1M80csF2+aM8Mm6CdUF0Nlvtnx2zMN0SoXiJ+2KgPctX+VqdARCOga/6uj6OkVsZb9BUklgeZH+b2uwBNfn+sLgOX4YF/uoLHB7iTXpgv1f1fm3jERqznnW3Ywfo750Szh0NRGst6uC48t2WffJ3mcPyDvzczUPz5r+X7x++7uzZXiaPxtNn66qTcM52bemEKZAUz9hMrw== 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=w5RE61aEh8TA6jceHMMeJhKCrBm8qbsZvDmJckrPQdc=; b=ItZhHK9MYMcbYRxfT05dNZI7KrM1iQQ6ThhOQeBVnVsCzkG6iOm/6xH6y0OCmCK61qA3Zav8FlV1uhLjIhsqj4oZdZag3krPUzCSOr4cDrMjh1t2y8hpqhyBdHHFafS+lki2wMunGZHgV7p2AD4K3KCKgalmRRgk5SKWAZLATB4jYxA10YkD6yeAECRClYjNPLPiDbczxsv+W5p9wkBNdHiK2umVm2kK21SPHQ+z7Y8+gpm+b1iC2jiQFGbRbLYNsbhuNRdoDaOoAvO1OG9xHJA41/zGRRBposZ0ScZyoOC3lq/GYicaes4w+HPv+BZ/KkqHxzbHRnV6DUh8Qavvvg== 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=w5RE61aEh8TA6jceHMMeJhKCrBm8qbsZvDmJckrPQdc=; b=RgY7f7V0FiTRJd9W1erFykLxXLWZ5XDIudtghoUCfe1rkgUK62D3TFTeMXma/xbG2dWR9ihOUjY3xwPhUXpdGQkthct6JJjLZkAtiLF30a5mUl5Sc1aN+4+osoP6er3znCh0B7/o7tAvHdbdiouMhgVSk7hnhIS9NPav3UqURqY= 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:07 +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:07 +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 23/32] staging: wfx: drop now useless field edca_params Date: Wed, 1 Apr 2020 13:03:56 +0200 Message-Id: <20200401110405.80282-24-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:05 +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: b28649f4-14d1-4c49-46fe-08d7d62c8943 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; 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: hmHILPmTYSTaHZ8WCEY0xJi70LX6RPxqUb8eHFO7R1SHZxtB0Kv5ndwefKGwxSmvySX9ngx0QqBL45AiGyK8Awhs4yPWH3+fGPl2yzTZzRHMHkd1PfB3pIW4v81gQJDdYFszA4YZzxB8TFi0zn76UIjvG2TljU2af+e4J9pk0JhnpgvKE6xEzRhENCSIH0KZoetUvNeGRCvn+joW/zbXvI+R/VWgTP38aIP8R9QZbKFo3p47PfPDah0T+dJcsmzTsJCoAyQII0HSoHQfGbXOV/hPEqH0+moT32FtkEaryfvWJZqn2rNbbcpURjIcyZQVmUuOagvjhGg5uc2psTz3zia+zd8MTpxr7Gw3I3dc76ltEHtAh6EnQGTjbjREjPQhY9QTVZWvZ51zGLTz5VmKtt/ogTzNwY7+C5JJczu1rkD+ex8JKJM88X+iAkdXx8wk X-MS-Exchange-AntiSpam-MessageData: NKqazT9u1bmKhdCmpJENthVZlJjuMjbOEPzNiYIs5EcloXEI1uhP9+CKn7N1VyM9WfyhzI3Ps3RATvyUsbsejHXn0PrqVINCbKMmzrVa237R+4lXXxjcc7LCgbosDQMWgSVA2st2t7/rQJc2zJTZzKP4FfCxw5UdOlj0DsMfsHZFVrvzNNw+1Y6WKNUCR0pp2rX0QjRQJ2GJ5zEzfvvAXQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b28649f4-14d1-4c49-46fe-08d7d62c8943 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:06.8915 (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: RGq1e84p6mbXbCkAJARsHLnfIWN0AyAo6/+RkoBnu2PPkNs6on2mbFFbOxZ88gIFBjfXmgNWg8vM62+pdHzjiQ== 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 Since we do not rely in QoS parameters to choose which frame to send, it is no more necessary to keep a copy of EDCA parameters. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 1 - drivers/staging/wfx/wfx.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index e1d7a0670c9d..15f00ea84068 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -298,7 +298,6 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, mutex_lock(&wdev->conf_mutex); assign_bit(queue, &wvif->uapsd_mask, params->uapsd); - memcpy(&wvif->edca_params[queue], params, sizeof(*params)); hif_set_edca_queue_params(wvif, queue, params); if (wvif->vif->type == NL80211_IFTYPE_STATION && old_uapsd != wvif->uapsd_mask) { diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 61899cd7942b..6b5b95a45e60 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -94,7 +94,6 @@ struct wfx_vif { struct work_struct update_filtering_work; unsigned long uapsd_mask; - struct ieee80211_tx_queue_params edca_params[IEEE80211_NUM_ACS]; struct hif_req_set_bss_params bss_params; struct work_struct bss_params_work; From patchwork Wed Apr 1 11:03:58 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: 221509 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 9C749C2D0E7 for ; Wed, 1 Apr 2020 11:06:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 642C92082F for ; Wed, 1 Apr 2020 11:06:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="VBN58U+r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732652AbgDALG0 (ORCPT ); Wed, 1 Apr 2020 07:06:26 -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 S1732461AbgDALFN (ORCPT ); Wed, 1 Apr 2020 07:05:13 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CMzf+wbiNmbmyXhoWK1hYBAM/TAnWC+P6WwhX6hfUZ2tN242w33hCfmdVOIOVTbQWc0HV292pRMKZuFPqRqS0wbPRzvz6pZWiTArpLdRcwidae5iw+uRvzF7T2OssSkFK+VODNK6FZ4C6zIILteNviCDQmuVldCMpQedQqLdlRmHnXB10t03rLF0Pk3JVq05AfyIYR/efo+fAUqcpBRqZ13PfACMVC1erRIp5kFFLJw7czCUJnsm6xXx7QsBfrsUkReFqmPZUkIRs0dhFuCZzxoLlqMAmICZsbgAGfY+lOVBBINuglTh9jdPh+VEeJWCkxap5kPq+8VMvGBOU3fjyA== 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=SrPGMLsUEPUKhc3RhU1c5TMkTtuEHRylbkifV77yKIE=; b=KzjGcCvWYatJdYVWBLYloB56fHZIR3t3YbiqDm3dwQkqQmdl8jzB1tLtLZr8An7sAHnLlE0SisWhRR9nT88m2BMT1MMSwQ2wM+Rdoi2M/syL6gemRGzpLi4cHrcSiSdmE7wK3kv6SC25bZJ1fkLtVNO3gmvKkTWMUyeG8Zt8a7zXMF/cF5NjphGllr2f1cxPymk3r384g0aLHWC0V/Jfr47vr/BWPttVqQb6opaaF/xD6OV05TDpLcxu9sa4ICNMsBkruRXSe/tLUaXAs7cqPVF3RtU8AJd3y3q+3xn25hs8ae1kl1h10E3hvzgcYZ1tiztNgIaa+DHHQzmOCuHb9A== 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=SrPGMLsUEPUKhc3RhU1c5TMkTtuEHRylbkifV77yKIE=; b=VBN58U+rgULbzVWJvYWUm00f3Hdvq+I7JplszFDkQMSmBsv1Hy9vXjmCTvT2MZ3AMmaG1BLWQFNXqSAfaFtNKi69GbEkWXtc/j4DatXyZG5TqBD03NcwKFrn6wXOCkjkTXu8Rn6/tExbvD9XMUlLm5mCApgCYCDsPphiyud4Z0o= 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:11 +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:11 +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 25/32] staging: wfx: simplify usage of wfx_tx_queues_put() Date: Wed, 1 Apr 2020 13:03:58 +0200 Message-Id: <20200401110405.80282-26-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:09 +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: 938b6c8e-ca5e-43d9-a11c-08d7d62c8bb1 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; 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: /vyoY46YSncBi8N6TLiuZ05Fl/YsDNq3A/L4Yj6BL1cbED3dASjytmxJZwN3QlgkSCIrCdNEu7WXibphrQYeQkEQFF5weoZJbmVS9eqIqh419n8pzlN4zpmhiKLLiJn/y79QwZCy9fl6UbUelq1+q/ynrC52wiHSTJpJZ624E1PAzdy7ib0Y4HTHSrjSeoBpmULQLWRDLf/AjT5Hj4fEJ6YfygNklrjByInkxryID1tgpDnpF+bl1++SvNGy6WYMgvSenY6RN44MFs+iEkH2jHEGG8Bg3nIDw89j+AjoofKy+QKdZTApTkduDcZCoHwp0ecJVxiijJaeXIXGSAlbynA2FnYsrjGUmG8M0mrbyelcJ63iBoxw+/jY77OMki7y3qKseb/nyBoHuN+ulw1Ek+I7GrQUjgZNPeAhUKP7qXcA5TangqeYsVBPCY5KnBpT X-MS-Exchange-AntiSpam-MessageData: m2xNRBDodGcpHi9FDDN1K73uDIgvggk321DDv3eugaX62e6jHbDHaDjIpTedDkeT2hxu3TRbkDLc3XhGvJpUOcS+ofKHd9sXEqyS6w7mdCeO1ao9MmlgGQMbFUH8BVSe+xWT99P6/hBgQwfQj+XWPm5MO4mykDhkQZpnrzeXP+s0YMbCcNTTR5w+oY93Tk5FO4q+SBTuM+0QIm5EEW1dGA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 938b6c8e-ca5e-43d9-a11c-08d7d62c8bb1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:11.3549 (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: pcDAsAAzybDjXMMKAh+otitrW8ToJwR6+VACUCHYVmw1cn8/oe4jbVr7+C8GD2xIZmg1jwZpkXSQPiEWC09Y5g== 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 The queue used for wfx_tx_queue_put() can be deducted from the content of the skb. So drop this parameter from call to wfx_tx_queues_put(). In add, this change uniformizes usage of functions wfx_tx_queues_*. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 2 +- drivers/staging/wfx/queue.c | 6 +++--- drivers/staging/wfx/queue.h | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 2533d4f53f83..d2e925218eda 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -461,7 +461,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, // Auxiliary operations wfx_tx_manage_pm(wvif, hdr, tx_priv, sta); - wfx_tx_queue_put(wvif->wdev, &wvif->wdev->tx_queue[queue_id], skb); + wfx_tx_queues_put(wvif->wdev, skb); if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) schedule_work(&wvif->update_tim_work); wfx_bh_request_tx(wvif->wdev); diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index a03860db2f54..cc89bfe1dbb4 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -150,9 +150,9 @@ void wfx_tx_queues_deinit(struct wfx_dev *wdev) wfx_tx_queues_clear(wdev); } -void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, - struct sk_buff *skb) +void wfx_tx_queues_put(struct wfx_dev *wdev, struct sk_buff *skb) { + struct wfx_queue *queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) @@ -170,7 +170,7 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) atomic_dec(&queue->pending_frames); skb_unlink(skb, &wdev->tx_pending); - wfx_tx_queue_put(wdev, queue, skb); + wfx_tx_queues_put(wdev, skb); return 0; } diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 241ca3039b54..4851635d159b 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -36,10 +36,9 @@ void wfx_tx_queues_clear(struct wfx_dev *wdev); bool wfx_tx_queues_empty(struct wfx_dev *wdev); bool wfx_tx_queues_has_cab(struct wfx_vif *wvif); void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); +void wfx_tx_queues_put(struct wfx_dev *wdev, struct sk_buff *skb); struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); -void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, - struct sk_buff *skb); 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); From patchwork Wed Apr 1 11:03:59 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: 221510 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 4434EC43331 for ; Wed, 1 Apr 2020 11:06:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D8502078B for ; Wed, 1 Apr 2020 11:06:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="lDoAZBtF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732645AbgDALGS (ORCPT ); Wed, 1 Apr 2020 07:06:18 -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 S1732478AbgDALFQ (ORCPT ); Wed, 1 Apr 2020 07:05:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fiuOc9UUKb2YIfQYsT1sQM1b4h6rDJcMqqFS1bKl/n5I9NBxw2+EjlijqQfmen+QTXhgwFFPIUeLEWn6O0yT5iaz6ScCBxxzx+6r2lP5YnVZcuVrq/1avTAAAnfydAxS4hIg3GIL2QFA+4O2m0Rjla6jd5r8xNRkUcd8sKasCRPSNV6W6ic/NCQeW96cX5Wnr+JhoPcdA6UztKgAXxL50JuLniqOW63+sjyhS8RlRrVdSyt4+ZQwqDXcPTHmg8dlcTqNswpvZG2ePb1/Qbnb6jX2I4wEfuExGN2HS6AtMTdeYZus8QZn7LFDnhIimMDNYRcaxUPoHOFpIgyo4j9qiA== 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=JLXkHtgOfIXkrIv65auGzqAl7SnFA+CICIpiDZd5Mfc=; b=hbMMmN1mhanqW0eVozOPCYKmNE6eiX5xdjStQG2LwxVpiWyjIgIzJI3hA2J/YHrOA+ydlmu3LTA5j8MQdT6m6TCAZuKL6sF578KEmVWn9jo5vGlvxW+0PjNbpKNAS+nFz4e3+rk7r9YB9ij3pDAaokP9ucveaCW41VqEow8nnufU2QRKtvE7swEU9APxh7XZUwll8IK2tmpjN8QFnLmB1nhDhbCc1IFrC8Zj0uURfjDG/ZwZLvhBcepUTnykJmlbicJW86Aq7jmlwNfiEQNOW6sSvPS4mOaSJ3Fi2akPBDRjwDFj5eg4scWILj6Gwh0OPb4a7OC03NDqmD137G/1TQ== 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=JLXkHtgOfIXkrIv65auGzqAl7SnFA+CICIpiDZd5Mfc=; b=lDoAZBtFGGcMdA0kfRASUGKxWPZ3ctMXJpNMVS1XVfc/rIUcqMjgtipX+WW9TipT5kRFDzPP5Kv+52rYyiUPBhNInnqENBsliRq2dQDSVJEPSbm3KClpJNNvcvlb+T2LwRQdpmA1R7VW38PN5ksK5dPAppMFBdfhnrkN6Tnyuao= 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:14 +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:14 +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 26/32] staging: wfx: improve interface between data_tx.c and queue.c Date: Wed, 1 Apr 2020 13:03:59 +0200 Message-Id: <20200401110405.80282-27-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:11 +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: 97463663-6387-4ee3-38c8-08d7d62c8d22 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; 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: ctcs35DUbRf2jjxtaIJt/OZH50BOMMP/3GMj37QfEFi8DhsXm+u3KmRY1jZNhI+QDE8kZfvdlqo4kAB0by0IU0FaYSXpxf8rhD6aMR7tOTEQ2pBrDJgdtrK+u3XdIWDm4R752IhevIMb06R2+Vyp7jNwEkjeb2uk0BW6eliC39aeJviURE9FnLH6vuFJKeyEMdgei67/Ye0xmy684nQjVAFE9QIPmWusCAOCivRxYpA0ufCzgJbfE5WXIr0yu89t85KbM4zQ9XwocBJ3wUo6yShJw8DkoWoJ/EW+ZzOUx9fYO0Ksorf4Z4zyh5KzjrW0WKdtYzbdz8huzXdiziXS0rkRzSduw3B2QXv51K/7Ndg4zR2aIZdEIzJzJWCmHwEdh35QjrIvgNmTyP+QODcguNVi61ZmBvr1Xy3kxCvo9oFGMT8dJZkxM4nIs8rnPWVO X-MS-Exchange-AntiSpam-MessageData: o1fbsVfMdt7w74HbnjKvV1u9FqGuaCryNJ/XBVbfyR6LYOYhaBwe57Uzv11dG2UrUYw5BSIwhySgfvq8ESKCMnBawFfL478iTp3TFYlQLcDPNK/Ghx1vMW3/LlPvZj4aYWGCtRUWGU7Cin7jSvIeb5EkW7QVH6LiFCEgLRphr07e7JGW19WoMS4UU7bRpXLNTK+5GFxU0R8dh6cAfRaT8A== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97463663-6387-4ee3-38c8-08d7d62c8d22 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:14.2343 (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: xIEKb6xF6ach2a3TxsvXYiEBqbkVDrWNlRVjoD0JqGKbt6nJdfwDS8+6wMVQ99nEc52KHiMrql+p/por0eungA== 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 Currently, wfx_pending_remove() (from queue.c) call wfx_skb_dtor() (from data_tx.c) that forward the tx status to mac80211. Moreover, there no purpose to retrieve a frame from the pending queue without dequeuing it. So, the main purpose of wfx_pending_remove() is to forward the tx status to mac80211. Let's make the architecture cleaner: - merge wfx_pending_remove() into wfx_pending_get() - call wfx_skb_dtor() from data_tx.c Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 2 +- drivers/staging/wfx/queue.c | 22 +++++++--------------- drivers/staging/wfx/queue.h | 1 - 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index d2e925218eda..17209f645e4b 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -586,7 +586,7 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) arg->packet_id == wvif->bss_loss_confirm_id) wfx_cqm_bssloss_sm(wvif, 0, 0, 1); } - wfx_pending_remove(wvif->wdev, skb); + wfx_skb_dtor(wvif->wdev, skb); } static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index cc89bfe1dbb4..a1a2f7756a27 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -174,30 +174,22 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) return 0; } -int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb) -{ - struct wfx_queue *queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; - - WARN_ON(skb_get_queue_mapping(skb) > 3); - WARN_ON(!atomic_read(&queue->pending_frames)); - - atomic_dec(&queue->pending_frames); - skb_unlink(skb, &wdev->tx_pending); - wfx_skb_dtor(wdev, skb); - - return 0; -} - struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id) { - struct sk_buff *skb; + struct wfx_queue *queue; struct hif_req_tx *req; + struct sk_buff *skb; spin_lock_bh(&wdev->tx_pending.lock); skb_queue_walk(&wdev->tx_pending, skb) { req = wfx_skb_txreq(skb); if (req->packet_id == packet_id) { spin_unlock_bh(&wdev->tx_pending.lock); + queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; + WARN_ON(skb_get_queue_mapping(skb) > 3); + WARN_ON(!atomic_read(&queue->pending_frames)); + atomic_dec(&queue->pending_frames); + skb_unlink(skb, &wdev->tx_pending); return skb; } } diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 4851635d159b..9bc1a5200e64 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -41,7 +41,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); 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); int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb); unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb); From patchwork Wed Apr 1 11:04:01 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: 221511 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 DFD8CC43331 for ; Wed, 1 Apr 2020 11:06:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 980922082F for ; Wed, 1 Apr 2020 11:06:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="QeQL0PRe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732603AbgDALFy (ORCPT ); Wed, 1 Apr 2020 07:05:54 -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 S1732335AbgDALF0 (ORCPT ); Wed, 1 Apr 2020 07:05:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cYwJuLeIjzyHei4R6hp8da/xyM4Px2sCIpjCHvIfxa8DyrvIwHFoV1eWvc8LWR+MdhnxEJ5M9T8IWBvnjLFmgmWnP1Ze4mn3tB98mPAHw6c6DZEa7lxnPkGtVaMr2GuvX8+uJU7GCxhoQziagm+sZju1TAUbfFqqkhJSC80KAMEnjNEuZg1FoHQ1LdaZenEa2GTnX7bxMvEvYGg9iK/4lMS4cVGU2fMBl6QPe1KfMfOd/+MC47oIEoB118iuH+7YuHCTETnqKiY5SDyUjQ13+q38cHEK1p8h/RP2vouCDZ9tD86MOjcKeRt0TUrb1IHSD2qNgndO6lNRBWzyXS54Mg== 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=IH8W3kGmmtO9DfMHjIyd12rVVibWNotPl7qw2RYprBc=; b=hMV1pl9pYRbdja1pVRfoVn9rEeP+8Sls+ankDCl53cmwAraXCThNpVOb41CGt3gMIhrtQu7i2mHjcVhvh5tjt0v4wQS0UxcMdJ2Ywt8L6jRSwVLwZGAw/oGG1TMYdpMVPK5eq5JldGaUZItD0TPnbRSba3VH5cGp2MbSKDcXO/cJOZJjCJ5RW3Ml7dPPAAxWk1vBgsaT6BDaZatRnnsBkfrAzHoFfsxAW4GTU7fhiSJaD+zjDkpxFg6uFs4psWwge0LX71MzqFgdPDkwiI9wysB+K6qSbLjdbaxE/UrN15XwYaOAX8ASZW99H6fXrgy2R+i6SrUpQG+WunvwQANqAQ== 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=IH8W3kGmmtO9DfMHjIyd12rVVibWNotPl7qw2RYprBc=; b=QeQL0PReTdid74e7ikpvvft+CbU6a4YJoTPS7iBvN1KcY2C5WTUPCKBeUYCvJQY+r+yZ24wOKxlh/DYnju/9okvnJbqIV1RWlbUiD5IRXLlR9ur38EzhSSBSJvG7JYbVyvmQrLleRmpjgeGnBf0qCPSVFCVmPRGGsgD+xkC0Z/I= 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:18 +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:18 +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 28/32] staging: wfx: repair wfx_flush() Date: Wed, 1 Apr 2020 13:04:01 +0200 Message-Id: <20200401110405.80282-29-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:16 +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: 99bc3cde-139a-4d46-96c5-08d7d62c9011 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; 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)(30864003)(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: /fepGjL8ioX+pJ3isCWbu1pQm5Qex5fi+clOppf8Lnya+ufxBCQhvD3+Tz7KAMpsrvasScQAH+FSfcj6aSDxsOG8aC2XW+NrvrM2U6Mc+MXbH4eDetwAcCjv3TH2yQDnCTYXT8EePaF50ZIGJGksU6dwhr7nJs4QUfRgrK4WhPiVVZuGY3vDk/oXOgWrIDRkejlvb5M1iw2q6T8lAU6VuVaf+okxI03uNFad8QSCUBHHKpefQn2v2gRDNNZ6Cvh4AeLyLqO3kIruOrO5XP0trtixesNUdgl24U0Fin3zfmdFdaUs03B64QzRBbwITUJIN1vTCK7Nquc+pldv3fnnXz06Dr0mpzjclOWQApkNRna/PEbAQANh5x7w12yD6E/jPd9X1Aki73+LhLGpIetAza2ssjw2f69txUDF4GLhDNDGGfnOMVlDt3Bi9fFCzp8R X-MS-Exchange-AntiSpam-MessageData: lsRitfDkjNZ/rO2AZkNBOoWxnWRr2t/XbdAY7cOOEc8s4uzBDUvOAbFOXtheEYxA30EtNnoFBa2q8QoozDoRM6+bNNGAWCSNVerwekrb9nt89/mDCNTa/E4DhkMLndgQ9wqt+5W5OotxYxf6mGZ1Nar62H3l4IHRqFzgDne33DQwlZXxoPUBsYQtLX4e18xRbmEUNdFLMZRtCzUCnvkGUg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99bc3cde-139a-4d46-96c5-08d7d62c9011 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:18.4408 (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: i1x5HgyHfXP9JbuwYOJQedORVRtgEnpSSrWaF41bVfrdtvPx5wUKTGJPsQLd+SggkCA4sG55me4nzl+C69IEBA== 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 Until now, wfx_flush() flushed queue for while device instead of only the queue of the intended vif. It sometime failed with a timeout, but this error was not reported. Moreover, if the device was frozen, wfx_flush didn't do anything and it results a potential warning (and maybe a resource leak) when the frozen device was unregistered. We can also notice that wfx_tx_queues_wait_empty_vif() did only exist to work around the broken feature of wfx_flush(). This patch repair wfx_flush() and therefore drop wfx_tx_queues_wait_empty_vif(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 34 ++++++- drivers/staging/wfx/data_tx.h | 3 +- drivers/staging/wfx/main.c | 1 - drivers/staging/wfx/queue.c | 163 ++++++++++++++++------------------ drivers/staging/wfx/queue.h | 10 ++- drivers/staging/wfx/sta.c | 36 +------- drivers/staging/wfx/sta.h | 2 - 7 files changed, 120 insertions(+), 129 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index ec95518c9167..1d9a8089f3d3 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -524,7 +524,7 @@ static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb) rcu_read_unlock(); } -void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb) +static 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; @@ -626,4 +626,36 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) wfx_skb_dtor(wvif->wdev, skb); } +void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + u32 queues, bool drop) +{ + struct wfx_dev *wdev = hw->priv; + struct sk_buff_head dropped; + struct wfx_queue *queue; + struct sk_buff *skb; + int vif_id = -1; + int i; + + if (vif) + vif_id = ((struct wfx_vif *)vif->drv_priv)->id; + skb_queue_head_init(&dropped); + for (i = 0; i < IEEE80211_NUM_ACS; i++) { + if (!(BIT(i) & queues)) + continue; + queue = &wdev->tx_queue[i]; + if (drop) + wfx_tx_queue_drop(wdev, queue, vif_id, &dropped); + if (wdev->chip_frozen) + continue; + if (wait_event_timeout(wdev->tx_dequeue, + wfx_tx_queue_empty(wdev, queue, vif_id), + msecs_to_jiffies(1000)) <= 0) + dev_warn(wdev->dev, "frames queued while flushing tx queues?"); + } + wfx_tx_flush(wdev); + if (wdev->chip_frozen) + wfx_pending_drop(wdev, &dropped); + while ((skb = skb_dequeue(&dropped)) != NULL) + wfx_skb_dtor(wdev, skb); +} diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index 03fe3e319ba1..7f201f626410 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -44,7 +44,8 @@ void wfx_tx_policy_upload_work(struct work_struct *work); void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb); void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg); -void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb); +void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + u32 queues, bool drop); static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb) { diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 5e1a7a932b53..738016d45d63 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -267,7 +267,6 @@ static void wfx_free_common(void *data) mutex_destroy(&wdev->rx_stats_lock); mutex_destroy(&wdev->conf_mutex); - wfx_tx_queues_deinit(wdev); ieee80211_free_hw(wdev->hw); } diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index a1a2f7756a27..d4302a30dc41 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -62,92 +62,79 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev) wfx_tx_flush(wdev); } -/* If successful, LOCKS the TX queue! */ -void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif) -{ - int i; - bool done; - struct wfx_queue *queue; - struct sk_buff *item; - struct wfx_dev *wdev = wvif->wdev; - struct hif_msg *hif; - - if (wvif->wdev->chip_frozen) { - wfx_tx_lock_flush(wdev); - wfx_tx_queues_clear(wdev); - return; - } - - do { - done = true; - wfx_tx_lock_flush(wdev); - for (i = 0; i < IEEE80211_NUM_ACS && done; ++i) { - queue = &wdev->tx_queue[i]; - spin_lock_bh(&queue->normal.lock); - skb_queue_walk(&queue->normal, item) { - hif = (struct hif_msg *)item->data; - if (hif->interface == wvif->id) - done = false; - } - spin_unlock_bh(&queue->normal.lock); - spin_lock_bh(&queue->cab.lock); - skb_queue_walk(&queue->cab, item) { - hif = (struct hif_msg *)item->data; - if (hif->interface == wvif->id) - done = false; - } - spin_unlock_bh(&queue->cab.lock); - } - if (!done) { - wfx_tx_unlock(wdev); - msleep(20); - } - } while (!done); -} - -static void wfx_tx_queue_clear(struct wfx_dev *wdev, struct wfx_queue *queue, - struct sk_buff_head *gc_list) -{ - struct sk_buff *item; - - while ((item = skb_dequeue(&queue->normal)) != NULL) - skb_queue_head(gc_list, item); - while ((item = skb_dequeue(&queue->cab)) != NULL) - skb_queue_head(gc_list, item); -} - -void wfx_tx_queues_clear(struct wfx_dev *wdev) -{ - int i; - struct sk_buff *item; - struct sk_buff_head gc_list; - - skb_queue_head_init(&gc_list); - for (i = 0; i < IEEE80211_NUM_ACS; ++i) - wfx_tx_queue_clear(wdev, &wdev->tx_queue[i], &gc_list); - wake_up(&wdev->tx_dequeue); - while ((item = skb_dequeue(&gc_list)) != NULL) - wfx_skb_dtor(wdev, item); -} - void wfx_tx_queues_init(struct wfx_dev *wdev) { int i; - memset(wdev->tx_queue, 0, sizeof(wdev->tx_queue)); skb_queue_head_init(&wdev->tx_pending); init_waitqueue_head(&wdev->tx_dequeue); - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { skb_queue_head_init(&wdev->tx_queue[i].normal); skb_queue_head_init(&wdev->tx_queue[i].cab); } } -void wfx_tx_queues_deinit(struct wfx_dev *wdev) +void wfx_tx_queues_check_empty(struct wfx_dev *wdev) { - WARN_ON(!skb_queue_empty(&wdev->tx_pending)); - wfx_tx_queues_clear(wdev); + int i; + + WARN_ON(!skb_queue_empty_lockless(&wdev->tx_pending)); + for (i = 0; i < IEEE80211_NUM_ACS; ++i) { + WARN_ON(atomic_read(&wdev->tx_queue[i].pending_frames)); + WARN_ON(!skb_queue_empty_lockless(&wdev->tx_queue[i].normal)); + WARN_ON(!skb_queue_empty_lockless(&wdev->tx_queue[i].cab)); + } +} + +static bool __wfx_tx_queue_empty(struct wfx_dev *wdev, + struct sk_buff_head *skb_queue, int vif_id) +{ + struct hif_msg *hif_msg; + struct sk_buff *skb; + + spin_lock_bh(&skb_queue->lock); + skb_queue_walk(skb_queue, skb) { + hif_msg = (struct hif_msg *)skb->data; + if (vif_id < 0 || hif_msg->interface == vif_id) { + spin_unlock_bh(&skb_queue->lock); + return false; + } + } + spin_unlock_bh(&skb_queue->lock); + return true; +} + +bool wfx_tx_queue_empty(struct wfx_dev *wdev, + struct wfx_queue *queue, int vif_id) +{ + return __wfx_tx_queue_empty(wdev, &queue->normal, vif_id) && + __wfx_tx_queue_empty(wdev, &queue->cab, vif_id); +} + +static void __wfx_tx_queue_drop(struct wfx_dev *wdev, + struct sk_buff_head *skb_queue, int vif_id, + struct sk_buff_head *dropped) +{ + struct sk_buff *skb, *tmp; + struct hif_msg *hif_msg; + + spin_lock_bh(&skb_queue->lock); + skb_queue_walk_safe(skb_queue, skb, tmp) { + hif_msg = (struct hif_msg *)skb->data; + if (vif_id < 0 || hif_msg->interface == vif_id) { + __skb_unlink(skb, skb_queue); + skb_queue_head(dropped, skb); + } + } + spin_unlock_bh(&skb_queue->lock); +} + +void wfx_tx_queue_drop(struct wfx_dev *wdev, struct wfx_queue *queue, + int vif_id, struct sk_buff_head *dropped) +{ + __wfx_tx_queue_drop(wdev, &queue->cab, vif_id, dropped); + __wfx_tx_queue_drop(wdev, &queue->normal, vif_id, dropped); + wake_up(&wdev->tx_dequeue); } void wfx_tx_queues_put(struct wfx_dev *wdev, struct sk_buff *skb) @@ -174,6 +161,22 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) return 0; } +void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped) +{ + struct wfx_queue *queue; + struct sk_buff *skb; + + WARN(!wdev->chip_frozen, "%s should only be used to recover a frozen device", + __func__); + while ((skb = skb_dequeue(&wdev->tx_pending)) != NULL) { + queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; + WARN_ON(skb_get_queue_mapping(skb) > 3); + WARN_ON(!atomic_read(&queue->pending_frames)); + atomic_dec(&queue->pending_frames); + skb_queue_head(dropped, skb); + } +} + struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id) { struct wfx_queue *queue; @@ -249,17 +252,6 @@ bool wfx_tx_queues_has_cab(struct wfx_vif *wvif) return false; } -bool wfx_tx_queues_empty(struct wfx_dev *wdev) -{ - int i; - - for (i = 0; i < IEEE80211_NUM_ACS; i++) - if (!skb_queue_empty_lockless(&wdev->tx_queue[i].normal) || - !skb_queue_empty_lockless(&wdev->tx_queue[i].cab)) - return false; - return true; -} - static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) { struct hif_req_tx *req = wfx_skb_txreq(skb); @@ -364,8 +356,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) if (!skb) return NULL; skb_queue_tail(&wdev->tx_pending, skb); - if (wfx_tx_queues_empty(wdev)) - wake_up(&wdev->tx_dequeue); + wake_up(&wdev->tx_dequeue); // FIXME: is it useful? if (wfx_handle_tx_data(wdev, skb)) continue; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 9bc1a5200e64..ab45e32cbfbc 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -31,16 +31,18 @@ void wfx_tx_flush(struct wfx_dev *wdev); void wfx_tx_lock_flush(struct wfx_dev *wdev); void wfx_tx_queues_init(struct wfx_dev *wdev); -void wfx_tx_queues_deinit(struct wfx_dev *wdev); -void wfx_tx_queues_clear(struct wfx_dev *wdev); -bool wfx_tx_queues_empty(struct wfx_dev *wdev); +void wfx_tx_queues_check_empty(struct wfx_dev *wdev); bool wfx_tx_queues_has_cab(struct wfx_vif *wvif); -void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); void wfx_tx_queues_put(struct wfx_dev *wdev, struct sk_buff *skb); struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); +bool wfx_tx_queue_empty(struct wfx_dev *wdev, struct wfx_queue *queue, + int vif_id); +void wfx_tx_queue_drop(struct wfx_dev *wdev, struct wfx_queue *queue, + int vif_id, struct sk_buff_head *dropped); struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); +void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped); int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb); unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 340e09bb639d..b1ee02d2f515 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -318,29 +318,6 @@ int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value) return 0; } -static int __wfx_flush(struct wfx_dev *wdev, bool drop) -{ - for (;;) { - if (drop) - wfx_tx_queues_clear(wdev); - if (wait_event_timeout(wdev->tx_dequeue, - wfx_tx_queues_empty(wdev), - 2 * HZ) <= 0) - return -ETIMEDOUT; - wfx_tx_flush(wdev); - if (wfx_tx_queues_empty(wdev)) - return 0; - dev_warn(wdev->dev, "frames queued while flushing tx queues"); - } -} - -void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - u32 queues, bool drop) -{ - // FIXME: only flush requested vif and queues - __wfx_flush(hw->priv, drop); -} - /* WSM callbacks */ static void wfx_event_report_rssi(struct wfx_vif *wvif, u8 raw_rcpi_rssi) @@ -843,10 +820,8 @@ static int wfx_update_tim(struct wfx_vif *wvif) skb = ieee80211_beacon_get_tim(wvif->wdev->hw, wvif->vif, &tim_offset, &tim_length); - if (!skb) { - __wfx_flush(wvif->wdev, true); + if (!skb) return -ENOENT; - } tim_ptr = skb->data + tim_offset; if (tim_offset && tim_length >= 6) { @@ -1062,8 +1037,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, } wvif->state = WFX_STATE_PASSIVE; - wfx_tx_queues_wait_empty_vif(wvif); - wfx_tx_unlock(wdev); /* FIXME: In add to reset MAC address, try to reset interface */ hif_set_macaddr(wvif, NULL); @@ -1097,10 +1070,5 @@ void wfx_stop(struct ieee80211_hw *hw) { struct wfx_dev *wdev = hw->priv; - wfx_tx_lock_flush(wdev); - mutex_lock(&wdev->conf_mutex); - wfx_tx_queues_clear(wdev); - mutex_unlock(&wdev->conf_mutex); - wfx_tx_unlock(wdev); - WARN(atomic_read(&wdev->tx_lock), "tx_lock is locked"); + wfx_tx_queues_check_empty(wdev); } diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index cf99a8a74a81..a0c5153e5272 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -54,8 +54,6 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif); void wfx_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif); -void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - u32 queues, bool drop); int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params); void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, From patchwork Wed Apr 1 11:04:03 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: 221513 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=ham 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 8FAF0C2D0E7 for ; Wed, 1 Apr 2020 11:05:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 562DB2078B for ; Wed, 1 Apr 2020 11:05:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="m7Irli7C" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732553AbgDALFb (ORCPT ); Wed, 1 Apr 2020 07:05:31 -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 S1732441AbgDALFa (ORCPT ); Wed, 1 Apr 2020 07:05:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LD9YXgC8s5iH17VD0Q+uPsF+Za1tE0ewPMu3aL2PLMfc78Y3IDZdh2QBzIM0fEXRpupbKRyOsSdCBLeUM7VFVIVNBrydg8OSJeBiD3CWPQHryQSLmyP1TQPz2zjR8SRMTXuQJmQH2hrBSxtIB1Zffn9z5uAX0cnpMO/bqx16FqWTs5Hxq6zVn+qHrHG19DahzMPvLGTeXHtp1ShTlucIDiCBSI6kej+MOAthWovsUHTkUZES2c29JkMJkv3dYHohtpYjEdIZ1vs9LC4MIWs5OwHQOUdY7jSi6a0BDRX/iEeCCR3L5RnqMaXQHQ1Njf89R6/ospMk6gMROO1KDfp9/Q== 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=Q4Swx1XSBETPQKAOKPk7/O84WzGRDzaHNgSGjmQRB2Y=; b=h8k/we5CAX42VywcNT5NdlKOEYBtD2sbgB0nmz9Qv2RjktXcZXLCsNdiUKDYGK2goU09Uuw3oyHlG5rcd3o6/AyFDnCBX/c3p8LG+CyQ5/x6gCISd66Ed1ceHrXRVpYh/BRvH673u9lgthtOzwb/AX2dpSgYUKZs7UhwNkZba05JzWIVAboJ6TSivIw2jt7/ngTCKWoX2vddZBp2DQIrkT1tklsiIom4SuusIo13Rb/toFODgevMmSyKGbhQYD4ouTuZi2VqeSv1WqcLDjXg3rrSDWv60wPtHqc4lQ8SBh+JJPtWLlS0bX4kj2sIR4tN3PlfeAcDoOwvrZuOQMs+vg== 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=Q4Swx1XSBETPQKAOKPk7/O84WzGRDzaHNgSGjmQRB2Y=; b=m7Irli7CkR97oNAQZh/DZ3oXmLqZii4X+YdCbDhp4SQHQ/usbkzhf7UebtNwtzVuwlk/7Vklcen4wj2KcPOH6yHaOuZQipd64agKNnaVJQoCI42F/EpQAc6XhG97meWut/rlJslFK94+TxyR0UBzShLXtlm//KqW8HHLWS5Gfzg= 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:23 +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:23 +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 30/32] staging: wfx: fix potential deadlock in wfx_tx_flush() Date: Wed, 1 Apr 2020 13:04:03 +0200 Message-Id: <20200401110405.80282-31-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:21 +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: 21259e16-d60b-421d-f41f-08d7d62c92cc X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; 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: SrvUj0WhhGGbgWj9L+qOC0YI/4aZA5jS73cqPAIapUJBANq4XMKIPuZbPqs3hytE374kesWvY2VcFwAZF3RpM58T6C3fqy0Uo8kIBuoSygBT068F+DONbiFWUZX0I65LtNxqtJePwhv6n2pC+Vet9LfPKozh2ZzZNAsnWmkq0kGrqBfknWQs82jFQ+U9veyroOe/zdA+ywPWNQaZlyaF6bwUZfWoQ7BwWeh/glKnaCgn2p9zESUKMUZwQHivvTNeVp4PYdL2T0/bZyw7l4RVeYIByFZfzZO7TiLbTcTaMKJU3vk6FfvmHZjLYr9e6LEQn3kNglKmLXpC4T2TH8lLKvrPp32tqhhVND2KGwriz3uqKvO2wFV75qxBXkjzGgyDuKt8SvzCicGsobg2TvAuyKLMfl1H6hu4+7O2Sp5BDWYxTqZS+yqmyzQnqFDu0rhF X-MS-Exchange-AntiSpam-MessageData: JPfaJduqfOThZ8IKitOMLEuh6VmypmkJmJpdygtTfx4UfJxE8LeGraXmHMjiMCr9jJQURpwjt61g5ymqEppuZb3JfULkgJq2/borOT/gKvDkFWbQiT3jTTw/C43am2cfP5LFC1+Jkbg07XSdJGF+aT5KIchUEBr/LYNQ6Eok7MuzNZ8SRcFOWpMlCLQ85n1m04hS5wSudfrUAkO9RNeQ2g== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21259e16-d60b-421d-f41f-08d7d62c92cc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:22.9343 (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: AqlkUbdxfXe6RJNbl44aSHkI77Jx4oghD83D8tJzUFxzIrhccYJI+ySsZTMMVO/E81Ugf/n2vRyfwM3w+FIKig== 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 wfx_tx_flush() wait there are no more frame in device buffer. However, this event may never happens since wfx_tx_flush() don't forbid to enqueue new frames. Note that wfx_tx_flush() should only ensure that all frames currently in hardware queues are sent. So the current code is more restrictive that it should. Note that wfx_tx_flush() release the lock before to return while wfx_tx_lock_flush() keep the lock. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index d4302a30dc41..e6d7d0e45156 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -36,6 +36,7 @@ void wfx_tx_flush(struct wfx_dev *wdev) if (wdev->chip_frozen) return; + wfx_tx_lock(wdev); mutex_lock(&wdev->hif_cmd.lock); ret = wait_event_timeout(wdev->hif.tx_buffers_empty, !wdev->hif.tx_buffers_used, @@ -54,6 +55,7 @@ void wfx_tx_flush(struct wfx_dev *wdev) wdev->chip_frozen = 1; } mutex_unlock(&wdev->hif_cmd.lock); + wfx_tx_unlock(wdev); } void wfx_tx_lock_flush(struct wfx_dev *wdev) From patchwork Wed Apr 1 11:04:04 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: 221512 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 CEA75C43331 for ; Wed, 1 Apr 2020 11:05:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 90D992080C for ; Wed, 1 Apr 2020 11:05:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="U6GpXhF9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732575AbgDALFf (ORCPT ); Wed, 1 Apr 2020 07:05:35 -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 S1732539AbgDALFc (ORCPT ); Wed, 1 Apr 2020 07:05:32 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c+3iJzJaMuf6XoOiJqOndz+RMf0461SDJA9Qi81LMPmqtehqoE1uFDSGMYBZ3LDLzp5R040woI2PIAFttj+93IzTFt5UlsaGcyKqtnGS56CFnmA0ZkDb+/6B1RvA4ALOqwVkpQ0rFn+4Ime+3WKLNeV1FVJvV5/jet+PifRDIBW1Ba9LK4WUOJ0JUcxGI6hu9I7JWhmYgkkUZLILyOqR6PQG7SlqzdxucAgPfa5P3TZ/jjpMAqecr/mNmVW/VvtkQlUkpZI/m/xM46IICBTQx4b8xbOXFA03PaUhR3RiYKY2FYNIWPpg/WGlU5NUjOIigudcuIw99Mp3//9ertNvsA== 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=X1jqhwnOCvIDXeCRXQIhQJr9ISs6aDNmUCuvc/MDHFs=; b=drXvrgkHHQ7i4mp8ujsBA3Xm0ydDwVZslkj66oU2k1iyhjSChdwXBQ+wYO/9g3UsOfxTgrGft6zqpjx/X9iEV/8PVUVCepQH6pwTW/aDsO9oVWkQ2iv/BK0X4USCSfIqO5WfToEWd16JPadZMdwM8pUhreuHU6FhQ3rIualYk83qum0rX08n36ZTqijvv5Z5KpVeTSGLvUmV0iu3Ydb9qLm43wnsLeNHevgcstsccEExRvPYoWMvWU6BDQJd6zXxOeNRNfTuRmIfnYtvBwYNgUbiOhU4vDFOWOWhm8PakvWeFWvMbqeYof7aDKKV633SfThlVW6CMQ8mpjPZyTXBHQ== 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=X1jqhwnOCvIDXeCRXQIhQJr9ISs6aDNmUCuvc/MDHFs=; b=U6GpXhF9WwAny3tBT8oH011KVBtUwsieLIQb5lLY4TboY+YHrWFdIITb6tQCVzOtzzod2UNnGGHfbzNikQvQ5w9Gh+PY8pfcRXue+LCiIx70/7WvTGvjB3r2JZRmKLw848duTe8t/6yrMpWBsH3DHF7XUScE15xr9bFCk6g4RJ4= 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:25 +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:25 +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 31/32] staging: wfx: fix case where AP stop with CAB traffic pending Date: Wed, 1 Apr 2020 13:04:04 +0200 Message-Id: <20200401110405.80282-32-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:23 +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: f642917a-be3c-4d38-ff9c-08d7d62c9412 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; 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: sANo9FWGYNxA1kQVyxYhKx0Ov885UhR3vPmFNEGlOy9V2x7yp9BPp7up2/XLhNYHhHH41wW8S/SCsDuvxcMfDvdRL9zR0G+KxEo0eowNPHFMBTa7CIfRgzCiZDDlcqTcvbeq5pSiZskbglRDbQjlFCKzkSx3LMELuZ2URsioss0CUSWl9aNAa3LuTKspUJe2K48bjapO7m5GMoYc9xZ1P+nwLvoerLmSYZGmMq2u9q61rmyny0f3GI0MOlN+KqT211CECBl4RNZWYXkXsAAr1OvSQIspqASwE5YSjtsjvdVPOOlgB7ehjLGxYT1GgAbUHiGfnMWnVI0TobnPApdHYvkR5SIiMKzI+FFjWPYOCbhKyOgeHTK3FtNPN2SmRWlImnUlpKrm8zeEiwEyePXoKmT8YbPCWJ8zA88C/g2Io9OF8pi9DkWEeElkXJHUy5hQ X-MS-Exchange-AntiSpam-MessageData: KB9ORJdqZFv4GLWzlwNPLxG4nb6ZH03Esv99EeEOH5/MawncESlH390QTP0tb8LWIV3GyeNZhkw3R6D7iy+qxnxM4ofuM+BpMV3kV21XeVqInmVBKERor9rmIaf+u/j92CNFdMNbwZipwDmKrumYb+t5xjmg1XWniTmDowk8psDMog+yVC3k+/oCSMCtGFixSyM9NSJvTBsaUrN85ONirQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f642917a-be3c-4d38-ff9c-08d7d62c9412 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:24.9411 (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: jMhziX8BpOw0/fXVzQLxZ1jHOGmEmlJ7H8ydEdWrLFOzHptIWuOlqTIXNkDp8RrczvpednKHaLP6gHmdCkJ3rw== 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 When driver has Content After DTIM Beacon (CAB) in queue, it wait for an indication from the firmware. However, when we stop to send beacons, this indication may never happen. Solve this issue by simply simulate this indication. Firmware will send data that probably nobody will heard. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index b1ee02d2f515..2e8d3f571c3e 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -686,6 +686,19 @@ static void wfx_join_finalize(struct wfx_vif *wvif, } } +void wfx_enable_beacon(struct wfx_vif *wvif, bool enable) +{ + // Driver has Content After DTIM Beacon in queue. Driver is waiting for + // a signal from the firmware. Since we are going to stop to send + // beacons, this signal will never happens. See also + // wfx_suspend_resume_mc() + if (!enable && wfx_tx_queues_has_cab(wvif)) { + wvif->after_dtim_tx_allowed = true; + wfx_bh_request_tx(wvif->wdev); + } + hif_beacon_transmit(wvif, enable); +} + void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, @@ -724,7 +737,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_BEACON_ENABLED && wvif->state != WFX_STATE_IBSS) - hif_beacon_transmit(wvif, info->enable_beacon); + wfx_enable_beacon(wvif, info->enable_beacon); if (changed & BSS_CHANGED_BEACON_INFO) hif_set_beacon_wakeup_period(wvif, info->dtim_period,