Message ID | 20230927163257.568496-2-jerome.pouiller@silabs.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2826959vqu; Wed, 27 Sep 2023 11:42:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGM3Dth9QLhNrBXLOEwYriBWdY5Z603LSie8r5NHJf8prHgQQNCPFrkG5n8pfcjArPRWrIH X-Received: by 2002:a05:6808:1a11:b0:3a7:1278:1899 with SMTP id bk17-20020a0568081a1100b003a712781899mr3347898oib.15.1695840152484; Wed, 27 Sep 2023 11:42:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695840152; cv=pass; d=google.com; s=arc-20160816; b=aWOY7t1Jzw0gg21JG99dLLLF2LLvXeIkEbiItPmx7zrzi+Jb68a+g/T5HZFE9H+TXh PtJk4ZiyvKIW4U6Jo8CmOXu9dUfr6pMUwzrhhPNLVI5fLtk4/5vFZ1op27bTFPbVJ/lg T/jRYgXbDtZq/fk/+1rc0lztrurHQ7yMVx4dT6oY3eqkF8iKMZz3dJLGuGH1rYzugDlx NhFc0LAK2J0LpIDxojKTsOlQfDFepYxJ2TikEGkE4Qiwdqj7kWjAipwYC2dR7tysbJCO wkqywcYpJ3iJNKy3ldpG83BF0zwaXVY80VYleI2UHFpJC8Av1HjLi9jqv7qq4g4vEuoo VbLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eZHHQ7z+gYAqzUaomMkt2aUcFnqsR1wYgwonnDaioow=; fh=l0GbbulFVEGIByrdVk2PDAYC0467jisoj0AJEvNmoTE=; b=bqfm8nCi+GLOw3HSkLzyPD3mJwQgJzFmGd/61JuG+mr3JNrNemx2PVB/6kYWXSpv/1 IFIRgrcSOdD+1VUm1thoOT8mwJfuMw+ntMDUY2MFNEaVIjjZjOqnl99PkoHjZOMHO9DC gOBYaSiWQmu1thbA5Bsp7JWwMv3SJZWgCKnfzevvETKwr072RgyAADgdXfa3gpge3xJG h75gDSi0DVGy/qQ4JEznfq23Thg9WECb49pcave5apL3M+UWet4umRnnc+tcvgUomryQ A9aZ1xZQWRQIFgpeuVUn6ugqQjYHmxrhAFEOkUDp1VE2l+wEqwzFiQRC9cscrO43VU0N EWVw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=S8Er7Hnj; arc=pass (i=1 spf=pass spfdomain=silabs.com dkim=pass dkdomain=silabs.com dmarc=pass fromdomain=silabs.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=silabs.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id bx27-20020a056a02051b00b005703b492a23si19246975pgb.308.2023.09.27.11.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 11:42:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=S8Er7Hnj; arc=pass (i=1 spf=pass spfdomain=silabs.com dkim=pass dkdomain=silabs.com dmarc=pass fromdomain=silabs.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=silabs.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id C910F80576E0; Wed, 27 Sep 2023 09:33:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231736AbjI0Qd3 (ORCPT <rfc822;ruipengqi7@gmail.com> + 19 others); Wed, 27 Sep 2023 12:33:29 -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 <rfc822;linux-kernel@vger.kernel.org>); 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=?= <jerome.pouiller@silabs.com> To: Kalle Valo <kvalo@kernel.org> Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= <jerome.pouiller@silabs.com> 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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 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/aYyNPkdTFmayScO082Svi?= =?utf-8?q?B8McL6p3HG9la88xRnKo6xisHypEJxGs3E8hgBt582c/QjOkSh/IZWUdPyaYYDECr?= =?utf-8?q?PmrpnjnZn5ww6gYjHqYM66L0kSMZvAhAxCHlsOKHcpOGm6+fEDDFEC2abFPr63FiF?= =?utf-8?q?R2ZovjQHQU7pOaus0/ZjKrDaWYPcdLyc8YlnWsvo7CYkvfNEwtAVk0uojH1BTgkTM?= =?utf-8?q?pixInMNKKnIylj/ohfeBbAg99K+8iCz8SmDSwKHKNSAQ/rrYohDzLlL2/WI98Oeqe?= =?utf-8?q?Hp7C0Ba/SxwF5fHOQs5I6aAgytZPpl1jY1Dka8/AtKJzpoXEowrnO/4LqDGY08nTI?= =?utf-8?q?QzNLsl5o9GvF+Yi6023D0bBx/Sz598zQjyAQwHVpmiqxi7fw3vGedDWE/T/yPeCSQ?= =?utf-8?q?ZFlqiVG81/KM5LERow9GU9+klaoXKjayiDrkh2w80TM4FKudt8mZD06t6cXKHvuTE?= =?utf-8?q?G1bK/4hEOhgxa71Dr9s/SXSm1nqffMqkJc/KUfJ7fnrDBUnzLK7T2CRg/uqTkqmdq?= =?utf-8?q?bz6JlXn1svnlqXYHvI5LYlUUtdqB/vX/q9Fvq080clmn/EtI/BW2YhOvsb+kNcSMQ?= =?utf-8?q?oCxuoZjMi1d3tIDAshiiCaB2ABWr7WPGzYsrRpd/STpI9sc3LcPuc1nX17WBAXE+7?= =?utf-8?q?gSxn8G0Fch4as9VlJ9Zv30ga+tNwAaugETof9JxVX/zOoZOI1BZiMnXB8ySneQV45?= =?utf-8?q?COSyaDCQkc3nEteiHyH2e+yKHOooHlxfW/vTkNWrIYuNNS6y2jSyH3dRw0KKMA37t?= =?utf-8?q?omWHamZW4jhQ/qzqknitqtP6pIXDhcoduKf8X0C2Vl3Kkm78q/4HFo54ONyQnoN+u?= =?utf-8?q?O1G0FD5N92KciDNblc9ItM8pOtjFv2p0Fy6L9WUrXhu3l9Gi4osRtQsXm9KYusgKz?= =?utf-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 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 27 Sep 2023 09:33:34 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778217283326430759 X-GMAIL-MSGID: 1778217283326430759 |
Series |
wfx: implement Remain On Channel
|
|
Commit Message
Jérôme Pouiller
Sept. 27, 2023, 4:32 p.m. UTC
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 <jerome.pouiller@silabs.com>
---
drivers/net/wireless/silabs/wfx/sta.c | 5 +++++
1 file changed, 5 insertions(+)
Comments
Jérôme Pouiller <jerome.pouiller@silabs.com> writes: > 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 <jerome.pouiller@silabs.com> > --- > 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); Isn't the assignment of wvif to NULL unnecessary as in the next line we assign it to again?
Hi Kalle, On Wednesday 4 October 2023 12:20:12 CEST Kalle Valo wrote: > > Jérôme Pouiller <jerome.pouiller@silabs.com> writes: > > > 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 <jerome.pouiller@silabs.com> > > --- > > 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); > > Isn't the assignment of wvif to NULL unnecessary as in the next line we > assign it to again? wvif is also passed as argument to wvif_iterate(). wvif_iterate() uses this parameter to know where the iteration has stopped on previous call. However, the assignation during the declaration of wvif is useless.
Jérôme Pouiller <jerome.pouiller@silabs.com> writes: > Hi Kalle, > > On Wednesday 4 October 2023 12:20:12 CEST Kalle Valo wrote: >> >> Jérôme Pouiller <jerome.pouiller@silabs.com> writes: >> >> > 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 <jerome.pouiller@silabs.com> >> > --- >> > 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); >> >> Isn't the assignment of wvif to NULL unnecessary as in the next line we >> assign it to again? > > wvif is also passed as argument to wvif_iterate(). wvif_iterate() uses this > parameter to know where the iteration has stopped on previous call. Ah, I missed that. > However, the assignation during the declaration of wvif is useless. Indeed, missed that as well.
On Wednesday 4 October 2023 13:30:45 CEST Kalle Valo wrote: > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. > > > Jérôme Pouiller <jerome.pouiller@silabs.com> writes: > > > Hi Kalle, > > > > On Wednesday 4 October 2023 12:20:12 CEST Kalle Valo wrote: > >> > >> Jérôme Pouiller <jerome.pouiller@silabs.com> writes: > >> > >> > 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 <jerome.pouiller@silabs.com> > >> > --- > >> > 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); > >> > >> Isn't the assignment of wvif to NULL unnecessary as in the next line we > >> assign it to again? > > > > wvif is also passed as argument to wvif_iterate(). wvif_iterate() uses this > > parameter to know where the iteration has stopped on previous call. > > Ah, I missed that. > > > However, the assignation during the declaration of wvif is useless. > > Indeed, missed that as well. In fact, this first assignation is used to fill wdev just below. So I am keeping this code as-is.
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); }