From patchwork Tue May 26 17:18:12 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: 218504 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 175F4C433E0 for ; Tue, 26 May 2020 17:18:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4F1C2073B for ; Tue, 26 May 2020 17:18:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="IdoQF/Kg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729950AbgEZRSt (ORCPT ); Tue, 26 May 2020 13:18:49 -0400 Received: from mail-bn8nam11on2083.outbound.protection.outlook.com ([40.107.236.83]:48578 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729597AbgEZRSq (ORCPT ); Tue, 26 May 2020 13:18:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gHcNDapIfL7pY5cswImPBCqr7KmKing4sj3MvGkFOfQNA1E15kAo13FfGjZgNnD/5BRBn3sHzg4BBNeNQthdQ32Foxd8tXFoSYO94wfvXoZ3l6W0vaQqoFqU316pXfxFWu7ht/D2YKMwb6xDMrrCe3PvNj7hF9vUBuBmhk32mlVaG7M2+OQWcF3fLKTCKw3OCNHkq0k7rqZlVxnrYpkt08kYF+Obzc1rH8IC2VLyaoCaVyHCrxtcm1iIfwXmU3oVoErwSJQ5NSDVUpWDYjyDg9h/6cGvIxgUDHMQivDV47YZvfJ2c4wEwRASsQIrWJ87GLA9JV3hFcO+hl9U+ALxrA== 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=1CZJt2AGW/b/5DPxtwNsVYH8u7aWDDxha8wH4ZgAfcE=; b=d0AAadWpf6RbkwZ/XTu9/APIil0Z+EUdoc8WAUMfSnRpnbe78w9bdNtpwTkWtmcEaubvLIT4ae1s1qUsNjUQ0P0QR0P+xtoGTA3jdNv34hj/h3FtLV6CUATxkuO3MwyM8t/ehlRCdhyMVG+gCGIDJQSO1vA2486UcbXzvM2QXidRD3Qwr+oSGAxKD+jxcyK9tuw2PnVG2R2c8dZNbI6goNcLWGw3LY2yQpDQT8S1Y0nvzG3/YBKpWomYSmaqTVFX1gbNHk7myfHOU7mNkzoqiGwrRlRsY04z8cZnsZt4y101Wg/gDMeL02eGtTFZCpb7Yw3Nk/DPfk0H3iE8YWz3yA== 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=1CZJt2AGW/b/5DPxtwNsVYH8u7aWDDxha8wH4ZgAfcE=; b=IdoQF/KgoBE/v/xYr+zYAbP+g5xt20g9O60hJs54G2RLBHWQSFQ1W2cMsBkJNiHouI3QiMxz+J0h+juuQxZVpvPKx6K6XnnzO49EqUYp1NxMkzzE450nSI/rI4AN1lny+Yn59F6zhLnw9LWD+MAMpYXa2PU2nxrydO8qz2vjwnc= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SN6PR11MB2750.namprd11.prod.outlook.com (2603:10b6:805:54::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.25; Tue, 26 May 2020 17:18:42 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::c504:2d66:a8f7:2336]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::c504:2d66:a8f7:2336%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 17:18:42 +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=?= , kbuild test robot Subject: [PATCH 01/10] staging: wfx: drop unused variable Date: Tue, 26 May 2020 19:18:12 +0200 Message-Id: <20200526171821.934581-2-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526171821.934581-1-Jerome.Pouiller@silabs.com> References: <20200526171821.934581-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR1PR01CA0007.eurprd01.prod.exchangelabs.com (2603:10a6:102::20) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (2a01:e35:2435:66a0:544b:f17b:7ae8:fb7) by PR1PR01CA0007.eurprd01.prod.exchangelabs.com (2603:10a6:102::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17 via Frontend Transport; Tue, 26 May 2020 17:18:40 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [2a01:e35:2435:66a0:544b:f17b:7ae8:fb7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3499145d-abfa-464d-1b75-08d80198d6aa X-MS-TrafficTypeDiagnostic: SN6PR11MB2750: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:480; X-Forefront-PRVS: 041517DFAB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JCcoyUnV5sbzS5jL00Qv7cXnTMDOVzAGsttksPC2OPigPJvCuSTr860imHCs1dolT5ybDr7ghpohHTeEqdKfTCeVvQUbJprv+hcXEWeJCBsOVu59aFG8JiJcycvz+HgpJH6DpVj0nSQgHP8HszyWGAsO8/XxpGEhmYv7gA+gZ2jhIQhL/W8kvYQg9zExwsEuUVHDk0YpDIRFEh5uSNtMgBqmyXtqeLi1uCW0OzNwIYa326YJta306YYMxK26V17Vj6jh2gpXOcMSoI81MEYjUGnWq3xDAaMwhCSEWFcpVWmXGv8z95NaILl4gNP5419h8/8pX2pYeoxgjJJSSjn4PA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(396003)(376002)(366004)(39860400002)(136003)(346002)(4326008)(6512007)(316002)(8676002)(8936002)(2616005)(6486002)(2906002)(1076003)(86362001)(6666004)(186003)(16526019)(5660300002)(66574014)(36756003)(54906003)(66556008)(478600001)(8886007)(6506007)(66946007)(66476007)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 1NyQAGHDjAppSytKdK5AmyBQPMMy7NH38A2Tr93ZwoCb7c1PDlcVfpMGae1WqAELkx0PEZYLQsuVU+w7rUh4yIt1DFpvEmGo9TDMZZg3T8F6scWtFkH1ExJwHJyOg9t62ZeG7p5lmDgQKDa1X4TNKd2GPENRbE2HgLG7LT6KG5UB/XZ1J+VZ3wgwB6pZvrC7Y1GQZ4Y8wVtMIumjnKBJ/kYt0pGO1vgMnIHLPZ+EiOSgLjPx0pey4GX+eaMH1jpo3fF60uikJ3Oxhev2K+Z0B9QoO5mH8s7HUAWZw2exXs+tbeOZgJqWvuxlJ+SaRlZ0oaELDpDpp5xOVkDc8k56NB02GQtoe3Vc2NYMe6utZxxY6wREVxFYdX8/8PqURFV9zkGsYZC0A7rzVxCuGodKc39YiTELV1pPNnOI/5GoX5vLabTvrTwlgv1Uls3VSnDO55KKKRL2yqUufKVHoXKCwOhPf795bQLwjhCM7C/9l4rTW07Xj/Z+Ey0LFf3qUYNIVT6GQsVyQYFvUwzvFX5SAmrwisl3CYyBOhNDnC584tA= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3499145d-abfa-464d-1b75-08d80198d6aa X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 17:18:42.2593 (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: xaD2WmsY4gswMVMQNHPtNIplcxRUqWdijS3s+VurMNEID5aEcuvhIU1s5h6uThGVnGrLsFI92I6zA+uje+21Qg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2750 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Since the commit 3f84adfe1d7ae ("staging: wfx: remove hack about tx_rate policies"), the variable "count" is no more used in wfx_tx_policy_build(). Notice that there were two instances of the variable "count" in wfx_tx_policy_build(). This patch also solves this cosmetic issue. Reported-by: kbuild test robot Fixes: 3f84adfe1d7ae ("staging: wfx: remove hack about tx_rate policies") Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index a82f00f8f17bd..a9eddd6db2b5d 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -43,15 +43,10 @@ static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy, struct ieee80211_tx_rate *rates) { int i; - size_t count; struct wfx_dev *wdev = wvif->wdev; WARN(rates[0].idx < 0, "invalid rate policy"); memset(policy, 0, sizeof(*policy)); - for (i = 1; i < IEEE80211_TX_MAX_RATES; i++) - if (rates[i].idx < 0) - break; - count = i; for (i = 0; i < IEEE80211_TX_MAX_RATES; ++i) { int rateid; u8 count; From patchwork Tue May 26 17:18:14 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: 218503 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 D2C83C433DF for ; Tue, 26 May 2020 17:18:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA1222073B for ; Tue, 26 May 2020 17:18: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="M0rCfHWI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388339AbgEZRS6 (ORCPT ); Tue, 26 May 2020 13:18:58 -0400 Received: from mail-bn8nam11on2083.outbound.protection.outlook.com ([40.107.236.83]:48578 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729597AbgEZRSw (ORCPT ); Tue, 26 May 2020 13:18:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hRzlxiSjIBzjbJDcqdmQP9dRH+PoW1Rojf0vnwguNPsygXIBJAwiao1zVbXNS4CPZvWsPb/wf2U5gkC3LL7+EJMtqw44TeMpXfwBl4k34YHUb0lRv8P5BHOOCuarv9LqoRT2N1sckWDI+Pocvc6S94NxsD5IhuDwHcdexz0eVGfyj1kiTTzYt5p4oJanE3p1fkwnTkqk3ZJMdInF0G/GJWBgkQQhEksMmKXdZC38qwjrzIvGq/VPAp+9IiS0QWbucQF3ew/RUbY2MqCdnogRj+gPvJoPYwNY4ft0IaE8lDHaeEsHOsRE5c0aedULl0s4xSX5FQaIhK5+0tbikkdryg== 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=wsTm/QaoE2NdtXYonMZIxlYJijuapxWK1NonVnqHTHs=; b=b/YvXAiOszusnEJDFeJA0XTBug659fjBwwduJp3uNgP+q7GZGoDeCI+txCZYtlNGbrTMeNsTuEoLoaB791r4+NdmLLDKfy9fflSHe+1jF0+bnA3laEQMi4ZdDNnTfl9cQ4FTFfy4p/PvabfHAU5TV+UeqJe+wnIGABprp5DVG2Uk8UUrNqcD+PO53cI8jw8nnzmUiKH0nSJqfWb8dV0hbQIHGexG4zS0MiGfhzhxCgW0Emtzs3vIvsN/KQsf9Nrea5uhDb0tkcWPrOI2TFAUDOKZTOOHrv4Gzez6JKi9xYb6LmnrjNpslyuSMwlDbCalmlJmB4A1yJtS0HfXGwn8SA== 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=wsTm/QaoE2NdtXYonMZIxlYJijuapxWK1NonVnqHTHs=; b=M0rCfHWIjocOTHA7QBeVvUJoGakzuEjlo0t8yMO4Q/IxKbIJmvLrNZgzGRjUFIsJZdJxp/kPIXEztmt54qTJZ0nC+fVVaFF1oxRxhvtCtzE68u6lTxnKACrYoFKwvCo9YEHnPtWj4TIWmunr83sIpMgE+e9QDE5czsGaG8daH1I= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SN6PR11MB2750.namprd11.prod.outlook.com (2603:10b6:805:54::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.25; Tue, 26 May 2020 17:18:45 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::c504:2d66:a8f7:2336]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::c504:2d66:a8f7:2336%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 17:18:45 +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 03/10] staging: wfx: drop unused function wfx_pending_requeue() Date: Tue, 26 May 2020 19:18:14 +0200 Message-Id: <20200526171821.934581-4-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526171821.934581-1-Jerome.Pouiller@silabs.com> References: <20200526171821.934581-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR1PR01CA0007.eurprd01.prod.exchangelabs.com (2603:10a6:102::20) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (2a01:e35:2435:66a0:544b:f17b:7ae8:fb7) by PR1PR01CA0007.eurprd01.prod.exchangelabs.com (2603:10a6:102::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17 via Frontend Transport; Tue, 26 May 2020 17:18:44 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [2a01:e35:2435:66a0:544b:f17b:7ae8:fb7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c4be2500-4ded-403c-3c7d-08d80198d8a6 X-MS-TrafficTypeDiagnostic: SN6PR11MB2750: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:88; X-Forefront-PRVS: 041517DFAB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P9+X8Rw9PQaUKm5qJB6UNbTMhdgzF4cqSHcPjxyutkfF1OUlvCYImOhfXnkSLDXUW0HTpYojMrSYt4jjcF8wH9CVUkDPoEWID5WnYLRGFONnFYscW41DLNEORnnRf91ixGNUNFwTVuKNbMwoeVZChj2WzrCkc5zjvkuzZNrhetP/FZSLb9E/sMpJ/nFMrwBJIh8oDFznq/67Xs8mFeo7pMK6PoP1IL5pp0gUuAq1JSydAqhymXhshv9nUflsPpI6iEwO12Yh1D0XJvo3Wao4iCng1sKRIDOxV50Ntofg5Gm0IUycfrAWQQxIcEb4+XlaAMqCtnwOZpvKykI2r+ZniQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(396003)(376002)(366004)(39860400002)(136003)(346002)(4326008)(6512007)(316002)(8676002)(8936002)(2616005)(6486002)(2906002)(107886003)(1076003)(86362001)(6666004)(186003)(16526019)(5660300002)(66574014)(36756003)(54906003)(66556008)(478600001)(8886007)(6506007)(66946007)(66476007)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: RVhVY6vN1XgdfhvcDOg1A+OiGT3boOFlZZMr4FWq5WM/ObCAgZLrGDCkDXQfYxIbNubNvAC5XkQIFiPxYGGO/+f2xKM9LIlY+L6oQnXc/zhcaplEYZPhIkRP8FMSbH5fIFgGnZyZMF00TZJ1keHGEGLXGbI0exA07+o9uHGt9JPbMSLksqk6d4X/2fJnWJ1kAHvbxpNJ+kksQzHl4pDWvpnoDmhMBYGjzG5heUpzAkMePzEe8vLOUcAvT7isgel5eYs6o6CDLgkl4v628l6rub9JuT5VTMx7k9nQyCwKDqQs1tziOeYd4wgPgeKfKQaxsQZ+wDkvsWl6BF5mwikM78xj8JnkYY1rFztU5vTx0Otiled+/R8g0a/W6w8BYlOSk+s9Z6O4xWqRZDkKR25I3w9Zj1AnclkMgxCMLCU+hrXxte+IiASI50pjWxXRn5TvRM9Dr7I+UARRJSqve78QEk6HkDywYWf8QW7gKcAa18pMwJrcnYAVAddbaOq5Iizdr9UIc99szB3kq1QP6AbqOWm0C8FrK8lWfpPpzNXCSt4= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4be2500-4ded-403c-3c7d-08d80198d8a6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 17:18:45.5714 (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: UeXzHJ1/cVppIMF4u4GdrWQbQ05ftf5CeoPF+9bUwcnA8FS2VySWFH2wpLVXXOIKMxsFN7N8Py0HEA76f0bWbw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2750 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The function wfx_pending_requeue() is not used anymore since the commit 7a44644c9379e ("staging: wfx: introduce wfx_set_default_unicast_key()") Fixes: 7a44644c9379e ("staging: wfx: introduce wfx_set_default_unicast_key()") Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 13 ------------- drivers/staging/wfx/queue.h | 1 - 2 files changed, 14 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 26b141cbd3035..3248ecefda564 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -143,19 +143,6 @@ void wfx_tx_queues_put(struct wfx_dev *wdev, struct sk_buff *skb) skb_queue_tail(&queue->normal, skb); } -int wfx_pending_requeue(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_tx_queues_put(wdev, skb); - return 0; -} - void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped) { struct wfx_queue *queue; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 0cbe5f4b06f24..0c3b7244498e3 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -38,7 +38,6 @@ void wfx_tx_queue_drop(struct wfx_dev *wdev, struct wfx_queue *queue, 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); void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms); From patchwork Tue May 26 17:18:17 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: 218500 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 B4892C433DF for ; Tue, 26 May 2020 17:19:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D7CA207FB for ; Tue, 26 May 2020 17:19:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="B+Gpilbk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388997AbgEZRTI (ORCPT ); Tue, 26 May 2020 13:19:08 -0400 Received: from mail-bn8nam11on2083.outbound.protection.outlook.com ([40.107.236.83]:48578 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388898AbgEZRTB (ORCPT ); Tue, 26 May 2020 13:19:01 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Eq++fMwcJ7YPJTbGcz/FRaXrhFJ/xXLQJnTmMymXJGvSc89Xoj2nxsjX8Ffm86b726EfxvoKuGhgt+wTm9Rr2mt249A0gcSLfrQqtoj1Y/ZB33TgTit8w3qrTUKseoeQYf6sFEzH/VYhxhPFU+aEGKkC/bz/iGzjCWYjK3eTrXzZxfvoeodqUCIAsrIQxeBu7iMkFeBFsKA5TBKig6oFv+us+es2dZJEm/klkAzJtDvwC8TdOVZu7CiTf+fn0+2ObnD1KRM8W8skw6MOR18q2qCbp0bXkB4WqqNJzY88oYzuCA3B+v6nBPbaW2GxQ+zefwgsPfv8KtHse/7xVUzcvw== 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=wXGHy+DOkIwG3kemaOa8KHPH2RZ2MpmCkltH0RA9COE=; b=FVGVyJ6eNnxBbHRepdirCKVN1mcpfHvMLjZSPUTjIWorlNQ6ynZFqHjwq2WwbdkBXeMkO3Gqou+2BIhqHxZiJiKrW1nZQYT1k+vAcqOr0T4/ku/IOM5DugyY5PWocP5XlLrhAjqIySwZbLq1iE7MVUfTisAWc8LZh7xFxEUg58ckHm5wCbEFJx9+ayStl6pMBy8xzKGJvUVSSRzSPLQeSfb5s4gA3vbrY+XCprXzKNKEoXcQpddpt3lODoSdvFunveIiMuwyYelKIRfjf3sIXxd7k1BB/ws0+FwdcuWk2g4tubbTXagS2/aMtBwkyVcPLwrO3CKLjsyturphEU2N0w== 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=wXGHy+DOkIwG3kemaOa8KHPH2RZ2MpmCkltH0RA9COE=; b=B+GpilbkkULrsxzj5IRbHwhjJDGzl+GBX9d9vG1lnlfnObiXagfPWYqP6hu+MH7kpMq7dVQyk0PLIvQp1lDmHZvGPZp0RF9Vzra9ogGPdyTclxDVGBc3bv6SNplnhSk68m2wEWJn2NdxX/P40NzWRhkmIb6tg7fEsYNT1JrbSSU= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SN6PR11MB2750.namprd11.prod.outlook.com (2603:10b6:805:54::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.25; Tue, 26 May 2020 17:18:50 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::c504:2d66:a8f7:2336]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::c504:2d66:a8f7:2336%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 17:18:50 +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/10] staging: wfx: split wfx_get_ps_timeout() from wfx_update_pm() Date: Tue, 26 May 2020 19:18:17 +0200 Message-Id: <20200526171821.934581-7-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526171821.934581-1-Jerome.Pouiller@silabs.com> References: <20200526171821.934581-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR1PR01CA0007.eurprd01.prod.exchangelabs.com (2603:10a6:102::20) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (2a01:e35:2435:66a0:544b:f17b:7ae8:fb7) by PR1PR01CA0007.eurprd01.prod.exchangelabs.com (2603:10a6:102::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17 via Frontend Transport; Tue, 26 May 2020 17:18:49 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [2a01:e35:2435:66a0:544b:f17b:7ae8:fb7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 783d39ca-549f-4436-f0a8-08d80198db9a X-MS-TrafficTypeDiagnostic: SN6PR11MB2750: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:935; X-Forefront-PRVS: 041517DFAB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B4f6ysuaScRbETCTzEAHlgSWdKMdgX1UVcI6ha2y9XkXi9hyD0JHXuxizEXRibTLWcGga7K6TS0tgzxZ/BZsUnsgU9lyH9iSKdn5xmg2m16FogdL+DVF01vTwPQpKp0SUKuo2kMpX6EeQFG4VhEAwz49q4t41ePZvZDghvjoA4kyn7YDMSYpul4wLCZ6ClVtBCZ4FuA1jrjP3V4V9ns+QTXMJM7/06kEC8c173jZ5v1SCs+5f0/NT3d0T35zoSO5QrMfCCXgupTGijbHZ/9EVTthkkbGUOFLy0mngkAJjiSAuBMx6RRMkDN/TSPDvwcdVuH8TWR+Ik4qpYvTR8TF5g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(396003)(376002)(366004)(39860400002)(136003)(346002)(4326008)(6512007)(316002)(8676002)(8936002)(2616005)(6486002)(2906002)(107886003)(1076003)(86362001)(6666004)(186003)(16526019)(5660300002)(66574014)(36756003)(54906003)(66556008)(478600001)(8886007)(6506007)(66946007)(66476007)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: /ZZ59/K/2AV8Nm6I65rxVU9T6b130UO4lQJOOWcEpeU29nK7HqQrIW7K0g3OyFYuZKl15ncebK8omLWLIW5+4yJpC9vZ2yO3ZRfNluT0ZtXFnbvwpLXT1maSFWv6Qnyavur31qgSY7qaVxOhEJFoPpUEbqowtPDuSBUVoYAR5gzF01R0v+ttDFZcK0MbhuIUILVMW+Jpnk2G6G4mmJ5EFErWfbgePMEFZBFfM/JIQSvfH6y4hMsd/tzFtGnsshe7jmUTEx+ZFT5TlhWZe1sZ5yb6AD+xAe/19js6RaDw10jOr2lIpPU4/vveGkX04MCdnIgQzwcrrUuhsln0MtO7xNYKoDGolIpewN15uORX+g6GQyKkEipH5QOl5ht4ObPb66TQq6475PIxqgbwyO4Ps5VLclgbzuzhtu4y6TTySM2x1oIwxo8gd387j7YFJAJQ8mu7yltgGh/nCVo1xgOAH/008sKQDmOMLbemAdlKB4CUjEaoLzjbzmMCNdzXp8BZNsuSpL+0sHbdmrOmkK/6RAeYhUDPa4gu8PpagK6wSBE= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 783d39ca-549f-4436-f0a8-08d80198db9a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 17:18:50.5265 (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: MkErhpNs69lg1cd2oxQCgctMBsfDJzgUqE/eg9cSPKA450ctqfLK9dxpKkGUFtnk0HOq9DYeFm0z6wXWGY6rIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2750 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller In the next commit, we will have to compute the PS timeout without changing the power save status of the device. This patch introduces wfx_get_ps_timeout() for that job and make wfx_update_pm() relies on it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 49 +++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index d0ab0b8dc404e..12e8a5b638f11 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -200,36 +200,49 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, mutex_unlock(&wdev->conf_mutex); } -static int wfx_update_pm(struct wfx_vif *wvif) +int wfx_get_ps_timeout(struct wfx_vif *wvif, bool *enable_ps) { - struct ieee80211_conf *conf = &wvif->wdev->hw->conf; - bool ps = wvif->vif->bss_conf.ps; - int ps_timeout = conf->dynamic_ps_timeout; struct ieee80211_channel *chan0 = NULL, *chan1 = NULL; + struct ieee80211_conf *conf = &wvif->wdev->hw->conf; - WARN_ON(conf->dynamic_ps_timeout < 0); - if (!wvif->vif->bss_conf.assoc) - return 0; - if (!ps) - ps_timeout = 0; - if (wvif->uapsd_mask) - ps_timeout = 0; - - // Kernel disable powersave when an AP is in use. In contrary, it is - // absolutely necessary to enable legacy powersave for WF200 if channels - // are differents. + WARN(!wvif->vif->bss_conf.assoc && enable_ps, + "enable_ps is reliable only if associated"); if (wdev_to_wvif(wvif->wdev, 0)) chan0 = wdev_to_wvif(wvif->wdev, 0)->vif->bss_conf.chandef.chan; if (wdev_to_wvif(wvif->wdev, 1)) chan1 = wdev_to_wvif(wvif->wdev, 1)->vif->bss_conf.chandef.chan; if (chan0 && chan1 && chan0->hw_value != chan1->hw_value && wvif->vif->type != NL80211_IFTYPE_AP) { - ps = true; + // It is necessary to enable powersave if channels + // are differents. + if (enable_ps) + *enable_ps = true; if (wvif->bss_not_support_ps_poll) - ps_timeout = 30; + return 30; else - ps_timeout = 0; + return 0; } + if (enable_ps) + *enable_ps = wvif->vif->bss_conf.ps; + if (wvif->vif->bss_conf.assoc && wvif->vif->bss_conf.ps) + return conf->dynamic_ps_timeout; + else + return -1; +} + +int wfx_update_pm(struct wfx_vif *wvif) +{ + int ps_timeout; + bool ps; + + if (!wvif->vif->bss_conf.assoc) + return 0; + ps_timeout = wfx_get_ps_timeout(wvif, &ps); + if (!ps) + ps_timeout = 0; + WARN_ON(ps_timeout < 0); + if (wvif->uapsd_mask) + ps_timeout = 0; if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, TU_TO_JIFFIES(512))) From patchwork Tue May 26 17:18:19 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: 218502 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 35108C433E1 for ; Tue, 26 May 2020 17:19:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1086D2073B for ; Tue, 26 May 2020 17:19: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="JAiXmu8L" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389077AbgEZRTN (ORCPT ); Tue, 26 May 2020 13:19:13 -0400 Received: from mail-bn8nam11on2083.outbound.protection.outlook.com ([40.107.236.83]:48578 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388995AbgEZRTL (ORCPT ); Tue, 26 May 2020 13:19:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FEMpcC7b3WKd4jakYOuIrX8EsgVSHxVd3s2A6W2/E1pLo5rpBPJTEgF8QQXHAX6XBbBdN7/dRqM4dkz09wygWYXuq5X9ikm5fAR5IWZC4tujrkHfOMrRM3kCiIOnpAN0YtYmDfmY4VrG6lxm8VjYlEBfGQafYCbK4kOED7msNiX6LDgyMbAuhd4E+LT50m302vloxX8aihtE6rhqxWX3c5/FBLVkPyXEocDiI1SklbwSaga7K0XH/Ugmv+D9GhYgjHwBHhxZ17ydD1ZRmgjTBCOyLJ4blAQGsrA1n5KdZWvbo/ICdkmwtg9SMxc21z8/231PKAxzVllw12SYEt+/ww== 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=vyrbr3YFnwOdvTfBarbes+ILcX0rykOlaggmKjWAZSQ=; b=bNHbH4oiqCQpPWVuLTFlYw56fpmnrqMTp6amE5QUL3RwyWVGHT5jYpjwJcxSxr1N5XYHBp1XLtzEWuQso1SCByCpsS7swp/T+jfLdlpGUCRrUYQ1NeY3H6VfKNmWFMWCOhPWlXy3lwlPgfeUjYRxbqgQKNkAnJm+8LAV49d1DV9P6q3ajf1tJ/9WmcJN7ctZ/7qQ3sjhjrbdQecuPyclagRSq7Ba9c2d3NAOn8Q7PU4vi2aGxbUvzVSjTESc52ptywn7eoEvPs/fX8ECudD6P4FUWBQc/0SDBUtovJD7c1hiyzSMfR6CbFAlSTeyQHhJvKAnCmBDDw14sA+VyzMu+g== 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=vyrbr3YFnwOdvTfBarbes+ILcX0rykOlaggmKjWAZSQ=; b=JAiXmu8LqpyLWYFX6dl0AcLCVSl9bdSZdwwH+kOuNF4T9dUofuXfbBCJ81rqdg5bP30efQ7/JKPKyXyQne1PwlBBajc+MYaP09MPApm77zoSQFNEDvja0y+FOdJnxd6VfNbkBkPZxGD/j1Pivp+5+UnwiR62hEBNC7GmnIhuaCs= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SN6PR11MB2750.namprd11.prod.outlook.com (2603:10b6:805:54::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.25; Tue, 26 May 2020 17:18:53 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::c504:2d66:a8f7:2336]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::c504:2d66:a8f7:2336%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 17:18:53 +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/10] staging: wfx: allow to burn prevent rollback bit Date: Tue, 26 May 2020 19:18:19 +0200 Message-Id: <20200526171821.934581-9-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526171821.934581-1-Jerome.Pouiller@silabs.com> References: <20200526171821.934581-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR1PR01CA0007.eurprd01.prod.exchangelabs.com (2603:10a6:102::20) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (2a01:e35:2435:66a0:544b:f17b:7ae8:fb7) by PR1PR01CA0007.eurprd01.prod.exchangelabs.com (2603:10a6:102::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17 via Frontend Transport; Tue, 26 May 2020 17:18:52 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [2a01:e35:2435:66a0:544b:f17b:7ae8:fb7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 65bfd7e7-6822-4ccd-d6cd-08d80198dd7c X-MS-TrafficTypeDiagnostic: SN6PR11MB2750: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 041517DFAB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jUO/CafqVZFkVxIILs2FdskS45/HWMQfkM/n8C+Tb5w/ov2wSIAqt6h7+ItEjh2kAuEcK1hjZJ3FyV49zbWqxNM57MPbZRNrg3o/31/mPKmvLb+jvU9ciu8+WXCKVJoRrXci9chUuHpY2ZKXu1dDTOzj/YMoIeGogMlX6ybTi+s6A9Rz3XGnpt3p47LsvxvIL+AdnB+u+cvHoSZQO16i2tXh2hqHyaMVlWT/Y1YHhOb1TqDS20xX+r5UzP8fmkbZITVpKpMUgii2CdH6VtzahF2DfUCNU/PGkA2ugNY0e+qwPC3YbXsVdybq3a5UOf18G5v1B4OXoHoomMjfxytqbg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(396003)(376002)(366004)(39860400002)(136003)(346002)(4326008)(6512007)(316002)(8676002)(8936002)(2616005)(6486002)(2906002)(107886003)(1076003)(86362001)(6666004)(186003)(16526019)(5660300002)(66574014)(36756003)(54906003)(66556008)(478600001)(8886007)(6506007)(66946007)(66476007)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: EQzkXU43bTAg7TukimXaKp7LLqEAjO/IDv85M1uItUIfaxaKNzrDZtJW2ARjo+7q44jSQkBgQ2nghPY8TFLV2+iPBVNzGRfxcALyUgnntmQK0oORAz3EQga/JrDNU/sBQbqV/cjeeDyPATSd98Qg/ehxGyJ0PwjXAIREbRLryTEnCtXhbqelQSUxaQKKoUZSeV27iM8Zw07UZG1Q5HbfQmsxFUSXvIlNLPRF27yNjrbp8+mSfoul26asGQiRs+ITDiQiQCniGRaNTDsqnovGzEUQ/wkbY8yKdF4QSDK4+s3FfPqHExSO8thKM/bC0EFFsZzJnMSyT5HZ6p9bsU3u4EG+KEihZINl94Z8Wxp9uST8Upx1IzOTpe33VWnIo08iPrWRWq+Dzg2m1DPOvwMtvSQzwKpIGndpbIXiZm8DMp5KvbVx5wETgPYyk5tt/0aPICTq0eZqxlaa+wAeqObVUzthumfx0lM93b1Ijs9dcJyoVWXx9iBw97tyuaLt1XSc1PDEyNzKX2V1vcdMW7WgUrtbBYJ0b0xwf0Lu8A0Uvts= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65bfd7e7-6822-4ccd-d6cd-08d80198dd7c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 17:18:53.6967 (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: 5kEqbL68/L4DIRzDGGxORw0ENP9j8CXHamZJ0mZfBb51zcnMSmVmXQMW4rfrwlspKj/RQRgALZEe4QDAQLNF4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2750 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller In case a security flaw is found in a version of firmware, the device offers a way to disallow the loading an older firmware. This patch provides a vendor extension to nl80211 to enable this feature. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_general.h | 8 ++++++++ drivers/staging/wfx/hif_tx.c | 18 ++++++++++++++++++ drivers/staging/wfx/hif_tx.h | 1 + drivers/staging/wfx/nl80211_vendor.c | 23 +++++++++++++++++++++++ drivers/staging/wfx/nl80211_vendor.h | 11 +++++++++++ 5 files changed, 61 insertions(+) diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h index dba18a7ae9194..c8af3534700ca 100644 --- a/drivers/staging/wfx/hif_api_general.h +++ b/drivers/staging/wfx/hif_api_general.h @@ -361,4 +361,12 @@ struct hif_cnf_sl_configure { __le32 status; } __packed; +struct hif_req_prevent_rollback { + __le32 magic_word; // Return an error if not equal to 0x5C8912F3 +} __packed; + +struct hif_cnf_prevent_rollback { + __le32 status; +} __packed; + #endif diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 6db41587cc7a5..899e1eb71a44b 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -535,6 +535,24 @@ int hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len) return ret; } +int hif_burn_prevent_rollback(struct wfx_dev *wdev, u32 magic_word) +{ + int ret; + struct hif_msg *hif; + struct hif_req_prevent_rollback *body = wfx_alloc_hif(sizeof(*body), + &hif); + + if (!hif) + return -ENOMEM; + body->magic_word = cpu_to_le32(magic_word); + wfx_fill_header(hif, -1, HIF_REQ_ID_PREVENT_ROLLBACK, sizeof(*body)); + ret = wfx_cmd_send(wdev, hif, NULL, 0, false); + if (ret == le32_to_cpu(HIF_STATUS_ROLLBACK_SUCCESS)) + ret = 0; + kfree(hif); + return ret; +} + int hif_sl_send_pub_keys(struct wfx_dev *wdev, const u8 *pubkey, const u8 *pubkey_hmac) { diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h index e1da28aef706e..d29c72d94789a 100644 --- a/drivers/staging/wfx/hif_tx.h +++ b/drivers/staging/wfx/hif_tx.h @@ -57,6 +57,7 @@ int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, int hif_beacon_transmit(struct wfx_vif *wvif, bool enable); int hif_map_link(struct wfx_vif *wvif, u8 *mac_addr, int flags, int sta_id); int hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len); +int hif_burn_prevent_rollback(struct wfx_dev *wdev, u32 magic_word); int hif_sl_set_mac_key(struct wfx_dev *wdev, const u8 *slk_key, int destination); int hif_sl_config(struct wfx_dev *wdev, const unsigned long *bitmap); diff --git a/drivers/staging/wfx/nl80211_vendor.c b/drivers/staging/wfx/nl80211_vendor.c index ec2fd2d73885f..1a9d411718a73 100644 --- a/drivers/staging/wfx/nl80211_vendor.c +++ b/drivers/staging/wfx/nl80211_vendor.c @@ -7,6 +7,7 @@ #include "nl80211_vendor.h" #include "wfx.h" #include "sta.h" +#include "hif_tx.h" int wfx_nl_ps_timeout(struct wiphy *wiphy, struct wireless_dev *widev, const void *data, int data_len) @@ -47,3 +48,25 @@ int wfx_nl_ps_timeout(struct wiphy *wiphy, struct wireless_dev *widev, return rc; } +int wfx_nl_burn_antirollback(struct wiphy *wiphy, struct wireless_dev *widev, + const void *data, int data_len) +{ + struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); + struct wfx_dev *wdev = (struct wfx_dev *)hw->priv; + struct nlattr *tb[WFX_NL80211_ATTR_MAX]; + u32 magic; + int rc; + + rc = nla_parse(tb, WFX_NL80211_ATTR_MAX - 1, data, data_len, + wfx_nl_policy, NULL); + if (rc) + return rc; + if (!tb[WFX_NL80211_ATTR_ROLLBACK_MAGIC]) + return -EINVAL; + magic = nla_get_u32(tb[WFX_NL80211_ATTR_ROLLBACK_MAGIC]); + rc = hif_burn_prevent_rollback(wdev, magic); + if (rc) + return -EINVAL; + return 0; +} + diff --git a/drivers/staging/wfx/nl80211_vendor.h b/drivers/staging/wfx/nl80211_vendor.h index c069330e240a9..49efe8716a654 100644 --- a/drivers/staging/wfx/nl80211_vendor.h +++ b/drivers/staging/wfx/nl80211_vendor.h @@ -16,18 +16,23 @@ int wfx_nl_ps_timeout(struct wiphy *wiphy, struct wireless_dev *widev, const void *data, int data_len); +int wfx_nl_burn_antirollback(struct wiphy *wiphy, struct wireless_dev *widev, + const void *data, int data_len); enum { WFX_NL80211_SUBCMD_PS_TIMEOUT = 0x10, + WFX_NL80211_SUBCMD_BURN_PREVENT_ROLLBACK = 0x20, }; enum { WFX_NL80211_ATTR_PS_TIMEOUT = 1, + WFX_NL80211_ATTR_ROLLBACK_MAGIC = 2, WFX_NL80211_ATTR_MAX }; static const struct nla_policy wfx_nl_policy[WFX_NL80211_ATTR_MAX] = { [WFX_NL80211_ATTR_PS_TIMEOUT] = NLA_POLICY_RANGE(NLA_S32, -1, 127), + [WFX_NL80211_ATTR_ROLLBACK_MAGIC] = { .type = NLA_U32 }, }; static const struct wiphy_vendor_command wfx_nl80211_vendor_commands[] = { @@ -38,6 +43,12 @@ static const struct wiphy_vendor_command wfx_nl80211_vendor_commands[] = { .policy = wfx_nl_policy, .doit = wfx_nl_ps_timeout, .maxattr = WFX_NL80211_ATTR_MAX - 1, + }, { + .info.vendor_id = WFX_NL80211_ID, + .info.subcmd = WFX_NL80211_SUBCMD_BURN_PREVENT_ROLLBACK, + .policy = wfx_nl_policy, + .doit = wfx_nl_burn_antirollback, + .maxattr = WFX_NL80211_ATTR_MAX - 1, }, }; From patchwork Tue May 26 17:18:21 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: 218501 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 49A02C433E0 for ; Tue, 26 May 2020 17:19:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D43A2073B for ; Tue, 26 May 2020 17:19:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="HXKvEoFZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389135AbgEZRTZ (ORCPT ); Tue, 26 May 2020 13:19:25 -0400 Received: from mail-bn8nam11on2083.outbound.protection.outlook.com ([40.107.236.83]:48578 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388874AbgEZRTT (ORCPT ); Tue, 26 May 2020 13:19:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XCZrc7yv4RENxcbg01cUSfVLI+OZN/0VfoUI+gwFoyKSE1wcql1fSq4WeNMW/ZkDxo6ZURwDBc+XeQHtfSBkPA2cGNhtFeDHu5OIClkfAHYIAtD3Glfar7Og22noa6rpk9RWJAL4WQfy0nv+RQGQPYIyDEPPcZbI5uupPcTVtxS+jWxxcIjbKVT7IEQ2FGgyJ34+2Iqrc3KrL281iIZX278l/i3nn4c61rSXCZ4OTbLuOrgdFOedoPp6ndttya0GXfR7Ht1HPl5dX//E53iCYFVZAjq7diQviZy4aOxGdpsAuK3iiWe6O5mN/8fNeaqvUJDOQunjJPaE/83aWxPIZA== 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=GElZCByPklEnoQ8Cdo2ms75WRk4lBT8yiCJV32eEMDs=; b=kKs6NnNWHtfUPvFsRUitGYjtWGivR/1phAFAfeWGT+vHjAK2I8sAqL/Vi81+hMYs95XyiI2hrTlOx1Eyw+gIh6LMuvFMUq2tvAQep51j8GmKOkrRnQ1QVkIjVZxLdiPqcPFywW1eXCMil6l15tPImH9QIZkTKeKHO6eJFFCU/c7QvuRPv+fZzN2ZbLqj7zezNLlEFxgRb1xbtRj+g8FKp9VstzHTuqZAB3vmNCAZZIsxDPMOgDAvsFemWrZWyHT7gPAd5K+Da9Ktu8UsB8EB5y4ULZ1zH42YOm6pMJyov1MhSYzngsJmzDixET+P5tHJa+v4X9B0DqCnw0lP3F58RQ== 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=GElZCByPklEnoQ8Cdo2ms75WRk4lBT8yiCJV32eEMDs=; b=HXKvEoFZ+DmgbaEwvrEPUdzvSarppuPxF9Ylc5IqxVATXZ52Hw2+jZdhXP/xC0ZoEZWVvrAUq3Nu1cnSpjpCz4axCJq0AjCSAftP/zQGWikn23w/i/b3dyhqvzeTmAG6rciZwxDBLNpbDdt1VrqpNXWGQlVYXjuaBnpGAPkFf9A= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SN6PR11MB2750.namprd11.prod.outlook.com (2603:10b6:805:54::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.25; Tue, 26 May 2020 17:18:57 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::c504:2d66:a8f7:2336]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::c504:2d66:a8f7:2336%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 17:18:57 +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 10/10] staging: wfx: allow to run nl80211 vendor commands with 'iw' Date: Tue, 26 May 2020 19:18:21 +0200 Message-Id: <20200526171821.934581-11-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526171821.934581-1-Jerome.Pouiller@silabs.com> References: <20200526171821.934581-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR1PR01CA0007.eurprd01.prod.exchangelabs.com (2603:10a6:102::20) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (2a01:e35:2435:66a0:544b:f17b:7ae8:fb7) by PR1PR01CA0007.eurprd01.prod.exchangelabs.com (2603:10a6:102::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17 via Frontend Transport; Tue, 26 May 2020 17:18:55 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [2a01:e35:2435:66a0:544b:f17b:7ae8:fb7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 469e27ff-2d0a-4bdb-287f-08d80198df6c X-MS-TrafficTypeDiagnostic: SN6PR11MB2750: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:220; X-Forefront-PRVS: 041517DFAB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 36udSgpgpoOqIZ8zH9GZ+plAMD9dD8KsbqJkbww7Iw4e+uCIc4o2VRqncR8JbizYmpvR/r9FetdLJis4sMMBK/v0nkplhQehpOx89JttHNwrUU2ZMLjqfKepPDOzx2PiaJJhkvUGDWPljLNC7Aec1g+BL0PdwnEFpUGPQTd6PuS3slPrv4H6a19NEy9lzhtkAu7i4b1PrcFQfWYFbNiNOhmIVnn7Z+HCF1ErTQyyAocId+PO54Bie1CUEplPCE5x2iLXxACKMdxOPSQntwwLoGn1qtXEJ0vHgE68biN2hYgYCP4atCqRfrT5OfjWkJUv X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(396003)(376002)(366004)(39860400002)(136003)(346002)(4326008)(6512007)(316002)(8676002)(8936002)(2616005)(6486002)(2906002)(107886003)(1076003)(86362001)(6666004)(186003)(16526019)(5660300002)(66574014)(36756003)(54906003)(66556008)(478600001)(8886007)(6506007)(66946007)(66476007)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: eW0X11/5NdJVp/L4tPsi5E49ykg/A4QckvE3A9nCGKT2P4aDXu6pzFOAneEH9IDSaXSKJsJDnSJXRTg2TxxNHkDTKd21kD0LKlHj0W6KhNfgqv+qh2A3Pj1UBFL964NIPXKd4bYSZQ+KiQcxR9c4nInOmSN++ic2oJlth1LtxCjY1L6gbv3tZ7veHsmhn7kFLBDPl/6fA9LomakmHds0vrJ8cRVuzfjcMbHWR5Ij/LpA86H7Dvdwvzs4l0ELzjnRDE5105LWzfERdshGxirwdQY7/hU+HKyyW759CMPQfu4SHvNLmyXHF8Xf+pSBub75+zibUyf/v4PCg21lTS46Ng0aFv4U8Z0iAwyyS93zQmjsIrEDzU/1yyXJ6E0W3V5hk66ZqRKJOR59oYvhyWIzBTd2UmCToChhotg6+fo1louMHgAOCt90rirKOdtCW82xkp0GmyCF9+RWG4V/shv3VYAV3puH4foOGd591X2EMp5AqVZXlG2Nxh23VBxUzX7DeqHX/tPGnCmJk/iuL+opsaLkBLR9p+Y69i3pNS6BA54= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 469e27ff-2d0a-4bdb-287f-08d80198df6c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 17:18:56.9508 (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: QS6X02ty43r+ZuKDqxZ7ukRsJnf6Zf6CT41EZyDxkfDUCENdsCjmPp5wnGT07rkbuOpGOJVelJA1rOwqsGF4Bg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2750 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller In current code, the nl80211 vendor extensions provided by the driver use the new API[1]. It requires to pack the netlink attributes into a NLA_NESTED. Unfortunately, it is not the way the command 'iw vendor' works. This patch, add extra vendor commands that can be called with 'iw vendor'. [1] see commit 901bb989185516 ("nl80211: require and validate vendor command policy") Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/nl80211_vendor.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/staging/wfx/nl80211_vendor.h b/drivers/staging/wfx/nl80211_vendor.h index 0ff3bf73f0ad3..b805b4aa951a0 100644 --- a/drivers/staging/wfx/nl80211_vendor.h +++ b/drivers/staging/wfx/nl80211_vendor.h @@ -23,8 +23,11 @@ int wfx_nl_pta_params(struct wiphy *wiphy, struct wireless_dev *widev, enum { WFX_NL80211_SUBCMD_PS_TIMEOUT = 0x10, + WFX_NL80211_SUBCMD_PS_TIMEOUT_COMPAT = 0x11, WFX_NL80211_SUBCMD_BURN_PREVENT_ROLLBACK = 0x20, + WFX_NL80211_SUBCMD_BURN_PREVENT_ROLLBACK_COMPAT = 0x21, WFX_NL80211_SUBCMD_PTA_PARMS = 0x30, + WFX_NL80211_SUBCMD_PTA_PARMS_COMPAT = 0x31, }; enum { @@ -53,18 +56,37 @@ static const struct wiphy_vendor_command wfx_nl80211_vendor_commands[] = { .policy = wfx_nl_policy, .doit = wfx_nl_ps_timeout, .maxattr = WFX_NL80211_ATTR_MAX - 1, + }, { + // Compat with iw + .info.vendor_id = WFX_NL80211_ID, + .info.subcmd = WFX_NL80211_SUBCMD_PS_TIMEOUT_COMPAT, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV, + .policy = VENDOR_CMD_RAW_DATA, + .doit = wfx_nl_ps_timeout, }, { .info.vendor_id = WFX_NL80211_ID, .info.subcmd = WFX_NL80211_SUBCMD_BURN_PREVENT_ROLLBACK, .policy = wfx_nl_policy, .doit = wfx_nl_burn_antirollback, .maxattr = WFX_NL80211_ATTR_MAX - 1, + }, { + // Compat with iw + .info.vendor_id = WFX_NL80211_ID, + .info.subcmd = WFX_NL80211_SUBCMD_BURN_PREVENT_ROLLBACK_COMPAT, + .policy = VENDOR_CMD_RAW_DATA, + .doit = wfx_nl_burn_antirollback, }, { .info.vendor_id = WFX_NL80211_ID, .info.subcmd = WFX_NL80211_SUBCMD_PTA_PARMS, .policy = wfx_nl_policy, .doit = wfx_nl_pta_params, .maxattr = WFX_NL80211_ATTR_MAX - 1, + }, { + // Compat with iw + .info.vendor_id = WFX_NL80211_ID, + .info.subcmd = WFX_NL80211_SUBCMD_PTA_PARMS_COMPAT, + .policy = VENDOR_CMD_RAW_DATA, + .doit = wfx_nl_pta_params, }, };