From patchwork Wed Oct 4 17:28: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: 13409096 X-Patchwork-Delegate: kvalo@adurom.com 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 C3BC9E7C4E8 for ; Wed, 4 Oct 2023 17:29:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243679AbjJDR3F (ORCPT ); Wed, 4 Oct 2023 13:29:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233422AbjJDR3E (ORCPT ); Wed, 4 Oct 2023 13:29:04 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2054.outbound.protection.outlook.com [40.107.94.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E515ADD; Wed, 4 Oct 2023 10:29:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eC8Mj/yusLcHCQSL6L4QF8AEV+HIVbuMnKOTK8G7RFKoqlJFBOWW5SOHsaYGGvm1PCSAzxs/MtlhLPl8lc5Yc2ZGv3ZLyFjYH6WBRa1wpfoJf0DKaE6vUD4o5KBKKTE+0Y5TQyqM4eCXgckyG5GNho6Dlt5b8quPa2n8IYV2I4WlFoE3Kp49CpxbhQBnjYCQVcNokYdlc7fzxCRbfAlpZuulqvORTalVL9huw1uQ6hK6Q+TmOTyYN/kkZEHcCzZWxNhsl0XbazatlJQLieOUedjHDv0TuSG8fzgFYDAvEGLLc0yc8shgNjMBJDsTg4VZ85RcN/rXa5lhfkT7sYbdkg== 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=eZHHQ7z+gYAqzUaomMkt2aUcFnqsR1wYgwonnDaioow=; b=P6PieRKs61IcaoFbBjyhO3VkLAikYeJHplHJXp69ieFsmzJldk27g5w5QUxdOhsmlayJPP4/jKrG7JpPaJQPJ9S59gBR9YR/JLsgHNOs3xjPCotKmNv+gc0cpRn4SCaqg6MddS4PKDrLe/dCwxfA+jgZ91f5qwWFJreMpcSEcTCeXw+edUF2MCqftUCXKweWHr8OPbYjrey1yBM4+cScMfFUSOS0wL7zx2S4u95J1HucBFs8Sje5GReQyfoFItvl0ThnSJBYrsEzchGsEHKFMtpHwmTSK5Du25LK1O1EuB3AfuDrI+H0Y9RB0qSf1SDHa9RdiZ4FEtBkVC5EkWE36Q== 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=eZHHQ7z+gYAqzUaomMkt2aUcFnqsR1wYgwonnDaioow=; b=NDxc9jFnFw6CtuMBpluxOmJNX8m9GByfEkqvUY9qf11WoHdjCu1hT9H45d9a1mkEb2MDMi3TDmcssSAa+Vi5ILFyRF68MNRNsQ8YGu5NRtebERXoH64W02K1AfXHesSUt7/GQoT6iPMhJlajDDdVMQRrLuBdClDzCiABxKsdPHY= 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 PH7PR11MB5982.namprd11.prod.outlook.com (2603:10b6:510:1e1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.34; Wed, 4 Oct 2023 17:28:56 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3%4]) with mapi id 15.20.6838.030; Wed, 4 Oct 2023 17:28:56 +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 v3 1/8] wifi: wfx: fix power_save setting when AP is stopped Date: Wed, 4 Oct 2023 19:28:36 +0200 Message-Id: <20231004172843.195332-2-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004172843.195332-1-jerome.pouiller@silabs.com> References: <20231004172843.195332-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR03CA0305.namprd03.prod.outlook.com (2603:10b6:8:2b::25) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|PH7PR11MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: a36ddfe4-d6a1-4e5a-d0ae-08dbc4ff6320 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oZMGXU/vrOHpFcWkJ7CVAgTVxDPIw3837BRbWbkbQ1N/rvPSYdD0Z8bwFfjSxYDgJAvBX6pn2deN92De3Y7SJSYkGeCNWYSNLZ9SXwzXZK0DGl8IZ8IQKOAgXpJaZO8jGMHNivxpmm4LmKzZM1957qCxRJ/thZYfDuCpfxMlJjZ4MjiOWL81mUgJ7Ya3qI3cR0soLDYhjPcpoccv3Ijlm/AUCqFY6ZtbOTqTXVcGxngAqu1yBQPiVLI4QleCZQPk+7eza4GQPTxADniUFuibUVngKg33u10K8ZqFe2MP9HIqmFz49ncgx6OptF4wbleb6S3kvb5zbZ9ZHnS9BzdF14zvzQ4H8cpb4FocOZXL6eLoP1fjp82Le414BzFnvucNMWu8D1XZeeKkHJd9d19P09XnQsgJ/4pkORI6r4+CEo0WbDg8gouJWpZeqTvN+9V7gGRzgV+PzscFL7T8pGNK6nYZgcwbuBqRefHdiFSm1PAHoyFHPITXt8rRieevmkBUaR477GdzGtaSBsQF2Bw9ifVBeQ3mBuEM5JMdY6E3vZTNHmViwk5tQP7rPsrjG3MN 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:(13230031)(376002)(136003)(366004)(346002)(39850400004)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(6486002)(36756003)(6512007)(38100700002)(6666004)(52116002)(86362001)(478600001)(6506007)(66556008)(66946007)(66476007)(316002)(6916009)(41300700001)(2616005)(107886003)(1076003)(8936002)(4326008)(8676002)(66574015)(5660300002)(83380400001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?UKKxxmIjVKZgkhZ8wkAIoHD9WO14?= =?utf-8?q?I82h6p1pYqPY2QPZziqQc7eZ1FWZkkbZjqDXgVpRBGizcRKATgU8LX9A1ZlwjezjO?= =?utf-8?q?StiHCovqeZMKmhAdAEWKRMRsc5WelBVy0JA0WEU2Ipb8SYFFSnUmH8tzXaZyuOC0r?= =?utf-8?q?COJNVwK5gyh1XnKfYi5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n3VsAY2/rnIWAfL82XGch2T4ZxFZTA99TMPWd9VQ?= =?utf-8?q?1dC94TSmNeuyliHIf5C7U8ob/AM8v6j7Bny0dVMTZAkfSQJOQN0ZFKKxHePnngU9W?= =?utf-8?q?tX0e0IIkfFPoPjTODc9gyBGgz7kjFfCMUiKs0F2SrTED/zBjsg2OX82cVIDGHWkFz?= =?utf-8?q?rPFxQj6ZwWGXjrAoI6QdDIQAc9tDLW1OiY01c1ytDNIa+OFEkVvxVllZtqBZtpEqX?= =?utf-8?q?PLoQFUUokJh+FT2tlNXLS4YNFwL/3vHniqwzGVmPs6EYOso+QlIvJlHLIiEdh7i1e?= =?utf-8?q?QtOcv4Z0a13mFbmG628BM6WwhNEPD2aajn/wRRx9cd5+L0PIsbzMsJENRQ2Uj6hfw?= =?utf-8?q?5I0cXGic5B/5KPdy1kfzzN8zLJt1PxwPZKHz28Denm/lhG97EelRfVZonteGmyJT2?= =?utf-8?q?vFp4rpaH+PbDm33mVNkFgmIp3gKl2zFlxJTKJLUASTWd2TBKxtlpNMviKCs/A6kAr?= =?utf-8?q?iirjx3Iguq7XQQb9xQROCguUD121AH3YSI2uzwCiUP8AA0jaBs20NaCs0WjZLOLMN?= =?utf-8?q?nZcWT0qfbKv?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a36ddfe4-d6a1-4e5a-d0ae-08dbc4ff6320 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:28:56.4059 (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: LQ3vP+cMnFKxBa3U9T9m5MtkAHgk2RNYMh2qSRQdh9FPlMdVnvbsrmkTEHaVVx2exAHEZP4/82+nd0Ntde9q9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5982 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The WF200 allow 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 Wed Oct 4 17:28: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: 13409103 X-Patchwork-Delegate: kvalo@adurom.com 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 B4C90E7C4E8 for ; Wed, 4 Oct 2023 17:29:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243731AbjJDR3X (ORCPT ); Wed, 4 Oct 2023 13:29:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243689AbjJDR3N (ORCPT ); Wed, 4 Oct 2023 13:29:13 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2053.outbound.protection.outlook.com [40.107.94.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA534A7; Wed, 4 Oct 2023 10:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=laRXG6CIpEE6TaINlFtrZ7qAJxhtXgs9k1D5xmIw2S1q3U2kl36+ZzmrIkI0ZdL5Rj5dNqyMU3EGBKrE0J/UEavKIYu7fYGliXAzgYVzlzg9ivzaWosUXipfPfHZpzUDqhfgG7cxOVfZSqqFdwOdqpZZABWfK/3jwqYkcg/X/0TZO0CrNA9GZ3sRvZwqL9b+h8y1E2nJ/6MFQTfgWdkIBT0yZqmOZf5GdmTTjyZRHpJo1N2reWMdkeKawSRnBpF1PTWZQQvbAAV6lOGOk+r2bI9U5yohmItCI68/Bj8MMpA5lQp5VBqefge8k4SDMoMT/jpHVRgCFlstbPqlLyHCZg== 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=EwIaUrNrCW3n84R00YvxajMa9LvmWXVQvvcnYf1NHIh+s7yJ8ftreA+I27kR0tffjzyCsrHxg6t8WKFVOGUxeCB/TsJXxGhfPZkOD18OUcMNC5rw41VPzEiccLSQdvre64rNk/q3FxyP6OhI2LElj8uGwtbhOJr1MnbA6jYY5dHHViMjQk+Pj0M7hLrvsqDwmfml5mBMUR9xBQLMRZF8YGcACP/IfvhNG1IHREicvVwGflIyjEMCEmawbNA09+2hgrFFsiYdfiLKIt+/D8ASxg9XCRSPmjRJXpGVXcy2nWkN6wAMl92d/0LSFr/h/ttBhlzQJ7u7J5Fm9fDzpywTNQ== 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=o75cJpJtJBwDmSxh2rzB5zrJRbxazcd1hTuxaC0/oBY0eyORfHHJza5eQmGMWPimFe+0RVIcIJ2cSZ3WKKqBz9GvQhvwlHNwqx9m7walsGu/FBex0qUSCyjKGTfst+fFuBUf8W1YhvILYKW9zrPFQK6EnDPZXDG9aN0cjSIXX/0= 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 PH7PR11MB5982.namprd11.prod.outlook.com (2603:10b6:510:1e1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.34; Wed, 4 Oct 2023 17:28:57 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3%4]) with mapi id 15.20.6838.030; Wed, 4 Oct 2023 17:28:57 +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 v3 2/8] wifi: wfx: relocate wfx_rate_mask_to_hw() Date: Wed, 4 Oct 2023 19:28:37 +0200 Message-Id: <20231004172843.195332-3-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004172843.195332-1-jerome.pouiller@silabs.com> References: <20231004172843.195332-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR03CA0305.namprd03.prod.outlook.com (2603:10b6:8:2b::25) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|PH7PR11MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: 548c618b-fea0-4d8a-4370-08dbc4ff63f0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E5V5M2pEkRHL7tLoZAGRO9usdWKX1IrYoVKrdEY/wdpRKt0sUe7D/PwflCy4Udy5t47PlB1xG9zDAmuj+Gdfj/aYupG2mBG2F8ErXbpETkE3mg9YaAYhjbg5Nj5XK0m/UoaRtkn7utDY9XEd0+GmPQZz1Lhpeaic2m+/qgmCu8fxckCGevBGhinP0RR2J4C05ypnEkd3YpoO59YwyGaiQuTWrZPahiA33BnpH+SIrOF1pLTdWNWU2k4BmBPg4tr1i9kvNRTv+qJ+BsL0zGjtOfVXPWX9/qIdplJftU6wfdE+GsRtYZVhc/Ecbm+kjhRUxNDAxC+mbk1Bft18kDY1xfa+nL6tCF8LuSoBPtvum/UC+8m12zjbRAsPL7vPC3o3WkR8vK1lT1pNEBlQ42KwFLwSvgYd3z1vT/xfLJJbemPwr1aWUsrX9uU2+Qr3nHrDwObAg+U2Qm9dqvOl+WihAmBQEt3cOxT1vtVtRlA5FidZdk8MsB6LaLrSuzImJ/f7lPteo6dcLMMxVuEl6VGJHGGDA/4vAoTLxRPrs31gM9X8IyAvQpxU7j8lHNgAlSl/ 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:(13230031)(376002)(136003)(366004)(346002)(39850400004)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(6486002)(36756003)(6512007)(38100700002)(6666004)(52116002)(86362001)(478600001)(6506007)(66556008)(66946007)(66476007)(316002)(6916009)(41300700001)(2616005)(107886003)(1076003)(8936002)(4326008)(8676002)(66574015)(5660300002)(83380400001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?nNS6EAs0e0OneECAWo/7Igh3Sa6z?= =?utf-8?q?PgO4BFarHWGdkt6/usd0nDcday1ZHvYKkBB2R996KGUKwzBZTFk4sFW9IQZCyuFw1?= =?utf-8?q?ZcsHCcuBnCBl26B+q3BwIDDtFCjK8I7qs0Pcn+4NO0q/rOjUolS6kfbuXZAzGo3T4?= =?utf-8?q?x9w3pCVLihcPzM7OBd3uYXMdyNJcEeoHTEoSoTcxgYxJtmuV4LFGgZwby0BGu9n/E?= =?utf-8?q?+bC6PDuO8a/4eciGk1iHT4NW8IrpEkZ86ZxVacwNfaFXz+w/tRXa0mcwKUEl5p5M3?= =?utf-8?q?ZMRZfjHazrb/3H6EnZP2w1n6Ywk5pSLAotPm5AJCwqSfCnTW1vj8wmptrfEN3eMXT?= =?utf-8?q?jx6OczwqWaS5/WwWRSOolCnzWy13TvYCidRo6Py6fFfDLJu2ys4odmeG450DkxH1t?= =?utf-8?q?DeUTkuyL000vcy0MSSGld3otACCcyL5tev/JiqcV3Y9qK4hmVEr1DLGIozkj21/zO?= =?utf-8?q?gODzJAIqH2EO6XoT1T0V5+ElzoV+GWz7ehOvKRt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BcvNvkqGNaxIvJMxi8GEZnakfocay75jzLOgD?= =?utf-8?q?m/so5P4U62iZQbMEqDKuiX6VdDRu/pP/eMnO+VLE9IX+Q3NFkxr52Nvn0LiidpTaN?= =?utf-8?q?XsrK0xQ7UoVOPWtyMG+BPy+FaM47bbL2CLoS1+zk7hYm3wM1qxUv4icpkOVQfWdPB?= =?utf-8?q?klEYUrrKgANYEynH+KAF/LHYJ3URHVK7uleSc8JWFUysvGAlw21OmY1E7kvQW0u5g?= =?utf-8?q?Aa+1yNTJwqq?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 548c618b-fea0-4d8a-4370-08dbc4ff63f0 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:28:57.7424 (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: LQnnQKM3fmwn5kY4P+c5GcbRVYh5D9RpG30S1/Hnwe8rZ3zFlm7C4R9jmEbdf2J4PwpfmF5szXaJgSCX3gbWRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5982 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 Wed Oct 4 17:28: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: 13409097 X-Patchwork-Delegate: kvalo@adurom.com 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 A3FE3E7C4E2 for ; Wed, 4 Oct 2023 17:29:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233422AbjJDR3O (ORCPT ); Wed, 4 Oct 2023 13:29:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243698AbjJDR3L (ORCPT ); Wed, 4 Oct 2023 13:29:11 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2082.outbound.protection.outlook.com [40.107.94.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05509C6; Wed, 4 Oct 2023 10:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fzhEmLqZTWK/E7tYnq8b7SCCYwrECuTcxDsjtdqz8rwtgwX9ljPPjDxTvfHclOUIALnEGnsmYY7SGG4+pz0TOQb0CHuZgKCMkdvc0JrUQCENgIIHB28uvOXhKwkgY6VQEEI8Y0KbK0T8sGupRzik8ALh3P/jLFukisl2mqlQuQHgsq+txmk7eskhusSfLWXtc/0vO6+jRDzebZrvGCkVfIXi3ksdomTdQV7dpoFm7eabpk/yplX9wajnud3RS7BTR7/pCYwieL1Yw0oWcUfTOiiYQokVTVaCGigaZnS+NXV7KH5kBP31ZlQtBlB+n58xmJHGklqHD/M/9tGO+O3jew== 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=ZnYZmvPqNbdn2FY20SPI8mEI3Ll7MqB3DYhCZ9VKF4ASCKfhXagF5piyGdRDA1tUX6edWFPEfdTK4nXBbT7hYBebbB1mfeY4lVcXMuSgrDoee0g6ewud+fYOybTyIkRUgvlxvAwezyHjhGhU+iGlRIXmco0E6coHyaSs1/BrC3twBtcTKG1WmFOavN/iLa04s5TvaaQE3LDXrY9EKnXyZ/rvtGe51kVjJKSotMCdBn3xm/jxsU94ej1mk51zmMhlO3/QHdBt5V8lWsjJL89IBGIL4KwkgUMc/n3tClpISUjSXz41PBSA6k2VXio58L+YXlFgQ7Vy0mLP3zmRyHYXDQ== 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=DsYClD3F1hb8tlx6MGj12XK6Jb/TMzdjDZXSxUKgdhmFJIfVZEbfkDwBZmbH3bXLgS3V9TL2RTGbI56rsa5qYl82IzerkWJv29Xp805Jrz6DiPXTW5zUzMWQ81EdLMbhkNvRb+y/lWBzBMdm72TxLgge6UM+6ylx3yuqol0Tosw= 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 PH7PR11MB5982.namprd11.prod.outlook.com (2603:10b6:510:1e1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.34; Wed, 4 Oct 2023 17:29:00 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3%4]) with mapi id 15.20.6838.030; Wed, 4 Oct 2023 17:29:00 +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 v3 3/8] wifi: wfx: move wfx_skb_*() out of the header file Date: Wed, 4 Oct 2023 19:28:38 +0200 Message-Id: <20231004172843.195332-4-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004172843.195332-1-jerome.pouiller@silabs.com> References: <20231004172843.195332-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR03CA0305.namprd03.prod.outlook.com (2603:10b6:8:2b::25) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|PH7PR11MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: 96a3ed65-6213-40be-c91a-08dbc4ff64f1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cAai/+v5EiR0UyMEBN7cY1b7yGJWGiJWIAWHtNIpBDZVVB1ld+K53U5Lws2Fouj2HRWyCoqJipoNpgbIWDpCy+JlRH4ys+8Ha2o7r4JiAJ3FdXFwrVVYT3v7GRVwbmuin8panSxHMHS7FNFBmGa94yf+WCUzW7MUzeEzwawz656zhLV/sdCfJmAnd9Hi98/8edcdI8gizVHfgAoQOW77Lojmlyyw6QYmHzZEN6EnJeaIIBREKN41iyJ+g2GNRgm3sB1r6tsrOEzBVxLz+pJFj8QO6lW1A2XtIpDkhGE0HTzCQqg4yAizubxfUsfY4uodu49KJx2d2szv5Devu1FkjoYNbNiDHd9qYtgl/q89oJsSBviT2ToYp9KsmrAYu8f9y0HRbQW8sc/S8/mlaaZU8FIgvHEd6wYvXPF+anO9H1a7lxClqPu03RIOlKwogtZbyoFmLnk+jdThNqvX7AI3d4zafpM71RMnQlR/0oe6/TZHl8XFPeQilFr+WabpYXGkoAUnIIGMyCMtcznFCIiMtQ5vKQHUes+Df+z5p3ZFkLCpayt59DEuDQ1IXJ/81sRp 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:(13230031)(376002)(136003)(366004)(346002)(39850400004)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(6486002)(36756003)(6512007)(38100700002)(6666004)(52116002)(86362001)(478600001)(6506007)(66556008)(66946007)(66476007)(316002)(6916009)(41300700001)(2616005)(107886003)(1076003)(8936002)(4326008)(8676002)(66574015)(5660300002)(83380400001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ydGK5wVtFhx0uE+7wrXCwuX3gE5v?= =?utf-8?q?vXovTzpD5AqewOEoRvC2VERRKcl9x7JB2NVtdq2yin16ZCB8tQQcy1WnfT5Gl9E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?utf-8?q?fn7O8P06+Ck+7F7j9SFAC3bxX5A0hMdLCgiogSj3jjl2YewlJvRLPEJ98QHsaM5Gx?= =?utf-8?q?mwzJcC9LBrfI1eVyiEDtLK2wEeX1Iy4EflGM4h3iqA8scPc/UG9Olj8N+ZOhHNdF+?= =?utf-8?q?x+WKbnWEzNl1ZtCpUQZuWMHwPuO4xifDhzaxOb8OvmOT0czjw2mt+YMmfwHtHKTtg?= =?utf-8?q?yUmQQtLhwkayJwpRdul6HG0NUwIN/1/exu3J9irf2VMGw+G0+8lhRJK0/3Che0zpk?= =?utf-8?q?kR+qJ+m+dMoaCqfLnaa5GPOsWpNVqgQRP1nnUihCZxg+BI07CW5cDBan1Pwk5FBlO?= =?utf-8?q?yc0hEAmG54uC5LwXQ8aEcW8An1s5LY5BU2n2DhtMLZTgEJLhIFWVRTJLJESgsSf5L?= =?utf-8?q?Q28phNQb9+1yHF9zz2GX41xQYPBVfLdzwEOhMrFEdnK46/rvLeI2eoidk991YYK0e?= =?utf-8?q?Caqgn18bbEF9+4+KunmNlK2jnKzCA004R3idFPgGiQHya8ZHU3LLSLiVhp3GzHd6I?= =?utf-8?q?Zewq6NbJ8ZuPCQOgibnO5D11nvAO4cFuZxrKo/LJ8ddDrhX5u6n4Inq9eFOPvxtml?= =?utf-8?q?dGWxPbiy4v1UQsKUSvgz5X4DRPzUUrbT9Jvh1LlQTxXHxC9yDYAqKx7+tu88kbsiz?= =?utf-8?q?SI4C8QHEdGq?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96a3ed65-6213-40be-c91a-08dbc4ff64f1 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:28:59.4420 (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: atBr3ZKTFmXdbGgCLnhQ27llKTyNV+aCWoQ0XYqwosJaEi6DzbAQ2nVxaEla2+B81IJKMIZ6zS7lJzwPHpUOmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5982 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 Wed Oct 4 17:28: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: 13409102 X-Patchwork-Delegate: kvalo@adurom.com 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 A5DC2E7C4E9 for ; Wed, 4 Oct 2023 17:29:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243727AbjJDR3V (ORCPT ); Wed, 4 Oct 2023 13:29:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243707AbjJDR3M (ORCPT ); Wed, 4 Oct 2023 13:29:12 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2082.outbound.protection.outlook.com [40.107.94.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A96ECFC; Wed, 4 Oct 2023 10:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GhJ8P4iIMSrVCQfZ4qCrrmYbwqnVPLyhCAhIyhgrxRP9uq40Q8SJVcP0bVkoP4G7b1hSdS0d1FBO6XjjYRQWg3jQmOX5sUdcXjtNUBucGE4PpEwB8ZUTa0w937+QG1jwqjfagQ/UTouxe6n2HR+8D4/11kywau1fTXqaJ5+7Gg2lgDguHb3rPR++pzAI+kyo5EhmqxEEHCbKY03WI7k2EPTAHsb3Y2PK1usqJuuuuU9/4IerLkiC+qfc5ocFMfk1c7+HVbZnXtMimYxYQqtx6xMGxZvYVlQPgEsGzEz8E6hvmbXgiX/8hHWqajNhgzPb6lY+acq4KZJFaB5beXvNcA== 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=6nFqrlsCNFUBc16Ioc8XPt2MHtqcMhvTI8S6mM1dcgY=; b=ZKGE0PVXXQcxMHBexgM0a82hGFqOfelXY7ux0dNB3u5sl9IfJyPkojc0FNUSGwqiZQ+gi3RcKAzgO/hGHV3PMfDPokzlW3ZjEc6r4abDot1v05iXtmKO+8AjWp/0FvdZD/lYBJYKRB7hTEjqqX2cDhiOWxQyPs+lzNDarskjsmy/AASZeI/fpMDg5Uj8yPKhqKKvR/TTaJpuh1eXKjbSDq08dLb1RidrjFg/B3BCDioVJFJhfkIp2Bc4PjTadtRO2PWDmUbIzWi8SUaf68ge2GgBWxeNy9HpaIkyhE0ZVk/crcyFbUpuJQD3H9IhL95bnRQr/aS68P1x0+NuJsQHtA== 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=6nFqrlsCNFUBc16Ioc8XPt2MHtqcMhvTI8S6mM1dcgY=; b=Fb/c5669A/l1DrTPR2uIqd027UEDhS4WEQUHt3W+GO9gWHfKFZbX6I2Vllc4VnlKSTviSJ4EAS/fPiwtC+EGVjhUI+DRWYCJgGoDuAyX9yl2jKwS522w/p4lvEiSFE9WLLuiXsi708EEXABqBD12uqCbslEYUAxtdjJEHdOnh5I= 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 PH7PR11MB5982.namprd11.prod.outlook.com (2603:10b6:510:1e1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.34; Wed, 4 Oct 2023 17:29:01 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3%4]) with mapi id 15.20.6838.030; Wed, 4 Oct 2023 17:29:01 +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 v3 4/8] wifi: wfx: introduce hif_scan_uniq() Date: Wed, 4 Oct 2023 19:28:39 +0200 Message-Id: <20231004172843.195332-5-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004172843.195332-1-jerome.pouiller@silabs.com> References: <20231004172843.195332-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR03CA0305.namprd03.prod.outlook.com (2603:10b6:8:2b::25) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|PH7PR11MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: bc88b17c-7cd2-4cc0-d98d-08dbc4ff65be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 24FkOJ4GPDkHQnUPUOY/J5d5AV6aBmCrA/y2wpD1LUcMxhA+slrckDgZ6v+Vhj2Si9YgfNc+HzzSNDWZUU/lcqDuzbaeiTzaKbkrkmWcJEW5lD+FfitXhkHkjmvjTiH5TwgneHQCKqPTSigbl6EoM4dMueKI8CvA/mMw6evseNdbY7v/KgTmWGuTwySOeU3W3Uphj0GiJ3tcjwC/R4WzasrXdamP742NNAttNe60sGLotSckKNPq58YtIvEW+VqeBjOXokEscRJAVN1mJohyZfCAEYGRQ8hHDFHhENWTVJUj6P2FDcuksyerytucQaByNsoOD6QHqj4FYVuCvj2epE+qIBsWY0T2Cxi3G0BYoeN9RrOy8/cEl5gk3HA8bcqyAMNbeCcoQOvf6BzYYDi7v1tsHZIEYprYRUTbb3+V0lJKy8A+rtImcUgDCNrfOtY0vImrzj35hTfCV2qwv8Kco/EhE6QxbJyz3WnT0TP2c/98HQ49Ijm0T2505lFg8PQMHX6HBDFGENvlMcPqTCKytPFDkbU7H+Ro681AT/P5Qs0esxMBbIg+6T56Kwo7e2tx 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:(13230031)(376002)(136003)(366004)(346002)(39850400004)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(6486002)(36756003)(6512007)(38100700002)(6666004)(52116002)(86362001)(478600001)(6506007)(66556008)(66946007)(66476007)(316002)(6916009)(41300700001)(2616005)(107886003)(1076003)(8936002)(4326008)(8676002)(66574015)(5660300002)(83380400001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?rwwC5qSy9ALpJs3kTVM5bQ/Gm/Pr?= =?utf-8?q?pF51g65/bhGX2ZeKwS0TNlx6wPcYObraTEczKHwA1Kl9imkY+osHiKWyBnxnZWxss?= =?utf-8?q?MBkzRiCj0f1ZxAzBhv617LGRvoiOAe0s7rkOOS+USW/ANbisd+fr4snRV0xNCWmhJ?= =?utf-8?q?6bjU21VA+JayaYM9cxfJS2N3HAeK64AVe4NU4St6i+ouN++NOiZEJgnISX0b2u4vu?= =?utf-8?q?TaqzdYdQofLp9t6+HJye1OxdKotNJ0Tp149M1A8gb0nVh8zXfdDkM8HCBpFkC03qg?= =?utf-8?q?c+MjljlEJnultRm3epcpaL7e4eXkALPhV4EXeYeMM3SoX8XFZnD7zrqwaGgTqzk8c?= =?utf-8?q?Ti6LJh5xNFe4Md6Sf284jl9uo3vRyMBzRxMPj7jsdQzNZryj+3RRBJKXkllVda+AV?= =?utf-8?q?WUlXSvlKOyyV95yufgr1350Gsy9aBE1fPUA3BLiK75/SJPWWc52sWKo85TlVPKN6V?= =?utf-8?q?AdRDRq+j++hfq5ug5YFliWM4a0Kaf7C80sJMg2vrqsR4G/x/bKn3+Zh7TVZpGkZWR?= =?utf-8?q?aWYz5LoYhtSYaRLCnOENU67IRut5KbIAbnwiQ73dnUAIcG4HuQrg2EO+e9YOsVhub?= =?utf-8?q?KI2/cVVI2f/54jpv/DzPTIzpsAo0QFrteoweSpZn4ZD+QZKE2AGDFcEjJhCvyYqVP?= =?utf-8?q?zvnU9f8e4diH+Jk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sybH8M02z1LcrN2mK/7lqlpUJqNh7USmWCwWChBEJTT3i5?= =?utf-8?q?3VnnG/ttitp?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc88b17c-7cd2-4cc0-d98d-08dbc4ff65be X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:29:00.8080 (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: s9xIopHvYs7d+UrEJqcYWpt5O5KZ+0ldJF+ekGkc0FF6eWXEJgHf17SSWLtBEYiGozqasYG7I/WuOEMTdxj0ig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5982 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Like hof_scan(), hif_scan_uniq() invoke HIF_SCAN. However, it only allows to probe one channel and disable probe requests. It works very well 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 Wed Oct 4 17:28: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: 13409098 X-Patchwork-Delegate: kvalo@adurom.com 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 D0476E7C4E7 for ; Wed, 4 Oct 2023 17:29:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243688AbjJDR3O (ORCPT ); Wed, 4 Oct 2023 13:29:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243673AbjJDR3M (ORCPT ); Wed, 4 Oct 2023 13:29:12 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2082.outbound.protection.outlook.com [40.107.94.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9183B8; Wed, 4 Oct 2023 10:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EnB6a5pnSsK6FWaVsvwnJs0fY8zkzVoSOpLAxFAPSkfjJH2dqOm0eAH0LRAoAvKiUYpfYJBBkssit5HaUffPFxSHBpLpYRtkPVycv7RhXip40KUvND45eyJj56gDArcNKymDlhf/WC2FS3cM1pyVB/rn/IJTulwb1ILfFLNjqt1eBEBaOKeWYINgM9XNQDPDvgIbEfZkQWMT0LJLJlCfqlkKk11banMMW3Bkc31L7EuuHGFOue9LvoAYwcjI8rkvGvze3p5hhj755VrVTUDqjrrHR55lE6ucpJO+fNPbcP6nVh46nqjHhcQADiquQFkOfrGqQtT/UpbOdqxRSSIVdw== 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=uFAaoOX/wsVCx+7JK4GuOCjNe4Hcm8a4PR49uuM5L30=; b=n87cAiA/Owitrv7Ws7m+frM9D8WqrwxoCt0h2IIB1SxWniCPC3qtMXw0iHNdYnhQxf5cDCML532Ihn/MxyKNziOU8xDhkhnM9rygH7n1u3o1Jlje5dNCllwtQ7O3T8oMVPWADjhkR1ZZFTfHsLHQtUBAr2b2yCH0LJA4xSq+HEgIqNIyaF0iryWuSHyK6qwny2sy7ng1XZ6l2a7pK34qHNit5FRl7Ddqr591L2FM63c1YR4aKmhqjeUTQfgUFomWwylbI9GtU20nWetrZ2KmeyvM1lhP1AljMQp8J7l8izjfdv0H1N+DPVuWyN1keZy48pNJR1yLWluzCqlJC9kduw== 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=uFAaoOX/wsVCx+7JK4GuOCjNe4Hcm8a4PR49uuM5L30=; b=RY4UrxmaRFj+kcA9bBjhOo7Hr5vN3q+H8kOuqOAIh5AGhE8E/gxturAGU5FzOtCv7WSc7yGwys0nsG7+Nd0F5FHWly7+eLMHdd1H07WBcqmWGHb9/FCmV8gmXEgmtOv5hJRwc8RfFKLL2zofeQ20Q44M3Tsn6U1F7Lkv6ii2P/w= 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 PH7PR11MB5982.namprd11.prod.outlook.com (2603:10b6:510:1e1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.34; Wed, 4 Oct 2023 17:29:02 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3%4]) with mapi id 15.20.6838.030; Wed, 4 Oct 2023 17:29:02 +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 v3 5/8] wifi: wfx: simplify exclusion between scan and Rx filters Date: Wed, 4 Oct 2023 19:28:40 +0200 Message-Id: <20231004172843.195332-6-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004172843.195332-1-jerome.pouiller@silabs.com> References: <20231004172843.195332-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR03CA0305.namprd03.prod.outlook.com (2603:10b6:8:2b::25) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|PH7PR11MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: ee7fa7f1-9d66-47df-7391-08dbc4ff6695 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 92xNgbdznuIU8Sa8ZRVhDGfVh6aH2t/ltM4YDFa/Xmo3M5768xLoNbTSKcsv1ONOTHkqr6kmHgYGwCf9YCftEVvb9lPcX19VmE9hAatQhn10Tl40FK0byDLx4z5jv2QVF8gHHK9B4IdRBmUKuMq1fKqLIeyCYjwJETxeg26mHxyhveJwPffS4HdIdlNVPB4VdKCxR8T3ikj+xUOr5v1Lf5F0DJM+s24OG/cRAcNhLRdjKKJsAqG2ahzxJqmb1gBdcepxhlEuExm16k4H07OaU6SNfL4VauThQ/uwlp9+K9VpkhyzKx0Mc00P/PdadD/PXoKRyClr0sYk6RpZIogUFk4JjvZOuNZju9SIoi6SPIVhQJG7p1Ql2G9+loIU5UOphaQXQeZV8CkfCircgKAgdvGExE0in0/2VI3a0Fo2TskgJL1fUNTVKJbzI2Y2UG5GqPbBzWR6S0jykM2EO9J+Shhiu8iAo0HJ1p1EA4kuaLCVXt8OfnV+zVJVJZZ+LZEXydneY2isFK+6IPHNQ8yytk8mVi78IGVPbNDd9xikcKiuTbFTwJHh0x54Mlu1xJpX 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:(13230031)(376002)(136003)(366004)(346002)(39850400004)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(6486002)(36756003)(6512007)(38100700002)(6666004)(52116002)(86362001)(478600001)(6506007)(66556008)(66946007)(66476007)(316002)(6916009)(41300700001)(2616005)(107886003)(1076003)(8936002)(4326008)(8676002)(66574015)(5660300002)(83380400001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?RQzpYw25GCWQn8pqUDWSGneIzSGH?= =?utf-8?q?vSTs6kWnqfiUMUb5nFk6xzMbzCQTIz66jwH5/+FtJCyisA8ium9iay+4SL+nQOk6B?= =?utf-8?q?Qj3SNhz4amtCTuDfvPkHgh2zbkbgXMDpd507IJzXWMEhAGLmfQcFht22lElxwzUTS?= =?utf-8?q?kComUWYy5uSAy8nheO294YevbGG8TlGeGIl0UwFlW77xlSZEM/sJqM0Ly/bmu3Oo0?= =?utf-8?q?1Rbd9epIQUfbX1KgijCaQ/r4GXBQjgqdHl/1cOuFFDq+P7KLgl1WjauoHlLSbh7UM?= =?utf-8?q?5TSzvKavY+KlbsR5/s8STfpEsKOHQTX5c8oPf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mLmh0A8n/MSalHrUx3srhlH+/F3CbHp+fn?= =?utf-8?q?CizC+tnVcsHysBGi3Q2ZmGI5p/2YjBSjETHKkukdfISi5PXQu5XqLem5S4A5IpFwD?= =?utf-8?q?PotuCq2SnCIqt4M6kEO+V7zJPgDE6GGI31Gk0SRwuPyuXbwIk4G2woUitj/6XD6eN?= =?utf-8?q?Bu7P9l9Pfwau9fllN/02ExN4KrB+HwyO1nmZ8dvCv3F38c3n+HHcgFTb4kDapycaH?= =?utf-8?q?gDK2tZHozg3Z7Vd+aD1eTqzcxFFXaX4kDdJwozBjI5BF2tDiQp8R9RxSF3rws0Mm2?= =?utf-8?q?2k38E7P4MxT3jvM1god7YQF2F31KHhiCq/Sw0NZj7xe0A/wyWuOcNCjtbprnj7XMp?= =?utf-8?q?WfA1mkZcj+aSpp3yBalJF3o54WIr/mgTohQSCtWTGB6jt0NPrABRxaU5SOLVzCeQs?= =?utf-8?q?ghpUre1rsAX?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee7fa7f1-9d66-47df-7391-08dbc4ff6695 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:29:02.1734 (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: oxqjaRYIJIJCh8UUWHXpByDAGqyqSfgzthxs9By7LykSge+hRlaZ59Bgb4anKLCscTwt0m/2fYDzIu2pBH8pRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5982 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 going to be 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c index c58db2bcea87b..cb03a5cf7ffa4 100644 --- a/drivers/net/wireless/silabs/wfx/sta.c +++ b/drivers/net/wireless/silabs/wfx/sta.c @@ -96,10 +96,12 @@ 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(&wvif->scan_lock)) + return; + mutex_lock(&wdev->conf_mutex); 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,8 +128,6 @@ 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->conf_mutex); } From patchwork Wed Oct 4 17:28: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: 13409100 X-Patchwork-Delegate: kvalo@adurom.com 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 E1EC1E7C4E6 for ; Wed, 4 Oct 2023 17:29:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243683AbjJDR3S (ORCPT ); Wed, 4 Oct 2023 13:29:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243659AbjJDR3O (ORCPT ); Wed, 4 Oct 2023 13:29:14 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2082.outbound.protection.outlook.com [40.107.94.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54FCED7; Wed, 4 Oct 2023 10:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OQ44YiThTT1WwfjpCgYQ2+2bNS8gbkQykFeQzGAd8q4ED2XJtEokrWEQFqQKiNxu9cVoJUUt8NQ9OGSlq07YrJRAieAYCT68R6C2PYo3F76lr/LNrkY/RcbivoZnHd5CkU9FCeWgzMpAMLSXzfBeajKpi1Wtzd7HEXp+DQ6ctWNFfVhczNoXCLvagrzmcfvvVZo9yFUELtpnaJXGRtBPW+s3EaDaTceadaNprUdjIMOJuzcXIpzIyI7HlZ67lAbQDI/kEu08gJ0Vpgn/L9VgvpKvALJeKyUTntSbCv91nQpYw+6kJjM9Mv38wf6Hwur4X13R3rc+irRe+XyMI3thUg== 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=jAXF46m/CPJayObdo/yO2Zf+QM4FW1e/fwL2cbCAoNA=; b=GZE+P1iJX3jwVpym3Uz8/4iYmueTjzH05jxGdbMhOzAcXpYEexyWc713vSje9C1Swu8r1TK129fZJQ2M7eTVEHh7g7g0hNfZYKtGdaDcTRh8d3aaHu8uTKHmVNFYyA97FoVbDgpnAU79JK6KvZgR5rM2rAJNa22+FQmPFG/llBu3xgj7gyJ11e7xfPA2rxyOG3h/k63e2mzIk7sRcZiG3Ijo/t1mnCBIcoqen8CPML/ttQttQmIyJbDCEm8SYpqQVw4daUDvQgh2RmjHHQm+Zj2SslsTvt9ggBkA3rFndoZZavvDyqnRL+zeU89ibuLk0o+eJxQiy7GlLE9nxIPk3Q== 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=jAXF46m/CPJayObdo/yO2Zf+QM4FW1e/fwL2cbCAoNA=; b=YKZyRrg3FcPlhUnKuLTkGktpzeAuSp1oW7SCSSDhnVf9Ai6s6vWPHk8d39kJtpYHuVrHheftecrMLIkmBaiXsr5B2B8+N3vcFvrIkN+yeNABIqV7sfnAkhoRnnzXvieg9ez4qXzfry7v/LM6AI85qI2yKPz9RB6h0yzknXL1GtQ= 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 PH7PR11MB5982.namprd11.prod.outlook.com (2603:10b6:510:1e1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.34; Wed, 4 Oct 2023 17:29:03 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3%4]) with mapi id 15.20.6838.030; Wed, 4 Oct 2023 17:29:03 +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 v3 6/8] wifi: wfx: scan_lock is global to the device Date: Wed, 4 Oct 2023 19:28:41 +0200 Message-Id: <20231004172843.195332-7-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004172843.195332-1-jerome.pouiller@silabs.com> References: <20231004172843.195332-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR03CA0305.namprd03.prod.outlook.com (2603:10b6:8:2b::25) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|PH7PR11MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: d599b826-ab11-4ed4-bf1e-08dbc4ff675d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NdQkG3GFtGVgeME77MkkfPA0KZlDX9i2iinEZfnNXbmMLZy7h/e2RCy3t3dTknSluHXSCuObLvok1SOlz+DISjwPFJT9vgEwm8THYJdv964CSW2u9mJcGjmYEf0Ft2eEY/6eKKxzRtfKJSEC123zQPvsG3FgRCoCy45+26wwIGge82QZ25QrWk05VQ+aAbCgCOnFJ3Q5obQSrk7cYXfO97zxB2xbyXOAnGoZ8wlCxgxC0pLH0RmJtqDfanV3pAjqRYfjoaIhHpm373Y+0SZhQiyI2Nka5qjOG7dqeadTo3xAwzBYizW/sjNg3MomnB51S04daBXBfyzXOFWJLWpn9JP+swuqUJ/zYd/s14Z44dSpwXepufhYbk2DHuTKoKKkP1e6oXk4TBzfltG9P2d5KLlwyH8oAIJ4kZ0g8hRXxN9ck2uijrLYikWzdXAgoQkNDXsEI7P5BupPz2rton+lxU5Uh+knQmNxcHIjBQoQljlc0yKWBEnzaFHXluRI2v0mEgeJdgJB/SsAvjZBjQOJ1tR6QcpvKVEfl4Sk7NSVWIotVHiMERqYch+72bfsyimd 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:(13230031)(376002)(136003)(366004)(346002)(39850400004)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(6486002)(36756003)(6512007)(38100700002)(6666004)(52116002)(86362001)(478600001)(6506007)(66556008)(66946007)(66476007)(316002)(6916009)(41300700001)(2616005)(107886003)(1076003)(8936002)(4326008)(8676002)(66574015)(5660300002)(83380400001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?4k/HgQ+cWFZaCOvSDU3C+6XPzNR1?= =?utf-8?q?JsYO56uvGgE4YC+ghBnXtmjiihG6KFhh/gcgEb7H4gu8Me40E5VUXEeQg4p39U/e0?= =?utf-8?q?p2N+vfb7ICXnDrK6/hTxymBERmRVk3Airv3Twxuk4pCtvz3oQPMj8dxXgGrFY4fWX?= =?utf-8?q?JKW8U526mVtjd+R7Xj/NbYUe4225+eL37tS9cWfAVw7gZSdTJcRanzJVO3KlSZMmf?= =?utf-8?q?rG+86ZrnbTuCNlqz+4gLWCZUP8D4DvlfTx498kWyDgVnKIkHIq4wLFgUEMwbA/HzD?= =?utf-8?q?zYwzW5+krzwAafqqlyyhbdJDivqSyHcAajs1sAz1HQFeY2H4xCqPVELbb45ePKWnt?= =?utf-8?q?RBzPFrx6SG2PDICYNFx8QeCpWJX3IfsT2xLbAYAtGd/a2AqCJRtAbn0QOK4x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OPmHObY+Z9?= =?utf-8?q?BE2fSeXbfzxpCmtQwKo6jovxvpaRuULsPDwawpe8qXaex0JRkw1ZrYLBM3Wd6QOm4?= =?utf-8?q?pijrXuodLjNxUfoL4b31l0bxUwVdweBLRjW7IjIxGdYvQd8h//Tgdhc5SOD5vH8me?= =?utf-8?q?rZYLaL+39PBuGM0aQjTTam36WyMWjafj1ALkPdUfFd30A+98kHztWCITEQ7AJ/0As?= =?utf-8?q?L+coJOel7KCnaLQ23lV7LWmVTU3FTZudtO4IoUGbQabGOVXHMAXypt0WbQht/RHDU?= =?utf-8?q?ORUCBosBtd0vTZqTmU/LkBBD0f3i+SA9kHUtfh6sY31WThEwe2DZzviYWQBr54btw?= =?utf-8?q?OBBQdwa0k7U?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: d599b826-ab11-4ed4-bf1e-08dbc4ff675d X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:29:03.5136 (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: 6sawYa2969wMq0db4fkZUaWgadFlgdx9+gu50yiHV8RbkgjwxZOvTDFqw77B192wvyloPDh/Dph4UB8lU4DoFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5982 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 a vif but it is always locked with conf_mutex (there is a case where conf_mutex is not associated to scan_lock but scan_lock is tested on all interfaces). So concurrent scan on vifs cannot happen. So, this patch relocate 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/scan.c | 4 ++-- drivers/net/wireless/silabs/wfx/sta.c | 11 +++-------- drivers/net/wireless/silabs/wfx/wfx.h | 3 +-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/silabs/wfx/main.c b/drivers/net/wireless/silabs/wfx/main.c index ede822d771aaf..4bf16bceb0bbc 100644 --- a/drivers/net/wireless/silabs/wfx/main.c +++ b/drivers/net/wireless/silabs/wfx/main.c @@ -246,6 +246,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); } @@ -314,6 +315,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/scan.c b/drivers/net/wireless/silabs/wfx/scan.c index 16f619ed22e00..d6f98035f6844 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); } diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c index cb03a5cf7ffa4..8533bad6caeae 100644 --- a/drivers/net/wireless/silabs/wfx/sta.c +++ b/drivers/net/wireless/silabs/wfx/sta.c @@ -97,7 +97,7 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, FIF_PROBE_REQ | FIF_PSPOLL; /* Filters are ignored during the scan. No frames are filtered. */ - if (mutex_is_locked(&wvif->scan_lock)) + if (mutex_is_locked(&wdev->scan_lock)) return; mutex_lock(&wdev->conf_mutex); @@ -621,18 +621,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 +726,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); diff --git a/drivers/net/wireless/silabs/wfx/wfx.h b/drivers/net/wireless/silabs/wfx/wfx.h index 13ba84b3b2c33..a41b2c35fa415 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; @@ -80,8 +81,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 Wed Oct 4 17:28: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: 13409099 X-Patchwork-Delegate: kvalo@adurom.com 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 54E9BE7C4E9 for ; Wed, 4 Oct 2023 17:29:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243694AbjJDR3R (ORCPT ); Wed, 4 Oct 2023 13:29:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243717AbjJDR3P (ORCPT ); Wed, 4 Oct 2023 13:29:15 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2053.outbound.protection.outlook.com [40.107.94.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FE12D8; Wed, 4 Oct 2023 10:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N6XObVHPr0iIOryizxE/4YHBxHulrT5+uD3spZs6bmhWUvOgZVLXg/RTn22QBbG5PvvbjBsehl/o0wjqYDZT7xfX5XHttI0aPF19y1gX6WGfLp18s9s4K+Dxd/3dCsENG9wUInV/K8IWqosxGTSOjRzBxHHUFUgL1ZdIJoqWwVdWNiGTBRmvP/oDmMFORyzkmGFR6MMupp+IwRQ1aUDvjmfYUfieT5xlOUB3DamZ6PqQ7Uu1t/7BSwvyM9a0keZgR5eP++qqpzlPP1CpbCtrgQicJL6G52/t/Wr/DqDj1IB3IXEj5sYVdRD/+05zTPYKz43iUlviHDdrArGMfHTK7g== 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=1rh/r9E/A/YRjMbzISXno2bQizEoygFOyKpFAaeFchk=; b=Qk1ZOrv0f7kwoTHPKshgPVIpWxX20xAac6JnHoLNKTg61sWhjo6vUAmvrD4XeMXi7LRSuYX4lzYpt5wFbWJNzK9+N1vurpdUnxEKyUUwmAQb+hxt1wBN2gNV7FP2BAv//dwAA/NzCmhLtnzKMPCnaxuLamGWbs3gFNkUgH39OhcD9hOKiF17fWyGCKHxmkA0ZIR0oT1mKC9+ATxH4WmGFnTwfzhO2p3VVQYPlcbD15hbQw5P7WfKi0hJvCwmoWTV4fUO0rkmqL3GlWyeMtxhOkQfQCR8Y1WckRADMj6JSrwA6Cr9v21iPGyaGyeqZSz9zKtE5/wdTfEUrq1jah+LDw== 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=1rh/r9E/A/YRjMbzISXno2bQizEoygFOyKpFAaeFchk=; b=MknrLeFf0WGY8vhd3jAM36U3shS0+KkdkDIZd/4udp4Z+wohpfNKLsOtzeL/IxTg7e7m7MK0PjoBZJMG0zOPascE0rm95+z8yCu52aK4D0xnY9w5iPKSEWipCgOjzLOtgyJd/bohn/SNzuLPAeVzD8MP2p7ul/98Ec/E6LYgPHo= 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 PH7PR11MB5982.namprd11.prod.outlook.com (2603:10b6:510:1e1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.34; Wed, 4 Oct 2023 17:29:05 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3%4]) with mapi id 15.20.6838.030; Wed, 4 Oct 2023 17:29: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 v3 7/8] wifi: wfx: allow to send frames during ROC Date: Wed, 4 Oct 2023 19:28:42 +0200 Message-Id: <20231004172843.195332-8-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004172843.195332-1-jerome.pouiller@silabs.com> References: <20231004172843.195332-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR03CA0305.namprd03.prod.outlook.com (2603:10b6:8:2b::25) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|PH7PR11MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: 5fb6a10d-5f25-40e7-31f9-08dbc4ff682d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kyPQaPDFMKUfLOvajBe+egQxBSL1uLMbLoAvfh8xeD5pPhH9pveGfoQHDCygGXUE2mvaYO6KJJPwuVv6wTbNVbkhJwjbli/6+pc/TAbHUlL9Plu9LThxZ3wgi/zpc73LWCyqkvZrhcHWFhefv+pqJc7kKwduB3SZY5ndiUg/ZIbKvKz4Opc9UEtZ0tAP3ybsc/01xtIMCUooBd+G5kxBFp5o4KG5S2GRMgyIA2Vy17CL9EIaI5PeOaNaQmxxnkSV9Xwk2fFA4ahYA8QjT9+JyEPW6i1FBGfe3jaojYVuTVCwaZVGA2F3CrAX9x8OVSCROgVplfyy134byrAnnvgsP7mEon8r6D9nHu15rMLFyJJgBsQ3Y2r3ta0C7KJQhV/iDti9WW0r5Z37vQanuxTMoUvNEBg0DrF2eWZow05oZ7C+qA3Ez73slMHPeT/5KBW0GgrGUZpK/eLALpWaV7QbnlPrwAGEevtanCI5YvupCRdPtQTcCDaAq3SwtBsHJmt9TQjroEkmXh477Ld32Ej60I2zgYJlkNMVoPXMmAuN7P6uCZK4R13o7KmdOb4O5jhs 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:(13230031)(376002)(136003)(366004)(346002)(39850400004)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(6486002)(36756003)(6512007)(38100700002)(6666004)(52116002)(86362001)(478600001)(6506007)(66556008)(66946007)(66476007)(316002)(6916009)(41300700001)(2616005)(107886003)(1076003)(8936002)(4326008)(8676002)(66574015)(5660300002)(83380400001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X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UayVxPQyxpV820AhvyYvPqKs5Nvp8PhUz7+LA2KIUBXQ4IQOGlOxsxnxbXzP?= =?utf-8?q?tRyHWl4BJZciRdrrR5TMvo4l/D6MoCSq14867HZIqTiLHQLbzz2h6w0kKUe79MR8c?= =?utf-8?q?YYxLy+EsW0SWuQu028QwIueOVj+qmdKX/WRcV7nOShTHExpKeurlgIlmXbIvsSbfq?= =?utf-8?q?wLOEPjtB07vCb3y+sPckjiYCUBXQmylvrseY0Jw/iCdtL/SIXSknUaVQ0mskJQ4ei?= =?utf-8?q?LLGPSzLc7Lb25oPVMeomEKhYRd26P1kC+cewVwkZgrV1CbzZI8+wLTvAfKLagBNNx?= =?utf-8?q?/fLoW4W9P+jTPRE5tAnwyS4RDxGPpvgsMclbwSzmOS/Mivg0OXj0IJ0ABdnZSLO/O?= =?utf-8?q?8L6BYmQfPYJR4CoIjzCGHspXhaYDIAVg9Sd1Pkh6odjlPAvIV9JIAZwIlilJg6gU3?= =?utf-8?q?338spP4mLaTPUMDUGz2LUnf38WMmACzkcMuR1w1EmgTcLwLP0uzZ8Av2W27j7CG1f?= =?utf-8?q?etzFsRCmp7P7e0IpoJPaaYTxiqKVDXQZ4hcD2J66snUY+qm9jXT1KTz2Krgl2wlNx?= =?utf-8?q?61ezgSY5T2gpUXDMiBrEjM8ALfkg+VXPoiKjvZmmyLJwSd9d0n0bYs3XPwZqOVFbh?= =?utf-8?q?h6r46DoKG6/qTNoQZfzWMynH7z0E8/QIBFRN2K/qh4biJP3R+uyBvmIcG88Syhu7S?= =?utf-8?q?Z4Acl4USwL3THzxof8c9uB/OiAKpohsHTfuqZCDARASArA8hkaNrzIqmPMhYln2rD?= =?utf-8?q?91tV1hFP2YG?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5fb6a10d-5f25-40e7-31f9-08dbc4ff682d X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:29:04.8518 (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: FtF1Yl9CzIFNQItwMP0uWItK6/68l9ITl5glGfq05BOG/I6OHf6QpkWVIE7PmODgDBgalGnRE7CXliKPOjlEOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5982 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Until now, all the traffic was blocked during scan operation. However, scan operation is going to be used to implement Remain On Channel (ROC). In this case, special frames (marked with IEEE80211_TX_CTL_TX_OFFCHAN) must be sent during the operation. 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 | 38 ++++++++++++++++++----- drivers/net/wireless/silabs/wfx/queue.h | 1 + 4 files changed, 62 insertions(+), 15 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..e61b86f211e53 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,26 @@ 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; + } + } + + if (mutex_is_locked(&wdev->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; }; From patchwork Wed Oct 4 17:28:43 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: 13409101 X-Patchwork-Delegate: kvalo@adurom.com 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 B11F1E7C4E2 for ; Wed, 4 Oct 2023 17:29:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243722AbjJDR3V (ORCPT ); Wed, 4 Oct 2023 13:29:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243682AbjJDR3Q (ORCPT ); Wed, 4 Oct 2023 13:29:16 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2082.outbound.protection.outlook.com [40.107.94.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E7E1A7; Wed, 4 Oct 2023 10:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GwYnkz+p9NrPsf3Em/4aKfK7x+QSgcGo0qHXJisNY4TZy4pZlRZ2+8HMUCGUVBiXd5QCUj0rtDAafScQKpNrL4fAIdE7PIpGUT7lAfHOy7drHQHtMngMTqp0LoOFoDGUrN7bD+9/O1eZYKitz6J5/GmHmxFzS/wh+wQcBum+F79X0MgU7PnxkhbvScBnxhEa5/QoE0dtCZZfvNspq7iZPHidfwXscDXw+8yrf9Cj2Sb+qJWnERd5zzS+H3DwtpEgr9wSXraFC4NpWeE+iP/vDd3K4GDwezHUupHsNT8EC78ezwWnVePUTwSiGRYTlPaY9/UYnZ+2EUF2qd185RcWJg== 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=mNDmDVuFCvF2iziaqZUbvbxc9ZC7LQvUPA+ZPlkd+bw=; b=ZH3GdxY6qbPaAQUglnU4WB4c4bfJxRtszcJ7iUEF62aOxXw5MeSpyB/0RGyTlWtzKF7wiDcbl8lbbt91u1izp0rxrif8FvY+ZW+BUhvktITd6n5IAEfn5CvBXKnprt7CcoSWEwuOpREZC0l1QnREkdizRjDtyiyg/vleDHm4z8lsyi51QpZEMfekj9TGsFiKLFqfzSpFsUyysK7PeTHKHXI08ql7iZMElKUwFa+ymtYPOvEZF9MyctvnUtI0NP4O+cozKsgmj0hG3gLwoiy+x4aJva7zFStGL8EqdxjqlXcwDZDsboIZ1s1wRv6j9JVDpRgPpCNGCAAwhqz2GErsVw== 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=mNDmDVuFCvF2iziaqZUbvbxc9ZC7LQvUPA+ZPlkd+bw=; b=O5ilAbjWxI3610J8VD682DP7oneiteiPxwUxFIKLaq8cOYk5vHIy3hDa6K6pxTAf/p3gNk7bCJ/dtOzQbwlFxN74vl76pk4X9hwN+J5mlEagJn1Pl/ZHf5avCSvzlhqGbhGfNk2OcuyDBRjKtd8SU8g1XtLtrFsUM3fjn0ONkiw= 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 PH7PR11MB5982.namprd11.prod.outlook.com (2603:10b6:510:1e1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.34; Wed, 4 Oct 2023 17:29:06 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3%4]) with mapi id 15.20.6838.030; Wed, 4 Oct 2023 17:29: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 v3 8/8] wifi: wfx: implement wfx_remain_on_channel() Date: Wed, 4 Oct 2023 19:28:43 +0200 Message-Id: <20231004172843.195332-9-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004172843.195332-1-jerome.pouiller@silabs.com> References: <20231004172843.195332-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR03CA0305.namprd03.prod.outlook.com (2603:10b6:8:2b::25) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|PH7PR11MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: 55343e5e-b01e-4e13-4256-08dbc4ff68fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iEiV6vlPpPoT54FJSCkdpt3L4y7wiOFtKoWZV9TeFA1hskiMF7DNt2WldhUj0gFev3kRLBgTTgWOG8lw5pcXNrG272BfBG+6O7uz0kB5ecFIlJZ0hzBX2TkXoPPtv2P3ie5mLeFx8lBK9ZAILLlge+n9ea5DOvTW9yHTa//x2PguuQeW/RRYqyJYgIt6A2kEKttbfYJ97T9ZRk3qXJ223wPd4gf89RXrMy+lhoFCDCAKHPgHWzWsjoYWtfPj9QiJeUjDTm1E9QGtRxhamcaFf3t0A7eABaKCHqjj8Wm9xDjR2PDxFkfHKH/2iQQgIYUhNzui94l1qMeqmijwQHNgk6pKyFsHZj9L0uvoSjKMa2vfeB8mitZR27O9PgfvXVKr8qv2ViVj0ZBrPj65yFHZ/AnertUKddgcLEB1rfhV8bRZPkEVU7q9ADirjJYItp/o0a1ckFuPzs0f6XhFzxGcwqzUzaiFx4M92fK9jaqUKaN11lG96IxD/yE9yW5AeLYdbGjBwXAKyjin1VKlwQYDRvpD+7Qgr/GGOqBJ9BQ+j1zxc51SVPehod/f0DrVdSMV 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:(13230031)(376002)(136003)(366004)(346002)(39850400004)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(6486002)(36756003)(6512007)(38100700002)(6666004)(52116002)(86362001)(478600001)(6506007)(66556008)(66946007)(66476007)(316002)(6916009)(41300700001)(2616005)(107886003)(1076003)(8936002)(4326008)(8676002)(66574015)(5660300002)(83380400001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?TTre1ejEouz5ey4XkPUQBFT+YsMT?= =?utf-8?q?uGrnMEXZkMPRWXUARuUTOlrzTOvb0QHuiKO+FjjPLWJVsF1AbL0vORGmRVHL02JMI?= =?utf-8?q?bSF4Z6JJ5vO29qGKzrGbd+QnjUuqN4ony96u8+iSoaGhfAQSsY/kEUu8Z74gt01HZ?= =?utf-8?q?Tlcxi0gWQe4hAAGJzG6czP+145/RQY3mNHNn90gXcSYLR4x7KbLl5WsHEqZs37hpn?= =?utf-8?q?M7KfKbyCEYAIEsCh5vNDKGOB5T1fhteYoEBSYCpDEWhmGno9rNyXenRzBXMeYPb8e?= =?utf-8?q?bilDjEUwQQgCxIbxHwmMTxoeD3/DJ3wwSLwnmvqkXS/gZdiIN02h6eUF9qBtzMpe9?= =?utf-8?q?If6JXo0J++mSELX7STz+nhz33cuNc4UPOcIg+gESVfqYZ0u6R/1wzlFW4ihUjxILo?= =?utf-8?q?jVr89A/taPwM2d2ZZzvLB14k2eEg8ljgxuvJPDdDEtmtXWu18PNSyJNqCO4wJPy+3?= =?utf-8?q?LCaDyxWdnxd8+wWEo+3sD5EOX63ALhTqHOPRg5D45bgRNoSNMchdryKF04we9xk4C?= =?utf-8?q?9avIIh5Z/I67rz1kcW5m0la0owo4TITySq/LJB+5MUr63pVL5rokGg9UULPb2gOnH?= =?utf-8?q?zc1eFkRamGrGmrn00u/rAQs59taNHakg6zwUeUSiB17lyJRcGIQMXuj3dSutwcXKS?= =?utf-8?q?i7hvzxKeMO+l92HDdAmgtkfTF4jy7SnWHqYhgQBvkVWVWiNfhPYaCch9mNT8OIh1x?= =?utf-8?q?kXQyMfXyHCeQoHaon67IYVo0s/4y4UZzHfDoN9L9lLIaEs88Pt0P/mW0xPRZxLl4Y?= =?utf-8?q?Cml8dpQWljANzxRTboYCTvd3EKJ8qOAP50YphJ9YqIKN2AzBQoNuiu+YX2msxrLKb?= =?utf-8?q?bYJFs1ZYjdb3BBPNOT0H11X4+n71aTrBb3T64qDdFpE+yR469UVAImR5PTYWEvK+a?= =?utf-8?q?g+0cM0pH4UWUy99QFi2Gb5ka1UYKyyYzFVGUUr1X0dE7szPgJV7Np1+xPq0i2Oqql?= =?utf-8?q?hckUsuE7LKbMjEGcx9FDQgvDH4U5ewpbK14CMzwiQCJSATUCox/bgFLzpc2fTPi1F?= =?utf-8?q?7ih+rIZ9nJPnr8dFbXqGsSnlctIdBA1GI1KTnAOrz9rqahKJGJftJPK/xGo/d7Mn/?= =?utf-8?q?zZxqQPN4I9oV/90nwxHpjgA8jGfGpuH6Tj6tiJs2dQeMd1s247fck5Z6hXfQgeg+6?= =?utf-8?q?/nCdjHYrgwKGCce6D8Dr12rVNexWJy6A4AXvYVPXLqWdZzoVpmk0NKKKnWVsfCt+X?= =?utf-8?q?Who8XiPlgCnEGZiPJXnziP7UvwZZfAOnGCuSgRNFlpf1AaJek+9gnghqOH6b26R7m?= =?utf-8?q?4SCcZgYEMVApFRuGQxwKThQ9IhWHlI4D33lwWkRVClWrwqCj5BEnbsuNNY6h/q6xR?= =?utf-8?q?OJHYeGSgrJPnYFUq33jvG+8AOdq28IPuVFyZvia0J3i4/BBHhQK4apiu1tPJAKEPu?= =?utf-8?q?yTSQ4dPG2Y/T2rrnBiUSpGEA6AtIsIZPP545KybdFqy2b/fTp/YWQieK4FOYpjoEx?= =?utf-8?q?q3hw7/eo70l5cCOJDAXFkKeFE3WkZnAiLJwnrEQ9jlBByz4Qb04ZNd9vcSut8L8ya?= =?utf-8?q?D+QWNIJMG9feOrxpMSB0Z7jxfR4ZmFbtWxTV+GcAht6i2jNzObs8AemDeJYkW4DVB?= =?utf-8?q?JOpDfqJbdmN?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55343e5e-b01e-4e13-4256-08dbc4ff68fa X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:29:06.2623 (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: wkHEs6wU7R/U65zxK1fGHehLRabFK/zQoSo4VClh6riWjUbbkKNXUaF6LchlP/KPeWJTczj2MSzwwJ3yJg5lYw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5982 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org With 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/main.c | 3 ++ drivers/net/wireless/silabs/wfx/scan.c | 62 ++++++++++++++++++++++++++ drivers/net/wireless/silabs/wfx/scan.h | 6 +++ drivers/net/wireless/silabs/wfx/sta.c | 1 + drivers/net/wireless/silabs/wfx/wfx.h | 5 ++- 5 files changed, 76 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/silabs/wfx/main.c b/drivers/net/wireless/silabs/wfx/main.c index 4bf16bceb0bbc..e7198520bdffc 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) @@ -289,6 +291,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 d6f98035f6844..c3c103ff88cce 100644 --- a/drivers/net/wireless/silabs/wfx/scan.c +++ b/drivers/net/wireless/silabs/wfx/scan.c @@ -145,3 +145,65 @@ void wfx_scan_complete(struct wfx_vif *wvif, int nb_chan_done) wvif->scan_nb_chan_done = 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->wdev->scan_lock); + if (wvif->join_in_progress) { + dev_info(wvif->wdev->dev, "abort in-progress REQ_JOIN"); + wfx_reset(wvif); + } + wfx_tx_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: + mutex_unlock(&wvif->wdev->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, + 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 78e3b984f375c..995ab8c6cb5ef 100644 --- a/drivers/net/wireless/silabs/wfx/scan.h +++ b/drivers/net/wireless/silabs/wfx/scan.h @@ -19,4 +19,10 @@ 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); +int wfx_cancel_remain_on_channel(struct ieee80211_hw *hw, struct ieee80211_vif *vif); + #endif diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c index 8533bad6caeae..1b6c158457b42 100644 --- a/drivers/net/wireless/silabs/wfx/sta.c +++ b/drivers/net/wireless/silabs/wfx/sta.c @@ -728,6 +728,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) init_completion(&wvif->scan_complete); INIT_WORK(&wvif->scan_work, wfx_hw_scan_work); + 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 a41b2c35fa415..bd0df2e1ea990 100644 --- a/drivers/net/wireless/silabs/wfx/wfx.h +++ b/drivers/net/wireless/silabs/wfx/wfx.h @@ -70,6 +70,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; @@ -87,7 +88,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)