From patchwork Tue Aug 25 08:58: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: 261978 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=-11.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, RCVD_ILLEGAL_IP, 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 61D18C433E4 for ; Tue, 25 Aug 2020 08:59:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 333A02071E for ; Tue, 25 Aug 2020 08:59:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="XhaglZ1b" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729484AbgHYI7D (ORCPT ); Tue, 25 Aug 2020 04:59:03 -0400 Received: from mail-bn8nam11on2079.outbound.protection.outlook.com ([40.107.236.79]:20448 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728033AbgHYI7B (ORCPT ); Tue, 25 Aug 2020 04:59:01 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UFSQVmTRjNq9WIa7CbjmsdUXnqVPnI6EPaksGiR/I/jAKOAriAJoTe7MyolFEKOb8dmrbymp/qZiNejCxozrlYgSaNXj3LjKHP7ocs0IzvwYOlMUUzYK+rdRTiVZusCT26kwP3WWo1PdjM3eLJKd7ck5dR0JfhMBhPg4Jzo6z8Bgdj5zyYT+AaJ8D/nwkNVCamZQbgR5Dv4GFfBELTUxxHHAWhS9V1SpAz0DKGP7OqcxyE4gQQwTVogTNPxpWvO5iSHnnPnw6N/+e1sEoZ6C78g8Z11mwQ+3fXvJokzd0ZacFBc4uTRG3axoMrQNhSJo39HFkXIroSkEVSkC5gYtaw== 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=HulzlNPJ0vKnS1DE7gqTcXMUbsJBNAI5ANqEA6+6cIk=; b=JydQ2SDLMqTSE0de6Wt2u/ATEuITEIvWYDGec88YgkGj35w1bYssk3fSmEvTZzGiEJ0JmjLjFUOOKfZajWGu1c0iTogB/tChzXhhch6KaS9WXC5dZWqrQHVQCGxptE6wo4Ei3C+Zh4FNFQOGRuiynzRqbwbjR8JVWaSU3RG8zZ0iW04Iyn1epnIl81HwXZA+ekJfI7cpMBvzsdlRBhQLgHlHrpYpGuXsGErzVqORtbFOYLOHrNUKxyHFCW+IY04/P90iBSLAEF1ZiXgbRdbL6Mo/dPnPBrvR85H0gOaeTWUzMOv4UWuDwhqWTKopFLLodVa8/DOHFLeUZkiStBh07w== 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=HulzlNPJ0vKnS1DE7gqTcXMUbsJBNAI5ANqEA6+6cIk=; b=XhaglZ1b1LnajPC67+tFTxcTu00bl0N7NvUJfH1r5IZ8jCBTAQCLu5QI59Nt9yvCDo8x4TAPTzECucCdyb1Zeb8B4Vk21Ag7DrpOWGjXbdfVIk6xHBRcYGlyJiVD5UaAlpMQXo1xr4SiWCF1sv+aEYtgPON2AnYwqUT8K4VqJzI= 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 SN6PR11MB3501.namprd11.prod.outlook.com (2603:10b6:805:d4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.26; Tue, 25 Aug 2020 08:58:55 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6%4]) with mapi id 15.20.3305.026; Tue, 25 Aug 2020 08:58:55 +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 v2 01/12] staging: wfx: fix BA when device is AP and MFP is enabled Date: Tue, 25 Aug 2020 10:58:17 +0200 Message-Id: <20200825085828.399505-1-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.28.0 X-ClientProxiedBy: PR3P192CA0002.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::7) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by PR3P192CA0002.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Tue, 25 Aug 2020 08:58:53 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [37.71.187.125] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2fa8b919-00df-4385-9d65-08d848d51878 X-MS-TrafficTypeDiagnostic: SN6PR11MB3501: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XWFS3VFJRNLi4sYpO2lOw4akxNPDR9r1ovaOWlH1Z+JQt/4HNv5g3i1qy4QEYb4EIbgzgov7Jf4rR2E+zfdWxRsEDGY57JrqaYAvxvUwwVIricTVTpzbDJ9gN5wi1B6xsVoehRsLhhU3E8Yhuhzi3aZmWacbQWbbDHNbX/r3oOhxSCjgC0UM5hCZlKwn1fJbCnlkN7ZCdE397bohtz9IqpzClCTHeniTnUqzWTUF35BFYnpG3OnTBTdQOcTVjfxInSXgLvCjRSIGPHSilaay6lWj7SRhAZsnscEdklhUW8NTyvVlAk/RFoZUt03kZCMqjlK723jAuGzItJNAXP3oCg== 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; SFS:(136003)(39830400003)(396003)(346002)(376002)(366004)(316002)(5660300002)(478600001)(107886003)(1076003)(8936002)(83380400001)(16576012)(956004)(66556008)(66476007)(26005)(2616005)(186003)(8676002)(86362001)(66946007)(6486002)(54906003)(6666004)(36756003)(4326008)(66574015)(2906002)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 5Brjpm2Z62h7oN4411l5CZwDuKYWFQPeYTgB0Q0GLH+lVpkhwNyOOfJs6zLtks8FWrPS81tfUr1e9q+uLWD0Pz4r06A1L2EnRkTBfKZD6sh05xtYdegLBkiIIHxFA6fEG04U5c18DGNMxaDzrvXuqIhgS+/y9rvNFdGQdOBasAzDxSfn/WJ4qOMHUjFtdirRiromcJGNKs0kqObLuf+QHvFny1PvWT69JTfru7od5/1PDkWNmGFvAIN0ooRoxiaDcrdHeYYGoPm2tRspii4rAhL5D2WdK4PEaqAZZaVSF5JUAz58FefIdVbquF7XyANAt1yXTh+LkUXnlSxshXnOviMz8flkHuk4SoKcbej5bmJt4S6hx3/BC3N0To3nyCZt1UFRo+Y/Up5zy1mEQW/o9K6okLVfzg0Vt8LKIoHDh7AMqjj4l5B8vm6T3B19YmkGlE/Vjna4zgkf68Pzw7JRmuaVgyeZobKL//p7kcZwQNeUsRQ5MGzcCJRXzb6ZH95bfZr29XmBBqQHoBXeHjKNRi8Wtxu4hmQccxBDVWnFZcWJnvDLVpZRm4VjnG2BeZK1mLHEo6PZEImut69vx8KU+RlHaxDcN0IBnO9TTZxH/O4qQ/PpST+HcyLQqMFfe8PurcrMJTv3Zrcd/1FDwbUuMw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fa8b919-00df-4385-9d65-08d848d51878 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2020 08:58:55.1095 (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: BhS5+tsNR1gDOZ9E43xmaUrbT4vEWReR9ZAt6pNDVkbO9kvghjBB1JeMujzViIP5AuHYWipy00YpomUyFyK+lg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3501 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The protection of the management frames is mainly done by mac80211. However, frames for the management of the BlockAck sessions are directly sent by the device. These frames have to be protected if MFP is in use. So the driver has to pass the MFP configuration to the device. Until now, the BlockAck management frames were completely unprotected whatever the status of the MFP negotiation. So, some devices dropped these frames. The device has two knobs to control the MFP. One global and one per station. Normally, the driver should always enable global MFP. Then it should enable MFP on every station with which MFP was successfully negotiated. Unfortunately, the older firmwares only provide the global control. So, this patch enable global MFP as it is exposed in the beacon. Then it marks every station with which the MFP is effective. Thus, the support for the old firmwares is not so bad. It may only encounter some difficulties to negotiate BA sessions when the local device (the AP) is MFP capable (ieee80211w=1) but the station is not. The only solution for this case is to upgrade the firmware. Signed-off-by: Jérôme Pouiller --- v2: - Check that ptr does not point out of bounds of skb. drivers/staging/wfx/sta.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index ad63332f690c..c31e302d05c9 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -434,7 +434,7 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, wvif->link_id_map |= BIT(sta_priv->link_id); WARN_ON(!sta_priv->link_id); WARN_ON(sta_priv->link_id >= HIF_LINK_ID_MAX); - hif_map_link(wvif, sta->addr, 0, sta_priv->link_id); + hif_map_link(wvif, sta->addr, sta->mfp ? 2 : 0, sta_priv->link_id); return 0; } @@ -474,6 +474,31 @@ static int wfx_upload_ap_templates(struct wfx_vif *wvif) return 0; } +static void wfx_set_mfp_ap(struct wfx_vif *wvif) +{ + struct sk_buff *skb = ieee80211_beacon_get(wvif->wdev->hw, wvif->vif); + const int ieoffset = offsetof(struct ieee80211_mgmt, u.beacon.variable); + const u16 *ptr = (u16 *)cfg80211_find_ie(WLAN_EID_RSN, + skb->data + ieoffset, + skb->len - ieoffset); + const int pairwise_cipher_suite_count_offset = 8 / sizeof(u16); + const int pairwise_cipher_suite_size = 4 / sizeof(u16); + const int akm_suite_size = 4 / sizeof(u16); + + if (ptr) { + ptr += pairwise_cipher_suite_count_offset; + if (WARN_ON(ptr > (u16 *)skb_tail_pointer(skb))) + return; + ptr += 1 + pairwise_cipher_suite_size * *ptr; + if (WARN_ON(ptr > (u16 *)skb_tail_pointer(skb))) + return; + ptr += 1 + akm_suite_size * *ptr; + if (WARN_ON(ptr > (u16 *)skb_tail_pointer(skb))) + return; + hif_set_mfp(wvif, *ptr & BIT(7), *ptr & BIT(6)); + } +} + int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv; @@ -488,6 +513,7 @@ int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ret = hif_start(wvif, &vif->bss_conf, wvif->channel); if (ret > 0) return -EIO; + wfx_set_mfp_ap(wvif); return ret; } From patchwork Tue Aug 25 08:58:20 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: 261977 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=-11.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, RCVD_ILLEGAL_IP, 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 1A096C433DF for ; Tue, 25 Aug 2020 08:59:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0AF92068F for ; Tue, 25 Aug 2020 08:59:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="cnX9shyE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729591AbgHYI7Q (ORCPT ); Tue, 25 Aug 2020 04:59:16 -0400 Received: from mail-dm6nam12on2052.outbound.protection.outlook.com ([40.107.243.52]:53959 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729510AbgHYI7M (ORCPT ); Tue, 25 Aug 2020 04:59:12 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W5oju9XSC/LULpopqARkQKfw2cZ8vgR8ox/9Sb6pQFd0f8b6F60R82T4F07ZGjXhN4gnHvaviPQ7f/CZOS6ZRZ6IxWALm0IiJDxuYCW7al1M0JMXEgQH6gBBeaAkdQhqrx9lSx9yTYl/B1zqFQBNy2CHSxLJ+8qMIfebwYfuO98qDWlZPlNxc0cU5c1w1q1wvm4PC2cCeYROPPLL9hofQqKWlcZZjOxtjuFIy+/c4AAFaaCMWDbw7Rctxy/GujxyA4hl9MpZCoeFFQmDQZJ3jxLnGlhvFpq44W8fdyEsNwJuWgG75CnljomZ3OnKSZCXo17ceJDX0xAp1pNXuZWwBQ== 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=qvHPU1fTvFig2Ymc0rY03r6D4O5Ye4R48U2j5KKlVVI=; b=fADilR4xJrlCYXGnsSZtkOrxBxxLuMjsqfx+46StV+PKunZowa1oCcqhVsIwyFeM2GYrBX6sLEYdSHQpNXFCQn4avBhhQdED+X2wQ+lvkcEfBAuyMZZSt/kVVbqV2bic9TOhjExImbGUcKX/OBvInxAaJ3vKQINnbVAOwqjipvAZgk06RQ20QObqitKOV+PDtB7RptmRusm/4cBNE0Y8Ot93nlhmYEDlPcckUe9lnokcrthZJo3/1xTeaJ6PQw9DWAtPpqBhqu1wPYDP+jXHemYVvp5ZUfjgzB8HlldujdhahR60vB41ne4RBBWZdhVrH9SV9ptAuDgXT7glS+hBxw== 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=qvHPU1fTvFig2Ymc0rY03r6D4O5Ye4R48U2j5KKlVVI=; b=cnX9shyEuif2xdc16BQuQ9a9jKGXkGdBz9jQlXLIE0KMfr85wyUcSiJWXI5lojAIVKawx3ni/fXEbnMOjDDBgfzfAsUWWYUu09WkwEe2Ihj2Um8tVKHtDFzXUrvii++zC5fgxxls/tcyH7b7NUd/jLfj7UGimx5UptnhFMQbH7A= 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 SN6PR11MB3501.namprd11.prod.outlook.com (2603:10b6:805:d4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.26; Tue, 25 Aug 2020 08:59:00 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6%4]) with mapi id 15.20.3305.026; Tue, 25 Aug 2020 08:59: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 v2 04/12] staging: wfx: fix spaces around binary operators Date: Tue, 25 Aug 2020 10:58:20 +0200 Message-Id: <20200825085828.399505-4-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200825085828.399505-1-Jerome.Pouiller@silabs.com> References: <20200825085828.399505-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR3P192CA0002.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::7) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by PR3P192CA0002.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Tue, 25 Aug 2020 08:58:58 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [37.71.187.125] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5abe446b-2fff-4db5-fab3-08d848d51b65 X-MS-TrafficTypeDiagnostic: SN6PR11MB3501: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:241; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uCzpSH+v8YoQRlGrfsHWI38Ow0j+UbJmVMoSKCVwU2I6XilW6U+30BvG0WQmW2+MzscdKiX6031vaB0VCZPY43idkj6Q9DMzZidOeO14P/LJSEuBxUrTRIBhjwwXckuSCztoDxDuOw4tkht7sPbCrcUyyW9Weyro2xomrUI/sdgVCOE/L1RO4IF2xfaLWG78Vsg4iEIDZZ4Up5KCTJryCFIJJz0yPDKKkJNMwaPQ3RL3VQn4NJLOmrJDvQvo6kQHz0Mzag8WKdFxn4muLC5590dvK6IisTkXvTsUPJlAzVosXl7fxyjpdmHZWR2C1QfcicT+bApIA9SVOQxBcFG4KQ== 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; SFS:(136003)(39830400003)(396003)(346002)(376002)(366004)(316002)(5660300002)(478600001)(107886003)(1076003)(8936002)(83380400001)(16576012)(956004)(66556008)(66476007)(26005)(2616005)(186003)(8676002)(86362001)(66946007)(6486002)(54906003)(6666004)(36756003)(4326008)(2906002)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: etOMb8doo3V9UXRT0FNq3nNKBMBnj2/zB0zpS+JmU4xS10GUeTXGeZE3ucVVvc3eoyWJcxUAHQfWfmlvaLGEjX7npz1yWy++9QBnbYZFOU2BV3CSXMAl+VQYyZKL6Rn/6uVNpU+n5NeH/f3kxB+i0WReWCCEo0MtJXmmFlb53wIdEm24tEt3rXPE6jL+6FwamyLEPbjurXDDQd38GMmDs2iKIqAC+80JSsxhTxX4OEmOYGbMsZev+O1r88lXGtrbObClRjNHuEomdfJDZH7wXJ9CvYuwdryCxw9uRqDHwJdn2bNJOOFK6F9NJUGeON1zQaLSvz/2Z/kn42xVgP0ZvDo73qJfNsLCDG93UjpTJK6CFMzApxXnfgaAFa3e5njwLCcoLMLj6xsP33uuwVgiNuGIP2QB3ZEMbBF6kOPrnALSxZenvVIiW5lZGcvRP2qHxIvIldH5IAL+AcdUYVZNpcFMZTgH7WkjZRvEi1LLvjYXF6fbJXHJEzfzuJz68ucy8cSbyNBSfbFsQwuVdOsp6Io1FuqZ5HLkidnaGq88TXIPCYfT0/DNFqdS3+eAPFJK7gtq//z7ax5dJiDmKGPLO0EclId0RAIHym1t5Jb1fmSKF0ZxZ9YbXdkBxH8MiBIXOH/rHEWAJu5BLB88F5gdHA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5abe446b-2fff-4db5-fab3-08d848d51b65 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2020 08:58:59.9626 (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: R0lUTv2YSevXcpxhWvp+JjpBLCEApxe7vKtfNEOUQ5h67DF84ZdrFZ9T6JcigSgdgAZO1RuOVvsfOYav9r+R5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3501 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller A binary operator should be followed by exactly one space. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/key.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/key.c b/drivers/staging/wfx/key.c index 5ee2ffc5f935..6165df59ecf9 100644 --- a/drivers/staging/wfx/key.c +++ b/drivers/staging/wfx/key.c @@ -171,7 +171,7 @@ static int wfx_add_key(struct wfx_vif *wvif, struct ieee80211_sta *sta, k.int_id = wvif->id; k.entry_index = idx; if (key->cipher == WLAN_CIPHER_SUITE_WEP40 || - key->cipher == WLAN_CIPHER_SUITE_WEP104) { + key->cipher == WLAN_CIPHER_SUITE_WEP104) { if (pairwise) k.type = fill_wep_pair(&k.key.wep_pairwise_key, key, sta->addr); @@ -191,13 +191,13 @@ static int wfx_add_key(struct wfx_vif *wvif, struct ieee80211_sta *sta, else k.type = fill_ccmp_group(&k.key.aes_group_key, key, &seq); - } else if (key->cipher == WLAN_CIPHER_SUITE_SMS4) { + } else if (key->cipher == WLAN_CIPHER_SUITE_SMS4) { if (pairwise) k.type = fill_sms4_pair(&k.key.wapi_pairwise_key, key, sta->addr); else k.type = fill_sms4_group(&k.key.wapi_group_key, key); - } else if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC) { + } else if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC) { k.type = fill_aes_cmac_group(&k.key.igtk_group_key, key, &seq); } else { From patchwork Tue Aug 25 08:58:23 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: 261976 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=-11.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, RCVD_ILLEGAL_IP, 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 D1ABEC433E3 for ; Tue, 25 Aug 2020 08:59:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A19D52068F for ; Tue, 25 Aug 2020 08:59:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Q5Ta75Ig" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729665AbgHYI7e (ORCPT ); Tue, 25 Aug 2020 04:59:34 -0400 Received: from mail-dm6nam12on2052.outbound.protection.outlook.com ([40.107.243.52]:53959 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729625AbgHYI70 (ORCPT ); Tue, 25 Aug 2020 04:59:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P133iMKGyBAAGSzjVKpJWuNJfRNlnUCZzxCZr50dqmBuJjVylxhKP6U51OLf2uEqkvNngGQUv0PvbZ3MTgKx/wjsYg7KD0qJH5GwtUlTaGIErqLkos0JcPPpMBi36SfR8eHrYV/0k4MSdB82cJ4cM8f99keKqYfOwyhsZyQiTn+dBvpWS5LwTSwWVhdDm+kvSQrgoMkJtjRjhji3NOG1aa3IDXEIj6ON0CpM26sAGyFBd0NONBmcfS8L/zu7U3RY6qQOx5mwwS8Q/NP9XFrvV7grdLOORDjqDQYWawhp3crSP+VOQdumAIPmTGXdCuY3cVWMistnnEP7fx7OMsQfKQ== 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=ak4CIZP3dcXMGBZZ3ut14GrlVvZym3fnk37czMeMAyQ=; b=L2I793BUaPgLE6TlK32IlhUVc/3WuooDAvMUYdAxzl+NLaIBvlMOaDDxVXN1OYdjHWHlNdmPRFy5Hw2i/gApRsCsXcVHL/kZYR0AH24Ig+1TEpz4RCdvUu8tcLabWxTECmprBfaZixVJYl2mXJXd5kifcr9iPb3wtSzuobEy6Q467VAtheAF2M9zk0fPZaGZHbHk361fs8uTJmFmOO220nGeDlVPqBDfi3aRyaNqqC+gOXXnU6fLIUDpcmHKkgYP1h8OnFrYnXcNehvTDOYpPvm4SnFfyT0jdAcoDc6CGHKVf/c0d6PPftA3q8W2nD78X3m8Nnn77ArsQ9bg4Mz2tQ== 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=ak4CIZP3dcXMGBZZ3ut14GrlVvZym3fnk37czMeMAyQ=; b=Q5Ta75IgwuVQ+ggtrjFMPnCf9lmCTqSrAOq3M89X/9dy8c6KpdCk2qvr0Ppl3W/kYAjZA2lfhrmdGgarrSRUsCPejhyjR0yKi0qEwmCYGZRsJNSDJJx9UE9kYqg5AsJGbUX1P95cD0oYfV5JkfCez/L8lgwx5pzQU38lUzU6P6c= 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 SN6PR11MB3501.namprd11.prod.outlook.com (2603:10b6:805:d4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.26; Tue, 25 Aug 2020 08:59:05 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6%4]) with mapi id 15.20.3305.026; Tue, 25 Aug 2020 08:59:05 +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 v2 07/12] staging: wfx: fix frame reordering Date: Tue, 25 Aug 2020 10:58:23 +0200 Message-Id: <20200825085828.399505-7-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200825085828.399505-1-Jerome.Pouiller@silabs.com> References: <20200825085828.399505-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR3P192CA0002.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::7) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by PR3P192CA0002.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Tue, 25 Aug 2020 08:59:03 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [37.71.187.125] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 685e85d7-6b4e-4dff-a041-08d848d51e67 X-MS-TrafficTypeDiagnostic: SN6PR11MB3501: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5grI8A8nErTT8v+2rGva5D4u9oNlxTz1oH52QZzsMZSWEodEnAMPx7NKkzgtmGy1Um7U/QfLTPcE1xAHWhgRqMU162dgqTtQ4ptBExC50KyLFmo33WQvui+TbUwbxe7na1z0NcSAx8ert+nSrEFdmqqE70ZFOoKp5zeogv533Di2GdCRpxRMp/mc6CcPrdiBKb9fM9B8cYEnCHC6soBeYqwFK3gbqIC0lr9Mj6ULs9XO1DjUE+eonVfgNS1I1JOBcumcT+9YLSkyehibV50xSVwiXcL/8/0wFr5KLHloY58vraFJC87ly5YrVTKK+QYE 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; SFS:(136003)(39830400003)(396003)(346002)(376002)(366004)(316002)(5660300002)(478600001)(107886003)(1076003)(8936002)(83380400001)(16576012)(956004)(66556008)(66476007)(26005)(2616005)(186003)(8676002)(86362001)(66946007)(6486002)(54906003)(6666004)(36756003)(4326008)(66574015)(2906002)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: HEX90+GxvWi+q6E3CLX7aTrARVmx4U2sZHF/2NaorXVCZ1GYfqq6Qo4ShLt5grKwtVHzePvL0GlXFKq/L2eUTJoIL0iayXWH/MwoygtVtdrgzUdKbQDQuT+iRcMwSeoraX8I2n3wwYapar5QVpeVj+n7ECvoTt+Bvtll3YC8ge+MLCJqAgSQT5J3avW4uwhUL03FH9Z6oS4GgvCF+jK1XPcL6bRNkosW+CVGJQshEzad8uXTtM5iH4CAz/iKTak8b8efyEWKxZwKiUDZ4NePa0ia+QH2g6WsbRM1gepGGbpt3RVlax9FV7LPhb9DEO5QvUlFXLSQHqaPmy4iyt8KRU4/ej3mH6VmnG9nKwqTxEqD8tsJ/DxchJux/hx+rZ8sQD84uvU4bthSrMHawR30jvETWrlCTWmNW8OrVOY8pk06f3UyEgxIXrnF76n+SjKyASUi56x1XbVbcBtOIhStID63cv42wJf3v+qjPQBrw1wk/MwLJG8mvYgPhJGS/vAHShpyg5TuiujrpYI9VLiByIrLKIrk9y3QL0L7+Xg06RUQt/DXYnF2G76D57/2zyLNW73aH1CebGQNT90xRqERvJG0+sfDLUIIQ+qYAHa1lhnw5j5udqvlKSYBjjQZA1lwJtLIed/jTTGUuvxOKttpPw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 685e85d7-6b4e-4dff-a041-08d848d51e67 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2020 08:59:05.1085 (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: gWY9Cj0sDgrWvz1gNnX5P08csWHUAvZVnz0j+wPWzIZoiWwe6XYFZOGpvo/Fcjx8A8gl4DjY9CBrR/XsPVMOYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3501 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller When mac80211 debug is enabled, the trace below appears: [60744.340037] wlan0: Rx A-MPDU request on aa:bb:cc:97:60:24 tid 0 result -524 This imply that ___ieee80211_start_rx_ba_session will prematurely exit and frame reordering won't be enabled. Fixes: e5da5fbd77411 ("staging: wfx: fix CCMP/TKIP replay protection") Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 2b848b8985df..7a4c9f63c4a2 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -680,15 +680,16 @@ int wfx_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_ampdu_params *params) { - /* Aggregation is implemented fully in firmware, - * including block ack negotiation. Do not allow - * mac80211 stack to do anything: it interferes with - * the firmware. - */ - - /* Note that we still need this function stubbed. */ - - return -ENOTSUPP; + // Aggregation is implemented fully in firmware + switch (params->action) { + case IEEE80211_AMPDU_RX_START: + case IEEE80211_AMPDU_RX_STOP: + // Just acknowledge it to enable frame re-ordering + return 0; + default: + // Leave the firmware doing its business for tx aggregation + return -ENOTSUPP; + } } int wfx_add_chanctx(struct ieee80211_hw *hw, From patchwork Tue Aug 25 08:58:24 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: 261974 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=-11.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, RCVD_ILLEGAL_IP, 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 9CE96C433E1 for ; Tue, 25 Aug 2020 09:00:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B7792067C for ; Tue, 25 Aug 2020 09:00:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="dCygFhYQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729699AbgHYI7t (ORCPT ); Tue, 25 Aug 2020 04:59:49 -0400 Received: from mail-dm6nam12on2052.outbound.protection.outlook.com ([40.107.243.52]:53959 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729646AbgHYI7b (ORCPT ); Tue, 25 Aug 2020 04:59:31 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XCVwmowTOOdBcrCMXMsAHGnXXJ9Z9PcZmPu2VXiIKbd4FwHqLIh5xooEetipioHhDkDtVIZZkduE//FP2AQPGkUcF3HNzmsnZx84HtDzlSckvw9FUggfk9sS3HnZ6XobNRIsWm+aMPFXDw86zwqj8byWPYqLkurYcVW9qvoJeB+RT59t7H7VVEmE7dMR/EC3FGdkmqMeTCqbaHw6eoSZdeRjbtC6dR5NQsPrCkPnKKzaqRwaJRVenqcTOvF8V3Ok1YDiaXGDA9oNF6gOw/vYh7FdqEDjCvI5sARYj7iZRFPfgzTFMFEdwQUwADe5acxKJg8cYBkdqUEhcg/DmIp81A== 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=vUCfAVxEEjw5fe6klsi9DKE0qPl2IHDqTZNcYCPBzxQ=; b=XfI3s2RnNLYEVlNoUiT58SbAsJY7SMLYxpAu08aw54Yy+BfEHSeNxoxAWhPSif8JtX3C9pArUb8tp1DPxvB+zTdVm8USusxueEJ19e49U9YvqwIrnesBnwlZD71Gk3mhG3+/NIk402l1FzhTQYmTp8MXAK1245tqbjL7c9CZweHHdZVYiBPj+SP5EMrBPdJckrYgqhD6p31/SpnDB+mi+xBJ5CYTKtNevJJ5Xh1GLbyJ2Jlne9KnbEfVI8rMwRJVYIOVH3vw4nhCH4g0s1x+2XQWaSY7oq3GtbVG3iPeHrY7oo6xOtE5cqzRwwyv7J2+RDGR9Cp2f5KFjtlIcOOn1w== 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=vUCfAVxEEjw5fe6klsi9DKE0qPl2IHDqTZNcYCPBzxQ=; b=dCygFhYQ2C/qUcqC8Xhf34BNtyDqieAq6L4DqAy7SAUmOaHZIuM5yRMuH2nilwW1eLp/ZVDGuCbrsbyDFW2DOtY8WEysAMNL3Ce6+SKw2RTsIhqQNMJy8Y3cJH0D2URWo1iRp5JGvEVFdnwk4jhDToPRgHr7bcTJwBEvkCCzRE8= 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 SN6PR11MB3501.namprd11.prod.outlook.com (2603:10b6:805:d4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.26; Tue, 25 Aug 2020 08:59:07 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6%4]) with mapi id 15.20.3305.026; Tue, 25 Aug 2020 08:59: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 v2 08/12] staging: wfx: fix potential use before init Date: Tue, 25 Aug 2020 10:58:24 +0200 Message-Id: <20200825085828.399505-8-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200825085828.399505-1-Jerome.Pouiller@silabs.com> References: <20200825085828.399505-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR3P192CA0002.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::7) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by PR3P192CA0002.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Tue, 25 Aug 2020 08:59:05 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [37.71.187.125] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 95f51a34-5838-43f9-974f-08d848d51f81 X-MS-TrafficTypeDiagnostic: SN6PR11MB3501: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: snfEWsImJyio9guHSCrMeH3/FFsoJvuwpe5rgKjIJ3DdQ1eNj/XLUus+Xg7+mbJPNtXn/BjZPArv4PmZ2gCzkU3GvezwFZuuaIKqsyO9HvQ7gUTmX4kKR+Xs1/8ifdUKEdp/bbjYJZ/YrRt8lYvCB2q8TZePUMKDdcdSe10R23v8WjD905sBGqFLSFH29fBUtm0YCWSfzezdpobBBXYJwoLfTwp/i+rTEuomFEwuLu4S4ZjJaNgnjY5V+fvU9WR0Rm0bPeJO7swQo+XUVWTWl1YG5rVRD0Spddk+r2csxT1yTD6Gfo66rjZRVvgc90h4 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; SFS:(136003)(39830400003)(396003)(346002)(376002)(366004)(316002)(5660300002)(478600001)(107886003)(1076003)(8936002)(83380400001)(16576012)(956004)(66556008)(66476007)(26005)(2616005)(186003)(8676002)(86362001)(66946007)(6486002)(54906003)(6666004)(36756003)(4326008)(66574015)(2906002)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 0dqNlV+XaIcVSytfSddL+5by+dPs2xeuzAwaGvRp8079faLgCmy22s4AUaverMnIyuaevCsSCnydcB555HtFuD7QcTBEwl04DrDqkRJ27T7pgvoMAcYNgsIuYU46/OuxnpK5hs7np43KSr6+465QxjxVwqJe3dVoe9Dlje8KhUzErUBZw4KY0HhtjX9rsacsFGD/QeRmhKUZWKXDu71jnijxb2MkirROFDaUlmYGpXMGXkv0I+aBXGaYwZtzE/OAEYGUdNfyt8IGlxxA1DUDHqExw9c6TIQ/Fvn+0c8Brto8IylPsZXab+0MpSiC04VJuhFjtaKBJkzS6mEeJ3J7SSl7EP2mOU07vn6nqUrQTbrYHLOmSe++SKJ4S3J17plz8eanDUe7mLfK6VnwbJqLlyDVj9eV0mzq8c5lCskIdMKTG+L1ga/swhSPzMcz8EQ9A6n2/+Dkpotb+cUDQMUvAU4zHxJiIuJqxgqlzXh34Y1gDVBhZdRhMh5oerqlZNPzU48+xzNX9+uoP2N7FlOiualShAxYMltIW4XeehMIhNSZBbztePV4xz1VwiKAR9HZyoOC2I/uI0ScT5kWTWvHN0EcjfM+wld0eZfzW+dYG57Dw6G3Zmoj8toYu8iRpn6CE7NfANmpZQDwxJHV65vRQw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95f51a34-5838-43f9-974f-08d848d51f81 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2020 08:59:06.9793 (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: w321RENZLfi7gXx7jtMjs+Q+SLxRsZPM6coviv02wjPJ6aFIFKCzJ5YyQABXLpct06+4XtoEoLue59bvY50Q3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3501 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The trace below can appear: [83613.832200] INFO: trying to register non-static key. [83613.837248] the code is fine but needs lockdep annotation. [83613.842808] turning off the locking correctness validator. [83613.848375] CPU: 3 PID: 141 Comm: kworker/3:2H Tainted: G O 5.6.13-silabs15 #2 [83613.857019] Hardware name: BCM2835 [83613.860605] Workqueue: events_highpri bh_work [wfx] [83613.865552] Backtrace: [83613.868041] [] (dump_backtrace) from [] (show_stack+0x20/0x24) [83613.881463] [] (show_stack) from [] (dump_stack+0xe8/0x114) [83613.888882] [] (dump_stack) from [] (register_lock_class+0x748/0x768) [83613.905035] [] (register_lock_class) from [] (__lock_acquire+0x88/0x13dc) [83613.924192] [] (__lock_acquire) from [] (lock_acquire+0xe8/0x274) [83613.942644] [] (lock_acquire) from [] (_raw_spin_lock_irqsave+0x58/0x6c) [83613.961714] [] (_raw_spin_lock_irqsave) from [] (skb_dequeue+0x24/0x78) [83613.974967] [] (skb_dequeue) from [] (wfx_tx_queues_get+0x96c/0x1294 [wfx]) [83613.989728] [] (wfx_tx_queues_get [wfx]) from [] (bh_work+0x454/0x26d8 [wfx]) [83614.009337] [] (bh_work [wfx]) from [] (process_one_work+0x23c/0x7ec) [83614.028141] [] (process_one_work) from [] (worker_thread+0x4c/0x55c) [83614.046861] [] (worker_thread) from [] (kthread+0x138/0x168) [83614.064876] [] (kthread) from [] (ret_from_fork+0x14/0x20) [83614.072200] Exception stack(0xecad3fb0 to 0xecad3ff8) [83614.077323] 3fa0: 00000000 00000000 00000000 00000000 [83614.085620] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [83614.093914] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 Indeed, the code of wfx_add_interface() shows that the interface is enabled to early. So, the spinlock associated with some skb_queue may not yet initialized when wfx_tx_queues_get() is called. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 7a4c9f63c4a2..a890fe32161c 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -759,17 +759,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) return -EOPNOTSUPP; } - for (i = 0; i < ARRAY_SIZE(wdev->vif); i++) { - if (!wdev->vif[i]) { - wdev->vif[i] = vif; - wvif->id = i; - break; - } - } - if (i == ARRAY_SIZE(wdev->vif)) { - mutex_unlock(&wdev->conf_mutex); - return -EOPNOTSUPP; - } // FIXME: prefer use of container_of() to get vif wvif->vif = vif; wvif->wdev = wdev; @@ -786,12 +775,22 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) init_completion(&wvif->scan_complete); INIT_WORK(&wvif->scan_work, wfx_hw_scan_work); - mutex_unlock(&wdev->conf_mutex); - - hif_set_macaddr(wvif, vif->addr); - wfx_tx_queues_init(wvif); wfx_tx_policy_init(wvif); + + for (i = 0; i < ARRAY_SIZE(wdev->vif); i++) { + if (!wdev->vif[i]) { + wdev->vif[i] = vif; + wvif->id = i; + break; + } + } + WARN(i == ARRAY_SIZE(wdev->vif), "try to instantiate more vif than supported"); + + hif_set_macaddr(wvif, vif->addr); + + mutex_unlock(&wdev->conf_mutex); + wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { // Combo mode does not support Block Acks. We can re-enable them @@ -823,6 +822,7 @@ void wfx_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) wvif->vif = NULL; mutex_unlock(&wdev->conf_mutex); + wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { // Combo mode does not support Block Acks. We can re-enable them From patchwork Tue Aug 25 08:58:25 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: 261973 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=-11.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, RCVD_ILLEGAL_IP, 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 43C36C433DF for ; Tue, 25 Aug 2020 09:00:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 184092067C for ; Tue, 25 Aug 2020 09:00: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="I93WFmi1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729121AbgHYJAi (ORCPT ); Tue, 25 Aug 2020 05:00:38 -0400 Received: from mail-dm6nam12on2052.outbound.protection.outlook.com ([40.107.243.52]:53959 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729648AbgHYI7o (ORCPT ); Tue, 25 Aug 2020 04:59:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Me4DxsiUxQmHgjT+of1CMTTTsRa1fiqFe0bfsEaHdvyxCjoywtbfTLapY5PLqK+fJVNfSDtiEskKsonWAgSLXFyjjQfZrMOBhQfJtEivzZ8nGmgTZeg2kyQ9MU6/rOFrtsK09UTWYlE8kLXO4vVbHIQiHzuoh/6/1VHb3YL7+K3DIyDlabYxPXeMeC3FuHpNuldcAGYTqN6o07xbhErqMSMDEPPUqfgB0ecTbpEGcimQGgj8OVr0D4OC7YVEyk6or7NCjQwcI+a0aBTam0RMeP3rSMfo2U8TPYmBMnepz8O3hY/kXwUsXFZBu1u3tw/rZrcOcymYu/KDt0Nl670MOg== 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=UpyoGU4FzcSEiHvu1sHhSwYfCgw6bHk1zKFXGBQ+uEE=; b=HsvL18Srt9jBf/GKDug+aWTPRRAkyJdW1GS1g6AwqKXUiJ5DfkuNq4tqyCBUK2QYqhUSstKbb6oL7HhUd7zT3eshfzv3lFZ2/BKJ61a7sXOs8UoCCKaxFzyUjedKgDQec4MXs1BODyte2AKGCYI3yDuFIRYQlxePjVkpEnrECOJEmcQvg5yawYKSsdT/cWv9KG1f/LnvkU+DRxR5r1R3QkLb8Xr4GKytEkLDKGUrYQH62GooQJOhhSYOVGgrPHKRRju37CahiDveRgPALZvzXhIY0t+BVtjJ0Gxkt+6Fu8UuA/FcMW5FCneM+L9aTBGv9pD6LOi8sJn1qlpUEqnRmQ== 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=UpyoGU4FzcSEiHvu1sHhSwYfCgw6bHk1zKFXGBQ+uEE=; b=I93WFmi1xx5FxS6L9Nmi9K9P2dO9YKG4Lmigb4r/ToQAkorgFbee2uJ+cRZvYjqA1TAU1YsqFyfk1BChzyqy3fk5hdG3e0hei1ayC+ScTYunm7gD1bqolxrM0FD+vmuk55oGI1p/U/LXzbMkSOqrsfQ2ko6Ud0yCR4xG78UKFJU= 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 SN6PR11MB3501.namprd11.prod.outlook.com (2603:10b6:805:d4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.26; Tue, 25 Aug 2020 08:59:08 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6%4]) with mapi id 15.20.3305.026; Tue, 25 Aug 2020 08:59:08 +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 v2 09/12] staging: wfx: scan while AP is supported Date: Tue, 25 Aug 2020 10:58:25 +0200 Message-Id: <20200825085828.399505-9-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200825085828.399505-1-Jerome.Pouiller@silabs.com> References: <20200825085828.399505-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR3P192CA0002.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::7) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by PR3P192CA0002.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Tue, 25 Aug 2020 08:59:07 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [37.71.187.125] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bb83dc8e-ebb7-4844-11ac-08d848d5208d X-MS-TrafficTypeDiagnostic: SN6PR11MB3501: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:901; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lubL0CajL2PuEkctUBhWb63qwCy1VsAkX7PSl/ipDLHIc6SPhdU4v1TyBBQCl22U6yS81ZV1Yckfnf/K4/omLNpbAkHMPRaWYMNGTOtJBboPMJOLjNmHAAUknq79s7IVVJhKdInxfpoXEzJhzp0V8pPXPR0vZdQ+WqMvlZYlMR+vJdn38Oa2d3o+5l+DhJ//9uhHd3+f7RnQi75BZIcI9tsx6KFRqavZASzvNFKEcS/RAPziC62aojDikcro5JiNh1dQlp8Hr64hq0DZNq7VwT7NLynrKcKoFvaZQ2xyYwetnT1U0LvjwNq/G3K3kA1yrJwhSubdmmU+L2o3a1JczQ== 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; SFS:(136003)(39840400004)(396003)(346002)(376002)(366004)(316002)(5660300002)(478600001)(107886003)(1076003)(8936002)(83380400001)(16576012)(956004)(66556008)(66476007)(26005)(2616005)(186003)(8676002)(86362001)(66946007)(6486002)(54906003)(6666004)(36756003)(4326008)(66574015)(2906002)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Jmb0Nse3aCxOW+60unnb7Q0FERusZ43oSKAU+3iHk/u93LvrQr5sSvITaeyH9LGhf7EhBF3CdmKJiKESkbTSb+trON8MdBG3+ef1BV5bydp3Me/CJK5vhGn2pJ+8ApoUigwERdccOT8Vk3a+7nT8d/Q+3LHe3f6dSMBKLgOuefluayJsRof0zW0s8gsC1RahnR69Z8Pr8/5oHdX7s8LFWhJIMqAzT+8Ov/oXh1NWc+FiL8HUtdpdBgEqU01ijX6fR5FVFs/GK057sQ3qnzq4Blg0xeKcE4nteqLH01WOkrS3+hBgIGBOi4pegSdcH+VrpmUZrj1cgOP/GbNaVggbltd6EJY6eip1FZV/7SFwQUBkvtn1nzTLnz11tB3Tsti446cNJzYToghrCD1Qz/NdgqVPudbenkOKyrQ9Lz744pJbfZsRt4HW+vMj5Eq5gEP6qH6+URSDAb2AACtbZcd1cu7BoxLFqKdrrJfoTE60Yy1v/kbmLRpjV6wugtIlimsHW/uEA7e55ajDBMzUA40boTMSq+8WNOwCQoxHPQ15rYuNxzdnaaVfr1SusYt1nrrGxTFyn0V2MfdfEb5xtY5n2PpXwx8WUUNp9VTJGN9dXdA5h4GaKd9qyl3c2IefqOQLeSDOOmYAmf5zd6tL5Q1EoA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb83dc8e-ebb7-4844-11ac-08d848d5208d X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2020 08:59:08.6453 (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: ZjTlLJ1IaaOpITAeQkdLFnpUgvFZWu50ul8DvN4Ewix594RVm96Wr1RgzuTCP999wX200hrlg2XuDNtzdwnfYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3501 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The device is able to scan while running an Access Point. Just declare it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 1 + drivers/staging/wfx/scan.c | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 4263f912760b..5a3018e14445 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -282,6 +282,7 @@ struct wfx_dev *wfx_init_common(struct device *dev, NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 | NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P | NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U; + hw->wiphy->features |= NL80211_FEATURE_AP_SCAN; hw->wiphy->flags |= WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD; hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index e9de19784865..02d4e653d594 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -113,10 +113,6 @@ int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv; WARN_ON(hw_req->req.n_channels > HIF_API_MAX_NB_CHANNELS); - - if (vif->type == NL80211_IFTYPE_AP) - return -EOPNOTSUPP; - wvif->scan_req = hw_req; schedule_work(&wvif->scan_work); return 0; From patchwork Tue Aug 25 08:58:27 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: 261975 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=-11.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, RCVD_ILLEGAL_IP, 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 8EF5DC433DF for ; Tue, 25 Aug 2020 09:00:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 63BCB2067C for ; Tue, 25 Aug 2020 09:00:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="bg2JSyfs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729725AbgHYI7z (ORCPT ); Tue, 25 Aug 2020 04:59:55 -0400 Received: from mail-dm6nam12on2052.outbound.protection.outlook.com ([40.107.243.52]:53959 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729693AbgHYI7v (ORCPT ); Tue, 25 Aug 2020 04:59:51 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OzPUo7JFBjgAwHnWLGnO+M+H2bwFaJICcWIy/42+mSqCazPd6/AGgMbQJSNYOI6mWS8ie0JXtkTL2vPPAkXaBtOzVfVwKDy/DFXLcOQD7v9InJdwBWnQz4f6iflBp4L4FzZH4gT9Z5c+ileNrJqiu8g/srMbxWgvUbbRsU7szRTwS26Z1JaHEBnOkcguRrjSEWdveINkhCFJrpTwR9aV+NNWvx0sdIWpFwpCZnThF9+H07ovOroUHttQ/wtIt38Gqk4luxE9UtkoGX0fq5BBTMu8eMBbU7WCH++6bMt6vLmPBuah/ZPETNnfAOvGNnCjvmvSBaAMC0FifT26cCasnQ== 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=lDRIEs3gitc7zye2/sfjgYma3wmW5ouz2V8A5vvj2vs=; b=W0YSXeNRHe9dJc0E8JGKUrD/s0sk6fXPGdGfzUQ0+5ctKZcfgcBH9Rxfm7sTz/AUcCUzDuemywSrSTWcMqZvwr1aH9Z9Cce+Yrxxjdnla2DSxs4p+ngKsHKlePhUu7+/meGySvvEpX3n/Z3l/qumOQHA2+JCb100IxOuMdZNPAIkFh6LAAgp4SwWEb7/PwdtWTyvYxpku7fDLRlGqevwAe0zlTZedxhIQJtXPn8Cvlqii4d84Wg8GfpZXBSvFEYdN3c/euLbJMX9OcWy9DHLncdNH07gb4PU1/dMDjVRXlWtBbSiVwYo5u6vtP6uCRJbgZiE1RnCjVit5s1qLcl5Tg== 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=lDRIEs3gitc7zye2/sfjgYma3wmW5ouz2V8A5vvj2vs=; b=bg2JSyfsbG0+BWnpcnGaZvpdyiF6TUcx9UAmFV6odptWty2HoBlcSwbBNApUgUuwVVTWRrGmOBVPboQ3OlwvbQDYMiNOhQvWKnaRFrfIy9b9g2fsnMU3gJkoaSOvimuujRia/U7SGLtzCOCwEHHi0Ia80FbCPj3MALewpqqBhio= 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 SN6PR11MB3501.namprd11.prod.outlook.com (2603:10b6:805:d4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.26; Tue, 25 Aug 2020 08:59:12 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6%4]) with mapi id 15.20.3305.026; Tue, 25 Aug 2020 08:59:12 +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 v2 11/12] staging: wfx: remove useless extra jiffy Date: Tue, 25 Aug 2020 10:58:27 +0200 Message-Id: <20200825085828.399505-11-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200825085828.399505-1-Jerome.Pouiller@silabs.com> References: <20200825085828.399505-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR3P192CA0002.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::7) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by PR3P192CA0002.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Tue, 25 Aug 2020 08:59:10 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [37.71.187.125] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 757b787e-3a00-42e3-967b-08d848d52298 X-MS-TrafficTypeDiagnostic: SN6PR11MB3501: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X8uZLW9gqLwhUkiyv36dSfIUILpicZ52ssfzxePPMoFOwPxSy6Mkd9W8SaQ+TC0jzd6Uvv7OPiLZ4ctYgKgtTZxK6rlApsReFqSTuyVAqRFk54WAhocUuocZT65Z8zgDtjoFiKh738YvML8HYURf+LIOi9t3xdare7PKguao7Ejr79gu41Uy0FIqjSyLsKVQbBqoFGRng1LJMB6cqq0yxbfCCyZ70jJhMhD5D1N8TcuY0bYNf7hQQwbGWuqXD8JvxvjK8Ew239dfRgYWZFmO1rSfvIRjrtrpBff+/cKpjNqLrOjriE6bkbDY3fHQ5HzMqMKpQeqoolys+SSeczmiDw== 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; SFS:(136003)(39840400004)(396003)(346002)(376002)(366004)(316002)(5660300002)(478600001)(107886003)(1076003)(8936002)(4744005)(83380400001)(16576012)(956004)(66556008)(66476007)(26005)(2616005)(186003)(8676002)(86362001)(66946007)(6486002)(54906003)(6666004)(36756003)(4326008)(66574015)(2906002)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: wF8nM5cndzt/Ub2hcClUHL+KKm4ZNZ9lTTCSJfcxvHcLxHZviR14sG6Av/qvBQiCCnAFUZ1/ajJFXvXAnyCEXPLISpwktSPypF8yaJNuJkNhJafKzPzO4tlsUWLelR5dg+kerX73Qfng+2JCobS7FVmjjt/fUM/DQJIdL+llNQTHNozCJanHsG/yGFQtI/zq/UJAYCpeJZ1KZJPHv77eacZVoNkzTkYLGJTkDPqr5Rr4KYs5C0sqhp/CmfHuVbBZG+8IRxkN3KUXnnL96cen7jyLv8W6lKsAtbsb7yfHC+PXO6A5VNHMLEkphHDUs5VIEkt/jU+nMxYWXsyFEi1iQwwFf20nmXXniMohAGSLG/Z2RE5JK8/eSrljyeKgA4jyWfG2JAvdAQd3nwSn1GQoGjFHyLDSGWgtq36lqX0GaesWrSL8o1YVrzgjqWJlQbj4IxsxuYdXaWVsnKoUGc8kSiVz3x+vBftqB5bu+viWh/6cz7Ufu3G/WyS3DHP+epqRDFnBu/+nxsRjXiCXoMX6BGCw7G8B3ko72MV93ixCT2jznYv+cjrtnsZb1uXSoOHblTs7O0uqAm/OEWL73vnh8Bns3ip68SM2rfw86TZAjDtZy2JPAioBZw6hEptZRpHd7QgwISQmrOP/vFPSTaeK8w== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 757b787e-3a00-42e3-967b-08d848d52298 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2020 08:59:12.1742 (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: lKjyPvYEjMMIGhbHOI7xCLym4qFjKqa0QEFwGDOZu7TGDtihIxeCoqKjiFfatbyEMwnxii0XKkmot8cCa5bYag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3501 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The initial developer has feared msecs_to_jiffies() could round down the result. However, the documentation of msecs_to_jiffies() says that the result is rounded upward. So the increment of the result of msecs_to_jiffies() is not necessary. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index 53ae0b5abcdd..07304a80c29b 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -33,7 +33,7 @@ static void device_wakeup(struct wfx_dev *wdev) // wait_for_completion_done_timeout()). So we have to emulate // it. if (wait_for_completion_timeout(&wdev->hif.ctrl_ready, - msecs_to_jiffies(2) + 1)) + msecs_to_jiffies(2))) complete(&wdev->hif.ctrl_ready); else dev_err(wdev->dev, "timeout while wake up chip\n");