From patchwork Wed Jan 15 12:13:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 11333957 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B3035139A for ; Wed, 15 Jan 2020 12:16:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86E2F2077B for ; Wed, 15 Jan 2020 12:16:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="d1mjQDjH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731519AbgAOMNi (ORCPT ); Wed, 15 Jan 2020 07:13:38 -0500 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:33252 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731359AbgAOMNf (ORCPT ); Wed, 15 Jan 2020 07:13:35 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f+iZ1MI26p4qjhTv1/zcjmE2mz+aqLiukqIROtqj8B92PRRVM6JW+Mriogr1wh/MV8Lq1Rj2mmeURKfYOxtenLiV+xJPHWcEWFRZoKwdDjzW6o6qTJlffAE8sbyaC01z/CwizA+Pb4XgE7GIXWTyMcIrNiRjC8L5I58yaG3GAggjg/ZBuGxHF59RcLRXvvt3CttE8XuuRQzV2zlMgNDCTkpk/VTT5fIGJrsrrsQ/uQW2eGsi3AiuA0vwsY0W5C2TDXLuXgYLW5srw0IIESCUHPi+q4rN3uYIf/p4FI5NfpXGcyG0w8uRT9/04wAt2vJ0qMHpDr/TXi5rnFdIbExD1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MGqfP+Bn6ViYrv+vCujkkmwbpYVEsmfRDXGsJC6g80s=; b=jhQNvJ+96i44rxygzyKYXtcEPaQYFOuyvQT2+ThDBwZY3a3CO2wy72iFmMjD2SUKSw7Iy1KDFEIwdkICHxe/cPNqGBxyAJzTPa1xbT1f0TnWLhtlAbXiPGzZWkw3mT+Bicl3VrXx/iGWtnbE3NffzNktiWqkI8God1f9OL1w5LylxTHvwFE4IVdQTdxH+e0n4Itfsyc6YyyVbiwH1P3H+Ecpq0YfSMA/ybeL8qQurXWV4ZIJgTueacJ2ZJqsljGseWpSYoOE+BRVFkgau3F1NiW+woFvmJAdXqS23rSXf7ZMvgwr462kIY1FcnbFvqGm2oTAdh9Lp1cyV7C+cnZ7Jw== 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=MGqfP+Bn6ViYrv+vCujkkmwbpYVEsmfRDXGsJC6g80s=; b=d1mjQDjHMYXW7pseOcQ+a7GRwJht/toJs/c6kAVkm5zRJ6JZdD/ICJOAELxIoCgNheDYBxp1IJVhzp2tpsZu3MB2OSPWCHAld7/05RR6cHnIHaBbTZf9XK7mMHfc/OCNwTj/jjI1KJtjs/swR8GITFrQ0LBe8BuMI6LnKUWMOko= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13:26 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:26 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:02 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 41/65] staging: wfx: with multiple vifs, force PS only if channels differs Thread-Topic: [PATCH 41/65] staging: wfx: with multiple vifs, force PS only if channels differs Thread-Index: AQHVy50jNHs/r+2QPUSLTwTNLpC5mA== Date: Wed, 15 Jan 2020 12:13:03 +0000 Message-ID: <20200115121041.10863-42-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8f87840e-eda5-4757-a2be-08d799b44574 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB3934;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DDakmXH9HhhdCt4K6Y0uD57zaegbJdSUnmCu8IgGIjYIqloSyJO1mOrB93LhdIOcZ9U2S50gy3vilq+aQG6oPodlroTCM/k/N/MCkGUqkT0l05bM8JdPHRbaITOnVDbgoSQL2J1dSfC0TgmX2fMc0xUjwxd8LOowqrhUNxJCXmvbjKfNxUg0wfejWnm/kxEmjLpQl0k7hnP4vfj70WsaDxvV5/qQT+I/ph5ERYcgSiG8B748gK6dh0bBgoK4PvqdI/AzWS8ZoYgKv67V/O9sThtg3/zFjRa7zzzlSfkSwVmlAGqT3y2zVr077OcRrgGLVOouzQpH37x5FLeZFLBY8EYF+vE/x26BjRFs+iTH3ycOssJQXYe+rf3PTNlqEuyFMct7DNbgAVMtyB2cQP9Qw7Z/E3JKAbqhJPg8ssc2mDB/r8JXfmndeEEbwXEvlbep Content-ID: <3E7C9B63822EC1499DA40A00A13065EB@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f87840e-eda5-4757-a2be-08d799b44574 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:03.6438 (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: wDx2GrZZ7d3dhVFnhU2xCKciA6P/K8brO5Gtdgi3tpzZqqjBU2BiILCIKNRZRnlmf91MsaZZTYg4maMZCvRYrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller When multiple vif are in use (the only supported configuration is one station and one AP), the driver force power save flag on station. This behavior allows the station to leave the station channel and make its business on AP channel. However, this has a big impact on station performances (especially since only legacy PS is supported). When both vifs use the same channel, it is not necessary to keep this restriction. This greatly improve station performances. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 94683a1440c8..bf285389c303 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -251,6 +251,7 @@ static int wfx_update_pm(struct wfx_vif *wvif) struct ieee80211_conf *conf = &wvif->wdev->hw->conf; bool ps = conf->flags & IEEE80211_CONF_PS; int ps_timeout = conf->dynamic_ps_timeout; + struct ieee80211_channel *chan0 = NULL, *chan1 = NULL; WARN_ON(conf->dynamic_ps_timeout < 0); if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid) @@ -260,10 +261,15 @@ static int wfx_update_pm(struct wfx_vif *wvif) if (wvif->uapsd_mask) ps_timeout = 0; - // Kernel disable PowerSave when multiple vifs are in use. In contrary, - // it is absolutly necessary to enable PowerSave for WF200 - // FIXME: only if channel vif0 != channel vif1 - if (wvif_count(wvif->wdev) > 1) { + // Kernel disable powersave when an AP is in use. In contrary, it is + // absolutely necessary to enable legacy powersave for WF200 if channels + // are differents. + if (wdev_to_wvif(wvif->wdev, 0)) + chan0 = wdev_to_wvif(wvif->wdev, 0)->vif->bss_conf.chandef.chan; + if (wdev_to_wvif(wvif->wdev, 1)) + chan1 = wdev_to_wvif(wvif->wdev, 1)->vif->bss_conf.chandef.chan; + if (chan0 && chan1 && chan0->hw_value != chan1->hw_value && + wvif->vif->type != NL80211_IFTYPE_AP) { ps = true; ps_timeout = 0; }