From patchwork Wed Jan 15 13:55:24 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: 216634 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D76EEC33CB1 for ; Wed, 15 Jan 2020 13:57:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0506222C3 for ; Wed, 15 Jan 2020 13:57:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="mjn7Hj0e" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729359AbgAON5t (ORCPT ); Wed, 15 Jan 2020 08:57:49 -0500 Received: from mail-eopbgr770047.outbound.protection.outlook.com ([40.107.77.47]:48566 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730039AbgAONzg (ORCPT ); Wed, 15 Jan 2020 08:55:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jd4BL53IB/41n0OkIJFsSLto9tEHdvx16sDti6aYS2x3HRYMPF1XL7l6JVEWtWoSS5KDX9Xr2E/uoQF4xDUSgBP3zgVRQi7OzgfrPTZnjE7m33u/R3+1ZPgBgdZF3R4x9E1OyG0copx7zkrKRjf4toklHtc4R4laJzSq7wK6WZTq4SMn+fLMTejeHwpD3h7xvUVX6xQyxZAxRfnWpm8fQwJDXsu2Sb5GJm11JZmGq/DBKmvvkOmBQEJ8xpMQVit5uM1D0zLAjiGxxlvqYx4BOJ3TBEpeQBqHbRC+gzxqVS199b6wQhbe12i03yUEkstjczR4Dr4oDYKdKsELXgeByg== 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=CZcasPrMA/8ilPvnsOg/0o+UwLhMEXVcTojckwzEtT8=; b=YL9w/lGjCW8wWy/7cRwfzdgCv3N4SrqYtHsqLkwEtI3WC3uP1T+ESwzThXHSUIDAYmdR2kfvtZcI9+Y6k/hKUSHfSWc618I/Iw7YqXPt7Oog8vJVefSp95nGDuUUE7k/+zXPIJU6D+TCx2SKui1zexnygsATcH08E4phnntAWNOzuO/miT7STBXD/71DgjTXb/XRUYicRDN0RASAr9Xb/xQ2NfJIdl38FMFpGCTqOtRWkFu/4o1dCYhVxwdTn+no1e73EwCet8KVvEsIFkcDSzKlt/p6fG/rls+dIVH2BLhm0t3RwnKpfj6t+N0hj5PPWosH5fwJD3Rqfq8fOrMuxg== 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=CZcasPrMA/8ilPvnsOg/0o+UwLhMEXVcTojckwzEtT8=; b=mjn7Hj0eWkUdHhqsEBrt5w1YfNYlsk84wRjsM/lhNwE84CyK38ftbGixssGAtuLj59NcgFZEbtYwqrLjwkQ8JrKJJTPSpjtEKAm6+n5rbMmRVuwS2Fk8Cu46KMFpE3wxGUYF32e1iY2OJFYDhrCKaefnxvpoM8Vge7r2LuBZp4Y= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:31 +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 13:55:31 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) 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 13:55:23 +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?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 56/65] staging: wfx: simplify wfx_suspend_resume_mc() Thread-Topic: [PATCH v2 56/65] staging: wfx: simplify wfx_suspend_resume_mc() Thread-Index: AQHVy6tvqRNbeQHxKEKWIiwJJT8fkw== Date: Wed, 15 Jan 2020 13:55:24 +0000 Message-ID: <20200115135338.14374-57-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) 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: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 509924ea-1e52-43c8-11bc-08d799c2918c x-ms-traffictypediagnostic: MN2PR11MB3661: 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)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; 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: AWOonB8r7otVKsHmuU7tPD8f1U1MwAICJsciSd8o6Xt44TTD+v9Qt40PsaU3PTKWVIsbuQiPwOi7F1+JByRmZDCHb8/luTmW0d9gc/aXj0vm2sxarH+gt6mlXe3L0Si6bAQNt2GpWQhTtGA8A/qxZMTdFqSB3hBfAQ7bgVuBHNwG6rYdHwmL5maCxmqPvtDQ1qUDrNnb+4brcmkcJXWzHUvwrL/lfCo94kIEZGACnIlRrxkMVyffg9CQXkjp0tl4rHHHWpFRuFcO+JdVrWvwBFKx+McD8KrfMvHpVdbEiV835Sj05mXbqq2Gp0xR82Brv4oJWOlD7UwwwhxwsrpcqVLA2WNilSXRWxB9FyCvgotVN8S9ChfU6PCBU6UMFPJifZyP5wiQKzO+t4cvmCuKgGHVkCufhWv9DbcJWh/HqhQLV6HqYa0uZtxrQtyj0x8J Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 509924ea-1e52-43c8-11bc-08d799c2918c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:24.2694 (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: 7cCkiOOc01pzVOvNu5MxPG0f67nSpGJW1ZolngTknhz9YC2k+Qwwq7/qHMPi0HGLc2dUUhEt5OsU9NVnRNmdNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Indeed, it is not necessary to pass whole hif_ind_suspend_resume_tx to wfx_suspend_resume_mc(). In add, the structure hif_ind_suspend_resume_tx come from hardware API. It is not intended to be manipulated in upper layers of the driver. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 7 +------ drivers/staging/wfx/hif_rx.c | 6 +++++- drivers/staging/wfx/sta.c | 10 ++-------- drivers/staging/wfx/sta.h | 3 +-- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 7914c06578aa..8710383f66e5 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -600,13 +600,8 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) tx_info->flags |= IEEE80211_TX_STAT_ACK; } else if (arg->status == HIF_REQUEUE) { /* "REQUEUE" means "implicit suspend" */ - struct hif_ind_suspend_resume_tx suspend = { - .suspend_resume_flags.resume = 0, - .suspend_resume_flags.bc_mc_only = 1, - }; - WARN(!arg->tx_result_flags.requeue, "incoherent status and result_flags"); - wfx_suspend_resume(wvif, &suspend); + wfx_suspend_resume_mc(wvif, STA_NOTIFY_SLEEP); tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; } else { if (wvif->bss_loss_state && diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index f04afc6db9a5..f798cd6973b6 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -230,7 +230,11 @@ static int hif_suspend_resume_indication(struct wfx_dev *wdev, const struct hif_ind_suspend_resume_tx *body = buf; WARN_ON(!wvif); - wfx_suspend_resume(wvif, body); + WARN(!body->suspend_resume_flags.bc_mc_only, "unsupported suspend/resume notification"); + if (body->suspend_resume_flags.resume) + wfx_suspend_resume_mc(wvif, STA_NOTIFY_AWAKE); + else + wfx_suspend_resume_mc(wvif, STA_NOTIFY_SLEEP); return 0; } diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 7c9e93f52993..bdc15554958c 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -985,18 +985,12 @@ int wfx_ampdu_action(struct ieee80211_hw *hw, return -ENOTSUPP; } -void wfx_suspend_resume(struct wfx_vif *wvif, - const struct hif_ind_suspend_resume_tx *arg) +void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) { bool cancel_tmo = false; - 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) + if (notify_cmd == STA_NOTIFY_SLEEP) wvif->mcast_tx = false; else wvif->mcast_tx = wvif->aid0_bit_set && diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index e832405d604e..cf99a8a74a81 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -82,8 +82,7 @@ void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf); // WSM Callbacks -void wfx_suspend_resume(struct wfx_vif *wvif, - const struct hif_ind_suspend_resume_tx *arg); +void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd); // Other Helpers void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad);