From patchwork Wed Sep 27 16:32:49 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: 13401360 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 3D451E82CB0 for ; Wed, 27 Sep 2023 16:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231858AbjI0Qd1 (ORCPT ); Wed, 27 Sep 2023 12:33:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231718AbjI0Qd0 (ORCPT ); Wed, 27 Sep 2023 12:33:26 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2088.outbound.protection.outlook.com [40.107.237.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC9F5DD; Wed, 27 Sep 2023 09:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TodTi8vC8FmITG7x8GcfpPO9nXh6wc8EEaCDRclbymxtq12ngfjHsIXtAMgLhOS/SOqrLZhcsCpVAcP/N8kuB2G0uNh0MSM3zEokzMTi3HZsEl3mWV1UtzJ3EaL3lStXkJagchmR97yb/6SuV1Yl8HUuU/X0Io6qwicKnVxPvZp9txHS/kawlHFTUnPNVzwoeiha9lDmamZWlt/dizIdShmYREUraocRi7uJXt+yWWmPDnQBKFUgujsjr9GEqrlheIC7FT6hXUEI5l7tO+WQ2wkeKxIrORy3KOvHxSrc/UGrDssKPobX6oF3U9Og77sidQ/to2Sv76ntIv3ELl42CA== 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=jn0Oa40vDUH1BmfdOMafSax5cinFd0xoDFgdYmXeBaLWjAJT4ca9Y8LqCVLPuJ1ImDRbuN1zbHH+XYd0N+LtWEFBH56Esd/whhfbd+7NdupcDG/DSnXxwRqEdiO8kJfzT/MPp8czir+4kJ1WpYfuRVOwv7cnQyKNhk0bZh4xWnTJeK3BwISepA2s/gYIMurttq/pF/1JYK2b2sB9GZF4QiheEwgbxXJ6L5GYPHeaktWB9ri3kDqaLYowNTGD5cPMWiqG9HgEebX5Z/W2O2cWrLEJ9LldCRsaMC0i8MAIdG49IsM7p5JEA8yp3556aHkdLJ2TcP7snDAPm57yhgWkRg== 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=S8Er7HnjR21uemIgvxdgJ0mwB9EwiflQ+/XYiOlRNR6fKHoEcTbT006n4rRNuP8AUKEUu3QwTq1DC2BRPuBXpTptAiaBvThDuyfI/A8cXQLjNPg4MjguhpYe3fFA4En1jZwuuQ1x6ONWv2Q3lu+8xS0oeFwSLD50P/qLuu490Ds= 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 CO1PR11MB5041.namprd11.prod.outlook.com (2603:10b6:303:90::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 16:33:21 +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.6813.027; Wed, 27 Sep 2023 16:33:21 +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 v2 1/9] wifi: wfx: fix power_save setting when AP is stopped Date: Wed, 27 Sep 2023 18:32:49 +0200 Message-Id: <20230927163257.568496-2-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927163257.568496-1-jerome.pouiller@silabs.com> References: <20230927163257.568496-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR06CA0052.namprd06.prod.outlook.com (2603:10b6:8:54::30) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|CO1PR11MB5041:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f486f14-5dc9-407b-912e-08dbbf777484 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KFNxBwVHILwZVF66zAQbUUyE5OgjZCU1iRHw6u+p2renmUvKY3+mNHR9rIzy4YvJnPLFmkv+auYkJbjqi4xVHbFAfGZEoSQ6zXtk6qtagQCUSfremixz4g59b50WuDnZEQ0IyV9SVIDZyXB3mZH5GWySpw9nJlcMhyXs7Z/aw+8bHce3KijUUpeM34SKZIovhz5wkVv4rfmYe8EG5aJbISvoiCvnfxiIAf63UFLMcL7ylV6eC+I8V1lzb+qg6vAfBEeGWXA9EPAlVncl8NAdIzNbrISPxFfiY803/2C8vBKL9u7dTPJ0XyrDX+DYPEktLU2lCkte2K+14basANCX7aRbC365zq71/qQfmVKwe6XJzq4ql4H84coyoKdmY2rf2g6gBrsi0798PJRsULrG8qfXKxCvRFQTI1kmcXqItke2nGRC2fcbr3OHt9HFgLaE4RLYp0ZHq2iIfyWQif7FZ2v6mZAHWKQDwBB4eveomY0+cafYuZX4qKNqhoV1+yFM18ZbM9Zfe6yzRy8JryVvK934VxEj1dJPgYlesLMvZIsPLGVluSu8cjzcbvTfNSWS 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)(346002)(39850400004)(396003)(366004)(230922051799003)(1800799009)(186009)(451199024)(6506007)(107886003)(66574015)(66556008)(66476007)(6666004)(1076003)(86362001)(6486002)(52116002)(6512007)(478600001)(38100700002)(2906002)(83380400001)(5660300002)(316002)(6916009)(36756003)(8936002)(8676002)(2616005)(66946007)(4326008)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?gzRGCntxMy63iTbhDn2zWk2MsZMx?= =?utf-8?q?C3p44kLuZbGhdsPDu+2amxuTf36L6QlrZiahLeo6hh8WfgBLFtv+uRlA3kjoKzTLc?= =?utf-8?q?RCDzPAEfeZjjyUg/4rAUq/E6ZRauq+WpeylwfDGw3183tL/rh1DbnSvyCd4KGrqGX?= =?utf-8?q?i+HlMZ0bAWyP/k6FfJjvNXUP9hQpIcKnAvNiqRrUwmB/aYyNPkdTFmayScO082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f-8?q?gU+yg38XfXJWTccP97a9+daychZT/RUHDwDBB0Xw9IxhIrPejPofT1HZSMIFx1jGk?= =?utf-8?q?BPaJUliLQXTTxBjR3CCz2EVNp6aGrLDFmSwqcK9JUVCGWmfAKRiz1fWKH3T3q0KcC?= =?utf-8?q?c93QZ8rEm9DJcGNdBsWeDe7O4RCeHS/tpnnpFXinftlgp2WfnJ1AZepPKgJGYILDb?= =?utf-8?q?CRfonZ03VSNB3oTjos9+qawDNAzPEJljsfrzDaKnqP+KEbxKBGHqbbo/JYi8muNc5?= =?utf-8?q?xrOZCHZye6jSI3IvRNOo3pcaQayQeSnEhzL1MbD55Gf8oahVd78AwlIGcBipPx32f?= =?utf-8?q?bsNil56Fud3SG/Qaza5z9AUvHP5YGOftQkZDhwL/qZfr70CSn1FkmIMHo+6wZQVF+?= =?utf-8?q?56+HL25gmf7FZa+7Lq5I6ppNoq94oa46kq9uR/+Zm2mro0MoYqx7j+cRL7r5Xa8ML?= =?utf-8?q?g6RTHXOHcZa3sg1jKShaPzBi+deYQ7tUak/BLrhVT4ta3JMCUXR3ruZQZHQGIuLtY?= =?utf-8?q?r+MAsydM+tw?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f486f14-5dc9-407b-912e-08dbbf777484 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 16:33:18.2400 (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: RH5MRTGMwR+/rFeFlvTtEexIqpxrAjG1lxg/8PyKk0Qodfg0G8Be8CRgOo/T1KYKEdmNKADaqdHvNSWsy+ohWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5041 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 Sep 27 16:32:50 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: 13401361 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 8A026E82CB1 for ; Wed, 27 Sep 2023 16:33:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231886AbjI0Qd2 (ORCPT ); Wed, 27 Sep 2023 12:33:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231565AbjI0Qd1 (ORCPT ); Wed, 27 Sep 2023 12:33:27 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2088.outbound.protection.outlook.com [40.107.237.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F213BE4; Wed, 27 Sep 2023 09:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CqlB+5lgIte6IAxgfpjVVBwy1lCyHPL5veEz9yt9/obLBW4u1ujVf4TXf0E9nbkZRM44AhUQ9FOTP6P13+6mMDve5MbJgvdrn1F0LZB5SUfUwCf2VUeqZ8j9EiH6y2Y6TZfT9eSHvchdf2cWoARlLmiHZuD4X9TiwHJBJzGHbAViZ2YkSVwFfRVPohIZcnf/E5rRagbtHvd6dN8eJgpd56p1bZYv+k1AT8kysbDw8P3PZ9cJ5IAiJ1nQUrvM4eQtsYr6ag95EuLxhHe/X1yJ+G7Eu1E/IBS3GiYbqQPo2fqWryvalfsOuYq2N7bTSYqjAEEyQcrqNV9cd0qQsBz/KQ== 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=kkSTKMtfQgfmTsypVUJiOmBrcypfZGJmB+37k8eAmIW1G0/u55S26wuqUJahvFtB5jZeHFESvFru/YMdxD7lsMJdc5xPTUm7hLbklkNBnW0GL5OKKm8ghbV4mkrQcd1ZRZnuvT2bW3RG4Qu8l6zKUjGt5kPaxwOWWqKgDkB/aW54BE8+j76rAOXXP7HOgX5bEjuF1hjHHp1qV8TBuOHEG9fl4CmdwcRj/HvFk3cVQkBxDoQCDQVcBBqS8dOu9aCs5dyu62VTWIlCtPB5LzsazqvjcLc6TVUXNYSTe7tZObdewO0BhmxMY8hpmEzBh73QuF3WuKO0EYfu7VobJmBcWA== 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=N7AlkFB1/gaO3kFghs7nVtKyFzYoI75rIcChUSbWOwZ/m+KglD/ukZdO/jse9SR4+8FigqXCNG+NZin9ezTKR7GT1mMNHQrHyIP1PLUbkPBbVFtORDU6uqY0oWLT08hNl462oAVZjIvG2hKSQPHGQl589XrlVeGhbylx9GBSq+o= 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 CO1PR11MB5041.namprd11.prod.outlook.com (2603:10b6:303:90::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 16:33:21 +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.6813.027; Wed, 27 Sep 2023 16:33:21 +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 v2 2/9] wifi: wfx: relocate wfx_rate_mask_to_hw() Date: Wed, 27 Sep 2023 18:32:50 +0200 Message-Id: <20230927163257.568496-3-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927163257.568496-1-jerome.pouiller@silabs.com> References: <20230927163257.568496-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR06CA0052.namprd06.prod.outlook.com (2603:10b6:8:54::30) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|CO1PR11MB5041:EE_ X-MS-Office365-Filtering-Correlation-Id: 80fa8505-873d-4169-667d-08dbbf777556 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VGMY5yMdWT04GTSojxrFwnT8/BT8O+sE12s0hWLVcI+Serae+p3dq7vUJBFY5HZyDIfr7q+wd1L7fk+cgRFcJ9H73DvF6F+NDhP3+Lkc6RjhCG9eO9Ly3otrV2kAD3YSShVXpraeVqDjh0YT5JT4rlY92ncgrYzmfLSxK6l2tifRNqNlNxvaiAuzvEOVuqPwQvczjYpyNxA9aada4K+zQjEWarC79KEqVKmvzzRxqvBopf+dC0Lq60HXXINpFdEx2BTUy9yg7fL2danYc4zwd0rxyr0GNFUxoPJlgMRG/mESQ2HQxoiLzvP/wSAz6nF6GtDazjczBphi3l3gKMYVU11fpwqwZL2qmXyJXXZlJMQSwET3OO5eYJ1xQAlEgG3T041bA1fRp/OdiAXQZY0/aPGptkIR6gcpHPQmZVvKLfCXFCZxRzLC+R4ChVTyw53qjOTzx8OwnRFWyF/FtemAIqV5BnKjjkF2y9gnwgJhaA046c3tUpKmTTwMrrw5p6VCikpUrnrxfKMNmy9m/HdAVXw4Fihpovalj3TRaRMaang5VuQV+2QrOn6nWSS9NDna 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)(346002)(39850400004)(396003)(366004)(230922051799003)(1800799009)(186009)(451199024)(6506007)(107886003)(66574015)(66556008)(66476007)(6666004)(1076003)(86362001)(6486002)(52116002)(6512007)(478600001)(38100700002)(2906002)(83380400001)(5660300002)(316002)(6916009)(36756003)(8936002)(8676002)(2616005)(66946007)(4326008)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?30z6exFaMUYq9NswSNS0W9KxsCMT?= =?utf-8?q?UwzV7bbC6ze/oJTAUG3fjPVS8TbqqMTRRUvMkH2/A+mJDFbJ984Lecj45XzL5OCOd?= =?utf-8?q?nOmrx6SwWHhXDHxHgMk2nREg+JO9dCnPrYxIq4uk9XEi3LgPn57h/Z7wNM+Tn8HZd?= =?utf-8?q?RRmCpaOn/4t0u7xWtAdnS3p4XzrppCGLJyYtwkjwc7AXxebJRlnOW9D5ksDYI0hbk?= =?utf-8?q?Y78OcjiFoOzKJFdqFgzUHMw6iGxfptxud0DxHp1gSzTmcAl+aFrKijsUCGWdric0x?= =?utf-8?q?eqJqC1cKNnbBZu8iOW98Xh2wu6N7aS8ZTjKwmmf0YuNpYKoHrApty2X7AFUlcvxyS?= =?utf-8?q?Ghpaa72g6+yPMhbqqspF9Pw0y2+60Q1i47U+JG+SWkh8kPWlDW0fIz1DELdnF06gp?= =?utf-8?q?+LKjtYNf9tSQdw6W+xSDDWk7OetAd+jAIwDWY8knRCPsQAcYbSpp+fMPDy4/+3wx2?= =?utf-8?q?XawzCH6e4RqGvpsvLRJwBoAIy0J7TIMt3HLLBRPZhagSt9dZf+w4c9CqsV8fFUrYG?= =?utf-8?q?iKrvAYio1/00pnAiN1+HTmIHmjYdBC8TKJef9qOqmcrz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0R7fqUEvtNMZ2wwV?= =?utf-8?q?JHtRYUHKhe2+d1d0m1ha8IYiKB5eED3icaNzpjMm4rWHnEhdum6OL+/3t2IQUhbkr?= =?utf-8?q?ozLq3foOdPgXfczRw10C1fKi0C3ZLIi17DK9Hzd0E7J7V4t1TbjY6NNXDmJQuGckD?= =?utf-8?q?DH32UrLUfVq?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80fa8505-873d-4169-667d-08dbbf777556 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 16:33:19.6087 (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: MyrM3r982D6cpJ/TaaOPu2vLxZBGoFNFxpa5K/te1a/mKnsm7yBVEJM8xmguV7Mcsx8QIEsS4kuQmZoUy1EnCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5041 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 Sep 27 16:32:51 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: 13401362 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 19481E82CAF for ; Wed, 27 Sep 2023 16:33:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231906AbjI0Qdb (ORCPT ); Wed, 27 Sep 2023 12:33:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231889AbjI0Qd3 (ORCPT ); Wed, 27 Sep 2023 12:33:29 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2088.outbound.protection.outlook.com [40.107.237.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BD459C; Wed, 27 Sep 2023 09:33:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mX6B+q7wBOAf+fpj6LfIlkq8LhGcB6jUCbC2jBkrX64y2rQWQkO2SRMTPXwLPFRajTiPLrPoj1tfKJ3+HzPQ5EkD6jrOPQUi8WV/XAXWeH/TrZkgeX7Aiy4pSOf6SWDex1zhBRsbhFVhuiTxqNjwsGVoAQho4Wn/E8/P5PjPXJT6sXdk1tBkO0j1uQXefek8nVvVXey7dRvvOtGIvO59M9NO7iF77wdR1fkrMQs4kSywPushYZBiEHyOjRRGwkWwpaU5becviAfIT/qJsDiy3u1EydPaniiZ1/iWyQtct6Pc5zXn0Mmdsh+F0IjiXKDyknRFDptRIvAsLVNLEDvDpg== 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=MmOPiZAsFxLiYLxNARVKx8lfkpYJyPYq+C1eKoWMw3T5IEqsfrS43xzWl0GQDVpJ0KY/QOl6ZJU5//i5z5t2faWllY55Oa8ItFhP2ZbJRxLauaUy2nHh7tczpBfPn7xgrL8yLOpbruJtha+88HYGzw+FH47kW86yFFttDoNrP2AjKjIJ8KLtRKHWHM6VF5guwoMWEg+5bVH2K+MJ1MnJlK57GpQ1QdgCXMwghfXy7Q5AidNcPGaVQUbazyzAEBQQciK8NnKSA4Mq6vVbZxjpTvRV2NAf8NtLkrTTu3JCTWcvq3WC441qD8KzFI1HJlVhu0tnOcbvdHHbqqtcCKkImQ== 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=a/8E8/THohuDiSzYM1SUx0C24DkaOEHc4oRrmsAh6LfaeOzIqfkvdPijWpty9DADIY1eZ77srjQq3y9Tu6asmtTGYFbM+yqmqCrvh6/pdigdShvKNZusQP9Nj2vSbkgXA2InnRKzt9T5A87mTW0qYT0I/oyGEDzbjhKziWlWMdw= 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 CO1PR11MB5041.namprd11.prod.outlook.com (2603:10b6:303:90::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 16:33:22 +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.6813.027; Wed, 27 Sep 2023 16:33:22 +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 v2 3/9] wifi: wfx: move wfx_skb_*() out of the header file Date: Wed, 27 Sep 2023 18:32:51 +0200 Message-Id: <20230927163257.568496-4-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927163257.568496-1-jerome.pouiller@silabs.com> References: <20230927163257.568496-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR06CA0052.namprd06.prod.outlook.com (2603:10b6:8:54::30) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|CO1PR11MB5041:EE_ X-MS-Office365-Filtering-Correlation-Id: 26190cda-6aec-4c13-3bd9-08dbbf777628 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EAYu9IiEHe3gYlAO6UXQyoHXS79n01TxNUXaFWkRtREJYcr9XwqPNgAekqztOb/0jMIGvza4wGELAfxKgDHD8GpiMObmMpOhlJMTh/qX9znQyVDuTOFGodX14Rh+YhFH+lGoY74j4yLA8GdlqCy9EHm9zdILxxKiw1rthXLj4is0Ms6Pf+8nAb7XwILNuSXzBEOhB55ipC8AhWZdyiSiml8hbgXyIPHtRYmHqLN38uGbsv1UhdH95qM2nSckxxqIW2qfJoKt8VbUSK5e5M0rB6XbNY5ao9rVAKJX833d2xSdDGFjFzwcb3wLtTlwWDLqvjp2OK+dbbHAo+Enp4meJHiVWBfUmMdFtxOY1dt9/HDZM2PuWkFtws/N4OpV/8dqAQIptrp7CuuaW1nHGkiiw6dm0PaZLgWVFe7wqNWeljvuhUnDAJvW7aOGNZUkFRflgq+sFHiGvCgmn9Wch3SjOiJ0/pSk7sXSewh+hxPdiJoeV0Rb9vXe9O324+T0nJknAD1u+du4iL+vJeq76RCLcQWQd5A2IWRy65Tn8IhH0MQ8gIsTl22WptaPOEGL51Zi 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)(346002)(39850400004)(396003)(366004)(230922051799003)(1800799009)(186009)(451199024)(6506007)(107886003)(66574015)(66556008)(66476007)(6666004)(1076003)(86362001)(6486002)(52116002)(6512007)(478600001)(38100700002)(2906002)(83380400001)(5660300002)(316002)(6916009)(36756003)(8936002)(8676002)(2616005)(66946007)(4326008)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?c8BT6w8cmTLThhLFPSto0wOSf25s?= =?utf-8?q?19PpsrQfvphT7SP2BibabwaN0iyTJc9R3iVy+qxeMblJdDhfZfChKnUbAsjtvJjTu?= =?utf-8?q?Hwe5M5Wx5Wh0UdEzeKPuk/H54VmAzoL5m3wdFmxDG2TEWP6CkjjdD3ppdei/+7+KT?= =?utf-8?q?yjUKP8fcQunwwGCI25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AcKjKQpG2fFhlnVpqkyk/OJ19Ix+6HDXD6R2A7UacOmRhBaXd7ljb1?= =?utf-8?q?2ZXuhjqf6iLbpR/phed3Isry/qKqVT0q0nkFx91XstUxgmZBEOSVzx9SHTA1BL6Sr?= =?utf-8?q?siMp2Uzw5791Y1AeOmKLBrCTA9RsF/MG4Y6UytkvPsnmuilvnbQYNM8ZJbLvl7LeQ?= =?utf-8?q?Gj0chQJTGofq1xNzbqC3tR+jNMdYtfs4kRP8y50XeijlU0qEK7NDD4iek3yFDYg5u?= =?utf-8?q?WsQ4AmPN9imE0Vo2I7/sqJ6AwBaqQoYD7CohW+xO+3epOyRnuU6GNYv7IRWJO7jEb?= =?utf-8?q?HYFe5+cU02NMIc+/h+W5plQvTSTloAp+79XBGzBTzcS8CMjHe+fQehYVNTcyJuXzJ?= =?utf-8?q?2VF7HomRUaDSVHPWn+s4PartDl1YsdiGAGrqdElnGfon/PQU+BaCy7PLe8NhNtrfc?= =?utf-8?q?/+XvGCiwZBA6XRbZldqcTVncsJSPXKP1xjwlWIl2Z6x+Nh9lvrsFzy6/EwF0d5wso?= =?utf-8?q?SxU8UAaCpjkodlJkyFZ8xcMT36JBpqoxvZs2/0I4bGLmiXV1LdI+3yxmbvVA30EIU?= =?utf-8?q?m2qDybL1cv5?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26190cda-6aec-4c13-3bd9-08dbbf777628 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 16:33:20.9615 (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: e71hDkJ9nREtzBGh0Vu4D6qNDPXNrrZxT9Iwlf8Q+/IQfdrsLk45EHyqnXqdtS8icl3Aj9xrbJwDnQ0yUfWMxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5041 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 Sep 27 16:32:52 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: 13401363 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 CDF8EE82CAE for ; Wed, 27 Sep 2023 16:33:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232022AbjI0Qdl (ORCPT ); Wed, 27 Sep 2023 12:33:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231907AbjI0Qdb (ORCPT ); Wed, 27 Sep 2023 12:33:31 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2088.outbound.protection.outlook.com [40.107.237.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FCADE5; Wed, 27 Sep 2023 09:33:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PEBnJZEVJnX2shs4eWB4KGe+cpi39/InfRmTbDsHTyRh9YHl/gy3Fi58+BEfnY+CX3Loqrj0qUBzgKDjuGwkiJSC5Qe9NX1m62BLlTHkxVrYVOGujBrpyjG6pozJW+jMZPBISxGX+voE95/E51PRM+szvYEhn6lKEfrucpmVi67cWw4jLkkmux+L0OSvu9EHPy+5mUhsRH6RLDgyUx4CnaU8cHU9miHPdKvIpXympTbWAUFaYlB8NlGmkdQis6lmnHj/oc303O6lJFXWg+yTnTK9SiiaFRIl9+69Ic/JWcGBG2aL8uoWnCkplqo6lFU8Bzsux+1Bripojh+HlHzvCw== 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=Lpcu9pnCexadUwrHWlRrUloHNv0EP43n3r3BrqCSHwCFv+rahGrZFbk0QAGB9ZyNhdlDX1vSrFf7eKJ/j39am16spUPUIJUZUM0kCg5L2KxadFG+JkwOAc8Jciu1PVBv4c8GLwAGzPjLAVLnsMC221oCwktOG2FMFj5954KxKPmsa/rSI+Ldy7aN6vyO800Syky2C6CAeev4IoPSYWrat/6Dxt2J8u4FHmAFZQs9H9buOG5J8l393xd5Fx1bWpbTux+Q3GiSjVMbq2qAa2X3Km4JRBhI8VlV7HL8b1VIu5rY4fN7dC3uXtaVZex2/wiYTSr0qHcR2nFqEk167oaK3A== 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=i1q0Me3l7H0/z+yUJXEgYv0r83r4x/rEegrBr8lJuqXBSWne+yyHz02kxYYqw83lKpb8vMn1dg+LDqHRmTF+t/kaChSc68pxFAAjrXnysHTnGJRx/bxaHCm1ISKpcT2PeTkttwr3eGwFC3xB8mGwh9KRqTZFLcJrc/bFGfihE5o= 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 CO1PR11MB5041.namprd11.prod.outlook.com (2603:10b6:303:90::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 16:33:23 +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.6813.027; Wed, 27 Sep 2023 16:33:23 +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 v2 4/9] wifi: wfx: introduce hif_scan_uniq() Date: Wed, 27 Sep 2023 18:32:52 +0200 Message-Id: <20230927163257.568496-5-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927163257.568496-1-jerome.pouiller@silabs.com> References: <20230927163257.568496-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR06CA0052.namprd06.prod.outlook.com (2603:10b6:8:54::30) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|CO1PR11MB5041:EE_ X-MS-Office365-Filtering-Correlation-Id: 6756ae1d-7477-4d58-4c4a-08dbbf7776f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3+vvr1FaiJkvWRr5TfHBXSZg4rL+Arb+pvJt/CSzX2Hawv4XENUjQn+MmJ4pssNex3SNk1em8kUeirObn/DPyXi1IDhqGEznUYtjQ3bcMQ+fGvR6MsSShgibirc4cGpLH+y7FvWu6qTumnChu915mI5n4djAN7JMIYYWEd5L8M1XnmNpciHGdr3OJgjxmSKWChpdM5ICfvy3jvQi61Nwe0kaAB5wW0F9d29GGC/ruJJUqtsdnxR3X4/BL4TBCPpENnfOYGJ1lM90tVeGMgBkvZwf30zbEvEKhXjzQwXKMRz5NVhW8TtfkDY/25Xy4LWZ3tapJFHtUF2LtHUvSMF/AkNRZ79qPh32WxNPs1SHPN66B853rIYQYT2BBUiu8gzuFXl04pdIN8pF2C+reRKxCbQyeQegzGrVbvHpYkm//f9WK2E1y3sGr2mOXmpHQtzjWt54huBgurE8bi2Zq5A4wPYMyikeQvVamDmpy9/jYOZb3aTVu2cKViPaRVbd5X8gDOijGWNSx6kgmkc5be+/p41HCKy8NtlT/u0bXxuZLSCWeYV+xksGK6WBMzYzSxUl 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)(346002)(39850400004)(396003)(366004)(230922051799003)(1800799009)(186009)(451199024)(6506007)(107886003)(66574015)(66556008)(66476007)(6666004)(1076003)(86362001)(6486002)(52116002)(6512007)(478600001)(38100700002)(2906002)(83380400001)(5660300002)(316002)(6916009)(36756003)(8936002)(8676002)(2616005)(66946007)(4326008)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?lsTwwH2pBQowgZVda5G4RvqAk5l+?= =?utf-8?q?eYwwHTHlHx7le9I2dZW1FU0F1/5rvuYmYCBFq/24/HahGFCLuyzXgOuJsk5F601vd?= =?utf-8?q?B/lYVQfSpD9EPVeYDKvTgZOGUI82knL+tLtPXQCnqIss0TgiWrYjsfhL/WVtdp21F?= =?utf-8?q?wD/9RBpRurGu3fEtbdUQmXIKzB1ZsOfsE5nkeidkXWoRl4HITNOUVfO7uQQqfxe1D?= =?utf-8?q?cdB/sia/rMeI1p28S9RC8tBZEfLdEusUuRO1HmanqYZK39TbAT6TQDZhBtPlPOd2I?= =?utf-8?q?wuQah+x3VNMMYc+VJFHPbeJQbvcM32iJ30LfhM6WmGFcAH9h7kcgJ9hkbjNKqY21S?= =?utf-8?q?goXXEHlJZ46i6/C9Eku05DpG7Il+N1MOYRREH4eKrlJ5OR9LU45wSo+LSjTaN4sz/?= =?utf-8?q?UAGLjRAnzIJYTKEcjPY3MnDgffiKQwuiOgJnq1EKHB17vuyxAvPr+7Ago6oUwCNct?= =?utf-8?q?7U+vC7TXEtv95VkVAuWyx/8d4mhjNNJxnnWJNrBmKVXTVV53cN4iGwIcMhsX97CS5?= =?utf-8?q?920lBAfx9tNLSVRXx2MIZXJGqZMLSbRsohLC+6w5nVf3ZLSU/GybzKm3iri2ATGe5?= =?utf-8?q?u8l/ImVOeJfhJ/zwtX/jdbaXZycLa11Wefi106aGARLhptUZncAzSL6nciHSJVpsD?= =?utf-8?q?iYGYMO6Ozuywc5aXn/F5Ld+khfyt+KWoZL7IxmYK4nxZHtzgIbkzFtOCn7R0kIZH5?= =?utf-8?q?31oGUhAVILpuOqTfPj9uw0nj1Z29/B1biLQFAx5K7K/DUUykltJ4y1CDMnqClQ+1s?= =?utf-8?q?rZlOlJZDXmOLsjq02hgnF08A7KEh/kl1yHV7rmB++I8eFrm0EsDaU0EL+UriM7Og7?= =?utf-8?q?Se+CsQdov11XDPXkN6yWtasB1XmDzGjEO14r4Jxhp/gK+2QhN60SwX6iSzgmxugTc?= =?utf-8?q?vgcGt//cETgDeWMeIZLFaucBjFO5cZOsigUiHRUIXcyMW0ppHaiVssVRrgvUMJETt?= =?utf-8?q?0vUT42l46llAFuiPWoALNMihsEdAfQk25xsU08dLA+IaPAm8hq7I5oUBoPxPgSpRA?= =?utf-8?q?D+19gIjtD7gfuzE5w/eBtup5EidrAZAD8IlxEYsqDYsvuo0EexzftFo2F3ZSElZtZ?= =?utf-8?q?y821rpxneI4fn10tUQNvacRhrmynsY8+RCKXmhi0GHMkq3DmmkYElGTNylu3GGndJ?= =?utf-8?q?T57RnuGlZxy+D8KeXJNpBu+BWi6/JzM6AfY6OHf4rb06bTxvK/3kVB9nOywU2vLf9?= =?utf-8?q?isSfw9WiWs4DJWw/cpCt6Fpa/I5AJEGbbzRGjTGlzDzcaocOCDPb+jhUG5JTdcrJn?= =?utf-8?q?87B0I5lJoxcsccMns8oAwh7cCD05e3R2pgBC0SAbcPJAgeQn3Q9DZwE8GQJIKq4zG?= =?utf-8?q?CjG+Y/yKFp7V9mkEcagYXn/LtnRGUCLQ15u+tfEnTF7NuIG+f9JH2QhMkpFy0lKaA?= =?utf-8?q?ElAb+GKAReSJXtKWES+xDwOnul1wrK6dRNLKMbh7quw72F163aGqLHvSvDr2XiO2A?= =?utf-8?q?X2hfFEdlFWR+nh8rGAIg4PZWz1XDdsoEQPn5WoIW0N4h7xjCZUbrZlGR5sNRsXo2/?= =?utf-8?q?dFlUIq1q7V/kAhzwlfbKrjVoFTE3eMUR4ItNQ9c4e6FPOVOHo5U/BtfkMF8zSUB6N?= =?utf-8?q?VMBRKamS7iN?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6756ae1d-7477-4d58-4c4a-08dbbf7776f5 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 16:33:22.3110 (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: E+WnMR7LViNCRDNKtYWlEfaKqNl5xuOLiauXqNXrD7lWBfdrVxpBkIkTBSj0me8ChZKZpEV94RpMID0HdZJvDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5041 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 Sep 27 16:32:53 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: 13401364 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 E956BE82CB0 for ; Wed, 27 Sep 2023 16:33:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231985AbjI0Qdn (ORCPT ); Wed, 27 Sep 2023 12:33:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231861AbjI0Qdk (ORCPT ); Wed, 27 Sep 2023 12:33:40 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2088.outbound.protection.outlook.com [40.107.237.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15250FB; Wed, 27 Sep 2023 09:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DDmhIeCnsj/CZVQfuGpig6c07e24aYc1av/S7yps6PmMhNvtFOPF5Vt9h6x7wG6EU9usj2E1DKY4YALbZ79ENWZa8zT7zVjfqVzZh+5uc7Wbjd1xg5RB+vzNXLiczHqKH1Ky8rd8WokTuC532XHP29kTDPdIIIEspm9qNcL8wUeDoLbe8i5JsefjPhEkIlW9iZf5pj5IvofKQ9q6nBPDELXgleCYueJrxj1yCrmFlahgzXzpki1h3v8T5INWj8s/j1MbQEnim6xvtTdmN29bL5sUeFpoDllNLA6SB2DESQmLTuiTj7NygAfdpuo0cbUGBZ14XqU9ZpN4R2WEw8M9iA== 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=n4d8aGNrGVWl5jnWEQiq+LEGrvdAMc1Dqh0Q/+W4ZM0=; b=YeZGXlMjO3nHmg6pCrny9nSMaiocIz8bv/0pTGOpz74mM8H8nLnIYmIHO6t6DFWosyFnZTNGZX1DC4pFkcoZFHCnu9e9QRDQqu1e5bDyrJDwJpxgFWcAjp9q267u4tdUk4gx/ZwRid/XMqTgDyda5Mqz3vrOYlsbed4Rq3/WHlXCyYMuihXZp8NbsrgjKB48jU7Pnnu0UsjReprjTrf8Yrp9uBLrwxo1LFWPDbtOUlzVec8gHJgOM9YCB6yY6lqXial/PgRK5GNAxYXiQ9GJcoOGjpIHzSv0QhDdjBKne5OkYMXR+Oo1rD9qHzS4Dd4R5a1rwRohpSJxH/xMuDtmwg== 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=n4d8aGNrGVWl5jnWEQiq+LEGrvdAMc1Dqh0Q/+W4ZM0=; b=llobKuD98Yl0fF4wXHm2hoWeU6niu7sqNCvTieNzh/qWYAWprSmj60j8AmFYYgpz9UbG3hti//cZ8EZXIaRsuyzAqNeJ4GagvxBOlGH5hWTqxxW7+5H2L5Me2xcL/lm8tP7Q1cwu0swCNVCOz3pHPPVaFmxzcVWjNtVkWMAokPs= 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 CO1PR11MB5041.namprd11.prod.outlook.com (2603:10b6:303:90::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 16:33:23 +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.6813.027; Wed, 27 Sep 2023 16:33:23 +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 v2 5/9] wifi: wfx: add placeholders for remain_on_channel feature Date: Wed, 27 Sep 2023 18:32:53 +0200 Message-Id: <20230927163257.568496-6-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927163257.568496-1-jerome.pouiller@silabs.com> References: <20230927163257.568496-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR06CA0052.namprd06.prod.outlook.com (2603:10b6:8:54::30) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|CO1PR11MB5041:EE_ X-MS-Office365-Filtering-Correlation-Id: 888293cc-2bd1-425b-0db7-08dbbf7777d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e7pZLZT+GOeqwF8OBpbP+hi48vwggqwMmTiWdH0G+lXvnR14lFl9dyTO0z/7z24UZkGTDK1epQWVdK8Mi/4ApsIhK0PSiDWWXctz+4WXJePBgdS/kRDSMqL4BjE87n3700QEUe6ooJnZYvJJc/VasNEIPOy798kfCat04MSa6ivfqrEfBCyh8JfYswJagcD7bEBCYogu/9SH2Rh5lodBmtcSz1vRHBsEbLFy5Z+kYA4fBbFeYE2Lj2TdPeu4m/xWy7+O226USCKkspKh+8kyJPzbpXgDAitFjpvkDCl28eSQqgo/qbb3wYkBJ6gzgwR6xDDNfxIe21CyTTCR9Fwm/exyhY52+WYIcRS0hy30pNG6LCYkwXu7EH4ViR1+qxBoM5myc1URXzldfTO+6AsxQ4HwTL3JN7UoJdatRY2nZqfztlT5a/DBPQ6xLG9eMtHDxgBIXJP5r//bbgKj6tMvofGji34R1ipRX8ha/ZtOjYbCmdI4wPPrHy6stFbFq+wLjkhx7L4syZ3VIrhtXcjQcM1TsJO+K0GCO737cWfzv6/UZc38QJWPyT8k4/fV3UtB 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)(346002)(39850400004)(396003)(366004)(230922051799003)(1800799009)(186009)(451199024)(6506007)(107886003)(66556008)(66476007)(6666004)(1076003)(86362001)(6486002)(52116002)(6512007)(478600001)(38100700002)(2906002)(5660300002)(316002)(6916009)(36756003)(8936002)(8676002)(2616005)(66946007)(4326008)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?JXw+BalRUcDGhe5+rhojDqqY0G9G?= =?utf-8?q?ffZsQ86h5h6xyzTzZoAu4vPPCBQ/CX8Tq3APrTStefu0Cda3v7r+9YULFqZS+G9LK?= =?utf-8?q?Nj6yaay2G64m7hAd03yMLPeX8rmKtgGz0fFUm3sAC1o3Jk1VyCSV5AUOrZSdx/hh+?= =?utf-8?q?eLbvKanbfmxGCjsvslfTHmDlMk2AMyJaDefSMJbm8PStkcdh8Kt7TJZEf/iqARmtv?= =?utf-8?q?8tgTucE5jkwjUkB6oblglDmOdrMqmMjkv2jmnP9FJlrdqPRR7q8ZO615euA2Ccvvo?= =?utf-8?q?RMwwWeiqp0ROcWygg00MCMy1fs7Q/o4uwr9W7nw9QU8B3JuK2D0oGJf9456eBrnOs?= =?utf-8?q?fWELlKOqGSSD2AtFdt8xqouSkx/PXCQhM2gaIlqNUQJjfu4EmtD2PA6v644+0wZIb?= =?utf-8?q?45gwmiNoR8iH01I/EXZPSPxoqOdO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ae0ioyHF?= =?utf-8?q?5u8xbBBiZd0AUI3y0vsl64QAMz9bC5Okk/UPV/g4JUzNsJsRrH+v1zpMiq8kFBXnu?= =?utf-8?q?Xbi9inpNg4SKdsiTKyYnXcKwdqvrMsa5GQEts2D5v18DDDc379V795fEbtRr0pcJX?= =?utf-8?q?t0rHrjUImo93MWbdkA0JctgQaWr13Q/CGwnV0a+lXL5/JSJyphNs8UsGg38lALZq1?= =?utf-8?q?mm40q4A+34e4uCOfo5rDrpK27KBmHFCvQoTDq2NPrT5eckLCv8ppLH4IZmMfEowe4?= =?utf-8?q?YzxMAA3QgLF?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 888293cc-2bd1-425b-0db7-08dbbf7777d3 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 16:33:23.7662 (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: oOd4TEOqk69XRUve+iecX+Y0BGx73BO1jojFv7QkYwilUU+Djqab1rLawOAKIOZ42Tc/VQdh/Sv9vMcitoMv6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5041 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 ede822d771aaf..31f6e0d3dc089 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 Wed Sep 27 16:32:54 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: 13401367 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 66911E82CAE for ; Wed, 27 Sep 2023 16:33:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232018AbjI0Qdr (ORCPT ); Wed, 27 Sep 2023 12:33:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231975AbjI0Qdl (ORCPT ); Wed, 27 Sep 2023 12:33:41 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2088.outbound.protection.outlook.com [40.107.237.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1304310A; Wed, 27 Sep 2023 09:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IaOiMBDvYckOVxPr1Hla+orERKqURHWZC5nWLsv98YMqdoUYS7/gz9qQ2y5VoBx564yECGtFn1DP2rtDVyQXr0xTCNN1jA5e24tz7aFKtC9dWuei8YN5GHxnmnwG8zLYjEb/YFWdSIc35s0WEBzobxSOa2NYLX4KSiOdpKujNI9IBAcYDA3r6UjqVHiedEZbiN6kbyq6iLkwXUlGM6GEYcuXn943NRK73WOn3wniyvv3pFIqir9Ju5YJHBeeodWFFnTxC04oJX/DHv6K4+0+/rKDijvSP4VZE+5Kj5sdCBe8gh7jJPBkO6etzYvIPxhJYxduPBBlGyoYfcKYlVYASw== 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=iEeZTFKIH/xeImm70sYbyeuFRuutq8ymyWu0/ZJegaI=; b=WPW3uW70y0SVLIsEznsuICMnweOSicHWNzU9JbiQvMb9ViYgXt3dgtO8Fr4btWqll4uoYINYsjhckHncJbYz8CgUvwXuh+0N6uOxJTS9MmrCXhR1xBgPFh81fyn/iOmAdVIlIVFAUcyfpR6TIks+jlzni1PnH6tOBjhYSkj9a4Xra0N/IXRPJgPMCcSyTMR1jPVbmdFcEulLClNLUZTdGaru4cOmNzOo35FFtE4xKvEwKDSjiUVrBIojIMo1IkLxvqgQXLj0aA5rVR82YEH3WJQid2sBzhXd+gtfSlhSulkQxYoYkbTwCd07AGmIbzQntfqoILQJsO+Af+NSAemdVg== 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=iEeZTFKIH/xeImm70sYbyeuFRuutq8ymyWu0/ZJegaI=; b=fda/Ik9IfkYGLt0Et9jOztRJQQRTlutH0D/ml6f09djFqianiZuR92UySzSnd70kZggGlPt6e99E23w1LipeYz0HmkZx8YEU3XXuFoHF9fTmPILoIBqiPdzV/rLaZgBY/BR6ZuYXKC6EEHRuR9w6PJ4inx/EELHfljjPL5GCZyE= 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 CO1PR11MB5041.namprd11.prod.outlook.com (2603:10b6:303:90::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 16:33:25 +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.6813.027; Wed, 27 Sep 2023 16:33:25 +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 v2 6/9] wifi: wfx: implement wfx_remain_on_channel() Date: Wed, 27 Sep 2023 18:32:54 +0200 Message-Id: <20230927163257.568496-7-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927163257.568496-1-jerome.pouiller@silabs.com> References: <20230927163257.568496-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR06CA0052.namprd06.prod.outlook.com (2603:10b6:8:54::30) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|CO1PR11MB5041:EE_ X-MS-Office365-Filtering-Correlation-Id: df86e403-c273-459e-e310-08dbbf7778a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: psEKFvqlgqj6D4cS6qe0J8z72okMKj4lVDIsEs5aDKIjDgBEAZToemheGobdfmayAKIIqCHiEDlpe+wgDTkUqXhCI1Byh7ltMx7NsN7a5Tg9ezRdzABrGGMhiGCBFwOOGI7tuD7dwDltSgXZVpAcWAodUBfbi36Y+vO7q78ScCxPqwovsrPrtAUth6O0jVaUxOtBG+QvWhE6PDVD+wOyCKO37JxD7D2/yHW/B7INz+PttFeFwQNloo3Kuh4winYIK7+z8zIFfYFg5UCLCp2+2HHkw/m12TB7yOIF2ZLzPHNFYWS53x9uJEZLxTPX/RSy/UoXoLNvP5iRuP0gaoW3Vy69O1Hx5s9A3MjDaGuoenocKJezR9nOOxnZsKaFQ/l0BAa7dcw1tp0dcRtwOvIiuER6LhFYXZlMa4n+zlLnvY1xjMADPBLhmCgqeThK0NvAJwa1K9dv2kyAISrRqXnFvUSG3fRLWakMtr1+z8y/6rnUx3S+T5a0zRNNGC1Z7/PEzrqE4qDUrvVbQsAHjGj4DKsZ9z8SfVrOb8bmO6XwNjEvifrXlerAFZLUEOUpXaHY 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)(346002)(39850400004)(396003)(366004)(230922051799003)(1800799009)(186009)(451199024)(6506007)(107886003)(66574015)(66556008)(66476007)(6666004)(1076003)(86362001)(6486002)(52116002)(6512007)(478600001)(38100700002)(2906002)(83380400001)(5660300002)(316002)(6916009)(36756003)(8936002)(8676002)(2616005)(66946007)(4326008)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?6lf7CZgkpzDJzo31dv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w6?= =?utf-8?q?BF29K4AFkEMDMDy26ZlKShAr1TDWWmKjQpTUgAPBy28KjYmnh6E0dWwxcMXh67RiG?= =?utf-8?q?kWvYse9kVcOvkfvYor3P/W/IK8m4GwLINCcQkDG5iSROYMVfrurlzKNgr/CGtkv3F?= =?utf-8?q?5Yc83DBrD0/lJAFPN6cYauhD3ETyaR4+UjZRcI+OI6klVbcsw8shVc3kozloT5cet?= =?utf-8?q?hYqlG/oI+Z6LCi0Pt9WrbXnY9RfqtiGbW+GYQr8maQMH7nU6bWYY1qhXm4tVXRg9b?= =?utf-8?q?oJeGH1KMamikAtYJz4a5oEZ0sh0lxqWZkQ6yCemBJvCUWj2lcZDttRer/ztsoa5wq?= =?utf-8?q?D+SJMKtzbsAC6HUHvDs3Gacf9tZVs1XtYwhyx9kUNrCg/fGfWG+8Q/SBosnwYSKm6?= =?utf-8?q?RbIdoRqgnuYcQ0ybWtz4uIY/LBcKCs0G/0g0QllOwTcPgXqZ3mdz/Q7aSD3hfTP+H?= =?utf-8?q?s5cIx3OfffIUPuEFNa5+190+WQBVbBTUTRNl1vk7L+GSZk9oUJp1n1weljBCCjg+L?= =?utf-8?q?owuU4WVXaEBIThggaheUlwfEfH8lTTmlV43Ka2wBXQXp9C7xgAQBdYfMusX8fMlx1?= =?utf-8?q?3DB/xm7gOGQzdyHh5vY01RwrsbHm8k8xZg+38kshOXP4Dqss6XKaKBEVLvvF45jvC?= =?utf-8?q?DyOpfNTFZ+rOsp7zcyLsCLn5JkFSetv8NUeep18txiM6C+H57y1C6fY0au20THgcf?= =?utf-8?q?gB/WJMLTGnU?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: df86e403-c273-459e-e310-08dbbf7778a4 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 16:33:25.1534 (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: +EtFPXgzDBtIXhWii7FtMesjF4B5f+da96sPJQmjxipf8SE4wHoLh9Wg93dQKfUOin76Ni6w9ApAJnnZCuIT9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5041 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/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 Wed Sep 27 16:32:55 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: 13401366 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 CD038E82CB0 for ; Wed, 27 Sep 2023 16:33:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232040AbjI0Qdp (ORCPT ); Wed, 27 Sep 2023 12:33:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231991AbjI0Qdl (ORCPT ); Wed, 27 Sep 2023 12:33:41 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2088.outbound.protection.outlook.com [40.107.237.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54B5F12A; Wed, 27 Sep 2023 09:33:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UuZz5+pn/0pmsBDsJfjOiaHQGV/AFp2xVuJXfj4TJrivqfikQzDOY5zrOtnm6T+0Li5qrfO7trytRu89/icdrG1jwMQc7N/DM955/dNO2LvCicEQ1c1sDFH38mq//PVqVjUc9DwaKoovCEW0jLVig9/0wzlw6+nOJZKU2Zw7hjXhjwl3hHJozzhsEQQc5sVA/kmuzsgPDJpNXHKWdJpCwi5951G/Gb2rqOMk+cftd8u/bN/hoDEWoSzyTn5ocMlSFxTAqP7Iwd7Ja6e2dDhJnyinaJBFX9Oztq9fcLXrOYVwNWYw95788ct7GExdCtQNknH2P1FvIAFcw57PKywRxg== 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=mmMx7g757frUoJqf1Hvr6WQSffZEn9STezwVQ6/pcuU=; b=kOqV6KSueCUhaxYUgG6V3zKg32PcVh1aSA5zdIQipkrXD/r4aubc0u4DO9I3HOuVhXFuIctESZoIXsG8eZKkeQCR7RczrGSDAL/GndXKNrb0KUsX5atFMPJ7JJSQjmnBdox2KNgwW66EMPx+rVKx9JWFeAGzyvd6Xw2gIRn0iM4XZzoc2eifkHmQ4F5NTUGaNRoUK1t+myH0djs6n9VVCJSlIgPEIEAyTsjjHM8eIt8J8Kx24K3LIusUwGZ0o89Ahy7yPqLb90lAUzXrpuKSj5qrCeGbM/BhkfCZpfb7zElQTPRVtNYHe/9mpusYeODxiYpgBqSh2cQqdb+J3NR/Aw== 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=mmMx7g757frUoJqf1Hvr6WQSffZEn9STezwVQ6/pcuU=; b=N00L7h6E4F0xmWo4x7Lihhr7IFSLfAoovl+tSOm0y2nvXNWbMDrS6mgTkuJrUH7InHCtu6lh9IoifVX5lmiFdTGFHKfS/gw4PUU02fYGy8XWlcgWmqDFxF8f+f0IMPrKbhVUMqtCn8eOqgo6purqA1egAcmwoThh86fDEUjz8l0= 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 CO1PR11MB5041.namprd11.prod.outlook.com (2603:10b6:303:90::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 16:33:26 +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.6813.027; Wed, 27 Sep 2023 16:33:26 +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 v2 7/9] wifi: wfx: allow to send frames during ROC Date: Wed, 27 Sep 2023 18:32:55 +0200 Message-Id: <20230927163257.568496-8-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927163257.568496-1-jerome.pouiller@silabs.com> References: <20230927163257.568496-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR06CA0052.namprd06.prod.outlook.com (2603:10b6:8:54::30) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|CO1PR11MB5041:EE_ X-MS-Office365-Filtering-Correlation-Id: 43ec9c46-2c9e-4315-55f0-08dbbf777974 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OWOZlvOf4J170INfhduFB5XxSpYZL0BEWwl9zkKmvHHwCqp6gNk9GoRjUKY9PrIclz00C1uRb9lSwE+Y1GLnsldD7CH0ppfCfclCoaSIprAodovNwXWbdbM1EVz39eycGNLQrUNMcNiIFV9CQfk/EDhzk+DAqLHIuZP0Sgo72M67B3aCfHYTwiMQTiTxK154HHriH5BeSc9ev18++KB0Q4+FFrkjwVPbHCUvBTsMOa4vGLHY/xA/Y/eP7N1+l8aEB3FcHkJ9lyU3lIWnkqXQC67AP36W64Uoo3Vzj79l9fg9TWKVKdMxkWmjCg1P6OI+Frk0LQwopi5rS0uLjSagdxRMFOezDW0EEiESyFr/xjh+7u/fzjUutkCglyHrUXlsTzng8GFlb+Q9E9e/WKypuH3Yt3Fpz6gAbyWJiouhWXf6wekTjMV0qPaLJ113oCcEIMAWRl64vBIIW4mn8tM7fkEc2b8/fVeR9Pnq3b9F/ifX+EudQU7AMnylkHMDJ7HnW+b/re9h0nkgXOcgcdRV9EdCh1pYzeCzn0eS8c5Aj0+sPiGp/0EzVIeITCWHTPuA 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)(346002)(39850400004)(396003)(366004)(230922051799003)(1800799009)(186009)(451199024)(6506007)(107886003)(66574015)(66556008)(66476007)(6666004)(1076003)(86362001)(6486002)(52116002)(6512007)(478600001)(38100700002)(2906002)(83380400001)(5660300002)(316002)(6916009)(36756003)(8936002)(8676002)(2616005)(66946007)(4326008)(30864003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ugBw9dnXYp0xlqOtxJEZwyZJoHay?= =?utf-8?q?68JO/HtMR96n7eI7RwG9MvgzCoGPfKfwvQA7AZZxKu04RjL3f3VHg4C2/rsp7S8tl?= =?utf-8?q?l01nGvje/Dqei5HrTqHCRtTKlB5INrXQd5/LUnTbTMz4jRYSwYRdEEpQBHXotbX+0?= =?utf-8?q?s0iomwjvVJ0Tz08Yhshk+TfwKgt4XRSazyu1JvF0alTvXMDaPiAYCB9ZSjGa5BxNO?= =?utf-8?q?kkICwdpEPLAr8nkWGfbH9shceHXIoxaLgFELx2WrJZhos9uOUwSvXfilMtYjoqdT8?= =?utf-8?q?GwVOnNWaoe8/sE4fV/3ntJueLW2G4FKspNk1zjZlYGrCX9L25H6fTXF3SO1JoPLPm?= =?utf-8?q?bloN0Xoy8P8ei5MTBeNeSNEHE0f/e3WuMgJQQRIedwvxADWGkL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A0n1IQAFjn9tSJLazRa?= =?utf-8?q?cJjxFkNN6c6jSFmfN4eie049ts9IB2g2nGlY/nJT8Eeivdw1gPJtpSKfk1JJhGsCM?= =?utf-8?q?MQ67wrFkELB6I13GLdTLUZr2qpPjgclnzgBzZ1I9QDJiHZ3ey83xzwy1c307G26du?= =?utf-8?q?Clvb3+7V5EvepQFM7J4/MajXT10mk+1O1UqZqtMsPGntWBnsYVhuAWpHpEXbCRVqr?= =?utf-8?q?jqVDT8K1tbJhQLm5hDhbqpPsELMuJhYTS91SgesYp8zi9EroaFSYjJf4GxIhgoMPe?= =?utf-8?q?Zduq9aB+uLsnOB6vLK2Rx0p+ovj8+ez2mYuIEiFqmHljyjwd351+nfa8lBTspZWUO?= =?utf-8?q?Dr2j2v/jU2u?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43ec9c46-2c9e-4315-55f0-08dbbf777974 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 16:33:26.5205 (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: u4CjXRwCfhFR6QBKPjmfaPMi5KtLLNfmawyMM4Aysuq4fEsBmhMB0R0ietJwkFi8i2CCy6aj7qQcUJxrDWX+kQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5041 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 allow 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 Wed Sep 27 16:32:56 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: 13401365 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 A4577E82CAE for ; Wed, 27 Sep 2023 16:33:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232000AbjI0Qdo (ORCPT ); Wed, 27 Sep 2023 12:33:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231966AbjI0Qdl (ORCPT ); Wed, 27 Sep 2023 12:33:41 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2077.outbound.protection.outlook.com [40.107.93.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4163AF4; Wed, 27 Sep 2023 09:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lpELk2KNHmZKh5JJMfKgPn8PmAfK5r7iJaNS2moStgzm9wF5/u3mbBbapkyluXAIFqHzVmZNcMFJ8vXFNm8QEF0tY4bivXTfub7/QGjnnVrfxlh6WP6SSBBDZA7kesJ9R2xSqEd9t3drYgJ7XhBjcgMeoh2Yr9x14YCFxFDF5RZnlVIrWIb3rsI0bIsrIDOp64SMSUjxZ8z5PJ/6CRcZn9fxqKcjvfF5xxUbZy19ZsKlj5eANsyzw0MloiKsAq67UPJ6ryPehDDMoqrcKFYa50zxlbUFAZ67J+JxRQRC0K5I2KxYzANa/QjLRpyb6RN5lITC+k2vU58pwMUt8t8vCA== 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=lWc8E8CMbVgT7TANNR/8TdPGoMSnLO96cJPktBpnkXU=; b=mQIJMyPAmjrs/MF1PdhMdEZ3wHnhCeMN0mrCvqmSoKU99hTaY7uKboVGX4tnGog1G+ClvnUyeIZxk2rDVJyxP4j+FWndHVhSm9iGYAUf7owvO2/+hXrSJ1l8q5UPUHnhTEQPXVbBsEcOycVU9MQVvxi7g7A0yQmR6y/yEbZYcLLYY797kFA+v2KKhTp0wqEymAONk3ekjcKA/WK/eMR4VMIVjo+AV6rjQXgZx4WzrsUIrqMl5ZyHcAc7NUHWTccbT0UKWA4im5sU1LNKzhQqqyMHHNJm2GA7yhtg5w+OKJfKEVfY+7TlXl0Z+NRASlszXoTOqUg1fM0vteMKlw3J9Q== 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=lWc8E8CMbVgT7TANNR/8TdPGoMSnLO96cJPktBpnkXU=; b=nlGA+udS0PDn21uITccIx8uV/TcmKiqkFDo/05wU77XWtAWMdlSLtR5KsChqrYORFwa/zYSf/1IgBRFZJxLrdY9x+lBlaOSnXLhG4FasDPwjL5qMsFQVe2j58He03hId+uoqYwcDN1U5gVlPT5mhS468HuIdZNI3FCBNrsb2/u8= 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 SA1PR11MB6781.namprd11.prod.outlook.com (2603:10b6:806:25d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.21; Wed, 27 Sep 2023 16:33:28 +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.6813.027; Wed, 27 Sep 2023 16:33:28 +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 v2 8/9] wifi: wfx: scan_lock is global to the device Date: Wed, 27 Sep 2023 18:32:56 +0200 Message-Id: <20230927163257.568496-9-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927163257.568496-1-jerome.pouiller@silabs.com> References: <20230927163257.568496-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR06CA0052.namprd06.prod.outlook.com (2603:10b6:8:54::30) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SA1PR11MB6781:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f0d3edb-924d-441d-5285-08dbbf777a4d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RNHZwuDX1xdrqSk3M5kfh5GTvDMI05FM8f9Plok1OeCjhsIAWmPJzQwCfGGAFABAU1cd6g2NBOMqyRPSeiAsLa7lT/+fPneTw3SCVJ/WplHkN1d4hIRu5gEMvWr/XGmUdwVvyYB8d5uCp4w6Sexcgx8GaVnrLy287Sv6QUAdoUQ1syQaz76aW7EzikUxpdzsoZ8MJgoixDBfWuckrScf4+0aNYptJiGUCSwryfy4/F7DBFjBFB5PiMJez9yabXxwU+26I1n/mbCKaYn6rx1r0IfWsLX1uekjVO8FGCKg5zfoBcqCT9VLheDfViNTYOQfFRkjiBhw8+fjmUpyRWDx02i46SblSfQ0WGD4tePzF/UfaaZDHra+zrvcOYO3ErGmDWAAbb6yWTmkkTThzy3lAfJET9LUy8N/u/0O9sZ6jsJ4V0OhzUQtd9fXgrb2CvlvoFpzcE2M1FHUQxMfk46uku2ttfAEhzkDtvH3e42Uh/iVHpqZbfytE05AoQ8vVwGRmirWkzq4pkhgwDa723na+gvFepQC5jV2pXPhqonD/sv6htu6xFPtdghrs16BIxRP 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)(396003)(366004)(136003)(346002)(39850400004)(376002)(230922051799003)(451199024)(186009)(1800799009)(36756003)(86362001)(8936002)(107886003)(6486002)(8676002)(2906002)(38100700002)(4326008)(6512007)(41300700001)(83380400001)(66556008)(5660300002)(1076003)(66574015)(2616005)(52116002)(6506007)(6916009)(66476007)(66946007)(316002)(478600001)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?+2SVksEa4WY9Uw8EC+zpJiMXbB3o?= =?utf-8?q?1Cn/RRL9mfrSIsqIHAoQd3Bo4hUu3rYIZso9E42VW5MnexmCCu5m1BonjP+gxH3I3?= =?utf-8?q?Zcu8hUPG6BI9siVMweNTSzELm5VInpzGAYBeFbYbbIpjMQsBhPzxBxQb0k8Jv3JOI?= =?utf-8?q?+WE/wNnIZlTrcJPi4L0bQa6xRZ8JvryWfsI6TDGYECVuKH6oFsEHFdsKZhGlIb70w?= =?utf-8?q?BkOkao2He00q0sRWiAdH9mlVz0luIpTgo8lne9qjawFvIq2fvpyOR3+57Dl/Mu4fh?= =?utf-8?q?k1mKbKgvaIqJjdTNK6VNuDBC//yFlc/eH67ZlXF/Q/JJqAV+6taKef9E+wLuyvR3r?= =?utf-8?q?AN2Ybfd+A0fC47S0SAY6HosjkTlIjOL7vObhItqE1GRwNezuMmrk8WMq7Ea8qoHKN?= =?utf-8?q?Dzmp14Dd2I5euF7B4BE1Xya6xsXDuLvE5GTkp33UXnIET/PkfxuftbqvyjEmEP1MU?= =?utf-8?q?kx6AdvQx5Vkywrn6IXM4Mrq/AF3kKbTFKXcT71SbeEEOnk10Nqhp4c0Rs76Cc1C7k?= =?utf-8?q?Tj3xGjOwOPAiyu6bqT+vNGtW2yGOL0eXgEVtLRBazrFYPF3fl44T8I7ZGChYAYpBa?= =?utf-8?q?kJPo3FCqL/YndSgPSx1Zi3bUGXd7ITKMuFUxyklbmegR6TFOKn9ZvO9p4/0BlqoVH?= =?utf-8?q?3hVeGZQ/Lio+0MNf+8hvEoeaJG7g/3V61Fz2TENIOFqw6yYdJBNDYPHH+NoNdnkdc?= =?utf-8?q?mO4FiprKw4LBsALpe2AmhxR9fLOZZmCt8AOSadH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enant-Network-Message-Id: 9f0d3edb-924d-441d-5285-08dbbf777a4d X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 16:33:27.9536 (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: pPD1v/0t2Qy8oROJcBdsSmzRxTUA8waaQcYkDB8kyKsYt4PFmQi5CRrVKNieamdBcwM6ySqy+3U2sG1ay/fLvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6781 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 prohitibed 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. 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/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 31f6e0d3dc089..e7198520bdffc 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); } @@ -317,6 +318,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 Wed Sep 27 16:32:57 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: 13401368 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 AE657E82CB1 for ; Wed, 27 Sep 2023 16:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231889AbjI0Qds (ORCPT ); Wed, 27 Sep 2023 12:33:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231974AbjI0Qdl (ORCPT ); Wed, 27 Sep 2023 12:33:41 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2077.outbound.protection.outlook.com [40.107.93.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFE68121; Wed, 27 Sep 2023 09:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZG+Lwf0gWOFYub+I9uJ92QnFh4PJl12B9enN7xwx1IKWnh4pXWvNda08qOU1ZdHR6q7cfM5PENehUxT2mJln4tYxvatHSDW7w6WNeRSZDLpQzykCxOFZxKklfmEDcrtAlrr2riGF38Zs45Nmt7oK07Q6gGSCV6cjjWh4KTzpdHCUJA2WEDAn7DX/QgzOxasWiw8vVzLlcWEiGvSazSwySmoZpol9TGJzhD9LUDejdDIFk9M/ml2SLJMdVKQrPBybrwV7K5QqqFhwcoggbjZ0HUw1F+YqkCQ1YQw0PjptEwnl+ziTSJsRlx96RNIrlB9m4g9mmPIqwnNyn/mPUGwc5A== 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=huhkI67tP8M6QtYr1GGcbmD43D/NYKT7XMEh/c5a9+XaNSiCTSRl3otIL1pzAyh4liXAtzMDCX/MiOIUzskb+F+0F35+gvF8/aSNEAYqQq59HeHg7P1R5YJtqzskgs5r5GlMml3WJl7XNPnixe6GyIF4ztmZG3c9NNcqiD9+JM0WgXuI3+YYFNRRP1q2ULa/W/+FZnvRAxNhcggeKX4FB+UxWyz2SNT5Dkew5dmIH664Bkwu0eU93pltjKa/eaQMYNEsG1hfP856YI+w+WHZlXJGjjWdilFZSJXMFccJz534IKoICzW8zwf4quylXmaRcYuhAm81tEry3zKdGQqEhw== 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=MyK/MeGDc/ayCNLod9IBgQjruHxrPsVfR0fu9XNRwccYQo0MuFs9zVeSKnCtvN3oXDwzbd+aV+IwBDchFYjtJSfcXUN+pByS7RmgZaor4/64PSToOp0vSjsnPscSbclQHDgk13WNx515PV4V1jS8ujLa/EXTBBasrfrvBoTQyp0= 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 SA1PR11MB6781.namprd11.prod.outlook.com (2603:10b6:806:25d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.21; Wed, 27 Sep 2023 16:33:30 +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.6813.027; Wed, 27 Sep 2023 16:33:29 +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 v2 9/9] wifi: wfx: fix possible lock-up between scan and Rx filters Date: Wed, 27 Sep 2023 18:32:57 +0200 Message-Id: <20230927163257.568496-10-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927163257.568496-1-jerome.pouiller@silabs.com> References: <20230927163257.568496-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR06CA0052.namprd06.prod.outlook.com (2603:10b6:8:54::30) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SA1PR11MB6781:EE_ X-MS-Office365-Filtering-Correlation-Id: 592df89b-9209-4b58-126d-08dbbf777b88 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9Y0TzJnRoGnKryoYEcR0dBJuhELdAyCKn+5eiMUFleo+drx4JGpm9c08S80jHxPpFPcE2OrGxssV4hsicojHZ1F+UGM46DZpu36zkczGWW72KhwETC4YuPmRaXgfMh1wH9y9O2VLAsOmLY8B38JQvEFKGvewBQjTPhGej2y/rPMIzP5zfDKyyoi5RBakCTWv/qFTu3ypqmYjGgqmRSoMFj5W39WeFb3kFiUXrzolyUWtDMCYTGLXhPla+nJwXnrvQq0aMcuRQtCZv4iqrDUZvoHHqHZGPrXlIhD1547V5QgBottHX9GDfU3VgMVgOjRho2MT1xGmoptbf1V2pPqDi/2Xk8zEF4Z1tX09vCuZ85HQJrOw0NbGXJiJLi903RWQG33rSYdVHyXdz5/J4xsE/hGaYVrshmb5ihi4Z+bJT7JhvCcZID2B0KB3apEfMTTMFrZAGTlfgK4uCLnF473st84+j7Cy+h9Kn4Ms+mT9kAC+PJ2kNQ+709BKeCH5eIvI1Bbw9PBpwfLo84deatoqZXyD4ntx2FDCutfY/pkCCH6SZOrXEyLBc3Q4bbqaAM7l 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)(396003)(366004)(136003)(346002)(39850400004)(376002)(230922051799003)(451199024)(186009)(1800799009)(36756003)(86362001)(8936002)(107886003)(6486002)(8676002)(2906002)(38100700002)(4326008)(6512007)(41300700001)(83380400001)(66556008)(5660300002)(1076003)(66574015)(2616005)(52116002)(6506007)(6916009)(66476007)(66946007)(316002)(478600001)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ohts3UNWHRPixoM6LFupCY1ZcwRn?= =?utf-8?q?0o1u540T+t7m42CFsQeUToVfW1LH7CIc4TCz7HXkHetrul6Z5rfZpYYpFC135opid?= =?utf-8?q?5uFpLsfarxIOjd3hhQLJ4invyhRna1PZkVhJ+KgMDItfdaf3Az6BUtQepNAyKsjwP?= =?utf-8?q?WKkoD5qp3iCWtg5uDibtXs+vWAUrBF2DY+AKxjldRaGfVIZFs8k4XU414HyXQaAQj?= =?utf-8?q?i8s5ptrbXdiQO329w1ggTrhMgvcByMwqyCUY+aHwfWXTcfh3nd0ku0rpX1szzH6pR?= =?utf-8?q?iZ8Xy4kE34FTNxHI82TgNt8r1u0tbhHJDeDa8EdVF3xxSGUoB+kPRCDL2lX/9grZ8?= =?utf-8?q?XFgM/GkDPivhHMFFlxkPvmkiQQFoFi0UDPMjUvC3w/eNeZm9gfYK2H4Q9iESbUJ96?= =?utf-8?q?i32QYnQSMJ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m8XjSVxMN77PwSAQk5aZxsEYEhxLqw1iAZwIHVPmdTE8gNNF7/zsQ?= =?utf-8?q?bcozkGRIRQTcL01/37hbNWdMMAPomCfrmKsx3i4Aa1rVLwEhyCMz7EC/HBIPyU557?= =?utf-8?q?HquZIK8OezKJIUA+gIwystkfRnHcZTS4RpvF0yqBEStGbKr5Y2XNjWXg1fWf8iOkP?= =?utf-8?q?mRiVn1u4NZ8WsuGIRLdRhnHuNp8zRU7sQEnd7UUN8mMk8+ZJbbgyhAFp9INm1RMsw?= =?utf-8?q?IZ7Xj/o3jvQizYAlDjMdXGSk5YXYjvYeVt0G1v/IrbSle6YW1LY5rD5R/RaUMytu4?= =?utf-8?q?TliJJirFhu0?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 592df89b-9209-4b58-126d-08dbbf777b88 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 16:33:29.8944 (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: p7i6HnOJC1ZtVIgU1/0k7TZoUapmI6IAlo0coRSVtgucHqhCqn+VqrhNJYWkxI9Iv5FT60VjK/VVrAoQt3ymNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6781 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); }