From patchwork Wed Jan 15 12:13:22 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: 11333917 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 24765109A for ; Wed, 15 Jan 2020 12:13:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC9BB222C3 for ; Wed, 15 Jan 2020 12:13:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="MTySAJMa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730422AbgAOMNu (ORCPT ); Wed, 15 Jan 2020 07:13:50 -0500 Received: from mail-co1nam11on2064.outbound.protection.outlook.com ([40.107.220.64]:28929 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731675AbgAOMNt (ORCPT ); Wed, 15 Jan 2020 07:13:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bCQEoSnB9R5vVySa1kVyYNiHVlhuxW0BopIMuMIleqyqSgNW8r8CMmNpzywiTXaOgZWDDmfBW+rg80s+a9FYUOTc2sJ8VHGHM75TZLzvM/pcrideEsj5LTzXiIzyg21yIriQZFdf3ChIhN95v48R6ZYycOO4Y59J3gEWFrzTYLsgmczN6Ez/GoJQNCNfmTEdRR198RU3vxohajFEWj1F16DLG6NFPjY8Qk5XEe24sRUkvMvQl+QFCkX7p/j7soBSY1Wdch5KK1SNQCtv+bTtO/JtLDcs0640WMEZioF7dOLRmvHhg4RxeEsrWDTygoyKjGj2Bz5FK6rhq9WSg8+uGw== 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=B+zq5T9uMxfb/CgmD1ygDpRDLGnzrLVhppu2bg4VgJQ=; b=NW+NvbNgpApKXpyBJFhUnOdixbMw3Tc0+9dDQrGFI+Se5Q2fNKUQOKYM6qNtNXODeTWKO1Ei+M0OTHjJvKU+pLWa6AC+SmeVqQdtK3BrbEiivCk3fQCXnHyAGHeSuzTgBZzgYBez7QacpJNFYsvU2i6PY4Rw72X/6hSzbxQVxxOUsop0DJD8vwk+NKd0mJnyzfu3OS0vCmY+ngtcSqg/HDaRktqOZlL7/bTXJ1ToMfxbQ54JVA9u6IahwJO+6KhN+KUfqpyCQKg+8MX0ESwvUQcIO9ODw+Mo3oHJp0xq6flGfdpvjmGOcTBOoe+WukJG7PwvAnz8bz4j/ZIh0Ld4/g== 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=B+zq5T9uMxfb/CgmD1ygDpRDLGnzrLVhppu2bg4VgJQ=; b=MTySAJMaDsVDiqeHg8iQPniY0dv+NgCd5DXdN9q8+rz83iXoH8k77mTGozF19JbrVFKID+sqZUDQxB9i7pBG0YU/B8VxecEP+ySiGX2ZeaBARZxXuNPpYTBtMwg3I5yP6es+mkg3qcAwkYLhhN6wREmaqNVDq+qoqWC1FKlZ5dk= 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:34 +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:34 +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:21 +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 55/65] staging: wfx: firmware never return PS status for stations Thread-Topic: [PATCH 55/65] staging: wfx: firmware never return PS status for stations Thread-Index: AQHVy50uPuhrVCL5JUid2UVR7lkP9g== Date: Wed, 15 Jan 2020 12:13:22 +0000 Message-ID: <20200115121041.10863-56-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: 783d192f-f107-49d3-80e4-08d799b4509c x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; 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: OcX5SeFyt8VMlwMga49ftRfYugosQgEsOnY1Z7CP1cvdEtkNWrqNS/gv3Jc+OISnM8RKLe7fUbNHUeFhe2UYG3TZweT32Gt9ZnehPAwFisvGutQ4z0z2KsHSPQAribfcV+Jyc+Lveum1F1GJrGC3jf+7t66MuaDpJymZmP5zty/e8krmVqB2WkFd1OTXA/PsJrKKFej04EO2x4xlTWymVcnFm6tArh8nwltb6ZfhiRUo64sKEsBh52wVqGngBRyrZjWKGSKfTxU3rT4W/Mzi5ia3+99HgplVmYeLh6S/l2ebPhLQsitbUFBhbxfIcMCXjq9itR6eX8t3eWKe7UADgLlPeVP8MV8QE4ptWJWVZguJjQ4aHsonJnMNjgdYJWUP59UnoX3s/77yhSKqD6+CTuLFfRGSP2OUfNHKzV03BZ/jtMkTMbShizAPCX9usJQG Content-ID: <119AB7DD32FCA94C9AFD7932B6368CD4@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 783d192f-f107-49d3-80e4-08d799b4509c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:22.4110 (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: sbw8C2DfxG5jxnYm91YY/LFbO6XRTxdJhn7ssdWianN0/W+MYww0m7CZ4XvcHR3aphcokYwyrJ84hTwsl9QF1w== 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 At the beginning, firmware could send suspend_resume indication to notify that a station wake up or sleep down. However, mac80211 already handles power save status of stations and this behavior has been removed from the firmware. So now, when suspend_resume indication is received, it is always to notify that a DTIM is about to be sent. So, it is possible to simply wfx_suspend_resume(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 43 ++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index d4c11b07497f..ce83a57397c8 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -985,38 +985,29 @@ int wfx_ampdu_action(struct ieee80211_hw *hw, return -ENOTSUPP; } -static void wfx_dtim_notify(struct wfx_vif *wvif) -{ - spin_lock_bh(&wvif->ps_state_lock); - wvif->sta_asleep_mask = 0; - wfx_bh_request_tx(wvif->wdev); - spin_unlock_bh(&wvif->ps_state_lock); -} - void wfx_suspend_resume(struct wfx_vif *wvif, const struct hif_ind_suspend_resume_tx *arg) { - if (arg->suspend_resume_flags.bc_mc_only) { - bool cancel_tmo = false; + bool cancel_tmo = false; - spin_lock_bh(&wvif->ps_state_lock); - if (!arg->suspend_resume_flags.resume) - wvif->mcast_tx = false; - else - wvif->mcast_tx = wvif->aid0_bit_set && - wvif->mcast_buffered; - if (wvif->mcast_tx) { - cancel_tmo = true; - wfx_bh_request_tx(wvif->wdev); - } - spin_unlock_bh(&wvif->ps_state_lock); - if (cancel_tmo) - del_timer_sync(&wvif->mcast_timeout); - } else if (arg->suspend_resume_flags.resume) { - wfx_dtim_notify(wvif); - } else { + if (!arg->suspend_resume_flags.bc_mc_only) { dev_warn(wvif->wdev->dev, "unsupported suspend/resume notification\n"); + return; } + + spin_lock_bh(&wvif->ps_state_lock); + if (!arg->suspend_resume_flags.resume) + wvif->mcast_tx = false; + else + wvif->mcast_tx = wvif->aid0_bit_set && + wvif->mcast_buffered; + if (wvif->mcast_tx) { + cancel_tmo = true; + wfx_bh_request_tx(wvif->wdev); + } + spin_unlock_bh(&wvif->ps_state_lock); + if (cancel_tmo) + del_timer_sync(&wvif->mcast_timeout); } int wfx_add_chanctx(struct ieee80211_hw *hw,