From patchwork Mon Aug 7 15:05:34 2023 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: 711530 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55EB1C04A94 for ; Mon, 7 Aug 2023 15:06:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229949AbjHGPGO (ORCPT ); Mon, 7 Aug 2023 11:06:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbjHGPGL (ORCPT ); Mon, 7 Aug 2023 11:06:11 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2041.outbound.protection.outlook.com [40.107.223.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E692910FC; Mon, 7 Aug 2023 08:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hxxqZjtiBPu5/sBdS7p+fEP6KiOZF0ietmGWKfe+LICEPGW17kXlQMjLK/8zc/sb6zMzURJJTSVlebs0B5kLtp8XjTDaczSbOksF5WEbU32Tca46AavF7Rhi7+zrHj8J0WWr21rRPaLzmUzzDGukaPyuPmMJsycJqYaOEKaRYpwSGI/x4mlN5gVQ4UbuwvsF39ohLUYs+z0Mi+GcmNQStl6WW2Nm7pV1tU92AWtJAQfP9YJLADx9SkChpCCMb0cFUNe1LraK/OgZYUVp+hHpeSoR5AcDefrKUytsga/P0OOq1otfzu6/Foj5YMVsV6rjbuvXexQeh2ELrGOf5B0RoA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=R02y5uDMP4DY2FFVtqTykV0XgTnZxfANfWvLa88n9rs=; b=lJMX1nC8l9+YJnuyzStcDGWXaZuLCP/1Kzji1A7IwfPEPX/66hav7DwCHKfLd5clbNOCD6J+VFGnIsGf5T9fY6AthAEqZSWKY9lqcGbOgdtz8Bl61fNMfFOH5MxLAppL0/6jeKAxvpoWS8PzZUfZ6UjSFABuniwgkiB15D3Q7fFlRf8/8F+MQ/HJWh19596rUsWNLMmm2s41Rc/zkJPzz2XhPBAGn6F5RmapBe2wOHnVvSRncWWpxIp3eXnCy7EZZVBrUbv3u6qS08DoruJppyy3vrmi31lMCBHb5HSlE9vy6uWkXCKAZXwISYLZRAK21kmKdVy8WWblou4Qp8YVRg== 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=R02y5uDMP4DY2FFVtqTykV0XgTnZxfANfWvLa88n9rs=; b=jHCddxcK+zjwrUMJYsivZR8mFEHUPP64SKM4ZK2rITsYoNrf1wzCnhAbpvrJSPM6ADaG5X47IioeS2WmGA7LXLCq/Y0GF2nhsnIaznufVi2d74XSP8j2fJeeZrWia7pTSR9sFOQ/3QzF1q/W5wlXtm/tEPF+5boxnKjlEiB6Q3Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) by SN7PR11MB7590.namprd11.prod.outlook.com (2603:10b6:806:348::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Mon, 7 Aug 2023 15:06:04 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 15:06:04 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 1/9] wifi: wfx: fix power_save setting when AP is stopped Date: Mon, 7 Aug 2023 17:05:34 +0200 Message-Id: <20230807150542.247801-2-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807150542.247801-1-jerome.pouiller@silabs.com> References: <20230807150542.247801-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0252.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::24) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SN7PR11MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: dafce701-c166-440f-7069-08db9757d1f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hmBf4j51R+Tsv2XqmA+UZXsUgMrTSEY2L3+PCnSG/sfhsZsFjHZuP9DwJ2rmYzELiwXYtAmdGTk9zFXi6hscPffi2PYqGlWcrCydosDkYf7mV40b6bB7Pwc5Byfd6dPwOhrtzGn1ILvBovJqQs+zET1DFz691qx5/ZkJ/QkKfNOryUWeT4/yf04sHxD5zS9tnrkfLPMNQKM0ca271OBBzWjb2Q+nP7hdK5LL44dzNCv6U5ohQCJIfWvPN2pzbBkE9RO2bJy955rUkhnRJpnDmXY8VOlS0UrDDs9pWjf+3il7ZfWJJBaXytycm6h72iqgki008WU6NBIIgFSt9E/ohtP+La/vVASBgRZJOLBPNWvonoTzoGIizGx59B/VgIptJVKbrmktGT/vJ+pPqMdsv4tveL0IjZhsePTq7lzOUAyA9nu60vhCDnxmxrI0e0m+8I26yYXd+QC6jGftAGo0+WZBLbat7+kdO0cXYwrpSVU2/z/FhpzUWNNUUJmeUcB4fkff5v59W1q9VsDGJDFln2+glWd7JFtlh0q3TNUCggNweKUwQuqEMquwmuvzP4YrY3DGAg0ayK+wT6LFYbzbWTsJlFwrcijRwGk5nsyypkNOOzcNC+WPMEw7btTOqjb4 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR11MB7773.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(136003)(39850400004)(376002)(346002)(396003)(366004)(451199021)(1800799003)(186006)(2906002)(4326008)(6916009)(66556008)(66476007)(66946007)(6486002)(52116002)(6666004)(66574015)(83380400001)(5660300002)(41300700001)(8936002)(316002)(8676002)(38350700002)(38100700002)(2616005)(478600001)(36756003)(107886003)(26005)(6506007)(1076003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?wXh7sAmBQ+yIYqVwYxujbipgkwDm?= =?utf-8?q?nMvopKcPq8bHC+gFgVY2QptauWx7Y9CIkMWib/oInkTfLjFemI7Le7WFAvUUb/i2/?= =?utf-8?q?Wdf5j0XTqegLp9oJexDXLHPwVnLNXcMXy7NaxfQnevRGxI2J0tFXAktP+sk/LICcB?= =?utf-8?q?hu6hSK0KkU77JuliXgmjKK/tKUJLG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q4rziKKCKziX+zcuHS5B5mg4RJM6vjnBZzv?= =?utf-8?q?Aq2qU5TcOkUGTTUVfQCZbmCBMgjTJi603t26hv/JBa54OKBDR1wHXfLFZXB1rQbSw?= =?utf-8?q?AQYfMJn78yG9j7cS2Ah1g8Bw9KIbNlILfYvQWuj6eZaJEE290noheRNvLdzhBHsUD?= =?utf-8?q?lVdrON8oet8NpMhSBicI7W+PpINjoaqYv9YomGxWjMnnVhr5uCDRXL0cd3M3FrZw9?= =?utf-8?q?L3b6/CyES3dyEpHLkcZ0rUmm+7+X5aE/m4QF72eUesO7a5Vp4oBTIwkl5MtQBoPbA?= =?utf-8?q?VSW1zVYbD81NC8hjp+cg3b32QLK8pwCTnS+IVscOB7UrCF2+r/BykMlqhkGp5kCfp?= =?utf-8?q?mDv9aXOgRNAtrfurEeBQ1OXEUb3xSu1eJ4OSKcZy1oRATgzOQqk6H1F+QcRkcYmxS?= =?utf-8?q?3CbpFMhDjvLDZaZoIe46HWVMOSI6VtJwuzrxuLD8mKf3utqRm4R1iUoGyv/RioCU5?= =?utf-8?q?Hu9jHNimDfOE?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: dafce701-c166-440f-7069-08db9757d1f3 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 15:06:04.4766 (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: zQewpjr55PXpADGYK0Lnhdv80ev2eOzcaafc1Ul1+ihm1EROImGtwlyc6tpXa4XNFcjhxEVOvsQaylxKF4f5cg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7590 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The WF200 allows to start two network interfaces (one AP, one station) on two different channels. Since magic does not exist, it only works if the station interface enables power save. Thus, the driver detects this case and enforce power save as necessary. This patch fixes the case where the AP interface is stopped and it is no more necessary to enforce power saving on the station interface. Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/sta.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c index 626dfb4b7a55d..9c0a11c277e97 100644 --- a/drivers/net/wireless/silabs/wfx/sta.c +++ b/drivers/net/wireless/silabs/wfx/sta.c @@ -402,7 +402,12 @@ void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *link_conf) { struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv; + struct wfx_dev *wdev = wvif->wdev; + wvif = NULL; + while ((wvif = wvif_iterate(wdev, wvif)) != NULL) + wfx_update_pm(wvif); + wvif = (struct wfx_vif *)vif->drv_priv; wfx_reset(wvif); } From patchwork Mon Aug 7 15:05:35 2023 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: 712336 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D794C41513 for ; Mon, 7 Aug 2023 15:06:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229908AbjHGPGM (ORCPT ); Mon, 7 Aug 2023 11:06:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjHGPGL (ORCPT ); Mon, 7 Aug 2023 11:06:11 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2081.outbound.protection.outlook.com [40.107.223.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 526D010F8; Mon, 7 Aug 2023 08:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MRueQWB98NEBCdGy+QHPwZPVuHeNlMtUR9IBqkiSZx2hmqhUZVlxW3ePAPgQzsfcd/aB4xMhuJLwjc8p71oB9ySn36++XoahdnBl/yVi6mZL+J5xfrfKMmZHvD1skz458rZsBA7BpyRwneuhwpnbBaIJSX6D3WiPhs2jjUgX6F2ANvmtAf/Ys3jtmWPDf1KK4g89R5QqKQ62mTUTpQWczdEIo+howI4gFBHt8w8G7asoVLB/H+bxYZDrj1XlTUsBPzfifR5rPrI9irD+mfqgHiQw/XElUMsUSLhaNTnzc7b4Ljr8C2WG1MYGk5koNDhwFlinrcue0t0uW1MtZvutPQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jOP92MESOXRIE8UQeRoit76K7t7rRgsKKFRdemcA71k=; b=JV5OndEi+l3uqa+eDykICL8Az7JS/KrWbvmgefW9BkU5K6E+SY9dTCox6A3xIaBAtmRdS/i6QBh8BIS1922kHA+1XendBdHQ6arRnlg5xn5w2Q83U5NIX/dCmD2y4n7aAs32C75SDgIdsS6l2K3xqUtQaMNXLWQlMr+aoz5L4qWtuaD8iBe3pALAy1n0h714mfrvLrpAPDQn0X2qVKEx7t0URUSYFi0hrfEqymL42JQEivzbznCbc2mgbkPI/6ElgUUiNyGf2/vLNQpnWfe677adyqqdmlC6RUeD3ji04YZzUJdNGQNaavP/DASYyK6pA0yUUJU4TdrifngoUjpieQ== 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=jOP92MESOXRIE8UQeRoit76K7t7rRgsKKFRdemcA71k=; b=TgNuy6fWywhvqvh9Ld1mq32zvKqd1mhTY7b8uePJ3fxWZ7C2jYdL08GPYVv5PqSHOad3MiM9YEK5e/nJFqMPeynXLVGa5h0QTt9KpYmLMqsyIcoPvsSmU9LXYb/wJhooOdeNkeFp6ESCGsioYVdCHyRLNn+dNXLXqWxDXmZlfgg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) by SN7PR11MB7590.namprd11.prod.outlook.com (2603:10b6:806:348::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Mon, 7 Aug 2023 15:06:05 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 15:06:05 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 2/9] wifi: wfx: relocate wfx_rate_mask_to_hw() Date: Mon, 7 Aug 2023 17:05:35 +0200 Message-Id: <20230807150542.247801-3-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807150542.247801-1-jerome.pouiller@silabs.com> References: <20230807150542.247801-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0252.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::24) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SN7PR11MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: 1919d4d8-34ba-4d34-3363-08db9757d274 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NSPywcVr6fApUXiYHY9vsBGhwupGZjlaNg5D2PmvbNFcbJaLTVVSczI4XTZPVjIBGMtsZX1zvwjAECF9vUD6qLAWAIat8taSi8UAN5omm0G5rZ7aRLMZZuhiqmq67SBNxTBEJMLhWCRmF4bdEF1hBn2h0igNrTJNmCBblQuCOL4YBkC1TZk95u23JchRZiPJqJNYhhF2Hu9B833T7k7whM2aCk8+80vTlHNxtc6YcsuodQ7diqITwI0sUDI14OuMiZiFpC63qHE5GIKHMHDe5xSFRq0XI/CztCzz/l7r7ZkBZorSbxq721baxZpKkEoGWMYPeaKmTnUEeBgZHcAUSePFa+L9fazYKHtB7mIVoFYS14oP8FKDow/nEPoSdIRPi+2rMtu+06flUPhzDtaAmfr13mq2C7G+CKbAGYeTkJjGooEzoxqCcCN7yAXWzlDI3ca0pFrgeQk9ZU1xMCcCpnFhGWMvUJE4ZjEeHS5JzOzipGptPsAwpQ5KpaspMk/xETbYejrpjwTlbZSyKSkZJ7wbkU2PMtp676UfIV3xQvwpahx1nGEexS975qk82hHtBzq9V1jHE79GHGRtm9AZZS04IZrxGet8ObSLTAhAS0+R3ijzhAk4IbpuBdBERZwq X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR11MB7773.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(136003)(39850400004)(376002)(346002)(396003)(366004)(451199021)(1800799003)(186006)(2906002)(4326008)(6916009)(66556008)(66476007)(66946007)(6486002)(52116002)(6666004)(66574015)(83380400001)(5660300002)(41300700001)(8936002)(316002)(8676002)(38350700002)(38100700002)(2616005)(478600001)(36756003)(107886003)(26005)(6506007)(1076003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?E/s2NS1kWdbkk89EYGzyagUr/Pd1?= =?utf-8?q?QlV8YEjXj0SbglDFAszPLZ42s09mEtZLuejuZuP8vOHTHbnZ4t+7FEhfGx8sU+Zm3?= =?utf-8?q?GmFwaj13eH+Berp90ZMd/9nXukockJ1owL4o7wu8VBykMvbW2rgQGWBzv6+FUGdKT?= =?utf-8?q?S7qvdm9U35cIPGDGbCE5DvcfMgiHDoXiAuYIOQZNE5ByRg+5Ag/EXsDmNSUZ8ZmEC?= =?utf-8?q?EdkpKBzZWGKI8ZgaMH4uc0/a2K6GxJaNgQurJ/ulUVEypYH3+QO8/9N8gqYuuwBNi?= =?utf-8?q?+GvZ17beK+NeHyiVW7PbDpj0HFjE7JCfW0xgSX0VvzajszTtEeblj94qvtXu3tdMW?= =?utf-8?q?o2rOV35aFPt7GhtSxQE1QuYprKqkElt8++crxYgjU0l1jtw/YYAxxpm/kE+vQXjnd?= =?utf-8?q?jf9fhRFck6OybgiXMGTImM376Xg3+fgccVNLnLJXvWfCWiYUuOrWltvyc4sif406b?= =?utf-8?q?+amiiin1GBYHkAlX0W0dLd8NKUnxIeDFiVtw0EyD5H/uXRjr0FlWyCWA63MLBZGFY?= =?utf-8?q?6mUyGHcWLdukCGN3OaW1zVcQnNWV/f+kEmReHftMisdIOz7qZ4UL3/49579Cg2Ujg?= =?utf-8?q?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?utf-8?q?7KtRGLTlixca907g9Uc2s63eJlzbP0QbajX8waKoAMFU1d+s5dAHQYlcO9Sg/pDs9?= =?utf-8?q?wjxCBwhOFesH?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1919d4d8-34ba-4d34-3363-08db9757d274 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 15:06:05.2821 (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: u4JIqNpD8Q/HOVrtcP4AAaCACA5BezAuCJoGe5q8wyh510gqzY+1Y6zNfpPNqCrG3UaLA9v8moFjEyAD1I+4ZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7590 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org wfx_rate_mask_to_hw() is only used in hif_tx.c. So relocate it into hif_tx.c and mark it static. Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/hif_tx.c | 18 ++++++++++++++++++ drivers/net/wireless/silabs/wfx/sta.c | 18 ------------------ drivers/net/wireless/silabs/wfx/sta.h | 1 - 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/drivers/net/wireless/silabs/wfx/hif_tx.c b/drivers/net/wireless/silabs/wfx/hif_tx.c index 9402503fbde3c..de5a31482df38 100644 --- a/drivers/net/wireless/silabs/wfx/hif_tx.c +++ b/drivers/net/wireless/silabs/wfx/hif_tx.c @@ -45,6 +45,24 @@ static void *wfx_alloc_hif(size_t body_len, struct wfx_hif_msg **hif) return NULL; } +static u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates) +{ + int i; + u32 ret = 0; + /* The device only supports 2GHz */ + struct ieee80211_supported_band *sband = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]; + + for (i = 0; i < sband->n_bitrates; i++) { + if (rates & BIT(i)) { + if (i >= sband->n_bitrates) + dev_warn(wdev->dev, "unsupported basic rate\n"); + else + ret |= BIT(sband->bitrates[i].hw_value); + } + } + return ret; +} + int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request, void *reply, size_t reply_len, bool no_reply) { diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c index 9c0a11c277e97..c58db2bcea87b 100644 --- a/drivers/net/wireless/silabs/wfx/sta.c +++ b/drivers/net/wireless/silabs/wfx/sta.c @@ -20,24 +20,6 @@ #define HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES 2 -u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates) -{ - int i; - u32 ret = 0; - /* The device only supports 2GHz */ - struct ieee80211_supported_band *sband = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]; - - for (i = 0; i < sband->n_bitrates; i++) { - if (rates & BIT(i)) { - if (i >= sband->n_bitrates) - dev_warn(wdev->dev, "unsupported basic rate\n"); - else - ret |= BIT(sband->bitrates[i].hw_value); - } - } - return ret; -} - void wfx_cooling_timeout_work(struct work_struct *work) { struct wfx_dev *wdev = container_of(to_delayed_work(work), struct wfx_dev, diff --git a/drivers/net/wireless/silabs/wfx/sta.h b/drivers/net/wireless/silabs/wfx/sta.h index 888db5cd3206b..c478ddcb934bd 100644 --- a/drivers/net/wireless/silabs/wfx/sta.h +++ b/drivers/net/wireless/silabs/wfx/sta.h @@ -66,6 +66,5 @@ int wfx_update_pm(struct wfx_vif *wvif); /* Other Helpers */ void wfx_reset(struct wfx_vif *wvif); -u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates); #endif From patchwork Mon Aug 7 15:05:36 2023 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: 712335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18FABC04A6A for ; Mon, 7 Aug 2023 15:06:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230027AbjHGPGP (ORCPT ); Mon, 7 Aug 2023 11:06:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbjHGPGM (ORCPT ); Mon, 7 Aug 2023 11:06:12 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2081.outbound.protection.outlook.com [40.107.223.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 663ED10DE; Mon, 7 Aug 2023 08:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fi30Wghu3SgpJ5f2U8EgcK8bQ5GibSLNDGc1lY2tpahlXKLbyTcsx6Ib3qyWj6vmumDoxnbJckFj2bKhQAkxBtCB3v0whqRBFmyxoCpH0SB8W94hkJY3BxZDmCV6wDPYteEWddmaDkKY4pqOxvbfJi0DzEvfMOb6MZVuTFS3Gu+NG8SLImGrhpRH5eWJ8WSCPd9Lxy61RornRFwT+rB9+aOdELLREEmaUE2MeRxZctbEQ54bVUXVngMY4SlnBzuNS2OqlKi8yiKw/lPItgcuTHEYHNF36Idbn1HddmXOWvplcHxF9XEyhTWeHZ6Eva7Q9ScfPzebFbLqH/E7UtwhPQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bjGVnnI4IgQWVESipP4NJkbr9TxmMmdc9cZT7TgzWTk=; b=g7nuk51Cj3N/Y7vq2DaY4SdSG/23CcxI5iAitVUOJaBFw5MuQTFryqNV2YLPQ2d22DP5C3nWV1BrBGoxsD9XTY8Z2s7Kdq+/gVPHiG5JzaI8ykUEw0I4p3NMULldHIr0Uff99zTNRhHPgtw5Ry6+FrDw2+WGCuqnRo/+kd9WGYembyCWPmZAYJRHpHI9KrxCANh0nyxvqBku4fUjYLJM6WKiD+e/RtSZIfe74eB2BCtiB1mbN5gX3zjUiGy3YmEL52QKExKsYVAoQ8lKShmc65JIQa7tr0MVfCzRvfLB3MXapg82C3hghXx2dLKwM/wMoFEVEQ0NLM0Bmh0bCOJYoQ== 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=bjGVnnI4IgQWVESipP4NJkbr9TxmMmdc9cZT7TgzWTk=; b=VrwpgkTYg3dKtdW70CC8HmLnsYuTIgdCol9t3bl3MJ2fzkDFtwpd6I6BbljSjGPiDSiVGaZUQ4NfASKtkll17/ftvBgR+zJ9GZv73ugTqswBSIPAqr8uVFlXD0Vn9JW/kAX2vIkPhsqBdlE4neUJa5CdndFqkbO8Q+2cLn8WtMQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) by SN7PR11MB7590.namprd11.prod.outlook.com (2603:10b6:806:348::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Mon, 7 Aug 2023 15:06:06 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 15:06:06 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 3/9] wifi: wfx: move wfx_skb_*() out of the header file Date: Mon, 7 Aug 2023 17:05:36 +0200 Message-Id: <20230807150542.247801-4-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807150542.247801-1-jerome.pouiller@silabs.com> References: <20230807150542.247801-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0252.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::24) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SN7PR11MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: 74570109-ed36-44bc-3170-08db9757d2f0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JG/+SZcRRnPXCR9bkPacmUfVJcLYxe3RJqcjuFWBaoCmNflH0avMsA8UJb7+D6uXds5O2m5yyzFRbgBajz/4hrhjg3O3+SYILDi4hiiTrQWXkZl5LwFYvd0Z9M8KMDIDv6tjkkMdFbmi8JgmW8IBacN0V2hVLVDqR2tiCCzkitubHGN+tpv96H+baHcavc9nofKWfJ6MvjuCghEUNbAQ3vNspFRv7ww5euKFtAeq2n4t8W3Vf+lkwr7BiTFX0eFziNV1ILDsLokwx1Q8XhfroFjaHa8I85C3pPo85wK/3LZzD+zU3WYGebiKyNG7JLvadYRVKiW2T2guoFo8C8zT2F16FiuQtR7fh4R9vF2qfJz4dPC21AHR8tKGh2pk/NImBlO487TaiwILAnhAeZ9Kxa/+AO5cJnBBmMTBJFBsFs6KAZIirDgT/hqYAsaBGwQ4T+Sgu5cbQnMLCAiulO0dKIpHf8ZCGNEoCk/TpI891H4nhV6/It9wDExrkbrYcD1d6AE8fiXAR1bgXfz7GXNY6H3ASEF/XbZmPsFlre2HIEAFB331xDnTfX5mRmPrCzKNgY0s+qGbZ/l3zue2+CH26CBEePUIbASXs33boJIu/vOxhdTOMmSXg/dfhbCAQPW7 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR11MB7773.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(136003)(39850400004)(376002)(346002)(396003)(366004)(451199021)(1800799003)(186006)(2906002)(4326008)(6916009)(66556008)(66476007)(66946007)(6486002)(52116002)(6666004)(66574015)(83380400001)(5660300002)(41300700001)(8936002)(316002)(8676002)(38350700002)(38100700002)(2616005)(478600001)(36756003)(107886003)(26005)(6506007)(1076003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?WBNTorANW3pLqHbOcX8DDXX2tn7l?= =?utf-8?q?f4FMHqG4fusApaMecw9Lizdp2NPUvpYx5wWl6E2TRwjGzDfJ3HWeS6fhHhoN6XozX?= =?utf-8?q?67DYvZX0J4lTpvi5IhVr+jVyZRWaEYW4x7bVIkU39cjvF+/6BAq02Ua4UlZJeIDtC?= =?utf-8?q?zQpSa5VwiAA402f+2x5s65DvpBm0McJ2N3PYBcDnqzR5VhBn7AZAKKelo1p9Rjv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bIuusnAFYKD0V9SFdxBvHbEJBr4Kpm8LwhEi3h8VNz9cLjAVY9dbofnmXTV8onk?= =?utf-8?q?O0Su4dm7CSNmVeZdv/aqT23G3n7uqcKAA5/mkuyGCq+zCq+h8mA0gM+mryAVzn9I/?= =?utf-8?q?W15l+Y02Ia5PUlQdhPDOaacovtcEnEvCHQVSLODez1AFuGVMqVboT8nNEKyecRIkM?= =?utf-8?q?ch108G3ujs+kgePMmOn7nHltFkdU3eYvF5WuCmtorhz/4v66rrEjtLzsIlAmDJydu?= =?utf-8?q?SvsQZ63Y7Z+9knvcEpHYQONhtquXw5QRIcRsNWMkPaUraMsy2FaV48RxSPR79pOLv?= =?utf-8?q?q5qWDmF8sb+C3WXQ+RamwJy4kcJHSDlCeDtmfIRtXWcO4SUYqLtNZ4292B6HKFPRk?= =?utf-8?q?W9wrW85wK/gHycOE/ofCE5FohQZ7WOKW0/FuFopTtBGSsQ9GB5uRjK9z5X6OTKHm7?= =?utf-8?q?WQR0QnwW8rws?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74570109-ed36-44bc-3170-08db9757d2f0 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 15:06:06.0954 (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: lnUZmCQtDln8h5qbZsvP6XchfRgJbgT4eu1qb+PGpLo/6QQUN+rKD7z/SkJsf5GJGHjj7Bo1jviBBglP4+MvJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7590 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org There is no real reasons to keep these function in the header file. Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/data_tx.c | 18 ++++++++++++++++++ drivers/net/wireless/silabs/wfx/data_tx.h | 19 ++----------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/drivers/net/wireless/silabs/wfx/data_tx.c b/drivers/net/wireless/silabs/wfx/data_tx.c index 6a5e52a96d183..ce2b5dcfd8d89 100644 --- a/drivers/net/wireless/silabs/wfx/data_tx.c +++ b/drivers/net/wireless/silabs/wfx/data_tx.c @@ -208,6 +208,24 @@ static bool wfx_is_action_back(struct ieee80211_hdr *hdr) return true; } +struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb) +{ + struct ieee80211_tx_info *tx_info; + + if (!skb) + return NULL; + tx_info = IEEE80211_SKB_CB(skb); + return (struct wfx_tx_priv *)tx_info->rate_driver_data; +} + +struct wfx_hif_req_tx *wfx_skb_txreq(struct sk_buff *skb) +{ + struct wfx_hif_msg *hif = (struct wfx_hif_msg *)skb->data; + struct wfx_hif_req_tx *req = (struct wfx_hif_req_tx *)hif->body; + + return req; +} + static u8 wfx_tx_get_link_id(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct ieee80211_hdr *hdr) { diff --git a/drivers/net/wireless/silabs/wfx/data_tx.h b/drivers/net/wireless/silabs/wfx/data_tx.h index 983470705e4bb..a5b80eacce39a 100644 --- a/drivers/net/wireless/silabs/wfx/data_tx.h +++ b/drivers/net/wireless/silabs/wfx/data_tx.h @@ -45,22 +45,7 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struc void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct wfx_hif_cnf_tx *arg); void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 queues, bool drop); -static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb) -{ - struct ieee80211_tx_info *tx_info; - - if (!skb) - return NULL; - tx_info = IEEE80211_SKB_CB(skb); - return (struct wfx_tx_priv *)tx_info->rate_driver_data; -} - -static inline struct wfx_hif_req_tx *wfx_skb_txreq(struct sk_buff *skb) -{ - struct wfx_hif_msg *hif = (struct wfx_hif_msg *)skb->data; - struct wfx_hif_req_tx *req = (struct wfx_hif_req_tx *)hif->body; - - return req; -} +struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb); +struct wfx_hif_req_tx *wfx_skb_txreq(struct sk_buff *skb); #endif From patchwork Mon Aug 7 15:05:37 2023 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: 711529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 774E9C00528 for ; Mon, 7 Aug 2023 15:06:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230103AbjHGPGR (ORCPT ); Mon, 7 Aug 2023 11:06:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbjHGPGM (ORCPT ); Mon, 7 Aug 2023 11:06:12 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2041.outbound.protection.outlook.com [40.107.223.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8F7010F8; Mon, 7 Aug 2023 08:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lPyA03y6Gt+3zS01SpUM28Gh0M/Dl4TOTdspclqd0dDSSjcVF3EfdgDaYMcWhVf9fajXaGXuzjmHrSji2/hvdH50IMYQpXrnea9guuMsZoGc7I1LaS2rXvlIquKTfTsknLFdRFRQm3kBjur7WwkitYvMV3KwCQErD6LN0YsXkeCbF7dpQ0RX0q6MNlX2wd9o0/sslnFeogcBtUdx0o637JbYq1ISldRwqqQ6EWM9vDNr8r+iyv49qeVfClXcDYLL46ttv263Hetdl6WcxIfawFIhsOBXOFKgMv8zf2JcV6q56C3C5fE3yVdn8BHtkEPPSFatlsVM8zbSsf4VjM0bUw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cPOV2Gz1E59W2pcAPTmW+HAfVjs5tUjGRDiUoEX/uys=; b=JjAo4j/E+IdQBToEfyMOf+O6KhiOUiv+BAf5+lQYP6GIS7RRqeTHHUb7Dtc7Y7cS70/k/hWpixYPjUxGIwLMqOGmdR57bCAdrra2s75t9np4sB0O5lz2/jOQu25mAPHCf3NTX5j2djzTS/zURlt2iTxScm+xzF2nFYj3cEZGMlE6ssiMUyTHIo9HOVnXpo62zne/gUZFbwNZiUrFSO1tJGGysG5Gh0R4FnIhEZmH9swJFECEC5KYqOxo6SSaRLOxVXYH5WDe+n9sFDpUCGcHayoggVfv9lUEQbi/oLyPPn0CIsmI484qQ+vCpCwSk1z2PDd7bfxgCxItUb1aGL3+xQ== 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=cPOV2Gz1E59W2pcAPTmW+HAfVjs5tUjGRDiUoEX/uys=; b=aEAD1dKcXbj2ZdT9JHtGqc5VBbGzSggQoTwhAejuVzVFWGbu3yEpYtlnTMMpCvjYIm/VXGQbDjpSg1oio8L9tuRuu0yIZrWBGahfe4hAOYZTwpBdgHmcPtMKKq5mH7kcvYN9DoydYZ/8OLOQN/PVyS6B/01XYaSZo9xkU3bLDXQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) by SN7PR11MB7590.namprd11.prod.outlook.com (2603:10b6:806:348::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Mon, 7 Aug 2023 15:06:07 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 15:06:06 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 4/9] wifi: wfx: introduce hif_scan_uniq() Date: Mon, 7 Aug 2023 17:05:37 +0200 Message-Id: <20230807150542.247801-5-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807150542.247801-1-jerome.pouiller@silabs.com> References: <20230807150542.247801-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0252.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::24) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SN7PR11MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ed0e708-3480-48ec-9214-08db9757d36e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H/do6JqcBsc11+npB2JUKxGKZzkzPhzJc1g6QtmGinKxHEKXw1jumGzE4ySof5ovJ9MOHfqDPWldV4pzbetYAI6P3c/dwQIdeHtyRPMhLa70wbUjFXqbtfzlTZyhIMixYdUNkF6nYwa31b7zIk04uZ+5ElIm8XvquRwFg0CgDj/9dT9vLNNMtTUaYEGzO3lkhfEU8q1B5TU37TMnaTZvzMTDcaPCaPpHCatqk06IrPQ6pmqYmNW4HW1D7Sn1NRyqabZlSvVS7Quw3MTLJd56GkQbNPtcjjR5F1NdWhi1zmMFRIO5VvYZ/g4RfX0ZbRtMWi+ez6Q+DyYO/w6umFhbzW22c5OCstLTJbuIrxkr7RKurKXveAPgcW5gkaOmI8B3dWoDXWtFwDtWnMSuRxf52z8MU3knXH3jjxEng+selFIQYuXI1XaRbpmFYOxUgsq7Z3pLVr1gu5VLYx0haq5EtR0p0W8JZyRLVGeOA0SL89QLDy06BIkglSueDCa+IU3KT+KSKaPV7LrFhOvTO7R92Yll3ybvX2jDOSXDxAXboIiLNMmS9SyCSuzflBGH7y34iwTpdF9JZGE1BhdycpnhLHTlN5KsEP1warZ4wcKaIVRN7by53RCEExzcBB6r/UvD X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR11MB7773.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(136003)(39850400004)(376002)(346002)(396003)(366004)(451199021)(1800799003)(186006)(2906002)(4326008)(6916009)(66556008)(66476007)(66946007)(6486002)(52116002)(6666004)(66574015)(83380400001)(5660300002)(41300700001)(8936002)(316002)(8676002)(38350700002)(38100700002)(2616005)(478600001)(36756003)(107886003)(26005)(6506007)(1076003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-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DowGrnw1RvAsXXYNKcewEqtPJlZ3fr54RwaUb?= =?utf-8?q?eHDz3vbeXscGMWZf6WKboZtjbRRAtSH4KbCxU84ITcvOZmR86E2dw8gl51uxlahRz?= =?utf-8?q?0KLj6b1ez40R5nZypXPVXmf4FQ0TGLjreVh7RiSBWX2rEEPSRj/2UgTLxoLZTVMYX?= =?utf-8?q?KSGi8rvDWkaN1lE+UeFOH+3seaL/PbwC0GaJU88e/rAvX3WtCPpveFipXRerai43f?= =?utf-8?q?WDJIhOeFVvFh+ncIPDeA94Dte80HicOlLoTH4GKOaj9TyR9er6rqciwcfQ2lkj5qD?= =?utf-8?q?7xuugWBshvi1vxHfOc8PVKL1yx81idF9RknGSuJ962DMGjXCC0uN0LOqseb2EVFyX?= =?utf-8?q?1omukt+aUIBTVVM+/aetaFyrnnBRRLpQeyBMYwRh5nQFZhFS/tFNNPbYL9Lv4IbW3?= =?utf-8?q?7PELmyFMnp8DEmxaEg5pgXiv26qJT65R7XSjfMjwhvKvhTpkX0A2Lpc0iDeFfA0Qw?= =?utf-8?q?DduxpYz7PhblCEYKeZPhb0FRtCpcLc0jGapSajXuEVvcSmcwWhIep2ZAlFQbj4Iew?= =?utf-8?q?Z5M3dT9uydvWFL3C8dGTStlxRuyraDpw/DKoSA+xz5ybIwZeQ27rAYhLWvy4kibkm?= =?utf-8?q?+XlrvsCXO9p88/ciwjTSU4F8RmGEOqHBvXUXdmZRWLAMwUkN7l7XO/N9zHo5m6JXZ?= =?utf-8?q?GTnPncoUH8ae?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ed0e708-3480-48ec-9214-08db9757d36e X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 15:06:06.9243 (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: lgbH3INbRmAYdr5d28f/H5FAepSzAVdxZXt+hulUItfnDfC7w7qoyf1F7ZtbFdlaq+pnc64Xei4f2H/6xitxzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7590 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Like hif_scan(), the new hif_scan_uniq() function invokes HIF_SCAN. However, it probes only one channel and disable probe requests. This new function is the basis to implement Remain-On-Channel. Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/hif_tx.c | 25 ++++++++++++++++++++++++ drivers/net/wireless/silabs/wfx/hif_tx.h | 1 + 2 files changed, 26 insertions(+) diff --git a/drivers/net/wireless/silabs/wfx/hif_tx.c b/drivers/net/wireless/silabs/wfx/hif_tx.c index de5a31482df38..9f403d275cb13 100644 --- a/drivers/net/wireless/silabs/wfx/hif_tx.c +++ b/drivers/net/wireless/silabs/wfx/hif_tx.c @@ -238,6 +238,31 @@ int wfx_hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, s return ret; } +/* Hijack scan request to implement Remain-On-Channel */ +int wfx_hif_scan_uniq(struct wfx_vif *wvif, struct ieee80211_channel *chan, int duration) +{ + int ret; + struct wfx_hif_msg *hif; + size_t buf_len = sizeof(struct wfx_hif_req_start_scan_alt) + sizeof(u8); + struct wfx_hif_req_start_scan_alt *body = wfx_alloc_hif(buf_len, &hif); + + if (!hif) + return -ENOMEM; + body->num_of_ssids = HIF_API_MAX_NB_SSIDS; + body->maintain_current_bss = 1; + body->disallow_ps = 1; + body->tx_power_level = cpu_to_le32(chan->max_power); + body->num_of_channels = 1; + body->channel_list[0] = chan->hw_value; + body->max_transmit_rate = API_RATE_INDEX_B_1MBPS; + body->min_channel_time = cpu_to_le32(duration); + body->max_channel_time = cpu_to_le32(duration * 110 / 100); + wfx_fill_header(hif, wvif->id, HIF_REQ_ID_START_SCAN, buf_len); + ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); + kfree(hif); + return ret; +} + int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req, int chan_start_idx, int chan_num) { diff --git a/drivers/net/wireless/silabs/wfx/hif_tx.h b/drivers/net/wireless/silabs/wfx/hif_tx.h index 71817a6571f0b..aab54df6aafa6 100644 --- a/drivers/net/wireless/silabs/wfx/hif_tx.h +++ b/drivers/net/wireless/silabs/wfx/hif_tx.h @@ -54,6 +54,7 @@ int wfx_hif_beacon_transmit(struct wfx_vif *wvif, bool enable); int wfx_hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len); int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req80211, int chan_start, int chan_num); +int wfx_hif_scan_uniq(struct wfx_vif *wvif, struct ieee80211_channel *chan, int duration); int wfx_hif_stop_scan(struct wfx_vif *wvif); int wfx_hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len); int wfx_hif_shutdown(struct wfx_dev *wdev); From patchwork Mon Aug 7 15:05:38 2023 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: 712334 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CE9CC04A6A for ; Mon, 7 Aug 2023 15:06:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbjHGPGS (ORCPT ); Mon, 7 Aug 2023 11:06:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229931AbjHGPGN (ORCPT ); Mon, 7 Aug 2023 11:06:13 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2081.outbound.protection.outlook.com [40.107.223.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6237C10FC; Mon, 7 Aug 2023 08:06:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PzCcEyT16T6qKpkqIEF3jv9eGsa7Ds4ifP1fbNavFSpTax0JOW6WL9hkleu0TWPb2+zMOVhhvkPL20l+xhL8yBPACmPKGLQh6zMoPNj0nRX3yPrUDvewzXYr+qAR+wtukKp5hnCIEmzzY/3WAt2DHlzZ+xP7vbF4Y6dxqtxcbnFgd/tunIKXCR5ZmhJ1QF9eB1LKvGt5zXohWCxRtzleQNKnrLljCTO0u4VLIbOpRHJ9O3sSGFG07aeJN5b4UUEpFsOHOXSeYo1NiKDSmiHjLKWS9DwHxxi+Ty7MgGm9njtuVy8rnKFj3DRGCLLEqZET20iLNqNQKb2c84xb0c95mA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=norDEW8Hxm6C7u81b2eY1C5/61vShbjHMSmIeYSui2Q=; b=V6nHNkMW4/M7p7XSmgW9H9IOLwdtN+qRgWmkhy3Ekv8ncvUVyF9aQVBQYccoJWxP7SbEvlCHZtM4Ac/beXj5eB5CQkOO880lZs5VrHK5OP4cnzMnC7qxo4PHqymatQpeyT+OhcYwjl0VCEBaE+10f74zGJzVsiWJSnMGPHSJEWOG6ATvhmrWblaH5pyghqj/Q2g7Df3FhQ9x1rI5XbX1HSFs68rt8NvIn5O+uKMYbXmmz0td8vBfC3RS40THGRysA1GxMHU8gcmHgB0vejL8rhEbE51+D+0MZL4xSOsHwcdVsGH0JMt9Ftg2tuypx2MFrQYkoNtiTmq9FHxDK/YgVA== 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=norDEW8Hxm6C7u81b2eY1C5/61vShbjHMSmIeYSui2Q=; b=KVqy0aduMVkI9nDgww4LTggRX1O/zOz9OZmWiP4+LNCmEw2NT3bLO3hMbRjMrWpKk5GvG4DwbIcYa3Fqipf6LE5bxlz6TFGEBAEbN5sVkJ5flCntP8knU8slABRJg9Si2APbvM2yean92aBXyR10oK++N1zFyKwAStTh+uDNgB8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) by SN7PR11MB7590.namprd11.prod.outlook.com (2603:10b6:806:348::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Mon, 7 Aug 2023 15:06:08 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 15:06:08 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 5/9] wifi: wfx: add placeholders for remain_on_channel feature Date: Mon, 7 Aug 2023 17:05:38 +0200 Message-Id: <20230807150542.247801-6-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807150542.247801-1-jerome.pouiller@silabs.com> References: <20230807150542.247801-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0252.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::24) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SN7PR11MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d66e59c-821f-430c-ca6a-08db9757d423 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2IkcFdRV2xFzeg7sWZCxUb9iJZqRr4D2uleMGUjPiol4n8e3Tpf/PUcDu/mJ48yJBLh0zV1LqnggNQ8sxyHBVtLzMTa7tgJpdFyXIFrAjlVULL5OlzE7LIvBjMPGPjwlavB9aSzl8wVleq3GtbnQBpXQOloYfJoSUQIHVJWaPtDgogwGD9GZgM8mhGmQqL9n4C8VR7dx9+vyrxXQ2DwoPf+gS0l8AYvEIv/vItXNPFHvwwvM5sCilgHHjV/zqDLCzUka7wfpQ2OgdYY49VVrqrOy1RMnR+poooMwbfXL0vJe9mJwVYqssBzAuyFVwT3R5yMVSeOdfPnirNwxM9boOOQdFpeiYmZftKZLfrzOgdIVof2uEYM1W75BWZaqeHaIeoS2NLPo208aFMUeBl3HBQKLEfcpz2F/N1ifi0Hc83F6hfMOETWEpHAd5adl1uECnz7yvj9tzyhHK6nMKw28Rz3Nzxz6iICJh4juIviAPaJ4HE5G/z43QJqou1SvfRK9LoxNkeJTbmRpfirq70pJxkT63YTIs1H99Q5A9tUwYJm/4ekWjadHIZ8EndB/8Njd8bQ+i/PHie7irqlXRypxgZFGH4rWMdiVKzUwP2IreD78xyujr/6dmPiuy9QsIyHl X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR11MB7773.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(136003)(39850400004)(376002)(346002)(396003)(366004)(451199021)(1800799003)(186006)(2906002)(4326008)(6916009)(66556008)(66476007)(66946007)(6486002)(52116002)(6666004)(5660300002)(41300700001)(8936002)(316002)(8676002)(38350700002)(38100700002)(2616005)(478600001)(36756003)(107886003)(26005)(6506007)(1076003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?vOWFTk/EP6YdtY2NXdqRdw9SdYHZ?= =?utf-8?q?xI/mOIM6YtmBQbgNvME68bB6myYXi57AXojQ1C3ZYPwQCCh+ue/G7563U+L8uDZLW?= =?utf-8?q?ZQDdB5jf79+szPjOd6JynRBRMDTxAdq/OlSaE7kX0jzjJ77zPxVD262Rzk4riRdPu?= =?utf-8?q?zUjD3W+uUzcQw1NHwrwVnzSME49mhx+WTP7Dp2mJ9HEDVxlmOogBRNGZBbLcItW1i?= =?utf-8?q?90YrAyu+x6P56NQwmkipn9GnB46ZDMC0uUVcguYloU3r+HMX2UnErLmCr970FgL1o?= =?utf-8?q?VeiDu0GFxwNa+w4NLDVukTdiv1CS/9O8w1/UCXXUJ/OnPbICebiosycZRtCSA8ABP?= =?utf-8?q?O8iWl2NKCEp6h/fCzdGXYS/uBFVH3AQB0Rv1MsnbdjStMq+V5FP4UjX0C9SkPKZMX?= =?utf-8?q?kFBYFg021pwwYB24axelA4Ghsv4vp+d3m6m5uL0lO3p49HBQLCNiM1wCBbGW99zr3?= =?utf-8?q?iq22JsnLcc4FutP4hey72Ii6kuZBsj7F21FPUK5lOnrVDzqu6AIyqRx3NePr4O7uK?= =?utf-8?q?1IooMxGTA+I79alPRG/JMdpMuE80SUdIpr43Ls2BBYD/y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5+ZDOHmzf2BFL3dwroCrB+XktILg7?= =?utf-8?q?hYy/N8oGRoPVEQC2Uns36eA/spZSEAuY/+06vuyOEg54R7Zh+TyjIyl+nIZ4dpkpQ?= =?utf-8?q?/V3HZePbRufa?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d66e59c-821f-430c-ca6a-08db9757d423 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 15:06:08.1092 (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: 3Sky6aDTnJCttxZ+QArkIF2kvrhqdy8SbgATw7ZxGqGvtTDnrnDKG9KbO/CUPr3sw3RoEsP1KAPtGzQnmcHIMw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7590 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org First step to implement remain_on_channel. Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/main.c | 3 +++ drivers/net/wireless/silabs/wfx/scan.c | 12 ++++++++++++ drivers/net/wireless/silabs/wfx/scan.h | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/drivers/net/wireless/silabs/wfx/main.c b/drivers/net/wireless/silabs/wfx/main.c index 0b50f7058bbbc..a0906d7d026e0 100644 --- a/drivers/net/wireless/silabs/wfx/main.c +++ b/drivers/net/wireless/silabs/wfx/main.c @@ -151,6 +151,8 @@ static const struct ieee80211_ops wfx_ops = { .change_chanctx = wfx_change_chanctx, .assign_vif_chanctx = wfx_assign_vif_chanctx, .unassign_vif_chanctx = wfx_unassign_vif_chanctx, + .remain_on_channel = wfx_remain_on_channel, + .cancel_remain_on_channel = wfx_cancel_remain_on_channel, }; bool wfx_api_older_than(struct wfx_dev *wdev, int major, int minor) @@ -288,6 +290,7 @@ struct wfx_dev *wfx_init_common(struct device *dev, const struct wfx_platform_da 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->max_remain_on_channel_duration = 5000; hw->wiphy->max_ap_assoc_sta = HIF_LINK_ID_MAX; hw->wiphy->max_scan_ssids = 2; hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; diff --git a/drivers/net/wireless/silabs/wfx/scan.c b/drivers/net/wireless/silabs/wfx/scan.c index 16f619ed22e00..51338fd43ae4f 100644 --- a/drivers/net/wireless/silabs/wfx/scan.c +++ b/drivers/net/wireless/silabs/wfx/scan.c @@ -145,3 +145,15 @@ void wfx_scan_complete(struct wfx_vif *wvif, int nb_chan_done) wvif->scan_nb_chan_done = nb_chan_done; complete(&wvif->scan_complete); } + +int wfx_remain_on_channel(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_channel *chan, int duration, + enum ieee80211_roc_type type) +{ + return 0; +} + +int wfx_cancel_remain_on_channel(struct ieee80211_hw *hw, struct ieee80211_vif *vif) +{ + return 0; +} diff --git a/drivers/net/wireless/silabs/wfx/scan.h b/drivers/net/wireless/silabs/wfx/scan.h index 78e3b984f375c..2f8361769303e 100644 --- a/drivers/net/wireless/silabs/wfx/scan.h +++ b/drivers/net/wireless/silabs/wfx/scan.h @@ -19,4 +19,9 @@ int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void wfx_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif); void wfx_scan_complete(struct wfx_vif *wvif, int nb_chan_done); +int wfx_remain_on_channel(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_channel *chan, int duration, + enum ieee80211_roc_type type); +int wfx_cancel_remain_on_channel(struct ieee80211_hw *hw, struct ieee80211_vif *vif); + #endif From patchwork Mon Aug 7 15:05:39 2023 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: 711528 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB250C41513 for ; Mon, 7 Aug 2023 15:06:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230074AbjHGPGT (ORCPT ); Mon, 7 Aug 2023 11:06:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbjHGPGN (ORCPT ); Mon, 7 Aug 2023 11:06:13 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2041.outbound.protection.outlook.com [40.107.223.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD67510DE; Mon, 7 Aug 2023 08:06:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l6Pxi1NoX/sePte0ctlIr6F6J8VZ+pp8U9YdoBNDP37aSSmkW4tq/wiVuC3tOLF0218Sx+FvULhTHiGrFvMY5BSEcYzL2M89NzHtA3WEiNX5DZrzJWWLcE7rqZ5G8fHV+vxSQ6KpUqbssJV+SGeEWii03gz/TrEorZ87LgP0WJM1GFNfHk67aGdwjFxwEEFaYUHE//j+tLMaNxAUr1QpouJP84oB9nMKulod/vw3D6/gEvt0H3ygI5CBz5y+HtVk4QsoTKpHfashtGp0gk1UkNkcVyHiwY+HJALRAayGf1UYAlvvmoqgVJ71x8xFuz72dmLwTMoLvNh1ZHPaJiC6SQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UTH5wIR+R1oRA1WM5IDcLdUhxe6B0hWxMJqCmFDulfc=; b=JThJTvZgxnn7W9tWPwkZNd1GWWd30ST11nD41jfcY/CeFKa73igw5LTzRLzk5lQzK3W/HHBXtDIGFYaKlo3/3LA+FiNAWJpyufaFBNw5Uhgnyj2ZTupnZHTzJlRomgrg+oZpr+UGTMLrSVKTDFrawGLqg9Qfqk0MEOLCaVVOO28khj1bc/IlCJgyD5DFf5+1V17u7D3hRc1etvupHp6ByK2SXRmpnimDGIVsKQ9XxO2k96WCbBzv7EK0MO7dFKnqJuc0h7y2nUan7KISWqWtFkgLErQgE2Ih6bkHRXkhPYerT0NvyVsU8MMNVad9aCDasndBzknGq3yBYwP8vNUqvA== 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=UTH5wIR+R1oRA1WM5IDcLdUhxe6B0hWxMJqCmFDulfc=; b=jX0fJWMgPDgLhlUhN4yG1yTrjgCSgAPSBljFWeWo+KhxAZoqgLu3UViGs6L90Hq10hiuQZRBKWGULi1fgyrsU7mhCcMLvwXr6LF/f2NunOTE1FqJN9AuLt9iLG711hmpJEcbGytftHt0pQZORM3Bkv0/lm+h2NA/oZ1GOxJEYhc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) by SN7PR11MB7590.namprd11.prod.outlook.com (2603:10b6:806:348::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Mon, 7 Aug 2023 15:06:09 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 15:06:09 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 6/9] wifi: wfx: implement wfx_remain_on_channel() Date: Mon, 7 Aug 2023 17:05:39 +0200 Message-Id: <20230807150542.247801-7-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807150542.247801-1-jerome.pouiller@silabs.com> References: <20230807150542.247801-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0252.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::24) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SN7PR11MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: f833c409-4e72-4aa9-c87d-08db9757d49f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cJ++EnFr0GQiQQmkZ4dW4f6L9trGBrNT2YJ8dHyiAP7RIlU5Z2+GHzQAFeDgMDc5CKVPhcazuXaPmzzW5MsHsKFiNyW8BMoLlEBogsqpXWC8dkPR9Q6yTSbwUgcVsDimAHsQhrTU93ADs0HJFjlwxzXDvfyfalw4KzEyHD0DgMhM7xa7Jght+NfaFaf1//rAKb6moXk+y6BlV8TCaXil/HVWISdPWyjEGvaFDDsBkNvERgfE4CNBIanOE0jC/hUQP9nna0eCmH0MhWRrIjGOe3HfxIVKCKM+Y+9+8XT++r6qGAS38PDOMo0wpNZZ5PKvl74W9CNWyUs30og/SK5iVd/kD2/BAMdeeNq+ik8gL0sOeMf2EC7tbHTSGFXFHJy1KbBXtBLgmZ/3CU3AqxWhsB6C97jihQ9DZw/c41sk4gKuBz4/WVSetThSwR8DO4XdtQXum3xViBAUCXF/y46knV5/uah6LNOiLYomJngKO/2ASIaaj7uhMK9jGOzXUk3ZgMfViKSnFZrbIh0vD0iRpkVM6TkbhvNYDUdMyvdhTZAT6uGI5LBk/v5KcIidds9zoyWoewPeMDmnIwPN84e/xQRsV+edodR9MTiUwous5b7zwFRK63jaTSLPKYMcG2dE X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR11MB7773.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(136003)(39850400004)(376002)(346002)(396003)(366004)(451199021)(1800799003)(186006)(2906002)(4326008)(6916009)(66556008)(66476007)(66946007)(6486002)(52116002)(6666004)(66574015)(83380400001)(5660300002)(41300700001)(8936002)(316002)(8676002)(38350700002)(38100700002)(2616005)(478600001)(36756003)(107886003)(26005)(6506007)(1076003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?k4ZxKje/qkyFzkGOtT0FBYlJukVO?= =?utf-8?q?J+0gD3gn/q5waesJV4GqK4w1WsU5f5QJs8hOU9XnPVGSDkM1Ge+wYsDQZwkGmLhOu?= =?utf-8?q?tPkpZkemQZ7w0EE7RO1qoN4quHpQdYiCUXmI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k/d3Ev60/?= =?utf-8?q?i0HgxyEI4XVieNRTYCEa4eFbMskis/LGhpNLjIJi2VWR8JPk4XfsbW8KBxmFGWzm+?= =?utf-8?q?Sqn7rvChrtlybmrQyhZCroGAjLYQkJ0pET4ZaV/P8bMMxBFz4yn9Y5AUoS216tPlp?= =?utf-8?q?W7hCW7FJq7+b8xJbhGiqQxAXHXy+WQy1JArHqSE9aNk8utP65nolBqAzXs9OrqJRG?= =?utf-8?q?unviWOyVdyWHTP1/DT86RuWeLEODzKBk+1mFEnMMcXI2+KgX4djahgw41TPyu8vQB?= =?utf-8?q?5XuX01Yw2Kgm3aDJ1vYUTcP5O6WE1Zk50WGiqqQj8SfC3PKWs+8nDo7CiCnCDlHqK?= =?utf-8?q?A3nHbvR0+lYlMbXd9bENFdV6/G5qBWGIa13+2Qu8Jx58Mo/a8SuQA9DN6BepLkXqz?= =?utf-8?q?48zphEqWqKGNBmP3pO9WqovMOQhrBmOhWyACFyOgZCMI22F9XyHzubAJREqgrod38?= =?utf-8?q?HyBbkx/cqBJINue1EFyROMWsWOB+WeqcZnp6/m5McHxB3WmSK5fuYkEpQE2V0zOJO?= =?utf-8?q?KWN6mVs/8Kom?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f833c409-4e72-4aa9-c87d-08db9757d49f X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 15:06:08.9535 (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: Cx8GKo0PGKLvApt3+Uqn8W7pWGQSOOqkik/92zeZod1Pbm/mt3mCOa7f41ILD8RCoR5b257B5HSGbzAHBYoWBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7590 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In some conditions, the device is able to send/receive frames during scan operation. So, it is possible to use it implement the "remain on channel" feature: we just ask for a passive scan (without sending any probe request) on one channel. This architecture allows to leverage some interesting features: - if the device is AP, the device switches channel just after the next beacon and the beacons are stopped during the off-channel interval. - if the device is connected, it advertises it is asleep before to switch channel (so the AP should stop to try to send data) Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/scan.c | 50 ++++++++++++++++++++++++++ drivers/net/wireless/silabs/wfx/scan.h | 1 + drivers/net/wireless/silabs/wfx/sta.c | 1 + drivers/net/wireless/silabs/wfx/wfx.h | 5 ++- 4 files changed, 56 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/silabs/wfx/scan.c b/drivers/net/wireless/silabs/wfx/scan.c index 51338fd43ae4f..57a2d63dd2a62 100644 --- a/drivers/net/wireless/silabs/wfx/scan.c +++ b/drivers/net/wireless/silabs/wfx/scan.c @@ -146,14 +146,64 @@ void wfx_scan_complete(struct wfx_vif *wvif, int nb_chan_done) complete(&wvif->scan_complete); } +void wfx_remain_on_channel_work(struct work_struct *work) +{ + struct wfx_vif *wvif = container_of(work, struct wfx_vif, remain_on_channel_work); + struct ieee80211_channel *chan = wvif->remain_on_channel_chan; + int duration = wvif->remain_on_channel_duration; + int ret; + + /* Hijack scan request to implement Remain-On-Channel */ + mutex_lock(&wvif->wdev->conf_mutex); + mutex_lock(&wvif->scan_lock); + if (wvif->join_in_progress) { + dev_info(wvif->wdev->dev, "abort in-progress REQ_JOIN"); + wfx_reset(wvif); + } + wfx_tx_lock_flush(wvif->wdev); + + reinit_completion(&wvif->scan_complete); + ret = wfx_hif_scan_uniq(wvif, chan, duration); + if (ret) + goto end; + ieee80211_ready_on_channel(wvif->wdev->hw); + ret = wait_for_completion_timeout(&wvif->scan_complete, + msecs_to_jiffies(duration * 120 / 100)); + if (!ret) { + wfx_hif_stop_scan(wvif); + ret = wait_for_completion_timeout(&wvif->scan_complete, 1 * HZ); + dev_dbg(wvif->wdev->dev, "roc timeout\n"); + } + if (!ret) + dev_err(wvif->wdev->dev, "roc didn't stop\n"); + ieee80211_remain_on_channel_expired(wvif->wdev->hw); +end: + wfx_tx_unlock(wvif->wdev); + mutex_unlock(&wvif->scan_lock); + mutex_unlock(&wvif->wdev->conf_mutex); +} + int wfx_remain_on_channel(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_channel *chan, int duration, enum ieee80211_roc_type type) { + struct wfx_dev *wdev = hw->priv; + struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv; + + if (wfx_api_older_than(wdev, 3, 10)) + return -EOPNOTSUPP; + + wvif->remain_on_channel_duration = duration; + wvif->remain_on_channel_chan = chan; + schedule_work(&wvif->remain_on_channel_work); return 0; } int wfx_cancel_remain_on_channel(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { + struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv; + + wfx_hif_stop_scan(wvif); + flush_work(&wvif->remain_on_channel_work); return 0; } diff --git a/drivers/net/wireless/silabs/wfx/scan.h b/drivers/net/wireless/silabs/wfx/scan.h index 2f8361769303e..995ab8c6cb5ef 100644 --- a/drivers/net/wireless/silabs/wfx/scan.h +++ b/drivers/net/wireless/silabs/wfx/scan.h @@ -19,6 +19,7 @@ int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void wfx_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif); void wfx_scan_complete(struct wfx_vif *wvif, int nb_chan_done); +void wfx_remain_on_channel_work(struct work_struct *work); int wfx_remain_on_channel(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_channel *chan, int duration, enum ieee80211_roc_type type); diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c index c58db2bcea87b..f42341c2baffb 100644 --- a/drivers/net/wireless/silabs/wfx/sta.c +++ b/drivers/net/wireless/silabs/wfx/sta.c @@ -733,6 +733,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) mutex_init(&wvif->scan_lock); init_completion(&wvif->scan_complete); INIT_WORK(&wvif->scan_work, wfx_hw_scan_work); + INIT_WORK(&wvif->remain_on_channel_work, wfx_remain_on_channel_work); wfx_tx_queues_init(wvif); wfx_tx_policy_init(wvif); diff --git a/drivers/net/wireless/silabs/wfx/wfx.h b/drivers/net/wireless/silabs/wfx/wfx.h index 13ba84b3b2c33..5fd80c423d6f6 100644 --- a/drivers/net/wireless/silabs/wfx/wfx.h +++ b/drivers/net/wireless/silabs/wfx/wfx.h @@ -69,6 +69,7 @@ struct wfx_vif { bool after_dtim_tx_allowed; bool join_in_progress; + struct completion set_pm_mode_complete; struct delayed_work beacon_loss_work; @@ -88,7 +89,9 @@ struct wfx_vif { bool scan_abort; struct ieee80211_scan_request *scan_req; - struct completion set_pm_mode_complete; + struct ieee80211_channel *remain_on_channel_chan; + int remain_on_channel_duration; + struct work_struct remain_on_channel_work; }; static inline struct ieee80211_vif *wvif_to_vif(struct wfx_vif *wvif) From patchwork Mon Aug 7 15:05:40 2023 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: 712333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CAD5C001DB for ; Mon, 7 Aug 2023 15:06:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230132AbjHGPGU (ORCPT ); Mon, 7 Aug 2023 11:06:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229986AbjHGPGO (ORCPT ); Mon, 7 Aug 2023 11:06:14 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2081.outbound.protection.outlook.com [40.107.223.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46BA910F6; Mon, 7 Aug 2023 08:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ml5IPmXPU/x0fxeOfkqN5XV3LE2vn3V4GawZDCFixg+0c3rGM9w04ZPdNjfkNNwMXPTYGH9pAIlnTy/VAaz/bf2Ehtamj15/KvYyHfdmkOAqRciBCqlDJflAN5BdS9a5VfFUrYgZEzEgd83ZyZHIxA5RiCtBZChGfSgi3TJLlS4JH127urUFr/cmhluShgztFz0q99y+bcLwkNyJX975dGxANyTYEeBv2Fhje997Xavkm3Uee8H5L7ooVyKeOJ2CxyqN/SnPPzG5fzzmwC5nLmZQH8J+5QtgcUGMS4GTWH4sezAkyLKCYc62LjRkW4eS/QfkPNWEHXgxsGA8SXOEJw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dp9W8JpkBsJI+8roWiTaciR4U5Smckb0Rvxk9abqBoo=; b=V0vn/SYIFS1Ro2+E4v54zW+Pgio1dSoJ97w3bL5UCKErKRpQNUVkNE9+ySikwoE+OpIr9BiMg0oHlz/3lECgHi3RA+vC5k9jqIDh113Nw1X1/IymMyyDHmf8zQJVekeMLFIEnCtulZN1CeFQ+8dUgF/EZMFMo9N8XSy+WIRsvzfLp/WgmuGsMBTdqWKfnhIqUm8bTs1immg2sdAYmE07mulOTCmksOlJ+aobM0mq+syCHPbtJ1nVCKYdRvKTIxCTgPt39qsDyJYejbc8m8NpyqFyNq/LhF4bKZGIIUG1dxH2kWRS4Z9xM3KQ5b2Lll9JSvLqiA+HG0lZ5Zov+VkO4w== 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=dp9W8JpkBsJI+8roWiTaciR4U5Smckb0Rvxk9abqBoo=; b=HM77YneNxRHJVvWdwdO73WZVSAy4WysNB6EFj/q9IF4QrqkCYHguWlggvs2rEmA4Obcfqm15/krNPHW9R8Fdk7TosOZhfH+4niaMaavXQQZbEOlqfOvz4//h1kffzOY7v5TJ9Jg3D7jIE2iyC9tLJpAE9mLSq7XFqaXzY6NRQfA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) by SN7PR11MB7590.namprd11.prod.outlook.com (2603:10b6:806:348::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Mon, 7 Aug 2023 15:06:10 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 15:06:09 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 7/9] wifi: wfx: allow to send frames during ROC Date: Mon, 7 Aug 2023 17:05:40 +0200 Message-Id: <20230807150542.247801-8-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807150542.247801-1-jerome.pouiller@silabs.com> References: <20230807150542.247801-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0252.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::24) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SN7PR11MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: 3df57d7a-3f72-4bc0-502a-08db9757d525 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oQMGDUUR9IbmZhkmvvnI3EWmW22Rh67IQUjtE6XW9LBWBuGn9qoYwMBf6+dQaePrqU9aSvfpiOPXx+L7FtQCczgpWEOWfvzO3pGxnVRUA3rMbMrNPO9+Z3qhrdQDfkVwBm/6ctJIV20PR6gArWPSIDYKm8RxfqcYcNC7pzPoMUh8qtJi7NeFLf+8a3tU/9Bw5j70q1fRGjS9kXv6JQRdjCu3NTTOKPHDce3m/Zjnr1vBRDYPzaLzCH8NvnAiyTJmOQCX+9jVtfzGvDGQK6HChtabTc4VvmjsrHzfnfTfNUnMnRk54/n90VnaDEJZr+zXOF+v8JaxmExD1ozFxzgUNGwXKE35X/EgRDf0rdc3TJwGioEuuF2N2pYUr9UCSxPDfD+EG6j2hZGBicoU+gI0OXCeg4fiIXLyeLR59hR2fhpL77SB/RXPCtT2u2IPrpVpd9n7ARBtuktPpw0PohVsZJ0cUoksi3QXIZFI+uuCpCAWgZ9/SWm3NZaG6KI+kTwwwk6ReO8TbBHOYsfYpTCPBugl7LkO9GthdDIi29SR6OUbxXldn1jyOoQZCux4u52Ymavrrpfi3sp/RhgSL+6HZwVwNAF2hGmFM0O3D4/dY84t9d3ymm9wDrVjVZiX3Okj X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR11MB7773.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(136003)(39850400004)(376002)(346002)(396003)(366004)(451199021)(1800799003)(186006)(2906002)(4326008)(6916009)(66556008)(66476007)(66946007)(6486002)(52116002)(6666004)(66574015)(83380400001)(5660300002)(41300700001)(8936002)(316002)(8676002)(30864003)(38350700002)(38100700002)(2616005)(478600001)(36756003)(107886003)(26005)(6506007)(1076003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?uanR8lOmhu7P8ZY435YZLdRYYNle?= =?utf-8?q?uNGBJAVO3MAHyIDTF76sIZWlSZy5tHeqAUCTsG69AxCTX0Ull6aAH65WCFQKdehx8?= =?utf-8?q?kYVgKS2D+w2lxs0+5n5H+rciF2Hj7bwwnITyyuuuh/Rp2sDimk25pUl0eCMzI0A34?= =?utf-8?q?kBw8tOHEwhaY5SaB/PQinYZAnWMjCDleQJGScFQcJgh2kJAmW0VODWD4vrtZUCR5Z?= =?utf-8?q?S6tpb5/jtKVzuqcigUOdvXDK8aGnPbe6C0bNKHc7rm4P8PnjXqZ58hONYoOA4tXW/?= =?utf-8?q?PqxXzjv5HZoZ3kWGjO4/IiW2CZxt+MmobxJhtiEQGFBnQ3UG3zMhHU5kibDejkRzs?= =?utf-8?q?qNTENocQ7Ym+U8/m9qY0IOZxsV+nqSSIL/pvcTC/WpRSlp0YCy1hhjRSOYEdhI2Yl?= =?utf-8?q?NlD+p2683jcAZ5vEfMq2cNjYOh5FPHSILAC17Im4Nu6DRicNBNRXdaygmB7FEsRxQ?= =?utf-8?q?dVrLaIuhGlafVZ9/ZGAb1wM8FEUTZXYP9TXCQXkUABVRbqUH/rxZiN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WIn?= =?utf-8?q?n+ZHEiQrJOq+HAL5upWXKoAL6E0OH8PTlSzGWkybCwSNaumba/+OxGs0Ls50gLAhy?= =?utf-8?q?jivOPyPopeqnVQsgq3eYtoTirzsiKx4CNXNXxwSCOGIorDMBcSbDlS4rYmVXKhk2N?= =?utf-8?q?6YcOy0uTQkVc?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3df57d7a-3f72-4bc0-502a-08db9757d525 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 15:06:09.8545 (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: EvZelWq9GO//d4OoOVIiG34b10X8uDvKFpGeWGeymz2IrSi5CAIQ+OPAnGkpRPQafckjytU9o6JKrLeB4Fd+QA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7590 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Until now, all the traffic was blocked during Remain On Channel (ROC). This patch allows to handle IEEE80211_TX_CTL_TX_OFFCHAN frames. These frames need to be sent on the virtual interface #2. Until now, this interface was only used by the device for internal purpose. But since API 3.9, it can be used to send data during scan operation (we hijack the scan process to implement ROC). Thus, we need to change a bit the way we match the frames with the interface. Fortunately, the frames received during the scan are marked with the correct interface number. So there is no change to do on this part. Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/data_tx.c | 36 +++++++++++++++----- drivers/net/wireless/silabs/wfx/data_tx.h | 2 ++ drivers/net/wireless/silabs/wfx/queue.c | 40 +++++++++++++++++++---- drivers/net/wireless/silabs/wfx/queue.h | 1 + drivers/net/wireless/silabs/wfx/scan.c | 4 +-- 5 files changed, 66 insertions(+), 17 deletions(-) diff --git a/drivers/net/wireless/silabs/wfx/data_tx.c b/drivers/net/wireless/silabs/wfx/data_tx.c index ce2b5dcfd8d89..e8b6d41f55196 100644 --- a/drivers/net/wireless/silabs/wfx/data_tx.c +++ b/drivers/net/wireless/silabs/wfx/data_tx.c @@ -226,6 +226,18 @@ struct wfx_hif_req_tx *wfx_skb_txreq(struct sk_buff *skb) return req; } +struct wfx_vif *wfx_skb_wvif(struct wfx_dev *wdev, struct sk_buff *skb) +{ + struct wfx_tx_priv *tx_priv = wfx_skb_tx_priv(skb); + struct wfx_hif_msg *hif = (struct wfx_hif_msg *)skb->data; + + if (tx_priv->vif_id != hif->interface && hif->interface != 2) { + dev_err(wdev->dev, "corrupted skb"); + return wdev_to_wvif(wdev, hif->interface); + } + return wdev_to_wvif(wdev, tx_priv->vif_id); +} + static u8 wfx_tx_get_link_id(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct ieee80211_hdr *hdr) { @@ -352,6 +364,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct /* Fill tx_priv */ tx_priv = (struct wfx_tx_priv *)tx_info->rate_driver_data; tx_priv->icv_size = wfx_tx_get_icv_len(hw_key); + tx_priv->vif_id = wvif->id; /* Fill hif_msg */ WARN(skb_headroom(skb) < wmsg_len, "not enough space in skb"); @@ -362,7 +375,10 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct hif_msg = (struct wfx_hif_msg *)skb->data; hif_msg->len = cpu_to_le16(skb->len); hif_msg->id = HIF_REQ_ID_TX; - hif_msg->interface = wvif->id; + if (tx_info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) + hif_msg->interface = 2; + else + hif_msg->interface = wvif->id; if (skb->len > le16_to_cpu(wvif->wdev->hw_caps.size_inp_ch_buf)) { dev_warn(wvif->wdev->dev, "requested frame size (%d) is larger than maximum supported (%d)\n", @@ -383,9 +399,15 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct req->fc_offset = offset; /* Queue index are inverted between firmware and Linux */ req->queue_id = 3 - queue_id; - req->peer_sta_id = wfx_tx_get_link_id(wvif, sta, hdr); - req->retry_policy_index = wfx_tx_get_retry_policy_id(wvif, tx_info); - req->frame_format = wfx_tx_get_frame_format(tx_info); + if (tx_info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) { + req->peer_sta_id = HIF_LINK_ID_NOT_ASSOCIATED; + req->retry_policy_index = HIF_TX_RETRY_POLICY_INVALID; + req->frame_format = HIF_FRAME_FORMAT_NON_HT; + } else { + req->peer_sta_id = wfx_tx_get_link_id(wvif, sta, hdr); + req->retry_policy_index = wfx_tx_get_retry_policy_id(wvif, tx_info); + req->frame_format = wfx_tx_get_frame_format(tx_info); + } if (tx_info->driver_rates[0].flags & IEEE80211_TX_RC_SHORT_GI) req->short_gi = 1; if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) @@ -501,7 +523,7 @@ void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct wfx_hif_cnf_tx *arg) } tx_info = IEEE80211_SKB_CB(skb); tx_priv = wfx_skb_tx_priv(skb); - wvif = wdev_to_wvif(wdev, ((struct wfx_hif_msg *)skb->data)->interface); + wvif = wfx_skb_wvif(wdev, skb); WARN_ON(!wvif); if (!wvif) return; @@ -563,7 +585,6 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 queues, b struct wfx_dev *wdev = hw->priv; struct sk_buff_head dropped; struct wfx_vif *wvif; - struct wfx_hif_msg *hif; struct sk_buff *skb; skb_queue_head_init(&dropped); @@ -579,8 +600,7 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 queues, b if (wdev->chip_frozen) wfx_pending_drop(wdev, &dropped); while ((skb = skb_dequeue(&dropped)) != NULL) { - hif = (struct wfx_hif_msg *)skb->data; - wvif = wdev_to_wvif(wdev, hif->interface); + wvif = wfx_skb_wvif(wdev, skb); ieee80211_tx_info_clear_status(IEEE80211_SKB_CB(skb)); wfx_skb_dtor(wvif, skb); } diff --git a/drivers/net/wireless/silabs/wfx/data_tx.h b/drivers/net/wireless/silabs/wfx/data_tx.h index a5b80eacce39a..0621b82103bef 100644 --- a/drivers/net/wireless/silabs/wfx/data_tx.h +++ b/drivers/net/wireless/silabs/wfx/data_tx.h @@ -36,6 +36,7 @@ struct wfx_tx_policy_cache { struct wfx_tx_priv { ktime_t xmit_timestamp; unsigned char icv_size; + unsigned char vif_id; }; void wfx_tx_policy_init(struct wfx_vif *wvif); @@ -47,5 +48,6 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 queues, b struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb); struct wfx_hif_req_tx *wfx_skb_txreq(struct sk_buff *skb); +struct wfx_vif *wfx_skb_wvif(struct wfx_dev *wdev, struct sk_buff *skb); #endif diff --git a/drivers/net/wireless/silabs/wfx/queue.c b/drivers/net/wireless/silabs/wfx/queue.c index 37f492e5d3bea..b5975d18f09b4 100644 --- a/drivers/net/wireless/silabs/wfx/queue.c +++ b/drivers/net/wireless/silabs/wfx/queue.c @@ -68,13 +68,16 @@ void wfx_tx_queues_init(struct wfx_vif *wvif) for (i = 0; i < IEEE80211_NUM_ACS; ++i) { skb_queue_head_init(&wvif->tx_queue[i].normal); skb_queue_head_init(&wvif->tx_queue[i].cab); + skb_queue_head_init(&wvif->tx_queue[i].offchan); wvif->tx_queue[i].priority = priorities[i]; } } bool wfx_tx_queue_empty(struct wfx_vif *wvif, struct wfx_queue *queue) { - return skb_queue_empty_lockless(&queue->normal) && skb_queue_empty_lockless(&queue->cab); + return skb_queue_empty_lockless(&queue->normal) && + skb_queue_empty_lockless(&queue->cab) && + skb_queue_empty_lockless(&queue->offchan); } void wfx_tx_queues_check_empty(struct wfx_vif *wvif) @@ -103,8 +106,9 @@ static void __wfx_tx_queue_drop(struct wfx_vif *wvif, void wfx_tx_queue_drop(struct wfx_vif *wvif, struct wfx_queue *queue, struct sk_buff_head *dropped) { - __wfx_tx_queue_drop(wvif, &queue->cab, dropped); __wfx_tx_queue_drop(wvif, &queue->normal, dropped); + __wfx_tx_queue_drop(wvif, &queue->cab, dropped); + __wfx_tx_queue_drop(wvif, &queue->offchan, dropped); wake_up(&wvif->wdev->tx_dequeue); } @@ -113,7 +117,9 @@ void wfx_tx_queues_put(struct wfx_vif *wvif, struct sk_buff *skb) struct wfx_queue *queue = &wvif->tx_queue[skb_get_queue_mapping(skb)]; struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); - if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) + if (tx_info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) + skb_queue_tail(&queue->offchan, skb); + else if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) skb_queue_tail(&queue->cab, skb); else skb_queue_tail(&queue->normal, skb); @@ -123,13 +129,11 @@ void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped) { struct wfx_queue *queue; struct wfx_vif *wvif; - struct wfx_hif_msg *hif; struct sk_buff *skb; WARN(!wdev->chip_frozen, "%s should only be used to recover a frozen device", __func__); while ((skb = skb_dequeue(&wdev->tx_pending)) != NULL) { - hif = (struct wfx_hif_msg *)skb->data; - wvif = wdev_to_wvif(wdev, hif->interface); + wvif = wfx_skb_wvif(wdev, skb); if (wvif) { queue = &wvif->tx_queue[skb_get_queue_mapping(skb)]; WARN_ON(skb_get_queue_mapping(skb) > 3); @@ -155,7 +159,7 @@ struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id) if (req->packet_id != packet_id) continue; spin_unlock_bh(&wdev->tx_pending.lock); - wvif = wdev_to_wvif(wdev, hif->interface); + wvif = wfx_skb_wvif(wdev, skb); if (wvif) { queue = &wvif->tx_queue[skb_get_queue_mapping(skb)]; WARN_ON(skb_get_queue_mapping(skb) > 3); @@ -246,6 +250,28 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev) } } + wvif = NULL; + while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { + for (i = 0; i < num_queues; i++) { + skb = skb_dequeue(&queues[i]->offchan); + if (!skb) + continue; + hif = (struct wfx_hif_msg *)skb->data; + /* Offchan frames are assigned to a special interface. + * The only interface allowed to send data during scan. + */ + WARN_ON(hif->interface != 2); + atomic_inc(&queues[i]->pending_frames); + trace_queues_stats(wdev, queues[i]); + return skb; + } + } + + wvif = NULL; + while ((wvif = wvif_iterate(wdev, wvif)) != NULL) + if (mutex_is_locked(&wvif->scan_lock)) + return NULL; + wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { if (!wvif->after_dtim_tx_allowed) diff --git a/drivers/net/wireless/silabs/wfx/queue.h b/drivers/net/wireless/silabs/wfx/queue.h index 4731debca93d2..6857fbd60fbad 100644 --- a/drivers/net/wireless/silabs/wfx/queue.h +++ b/drivers/net/wireless/silabs/wfx/queue.h @@ -17,6 +17,7 @@ struct wfx_vif; struct wfx_queue { struct sk_buff_head normal; struct sk_buff_head cab; /* Content After (DTIM) Beacon */ + struct sk_buff_head offchan; atomic_t pending_frames; int priority; }; diff --git a/drivers/net/wireless/silabs/wfx/scan.c b/drivers/net/wireless/silabs/wfx/scan.c index 57a2d63dd2a62..817eeb3aa8bff 100644 --- a/drivers/net/wireless/silabs/wfx/scan.c +++ b/drivers/net/wireless/silabs/wfx/scan.c @@ -160,7 +160,7 @@ void wfx_remain_on_channel_work(struct work_struct *work) dev_info(wvif->wdev->dev, "abort in-progress REQ_JOIN"); wfx_reset(wvif); } - wfx_tx_lock_flush(wvif->wdev); + wfx_tx_flush(wvif->wdev); reinit_completion(&wvif->scan_complete); ret = wfx_hif_scan_uniq(wvif, chan, duration); @@ -178,9 +178,9 @@ void wfx_remain_on_channel_work(struct work_struct *work) dev_err(wvif->wdev->dev, "roc didn't stop\n"); ieee80211_remain_on_channel_expired(wvif->wdev->hw); end: - wfx_tx_unlock(wvif->wdev); mutex_unlock(&wvif->scan_lock); mutex_unlock(&wvif->wdev->conf_mutex); + wfx_bh_request_tx(wvif->wdev); } int wfx_remain_on_channel(struct ieee80211_hw *hw, struct ieee80211_vif *vif, From patchwork Mon Aug 7 15:05:41 2023 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: 711527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF950C00528 for ; Mon, 7 Aug 2023 15:06:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230214AbjHGPGW (ORCPT ); Mon, 7 Aug 2023 11:06:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbjHGPGP (ORCPT ); Mon, 7 Aug 2023 11:06:15 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2041.outbound.protection.outlook.com [40.107.223.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B37A510FC; Mon, 7 Aug 2023 08:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eKBNjga4HVA4tynnwwL9JnOpAZEvz/dzHZ+DeN0GcUZhuyr5fklGVJAyL1oG0Jw1MNW6sGlEd0L6b4pMRxKUjKLzM7A1PRRU3VIEq2QEmJcdavfRdpW64dLyv40gCD2Z3C0OIGMBoXaOWogseug+MXJgW9SoN0KkImaJtXDViDuu6Ot/jyFWl7OFsIr3/5+cQmqHk077W71m0fn7NOoHPNYjMyFsbd2MLokcukwuDrxXlYAz0plDQYlmhKUajhf9w6cpMGcNoltBK3YhlAdCkDyqbsPo+2QF2imvaFBwg4n6SypKs3oZM+5RSRX1tSaBoB+9F/Fa7c1yn4BBX+XkWg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MDrcTDCa+jCrYxb+wZAdupVXskszFZLV1jIGUVLLGJ0=; b=jSWM5HDrhUTVulRmFkuWFj+zQ1rC5RzuFXTZbV51CbmvTnahd/Gk9HIZ837U+iG1Gq7YLufDksqdPPA5GBmCK+R+bjJfSwX/glD6TMYgMolRukab3OwzBLrxmDTVvBKxEfDs5ZDQjDYzkBUU0N8IcuY6yKFav0dmUOisadPBYrUIdn1OyktbuvCLODmlJgQ9gjHKp2LUA4ehMQS+9oG5lSUYtVqGbMfXZGUl564R7NjQDMd8/WskCbhu0ArB/cHSHrUL7wSzY9abIDFnCSVrJGGjo8DUKcEwy8IRFZ/W0S6Yo0p0KMqpZGeUwmpDlTW/pqjcgk+aLGWTEpk0CpuRdQ== 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=MDrcTDCa+jCrYxb+wZAdupVXskszFZLV1jIGUVLLGJ0=; b=Ph0maI/en1X6MB1k4nX0Ba0PqhdmEIeTNPoA5VmjB7qzo6MGVvUxhfn8KIFtVLJgFD4NcwedcaX5T8r9pBkb0zEx+mFMTlXy66ggB8hVlIkpqUgKiLqTz+8FcCzVYp84lyRMwS+T0nwbjlnkqsQs2RhgC5Qf2yRWJENy28ge/Lg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) by SN7PR11MB7590.namprd11.prod.outlook.com (2603:10b6:806:348::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Mon, 7 Aug 2023 15:06:10 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 15:06:10 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 8/9] wifi: wfx: scan_lock is global to the device Date: Mon, 7 Aug 2023 17:05:41 +0200 Message-Id: <20230807150542.247801-9-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807150542.247801-1-jerome.pouiller@silabs.com> References: <20230807150542.247801-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0252.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::24) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SN7PR11MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: 02b9e598-f85f-4b36-9cf4-08db9757d5af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PpLRvLpvUTQyX9kyV1yT0jtOAeIgXZXTkOvLVNbx4/xw++OpS4GbyAvEOCJ3nOKjF8eKD5RoRdx+jJvMCBYd+UUSF5iVfvxCyqcp0bSp/tepQ27sjZ+P3jQDqdw7/BtxQKHMrfJFc0oDdISlcevcHWTbQPivXp60/IIgVsaPg/GQ0MSmAYP5Il+x5mPPL7RtJ5vJVF9R3qPKGEzfAKe+OdS1fH7peW9QUTEfdztRaapJk0TB7eWbbl9360KVs+LhjMJIzNTK8nE2e7Ch2LERteE3q1Um1IePNWs1uDB9A5sn7asYV+DWGmX4zw30iidePPzowud6goHAlPI5Y1Letk4Il4Rla1CxRu4GAdbY4nbdJYnsthBR0o0RYrMZeitH/CforgrAaawyNH2jCacOrjgiNklAyaIgMMawrs1x5oWD71mlUd026h8lO8DwQljpjPJ68KkyIkwIjF1CKx5CZVuQkl1zOHUKPUua4O2zMZmZFqqtpBsjDBJW7D/f+v/MHNb/8y8cDdWB+ZqNWEb6BV4dsvdW0UmBeCdCTIkjbgFC7+pky2P6QkZntWeFq881vprvJRdgadVO0EA484FuNo1nCfl3sg99j4V+El/gEeTtHyUrmjZqmJipIb9U4nIf X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR11MB7773.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(136003)(39850400004)(376002)(346002)(396003)(366004)(451199021)(1800799003)(186006)(2906002)(4326008)(6916009)(66556008)(66476007)(66946007)(6486002)(52116002)(6666004)(66574015)(83380400001)(5660300002)(41300700001)(8936002)(316002)(8676002)(38350700002)(38100700002)(2616005)(478600001)(36756003)(107886003)(26005)(6506007)(1076003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?GWwgdLi1KknGw+4LYcIt/e8cBVEA?= =?utf-8?q?jVUGXLFjo7o9ZdyE3d3NNE5y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qtfCgjjVoORbL8tA33Y5ag8wn+vHTN/?= =?utf-8?q?ah7lCXjB4nrkQjgRS178Sv7RNmCOp1EVM8vLcnr9+y0f0bGxS8lrcblpPaXpKx9Wk?= =?utf-8?q?k1qZYvtvMLn4H21wtWCYzagJI0N5lW0wy79CFeYl2BzBSUle8Ezl6sTumQl1y0rWU?= =?utf-8?q?EQdNT2TdzcTRR39qmJmkGxK+YscJX+1xFPyjiemrK/gFF9aCbHZL4JOf7qAjO+aRy?= =?utf-8?q?F31ieirffMIYaKIRLPkyFILUGfrhtzWK06iqThIVdZAvnMN03301xT090CYGxr7GI?= =?utf-8?q?VvisE2pNtoWYFyDJok0MxqfMhGnKZgNht2JBLppnfYJTQ5Hsr4UF2VAuXfEf4t2lc?= =?utf-8?q?56cw0eUiRMb0uhoEPR+7zn47clKlyZZioERWhB/kFwDkfYmfemr11uoRHC+BjHtso?= =?utf-8?q?PfBpZEs+RVxMNcmKBwDXQEYWY8lRu+0es0UJBB6s9eVbMpBI8JkNctgDcsl+ku+YU?= =?utf-8?q?au2gIBibBiVdYQ5ucV2fDdsiuD5OhDUd5aXu6V/rM3R7wLzxP9FIIAZc6Grdeizrt?= =?utf-8?q?8PgdyJAiua/pSHwTUiosY6LGyL025jTlcry4SluSARbJVsEbfMwEBKMyA69/sGelp?= =?utf-8?q?M+tbVEIUYpNc?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02b9e598-f85f-4b36-9cf4-08db9757d5af X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 15:06:10.7015 (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: 8TwZ7M5F94by+UT3w0bAJ799s0+I+trPM8AZLkYJDaVLGk3NgPDH8npv7+W4Rg5BzNqACKxN3QFu3A5IQZZKcg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7590 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Currently, one scan_lock is associated to each vif. However, concurrent scan on vifs is explicitly prohibited by the device. Currently, scan_lock is associated with conf_mutex that ensure that concurrent scan on vifs cannot happen. In the only case where conf_mutex is not associated to scan_lock, the scan_lock is tested on all interfaces. Short, this patch relocates scan_lock to the device and simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/main.c | 2 ++ drivers/net/wireless/silabs/wfx/queue.c | 6 ++---- drivers/net/wireless/silabs/wfx/scan.c | 8 ++++---- drivers/net/wireless/silabs/wfx/sta.c | 15 ++++----------- drivers/net/wireless/silabs/wfx/wfx.h | 3 +-- 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/drivers/net/wireless/silabs/wfx/main.c b/drivers/net/wireless/silabs/wfx/main.c index a0906d7d026e0..32564f5c98e5c 100644 --- a/drivers/net/wireless/silabs/wfx/main.c +++ b/drivers/net/wireless/silabs/wfx/main.c @@ -248,6 +248,7 @@ static void wfx_free_common(void *data) mutex_destroy(&wdev->tx_power_loop_info_lock); mutex_destroy(&wdev->rx_stats_lock); + mutex_destroy(&wdev->scan_lock); mutex_destroy(&wdev->conf_mutex); ieee80211_free_hw(wdev->hw); } @@ -318,6 +319,7 @@ struct wfx_dev *wfx_init_common(struct device *dev, const struct wfx_platform_da gpiod_set_consumer_name(wdev->pdata.gpio_wakeup, "wfx wakeup"); mutex_init(&wdev->conf_mutex); + mutex_init(&wdev->scan_lock); mutex_init(&wdev->rx_stats_lock); mutex_init(&wdev->tx_power_loop_info_lock); init_completion(&wdev->firmware_ready); diff --git a/drivers/net/wireless/silabs/wfx/queue.c b/drivers/net/wireless/silabs/wfx/queue.c index b5975d18f09b4..e61b86f211e53 100644 --- a/drivers/net/wireless/silabs/wfx/queue.c +++ b/drivers/net/wireless/silabs/wfx/queue.c @@ -267,10 +267,8 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev) } } - wvif = NULL; - while ((wvif = wvif_iterate(wdev, wvif)) != NULL) - if (mutex_is_locked(&wvif->scan_lock)) - return NULL; + if (mutex_is_locked(&wdev->scan_lock)) + return NULL; wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { diff --git a/drivers/net/wireless/silabs/wfx/scan.c b/drivers/net/wireless/silabs/wfx/scan.c index 817eeb3aa8bff..c3c103ff88cce 100644 --- a/drivers/net/wireless/silabs/wfx/scan.c +++ b/drivers/net/wireless/silabs/wfx/scan.c @@ -95,7 +95,7 @@ void wfx_hw_scan_work(struct work_struct *work) int chan_cur, ret, err; mutex_lock(&wvif->wdev->conf_mutex); - mutex_lock(&wvif->scan_lock); + mutex_lock(&wvif->wdev->scan_lock); if (wvif->join_in_progress) { dev_info(wvif->wdev->dev, "abort in-progress REQ_JOIN"); wfx_reset(wvif); @@ -116,7 +116,7 @@ void wfx_hw_scan_work(struct work_struct *work) ret = -ETIMEDOUT; } } while (ret >= 0 && chan_cur < hw_req->req.n_channels); - mutex_unlock(&wvif->scan_lock); + mutex_unlock(&wvif->wdev->scan_lock); mutex_unlock(&wvif->wdev->conf_mutex); wfx_ieee80211_scan_completed_compat(wvif->wdev->hw, ret < 0); } @@ -155,7 +155,7 @@ void wfx_remain_on_channel_work(struct work_struct *work) /* Hijack scan request to implement Remain-On-Channel */ mutex_lock(&wvif->wdev->conf_mutex); - mutex_lock(&wvif->scan_lock); + mutex_lock(&wvif->wdev->scan_lock); if (wvif->join_in_progress) { dev_info(wvif->wdev->dev, "abort in-progress REQ_JOIN"); wfx_reset(wvif); @@ -178,7 +178,7 @@ void wfx_remain_on_channel_work(struct work_struct *work) dev_err(wvif->wdev->dev, "roc didn't stop\n"); ieee80211_remain_on_channel_expired(wvif->wdev->hw); end: - mutex_unlock(&wvif->scan_lock); + mutex_unlock(&wvif->wdev->scan_lock); mutex_unlock(&wvif->wdev->conf_mutex); wfx_bh_request_tx(wvif->wdev); } diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c index f42341c2baffb..496b93de3ee58 100644 --- a/drivers/net/wireless/silabs/wfx/sta.c +++ b/drivers/net/wireless/silabs/wfx/sta.c @@ -97,9 +97,8 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, FIF_PROBE_REQ | FIF_PSPOLL; mutex_lock(&wdev->conf_mutex); + mutex_lock(&wdev->scan_lock); while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - mutex_lock(&wvif->scan_lock); - /* Note: FIF_BCN_PRBRESP_PROMISC covers probe response and * beacons from other BSS */ @@ -126,9 +125,8 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, else filter_prbreq = true; wfx_hif_set_rx_filter(wvif, filter_bssid, filter_prbreq); - - mutex_unlock(&wvif->scan_lock); } + mutex_unlock(&wdev->scan_lock); mutex_unlock(&wdev->conf_mutex); } @@ -621,18 +619,14 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) { - struct wfx_vif *wvif_it; - if (notify_cmd != STA_NOTIFY_AWAKE) return; /* Device won't be able to honor CAB if a scan is in progress on any interface. Prefer to * skip this DTIM and wait for the next one. */ - wvif_it = NULL; - while ((wvif_it = wvif_iterate(wvif->wdev, wvif_it)) != NULL) - if (mutex_is_locked(&wvif_it->scan_lock)) - return; + if (mutex_is_locked(&wvif->wdev->scan_lock)) + return; if (!wfx_tx_queues_has_cab(wvif) || wvif->after_dtim_tx_allowed) dev_warn(wvif->wdev->dev, "incorrect sequence (%d CAB in queue)", @@ -730,7 +724,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) complete(&wvif->set_pm_mode_complete); INIT_WORK(&wvif->tx_policy_upload_work, wfx_tx_policy_upload_work); - mutex_init(&wvif->scan_lock); init_completion(&wvif->scan_complete); INIT_WORK(&wvif->scan_work, wfx_hw_scan_work); INIT_WORK(&wvif->remain_on_channel_work, wfx_remain_on_channel_work); diff --git a/drivers/net/wireless/silabs/wfx/wfx.h b/drivers/net/wireless/silabs/wfx/wfx.h index 5fd80c423d6f6..bd0df2e1ea990 100644 --- a/drivers/net/wireless/silabs/wfx/wfx.h +++ b/drivers/net/wireless/silabs/wfx/wfx.h @@ -43,6 +43,7 @@ struct wfx_dev { struct delayed_work cooling_timeout_work; bool poll_irq; bool chip_frozen; + struct mutex scan_lock; struct mutex conf_mutex; struct wfx_hif_cmd hif_cmd; @@ -81,8 +82,6 @@ struct wfx_vif { unsigned long uapsd_mask; - /* avoid some operations in parallel with scan */ - struct mutex scan_lock; struct work_struct scan_work; struct completion scan_complete; int scan_nb_chan_done; From patchwork Mon Aug 7 15:05:42 2023 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: 712332 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76EF6C001DB for ; Mon, 7 Aug 2023 15:06:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229732AbjHGPGX (ORCPT ); Mon, 7 Aug 2023 11:06:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230091AbjHGPGR (ORCPT ); Mon, 7 Aug 2023 11:06:17 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2081.outbound.protection.outlook.com [40.107.223.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADBDA1701; Mon, 7 Aug 2023 08:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vy6NHgGMLQRyzVl125bxezpjl5OSwWVFl2G5C/8HICLvHaIQCDIPqtbPitUC19nSy9kxM3HbtfKYMSX1qG/LpjGSytwy+MgiaaiKoPA0FEvgeVp8yWzngTtloDloNfJ45HpqAKunfr+GGQSHkYlBnKPBJPw7eFRffZOIAefuW6po7GxeXMSuju+nawaocLMkIn11Q6RtPs2iPcOXnj+uD7OEElSAa7sG7BHKeqE/fAk2ipOMORUmJm9mJuDqL4GsJa6UASnddiw3Ym73N7fxYTfyNApbOOpphPUnpBsYJNe6l5/dtPENqxm/qvDvIbqtE99wH9m/1I5AUYnkKXuwQQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZPRftwa/5INHUuf/U0IO6DYv07+MkuBCaxGoh+MZ00E=; b=I2ySPq75AtXbW2qYUG4G7sozx70ZIEvq2wtfCCqe55RkuHNvl6V+m3zx9B7bpsvsUieE9qi+zftXWDcDsAyqEGyGt8offvjighRiIQx/lBzZc03+7C4GKdXQUepkfb2cDkEPzLl25hWSGivQlNYgh8ECwSKUzMqARhzSLLouK53XViG4G/7FSwvc74gvYIrIbhbVXte1fSod+yTpChm1X+lbRTThdu+jpnhmuSy4jmWKiJhU/YAviQSZMLEiWQLs7NDZTDmukTO6PAR/ZZpB0XzH552yofZge6nXQ1rce7Ol2PZlt7ZG46IFX3xWPGtVsvf6bArQR3tzAOz8HsPoJg== 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=ZPRftwa/5INHUuf/U0IO6DYv07+MkuBCaxGoh+MZ00E=; b=alK9AcXWM4JWfOVcWoGfsxba6SA6KaHSgO0ESeAyzk9IA8G4zPNvkeIH5DsMfqZiLvEY8LeqB+SxTBvFXss0uLG9Wxgqdn553kequ490iap6+8sq/bnbC6ojoOJgSBqYLoox9aNg058+4xL4WxXoOiFfk6pcsQNdm7YQ5e564zU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) by SN7PR11MB7590.namprd11.prod.outlook.com (2603:10b6:806:348::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Mon, 7 Aug 2023 15:06:11 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 15:06:11 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 9/9] wifi: wfx: fix possible lock-up between scan and Rx filters Date: Mon, 7 Aug 2023 17:05:42 +0200 Message-Id: <20230807150542.247801-10-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807150542.247801-1-jerome.pouiller@silabs.com> References: <20230807150542.247801-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0252.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::24) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SN7PR11MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: 62c679e4-8df1-4146-9af0-08db9757d62b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pYE8zqrqxp3sscWQ2ZMasbkAXC4XLpfDl01/lCigHW7nElyq3H1x2PmTiGnoHNAzIwSZ7wGmXOj7Ld3mS2DloGLg9s3Im/ykWNWIVGyKrhV3LIkrwGLMvNgtRC92Rg8iq4k8NB4cEc/XzsFzkvybz/4yapzOdI0DgnyX9koiAAtBPq8YbkGAa7L0YmM21PAFmawfBvOx+Wm/KQEsE8QV9F/COcIlruoeVDXMnok3OCE7Uj5YYeElokOxYnuc5JoYrsWB6q9M+ZVfkV8p1r/MuCGBgRw5zA3k1WM9sjd+KqTdz0LZH1JB2tRYFA5cPTg9hWazwbakP+Z6mw6iooXGmIul4JhzjkkzZFJS1CZwCBykfrqswb0DNr72Utv+uSmHVmzpCaM/UjXEYYFTiaS/yA+FrT409UaJiPU75mhnDNVGGoFWOMkQjgzYIxlrG9K+f6hB5/OEZl4lwjHV07RXACVV78JNGdpdfcL1BCxs+rtPAaPUToFJOpGp8zirreH5VcRSKE/pXxx7cXdxENQMpP+0AXMVEcm38zrSUHfIz1KA6ECQvI+pZ3303mMreKrnUnE7IuEoMisIXQrBvXOAL8dDZw+WhmGWg19bnfPeKjr1dhMXfPW+IjrbyJU3GYi7 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR11MB7773.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(136003)(39850400004)(376002)(346002)(396003)(366004)(451199021)(1800799003)(186006)(2906002)(4326008)(6916009)(66556008)(66476007)(66946007)(6486002)(52116002)(6666004)(66574015)(83380400001)(5660300002)(41300700001)(8936002)(316002)(8676002)(38350700002)(38100700002)(2616005)(478600001)(36756003)(107886003)(26005)(6506007)(1076003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?x4zFoaH4sGglWJ+pKlDO5cdEEHix?= =?utf-8?q?g9TE1MV+qjN3P8PPegmCucBkOVA6xd/Kp2AI2czI2CShvoCEUjZvrajgYQwu9Ed81?= =?utf-8?q?SHiAXv8fGLJd6YhZ7XXA+kYc923QMxLLv1ugzSo4gdpjieTYVqji7rnmrcirAvh8X?= =?utf-8?q?DlG/HXFBLN3RJ0NEAZjowQx1dQ2XyWPo9glHmVIl0XX+Bx4FSGs1grOIPuQddPGMl?= =?utf-8?q?CfAnFwKLJRdxCjcQETgVrcDcJAMpm3NEdUHT10ZDL+p+FFVzFTpy8xbns2kMiX6xm?= =?utf-8?q?Nk2le190c2yzYyys+hMXh/QeJob2NzxzEJoqYuTYTKZGNEzOGxIYu0vJoM3TEUtlw?= =?utf-8?q?sg5fozBNy2oTEblrEES4+5gc/U+lWPp5xDpYUK+HnZNh4lk5fNPnMCaztm2ofv+4m?= =?utf-8?q?L7afD16wyjpfuxomfUwHiCfSxw26NtE+cqzLx4oI5rwBM4w3WAoZfQA3ZhZxzbyWK?= =?utf-8?q?es9dmX3UGFyySRS+jCjRTGluizgZaeCYBHsKFyp0KRIPGubidZXcWhwhzvxuRXu95?= =?utf-8?q?LD6E4HvPubMoJK1j/kNT5UEelluKMDgzRUMImzMl0mwf3fczS24saMRrkaUD44Btk?= =?utf-8?q?kvKYQhBXtALRxvkj02V0LUh6wIjps7kTYUuXSG8WHN9nC/7QxcKVd92ZmmR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= =?utf-8?q?k4baUU5BjC5j?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62c679e4-8df1-4146-9af0-08db9757d62b X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 15:06:11.5201 (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: R8q+QPp6zj6S25Ii+K42rh19ALr1HObFvvzYY7Hs1TqGhom/omlrp7ncLBGpqYnfNHXqAcsTW/pz4jpAR1Tf+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7590 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The device ignore the rx filters during the scan operation. wfx_configure_filter() acquires scan_lock to reflect this restriction. However, it is not really necessary since mac80211 don't try to configure Rx filters during scan. However, the things are changing. The scan operation is also used to implement remain-on-channel. In this case, wfx_configure_filter() can be called during the scan. Currently, this scenario generate a delay that end with a timeout in the upper layers. For the final user, some scenario of the EasyConnect specification end with a failure. So, avoid acquiring the scan_lock and just return. Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/sta.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c index 496b93de3ee58..1b6c158457b42 100644 --- a/drivers/net/wireless/silabs/wfx/sta.c +++ b/drivers/net/wireless/silabs/wfx/sta.c @@ -96,8 +96,11 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, *total_flags &= FIF_BCN_PRBRESP_PROMISC | FIF_ALLMULTI | FIF_OTHER_BSS | FIF_PROBE_REQ | FIF_PSPOLL; + /* Filters are ignored during the scan. No frames are filtered. */ + if (mutex_is_locked(&wdev->scan_lock)) + return; + mutex_lock(&wdev->conf_mutex); - mutex_lock(&wdev->scan_lock); while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { /* Note: FIF_BCN_PRBRESP_PROMISC covers probe response and * beacons from other BSS @@ -126,7 +129,6 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, filter_prbreq = true; wfx_hif_set_rx_filter(wvif, filter_bssid, filter_prbreq); } - mutex_unlock(&wdev->scan_lock); mutex_unlock(&wdev->conf_mutex); }