From patchwork Tue Dec 17 16:14:27 2019 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: 1211550 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="GfXM8Db9"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47ck0p4j21z9sRM for ; Wed, 18 Dec 2019 03:21:30 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728305AbfLQQOd (ORCPT ); Tue, 17 Dec 2019 11:14:33 -0500 Received: from mail-eopbgr770078.outbound.protection.outlook.com ([40.107.77.78]:1089 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728179AbfLQQOc (ORCPT ); Tue, 17 Dec 2019 11:14:32 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QZhUu+G831Gl5KMwiE3x+G/UpOSnHboyHGF16wDcX7J/s+IYeTqEgtLweKOKtgcxnEN5kfyu2DF+8BbwupQzyDT1YAof1M7ZkkQzX0UGmj9dnMule9B02BUP+oUa5dZ6mHpbkhLFRlbc6HZfG/t0lqdI/sRnuEiSFzcQ8icMsZ4x/Ajdq1GzSKm/KwqWEMx+vP8iyAB0jDZ9E/4QyqcsMw4sTdYalhWh3FiFMvKh8OTU7GFK8aloOjnTAxPlQj13DRIHm7IYqCgBWnriyPK0YpnLmoaPv4sJKvlu7j3uUC+xvYCZy13TciVNsLHKAIKFsTb8evxWHcc4IVHc38uVGA== 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=SllwR4vG+YkzqlvlRssm7wQtcW6OikqRtUGCUbcX9As=; b=Rgw6bueztnsMBB0MIltHGU/R1tBBdYVYBrvk3DBYp+SJFKGN1AxUjlgJH26UJZehcfFHeQ1yvHh1fD0GX7fN2mwICU7AJ2721e67WQ36yEYpehdJUj5J6jW0bx7V+f/zQ+Fdxu/Q6+VEeunKp6P0BKqQQRx7EP3smLQM7dPgS8+jXAcSzN/ZUM7X35pFxBo1E8DD1x7d5jgS1DdbgQ6AXGkBdMP2waGMQaQRo1hIENJBiOKu2O3mUzf+RjuDVxosW+oVlTwPg75vrS8IM8gtqsuDAIaEIcEHqk5aKSdG5Iu85rrupUDv45d3sqG48imp+qnhGNJPHvghW4DaEqWDLQ== 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=SllwR4vG+YkzqlvlRssm7wQtcW6OikqRtUGCUbcX9As=; b=GfXM8Db9BOX6/TiG1sQeE5iQn3fCZJAmBWoUO1DpBNOzwQJD8htpejtwsmCqiEjNLpMvfcLFECEbvraoJ85aZuf857WfdzZo18ApEn4RaUmfoAzfSn6ewzl7gFC68nEG73DFCPhuTs8U/JHbLHgvEe4AeWGmjPlq88ZKohp7/WU= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3678.namprd11.prod.outlook.com (20.178.254.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Tue, 17 Dec 2019 16:14:28 +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.2538.019; Tue, 17 Dec 2019 16:14:28 +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 01/55] staging: wfx: fix the cache of rate policies on interface reset Thread-Topic: [PATCH v2 01/55] staging: wfx: fix the cache of rate policies on interface reset Thread-Index: AQHVtPUOtYz/qB8C10GcnNR+XQOQZw== Date: Tue, 17 Dec 2019 16:14:27 +0000 Message-ID: <20191217161318.31402-2-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 76c97594-eb8a-4699-3cb5-08d7830c30c5 x-ms-traffictypediagnostic: MN2PR11MB3678: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39840400004)(366004)(136003)(199004)(189003)(6512007)(66574012)(1076003)(478600001)(86362001)(8936002)(110136005)(316002)(2616005)(26005)(6506007)(5660300002)(36756003)(6486002)(66946007)(66476007)(66556008)(64756008)(66446008)(71200400001)(52116002)(85182001)(81166006)(81156014)(8676002)(54906003)(107886003)(2906002)(4326008)(186003)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3678; 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: BktBOETnIazi5wmIIE9TPJ+0C/4p7xtGqcD4fII041sQ1wdOkflSWPTPwQzPIDf19v6lxuFDl5shtXHsMiJmrkKuaMfIjpYexV9EFdv8c9XBtkPC7+Tiq94RYrgQvxakPOso2T61xIjx+hkjSzHmAH4pvbP5YGqlu3EVVd0kjuL8DDFS1OYl+LGB0h7fQqYoIQZs9X/mlm+YJBvzj6R6tgh6otGBDPCtoiQiW4Tz3C5BFIQEDV9LVlz0Y21qbJC8CBoW0IzJRtRAXDDmGITweStS7vzdSn/fNaP47fIgOHZV063VHRl0yRFYDi3J8SqZk4qL7AdCfk251Kx3mR7bf2ARJ0kry6ep74kczPkp4I3/weWQK+RMgAs1+aP9m7j2UFIRrhL4xrMvyMvAdRgzK37gsjzOMCkQ4rN99LL2Znp4wxN5VGmdbHqgrX84kQLw Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76c97594-eb8a-4699-3cb5-08d7830c30c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:27.8792 (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: orAHwmr4CgWPJ/yebH6MexxxpaqbwyRbe7a7JvgxXt0106oV1E/lPsIxMiGH7aXtEqVx9Zup+xX7IUvVsxUbVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3678 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Device and driver maintain a cache of rate policies (aka. tx_retry_policy in hardware API). When hif_reset() is sent to hardware, device resets its cache of rate policies. In order to keep driver in sync, it is necessary to do the same on driver. Note, when driver tries to use a rate policy that has not been defined on device, data is sent at 1Mbps. So, this patch should fix abnormal throughput observed sometime after a reset of the interface. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 3 +-- drivers/staging/wfx/data_tx.h | 1 + drivers/staging/wfx/sta.c | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index b722e9773232..02f001dab62b 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -249,7 +249,7 @@ static int wfx_tx_policy_upload(struct wfx_vif *wvif) return 0; } -static void wfx_tx_policy_upload_work(struct work_struct *work) +void wfx_tx_policy_upload_work(struct work_struct *work) { struct wfx_vif *wvif = container_of(work, struct wfx_vif, tx_policy_upload_work); @@ -270,7 +270,6 @@ void wfx_tx_policy_init(struct wfx_vif *wvif) spin_lock_init(&cache->lock); INIT_LIST_HEAD(&cache->used); INIT_LIST_HEAD(&cache->free); - INIT_WORK(&wvif->tx_policy_upload_work, wfx_tx_policy_upload_work); for (i = 0; i < HIF_MIB_NUM_TX_RATE_RETRY_POLICIES; ++i) list_add(&cache->cache[i].link, &cache->free); diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index 29faa5640516..a0f9ae69baf5 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -61,6 +61,7 @@ struct wfx_tx_priv { } __packed; void wfx_tx_policy_init(struct wfx_vif *wvif); +void wfx_tx_policy_upload_work(struct work_struct *work); void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 29848a202ab4..471dd15b227f 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -592,6 +592,7 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) wfx_tx_flush(wvif->wdev); hif_keep_alive_period(wvif, 0); hif_reset(wvif, false); + wfx_tx_policy_init(wvif); hif_set_output_power(wvif, wvif->wdev->output_power * 10); wvif->dtim_period = 0; hif_set_macaddr(wvif, wvif->vif->addr); @@ -880,8 +881,10 @@ static int wfx_update_beaconing(struct wfx_vif *wvif) if (wvif->state != WFX_STATE_AP || wvif->beacon_int != conf->beacon_int) { wfx_tx_lock_flush(wvif->wdev); - if (wvif->state != WFX_STATE_PASSIVE) + if (wvif->state != WFX_STATE_PASSIVE) { hif_reset(wvif, false); + wfx_tx_policy_init(wvif); + } wvif->state = WFX_STATE_PASSIVE; wfx_start_ap(wvif); wfx_tx_unlock(wvif->wdev); @@ -1567,6 +1570,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) INIT_WORK(&wvif->set_cts_work, wfx_set_cts_work); INIT_WORK(&wvif->unjoin_work, wfx_unjoin_work); + INIT_WORK(&wvif->tx_policy_upload_work, wfx_tx_policy_upload_work); mutex_unlock(&wdev->conf_mutex); hif_set_macaddr(wvif, vif->addr); From patchwork Tue Dec 17 16:14:29 2019 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: 1211485 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="kdrbXaZo"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjrt0dx6z9sRc for ; Wed, 18 Dec 2019 03:14:38 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728167AbfLQQOg (ORCPT ); Tue, 17 Dec 2019 11:14:36 -0500 Received: from mail-eopbgr770078.outbound.protection.outlook.com ([40.107.77.78]:1089 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726858AbfLQQOd (ORCPT ); Tue, 17 Dec 2019 11:14:33 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PX1F9Mf3WovbK2b5f4UKgPw4FFyYDx/2Xs15uJlspuIkXwN/q9JZ6rGPbXSYSiVsS0oUzaxPlI9fqRDzt7t8t7mf+slsagL4S3mSlnbpAFG+/jC7aZvq8roYz31oJ8I119gZRwSDLMmyF/BnFxLyFj2bNUGIC9CGmtwSMDCpAGnCWULiMFu1RO/pQDXGAWntwi0ZOWA6VSe/8xX+ByFJLXRsij1dazFgQxUIhIxS2fAuxKAbpU3xWdo0DWU6zQwQmcUOr9L8doc+nHRQgtm7zxiZB1B+uHqyhJ94gsVGwsKsGRkyN6OrWpQ1NIZf2FczgvrkKQ/F7MrdI5zsJ/MH2g== 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=6FKLXPwFiAaxz9IjURM8K6izCl2qp7MySkfX7eEdZc4=; b=joyrZuK9AfufqvFl0RNXTcvK/eq5wh1PqL51K5zjaqeFJo6bjcYKXn/MQ1FP8I8A61IOQkYfk8En7MZN4S961oqJ+IySMK9Sd3dWrALi3AFb2sQD4uKsM626IelKiCHMkMLALvddJ0jsDg+VpSaQfjo5PDUaPR9cCCKp4Q+xvdrFHniRfOeumRNDonXBh9Zxv9euvQ98tCsNNy18rjBdOpeStvZm00x4L1l62+I9PAqZGy3gG1B4vKr8jhEud5Ll9nduZl4Eq9jN3vertUchcQp4P6U533ZDOKGdkSKYMZo7l3eQL998j7t9BWbhL+eZpI+rIQF/myLIfx7reh/0Ww== 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=6FKLXPwFiAaxz9IjURM8K6izCl2qp7MySkfX7eEdZc4=; b=kdrbXaZoIlO+kgfywXp6LpFTCZCthhKIT0MRNtGAujpcroU6ogyrIpIN4+sLcPEdth9SzdWEuIw3UGZAwPT9YC3K7V7SK2wTsD9L01xprYU6RuGir/D+Bqqf7UtQuV7FgwbtFyEzPjpmQa0nurO+gM+cgVL/RFOChl2G0WNQq+E= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3678.namprd11.prod.outlook.com (20.178.254.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Tue, 17 Dec 2019 16:14:29 +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.2538.019; Tue, 17 Dec 2019 16:14:29 +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 02/55] staging: wfx: fix case of lack of tx_retry_policies Thread-Topic: [PATCH v2 02/55] staging: wfx: fix case of lack of tx_retry_policies Thread-Index: AQHVtPUPAJFfhQ1HJkic9pTjXp8ciQ== Date: Tue, 17 Dec 2019 16:14:29 +0000 Message-ID: <20191217161318.31402-3-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 402f5594-1a37-4007-8702-08d7830c3187 x-ms-traffictypediagnostic: MN2PR11MB3678: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39840400004)(366004)(136003)(199004)(189003)(6512007)(66574012)(1076003)(478600001)(86362001)(8936002)(110136005)(316002)(2616005)(26005)(6506007)(5660300002)(36756003)(6486002)(66946007)(66476007)(66556008)(64756008)(66446008)(71200400001)(52116002)(85182001)(81166006)(81156014)(8676002)(54906003)(107886003)(2906002)(4326008)(186003)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3678; 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: zHmWdBnQlHDMvYMakg/1VT/GcqVZvCmgxF0Ag33SRmd+QDXWX69jlTLbegvWctaPLxSISVhuzjGvM8wi80/uMaT79lKYjRM5teV/rcHhzXTGKhk6KBzv0mu6jgSYiaql56m4U1VOBVdQhOvfTJKqHPSck0X3hlSzvvbtzOc2Z0qZInWoaO5qsvcTvx3jzlBhTsR57z93xHl7z6UibovnqQ+qCZan2+or2SA9Wwtgyr+BwfGjNKcpfx3EFO6Wf93uDFUT/p1L27wwniTSlIyCPzOc6CUJ8g5scI1HyfNvqJeNTRsDgtOneiEF0DWDeXH9OzvNmOM1I6PnaiOp198EukwFUDp5DDe2p2CeZPwPPP1+WpVUCqzjIGa0hlLJU+fs+O9qsJkyMdjr07e4DihZiOaEjgCWgIkVGxHHknN7t7jDa1lZxs80jlylYODC2LT7 Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 402f5594-1a37-4007-8702-08d7830c3187 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:29.1925 (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: 1e9LAFymy5wKnpAlb8BUcuK5KSh4QdrnRrnobfSNQIeppzH5i7hDw5sT/D04Sl6rrljBm+YLpckoQ0qvooWGpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3678 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller In some rare cases, driver may not have any available tx_retry_policies. In this case, the driver asks to mac80211 to stop sending data. However, it seems that a race is possible and a few frames can be sent to the driver. In this case, driver can't wait for free tx_retry_policies since wfx_tx() must be atomic. So, this patch fix this case by sending these frames with the special policy number 15. The firmware normally use policy 15 to send internal frames (PS-poll, beacons, etc...). So, it is not a so bad fallback. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 02f001dab62b..df3aca03b50b 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -16,7 +16,7 @@ #include "traces.h" #include "hif_tx_mib.h" -#define WFX_INVALID_RATE_ID (0xFF) +#define WFX_INVALID_RATE_ID 15 #define WFX_LINK_ID_NO_ASSOC 15 #define WFX_LINK_ID_GC_TIMEOUT ((unsigned long)(10 * HZ)) @@ -202,6 +202,8 @@ static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx) int usage, locked; struct tx_policy_cache *cache = &wvif->tx_policy_cache; + if (idx == WFX_INVALID_RATE_ID) + return; spin_lock_bh(&cache->lock); locked = list_empty(&cache->free); usage = wfx_tx_policy_release(cache, &cache->cache[idx]); @@ -549,7 +551,8 @@ static u8 wfx_tx_get_rate_id(struct wfx_vif *wvif, rate_id = wfx_tx_policy_get(wvif, tx_info->driver_rates, &tx_policy_renew); - WARN(rate_id == WFX_INVALID_RATE_ID, "unable to get a valid Tx policy"); + if (rate_id == WFX_INVALID_RATE_ID) + dev_warn(wvif->wdev->dev, "unable to get a valid Tx policy"); if (tx_policy_renew) { /* FIXME: It's not so optimal to stop TX queues every now and From patchwork Tue Dec 17 16:14:30 2019 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: 1211548 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="SOFs4whY"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47ck0Y1YY2z9sRM for ; Wed, 18 Dec 2019 03:21:17 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728213AbfLQQOi (ORCPT ); Tue, 17 Dec 2019 11:14:38 -0500 Received: from mail-eopbgr770078.outbound.protection.outlook.com ([40.107.77.78]:1089 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728319AbfLQQOg (ORCPT ); Tue, 17 Dec 2019 11:14:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I1GGw+CrBrRVkgkVRDzRYUWX33Nw+NFXX/j2/o7V8pqYJBPX7JRhHeWsTSy33DP4bOzUrm+/P2l2rg5TUD5e65BmZA6nf3/k/TrTTFPZPfrFgi6kBBgkUd5UXN1/4OlkG8T3ZIEgibtMM+9JmK9kTFCND7BCe82jnGYPO55WMp+Hn198yM5WYEumomYsjWTYyKjChwOwjViPlKG8u7orvjUcgDjUEAsmDgFX43bLkMS6lv0H+x22Dy0Dt6i41ibVf9USwIvxrOrCn5iedN9uKRiGJY4CJyZcogmWTeNvwHnfqnGIdJj/OSWaoTMeT+eknGXNL3xNJKg0Pf5EnV4wcg== 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=+MaZG4rkBwaB6SOqrI578ikfP+9Cx+5JWAci0T8RjR8=; b=IXiutTxmLav36CG+wpmtp8eAw32XIxts9euQntGldtun/fN/SH1t8wEiIvdn7iqly3QihwBbVmxzrjCcqjTe5j+U6jZHqZ++FCsmhUAwtaD4T6kK9Tp9us1zijUkD1Ddgo6htdgTH48zoNvtopYyOPCQ4khU8rRBicLMvWraGgMvKNYguZowPOhJ5P8FQX4+GZ2y5gTHtUboh4BEPJ3LFK6RkacanGxTxUGqxmXcESSCvIlPXDIhk2tql0a0WSsGaW/EoyGjsBl3QeExHInxcILFI4C9YVoylYUJH7fQTpsjbUhwJ8YhYw4nzFaGGzh+Z1bUIxb1DAk4dgI8AEuEpw== 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=+MaZG4rkBwaB6SOqrI578ikfP+9Cx+5JWAci0T8RjR8=; b=SOFs4whYTklH7kSp8b4r4p9q574XnJhoAmMFlkfdBh4DtGKhoUqpeN+x9iR/cWvrCM7q7xhGk54in4FLXRe305oTw2Vtu5smNTxYGjWgkFZpM19QzTI6p8IuV2ePu4eoHxiq53B/L8MFQTnOQUBMrqxB/iYalCRyd/Qnd1kQ2Hc= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3678.namprd11.prod.outlook.com (20.178.254.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Tue, 17 Dec 2019 16:14: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.2538.019; Tue, 17 Dec 2019 16:14:31 +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 03/55] staging: wfx: fix counter overflow Thread-Topic: [PATCH v2 03/55] staging: wfx: fix counter overflow Thread-Index: AQHVtPUPmZkDXln6Ikml0iljrbg3Ow== Date: Tue, 17 Dec 2019 16:14:30 +0000 Message-ID: <20191217161318.31402-4-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bc4656c6-2758-4efa-ccdb-08d7830c324b x-ms-traffictypediagnostic: MN2PR11MB3678: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:510; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39840400004)(366004)(136003)(199004)(189003)(6512007)(66574012)(1076003)(4744005)(478600001)(86362001)(8936002)(110136005)(316002)(2616005)(26005)(6506007)(5660300002)(36756003)(6486002)(66946007)(66476007)(66556008)(64756008)(66446008)(71200400001)(52116002)(85182001)(81166006)(81156014)(8676002)(54906003)(107886003)(2906002)(4326008)(186003)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3678; 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: ONWwIsalOxjNbg2KQmdN9u6fpBv9K4zmZoJf3h+ak2uM5v5DQxFzuEorZQKI0/CoRep3NvJAUB1Eh2/OA74n9i0K2ernrpA43bbYez/T1h8o+09Pg/HxIFpaan7d9RMvwsW9SVKeodQcL0Dkj1G7aU6ZkSI90JC/YW6G1eLCkMCaWyfQVKs1sc5gY1zN56FiYKR+VROGJ5ZO5KQ2gKer9hCri4DyX3fq5SnIB0kMA8a2r7GlYR4+sZYmRAcDCoLsjZWDi9TnPxFH1ppJV8ET29ymCZazcTlxojMoFBHo/fSigLUpzJ6kkI7WrGnqVWq2AdYW+F0/PBhO4K4oHiGmSXbehyjFdWtevftQlWdADskuPxeGjY+Z2TG7t0gzH2opW/R7aa9BQrutqaCYATk5KFsfh4+CFtzkPYSj+lS2S09vM2gswh+YiVNZtVWEsXP0 Content-ID: <819317DD139DC9428B0DA8D01D36A1C7@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc4656c6-2758-4efa-ccdb-08d7830c324b X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:30.5507 (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: J3exoCOmsmnvpDVWhtrqEiWJmvsxoDfwfZ+LPyHoQe3I6LUBwtL5cS7yjWuWSIMQD5DbOic2ymCn287TkNifdg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3678 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Some weird behaviors were observed when connection is really good and packets are small. It appears that sometime, number of packets in queues can exceed 255 and generate an overflow in field usage_count. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index a0f9ae69baf5..f63e5d8cf929 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -39,8 +39,8 @@ struct wfx_link_entry { struct tx_policy { struct list_head link; + int usage_count; u8 rates[12]; - u8 usage_count; u8 uploaded; }; From patchwork Tue Dec 17 16:14:32 2019 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: 1211546 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="KxzG39cx"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47ck0M2ws3z9sNH for ; Wed, 18 Dec 2019 03:21:07 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728413AbfLQQOi (ORCPT ); Tue, 17 Dec 2019 11:14:38 -0500 Received: from mail-eopbgr680046.outbound.protection.outlook.com ([40.107.68.46]:59543 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728120AbfLQQOg (ORCPT ); Tue, 17 Dec 2019 11:14:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qb+5kMfXiwyrcpHmrcoRWyTc1XiTD7EtTql8LiTZBbb91jRz/jPqW8QJVTmXVo4vyhL+yYCkytGUgRz76OMl7ntBAI+TzcanhTC/+Ky3qMx6sVGzQGrvjyKZDj4VtDnE5fiXP9sK1y7UmNoSVwc8aRzE0k+Z759csPUpZRIqq/khr4y5rQ0VN1EHdkIuCOso+AQ56ECuHNq/mHr+HvNXVvUCUC9M3hWb970RLNJ+Iu0k6xCHYOsF5aQho4qUOrreS9JQZewSWsmt2HdTFa1fiTwP3hYw3NT2xTzUzpka29zbjJcblSymfpBxTLGL2Bl+bxeid7NVEhznaCF+t8zjiQ== 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=OSXW7s0ibXv3OklD13Pt6khLryY4SV0hu+5hMqzb6Gg=; b=B1mM5+WSYx3h11zkr5cIXp/58zcq9CaP5kcfH07quwC3Rk34Et6ZKWDwv46ikFoki6Uf4nbmCMQtQN1aDQSNSFFjm5xz59zpKq1gqbZresywmfp9T2OnuIOHkifE5gHQhdDjRoPPX5WPCxpDvfuALJOLwMAXs8QfrADvXEpHdQLXcLWICCbVb/h6L/IptyHTyVPkmd/V9LJvkh7cZ9X0T3TTj0DD9w0suxQCkWJ+1kQzqEREENsYgYD6uac3ev6FvWmekRzozm2t8fN50bx6KlODg1OKDtTRWjOe7EKWE8C5RHmi5lBzmpvkB6oc9OYkLEd1CSnWFQMYxr5WdcpFcQ== 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=OSXW7s0ibXv3OklD13Pt6khLryY4SV0hu+5hMqzb6Gg=; b=KxzG39cxBIat/HZirVDosDzhv4ripJRY9dmAgDqtIF919wxttQbJO1ScaLeG35DxJQsYnXwZLmWgGHvLn7FDigWnzVPiqEYQLdkOCl13bHjWXw0T2DGWZm9xFVE8LlJD/zsHO0HQwdq4qekcgSZii6icoqB7w35MbOdaTXUdw0E= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3791.namprd11.prod.outlook.com (20.178.254.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Tue, 17 Dec 2019 16:14:32 +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.2538.019; Tue, 17 Dec 2019 16:14:32 +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 04/55] staging: wfx: use boolean appropriately Thread-Topic: [PATCH v2 04/55] staging: wfx: use boolean appropriately Thread-Index: AQHVtPUQlBqhb2ClUU2Iv95AxiPnqA== Date: Tue, 17 Dec 2019 16:14:32 +0000 Message-ID: <20191217161318.31402-5-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c655769b-f8c8-425b-a6ec-08d7830c3348 x-ms-traffictypediagnostic: MN2PR11MB3791: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:247; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(189003)(199004)(2906002)(52116002)(107886003)(2616005)(86362001)(478600001)(6486002)(4326008)(64756008)(66556008)(66476007)(81156014)(66946007)(6506007)(1076003)(316002)(66446008)(8936002)(71200400001)(81166006)(5660300002)(36756003)(26005)(186003)(8676002)(85202003)(66574012)(85182001)(110136005)(54906003)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3791; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: hcFn9UbGgy+fBAY1eVXGsaZ0J96i9ODE02gzGm6sXgiOVx6L4NAg0WI+pTB3PJAFV8Vk3eJhlXcSeIGFgCkN/8BhyPQXju2kw96pyhaxITr0ya+M7ycI5h5FTzpiQOvI5KRmIHbQq6DTAmeIViOeNHQmNPXg4ixeWfe66PbSMeBP2OhdLUZ8takhiuMckX0QpPT2ebNKf7NSyAipw/O6FzwOKU7i1AAoGNede3FIXTxJxdUrPlOClmrH1/r9+dr7EVsxDohFkAxHulo/6tjuSF7ItVN7+gzJIecYTfMNAUA/qSP01714CyUEvmurvdR2fI+wxN1ZxI71osTAg4pHkDyNvJPTaCsqjLcJuU7lNuFi8obWwYO1cXbfUi6hRpfbmnLnYUslIceYOet0OZku9j0NlNsNzBNBmLTzRTaoxkgss9PpH+Qn+SD1Q0C5uRWm Content-ID: <3A9773138A343549AC05E7BDCD75999C@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: c655769b-f8c8-425b-a6ec-08d7830c3348 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:32.1209 (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: SdddfohuK4bfEHJwuTNuq9rKOZO4KRPbEgiRpGjNbucfttzCWqSU1sE+oHoytPX8L77jv254PqRhvHcmJm/zag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3791 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The field 'uploaded' is used as a boolean, so call it a boolean. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 4 ++-- drivers/staging/wfx/data_tx.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index df3aca03b50b..b726dd5e59f3 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -184,7 +184,7 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif, */ entry = list_entry(cache->free.prev, struct tx_policy, link); memcpy(entry->rates, wanted.rates, sizeof(entry->rates)); - entry->uploaded = 0; + entry->uploaded = false; entry->usage_count = 0; idx = entry - cache->cache; } @@ -241,7 +241,7 @@ static int wfx_tx_policy_upload(struct wfx_vif *wvif) dst->terminate = 1; dst->count_init = 1; memcpy(&dst->rates, src->rates, sizeof(src->rates)); - src->uploaded = 1; + src->uploaded = true; arg->num_tx_rate_policies++; } } diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index f63e5d8cf929..0fc388db62e0 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -41,7 +41,7 @@ struct tx_policy { struct list_head link; int usage_count; u8 rates[12]; - u8 uploaded; + bool uploaded; }; struct tx_policy_cache { From patchwork Tue Dec 17 16:14:33 2019 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: 1211549 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="KkAT6gxC"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47ck0c5ZKbz9sNH for ; Wed, 18 Dec 2019 03:21:20 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729400AbfLQQVT (ORCPT ); Tue, 17 Dec 2019 11:21:19 -0500 Received: from mail-eopbgr680046.outbound.protection.outlook.com ([40.107.68.46]:59543 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728350AbfLQQOh (ORCPT ); Tue, 17 Dec 2019 11:14:37 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lg2F233jN7e/Nvj7z3Xeih1hNcn02p0hffpv+1+decB792Wap9GhTjwUyeyCh3liwMU3M9UBxf+J6YKU5efsWJzHlXUguYaEHPT5Kb1+KTGJgcjdPSwCb/0+LklwS3JHdeh1NYu+eS6h60JN1j3xV7VzrXPhe7ZQKqFE7YANarXY95O+fUa0jaZweGaZVTPLvVclao5fPSY8J7aSnbXR88GJny+vd+JQ2EdHB+UWXufbVadr4KGf3m78Djl0psTBQApR9elAMg7O4b7F7SCC5Cq+MG9LHc6HTeOnYGv8hI5PNPxaJ1+CNTt5VmZ9bW4iOD7Yfk5AJo44IOlb+HobgQ== 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=EW+GlCwGU1KRrlIvF9xBKI5A21F8qEf1xA0yRpPIjx0=; b=NdNTTak5Ift9Wu+nAeYwQerEQI7hgXE3fSdbZ98V2jSd6zuODUaQzAHNo6e7Yx8AE/OjeJD+pmwEKLaTUQf7cR1rm2Yub2HximzekvzPgbGJ7gxiJyvd7FmJ3eOYnpvUQcXXuiNlIan2CYNba6EfTcveKd5Xh1Ug7AXchnxbvNnQFu6bWJSY3V7NaU1LkiYm/31F7oqX99a0MmQEb8goiY7n9W0TUHUIaxVUiIOe+AITrMO9NQD+koFxAMuUZo8Llf2d+wdd2oaEfeTgVxDVZ8wekkWEuITda8fvckxvgqQxSZNwnPYZSsuho2aAj9jn7o0xgKWERsI1QKzlbZu3lg== 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=EW+GlCwGU1KRrlIvF9xBKI5A21F8qEf1xA0yRpPIjx0=; b=KkAT6gxCoKdPUg/I67aicmcIn9oWvOQCsZbYHbf3CHCriErnwwrwqtHbOOPRNjL5G7ytOZVbtdIl0vhxWcQ4uwaAwhZZwo38nd5u4Im+oN4bLCBFFMjTfq9mvhMO2CmYLUqoA5sdtqyI3rZbSEBYq6tTq9SPjOJJTQVDljGOf20= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3791.namprd11.prod.outlook.com (20.178.254.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Tue, 17 Dec 2019 16:14: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.2538.019; Tue, 17 Dec 2019 16:14:34 +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 05/55] staging: wfx: firmware does not support more than 32 total retries Thread-Topic: [PATCH v2 05/55] staging: wfx: firmware does not support more than 32 total retries Thread-Index: AQHVtPURB57vyPfkUU6483afGqAOTA== Date: Tue, 17 Dec 2019 16:14:33 +0000 Message-ID: <20191217161318.31402-6-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ecce136a-c2dc-4e10-3ad6-08d7830c340d x-ms-traffictypediagnostic: MN2PR11MB3791: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(189003)(199004)(2906002)(52116002)(107886003)(2616005)(86362001)(478600001)(6486002)(4326008)(64756008)(66556008)(66476007)(81156014)(66946007)(6506007)(1076003)(316002)(66446008)(8936002)(71200400001)(81166006)(5660300002)(36756003)(26005)(186003)(8676002)(85202003)(4744005)(66574012)(85182001)(110136005)(54906003)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3791; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: ScudY5cvDHLk30lVWIsq+ARx710hANedTRRlm+/N3+mfcP/QV5vieohs3sWq4sHlnxiaMGZ2G/KjtWbk5IptYoKFHR/yhV9Hm+PoqgBCFOv54g7AVjfMXSmvP/x/CBK0JQ97ZgjZISil7X19DGXMXPUNe3M+V+hikDfaEcM69Olpbp/KWZhfuyHFDMwgRqk5QTLCmvMjPTmLwI8NM7BdxyCVWMO9lCe083GYN/Ev0x4HqG9L3BRQ30Wq422w9XDKIYDUWCV5jnQaJ6RwCG8uvLHbkw6Wp1FWb3VqsqLbVIG+jSwiEUMbjLcJ1SedMzRoYYyPH+KdPMNi5wMCVvQyqR7b74A2HqnBanx32+oxVf35ut4d8O/m2EMvxGV3axFvZYsa1cgWxwRfSHre7LS+v7XD84b9ySXAFdfQJPz9ICmqefXKXKLKUHzTF5VwyqGL Content-ID: <1CF8296E4FBC304E90F47CD27C471D6B@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ecce136a-c2dc-4e10-3ad6-08d7830c340d X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:33.4901 (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: QzIPpPKqduTNn2Fb8Ai0nL0chjiUJhXLdJh+OqtQr8iq4ZFLa6gy7DM3CNBKSDF7wA9FNPNUGkubB6ZoG5RBog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3791 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The sum of all retries for a Tx frame cannot be superior to 32. There are 4 rates at most. So this patch limits number of retries per rate to 8. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 986a2ef678b9..3b47b6c21ea1 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -289,7 +289,7 @@ struct wfx_dev *wfx_init_common(struct device *dev, hw->sta_data_size = sizeof(struct wfx_sta_priv); hw->queues = 4; hw->max_rates = 8; - hw->max_rate_tries = 15; + hw->max_rate_tries = 8; hw->extra_tx_headroom = sizeof(struct hif_sl_msg_hdr) + sizeof(struct hif_msg) + sizeof(struct hif_req_tx) From patchwork Tue Dec 17 16:14:34 2019 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: 1211547 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="H3d0rZNl"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47ck0S2d0Bz9sRM for ; Wed, 18 Dec 2019 03:21:12 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729380AbfLQQVI (ORCPT ); Tue, 17 Dec 2019 11:21:08 -0500 Received: from mail-eopbgr680046.outbound.protection.outlook.com ([40.107.68.46]:59543 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726858AbfLQQOj (ORCPT ); Tue, 17 Dec 2019 11:14:39 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KmKOJCVzBShRQBz0yNZ2e16t+0Qn6jvOuQMYj0mY8WhlnRJJoqrX2Hvb+TSIQsCuj243n8/GqTZBXXJiSHuPr81k/q8XWTfczakSs4nGFeggzR9Ktja0vYRymZFGxQ+ObBjMR+DXqMETotK1Y0ymGa6UG3XFrqyJOvXlO01itu5GM2zJFo5kz3g1AM/IQZIScc/+XHcQ8DdSg3MInlTDjeIcTXguzNxZAWJkMeh646z7YqU4evc6/LEvwzesLMoIAx2pnI42OffJ/At4V3hQqqWilFfy1tZsAD2E8wNGlJLzPx6Z0B7byxSNtLiDiPTCLEB2Fedn76aoUMICkxp+NA== 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=FRLMZCQ+5rhWTrLjUj6s2NJKPZPRMfxJgueobw2UHVc=; b=iiAxNS13NxPKeyny6jwZ+jK7Ga41BQFY6XihGYFbYKOrFKMsfDOZDadV91m6bSUNHObqyEM8uoh1xlKqDoa2UEzpFXngDlgIKy/za4PkSrInnCHG8MW2KqExtpTSfjzqZC8cQoai1+gDeedw4xdpEEsWmHOBNbkWvtlztf99aplAjAhsuErB33TIXy3zsqsUc3NfjhBjnUwRI/DtgH/VApWzbTs0rPZiey0Od9ONJZ5s42x72GJ/UWn9S80hj2ujyuTTyzTgQsVLvG8IgdHDHE92A4TAI6hblyCWT5aAINy40vkcQ9ZAN93wI/sJmWM4MtQlHeCVRKq3qvQWZYYOaA== 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=FRLMZCQ+5rhWTrLjUj6s2NJKPZPRMfxJgueobw2UHVc=; b=H3d0rZNlTV5dQ7BhbPgIsoShWxI/fxcP+b7Q90tHDRHJhjRY043r/IhQgGHlpMhcMSCeKUUbfxv59H99omRaOTACak2PrhTLAy75+DaUzJNZ2JplUSXNWBYE1Pdzzl3jGmgVzuxQ13YNM8OmKTbFM7B/WH3LB43mYyNV6AtK8lc= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3791.namprd11.prod.outlook.com (20.178.254.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Tue, 17 Dec 2019 16:14: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.2538.019; Tue, 17 Dec 2019 16:14:34 +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 06/55] staging: wfx: fix rate control handling Thread-Topic: [PATCH v2 06/55] staging: wfx: fix rate control handling Thread-Index: AQHVtPUSV3snjZp3tk+yJwmm+q7V1g== Date: Tue, 17 Dec 2019 16:14:34 +0000 Message-ID: <20191217161318.31402-7-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 12085b06-c95a-4b02-af7f-08d7830c34df x-ms-traffictypediagnostic: MN2PR11MB3791: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(189003)(199004)(2906002)(52116002)(107886003)(2616005)(86362001)(478600001)(6486002)(4326008)(64756008)(66556008)(66476007)(81156014)(66946007)(6506007)(1076003)(316002)(66446008)(8936002)(71200400001)(81166006)(5660300002)(36756003)(26005)(186003)(8676002)(85202003)(85182001)(110136005)(54906003)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3791; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: QHiAspH8YJXEBnUWd0EaXPuVQPerGCKcdrEUP6Av1R76PzsWw08w27qp9nf/cR8xm04zbEAlGGY3IEUAkR40MqavZRzpi4kqrjGR2sR6JHN1flF37MnK1dPGVN2s5/eSOqi9RA4/RxnqVuPLgxCGwVONTZQ5xY/OBwZAr0qSHny8547YHuVwrVcHTExRP6pMga/lrPQvB6ktON0+IEd7SdO0jdiT/v2zNaf5sEFsKQidZUVn6nOVm2uVEF9FhW4fnpATfVhMKK0VjHZ22plmee9WTdcISisZivmgJK5Ey+8lwkmVUPddtCA78me7xi8dH+asla/d0JEEGtfx+B8k5Ky7O1Du0Jyvkg3WFatQt78kPOFCrAx1bpt0TsRnQeSPQ/q2l8KoS2rf8QQE2HVEjSegy/aJ+yJCqad16lmKIfPTxVEkuHIeffkAQDRVNEPH Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 12085b06-c95a-4b02-af7f-08d7830c34df X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:34.8324 (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: qjPpXTFV4XXqMjbKDX8FnlzYBbWDi/zzfkBeoqb1pEbFECFVU1sxdcoxJBNHJnNOpa3tJlqYvVpyYacOdiE8Og== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3791 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller A tx_retry_policy (the equivalent of a list of ieee80211_tx_rate in hardware API) is not able to include a rate multiple time. So currently, the driver merges the identical rates from the policy provided by minstrel (and it try to do the best choice it can in the associated flags) before to sent it to firmware. Until now, when rates are merged, field "count" is set to max(count1, count2). But, it means that the sum of retries for all rates could be far less than initial number of retries. So, this patch changes the value of field "count" to count1 + count2. Thus, sum of all retries for all rates stay the same. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index b726dd5e59f3..46ad83b95f52 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -524,9 +524,9 @@ static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates) for (i = 0; i < IEEE80211_TX_MAX_RATES - 1; i++) { if (rates[i + 1].idx == rates[i].idx && rates[i].idx != -1) { - rates[i].count = - max_t(int, rates[i].count, - rates[i + 1].count); + rates[i].count += rates[i + 1].count; + if (rates[i].count > 15) + rates[i].count = 15; rates[i + 1].idx = -1; rates[i + 1].count = 0; From patchwork Tue Dec 17 16:14:36 2019 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: 1211486 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="h+3IXTKK"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjs26mGQz9sSF for ; Wed, 18 Dec 2019 03:14:46 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728462AbfLQQOo (ORCPT ); Tue, 17 Dec 2019 11:14:44 -0500 Received: from mail-eopbgr680046.outbound.protection.outlook.com ([40.107.68.46]:59543 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728419AbfLQQOk (ORCPT ); Tue, 17 Dec 2019 11:14:40 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dPZXVAmDtp4MUAgnt+hI7+Y55sx29UDw3sE8FE45HJ5sHA0QCafp4eF1kDJwTsw1UPqjwoInWXJgeALfnr8IdeLjvPKIV8Tpf28PekE7xpkzx3/6WLeAAIm05K6NCj9TAGDCtCQol4AEc0q3WThg9ycKZdTY/TRydYufElwwQEbSBbo7HUSW0e56wM+v3iOSovEInF/rCTckV6vGgT+fR/75WmYGAKn/27n3kqjF9jcz6K6w2mya2zT8ybUudzoxF4rnsQfmG1yprHRnpuWEqJTRrJ0eXShsaqd7BdCEakSP3Hms2cXRW0gicRlIxLgoo+jEovTXjwenOjMHsZNX3g== 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=iAWqkFdigmw4vHi00yhGVa3Yk42MHGcrKV2JTpUIO70=; b=dn6DWWCjPvTJ1qO04N5WNAonV5tp4vXzLmdefy0BAStrQxiK4662NzmcSSETKpdNuIhfrWURkZGBAI0INVvGEw8hZc1A84LajJ93+5/nVZM+uouuW2nNG7N26b7n73h4MiPP+YR8j+Z3Am/CjA2EgXeK8H1Ny+yKpFyVQ1lQDxIA1xO92VYi56g4Ir9bgB4JjdSH0Tdawxi3y8uHUObjBXqqmD40QLIMuMAxiGTz75jBbsa+TNO9aVHrqRnEXF1qyLKlHoS+ItAOCm/NXQlygGvLHiSOfVuZ+z1s8wfNFSLkMXvAyhBsmJVzvDoA3gPwhZWpynGPrn77giS6e2JcjA== 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=iAWqkFdigmw4vHi00yhGVa3Yk42MHGcrKV2JTpUIO70=; b=h+3IXTKK4QvkTCDry+qkYqil0uUq6vvT4vMDYYlsUK/yrAwzR6ezqwdyxzKgtjRe9eSeLmXE3SWGfmtAHAHAZvJZXBiOCQtsSxWLwR/4Wj1lg9XYC8kbESgy9Fp3/TvMe5uci6ZgkCczcHlPj+OsH8MVqTnd08bOhN5xE/4KEts= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3791.namprd11.prod.outlook.com (20.178.254.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Tue, 17 Dec 2019 16:14:36 +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.2538.019; Tue, 17 Dec 2019 16:14:36 +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 07/55] staging: wfx: ensure that retry policy always fallbacks to MCS0 / 1Mbps Thread-Topic: [PATCH v2 07/55] staging: wfx: ensure that retry policy always fallbacks to MCS0 / 1Mbps Thread-Index: AQHVtPUT+yUvhYCIm0KyGJu97eaKNA== Date: Tue, 17 Dec 2019 16:14:36 +0000 Message-ID: <20191217161318.31402-8-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bc678263-495c-4532-b880-08d7830c35a4 x-ms-traffictypediagnostic: MN2PR11MB3791: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(189003)(199004)(2906002)(52116002)(107886003)(2616005)(86362001)(478600001)(6486002)(4326008)(64756008)(66556008)(66476007)(81156014)(66946007)(6506007)(1076003)(316002)(66446008)(8936002)(71200400001)(81166006)(5660300002)(36756003)(26005)(186003)(8676002)(85202003)(85182001)(110136005)(54906003)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3791; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: leZLjiVrzJfidGWQITFSyNjWBRCkCBfIiITNV2890hNPHJKwqxBpfUqNdTau0q7wIkN8Qhf1sY5+I4pztaz1OorVffkmULM9mpkGbIcDyd4dxD6d+vtIMIbJCZr8ZTRdnvQ0sU7tuwmpuZi5imaKOGbQCT378vZetxu6u+RNY+Ef7o3GqdXhY9xgEXQJp6Ok6iPnMu/ds1Er9BAcjnouI6aCMJ8Uo388iaeM17woHblu3J1dkfgI2H0vf13cd5HEwug4w1tvlmfpKoeZY3TLzo1pBbxRBsBLQWR+7pTcRx1oKvWRzZE/ackJnyhD/J8NsACRLXbuxwiGSvSJ6wZacwh3dLwJu6QOrfhtaW43+Rln7FiVCWkGarZgs7FI7Pgh2SZyKJlLcfimv9ybbB7o7I2WfsajS6spHLSpnrKZqU3qejy8UbK3Vt3JD/MvqufZ Content-ID: <9D60EB79FDE4ED4DA3DE161AAD87AE13@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc678263-495c-4532-b880-08d7830c35a4 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:36.0547 (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: +6LO3KIpEs+uh+fi0grOjai9/n4fzk3hqgymL5TLWYY0smfn+nWoO4ExYbXaFCMIuEQ1/MeZnWrfuyZAaMXjuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3791 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller When not using HT mode, minstrel always includes 1Mbps as fallback rate. But, when using HT mode, this fallback is not included. Yet, it seems that it could save some frames. So, this patch add it unconditionally. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 46ad83b95f52..738a6ca5edad 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -538,6 +538,17 @@ static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates) } } } while (!finished); + // Ensure that MCS0 or 1Mbps is present at the end of the retry list + for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { + if (rates[i].idx == 0) + break; + if (rates[i].idx == -1) { + rates[i].idx = 0; + rates[i].count = 8; // == hw->max_rate_tries + rates[i].flags = rates[i - 1].flags & IEEE80211_TX_RC_MCS; + break; + } + } // All retries use long GI for (i = 1; i < IEEE80211_TX_MAX_RATES; i++) rates[i].flags &= ~IEEE80211_TX_RC_SHORT_GI; From patchwork Tue Dec 17 16:14:37 2019 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: 1211545 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="h6JFMIws"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47ck0J5CQmz9sRM for ; Wed, 18 Dec 2019 03:21:04 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729486AbfLQQVA (ORCPT ); Tue, 17 Dec 2019 11:21:00 -0500 Received: from mail-eopbgr770059.outbound.protection.outlook.com ([40.107.77.59]:32421 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728387AbfLQQOj (ORCPT ); Tue, 17 Dec 2019 11:14:39 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R0xtDj1/ouMCxEWPsZLiGKaitYjL0uGVfGilhnP9yq1XBVE3oX9iZgsK41i4gLwYsodu8HIxtjpKUJishQvZhbkP0Zb9VuWsGInsswdL3pjgO4mQx5/yWTov/ZWCrenZVZUPB0bpArXbf8zV7EP2MGi0NQqSe8w9W2PR5442hbK4CEN/hOBY7OQv8y8B5Pu9UoYDzcO0bQw2RvW2CruqpqDvKRldDOYVWVrRucLVGcvLjGfP8HZJ4mG9xU1vDSlEPYMWrw9jHRL5sE3ochzTZqMXS0XHhAvlARDhgAHK5yAljvZuvTBDKyoZjiP8ZAvx7OFJ55fo/sMMvVGr+zrpXA== 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=UXO891/8R6v+gO7K16xmZhP1Ik0gLvhGwJ1VwG/esPs=; b=IYCi8a5oRog1hb4/0Qxorz2OQ+0xJhDjYHV182bn+juVPyqJyy6a3IzbC24T6/tMbprUURMUKxIoXwxUvBS5Z0Iostm4nOwKmI6ZLZKDyHcSoxG8xRgZYd3cOKcbCGB9n8nDurVAVIsJCHYZm3Dqe+L2rYTeHQ0+puxtEVXKm3TJ5YJVj2Prk0nv78lxEgV2hfcQ5yWfeALS6Gw6QXkWlDoeUnMvRWJM2x7JIclMOeCVe26VJdUdr0/adWOz2uQNa5cyf4q6IK7LOoPcuRCvZm83WbSf15T6NXmTJhkuxMqRXiBpV9SiNLMO1Se/mvr1NscWRmw1tntf9PcBOi5dOA== 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=UXO891/8R6v+gO7K16xmZhP1Ik0gLvhGwJ1VwG/esPs=; b=h6JFMIwsMOSC5w/m+nGn6o7HGVy1aBSIbWJMqI+KkgMepSSCLvdLFF5Ox2w2bS0r9ch1JQ7y+LUdyYpdP01rOYnRGZnkW9rLPTuWwo6jhcQgVhrX6pVxF2TMG1nUDXuNtgryYGXZWH2rlv1cr6T+LOIuSo2TD707I6nQSSxgpvU= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3678.namprd11.prod.outlook.com (20.178.254.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Tue, 17 Dec 2019 16:14:37 +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.2538.019; Tue, 17 Dec 2019 16:14:37 +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 08/55] staging: wfx: detect race condition in WEP authentication Thread-Topic: [PATCH v2 08/55] staging: wfx: detect race condition in WEP authentication Thread-Index: AQHVtPUUqkxVBx5Uz0+0nJd0TGy/gg== Date: Tue, 17 Dec 2019 16:14:37 +0000 Message-ID: <20191217161318.31402-9-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: be061756-d915-4535-bda4-08d7830c3662 x-ms-traffictypediagnostic: MN2PR11MB3678: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2201; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39840400004)(366004)(136003)(199004)(189003)(6512007)(66574012)(1076003)(4744005)(478600001)(86362001)(8936002)(110136005)(316002)(2616005)(26005)(6506007)(5660300002)(36756003)(6486002)(66946007)(66476007)(66556008)(64756008)(66446008)(71200400001)(52116002)(85182001)(81166006)(81156014)(8676002)(54906003)(107886003)(2906002)(4326008)(186003)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3678; 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: 5J99McFCkM/3lJGPAE31UgSTwvUXZZHQ4JJ6osOtGPZkHR+ufJJIAKvW6NVcZKkKpv+V0RkFCdehFPdTiQc9f283Q+EJq38c6SYM25gzXNCkfHMnKzKfxd/oZk9BpmkRK1jlXWzd8ZYwIaK/Bgrg4f9YRkWLKWkuAA/RFcBhIOw7hr+AhvbL2dKVmkTp841yofM8yKR2MVBU4CwyXeyKRGag0AB0L0u51yOet/cUO9K6bS4is9qY0bpSCs6E6zddl+u+MvCGQVP0adHMBCDzCTUrJ9LCeRLR8Oz+UK8umYnc2XsYYHjxbBCK/Ky3Plx+CN8GGFUuCa902q3WW/b+g+22SnSKFxS1fH/qY9CtMrMVAFmbfCOW2gVL4zb3SUfhKqwhInVNWFQpsOn6nowGdDyQRFythALo62rgQndU79IVq8NYQ2Ooe149jpArtS4Q Content-ID: <693C21275C1F0D4C888A47C0E60BF702@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: be061756-d915-4535-bda4-08d7830c3662 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:37.4150 (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: K/bSdzY8krrCHYrzgW1nJKRDiypUZPEs9DSNjvie5muyT9+4ZyD164t4+p7B+kgv9x5vIWKY5umKKgcAUcXkyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3678 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Current code has a special case to handle association with WEP. Before to rework the tx data handling, let's try to detect any possible misuse of this code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index c7ee90888f69..680fed31cefb 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -422,6 +422,7 @@ static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, break; case do_wep: wfx_tx_lock(wvif->wdev); + WARN_ON(wvif->wep_pending_skb); wvif->wep_default_key_id = tx_priv->hw_key->keyidx; wvif->wep_pending_skb = skb; if (!schedule_work(&wvif->wep_key_work)) From patchwork Tue Dec 17 16:14:38 2019 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: 1211528 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="iJxVszA1"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjzF42ndz9sRM for ; Wed, 18 Dec 2019 03:20:09 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728611AbfLQQO5 (ORCPT ); Tue, 17 Dec 2019 11:14:57 -0500 Received: from mail-eopbgr680046.outbound.protection.outlook.com ([40.107.68.46]:59543 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728433AbfLQQOz (ORCPT ); Tue, 17 Dec 2019 11:14:55 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C3oqunfIclm+xARzAlyeSAsN1pAYQedsK9UmDfZ9OYl/4rKWn5ESpbRMGqfev1g04HRSzMpQ5P2OPC2CHowt9q9A7xjej/u32w5e5soLsT+OGEJgTvw76mHUajJ3FOMGZ82VqpPLZmGvVYe/NwYDL365/SdzDURNxVaui/1UawgB317eIzbYB9HPtSmuxVvu2xJCkZDB7zdYqAXWUjnl7XANRLk0IWIWYhPPo3scrbRbKSPAGJwpvJYsIll5D52XyjFGGdmPQVEXXzzzVciI4kbh/oWTkRXrVNpuL7tbPCvQXPDycWPGMK/Cfm7kCVIcBgjkvhK5a20IpRjy0YTFHA== 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=gIKJQXDnYidfodu1jSnFXBCBXQv95KLU5XA6Fdku/Ig=; b=blU5NoCVFbyaj18RKFZU4C9/iD07BHP07rGIPsuAdiskUXy9aZxGETGYMUm9BJ5w1YsQRMuf9Q7vwakU3D+HmkttpL3s+NgFRH1kYlW016qFCDMLWSXPDb6odmZ6NajFQ0jffz8w0RhReqJb8Oa4T4Butg7KH7QgFSL5/6OxV1ye2xvcv2UX3M5U67nM0UoG1IYxzpPXLzCPcyNflisEJKlan4/L23bv/Azs8RrqhkfRBgyxJG6NUzo2mW8Tt1J24JelvbW1+gykKb2zMbGNCLjGjnfFv/ae9GURbklSO/WJrLpR1lr30pW8RFMAGUyUHGc/q66NWhF7L7G/J6Copg== 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=gIKJQXDnYidfodu1jSnFXBCBXQv95KLU5XA6Fdku/Ig=; b=iJxVszA1bpF/2+xw7CGs3Teus3UW9kWq+CDu0qys1ri7Y2E7SWxKAPttXTBnn5j3GrISsOePO2MQXa5i0eY95RD5hctIYVx7wLgqhjWOV8gSlb9e6kpGRd9AsvPlq7WUc2X87/IEpPTbOh36P4t9/mNJnX0P3nxp4OzYcBhc0Qc= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3791.namprd11.prod.outlook.com (20.178.254.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Tue, 17 Dec 2019 16:14:38 +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.2538.019; Tue, 17 Dec 2019 16:14:38 +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 09/55] staging: wfx: fix hif_set_mfp() with big endian hosts Thread-Topic: [PATCH v2 09/55] staging: wfx: fix hif_set_mfp() with big endian hosts Thread-Index: AQHVtPUUz7pPz6o2e0y45HuThzLe6Q== Date: Tue, 17 Dec 2019 16:14:38 +0000 Message-ID: <20191217161318.31402-10-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 647b740f-1c45-483a-c9f0-08d7830c3737 x-ms-traffictypediagnostic: MN2PR11MB3791: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:549; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(189003)(199004)(2906002)(52116002)(107886003)(2616005)(86362001)(478600001)(6486002)(4326008)(64756008)(66556008)(66476007)(81156014)(66946007)(6506007)(1076003)(316002)(66446008)(8936002)(71200400001)(81166006)(5660300002)(36756003)(26005)(186003)(8676002)(85202003)(4744005)(66574012)(85182001)(110136005)(54906003)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3791; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: i5/qYms6Kq37qmKP2O2XL9EjzHMDvVsSTPG15nUJeEqbot/FmTssbfUTpvV0rusb07/CmccQ2HCnwu8GxafX15IhD/axMKjPsUjF2aTFUQfUMduaV9B2XVYB9h0mhyol6U0ez87qGEXCCAFx7OMpuMC1B3zflOayYoMVohC1KoMDRYGMhl9UheOwkMFRxL7GJ9NeUUhn3deWlbxmYps4EkZAlcyE38OGqEvOGwJ9OWnHECjKSSGCXO37cAPfZ0oNEghWi7UCLqqsRZjnG0SIAmC9cMHN2fEC7o4f7R05hAqyr9AaHwQun76PLpZLtHhKjJUHxJJ1bQzMxpEX11dhjcGBIQs3qkyzOXwD0ETlSRJ/skUH4evC/zqYSyE6u/7qPW8yeHVfH5pwYRau15nCMhMUjD3E1u6IPx7KFDbLsTNYsaHh0wzsVF32EVhsF1Ls Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 647b740f-1c45-483a-c9f0-08d7830c3737 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:38.8042 (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: 9GSrn2mC8R1+LJVzoFaVrVhzgv3+rE7kcI3yhEoqO+EBwNxKixqAlclji4kdBEvEn+esCO9JFOTDhxCg/VYSyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3791 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller struct hif_mib_protected_mgmt_policy is an array of u8. There is no reason to swap its bytes. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index bb091e395ff5..9be74881c56c 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -147,7 +147,6 @@ static inline int hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required) } if (!required) val.unpmf_allowed = 1; - cpu_to_le32s((u32 *) &val); return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_PROTECTED_MGMT_POLICY, &val, sizeof(val)); From patchwork Tue Dec 17 16:14:40 2019 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: 1211529 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="M0TTB5GF"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjzP393jz9sRM for ; Wed, 18 Dec 2019 03:20:17 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729305AbfLQQUN (ORCPT ); Tue, 17 Dec 2019 11:20:13 -0500 Received: from mail-eopbgr680046.outbound.protection.outlook.com ([40.107.68.46]:59543 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728562AbfLQQO5 (ORCPT ); Tue, 17 Dec 2019 11:14:57 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LWB9QzKMG/zSrCUV7QyrSEBmcOqM6sgoIyO5pOXOPMUQmi/RM75HCe277ytuiICk+9iXuI4kz38gDXg8L6gPPTCh3r4cJmRj+Dr6hx1lULJjV51S2WWm3OJDMrCHByvgeC2DCLXb19YX7chdU+i2H/WymSnOrAxOoXKmGeFo7CNafXi4tYzpF9gb7BNg0d+WvwO2Nr1s2wt+FFfgYsJupjZtON72n9D6whtd+gcLPVV7OE/qcIlTgomEQJa3+8WkfDs7Vtullmb8st47dQd2cWl3gcWUGuSQWeHtbYxXLIyLbVI57ERNLzXo7Y9GKmVzg8FGes46jbpcTkhKdZK6eA== 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=AcvybTTVTamf+RrwBqacwKQHYq24pZRweh1D95BxTnI=; b=CuiH1QG3FJC1hAwQHV6WQJrtJyX568lcwkkKW/W6I6ROWu88yaEwKieBQFzc9QyH5gZsmgstjv9O4rLaxleUNOpdx1/Jda09Q3E8MkczO1k7o5/vuJ1V3ZnfHLa9r/i/pfhU3nBjYVTXtwQM9KI26tkFCl4Q6tSp3wsGfCdHArP5+VVn8AxtSxExj3/z6G3nkPWbe5pw4VecSreeSaSJl/8bX3YlhS7AhZ18wzNoeod8A1NH5mLmVDALrH/OGCscvtoUGAV/+ScfKmIdNZ19oBflEb3QL9BDZOsbQ9+NYBpKLw87NWEft0yzY64lzaiyggKJPweJdzGu5vItDDe/kg== 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=AcvybTTVTamf+RrwBqacwKQHYq24pZRweh1D95BxTnI=; b=M0TTB5GFMxGo3HeUzhE/qCs1XSMVBnNr8vvBi2gfGOXDnaELoZp6IYTlUflyuYEuT9/VHb58g2gZNTjbSOa0uWaYy/qRrEnAEuD11X7x0j2wdIGjjl9x31JZbJtsX/NdEaqw2jttmOweFZQhgIA4Q5vYckqZFJTa6EeEM9ivtKo= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3791.namprd11.prod.outlook.com (20.178.254.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Tue, 17 Dec 2019 16:14:40 +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.2538.019; Tue, 17 Dec 2019 16:14:40 +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 10/55] staging: wfx: fix wrong error message Thread-Topic: [PATCH v2 10/55] staging: wfx: fix wrong error message Thread-Index: AQHVtPUVrSiFmMNkWEC934NjM6UjPg== Date: Tue, 17 Dec 2019 16:14:40 +0000 Message-ID: <20191217161318.31402-11-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 855e5d70-dae4-4309-139d-08d7830c3803 x-ms-traffictypediagnostic: MN2PR11MB3791: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1332; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(189003)(199004)(2906002)(52116002)(107886003)(2616005)(86362001)(478600001)(6486002)(4326008)(64756008)(66556008)(66476007)(81156014)(66946007)(6506007)(1076003)(316002)(66446008)(8936002)(71200400001)(81166006)(5660300002)(36756003)(26005)(186003)(8676002)(85202003)(4744005)(66574012)(85182001)(110136005)(54906003)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3791; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: 4BP7tOTjFvLKsUa+7LIi49gJYzWELZz3io50aek02iIp8sGJvtFRb0SrKpzGdeA/mE8rKN0Wc49R3PVH+/fCtakOllOSpuu+UlypBcJ9iwRT2V/97+oNEdhyNmY2XrwMH0YQgMYk8qYYXzpl7QLLIz7f+eiaFFJQE6aRKt8wT+tGMGIlrRZUgkj3ZzPo+gjx2Dh+mqO60lGLzkR+me4q2OMFnvjuqvfnnDZ98wHmYaVZ+wxuS160MbIrItt/yn8TtRu0PcouLanwXFD8s7h+L/WDe7+HIKvgkUsYZnnLRilMGV6Q9lvMwwOnTPf56lHlyAMtwY8ydO4bi3Mm2OZz35z7FhdY4ip9a6AUZj3O2ZlSH1rTWiwMgaSeYHi684JmKMrJmw9bref+dhtD7QYi252wtZbvCWvWTsea2Fe74RsHlIIUwbb4Yd4CjNQmU1rU Content-ID: <8E6896790DE8A14084D0645F1203DF86@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 855e5d70-dae4-4309-139d-08d7830c3803 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:40.0405 (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: n6h8fKh6NyE4CIAlE/xI8hqpgx/GW7r4OCsD8lxet8lWTy9QC8tb2G1wA/19XhIo/W4JLuJOEhwcP/Fwa0EPCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3791 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The driver checks that the number of retries made by the device is coherent with the rate policy. However, this check make sense only if the device has returned RETRY_EXCEEDED. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 738a6ca5edad..32e269becd75 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -748,7 +748,9 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, struct hif_cnf_tx *arg) rate = &tx_info->status.rates[i]; if (rate->idx < 0) break; - if (tx_count < rate->count && arg->status && arg->ack_failures) + if (tx_count < rate->count && + arg->status == HIF_STATUS_RETRY_EXCEEDED && + arg->ack_failures) dev_dbg(wvif->wdev->dev, "all retries were not consumed: %d != %d\n", rate->count, tx_count); if (tx_count <= rate->count && tx_count && From patchwork Tue Dec 17 16:14:41 2019 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: 1211488 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="hxAM4kRx"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjsQ0XTsz9sSR for ; Wed, 18 Dec 2019 03:15:06 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728712AbfLQQPB (ORCPT ); Tue, 17 Dec 2019 11:15:01 -0500 Received: from mail-eopbgr680046.outbound.protection.outlook.com ([40.107.68.46]:59543 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728670AbfLQQO6 (ORCPT ); Tue, 17 Dec 2019 11:14:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RGA83A61ch+Vrpg7Yw0guCekonQgY8LCFUYB+R8CkRKunMaeEo83+QnoEJxRTuft+46rWJZ5gv7IXNuzi0iLMZhklUd4PyQa5GTWaeeLTnkZwUtnsMCj1LRQUiEsft927p1lXcp9HGMUZ8DEGWf2CqtpJr50mEOWJktVoJB7X7VEoDUpUtzL4xjqfAem9VvJLcygSkYxtleMDKHkIcMfn3LlY/AKAMQVbQLb4tEPUi0hHY/1gS+t+/HuzDWSdf+JQU/0yvlJEhWUAlr+K7QOaZYT6Rfs0UWYewk8/rbBvCV2qat/J/VigGxGezqkQzxkQA75IjwR0/50RtEgQMR7tw== 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=xkwSEUaf5FikMTEMAHVJod2eWxzYWbjceVKMN0/ePGk=; b=k7EuMPay8x+ekaExwubrvjjeg433RUT/GOcoxLK4TwoXECP0yZIXokJfIP8W+IdhxRgJ/5gBwrLkPPQJn+ecV30LOvw1x4e+nMrP7kItCZYFDhPkY4eGRD2wiaxfb7DaXUHVvXOYLTxblWFzioYAdBi6snnR7ImOFyn1T2BDXicDLYH+eb8wq6hV0szyNQKnfq/xNA6nq6GGtTtxwXyuFFEWnK85obbtyr4zxPssQnCUdUusC4rT+K9X9Umwc4Ucqhz+29NE5qqs1SVOo//4t8FDhGRseKltVX8vH7WJYXf1mHQWYF2ptAfTdg96M8dnZWHDP+CSeC8kP4MJp4iQpQ== 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=xkwSEUaf5FikMTEMAHVJod2eWxzYWbjceVKMN0/ePGk=; b=hxAM4kRxg1V/DCpaKQORD3HnKDFbgkO6O4gOwiBIpuV+Chvq6cqcnKXG7VD2mF/Mrq9CdFD1K94j7fQ7GW+wKJM8FGwFpWZJ+nnZ8DRIK5GAZWn81MAATe+ywkLXlauYciFGpk3qBRjz/5IS+n9lKaucxrYFBHVSvS2TJVBeWm8= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3791.namprd11.prod.outlook.com (20.178.254.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Tue, 17 Dec 2019 16:14:41 +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.2538.019; Tue, 17 Dec 2019 16:14:41 +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 11/55] staging: wfx: increase SPI bus frequency limit Thread-Topic: [PATCH v2 11/55] staging: wfx: increase SPI bus frequency limit Thread-Index: AQHVtPUWDHamnJNHP0yOm8KShv5Mvg== Date: Tue, 17 Dec 2019 16:14:41 +0000 Message-ID: <20191217161318.31402-12-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fed71f0c-1140-44e8-ed37-08d7830c38c2 x-ms-traffictypediagnostic: MN2PR11MB3791: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1227; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(189003)(199004)(2906002)(52116002)(107886003)(2616005)(86362001)(478600001)(6486002)(4326008)(64756008)(66556008)(66476007)(81156014)(66946007)(6506007)(1076003)(316002)(66446008)(8936002)(71200400001)(81166006)(5660300002)(36756003)(26005)(186003)(8676002)(85202003)(4744005)(66574012)(85182001)(110136005)(54906003)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3791; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: beCKLkzOFcHlbTOI3IzFKRYqceginWwUu7GYysEhcHyfoXfKYUwbLRjTTLWSqpFV+CzNUEVVRZPQFalIhbSGn8lSNVbxmGqXoZZTF+IlmUjIckq7GdP3jzfy/bYLE5DFRsvE/yxuNCuOX30QzPZWtHIQ/gV0nucC2MnTn9jnlZxY61EbdNtyDA7lFEexV2tGcV57sP94QgCqeauScl2ipK5rB7onfiXnoOLjXdw66jLVtfU1hvXVtMQ0SVkF70PcwmdB+j3jsRyeqyyv323voWUoRsyIOnATsfs5jk7mk9ZAA29+LNySeXLt6ZDep118T4xs71YUncOQkF4NeonBnKbiR+0XQUuCJiHTjMOUmlgYCD7DdPz81kwG1Gam0RfBsTnCjHOuCFXY6LOxXsrA+TwIhXOBIBLjaRWup6LKEQBIFGjoM9h/srvC3Qx0mxlr Content-ID: <78E09B3BB21AF541BF46B514C85B1F6F@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: fed71f0c-1140-44e8-ed37-08d7830c38c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:41.3948 (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: HaEtZTObbRx9XqrYdtWEV9U1SccLRTm5Ue67jani0YSw3OXBUyO3IBR0HaY9G/BVb+6r/dVeKeIF4pPyUW3bKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3791 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The chip has now proven that it can run at 50MHz on any boards without any problem. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bus_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c index ab0cda1e124f..44fc42bb43a0 100644 --- a/drivers/staging/wfx/bus_spi.c +++ b/drivers/staging/wfx/bus_spi.c @@ -183,7 +183,7 @@ static int wfx_spi_probe(struct spi_device *func) if (func->bits_per_word != 16 && func->bits_per_word != 8) dev_warn(&func->dev, "unusual bits/word value: %d\n", func->bits_per_word); - if (func->max_speed_hz > 49000000) + if (func->max_speed_hz > 50000000) dev_warn(&func->dev, "%dHz is a very high speed\n", func->max_speed_hz); From patchwork Tue Dec 17 16:14:42 2019 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: 1211487 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="p8nNXClC"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjs40wn9z9sSK for ; Wed, 18 Dec 2019 03:14:48 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728511AbfLQQOq (ORCPT ); Tue, 17 Dec 2019 11:14:46 -0500 Received: from mail-eopbgr770072.outbound.protection.outlook.com ([40.107.77.72]:46565 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728120AbfLQQOp (ORCPT ); Tue, 17 Dec 2019 11:14:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K9pgFKdNoHYXGWr0EVLAx0SztIwhP3vFiBVoc1sttZIsL29QlLX1lRzBrPkUj+HSdCR2Mwgxb+fzvgSV36jP4ZR9rlnitMAheRMY1wQ4mrL6SrUdoeS1Ohtvj9GBeiqop2XuGpndiGhB7uR6+zVLB8ZB3nsCvfC222SGM3FJUNdDRJV5PjTVxZuqP4NjvNDqQCsUoLpFvhxitvM122Vru4h2IlWY1kow/KC9z3ffcRM8QRZ4kKM6mGXF9QLwwoTncQKHHE7Czt/PuutGaAUvX9D00Kmqmb2svsuo6bDMlBRVv2cOM2ScJ+FJETEZnxvQbfUqkkFAL6Ids/xvdGwtsQ== 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=nc9K3j/CNlVDo001+UrNKBkibFPlvivaSl3q5jhndzM=; b=fcXb6//Mne9hkIaeC9mtOJcWbp7qzM9aK90dVDkRHVdpxZZYfx9FIvKIe0bR446NL82V9hd1t9lgl2wDmW8CBAiGEhEYvek2jN9FX5PmnFmkys2n8rYGl2uzPkJnQb/HCJfWDv6ztxfC/pXLRxsq0vnDrSNv1iP8kXgYUTB9Y0t0z9bgmrXrWarKf0ra5TNwV8UP9zuBgmc/78RsnO5uvCpUe7DtrCCVRo1ex1y41pZi6jS0dBDvqouDgeg+YSCQAz4o5g9D2yJ9bdxrrWk5TDl3fx84ppwcSrxI2DgNCcwmv1W6iUb9bTYhZsKuJJLuks9VF/mRGiJsgSG2cU/0QA== 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=nc9K3j/CNlVDo001+UrNKBkibFPlvivaSl3q5jhndzM=; b=p8nNXClCois/pXPiAYyaJRUv8IbIls+uFU4v2EVbxkoy7HpIR4+FdL+Z+wWh7QzETJuoNh9XiE6l9WEn4l/ibbhe2BF2JQH2Si1UGK9Uq6t6bK8Q1VaAJFyzkMzoz8aIbWTNuPKGPVaKKnAHozScBVcThnhbb4onjEB4aildplc= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3678.namprd11.prod.outlook.com (20.178.254.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Tue, 17 Dec 2019 16:14:42 +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.2538.019; Tue, 17 Dec 2019 16:14:42 +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 12/55] staging: wfx: don't print useless error messages Thread-Topic: [PATCH v2 12/55] staging: wfx: don't print useless error messages Thread-Index: AQHVtPUXXn3HquIu9U2QGPrXCg+47g== Date: Tue, 17 Dec 2019 16:14:42 +0000 Message-ID: <20191217161318.31402-13-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 11b05e8a-e8a7-492f-13bc-08d7830c3995 x-ms-traffictypediagnostic: MN2PR11MB3678: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39840400004)(366004)(136003)(199004)(189003)(6512007)(66574012)(1076003)(478600001)(86362001)(8936002)(110136005)(316002)(2616005)(26005)(6506007)(5660300002)(36756003)(6486002)(66946007)(66476007)(66556008)(64756008)(66446008)(71200400001)(52116002)(85182001)(81166006)(81156014)(8676002)(54906003)(107886003)(15650500001)(2906002)(4326008)(186003)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3678; 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: sEOWjkteBovVlwF4FGytumDfIl/5nZTwJ9AYSkwXAZA+0Eg8tVX75a+4Iv/s5Jw2wEmJAa+G16fWXdr0AGpH11b47pxsO+1SwX/EGGAunvi49p32cwnN9a6Z4cmFDfaJWItOPYYyCr5Xcjs/iPKc5awlFX4VEopk495Pq1LzBDZU6DvBIWUNBl5Ji8QHyl/22QSaW0lTga1JwsBozReb1RZP6nLlM5QpTccgMXk1ERPkGM75Hr7TMZJxthyzj/Yn5MhitEbl0s4aAjjJCVLZBqPD4oxBKBPkAuNS/KEE12ZAtaAcy+1CloCoq+yru9CktgxB4NPDIkPdIRbuzFjc2LPavDNppPwhAYv0CB5PchvAS6VzGrXP+2o5wY2OOAx6AMtiiQrd/OOwoqxeLEnbg+dMHrlc1Gn/ath2/RAnarctWL/SWy/uZKYCPfgWFZXy Content-ID: <70F12EFE96451F4FB2BDF3ABECBBC9C2@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11b05e8a-e8a7-492f-13bc-08d7830c3995 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:42.6721 (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: S2mwGQk8DqiQ0SKm5sKcO6+A9PkgGSuJ/8zTxtDy8bvsqrs9PixeKfWJm5rW1FBGC/6LkFED+DghOsuz1UMDXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3678 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller During chip probing, if error does not come from secure boot (for exemple when firmware has been found), others errors probably appears. It is not necessary to say to user that the error does not come from secure boot. So, drop the message saying "no error reported by secure boot". BTW, we take the opportunity to simplify print_boot_status(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/fwio.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c index dbf8bda71ff7..47e627bf0f8e 100644 --- a/drivers/staging/wfx/fwio.c +++ b/drivers/staging/wfx/fwio.c @@ -61,7 +61,7 @@ #define DCA_TIMEOUT 50 // milliseconds #define WAKEUP_TIMEOUT 200 // milliseconds -static const char * const fwio_error_strings[] = { +static const char * const fwio_errors[] = { [ERR_INVALID_SEC_TYPE] = "Invalid section type or wrong encryption", [ERR_SIG_VERIF_FAILED] = "Signature verification failed", [ERR_AES_CTRL_KEY] = "AES control key not initialized", @@ -220,22 +220,16 @@ static int upload_firmware(struct wfx_dev *wdev, const u8 *data, size_t len) static void print_boot_status(struct wfx_dev *wdev) { - u32 val32; + u32 reg; - sram_reg_read(wdev, WFX_STATUS_INFO, &val32); - if (val32 == 0x12345678) { - dev_info(wdev->dev, "no error reported by secure boot\n"); - } else { - sram_reg_read(wdev, WFX_ERR_INFO, &val32); - if (val32 < ARRAY_SIZE(fwio_error_strings) && - fwio_error_strings[val32]) - dev_info(wdev->dev, "secure boot error: %s\n", - fwio_error_strings[val32]); - else - dev_info(wdev->dev, - "secure boot error: Unknown (0x%02x)\n", - val32); - } + sram_reg_read(wdev, WFX_STATUS_INFO, ®); + if (reg == 0x12345678) + return; + sram_reg_read(wdev, WFX_ERR_INFO, ®); + if (reg < ARRAY_SIZE(fwio_errors) && fwio_errors[reg]) + dev_info(wdev->dev, "secure boot: %s\n", fwio_errors[reg]); + else + dev_info(wdev->dev, "secure boot: Error %#02x\n", reg); } static int load_firmware_secure(struct wfx_dev *wdev) From patchwork Tue Dec 17 16:14:44 2019 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: 1211533 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Z8alIFW7"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjzk6FHvz9sRX for ; Wed, 18 Dec 2019 03:20:34 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728547AbfLQQOs (ORCPT ); Tue, 17 Dec 2019 11:14:48 -0500 Received: from mail-eopbgr770072.outbound.protection.outlook.com ([40.107.77.72]:46565 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728470AbfLQQOq (ORCPT ); Tue, 17 Dec 2019 11:14:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DYbutUTxIEc9+ZAwkfFyoHP4qlz+jsIn8/GBPE6KS/feHFFR198WV3R0vwv6KbuAYOO8RzfocuwaSyzG/1MOdlihzIJGOGn7OTxQowbY3Hn678Ji5ib9xpkIG9isiQiF3e7GDkK6h5e4aiUWbAhAQ3wVHZ44ATGOG6/tGsS1txv86bQCHik5ZKmyQ2GlulaNzvtCRJoIw6vUllmYUKmd2kaZrlOnLfHiArcs0Abui3Hb5jVJEPxZ3foT8zyClklf5d/XXAmt2WfkH/VbAMUFO8MLKsRKsjWQFejW7gb9gFTfpBVF1HSS+xiz76KXHSE43Url3pVP/k3K8xdV7ExRrg== 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=3e6A8zclh+sbKBL/FiNbcfJFdz00l+Pj7W9HJEvq2ms=; b=a0+n67Ap3Vmv0Q0CyGkypnuwbYi4Ub5PGKD6vtFM4BRlR692250uoYcYC3y/1lhxykV3fij/z2XF9MhG4eYdqBZQVOsPVikX1EKMpCaTQbJLCZ8cJ1TyvaM+qgYTpE8ku6CJhLsNXuqDFcn1gs4nS1MBx27kQSAbuWrCTb0gOjFbzXBUmjVYGx3VHh+1lzoJZ0QndyKXgBwHMBCa84/egwpxpy1gyDMEPkbzzjV5vLAMdQKGKqAaP7y8pPHefcTax/9yAibzzJPiv0V7p/5B3dPacrRnESmVQaiLKHdlO8teB30zcDKcKP5wjMTuo7UOuWJrmpd4UK2Ax9ku4wbYTg== 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=3e6A8zclh+sbKBL/FiNbcfJFdz00l+Pj7W9HJEvq2ms=; b=Z8alIFW7ZRDdXWBIRhZCArKtgpeT7r4zNKQ6/aFwnffT0Yicu+7MJnzEr2btbVyi0EAhpNBLQflPTNa08IlkZjD4hYYQvnxuZ3AA2t/YiOmebkAfX3rPoRaVqQPk4iIEgXgXxMogJZzLOlCKnKv/g3keWmh+UokGkAHj6WDwU8Y= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3678.namprd11.prod.outlook.com (20.178.254.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Tue, 17 Dec 2019 16:14:44 +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.2538.019; Tue, 17 Dec 2019 16:14:44 +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 13/55] staging: wfx: avoid double warning when no more tx policy are available Thread-Topic: [PATCH v2 13/55] staging: wfx: avoid double warning when no more tx policy are available Thread-Index: AQHVtPUYR1+FPj2gG0K7mDog2VQHUA== Date: Tue, 17 Dec 2019 16:14:44 +0000 Message-ID: <20191217161318.31402-14-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dcc4ea14-f825-4228-f51b-08d7830c3a62 x-ms-traffictypediagnostic: MN2PR11MB3678: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:475; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39840400004)(366004)(136003)(199004)(189003)(6512007)(66574012)(1076003)(4744005)(478600001)(86362001)(8936002)(110136005)(316002)(2616005)(26005)(6506007)(5660300002)(36756003)(6486002)(66946007)(66476007)(66556008)(64756008)(66446008)(71200400001)(52116002)(85182001)(81166006)(81156014)(8676002)(54906003)(107886003)(2906002)(4326008)(186003)(85202003)(29513003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3678; 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: KteQ0mmWNUZMIIgpxuAcNCBNfXEURrp1m58Y7dMaRHIeY3cvMBdb+UW7hp07wJTugMSGuN5pKokeBmwTu7e/CTqOuqzVJA7O9Hqeo3sKKUYwIwMpQ/t9EyUPg6zZP6YRtNu/zvFZFdnt3YVAVlahXHOjTb3CUigqnIW2Rfpk5xMYKBqvdgK5qcPpNmas1ARlDhCFkCsfHgDJ5084KOwTbtCbar9KNaNhG1mZcKN3KzY4l9MSGQfr7ZVipzhX0P3lNXAS+fSkfmzLmX45UgH9O9r/k4CwkPu2DChxO6VcazM06Yp+48x9tHUZVEWhMsDlUr8mhW9rFgOCE/10GKSy26EBO/0XLyhVm+ej29j+/Gp1IO8c/UmcARGMn1tM/zX1FNOK+dHggO99B/BzbJABjJO+VGs79VsCny4PGyhqD9Zt4jIEqUA2XtTIqyOIErF9cfD+vzT2KKu0DIzQ3LAzOjvwGy3IizNM2CmiYT+D7uUGn1FkpMqnOpbD3jAwrJ8l Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcc4ea14-f825-4228-f51b-08d7830c3a62 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:44.1113 (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: Cog3yRiQW9M7fp84Fy3m9ZDuprl2jXoTSQox8z6s2nLEUSOw9o2YgDpREA/EERQS4MK6mF056ZM1KmZfQ2N8RA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3678 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Currently, number of available tx retry policies is checked two times. Only one is sufficient. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 32e269becd75..c9dea627661f 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -169,7 +169,8 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif, wfx_tx_policy_build(wvif, &wanted, rates); spin_lock_bh(&cache->lock); - if (WARN_ON(list_empty(&cache->free))) { + if (list_empty(&cache->free)) { + WARN(1, "unable to get a valid Tx policy"); spin_unlock_bh(&cache->lock); return WFX_INVALID_RATE_ID; } From patchwork Tue Dec 17 16:14:46 2019 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: 1211534 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="IwNuAyvS"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjzq5pg7z9sNH for ; Wed, 18 Dec 2019 03:20:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729461AbfLQQUe (ORCPT ); Tue, 17 Dec 2019 11:20:34 -0500 Received: from mail-eopbgr770074.outbound.protection.outlook.com ([40.107.77.74]:51332 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728527AbfLQQOs (ORCPT ); Tue, 17 Dec 2019 11:14:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eR1+FXhVNOy0VWhphyWBNyb5uU/l7+C6MbqvQDvNZ3Kz86uVqrYmAesgIjO46nHVFU1FJBGWIaxvwgzqme7EWPxqphjg2gfVxLJO7lNhTH9+OF2+NqD5sywTvRsOyiY3utvWYMZ3yahdkgeZ7vjjvVvx2BrkWBBMSNRcHcuN4H4sfHTpnFVtP/fSwO3MfGHqfNmraFazIiyJwipOjC7cNlTePa4PO1ZloO96XQ04L3u09emNZnJBP+vn2VDW9OAjHmlwMfAp7iwBFwaKZUzzn8LeyxKez2ipF9++zDxH+vaJ2glUCnB15E8V7jwfdJRC7DhAoH6YsrLnrXf2WUoR6g== 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=ykbHrayhucoW96Q9wsmZFwaTSnAEZu3zX1giZkHNMJc=; b=mLtXWAFGwrKH+hgTJtYuPAZ70R9h+vx3B8PinJ5tdvuB7/8i57oP5eVPugPrMYLxO3UUOR0vSbb3UjyL6DoyxGYO83l5Mn3bXw2vptF3A3spsQ41flUrE0SC/RAHus1mgZG1STPz6dkUdTLL6E7NBEwW1ZTwFFZsAqFv+GXgZPhDcZoTwfjpQQOBxuT+SfZ0WSiuFiQSTql6GK8ydGpj7Wyg9jAYFk4GfcXXMhlNYcHPq0yb6w1dPQT4AUmuSb4ScnruT6WsUzrL49q0inN45iCvz3IESLJCarO3cq1bNAIwpgSLcoiHW/bNR8DGRV6dDxQaiEt1kC01WJ7o1cPFmQ== 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=ykbHrayhucoW96Q9wsmZFwaTSnAEZu3zX1giZkHNMJc=; b=IwNuAyvSRckc5iWDJl5PUEuSGCN7wKBf1j3A16Q8fq+CJTxzwPfPKxv18Z8kRWQoP4zKNAzZaob8P2rPKTHK8kZ1yTRlSZ0+b9u6wukkgFsgxmHedvmcaQmSN1DRoCAeVL8mDJECOisHP6nTrXqmXaKsQ6CyneJv/XKe8sb2Uto= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3678.namprd11.prod.outlook.com (20.178.254.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Tue, 17 Dec 2019 16:14:46 +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.2538.019; Tue, 17 Dec 2019 16:14:46 +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 14/55] staging: wfx: improve error message on unexpected confirmation Thread-Topic: [PATCH v2 14/55] staging: wfx: improve error message on unexpected confirmation Thread-Index: AQHVtPUZUTdSWpTmakq/HgUUicrz6Q== Date: Tue, 17 Dec 2019 16:14:46 +0000 Message-ID: <20191217161318.31402-15-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3708457f-b5da-496f-ba4d-08d7830c3b94 x-ms-traffictypediagnostic: MN2PR11MB3678: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1728; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39840400004)(366004)(136003)(199004)(189003)(6512007)(66574012)(1076003)(4744005)(478600001)(86362001)(8936002)(110136005)(316002)(2616005)(26005)(6506007)(5660300002)(36756003)(6486002)(66946007)(66476007)(66556008)(64756008)(66446008)(71200400001)(52116002)(85182001)(81166006)(81156014)(8676002)(54906003)(107886003)(15650500001)(2906002)(4326008)(186003)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3678; 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: roRmMONQI/CTmPNxWunU/3qvpaqt8vL0nafWhQzMZvcghCRaAtg9IWw0mS9X+Tqz0RTrMskGTXqBl5en5zh2ECKysLMkl8awyctsceu/+c9RGSU1GtN8dfhnR3CBMEr7ToH6OjdrJBOk128QdjtIo84tGApOitwJ9y/B4kJiVx0tflDITY77kP1VISjYqtPyHy+e4PCt6II7sqq+lTEruLFD0mhnIqlJPChbw6w3PVnJWk21PaMHX7h7vUUrw+qWfuavx+OQ3cXtXjjXRAW3d0eRDgrNTDrZcA/sbUaC62UmVL2ncUtO4TUf5G9HP+FetJ/Cd+b3u9sZfUdOJ/B/B5uPecWJdALudtInwNeYnz7RE1GWf2aGz1879SXCaQg1tse9RaJnkVrtauGu+ZTcHU+Hp+uMvhgqaqimyxgWOAK5Jtnn6ZJY4sG8YISm/xNS Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3708457f-b5da-496f-ba4d-08d7830c3b94 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:46.2031 (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: bSAhPy+Vyh67hPrUb6PZQSmJabO4OP22OCr98cm7BsDh+kiL2poTfbV7RfFMBKMbC9swQ9JcLDCkuEzPkUPWaw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3678 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller When driver receives an unexpected answer from the device, it shows "unsupported HIF ID". That message does not represent the real error. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 820de216be0c..1494ad5a507b 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -358,7 +358,12 @@ void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb) goto free; } } - dev_err(wdev->dev, "unsupported HIF ID %02x\n", hif_id); + if (hif_id & 0x80) + dev_err(wdev->dev, "unsupported HIF indication: ID %02x\n", + hif_id); + else + dev_err(wdev->dev, "unexpected HIF confirmation: ID %02x\n", + hif_id); free: dev_kfree_skb(skb); } From patchwork Tue Dec 17 16:14:48 2019 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: 1211531 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="piWa2k2M"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjzX1XHGz9sNH for ; Wed, 18 Dec 2019 03:20:24 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728600AbfLQQOy (ORCPT ); Tue, 17 Dec 2019 11:14:54 -0500 Received: from mail-eopbgr770085.outbound.protection.outlook.com ([40.107.77.85]:54665 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728562AbfLQQOw (ORCPT ); Tue, 17 Dec 2019 11:14:52 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O9YyL0umP8eXsBm6DeKSmPSNwQaNP6/4LMuD6eck9nS6xrOoAIQJui8gICBVcB+fAcT3/mw3W6OonPqvIHdFeUNjeYuFOBTL/GHswLE+/f+Stsim7uvZKOCai4kXkIP8HxWvC5XkvdJkIGPc5O57IvjSToOL9DY7USttf4ZezcALmn7+NPNZyNGH9WiamCVqVk7AJI1UUhRHqhdF/3arzMlTS97eXP/oollo4KhyBGNSR9TQUgcBMix8P30l7HCtO046komsVKtmhJAAJulFghMKHBrOvhmRdCNxlNZ+k6GQx5JoalOtNcq/reTUJL4+JNZFo9QGluAJt0mshdQADg== 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=YTZ2mHQAOdzhtudBdg9k79F/qN3A9xgRWs5Gtagwc+o=; b=Apcv8yEXJ5clOcxl00VVz1pe07PtC5tNX87LLm3emCyzyd0yngIs4GQHL/WWQSAFErzrqHfYZIwydI/K00BDAnVemkcjGmUC/NKWldjlyYjkQGW0dkvGzrSdj9n2lEVTl0HdqUTyqf8VmU61XyZqprgYkDAd2AS1WZMbm6RzYU8XBoDkw1IPwEKEjgqkilcfLaXz+Sr3DlSZPSPNWC6OUvJbXLMqzz2cFyzdTXQkL3z2RqWjDtaqpXKY/Vosl/Ns50jB6636ugO5UvkmaBdUXdiFrMuWNowGxz6zBhX2ZCJznlLP0HcJI3xD+i+TKIJyP4i/X9lhiavH0UuYLOiwUw== 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=YTZ2mHQAOdzhtudBdg9k79F/qN3A9xgRWs5Gtagwc+o=; b=piWa2k2MOdZDWxbbFnW98taVevwWoHD8syzugx2ogpRwmDeJ3F1p56eioJrMcWZUBrv0ws/x/4pStHM+G/gA3VDUS5wiFOrTt4h78diMey6SpddYQD3D0yfG6kKr5tjlhcAG9OKvZarU+yakeP6mBsqWBvpW8FMt+joPv9uSORQ= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3678.namprd11.prod.outlook.com (20.178.254.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Tue, 17 Dec 2019 16:14:50 +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.2538.019; Tue, 17 Dec 2019 16:14:49 +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 15/55] staging: wfx: take advantage of IS_ERR_OR_NULL() Thread-Topic: [PATCH v2 15/55] staging: wfx: take advantage of IS_ERR_OR_NULL() Thread-Index: AQHVtPUaVu3WG5LOh0qy2MRcQq8tLg== Date: Tue, 17 Dec 2019 16:14:48 +0000 Message-ID: <20191217161318.31402-16-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bbfdf93d-df18-4ed4-ca78-08d7830c3c70 x-ms-traffictypediagnostic: MN2PR11MB3678: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:257; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(366004)(39860400002)(136003)(199004)(189003)(6512007)(66574012)(1076003)(4744005)(478600001)(86362001)(8936002)(110136005)(316002)(2616005)(26005)(6506007)(5660300002)(36756003)(6486002)(66946007)(66476007)(66556008)(64756008)(66446008)(71200400001)(52116002)(85182001)(81166006)(81156014)(8676002)(54906003)(107886003)(2906002)(4326008)(186003)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3678; 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: Fpdou2V8nGI1bBriUaUXEmHqtrjOrSCr9WF8qv2THZWElxfnFfUA1zmpLPN/zFlQEcSfqxbpFHdiFmODXDjwymo2xfcbGH0zGzDGQx7OeM56GDjLlmuEpH5i5ypbDcAivd05HC10G0aAMh5aXLUEfrCPqypM+aWFaAKopQhnk8HgC1L4kAhIzqgR2DZ7taODKD0CG8P8PJN4SI1K6LDgrEKYnGr6e4piW46AzIGiNKuCEamlDLHHtu+JNmS9HAYS6Tz4aTDjZH9XWXMF+GijkRUOp2rwj4UUVDIoyRc+8cFrvA6KRT+Vu+La7sWDUlxGuKlk32o0KgJ+DQXS0k0iQQr/RIDYNeXJ50O7s21AeMYytwQxGdPcWzSmrTntlWrlWpasoU2ujhaZ9JDSsJsi/CkK+5Ua50FVBgLr1c5z/a0IKHZ32J7f+akQ4UBA0+q2 Content-ID: <0E738CADD67D264EBBB70178CC175465@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: bbfdf93d-df18-4ed4-ca78-08d7830c3c70 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:49.0296 (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: qZg7BUnnSR73qQaL+duV7rxSMLP8+8ePOMyG4Xyqepqun8W/CXtp2vs7J3pSy1dIkPdiHFh7mqiKKP9xFDbw/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3678 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Obviously, current code can be replaced by IS_ERR_OR_NULL(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 3b47b6c21ea1..cf4bcb14a12d 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -182,7 +182,7 @@ struct gpio_desc *wfx_get_gpio(struct device *dev, int override, } else { ret = devm_gpiod_get(dev, label, GPIOD_OUT_LOW); } - if (IS_ERR(ret) || !ret) { + if (IS_ERR_OR_NULL(ret)) { if (!ret || PTR_ERR(ret) == -ENOENT) dev_warn(dev, "gpio %s is not defined\n", label); else From patchwork Tue Dec 17 16:14:51 2019 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: 1211532 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="lbJ9ubof"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjzb4Psgz9sNH for ; Wed, 18 Dec 2019 03:20:27 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729454AbfLQQU0 (ORCPT ); Tue, 17 Dec 2019 11:20:26 -0500 Received: from mail-eopbgr770085.outbound.protection.outlook.com ([40.107.77.85]:54665 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728470AbfLQQOx (ORCPT ); Tue, 17 Dec 2019 11:14:53 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gxINZ1n0JyuzuZyI1OUfW6Oc4au4RZsJQBptRoi1gSWjAC+r5eZ2BN9TgABQ2jI5TCJu4YFCWp4JnkKuYmmSm5NXovvyFr2mpFFVwiLnMPN/EKx+2YKmfpYkvPcXLjdOfQEy+ePt1Qw3KE0aEjyD3QXAkLYGuqg3KfDon6gd/FsM6zqv8nEFXuk8xm+0iPYDz6IhztMEdGpWdbKsDAuJhdYYNZEwlb10xL7UEqeX/VZ82HWxv4pNWIsx9AMfO5CnTi9cHIYSox1FJviskC+7Amt50xsyqYMSGN9EmKWEeBZMk/zjSnEoRWiC5ruf2dmDzK0Jq/lcYMoosAFD5PQOuA== 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=oa7BZBcw7bkHfVUpfqTHHcmVDdCF4p/YDmQHY7qzc4Y=; b=eLpTijQpS/pUMoZDO95BXGIgANTuSJ4WJPh2G0waVC4VqZXrLrjpUHJC2Ud0XS5LViYvopO+FUljP3dcmigyxVsv31adygrcTs5NTtELOrbEA/h5tgDIcQHInDKSctY4mqmQdwUhlhmovFFHBRkZYn3X6j1wE4NCRynOTa+j2XvkNW/B7WlcLLodzwc7sM1drmLLzzCdw18YKCbzIQ0cLL5sLaFl9lMAoNaP+XTDzi6Rxdz4pelVsk1FLfy3rc/eYiIK2LPu9oc6oz/sQ4je9nWWz9REBHYqHGfJ4YtYbpcOf9zZixjD901aZHx/p7Zb6YYgYc9IkDv/PA3TX72Z6g== 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=oa7BZBcw7bkHfVUpfqTHHcmVDdCF4p/YDmQHY7qzc4Y=; b=lbJ9ubof0tJTVPgDnauDH15ztDV3lrzuhyM/QMNH3Ls337dM72mHsSocG5zuDhO5Y+D47hnfKRXECufY25VKR/J0jXbiLFSSjA2drUZaZKaWge7MvTsvfjIlDHSuU94Iut7gvWzrdhvr8lKzXfvj8/S436i2JCX225UFHFAD/IQ= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3678.namprd11.prod.outlook.com (20.178.254.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Tue, 17 Dec 2019 16:14:51 +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.2538.019; Tue, 17 Dec 2019 16:14:51 +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 16/55] staging: wfx: uniformize naming rule Thread-Topic: [PATCH v2 16/55] staging: wfx: uniformize naming rule Thread-Index: AQHVtPUcWq+DZSowJk6hjAkDfGy0Tw== Date: Tue, 17 Dec 2019 16:14:51 +0000 Message-ID: <20191217161318.31402-17-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9d134871-f295-4754-1bec-08d7830c3edc x-ms-traffictypediagnostic: MN2PR11MB3678: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:446; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(366004)(39860400002)(136003)(199004)(189003)(6512007)(1076003)(478600001)(86362001)(8936002)(110136005)(316002)(2616005)(26005)(6506007)(5660300002)(36756003)(6486002)(66946007)(66476007)(66556008)(64756008)(66446008)(71200400001)(52116002)(85182001)(81166006)(81156014)(8676002)(54906003)(107886003)(2906002)(4326008)(186003)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3678; 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: Eg78OMQfPWz/FmdldoSqhGxvdWNaJe8ZVJYAG2dxZjvJ7HjuZoxCc1bO8FN7W1KJq7h7Qx9TRDH5um84rJPZ7ThmjDm5nHgLoJLaytJ6jS2APrOd3ki1RHXUZz8AXyECn7gSmrhB8J3XmQy6tawX7CAiN36xP6Vx0kIY4ke5Dv3pgXKXEUSgb+BVEi2EqeNj3Jkaq+twziATNUYR8jiBKuAQY2O5gCTMozpG/9Y+EHa1xrOv49bARYYHzlB6T8+o1Vg00X7VBFMkdo0YkIrMnkFBo/ftqCjvK8ziKCaFiD99VBNYerj/r3ad6o+rkn6fezB8jnqH5v4farOeKDsPhONa0muxQDUZONfrTQsq9ZWWvN4tQSihpwBBhepcsMgYKrJ3Rp2ks8XUSAtuHkZ6GDUOENo57MiFs1bU1yLBj45Ab9oeB/HXDXnUN9P7ppSg Content-ID: <141BBAA6CE455340950FCF9ABAF158FE@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d134871-f295-4754-1bec-08d7830c3edc X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:51.5232 (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: LV0Ns2yoZjDI5CdhGweoRWm+sPjm9NrwFrn87ab2ly/XFWOpllHz4ScFgv87ajkanOosfLQCOvDUKsjKsldIig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3678 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller In wfx driver, when a function is used as a struct member, its name is the name of the member prefixed with "wfx_". This patch apply this rule to wfx_spi_remove(). Also remove the useless comment above the function. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bus_spi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c index 44fc42bb43a0..0a055c4041af 100644 --- a/drivers/staging/wfx/bus_spi.c +++ b/drivers/staging/wfx/bus_spi.c @@ -223,8 +223,7 @@ static int wfx_spi_probe(struct spi_device *func) return ret; } -/* Disconnect Function to be called by SPI stack when device is disconnected */ -static int wfx_spi_disconnect(struct spi_device *func) +static int wfx_spi_remove(struct spi_device *func) { struct wfx_spi_priv *bus = spi_get_drvdata(func); @@ -263,5 +262,5 @@ struct spi_driver wfx_spi_driver = { }, .id_table = wfx_spi_id, .probe = wfx_spi_probe, - .remove = wfx_spi_disconnect, + .remove = wfx_spi_remove, }; From patchwork Tue Dec 17 16:14:52 2019 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: 1211530 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="mroMfKXp"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjzS0rRVz9sRc for ; Wed, 18 Dec 2019 03:20:20 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728644AbfLQQO5 (ORCPT ); Tue, 17 Dec 2019 11:14:57 -0500 Received: from mail-co1nam11on2040.outbound.protection.outlook.com ([40.107.220.40]:6107 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728611AbfLQQOz (ORCPT ); Tue, 17 Dec 2019 11:14:55 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k7qc12X7GSOUBvetG+6GZPzWCKT/3xxx78OJrjWcPibud0gBNBMAPVmqVGqruAJodXEMi84lXizHxP/uca3tB5W0dBpMg1zAxmejw6zt9F4F1DPUkYDFpsDEAzddYSwpOf53m10sGEbLxX+tYba4p4YgL6dgrMdaQFTLFteOk32oeS4YVo489s2uFNjGoOKQyy4CZGmPdm31bS3h43rm3qGltXkFuzb7zfZjAROusqzbhgcFYcWW+Fjp06k70SS+IdEKViezfos4a2OJ5Ww2Bf2P8ex93xEeN5evIO/IZ18zHk1dQCvjKYj70Tp5vJsqK3akFyrs23lKjiDQTN5swA== 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=qSt5Bj9pM1rKsJLNKstOG6EMbm9bl0x5ZrOupIor3mU=; b=dbM57SeNbKEDFqm9y8Bnaa8FxjXDCR7Sscheu1Mm804QgRFB/0+hb/Wp3/kXojGbmBMEVE57SLxmEelsJqKEIMw1mn4G+fL3LXqka3ln/zbE8T2VDvOWAJ/254WksjwamYDB/wp30hSIEegSHuz9WtLfb4aSrap53xu/VktpQzoPEYKCfyesdXwfUVYDYyvUomLxqfCGKWee+BoKtcbvl98w9g3eFHrZYQ9KLXzbfKucie7T80Y2qrnQ+2DHD1wszpMfeOe/5zgRgrEKrhjHZr4OquorhiualXQoJuR/v2F/UX2T0iEy8GzU/Jt2oUBf8ruK48IoVwMBs0U8I1NAOQ== 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=qSt5Bj9pM1rKsJLNKstOG6EMbm9bl0x5ZrOupIor3mU=; b=mroMfKXpb/mAD6ea6kpM3oEXOo7Kd1hAiEXHSkCkzqgqHevIDPano0mzaqGXjwsybljm4tKMODk7QE6U5PY9EPKuWw/HT3vLluXIv9HnyTIclAYbVg2CA6GX51gQlE3758LpsjlJUxsDpENS82qxfy7bWXhJDQq5gZEDFBdwpt4= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3678.namprd11.prod.outlook.com (20.178.254.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Tue, 17 Dec 2019 16:14:53 +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.2538.019; Tue, 17 Dec 2019 16:14:53 +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 17/55] staging: wfx: use meaningful names for CFG_BYTE_ORDER_* Thread-Topic: [PATCH v2 17/55] staging: wfx: use meaningful names for CFG_BYTE_ORDER_* Thread-Index: AQHVtPUdMqjBxa9920eBAwh9rliraA== Date: Tue, 17 Dec 2019 16:14:52 +0000 Message-ID: <20191217161318.31402-18-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cda2db70-e93a-4419-3de9-08d7830c3fb0 x-ms-traffictypediagnostic: MN2PR11MB3678: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2150; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(366004)(39860400002)(136003)(199004)(189003)(6512007)(66574012)(1076003)(478600001)(86362001)(8936002)(110136005)(316002)(2616005)(26005)(6506007)(5660300002)(36756003)(6486002)(66946007)(66476007)(66556008)(64756008)(66446008)(71200400001)(52116002)(85182001)(81166006)(81156014)(8676002)(54906003)(107886003)(2906002)(4326008)(186003)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3678; 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: WFTMkEmbXnKP+iWb/R45yfuJaz2xPzS0MbbaPTYKrazTxOY3CDRTwjYe+pYhn0Xj9FBjrNAnqDw4JFF4VOgI2VVch/1OjzbiQ0tzwv4Cdw4jkKxKzFfFMtPevgXU21wiW2vVfUvkdGp62B3c2wRXZjnIqFMzA7nUaiOtP2//1QhSJpBFkZY8OLDCdPtfr4AJ4sYUDWLo7eC94x1/JvFeynRp5bMEq5gEFQGk0kuwuiqOraWPfF9GQ1d6UdKLihyFFfLW2A3dHwfW55W5DJ2ki6wMc1dA4gaUm6ea9m+3fVLKFpWeyjYro6gPgtcoUPMBIgKQ9GrnOVlOX6bZOIvpz5qK0omSG7Gzu4J53k5MEoHWJ095NdaV+4h+DexvhV7d+G9YIfftaYN0dP4M2fTkCHxsZij3Li85yuYrDXi1c8+gN7mLJBxV5ap6YekLqOfB Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: cda2db70-e93a-4419-3de9-08d7830c3fb0 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:52.9224 (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: sCyQfBFUExA8ieK/HqEwJHwcay4Cr31yr7THbEQ4Ao3jfEf42S0Gim9DUAd3Tw3Ja4HwiAg7QT/SusKDSpto1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3678 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller This new naming allows to save a comment. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bus_spi.c | 2 ++ drivers/staging/wfx/fwio.c | 2 +- drivers/staging/wfx/hwio.h | 15 +++++---------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c index 0a055c4041af..40bc33035de2 100644 --- a/drivers/staging/wfx/bus_spi.c +++ b/drivers/staging/wfx/bus_spi.c @@ -107,6 +107,8 @@ static int wfx_spi_copy_to_io(void *priv, unsigned int addr, cpu_to_le16s(®addr); + // Register address and CONFIG content always use 16bit big endian + // ("BADC" order) if (bus->need_swab) swab16s(®addr); if (bus->need_swab && addr == WFX_REG_CONFIG) diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c index 47e627bf0f8e..9d61082c1e6c 100644 --- a/drivers/staging/wfx/fwio.c +++ b/drivers/staging/wfx/fwio.c @@ -339,7 +339,7 @@ int wfx_init_device(struct wfx_dev *wdev) ktime_t now, start; u32 reg; - reg = CFG_DIRECT_ACCESS_MODE | CFG_CPU_RESET | CFG_WORD_MODE2; + reg = CFG_DIRECT_ACCESS_MODE | CFG_CPU_RESET | CFG_BYTE_ORDER_ABCD; if (wdev->pdata.use_rising_clk) reg |= CFG_CLK_RISE_EDGE; ret = config_reg_write(wdev, reg); diff --git a/drivers/staging/wfx/hwio.h b/drivers/staging/wfx/hwio.h index b2c1a66de963..4b6ef061b40b 100644 --- a/drivers/staging/wfx/hwio.h +++ b/drivers/staging/wfx/hwio.h @@ -37,16 +37,11 @@ int ahb_reg_write(struct wfx_dev *wdev, u32 addr, u32 val); #define CFG_ERR_HOST_NO_IN_QUEUE 0x00000040 #define CFG_ERR_HOST_CRC_MISS 0x00000080 // only with SDIO #define CFG_SPI_IGNORE_CS 0x00000080 // only with SPI -/* Bytes ordering (only writable in SPI): */ -#define CFG_WORD_MODE_MASK 0x00000300 -/* - * B1,B0,B3,B2 (In SPI, register address and - * CONFIG data always use this mode) - */ -#define CFG_WORD_MODE0 0x00000000 -#define CFG_WORD_MODE1 0x00000100 // B3,B2,B1,B0 -#define CFG_WORD_MODE2 0x00000200 // B0,B1,B2,B3 (SDIO) -#define CFG_DIRECT_ACCESS_MODE 0x00000400 // Direct or queue access mode +#define CFG_BYTE_ORDER_MASK 0x00000300 // only writable with SPI +#define CFG_BYTE_ORDER_BADC 0x00000000 +#define CFG_BYTE_ORDER_DCBA 0x00000100 +#define CFG_BYTE_ORDER_ABCD 0x00000200 // SDIO always use this value +#define CFG_DIRECT_ACCESS_MODE 0x00000400 #define CFG_PREFETCH_AHB 0x00000800 #define CFG_DISABLE_CPU_CLK 0x00001000 #define CFG_PREFETCH_SRAM 0x00002000 From patchwork Tue Dec 17 16:14:54 2019 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: 1211527 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="fTbl3sVN"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjz91tFlz9sRM for ; Wed, 18 Dec 2019 03:20:05 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729444AbfLQQUB (ORCPT ); Tue, 17 Dec 2019 11:20:01 -0500 Received: from mail-eopbgr680046.outbound.protection.outlook.com ([40.107.68.46]:59543 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728691AbfLQQPA (ORCPT ); Tue, 17 Dec 2019 11:15:00 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j2lpbdChKi5V3pLe00JTs1LC/7A7HrMGPA8Xqk596SoqPZWb4X6g9u8y39wnydWCU1AYEBTuix3GJd5hSU3glqZJtkfy7Rq3+s4MOaqjbNXy4+qXlJjdbGpSHDoILDLwUxUt8wjpmulWW/aEfvEfGrRbZ3QGM8psb+aPYcq/jUIKlngUvp0Ig2l1syz5jEBaFRuuZje+njgY7apbKuOUPuQeBgPiTFQq042lMRpmOj+s3JvV99tz4kffx5CompfgHddw/1z/GExeBuU9ZeooXZKMR0xKBkrHLlJnHJv0Nrsiu4euRiAJOdgkm9iUg/0q6j25F1iVuFw4r/eIThv6Bg== 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=bwq83apa9UPPWMtYIC+2a1EAwrox1NuZQYWnXXSmpAU=; b=lMl2LGf/EVYdCs6Mo0ziHZinTJDK0FqjZv9HT/HAj70s+ENT+EjaiM2p7Bi6LtDtiwbh4JqOq+b9X7dNnpWC83nFluqZT4dT30YPyaxqAWz33hJ/rl1vq2lfaEkCSSrgth3TuZhIqJGkc9TQrJ5fGh6ai6UUczrz79YjJ4ieffSyFeSrOdzcmxagOH/oUlZj7+ynzS5hEZA4UllaHZF2UMUp1ngVBTqXvmZ99mSEXvipbgIiPWlGm/KfOfrUlj/uBVJ4cWjYqlrF1oyxk4qhQtZJaa1Q0STQvwGRfluQjNKI0ZkJ/qgtDbEfzXG9LGXmDRH4B9OzC02nnzFzM0F/eg== 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=bwq83apa9UPPWMtYIC+2a1EAwrox1NuZQYWnXXSmpAU=; b=fTbl3sVNcSHPDSbZ0tr4p5Mp0/QfSyrVp04krztMwk+IPC+MSFXp3cSaDd0fwR0Ne2rpu2rUlus6LUS6x2uozmcCKoXmp7gdJqW574BNo3YWr3F5F9AsEKP/vf+Rk1YdQtS/SaOS0EMIV/XrGt5PCNEuK0M9TlVNehOYFugePYM= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3791.namprd11.prod.outlook.com (20.178.254.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Tue, 17 Dec 2019 16:14:54 +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.2538.019; Tue, 17 Dec 2019 16:14:54 +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 18/55] staging: wfx: remove useless include Thread-Topic: [PATCH v2 18/55] staging: wfx: remove useless include Thread-Index: AQHVtPUeSWhPDyYxVUuXgmw6OA5hQQ== Date: Tue, 17 Dec 2019 16:14:54 +0000 Message-ID: <20191217161318.31402-19-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f87eb744-2832-4929-e303-08d7830c4075 x-ms-traffictypediagnostic: MN2PR11MB3791: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:639; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(189003)(199004)(2906002)(52116002)(107886003)(2616005)(86362001)(478600001)(6486002)(4326008)(64756008)(66556008)(66476007)(81156014)(66946007)(6506007)(1076003)(316002)(66446008)(8936002)(71200400001)(81166006)(5660300002)(36756003)(26005)(186003)(8676002)(85202003)(4744005)(66574012)(85182001)(110136005)(54906003)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3791; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: 7v5hNCDZSz3Rt29QEJkGb70AMufuzdFtsnHyBBxlnc7rR8XNEnLTD7eNnk/eHssdIsGLkFRUZd9KA0ZL6qHzy7HIdG2+5DjpOaTkpXUOKsX1hophEYzWvnMwSeIhnccemq3dJYFkCvTHyZHkfMGcKIIIK5/9HyKo6yxlhLw/qQzSJ6vjLHHPEDMTceOYB/VBN2wO6nJmglzffpTq7LKIwr43rsjSPTIBZWeV8RSchI5dGW9IK3qGd0TlhFzW2Rn4hcwCBQxIGnxf5ioFvBH7ssj+m9V8wUS40zk/0VK0aAeeboyN32x6EbjRR5kzWAsr83bWZE95IAK82lHS8CvlFgLAX97eKNd6Y4f63KIXA7iEitD1EscFEgRUVHmP9+DOo2GX3tWFGPlUzv5A3Xb7dUUxd+iZ1/ALcmzkV1g36YMLFAbyIS+GC2OJzGYDf0He Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f87eb744-2832-4929-e303-08d7830c4075 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:54.3186 (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: q5a2ydmrc8zzEawC1pf+PrZ7Q+FwhpRnse+Qw4UaNZHz1Az8IHCOIaBlBtLPUM8c0qru4UvanOlIQM0dhnO/cw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3791 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller hif_tx.c does not use any struct skb. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index cb7cddcb9815..e8c2bd1efbac 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -6,7 +6,6 @@ * Copyright (c) 2017-2019, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ -#include #include #include "hif_tx.h" From patchwork Tue Dec 17 16:14:55 2019 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: 1211526 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="f1TR4mFv"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjz12qslz9sRM for ; Wed, 18 Dec 2019 03:19:57 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729434AbfLQQTw (ORCPT ); Tue, 17 Dec 2019 11:19:52 -0500 Received: from mail-eopbgr680046.outbound.protection.outlook.com ([40.107.68.46]:59543 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728670AbfLQQPE (ORCPT ); Tue, 17 Dec 2019 11:15:04 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZVbpSH5CJ7CgEjElDC3ks94cOXYs+c5kYarbdyN1eYdCa1Q1DCDyM7b6XxFEW8d2CtSXaOHtj7Mn/NUq9GMhUlWDeT2d1m9MuNjOmq5a8hYdq7Loup1vNpToqfmHKpZvF/eaQjkjnoYs3A0N33F135/OXhK2fXnwvTJspj8RUY1oCPuo95P6sTk12dgglM35EMfvvuG8/H4Jj/pBsLp9cbCR3pfTzJhxMS+XCuuFjvAF2w87ZbdXqw82ON2UyWmknoQ1Y4ZlIwvNmDY7fFtbLEfHCfkfYgrm7hknnsH+sLfs7+JZLS9nuABj/enGc3/6Fc8RqkTL4ZS/Dm2doSyLlQ== 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=I4zmIWF1VEfiZFnDsG5urt00s1dOZma4jMG+tf8W3k4=; b=cia59cx1+YVCpiq5D/qiMsmb6XQFyMOt55eQblDnWlFWWE2HKMluAltv3p9x7FSGmfK74UHe84xGUxZMUJO2I3p1q1nkefTta3thSUUffhJVtWIfhr+WX4C4o9II3C43Jg2I3umdSvE2Ow0SCNjpEgt3xE3kPk7ssGQSlnSdIZ/a5FDrZZo6ZNLgQslz6OdShdti0Wb51nqNEZyjw1Z6aq4VzFuHHjFMR8pruUzikRQm+X83Mimdl8caso/ZIhLdSdwzEX4PHkpJEKsc3UVTVg6Sh0PZop5rxqjX6ADiIQSeEuca/vHHxSvtisENn7x+oyD9opCAv3oJixKdtDZpsg== 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=I4zmIWF1VEfiZFnDsG5urt00s1dOZma4jMG+tf8W3k4=; b=f1TR4mFvqxdQQAPd1YpALE2lQZ5OTP5KsSHB7kBIwO7IdwtuV/XoUO+c1a1lA265IIQU72ctC9irJejXvq9alFDqwOMYxqZ3NiSfSWjJNGIRnhtXJSp6jxj/GOdIJGdA0bT5wy7ghpDvFZx0wY4tMyE3Bc/d4hhtDWqTijglr1Y= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3791.namprd11.prod.outlook.com (20.178.254.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Tue, 17 Dec 2019 16:14:55 +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.2538.019; Tue, 17 Dec 2019 16:14:55 +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 19/55] staging: wfx: simplify variable assignment Thread-Topic: [PATCH v2 19/55] staging: wfx: simplify variable assignment Thread-Index: AQHVtPUezJkUHDulLEKXzdmJ3J5fhA== Date: Tue, 17 Dec 2019 16:14:55 +0000 Message-ID: <20191217161318.31402-20-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a46e1d4d-381f-4af0-0972-08d7830c4148 x-ms-traffictypediagnostic: MN2PR11MB3791: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:206; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(189003)(199004)(2906002)(52116002)(107886003)(2616005)(86362001)(478600001)(6486002)(4326008)(64756008)(66556008)(66476007)(81156014)(66946007)(6506007)(1076003)(316002)(66446008)(8936002)(71200400001)(81166006)(5660300002)(36756003)(26005)(186003)(8676002)(85202003)(4744005)(66574012)(85182001)(110136005)(54906003)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3791; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: wihv4HmF95XzUQwzVrXbcb2bQbIUrIYprEtSkGgmHYRh0+faNBVCaF9eaz5H+9YUpcv5d/iGXHmGeK8qttSYDpnvPj7eqb9dJkfRx6n7+UVNv1FPPWu3GBB6A6DXIAxrcmUH6fMIy9hVoYzAsl9DaWtfLskBI6wuz5sg3Gs1qryGsT0uMPy1ZVeiuiDrHO33+ezFgT8JZiAEG+rTNeS+48dz5WQUPDyCUfEPE5cQy+njHzRmmYynJZiqHEIpP0D1m5O7YjtOQ8Pu4Ay9y75j6DuAKZkD1Hft3JQdmS5wp3eJD/RmXsXvDsVwOTn2bzWp64nN7gmIN7RRMmVPTEA7B+m79BZ1y9TfneLGGBSgleI/3kBSe9Tar1dSJiQSe/kGQSX9mlUD2NEB1HeuBM0HR88gYI9QYcNuS42Fn/O1uZTJWL8+mtHMNZjmII2meGJh Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a46e1d4d-381f-4af0-0972-08d7830c4148 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:55.6829 (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: U1e5Z1PtEHJeV8p0rie4LcJU0eSkDFO5BJc2VlRtu8STQUYveUo0u7Zmua5+W+Nca4XZ8xxZ3wtHJrs9MloVnw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3791 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Attribute "aborted" and argument "aborted" are both booleans. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 35fcf9119f96..a6c93400a7ba 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -16,7 +16,7 @@ static void __ieee80211_scan_completed_compat(struct ieee80211_hw *hw, bool aborted) { struct cfg80211_scan_info info = { - .aborted = aborted ? 1 : 0, + .aborted = aborted, }; ieee80211_scan_completed(hw, &info); From patchwork Tue Dec 17 16:14:56 2019 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: 1211524 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="LZprxSUL"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjyg1LD0z9sRc for ; Wed, 18 Dec 2019 03:19:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728773AbfLQQPJ (ORCPT ); Tue, 17 Dec 2019 11:15:09 -0500 Received: from mail-eopbgr680046.outbound.protection.outlook.com ([40.107.68.46]:59543 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728743AbfLQQPH (ORCPT ); Tue, 17 Dec 2019 11:15:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QwNYF/bF5oDB5qaqo6aemRRlhWCospW5t/XsyrUCUL6LivIpbzOzgvr0TVy9GhQiqaRZEPzFph/JkFvnsMkQ6Ip06TD6EWfCixMQtChWzRWvpYwdfISTc+Z6nfOHBlljg+waxTKnhE0ZBUBVSCZ2ZYBYqyC/1Pf0/uJLJm9wFYxP8i3RDWDyKxh0hBXFCTaQgdo88bpmsvXbPyoxRe6UV7nzPcxodBoHAHYKkSU1s0yrCqecVJ+ZKt26QmUqXAULufXA5Ww8kjyUhkf3AtEX+CIHArNIK6h9a89DOPEhdNsL7GjV8+oL6scCfnRTECPRFKIN9gfcXyXOluCIy2Q9KQ== 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=+GTFV5SWac53s1xD0x1J89lUpDsz6huBwnt1RPa61zg=; b=dLL6Hw9KGuP2Ye1A/0LbH0qMC3P5PJUersOZWtztV0aFgg2YX6X1q4NmOC8KE94kQL0Kx3dqaEAIQlZvq8L9vM7Ky0GRguto71DD7mtEZlROhjV8sUVVGM1CccbpYndG9pLd7QvmaJhRgF1pqUyeeiRokcp3hFUT09FXU+g7t1LNIEG4f8IIH7AZO5kDbuzeo3L5HISP32jB+6xsshVNvDNJ0FkGi+VQIHkhTlESRBp6jYEIN4PuDAdMh6yBTtOsDGtCNRik/nICzI+ozvwVM7c5i1sbdiGxQP/55OsnhVg2cwi99sl7YcYHi5hVU36Qc+/Zqz8YkbZsYKKom/89zg== 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=+GTFV5SWac53s1xD0x1J89lUpDsz6huBwnt1RPa61zg=; b=LZprxSUL9GjvEbQPv5hp380zmIxQWE47uSeZ9Vlw+CjaS15htlH8HEbznoFWY/J7nVw6u3Wj6PBA+u3pkX/+1jcvT2AbQWDAxvui9b9oNjiaoUt8wrHhD245d6SB9qe0Ip/6i1xgbVZH7Ris3mzkp84Puu/aVkQHpKvDJ5TjVfM= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3791.namprd11.prod.outlook.com (20.178.254.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Tue, 17 Dec 2019 16:14:57 +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.2538.019; Tue, 17 Dec 2019 16:14:57 +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 20/55] staging: wfx: make conditions easier to read Thread-Topic: [PATCH v2 20/55] staging: wfx: make conditions easier to read Thread-Index: AQHVtPUftxWFpzusskSHUCZVHaED9g== Date: Tue, 17 Dec 2019 16:14:56 +0000 Message-ID: <20191217161318.31402-21-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6559ceaa-b93a-4a9c-adf6-08d7830c4216 x-ms-traffictypediagnostic: MN2PR11MB3791: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:376; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(189003)(199004)(2906002)(52116002)(107886003)(2616005)(86362001)(478600001)(6486002)(4326008)(64756008)(66556008)(66476007)(81156014)(66946007)(6506007)(1076003)(316002)(66446008)(8936002)(71200400001)(81166006)(5660300002)(36756003)(26005)(186003)(8676002)(85202003)(66574012)(85182001)(110136005)(54906003)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3791; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: dR4TK0TLOEnTC9pFYokQA2cyqyZexjdKpF3hL2bWU3mZw92uCYtLAKaUkYpNXqG1rXkCIS0boD9j/XmhEkjZNSTrudc5anqMdlJPKa8AMxH5pvZmIU+Kq8kfuiulmrZikKPyDmkFRuhfbs1LiNmmjF8ZW8u3B1cmPro8CrEIh76UVeXxsUBEbE2AfQHPfUEUlicMUVfC32YDAle17KzBMlMHAGlzhYLJnVI+PWPRFtmcRVcGTvZR9BlYt1YFqdoR+Rn76AkbnUPz7w4YmWPbWIq2prpxKIvjdKMK9NnOxFroAUHvZLDG5YI1ApWXxot9w8zO/8jYrqm6UtDrXWGIvKtPdurvV6zPhIIIIOs286b5t4UhtaZSD0YP10QCca3BiHP7qg6su/moS8GLltnPIY8Y5QW7cD96lPl3zwPfv+78r/UiXWOdhPZhW4LMjCsQ Content-ID: <79F9E7C7A4645F45BCD9BE37D25F2B13@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6559ceaa-b93a-4a9c-adf6-08d7830c4216 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:56.9842 (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: Hpw7gcpxV2c0/oG6ojV1Oep1ntQVkNdXm8WnfAtwMW7FDXhkmK0fTLTIuia2pMimpZIFTOhRWHo9OBVkuNbXEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3791 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller We prefer series of simple boolean conditions than computing bitmasks. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 471dd15b227f..7f4eaa8e6d84 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -1055,9 +1055,11 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, } } - if (changed & - (BSS_CHANGED_BEACON | BSS_CHANGED_AP_PROBE_RESP | - BSS_CHANGED_BSSID | BSS_CHANGED_SSID | BSS_CHANGED_IBSS)) { + if (changed & BSS_CHANGED_BEACON || + changed & BSS_CHANGED_AP_PROBE_RESP || + changed & BSS_CHANGED_BSSID || + changed & BSS_CHANGED_SSID || + changed & BSS_CHANGED_IBSS) { wvif->beacon_int = info->beacon_int; wfx_update_beaconing(wvif); wfx_upload_beacon(wvif); @@ -1095,10 +1097,11 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_BSSID) do_join = true; - if (changed & - (BSS_CHANGED_ASSOC | BSS_CHANGED_BSSID | - BSS_CHANGED_IBSS | BSS_CHANGED_BASIC_RATES | - BSS_CHANGED_HT)) { + if (changed & BSS_CHANGED_ASSOC || + changed & BSS_CHANGED_BSSID || + changed & BSS_CHANGED_IBSS || + changed & BSS_CHANGED_BASIC_RATES || + changed & BSS_CHANGED_HT) { if (info->assoc) { if (wvif->state < WFX_STATE_PRE_STA) { ieee80211_connection_loss(vif); @@ -1120,9 +1123,9 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, } /* ERP Protection */ - if (changed & (BSS_CHANGED_ASSOC | - BSS_CHANGED_ERP_CTS_PROT | - BSS_CHANGED_ERP_PREAMBLE)) { + if (changed & BSS_CHANGED_ASSOC || + changed & BSS_CHANGED_ERP_CTS_PROT || + changed & BSS_CHANGED_ERP_PREAMBLE) { u32 prev_erp_info = wvif->erp_info; if (info->use_cts_prot) @@ -1139,10 +1142,10 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, schedule_work(&wvif->set_cts_work); } - if (changed & (BSS_CHANGED_ASSOC | BSS_CHANGED_ERP_SLOT)) + if (changed & BSS_CHANGED_ASSOC || changed & BSS_CHANGED_ERP_SLOT) hif_slot_time(wvif, info->use_short_slot ? 9 : 20); - if (changed & (BSS_CHANGED_ASSOC | BSS_CHANGED_CQM)) { + if (changed & BSS_CHANGED_ASSOC || changed & BSS_CHANGED_CQM) { struct hif_mib_rcpi_rssi_threshold th = { .rolling_average_count = 8, .detection = 1, From patchwork Tue Dec 17 16:14:58 2019 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: 1211489 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Q2i1TBFM"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjsS2PYYz9sSR for ; Wed, 18 Dec 2019 03:15:08 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728745AbfLQQPG (ORCPT ); Tue, 17 Dec 2019 11:15:06 -0500 Received: from mail-eopbgr770080.outbound.protection.outlook.com ([40.107.77.80]:48866 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728695AbfLQQPD (ORCPT ); Tue, 17 Dec 2019 11:15:03 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iwX54tfGoUP28z9wz2srqKvpV/SowmBsZr7OF5crVPBzUYAeNlEuf4Wlyy5MPjcrN/i41rYR4CNXn4VbEKoTXwtwxgZh96TXWlgT5qFp6es5XYNtnvcbB7zf5i/VbQCgRqhJi38Ym49eCOZWIazI/xF+/13CuVIpdAyKw+ixFiXA3ja0IUNM/E9ksZrbEXWZ7PJMiuH5zGcLRwcEs9I5BjAXHv+fGKeEMIQF3bl02UsjkHxQ9ykyzo4lPK/pDXY6nE/sX69Y5k6pjJyEJjjzL0uDu9FITA/1jlS5sQOQ6x7X32F/BpFJWY9MXMWRufGU5a4oAn1j7Ne3eUSLgq/2yA== 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=GLJulXtZXLF4hTJYoJHr3dn0XVZLmzPWYVzhDxmGKF8=; b=lX4Uvgq61UMahcOdkYUEqEbc5S2Jt0jpOXVcdb53adzBOW6AVzJAq10nc1/EGqqaHGE8BfXIHPe3oM7XePaKhtr/bmLvfnbHhZYNFfiVThWMXcIHJ7xU06pr3MVBs3Gr73hDJRvWhqTv9i9cLKt4ZHNvzStyOrhRsWhVriPHqL3BaC9I+RGlEuq9uLPUsHthAH1sbxyPmZB8q0u/qvE9UFD9ZeslmSLToHPBo1oM30SFhJAkxdOdHGGSl0AmF8T6ic2EF9cVTMwmp0myTvqxYuDaZPjs+HYr/ZRxx9/eynD0giPvymnuNN8kMbUE9GdKRj0a20Gc5LfOR3SJCvYXYQ== 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=GLJulXtZXLF4hTJYoJHr3dn0XVZLmzPWYVzhDxmGKF8=; b=Q2i1TBFM9878BqaQb0QFVcdZcq7i52hSxcJEgIL+S8QGrFhaLWGB3W8A/blS3PSW3RcUY9Z8rykjcB4+cMyFbo7a2M9Va7AoPJFDXS46tGLORuIO2UhS43YUxGDLgKaG40/nqrTDF8AbpT9opo7DfX0mHkg+mRdvvV4llOFz/ak= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3678.namprd11.prod.outlook.com (20.178.254.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Tue, 17 Dec 2019 16:14:58 +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.2538.019; Tue, 17 Dec 2019 16:14:58 +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 21/55] staging: wfx: ensure that traces never modify arguments Thread-Topic: [PATCH v2 21/55] staging: wfx: ensure that traces never modify arguments Thread-Index: AQHVtPUgW+Ohf8j0AUOqHXo5Q0PSqA== Date: Tue, 17 Dec 2019 16:14:58 +0000 Message-ID: <20191217161318.31402-22-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 31a79391-3971-48af-3d4b-08d7830c42dd x-ms-traffictypediagnostic: MN2PR11MB3678: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(366004)(39860400002)(136003)(199004)(189003)(6512007)(1076003)(478600001)(86362001)(8936002)(110136005)(316002)(2616005)(26005)(6506007)(5660300002)(36756003)(6486002)(66946007)(66476007)(66556008)(64756008)(66446008)(71200400001)(52116002)(85182001)(81166006)(81156014)(8676002)(54906003)(107886003)(2906002)(4326008)(186003)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3678; 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: syhr7gArjFoiKMoAeKI75YtTkyylzuTpie965gXNhsbDjuP5S7C+YxILLgaRJlI+iGvECI+NYGclsHEDMxVfpb6jiet2cD/fSOqWnuJmkpr2cy3K+OglOPlAiryiXYcyLieMXipnoeHN0Hd3iMiXY9hRxxwKy6oJgZ6im+fjnJLzQzTGXR2pYjiZ/LsvWev81lcifyy0XyXswiCVUL6V77jNWYGY5h1v82Dk/WAN1KiJ15qeFhKNeSGiIPOb44thAUWn+7gFostAArWKnQSJXZ8KPvgpmKmKjjC735K8emvAYZ+tx1YAijbdBN29Db7z5xetn05nH2AE6Qsa24UcnnrZ3KfCPUsRvhQ/FMJaPyIeYM98UKZKg6gelBBfJGMJapZUoi7gtqsd3TILt3V3vue4PkCuB23wnNuZPU8PvGjC/v2xuUZyRbVNh47ANi5V Content-ID: <99293B299756D34A9B41BBF6897BB063@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 31a79391-3971-48af-3d4b-08d7830c42dd X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:58.2365 (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: sA1Qy3+d9EPZYBwqGpJnnofL/tPTkGnLmg3sgdojuQUFGnmCID4HKXfcHG5Ijymdsr11+W+VV2LH3DbRzafaAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3678 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller There is no reason for a trace to change any bit of the argument. So, let's make sure that is the case by declaring the arguments constant. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/traces.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wfx/traces.h b/drivers/staging/wfx/traces.h index 3f6198ab2235..30c6a13f0e22 100644 --- a/drivers/staging/wfx/traces.h +++ b/drivers/staging/wfx/traces.h @@ -153,7 +153,7 @@ hif_mib_list_enum #define hif_mib_list hif_mib_list_enum { -1, NULL } DECLARE_EVENT_CLASS(hif_data, - TP_PROTO(struct hif_msg *hif, int tx_fill_level, bool is_recv), + TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv), TP_ARGS(hif, tx_fill_level, is_recv), TP_STRUCT__entry( __field(int, tx_fill_level) @@ -203,12 +203,12 @@ DECLARE_EVENT_CLASS(hif_data, ) ); DEFINE_EVENT(hif_data, hif_send, - TP_PROTO(struct hif_msg *hif, int tx_fill_level, bool is_recv), + TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv), TP_ARGS(hif, tx_fill_level, is_recv)); #define _trace_hif_send(hif, tx_fill_level)\ trace_hif_send(hif, tx_fill_level, false) DEFINE_EVENT(hif_data, hif_recv, - TP_PROTO(struct hif_msg *hif, int tx_fill_level, bool is_recv), + TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv), TP_ARGS(hif, tx_fill_level, is_recv)); #define _trace_hif_recv(hif, tx_fill_level)\ trace_hif_recv(hif, tx_fill_level, true) @@ -359,7 +359,8 @@ TRACE_EVENT(bh_stats, trace_bh_stats(ind, req, cnf, busy, release) TRACE_EVENT(tx_stats, - TP_PROTO(struct hif_cnf_tx *tx_cnf, struct sk_buff *skb, int delay), + TP_PROTO(const struct hif_cnf_tx *tx_cnf, const struct sk_buff *skb, + int delay), TP_ARGS(tx_cnf, skb, delay), TP_STRUCT__entry( __field(int, pkt_id) @@ -375,8 +376,9 @@ TRACE_EVENT(tx_stats, // Keep sync with wfx_rates definition in main.c static const int hw_rate[] = { 0, 1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13 }; - struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); - struct ieee80211_tx_rate *rates = tx_info->driver_rates; + const struct ieee80211_tx_info *tx_info = + (const struct ieee80211_tx_info *)skb->cb; + const struct ieee80211_tx_rate *rates = tx_info->driver_rates; int i; __entry->pkt_id = tx_cnf->packet_id; From patchwork Tue Dec 17 16:14:59 2019 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: 1211522 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="C03kAHLB"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjyT50Bjz9sNH for ; Wed, 18 Dec 2019 03:19:29 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728794AbfLQQPK (ORCPT ); Tue, 17 Dec 2019 11:15:10 -0500 Received: from mail-bn8nam11on2073.outbound.protection.outlook.com ([40.107.236.73]:39265 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728718AbfLQQPH (ORCPT ); Tue, 17 Dec 2019 11:15:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dYqVKNUYYgQWNPojGyW6Wmg+pwV7Er25sI6o+KZ42aBH7dWnG269sGOJpcEb2dx9/FysA5vkamLrWx9UY9c6jRa9JA47enbzsWqcYetZWwkBzbc3q1oPVe1UZ5bCDwlcEikOrA5O6qaOnrIghvMn4FTr9J65TUx5Uaqw9iUOMXiC7rpQrvwQUj4aBs7WsILdwmoKro25hhPGhk9jWFL/T2v07v+E5ha4Yc5wN/vnRqrjPI8UWIQNzREfB6HWsyMbBIJrSblU3xwoCVmQS4a3QwVmUC9G7arkQByR/DcoMJpUgC3aGAZU84O7gDRSzpUQba4+IdwS4RW/Pluow5SvBA== 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=RFeO5NsyAkZGTCN6PuOM7BmGUjPAqGJZtSFoWSYkslU=; b=eZMD26rru+SOFvuNFhDbVOKX5SfB5f83XRIxfVbUvucr/olzYOQX2i6D/6LFtf3HdccUyl4XYkdDMakNR6HJYx0gM7Z2qZXKL/r7UUL9pHc7WFrtu1mt4cHyr2S+BiQlEjcko1o9OgTkU5iYDDw9pvgGxncZfYz2gn3ds9LO5XWNkHWjtZBrFHdhD/EgCM1mRfoj6HCp8Q0y9Y6je0HWrayZ73BLLqzkHqjb94wEtRNUiMut54hMLphEj8y1MaQ3Zhvl0VmheEYW1VWjflbhxPGj8Dl8nzkDZweqvaw9cgEBMn1iRShxR+Gnhv2w3kycIJ5JFZsJQ0pp22mLXYTV9Q== 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=RFeO5NsyAkZGTCN6PuOM7BmGUjPAqGJZtSFoWSYkslU=; b=C03kAHLBZjH42J0rKtMStRzpU8gPcK0wMdpeuF5kMomSklgilAy+v4ZtjIR25qv0iJTMLjZhtYJ0fOMS6RPrS2NjVnFqBW3RngiEGaxUwQXB/6NyOrxM7u0+wGmId903T/Wje3evo8kBzbapotYVG4NrIHP4CLWMbhGgLhqNktQ= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:14:59 +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.2538.019; Tue, 17 Dec 2019 16:14:59 +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 22/55] staging: wfx: ensure that received hif messages are never modified Thread-Topic: [PATCH v2 22/55] staging: wfx: ensure that received hif messages are never modified Thread-Index: AQHVtPUhkZeRFXFsYE2DspeYg3LT4w== Date: Tue, 17 Dec 2019 16:14:59 +0000 Message-ID: <20191217161318.31402-23-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d09a0683-48ad-4695-906b-08d7830c439b x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(15650500001)(52116002)(6512007)(30864003)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: Rq7yx8xi1r2ltHF+mFuiP4ebgdWXC1cW85pS1O4CmI/xbPqnkBAbAivVqlyniihBCkQWFGwYDkza0KwvXOCPzQlGPuJ1KLb/3j9NnV79fTEIFMY4PAK3e8LJX3Je+VbFZJfWl0WAQOH8A2pEFnoUNVODXp0Jz4p3JElEexbUCzlnOtY67q5pvl3IvFufeXdBsuC5RNUu7jCh9BjiN9pWsl3Aw4ps57o+hEi2/cKxwqNoYmxV7RkD5K4XCVoh8cehcmxCtE+zWKxIg/UM+A4s42Kz3/3FpXFXqy6hPi/nF9p7Ua5WXaZLRA6s2slaM6fZNeAq2wX8tcMKtYQeubA7EBKMWfbLM4H5GNKTnNNriqOK31B5ehPSZDP9LvDKNPcg5yJAww96y6TNqJfn7eK9ygt45x+aQC0QaForQBsq1xdfupnKim8rLggYV8TenqdU Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: d09a0683-48ad-4695-906b-08d7830c439b X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:59.5088 (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: FGPFFJwUcItTQqE4E4tPaJhABQKFQFwRYBIO4Avek4s2oJCcuqbTxkeGUONXcCf454W3AC0hm0Yu9bbfq8ZiTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller There are no real reason to modify the data received from device. So, let's mark the arguments constant. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.c | 8 ++- drivers/staging/wfx/data_rx.h | 4 +- drivers/staging/wfx/data_tx.c | 2 +- drivers/staging/wfx/data_tx.h | 2 +- drivers/staging/wfx/hif_rx.c | 94 +++++++++++++++++-------------- drivers/staging/wfx/scan.c | 3 +- drivers/staging/wfx/scan.h | 3 +- drivers/staging/wfx/secure_link.h | 8 ++- drivers/staging/wfx/sta.c | 2 +- drivers/staging/wfx/sta.h | 2 +- 10 files changed, 72 insertions(+), 56 deletions(-) diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c index e7fcce8d0cc4..d460c0ffca1f 100644 --- a/drivers/staging/wfx/data_rx.c +++ b/drivers/staging/wfx/data_rx.c @@ -48,7 +48,9 @@ static int wfx_handle_pspoll(struct wfx_vif *wvif, struct sk_buff *skb) return 0; } -static int wfx_drop_encrypt_data(struct wfx_dev *wdev, struct hif_ind_rx *arg, struct sk_buff *skb) +static int wfx_drop_encrypt_data(struct wfx_dev *wdev, + const struct hif_ind_rx *arg, + struct sk_buff *skb) { struct ieee80211_hdr *frame = (struct ieee80211_hdr *) skb->data; size_t hdrlen = ieee80211_hdrlen(frame->frame_control); @@ -98,8 +100,8 @@ static int wfx_drop_encrypt_data(struct wfx_dev *wdev, struct hif_ind_rx *arg, s } -void wfx_rx_cb(struct wfx_vif *wvif, struct hif_ind_rx *arg, - struct sk_buff *skb) +void wfx_rx_cb(struct wfx_vif *wvif, + const struct hif_ind_rx *arg, struct sk_buff *skb) { int link_id = arg->rx_flags.peer_sta_id; struct ieee80211_rx_status *hdr = IEEE80211_SKB_RXCB(skb); diff --git a/drivers/staging/wfx/data_rx.h b/drivers/staging/wfx/data_rx.h index a50ce352bc5e..61c28bfd2a37 100644 --- a/drivers/staging/wfx/data_rx.h +++ b/drivers/staging/wfx/data_rx.h @@ -13,7 +13,7 @@ struct wfx_vif; struct sk_buff; -void wfx_rx_cb(struct wfx_vif *wvif, struct hif_ind_rx *arg, - struct sk_buff *skb); +void wfx_rx_cb(struct wfx_vif *wvif, + const struct hif_ind_rx *arg, struct sk_buff *skb); #endif /* WFX_DATA_RX_H */ diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index c9dea627661f..a45243a7f15f 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -720,7 +720,7 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, ieee80211_tx_status_irqsafe(wdev->hw, skb); } -void wfx_tx_confirm_cb(struct wfx_vif *wvif, struct hif_cnf_tx *arg) +void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) { int i; int tx_count; diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index 0fc388db62e0..078d0cfc521a 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -65,7 +65,7 @@ void wfx_tx_policy_upload_work(struct work_struct *work); void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb); -void wfx_tx_confirm_cb(struct wfx_vif *wvif, struct hif_cnf_tx *arg); +void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg); void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb); int wfx_unmap_link(struct wfx_vif *wvif, int link_id); diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 1494ad5a507b..8a3ccdc60b7d 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -18,8 +18,8 @@ #include "secure_link.h" #include "hif_api_cmd.h" -static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, - void *buf) +static int hif_generic_confirm(struct wfx_dev *wdev, + const struct hif_msg *hif, const void *buf) { // All confirm messages start with status int status = le32_to_cpu(*((__le32 *) buf)); @@ -59,9 +59,10 @@ static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, return status; } -static int hif_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_tx_confirm(struct wfx_dev *wdev, + const struct hif_msg *hif, const void *buf) { - struct hif_cnf_tx *body = buf; + const struct hif_cnf_tx *body = buf; struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); WARN_ON(!wvif); @@ -72,11 +73,12 @@ static int hif_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) return 0; } -static int hif_multi_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, - void *buf) +static int hif_multi_tx_confirm(struct wfx_dev *wdev, + const struct hif_msg *hif, const void *buf) { - struct hif_cnf_multi_transmit *body = buf; - struct hif_cnf_tx *buf_loc = (struct hif_cnf_tx *) &body->tx_conf_payload; + const struct hif_cnf_multi_transmit *body = buf; + const struct hif_cnf_tx *buf_loc = + (const struct hif_cnf_tx *)&body->tx_conf_payload; struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); int count = body->num_tx_confs; int i; @@ -93,10 +95,10 @@ static int hif_multi_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, return 0; } -static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif, - void *buf) +static int hif_startup_indication(struct wfx_dev *wdev, + const struct hif_msg *hif, const void *buf) { - struct hif_ind_startup *body = buf; + const struct hif_ind_startup *body = buf; if (body->status || body->firmware_type > 4) { dev_err(wdev->dev, "received invalid startup indication"); @@ -112,8 +114,8 @@ static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif, return 0; } -static int hif_wakeup_indication(struct wfx_dev *wdev, struct hif_msg *hif, - void *buf) +static int hif_wakeup_indication(struct wfx_dev *wdev, + const struct hif_msg *hif, const void *buf) { if (!wdev->pdata.gpio_wakeup || !gpiod_get_value(wdev->pdata.gpio_wakeup)) { @@ -123,25 +125,27 @@ static int hif_wakeup_indication(struct wfx_dev *wdev, struct hif_msg *hif, return 0; } -static int hif_keys_indication(struct wfx_dev *wdev, struct hif_msg *hif, - void *buf) +static int hif_keys_indication(struct wfx_dev *wdev, + const struct hif_msg *hif, const void *buf) { - struct hif_ind_sl_exchange_pub_keys *body = buf; + const struct hif_ind_sl_exchange_pub_keys *body = buf; + u8 pubkey[API_NCP_PUB_KEY_SIZE]; - // Compatibility with legacy secure link - if (body->status == SL_PUB_KEY_EXCHANGE_STATUS_SUCCESS) - body->status = 0; - if (body->status) + // SL_PUB_KEY_EXCHANGE_STATUS_SUCCESS is used by legacy secure link + if (body->status && body->status != SL_PUB_KEY_EXCHANGE_STATUS_SUCCESS) dev_warn(wdev->dev, "secure link negociation error\n"); - wfx_sl_check_pubkey(wdev, body->ncp_pub_key, body->ncp_pub_key_mac); + memcpy(pubkey, body->ncp_pub_key, sizeof(pubkey)); + memreverse(pubkey, sizeof(pubkey)); + wfx_sl_check_pubkey(wdev, pubkey, body->ncp_pub_key_mac); return 0; } -static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif, - void *buf, struct sk_buff *skb) +static int hif_receive_indication(struct wfx_dev *wdev, + const struct hif_msg *hif, + const void *buf, struct sk_buff *skb) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); - struct hif_ind_rx *body = buf; + const struct hif_ind_rx *body = buf; if (!wvif) { dev_warn(wdev->dev, "ignore rx data for non-existent vif %d\n", @@ -154,11 +158,11 @@ static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif, return 0; } -static int hif_event_indication(struct wfx_dev *wdev, struct hif_msg *hif, - void *buf) +static int hif_event_indication(struct wfx_dev *wdev, + const struct hif_msg *hif, const void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); - struct hif_ind_event *body = buf; + const struct hif_ind_event *body = buf; struct wfx_hif_event *event; int first; @@ -183,7 +187,8 @@ static int hif_event_indication(struct wfx_dev *wdev, struct hif_msg *hif, } static int hif_pm_mode_complete_indication(struct wfx_dev *wdev, - struct hif_msg *hif, void *buf) + const struct hif_msg *hif, + const void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); @@ -194,10 +199,11 @@ static int hif_pm_mode_complete_indication(struct wfx_dev *wdev, } static int hif_scan_complete_indication(struct wfx_dev *wdev, - struct hif_msg *hif, void *buf) + const struct hif_msg *hif, + const void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); - struct hif_ind_scan_cmpl *body = buf; + const struct hif_ind_scan_cmpl *body = buf; WARN_ON(!wvif); wfx_scan_complete_cb(wvif, body); @@ -206,7 +212,8 @@ static int hif_scan_complete_indication(struct wfx_dev *wdev, } static int hif_join_complete_indication(struct wfx_dev *wdev, - struct hif_msg *hif, void *buf) + const struct hif_msg *hif, + const void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); @@ -217,10 +224,11 @@ static int hif_join_complete_indication(struct wfx_dev *wdev, } static int hif_suspend_resume_indication(struct wfx_dev *wdev, - struct hif_msg *hif, void *buf) + const struct hif_msg *hif, + const void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); - struct hif_ind_suspend_resume_tx *body = buf; + const struct hif_ind_suspend_resume_tx *body = buf; WARN_ON(!wvif); wfx_suspend_resume(wvif, body); @@ -228,10 +236,10 @@ static int hif_suspend_resume_indication(struct wfx_dev *wdev, return 0; } -static int hif_error_indication(struct wfx_dev *wdev, struct hif_msg *hif, - void *buf) +static int hif_error_indication(struct wfx_dev *wdev, + const struct hif_msg *hif, const void *buf) { - struct hif_ind_error *body = buf; + const struct hif_ind_error *body = buf; u8 *pRollback = (u8 *) body->data; u32 *pStatus = (u32 *) body->data; @@ -268,10 +276,10 @@ static int hif_error_indication(struct wfx_dev *wdev, struct hif_msg *hif, return 0; } -static int hif_generic_indication(struct wfx_dev *wdev, struct hif_msg *hif, - void *buf) +static int hif_generic_indication(struct wfx_dev *wdev, + const struct hif_msg *hif, const void *buf) { - struct hif_ind_generic *body = buf; + const struct hif_ind_generic *body = buf; switch (body->indication_type) { case HIF_GENERIC_INDICATION_TYPE_RAW: @@ -299,9 +307,10 @@ static int hif_generic_indication(struct wfx_dev *wdev, struct hif_msg *hif, } static int hif_exception_indication(struct wfx_dev *wdev, - struct hif_msg *hif, void *buf) + const struct hif_msg *hif, const void *buf) { size_t len = hif->len - 4; // drop header + dev_err(wdev->dev, "firmware exception\n"); print_hex_dump_bytes("Dump: ", DUMP_PREFIX_NONE, buf, len); wdev->chip_frozen = 1; @@ -311,7 +320,8 @@ static int hif_exception_indication(struct wfx_dev *wdev, static const struct { int msg_id; - int (*handler)(struct wfx_dev *wdev, struct hif_msg *hif, void *buf); + int (*handler)(struct wfx_dev *wdev, + const struct hif_msg *hif, const void *buf); } hif_handlers[] = { /* Confirmations */ { HIF_CNF_ID_TX, hif_tx_confirm }, @@ -335,7 +345,7 @@ static const struct { void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb) { int i; - struct hif_msg *hif = (struct hif_msg *) skb->data; + const struct hif_msg *hif = (const struct hif_msg *)skb->data; int hif_id = hif->id; if (hif_id == HIF_IND_ID_RX) { diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index a6c93400a7ba..45e78c5722ff 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -267,7 +267,8 @@ void wfx_scan_failed_cb(struct wfx_vif *wvif) } } -void wfx_scan_complete_cb(struct wfx_vif *wvif, struct hif_ind_scan_cmpl *arg) +void wfx_scan_complete_cb(struct wfx_vif *wvif, + const struct hif_ind_scan_cmpl *arg) { if (cancel_delayed_work_sync(&wvif->scan.timeout) > 0) { wvif->scan.status = 1; diff --git a/drivers/staging/wfx/scan.h b/drivers/staging/wfx/scan.h index b4ddd0771a9b..c7c0ab178c87 100644 --- a/drivers/staging/wfx/scan.h +++ b/drivers/staging/wfx/scan.h @@ -36,7 +36,8 @@ int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_scan_request *req); void wfx_scan_work(struct work_struct *work); void wfx_scan_timeout(struct work_struct *work); -void wfx_scan_complete_cb(struct wfx_vif *wvif, struct hif_ind_scan_cmpl *arg); +void wfx_scan_complete_cb(struct wfx_vif *wvif, + const struct hif_ind_scan_cmpl *arg); void wfx_scan_failed_cb(struct wfx_vif *wvif); #endif /* WFX_SCAN_H */ diff --git a/drivers/staging/wfx/secure_link.h b/drivers/staging/wfx/secure_link.h index 666b26e5308d..c3d055b2f8b1 100644 --- a/drivers/staging/wfx/secure_link.h +++ b/drivers/staging/wfx/secure_link.h @@ -25,14 +25,16 @@ static inline int wfx_sl_decode(struct wfx_dev *wdev, struct hif_sl_msg *m) return -EIO; } -static inline int wfx_sl_encode(struct wfx_dev *wdev, struct hif_msg *input, +static inline int wfx_sl_encode(struct wfx_dev *wdev, + const struct hif_msg *input, struct hif_sl_msg *output) { return -EIO; } -static inline int wfx_sl_check_pubkey(struct wfx_dev *wdev, u8 *ncp_pubkey, - u8 *ncp_pubmac) +static inline int wfx_sl_check_pubkey(struct wfx_dev *wdev, + const u8 *ncp_pubkey, + const u8 *ncp_pubmac) { return -EIO; } diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 7f4eaa8e6d84..b4bb5b653e64 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -1345,7 +1345,7 @@ int wfx_ampdu_action(struct ieee80211_hw *hw, } void wfx_suspend_resume(struct wfx_vif *wvif, - struct hif_ind_suspend_resume_tx *arg) + const struct hif_ind_suspend_resume_tx *arg) { if (arg->suspend_resume_flags.bc_mc_only) { bool cancel_tmo = false; diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index 4ccf1b17632b..721b7cee9c10 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -92,7 +92,7 @@ void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, // WSM Callbacks void wfx_suspend_resume(struct wfx_vif *wvif, - struct hif_ind_suspend_resume_tx *arg); + const struct hif_ind_suspend_resume_tx *arg); // Other Helpers void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad); From patchwork Tue Dec 17 16:15:00 2019 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: 1211525 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="b9IZ2uHo"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjym4DLFz9sNH for ; Wed, 18 Dec 2019 03:19:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729341AbfLQQTk (ORCPT ); Tue, 17 Dec 2019 11:19:40 -0500 Received: from mail-bn7nam10on2056.outbound.protection.outlook.com ([40.107.92.56]:15713 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728759AbfLQQPJ (ORCPT ); Tue, 17 Dec 2019 11:15:09 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M7LRk8W/M4fmWwCjqyS1EP18y03zqreH0HASNo/Hmu8RDYTLgAMyPn4MTOIfuTuGsYi31mKzqMRBDv3LbHCQbOXggUltXGbqU+HXFk/4sswTOCO7BWGvR01bdhjcRRZe3wWq2s9pJkg4bYiFsXmWHucoTN6r/VHPB8v753Wah6xYi8PIPCs1O2wCzkxeeAelBVZBBt1sWBzfMGzCmk7LWPhTOCt+h8CtaVZr4Y2PQcuwpPLfNiEhsXSjvPtLiet0PGMMHWTXa9EP1L6Z/fY7/UM+IWlPN/htcfTJY07WUS/5XOplUFaahK6YmUv3djKzEZVSGUKmVD6sWfILOka57A== 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=Oa3K0+KcAZHPdI+ay+5/VdEt2ZmkPyQAY8/yohGyoSc=; b=Gu37BTIWXYHJQ8pDk0qtNJtPfHb4hV2yN5GGzL8qEfb11A5dMY14eoDvQa0CYs7Wx4Pqs7/VsilotzMRoPy00HbNoekTQx9X5mh8hJtaEuAmM74mdpbw7xy25JKUAYvAyps4fDkH7siqE8xc3b54N7u5vPSNFiEvdK0eNY44SHBHfLwIaDEr6g29S7esFOEhtae3W4ICl4cCOb3Pe2LSk4jHlrLoIR9pQ8ne0ivGk5Efi5dYmom8ty3EUjBdbJ6STfGuV0LuKQ5yDDDXdm75u5ZkSvBhyioOjXaC3LnA2fe6gg0mjNZ9v1BrFdS/a4YJr+0CXUULfpcuacIb7QJ8GQ== 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=Oa3K0+KcAZHPdI+ay+5/VdEt2ZmkPyQAY8/yohGyoSc=; b=b9IZ2uHoWngk0FoUHLGQQ6I00FX5UBP2KQdDWszQAvaahUhVtE/Ft48toOL8LSk5K5kr/BJGwUYa8+MZ62wO3ZO4a1OOowk5HhkaT6bxNhQFglmC3RZ36e6UhlTaigC54lhuafrBJ235M8ZoCc/bTE92nRFMjlU0KalG+ctB1Xg= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:00 +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.2538.019; Tue, 17 Dec 2019 16:15:00 +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 23/55] staging: wfx: fix typo in "num_of_ssi_ds" Thread-Topic: [PATCH v2 23/55] staging: wfx: fix typo in "num_of_ssi_ds" Thread-Index: AQHVtPUh240qq8pZ3EWniO+vtyJKrg== Date: Tue, 17 Dec 2019 16:15:00 +0000 Message-ID: <20191217161318.31402-24-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 39501991-a0ca-4a45-424a-08d7830c4464 x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2512; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(4326008)(8676002)(86362001)(6486002)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: 0FMM12lLEnFzcCLcDC8YqfDQgLsnPFr4FbuPUS2O/AiM0MEtFFlhNbdZDHfNpjCdbtIaGeY81iLsmcGc5oKWYKG6z2hgcPuQBXN+DP5SdsbMhE1N0aH+EN2C3NorrhiHdxCQjLzGqmZWsus5gaMHYCqRso2LCxsjqMbKju911/6AjqvnDuJePRka1d4Q4uQQXO8E2hZFXbEfQzcnGHngdjxUdScKq+1qz9kp452vtc42vaZcjg3pc4aN1+a7FL6UCfPpSdsFVIQeOnVcj5ohajo2JCUMsLv4Ne70Mz/6r5D/viMuoyaBkLp/yPRVL0AlixmKQud7j4W8SBeOG7wwyY/hCu6PRr0yWRV6Sscva6JT7hnSiPZFgHp89j6a07NOFT8djvNERYWkTms+g16ro+wcUbfS4MtYYCBE7ZObqGxgvK0x69/ZiwKM2clFxqO0 Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39501991-a0ca-4a45-424a-08d7830c4464 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:00.7811 (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: +lSuPib34f7tX4vZbCheyhvrd8XHSBC+L0JmrCXwh+iypOkTNJ+eoL9VYN9IYWr37HuFBvT9Zodwn4/VRXOywg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The script that has imported API headers has made a mistake in "num_of_ssi_ds". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 4 ++-- drivers/staging/wfx/hif_tx.c | 10 +++++----- drivers/staging/wfx/scan.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index c15831de4ff4..90ba6e9b82ea 100644 --- a/drivers/staging/wfx/hif_api_cmd.h +++ b/drivers/staging/wfx/hif_api_cmd.h @@ -180,7 +180,7 @@ struct hif_req_start_scan { struct hif_auto_scan_param auto_scan_param; u8 num_of_probe_requests; u8 probe_delay; - u8 num_of_ssi_ds; + u8 num_of_ssids; u8 num_of_channels; u32 min_channel_time; u32 max_channel_time; @@ -196,7 +196,7 @@ struct hif_start_scan_req_cstnbssid_body { struct hif_auto_scan_param auto_scan_param; u8 num_of_probe_requests; u8 probe_delay; - u8 num_of_ssi_ds; + u8 num_of_ssids; u8 num_of_channels; u32 min_channel_time; u32 max_channel_time; diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index e8c2bd1efbac..2f74abca2b60 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -227,12 +227,12 @@ int hif_scan(struct wfx_vif *wvif, const struct wfx_scan_params *arg) struct hif_ssid_def *ssids; size_t buf_len = sizeof(struct hif_req_start_scan) + arg->scan_req.num_of_channels * sizeof(u8) + - arg->scan_req.num_of_ssi_ds * sizeof(struct hif_ssid_def); + arg->scan_req.num_of_ssids * sizeof(struct hif_ssid_def); struct hif_req_start_scan *body = wfx_alloc_hif(buf_len, &hif); u8 *ptr = (u8 *) body + sizeof(*body); WARN(arg->scan_req.num_of_channels > HIF_API_MAX_NB_CHANNELS, "invalid params"); - WARN(arg->scan_req.num_of_ssi_ds > 2, "invalid params"); + WARN(arg->scan_req.num_of_ssids > 2, "invalid params"); WARN(arg->scan_req.band > 1, "invalid params"); // FIXME: This API is unnecessary complex, fixing NumOfChannels and @@ -243,11 +243,11 @@ int hif_scan(struct wfx_vif *wvif, const struct wfx_scan_params *arg) cpu_to_le32s(&body->max_channel_time); cpu_to_le32s(&body->tx_power_level); memcpy(ptr, arg->ssids, - arg->scan_req.num_of_ssi_ds * sizeof(struct hif_ssid_def)); + arg->scan_req.num_of_ssids * sizeof(struct hif_ssid_def)); ssids = (struct hif_ssid_def *) ptr; - for (i = 0; i < body->num_of_ssi_ds; ++i) + for (i = 0; i < body->num_of_ssids; ++i) cpu_to_le32s(&ssids[i].ssid_length); - ptr += arg->scan_req.num_of_ssi_ds * sizeof(struct hif_ssid_def); + ptr += arg->scan_req.num_of_ssids * sizeof(struct hif_ssid_def); memcpy(ptr, arg->ch, arg->scan_req.num_of_channels * sizeof(u8)); ptr += arg->scan_req.num_of_channels * sizeof(u8); WARN(buf_len != ptr - (u8 *) body, "allocation size mismatch"); diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 45e78c5722ff..cb7a1fdd0001 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -204,7 +204,7 @@ void wfx_scan_work(struct work_struct *work) scan.scan_req.max_transmit_rate = API_RATE_INDEX_B_1MBPS; scan.scan_req.num_of_probe_requests = (first->flags & IEEE80211_CHAN_NO_IR) ? 0 : 2; - scan.scan_req.num_of_ssi_ds = wvif->scan.n_ssids; + scan.scan_req.num_of_ssids = wvif->scan.n_ssids; scan.ssids = &wvif->scan.ssids[0]; scan.scan_req.num_of_channels = it - wvif->scan.curr; scan.scan_req.probe_delay = 100; From patchwork Tue Dec 17 16:15:01 2019 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: 1211523 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Yg6v0p7H"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjyc2ywZz9sRc for ; Wed, 18 Dec 2019 03:19:36 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729174AbfLQQTb (ORCPT ); Tue, 17 Dec 2019 11:19:31 -0500 Received: from mail-bn8nam11on2073.outbound.protection.outlook.com ([40.107.236.73]:39265 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728695AbfLQQPJ (ORCPT ); Tue, 17 Dec 2019 11:15:09 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZXFvK7l2FwGD2f80+usBtIGhYnahJWQ47r54yCvtlPedq+qd5+zycJVvxTXjzoDplLG3/hFtZkNscC2gaCpfSQYEheLef9N06qY5GcSFLgRiin0D05rrDP9feqzflRYfyDGwuGgYFOmYGthXU2JaeanIT8rIlOSHY5c6I/m7lxP7hdr4TdB5df1Y8xp4lpEWwRJjC/tinbNl+cwbLuZVD/3Gic+rOBhQG2pUbPqjR3luywV06Hw1jVtoPUr3QZWjL96CAaPj1TD0t/swdeFFACokLJ+B0JojWE8D/SsRRuwjh06pG1M58fTbf6CjC9gAvc9EcGkGqHwRLPcWqlozEg== 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=iVfERpOAMaOcy/XnkyLUQlU1LwX2b+Jc9frQPgMyf1k=; b=QR9cssSb/fYU47/VEViFv4xg0m9Kmg2GXVQgH4AH/lP0IK9uQFXC35PhLTWnxsdWXBVdWF0wqHD5aUlx9bfe9xqA/Rb9NBW9De0Yd6iRM6935nS5xVjUuzRhJiIlhfhOsfuy0LMlpaIcQi+sbKEOGb8T99rxuck2w+U5MiD5kk+PZcBbcGIYpn4CmJWaXUzi7mylRfHXR82S3vl5gpsWiXzog52VU+0RqtRAOjW5rmDFP4rVu7M6arrhef04xNj5kkJ/wmiQIxqk4ba0pQgGy52ATg/LNXF+CgbJapNV9mPq0qEggK6KP8CP77togaJodSZ4kTHRAMladRwzasT+Qw== 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=iVfERpOAMaOcy/XnkyLUQlU1LwX2b+Jc9frQPgMyf1k=; b=Yg6v0p7HaoD2P78mfBrE+JlXibCJs3ixIfYHntZcnu7MZ7WgiADNOYFLTOi6ulGsGwU0ABYx4VLI5MBvyX/g85Gw/Bffoho0TRJ4AbOTuO01Ojk4b/vYnuYu2kq5ih4RSBTNswIEcW2Jw0dnCPNjz+eGqGUFR7ud0sEAoWqhHQ0= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:02 +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.2538.019; Tue, 17 Dec 2019 16:15: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?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 24/55] staging: wfx: fix typo in "num_i_es" Thread-Topic: [PATCH v2 24/55] staging: wfx: fix typo in "num_i_es" Thread-Index: AQHVtPUiOHoYnMTN1kWa4u/suVmmWw== Date: Tue, 17 Dec 2019 16:15:01 +0000 Message-ID: <20191217161318.31402-25-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 142340f8-cfca-4c84-06a3-08d7830c451c x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:328; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: aJIedjl3q+ZvtjwuULhDmjSzLUvqlm1ymNSOEaA8pyC+Z/UxT/6GatLJhf4xGB23U5GCSZfQEH3jUQzFVqWtH9k3mZ8aAbAjBGiunc+VsoRp52n3waUOkFakWNX7RfR6KAQVkwE4gCbKEWavtc2Ii+OhuiZXIzTP0IGCO9v0sjeB1ycdqZjvbTzIItYOTON2r4u2R1N2hu8CBj5ok6oXrc2f3+FnUhwKivsrFcHqgCttvxKs8rQTtW1yKHnkgVlwSPCb6JQcBPqlUYyQw8iakwxMwJFz1PVUXg8EjdOnx5kfeg8rL/aKdFPGx6wiRdKyOqqmNNBb9cZH9CX6+ch9xcUIRc9NiPKVFO2abjSGfWG6L5nOwjJS8Pqqwj4qk1rsOJeJte4jNLq4ZBaQ7TS10zb064Kip/YDP6NDvVruc4eu8zYDodjguh2cL6hwQ5iX Content-ID: <49EB48B41716304DBAA5DE74A0B28B1D@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 142340f8-cfca-4c84-06a3-08d7830c451c X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:02.0004 (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: DS4KesVjshD1+li43W7tudl09+bJYZXRg7DcT7e7Gk5pXovGcYaBRPutpnfivolhJFAjueHYMjOaJD7x3XfH4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The script that has imported API header has made a mistake "num_i_es". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 2 +- drivers/staging/wfx/hif_tx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index 90ba6e9b82ea..3e77fbe3d5ff 100644 --- a/drivers/staging/wfx/hif_api_cmd.h +++ b/drivers/staging/wfx/hif_api_cmd.h @@ -137,7 +137,7 @@ struct hif_ie_tlv { struct hif_req_update_ie { struct hif_ie_flags ie_flags; - u16 num_i_es; + u16 num_ies; struct hif_ie_tlv ie[]; } __packed; diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 2f74abca2b60..6fb98ddbc0e2 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -429,7 +429,7 @@ int hif_update_ie(struct wfx_vif *wvif, const struct hif_ie_flags *target_frame, struct hif_req_update_ie *body = wfx_alloc_hif(buf_len, &hif); memcpy(&body->ie_flags, target_frame, sizeof(struct hif_ie_flags)); - body->num_i_es = cpu_to_le16(1); + body->num_ies = cpu_to_le16(1); memcpy(body->ie, ies, ies_len); wfx_fill_header(hif, wvif->id, HIF_REQ_ID_UPDATE_IE, buf_len); ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); From patchwork Tue Dec 17 16:15:03 2019 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: 1211490 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="PcmI1SAQ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjsh1ld8z9sST for ; Wed, 18 Dec 2019 03:15:20 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728861AbfLQQPP (ORCPT ); Tue, 17 Dec 2019 11:15:15 -0500 Received: from mail-bn7nam10on2081.outbound.protection.outlook.com ([40.107.92.81]:11510 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728786AbfLQQPL (ORCPT ); Tue, 17 Dec 2019 11:15:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U9Ltf9VScfQutYQq9FVdzwHeAbuuWZjZNac3L9i43+O/0r5o6YdlOQ40wRcbeJTePMtBpYhQrlYGtYmVUEcW3Y7PuG25to59IEmFlx1IKVZudgh25OR4halP8fnhJKh7hUgCLoidUEs7mZ0jnwnn1TOmm9+jXK0A+aPQKS6FNaVhMwnGj1RlERa8kLAXCLtqtvmYgg3H7NuAp1iDp2yiuz47yJS6fA+hYgR7h/38UcAMOWaDRUmbhoy8sOEq280zNAx1QwquIdsxAPihCbT+AK/dilpbsKZCO7dYaEEgFGCYdBj94lakcO/Z66QwYqwagixe+ngEYYh9f6vWkarfSQ== 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=rzqXR4OSD6Tjju7AAqCftCCo3sqtHwOS4ZKeJqhwSrE=; b=EK13J/slWFx1gU0dW20lMl1KXlj8pO2jyyzrP37Tev9KQ077EupWK929DjFSzSgcQb7R66SNmwD/6bv0JO+LaCh9r18+wGBJV3AjGE5UilfGhRW4VP6/drzWYPaUsQo8j05A1DiVQRFu4K/ZRlwxdwE3cyZS/ku36bXR5Y+pNssklJyPkQVp7gEN7fDaKahgUJvAjNclhXkS8MTEjDKZZHI9729OGnXGv8sWUR00S0teA9XAQsnz2fZE7Q9haqe7poSd4obn8/KMDtspZs/LZQeC+PLQVVZV+GU/bDCjcBfvTvdVKZNEJJ7+ByXEMGRAcHIbIOZfnYCvd1IJWgFJkQ== 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=rzqXR4OSD6Tjju7AAqCftCCo3sqtHwOS4ZKeJqhwSrE=; b=PcmI1SAQVRlY1EDwcTPJC8fsPJmKK5DBsIZaWVJPs1hQoWalA2Texyt+jcq9Gt0yAYTFWaVcE1Ijqpz6D3PByYN/YPBi8p5hMc4VqALQI/ceHCDOrNmAAJwMIRtLltGrGvh8vxaBOn0rYQ+YMjJVRKjG/pHAFmKv4VyuiR/U1a0= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:03 +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.2538.019; Tue, 17 Dec 2019 16:15:03 +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 25/55] staging: wfx: fix name of struct hif_req_start_scan_alt Thread-Topic: [PATCH v2 25/55] staging: wfx: fix name of struct hif_req_start_scan_alt Thread-Index: AQHVtPUjcdBK6IlpOEisv8L/VkdNZg== Date: Tue, 17 Dec 2019 16:15:03 +0000 Message-ID: <20191217161318.31402-26-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a4941d4d-0f00-4735-c5f1-08d7830c45de x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:873; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(4744005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: 6gCkb7ZhQEl/H2efPmuOiwqpcCkWaxOn0kaglDmjpxy9R/XhvP22tcQ+gVxiKWq+e4I1y45JRCZZSCa1nSmiKHYFZ0yHLyWnxzuitnEjLX2e73Z8PbB0e198VMSIf6czG0MeJrN9Sz0F6LV+43lkRUOwclw8SziBRXT0IN0BNIpcIaCw2tEfoZ4t9s9LCBdnT5sbQPbTKhbhv/xf9A2VUEQlonfuLrTC1G5/SGNX5guLSM383Q1TargPsB2i02cok6KpkRyCD1IgGfvnXU3aXCUaUAwl0ttu1GSrbvRTRzGnhUI9Ntt99dZup/Im1QosdCraAvM/RGtC2/tdSNkV9h7zqpGwNFmOsfAHn3x8ndTYm/cJ73/0AwvpJ7mQbycEpVKH4C5qtpO7u2XNaCIgfvAXQQT2GHStwlTLx8+emlmcTvK2PGbWa1r/je7g2/1T Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4941d4d-0f00-4735-c5f1-08d7830c45de X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:03.4006 (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: H0zMjQ6X6RjDV24rloizsOSZZW2l3ZrUEwIFBZB3ygfAm9TttJUlNt/hACHVbWOR9eAsnLOllacfZMCaDoldHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The original name did not make any sense. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index 3e77fbe3d5ff..4ce3bb51cf04 100644 --- a/drivers/staging/wfx/hif_api_cmd.h +++ b/drivers/staging/wfx/hif_api_cmd.h @@ -188,7 +188,7 @@ struct hif_req_start_scan { u8 ssid_and_channel_lists[]; } __packed; -struct hif_start_scan_req_cstnbssid_body { +struct hif_req_start_scan_alt { u8 band; struct hif_scan_type scan_type; struct hif_scan_flags scan_flags; From patchwork Tue Dec 17 16:15:04 2019 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: 1211493 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Ph0Flskk"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjt33spGz9sSZ for ; Wed, 18 Dec 2019 03:15:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728841AbfLQQPN (ORCPT ); Tue, 17 Dec 2019 11:15:13 -0500 Received: from mail-bn8nam11on2073.outbound.protection.outlook.com ([40.107.236.73]:39265 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728804AbfLQQPM (ORCPT ); Tue, 17 Dec 2019 11:15:12 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eN0NmthCv6ar63fXVcuPoRhHruL0ZmMF6r2Rbp4xq5l0R1Bw39Mtc+ybjrPI3B1XQerNEJJoUNxScqCZsPvekvZ2YzTFPttelj82bLtDdVA6/rIeQ52+zmByd4AMxTXNHzSs8QdnLpoKxbCyD1EWPAeejxZr8hPwsUURiVydrn0avHiZNj/kt1OGeqvypoq5isCytmc9cVlEl7c/r/VgKOk1g2gBvdU7uVxJnFoqXuQm8jB5fIEO8mCJSvQBZiTUIYONzOfIZOvwl+q4M07D7zTxmJvHNza5vAUK07BGCaIWU1HbnZEDFU0TXiO0Dy+ZigxoD+/SoOG4Y2qbRVbbWw== 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=OAR2CJleKMtf7Fzv+6IfTj9mDulTG22RY2Q0iKygpGM=; b=byiD2ewwFJJVQ/E4ldIqNtCF6B++knBF7dILpqfxZbLPXVDVofdHIdomwLsg5FPNWxget5vgOb7CyII+ixDgse/QQtmscRHuBYZm2RWv/YmY0RZM455oWsd7e1oXXOdhnPzbBuHttiq/p/6c4zvQ58LGyOfGHqlOJwQbaYj5BqXhWvxkr1wtklQhZU8BBOlz57w7+YOmKZTMjrM1S1O849L8yLsZu1UTkz2QzWSuKksiqDa3gd/XQOavmAat3RXJgacpMf/4Zq+CJE46o+OyvquFZ2VloimqqXvlWd6QKQgMUyxLxHGbyIpaLkVgeKqVD9LF/zfGtFm1xZ2SosQZnw== 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=OAR2CJleKMtf7Fzv+6IfTj9mDulTG22RY2Q0iKygpGM=; b=Ph0FlskkdA7PZLslB2a3pSkGWDcBAY8XV/LRzJ1Ud4jfQrcj1/eSry51EYMg76Ki33v1zVhTsMVwF+0bpQa5y85cwqVMmRuZJldhiOs2PsJZRtXp8HiUq0Fa0AkorSltg8neG/ENFU2Msue5Mk0XFcEah2WW60FO4SjnvQEJJb8= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:04 +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.2538.019; Tue, 17 Dec 2019 16:15:04 +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 26/55] staging: wfx: improve API of hif_req_join->infrastructure_bss_mode Thread-Topic: [PATCH v2 26/55] staging: wfx: improve API of hif_req_join->infrastructure_bss_mode Thread-Index: AQHVtPUkg13sfTPhAkmFbUcYXxvbJg== Date: Tue, 17 Dec 2019 16:15:04 +0000 Message-ID: <20191217161318.31402-27-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0b6fc2a0-7664-4578-4f94-08d7830c46b9 x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3173; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(4326008)(8676002)(86362001)(6486002)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: Di/P062DZqb/K+9SxmQ8wMbxlTMkeKtjOPStr471xRPrl84B0jjqL/Gczv3SHAx3vNGZ2P1C5MUkNwDZsEzz5uvACwQ05rfGTCZWb8u+yjiYDys5IT3bwHIz2ev6ygJQ1Lr2qtXfH0dV3fAovdPjVOEPuJpOLKiq7dam0fSVcRaq6P0OL+shiE3JySeAlPY8tF8GN01rzGcq+QwVDfpQV77ovQu4DANwP905aJ5yOjzyoULL2H0uzPc+SU/SoUJ3ZZ3MjyKKuzVv8uj/jKLwZcb8hFJADw8VdDbKMJDddNhMTnRxApAhwLi3uS+OVOTRREUC69qKYrirwQseBdP/EQqnsQaMp9uxacRZeqTEJz2TDG2ieQeEfe5ERvcPL7LmXH1oXB6Yd2iuTmsNij7va69K8RiCSP9GzKjTEBpoyfmQaAjiNlUmPJ+6rr/e38+l Content-ID: <5E879E467877804696EFAA130F292F83@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b6fc2a0-7664-4578-4f94-08d7830c46b9 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:04.7109 (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: 986oG1tFXeaUD5e1gUawCzymkhuKJ/sSQdMw8OvVzwNOqSzmAJIn5imouUvepvrHLCby11Q/V+4lR9lqEPh4/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller In fact "mode" is a boolean that indicates if IBSS mode is used. This patch fixes the name and uses a more adapted memory representation. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 8 ++------ drivers/staging/wfx/sta.c | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index 4ce3bb51cf04..e848bd3073a2 100644 --- a/drivers/staging/wfx/hif_api_cmd.h +++ b/drivers/staging/wfx/hif_api_cmd.h @@ -377,11 +377,6 @@ struct hif_cnf_edca_queue_params { u32 status; } __packed; -enum hif_ap_mode { - HIF_MODE_IBSS = 0x0, - HIF_MODE_BSS = 0x1 -}; - enum hif_preamble { HIF_PREAMBLE_LONG = 0x0, HIF_PREAMBLE_SHORT = 0x1, @@ -396,7 +391,8 @@ struct hif_join_flags { } __packed; struct hif_req_join { - u8 mode; + u8 infrastructure_bss_mode:1; + u8 reserved1:7; u8 band; u16 channel_number; u8 bssid[ETH_ALEN]; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index b4bb5b653e64..23ec7a4a926b 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -651,7 +651,7 @@ static void wfx_do_join(struct wfx_vif *wvif) struct ieee80211_bss_conf *conf = &wvif->vif->bss_conf; struct cfg80211_bss *bss = NULL; struct hif_req_join join = { - .mode = conf->ibss_joined ? HIF_MODE_IBSS : HIF_MODE_BSS, + .infrastructure_bss_mode = !conf->ibss_joined, .preamble_type = conf->use_short_preamble ? HIF_PREAMBLE_SHORT : HIF_PREAMBLE_LONG, .probe_for_join = 1, .atim_window = 0, From patchwork Tue Dec 17 16:15:05 2019 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: 1211492 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="dC8vAyOo"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjsr37FHz9sSV for ; Wed, 18 Dec 2019 03:15:28 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728835AbfLQQP0 (ORCPT ); Tue, 17 Dec 2019 11:15:26 -0500 Received: from mail-bn7nam10on2081.outbound.protection.outlook.com ([40.107.92.81]:11510 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728718AbfLQQPO (ORCPT ); Tue, 17 Dec 2019 11:15:14 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GX/Xat2GVV+uKhN+JY0sJ06q+T7q5GuqFoBUGMl/w05st1o0NHw/Gh/4oXxk1lc5ROezJXSH7Ss6Jx5eXxg0mZ4puwgodM9xfXGKIlRwVozykmQsYqFVCMiJlbhNyFhya8eCdfA3ns6iiliy2I/Q+QGbTpK2XvxEDzEeQrcvvBuFm3TFNxieltw7VVWcBt/f5+Ey1duClk+pJov288IGi23BFdYVgMPOazoxFk+asINAMZz08TTDOT/QBAo5qaKPGb4V5ZV7xr4KYdWBcYQvSnNC66jgpSil8jt0VjFhO+dpUEJ3I08vRU7cuHZtUQbmJ0Aty6Tjuqhbsh04PMC8iA== 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=00C7yvUiSw61drLH3nKSkuEhkRj+FBYQcpu+d0wiUzU=; b=JKbCLZ2v6B259A9cM/PiP6Qv3tZ8J5FyW6Ne/rydNSmoa+lAXCG1+MVWD5eVH8dKkcsTP15p5cNY4F60nurVRaKc7r7RISLHpJ6ag2WAVmmrvmcDpLFP5btnkV7IlhV32aMpACXqz5E07YgNoa4oh/BKkQoo3PotfoBcXL28xWo8nJ22a8NH7JSoYku7kjrhMn5t9NBJCBPEgkk67KyFqVL/Rw4PKP5hylIIquCn/cuJJD7fUCKhH14t8RT3U96WcMLTcZy+0Ol5PxhuNJdWiUEccQ6r7reS6XCWGgMcB/Mg/jLu4cYA7iREvJq1kDq6ePKyI9ZvnpPabfeC1JuYEw== 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=00C7yvUiSw61drLH3nKSkuEhkRj+FBYQcpu+d0wiUzU=; b=dC8vAyOoM8MkUZlxwjtnz71lWA53lPOv39I7GeEnN3ZXP1HqKQZRoKnmzEfC5Eqn50Zww6MxreeYZeiHXICyBgK2RU9E41gK5OXdH0ThQCGH8i6vFVSaBBSb0HL0uNsspV95enpJegaDLVtb5DSajXSoVCC3jLI3X2Eciv0h6wA= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:06 +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.2538.019; Tue, 17 Dec 2019 16:15:06 +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 27/55] staging: wfx: better naming for hif_req_join->short_preamble Thread-Topic: [PATCH v2 27/55] staging: wfx: better naming for hif_req_join->short_preamble Thread-Index: AQHVtPUlIxdb1YHkuU+OJUWlibw5eg== Date: Tue, 17 Dec 2019 16:15:05 +0000 Message-ID: <20191217161318.31402-28-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9581d860-6c3e-4472-9e3c-08d7830c4779 x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2958; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(4326008)(8676002)(86362001)(6486002)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: kdjzFlrNMrOz1k9EAfgFUjwagve7r+OQLiyC72ZQqTyc0UlF2iLV/3sOZ2hpveiu7VmwjFUCLyr3779LDkJuXoIyT7cG6+hu32VnlV/f87YjEQ93xZXXlhtUZw9JLVLpEy6BUmfrmVgt7tQ3ZQuTu1MFJSDqpVrAMN/mOEx6aEP8+TAym0XmlZaGvwts5QHSOUwKkuiw0HPE0nAlbz6jQOsfQHpvr3HBCGUoOheDfFJtgwa08A3ZfyF7p+Y6uRToviujzavs3slfdGSdZWlXK+YhYinSsDKwza7+EaB4l/XmkntECV8vxUU1i+kouBo67zSeKt4DGk+xvffOQ1Ffchk1u+DxXm975PPKfoZ5ABtG6HsQpc3Mjncrt8PRmwXmNUhlaDCW0CLgFE5dn9COz5o23xAGhmeGaNCa6Jx3TA0Y6KbXZp5D+j3UQjCjS5GY Content-ID: <6C5B07B352ECAC46A3F6198AEC361D19@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9581d860-6c3e-4472-9e3c-08d7830c4779 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:05.9802 (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: /ZJEcQzMAMa8MGz3cS7zG2lq9HkGpU8e7pZwWJakTnNouztf92aZrNfFV6U9giJTW6EInbfPQP8W5seWzW3+Cw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller HIF_PREAMBLE_SHORT_LONG12 is never used. So it is possible to change "preamble_type" into a boolean and drop "enum hif_preamble". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 16 ++++++---------- drivers/staging/wfx/hif_api_mib.h | 5 +++-- drivers/staging/wfx/sta.c | 6 +++--- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index e848bd3073a2..fc078d54bfbf 100644 --- a/drivers/staging/wfx/hif_api_cmd.h +++ b/drivers/staging/wfx/hif_api_cmd.h @@ -377,12 +377,6 @@ struct hif_cnf_edca_queue_params { u32 status; } __packed; -enum hif_preamble { - HIF_PREAMBLE_LONG = 0x0, - HIF_PREAMBLE_SHORT = 0x1, - HIF_PREAMBLE_SHORT_LONG12 = 0x2 -}; - struct hif_join_flags { u8 reserved1:2; u8 force_no_beacon:1; @@ -397,9 +391,10 @@ struct hif_req_join { u16 channel_number; u8 bssid[ETH_ALEN]; u16 atim_window; - u8 preamble_type; + u8 short_preamble:1; + u8 reserved2:7; u8 probe_for_join; - u8 reserved; + u8 reserved3; struct hif_join_flags join_flags; u32 ssid_length; u8 ssid[HIF_API_SSID_SIZE]; @@ -462,8 +457,9 @@ struct hif_req_start { u32 reserved1; u32 beacon_interval; u8 dtim_period; - u8 preamble_type; - u8 reserved2; + u8 short_preamble:1; + u8 reserved2:7; + u8 reserved3; u8 ssid_length; u8 ssid[HIF_API_SSID_SIZE]; u32 basic_rate_set; diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/hif_api_mib.h index 94b789ceb4ff..34e4310ad71f 100644 --- a/drivers/staging/wfx/hif_api_mib.h +++ b/drivers/staging/wfx/hif_api_mib.h @@ -471,8 +471,9 @@ struct hif_mib_set_association_mode { u8 mode:1; u8 rateset:1; u8 spacing:1; - u8 reserved:4; - u8 preamble_type; + u8 reserved1:4; + u8 short_preamble:1; + u8 reserved2:7; u8 mixed_or_greenfield_type; u8 mpdu_start_spacing; u32 basic_rate_set; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 23ec7a4a926b..e5c933678c47 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -652,7 +652,7 @@ static void wfx_do_join(struct wfx_vif *wvif) struct cfg80211_bss *bss = NULL; struct hif_req_join join = { .infrastructure_bss_mode = !conf->ibss_joined, - .preamble_type = conf->use_short_preamble ? HIF_PREAMBLE_SHORT : HIF_PREAMBLE_LONG, + .short_preamble = conf->use_short_preamble, .probe_for_join = 1, .atim_window = 0, .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev, @@ -843,7 +843,7 @@ static int wfx_start_ap(struct wfx_vif *wvif) .channel_number = wvif->channel->hw_value, .beacon_interval = conf->beacon_int, .dtim_period = conf->dtim_period, - .preamble_type = conf->use_short_preamble ? HIF_PREAMBLE_SHORT : HIF_PREAMBLE_LONG, + .short_preamble = conf->use_short_preamble, .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates), }; @@ -994,7 +994,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif, association_mode.mode = 1; association_mode.rateset = 1; association_mode.spacing = 1; - association_mode.preamble_type = info->use_short_preamble ? HIF_PREAMBLE_SHORT : HIF_PREAMBLE_LONG; + association_mode.short_preamble = info->use_short_preamble; association_mode.basic_rate_set = cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, info->basic_rates)); association_mode.mixed_or_greenfield_type = wfx_ht_greenfield(&wvif->ht_info); association_mode.mpdu_start_spacing = wfx_ht_ampdu_density(&wvif->ht_info); From patchwork Tue Dec 17 16:15:07 2019 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: 1211521 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="hHUPn9Ff"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjyP5zh5z9sNH for ; Wed, 18 Dec 2019 03:19:25 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728931AbfLQQPl (ORCPT ); Tue, 17 Dec 2019 11:15:41 -0500 Received: from mail-bn8nam11on2073.outbound.protection.outlook.com ([40.107.236.73]:39265 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728815AbfLQQPN (ORCPT ); Tue, 17 Dec 2019 11:15:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fN2N8guRCItW+EEg/Hkj/ukOSc+A5qgpMgCCbDuS1aKr60NR79F6wKAd+D0J7vZtW8rT2CknmAmW3ChADexCzNnfthOeb5UDDSbQIYxNd4iiisOt1dQXORvgp58bBi/To/qexgnmhxqkf2X5n9YpE8PHftV3c3ZswKBX7Yc2Af+RZQv/iaUFS1CqmfHPShl7wT5+pS4aP/43a4QJ1H6VOjTjVMXFC5/zkXJSRRnpAS5fyyDVlsMQQ7ZJXOOLNRubJW9z/H03uLETvnDXRBSnltTPoj03KioXDVWwzwx8Jo6evslazAAyuvSMRypYtlcQM7XSs90QsjI5dVdVoqu1Ew== 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=yzJ9Km3ztcZj3nWkxD6oAFc1JunTerw1K22+aUHSyQY=; b=Q8/+Q6MQrVYzLzCl95yiNzpKTskyfZ0zwQLtq+jUgezGbehSPq3aMakC6fc+ISNm3tNDD4oiciGd/yQ3matAg7czY92Dnx8Gq6ouGY/BNtVkhbinS+GaXOxv8yYzRsh2nOYqVJbqAAwBPSrQ8rckr7JM1xVp11mCniC6seXcfkOTwI0JYW9au3X93Na7+6VFQSbuY2mHZA/iFAg2rsx7fHuTyIFMFYk7VtH2Q8tvL3dd8tvErpxaOGRbN4mR2ogsloiybReWdcw2X5K4PwAv+6EZHRF8cJ4Pr6S4Ng2ZfoQV2wLEaOWNglj/Y1a8rhllqSpCWIpCoZWE4cpcL6/tVQ== 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=yzJ9Km3ztcZj3nWkxD6oAFc1JunTerw1K22+aUHSyQY=; b=hHUPn9FfBs9/BeHAbJ8Yt88Wvffcmd0gAAMHrChMAdFsTmxeJ1D0aDq144b/2s+HFjBMG+ga4FHumvBcHtATBE0qREI+lLAN9vOPZzEs+UKEXiIyHtaqZq/94rdRcAVpQECeRga500kGzbafbVm2qxxNmwSyVMiUV2M98nTznSI= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:07 +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.2538.019; Tue, 17 Dec 2019 16:15:07 +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 28/55] staging: wfx: better naming for hif_mib_set_association_mode->greenfield Thread-Topic: [PATCH v2 28/55] staging: wfx: better naming for hif_mib_set_association_mode->greenfield Thread-Index: AQHVtPUlFWQs71+YPUmVM/v2SaPjlg== Date: Tue, 17 Dec 2019 16:15:07 +0000 Message-ID: <20191217161318.31402-29-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3ca7774f-a86b-43ae-1c39-08d7830c483f x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1148; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(4326008)(8676002)(86362001)(6486002)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: 1gIGDrfZ4OexfEo9vWRH4GF9pnaGjbr5wGKb0Qao3io5HEWqEGbBErMUUI3Nnx9lfHGP4C3FW7BnCHd8Gd2Cy0mos7GqwI7i5O16M9freK1SZwy6rA+KlK8hirNtk3PT33cqZbesWfH9IUSVaG1ii8eEGb38b2ec6kG/cD9yew4wG1QXuF6KMtit2pUa0n0Q2s2V2dPNsgYrkNvnrVfdkM2VTTtxM2+fDbYZYTWynRHHdminzlfxejKkX9Ep+TaLV09AcRS8nYL/+8kCdDH/SfIcgAm2DqQKCXFVun4cnAoQ4f1a0e7MivDUX7u6g3XqoH4J2alIjT3OSbKIOx4/mhqgBPDGH3n0NbHGWtv58c4QKuc8Iuy6WE+eq5HSWAi+LIjrS5g+m/nNr6nKuZZMjBR1JxUNdk/onVNsq+yzV9FZg8dxsy5EtGTakF8aPUmS Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ca7774f-a86b-43ae-1c39-08d7830c483f X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:07.2805 (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: JuEpEzuH//Z8RYJYo0CVidaLIGYoPqC8vTVbdq+yIDKVUzwq1GfFKY4+VcV/zESom9P16C8BFZGKYJzRDafj4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Current name "mixed_or_greenfield_type" does not allow to know if "true" means "mixed" of "greenfield". It is possible to use a better name and drop "enum hif_tx_mode". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_mib.h | 8 ++------ drivers/staging/wfx/sta.c | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/hif_api_mib.h index 34e4310ad71f..1603b3074bf7 100644 --- a/drivers/staging/wfx/hif_api_mib.h +++ b/drivers/staging/wfx/hif_api_mib.h @@ -395,11 +395,6 @@ struct hif_mib_non_erp_protection { u8 reserved2[3]; } __packed; -enum hif_tx_mode { - HIF_TX_MODE_MIXED = 0x0, - HIF_TX_MODE_GREENFIELD = 0x1 -}; - enum hif_tmplt { HIF_TMPLT_PRBREQ = 0x0, HIF_TMPLT_BCN = 0x1, @@ -474,7 +469,8 @@ struct hif_mib_set_association_mode { u8 reserved1:4; u8 short_preamble:1; u8 reserved2:7; - u8 mixed_or_greenfield_type; + u8 greenfield:1; + u8 reserved3:7; u8 mpdu_start_spacing; u32 basic_rate_set; } __packed; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index e5c933678c47..939c64f108ed 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -996,7 +996,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif, association_mode.spacing = 1; association_mode.short_preamble = info->use_short_preamble; association_mode.basic_rate_set = cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, info->basic_rates)); - association_mode.mixed_or_greenfield_type = wfx_ht_greenfield(&wvif->ht_info); + association_mode.greenfield = wfx_ht_greenfield(&wvif->ht_info); association_mode.mpdu_start_spacing = wfx_ht_ampdu_density(&wvif->ht_info); wfx_cqm_bssloss_sm(wvif, 0, 0, 0); From patchwork Tue Dec 17 16:15:08 2019 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: 1211491 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="dpYCguyo"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjsp5PXqz9sRc for ; Wed, 18 Dec 2019 03:15:26 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728898AbfLQQPZ (ORCPT ); Tue, 17 Dec 2019 11:15:25 -0500 Received: from mail-bn8nam11on2073.outbound.protection.outlook.com ([40.107.236.73]:39265 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728835AbfLQQPO (ORCPT ); Tue, 17 Dec 2019 11:15:14 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cK4YN/4jKG7kIRvcqI3ya5lWdWMYjs1bL7cuQ0FSgp9bYYSQhAYd3puufA6sBOcEUAmzJBh7jn0w81h/tvRSqO3A6MoL17fJJt+C04+xmbeoVy3vW9ICl7yATPsTgqqVJXHpdpJOEX2463dvUf2kHtUR9Ce4nIi5Z/Hq88gVMKFi7GTBSjScEYUfR/v6Di83y5r8uYfSQdUb8NJJGSWp31yOagb/G9vMa51+D572FH16Rmh40ET2mAbe3T+2UhNj4oVVd8v9/5x8bii42G/aadJSwyksh4mG5IberjV9dEJA3Z6xjjSa5S7SA4SviZooYp6Irl9v6MTHK/zsUAL9DA== 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=DgRsYGpOQruqWvGnWEUUxdiA+S21vlMKBbozCs8hMqg=; b=G8mFtlxwMbrBP/Q4wfsykDn3ZyvKMhGaJz/NUk7HgyR+Kwajg1Xf/fmb7knT/U759Bm3F7eaaaqm1eNevpgwiYAvJj2dEFTUUAAF4OIYCdE63Ms1F/XhaSWw0lUoPxQIJlExj2DBnsc3nQ1YaNCKsnzDCCNIA6DPpUsq0tLqv0HG3z7Zufm0IjkEZ/kol4p04MAEJp5ou2Jox/fU/MFzC6SrlCjXsRnpf4i95nFzT/AD4xR79Qt0q8QRNkwdMOQvn92oZXBCcka4HrOUVigP4JVZiw3O15aer+Kcdz4uJTHzRzAYa30GE0AclxD1F8UCui2tXCrlGq6WoYrkiHXjxg== 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=DgRsYGpOQruqWvGnWEUUxdiA+S21vlMKBbozCs8hMqg=; b=dpYCguyo8BYZ33c+kx6JF9UAktyoLsahOJbkAErJtBML90bvVrY0Kh0Pk8qfl/i7Ai4Yi9CP/94D4VavY6TQtTbgoVVMAkFNIq8vGWNpBk6qELfZbe+io/tTyJcv828iTg+VHQnDaNWpQVewzkOuSjYl6XvQ9i7RgfDu4D2ugIg= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:08 +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.2538.019; Tue, 17 Dec 2019 16:15:08 +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 29/55] staging: wfx: simplify handling of tx_lock in wfx_do_join() Thread-Topic: [PATCH v2 29/55] staging: wfx: simplify handling of tx_lock in wfx_do_join() Thread-Index: AQHVtPUmosfEjogheUqodIyJPKuxrQ== Date: Tue, 17 Dec 2019 16:15:08 +0000 Message-ID: <20191217161318.31402-30-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 552362d5-4cfe-4523-d31b-08d7830c48fc x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: hM9zcGfLv8VHYpaq22iU8lkrl1JqjQdPZlT/akPQ5PNozlt3GYfTZFDVChHwmfQ1SdQjATT4P5oSkOpRmYMkYdPp7HRiafe6XLUfoie/oshnHtk7b+2m2GjDejL/TgLFyUjuphgpXbcdUTpQIf891F9JpqWmEKHpToWmXTFlWFqV4TRvYAsryCaItexR/QLBC9DuXrJnpGXVnjXL4koQHo2thxNgSC9KJttK6NjtEC68G0u5Qt4+3aUGsWi3lWy8CQ3Bc652KKWwMPG2Jq+ZUQ5OU2VoZ1cFHo9cxZWgY5ejGBKrUyigqKXnrKVHXTwS3VI2ujnC3OUg/5zJCg+jshvfwOZ5hpMiFxfELMtfPr58nOKejB1RpoJCzn2EVa2yx2rH5d4qkpoaNLAeMjt2JtEuei8L8QzuBKZGOot7jqkWalEddwW6p/ltwwbUwWBq Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 552362d5-4cfe-4523-d31b-08d7830c48fc X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:08.5248 (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: SWdH+viZBM7hEXQ27QX9NEueQYZRD6MxxeLaiaMLyDRIyiz6lguVxCmDQ4dPcwx9CU484vmHHvDDvoBBVf4+1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller In the old days, wfx_do_join() could be called from different contexts. Now that wfx_do_join() is called only from one place, it is cleaner to keep lock and unlock of data inside the function. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 939c64f108ed..62e65493a4fe 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -644,7 +644,6 @@ static void wfx_set_mfp(struct wfx_vif *wvif, hif_set_mfp(wvif, mfpc, mfpr); } -/* MUST be called with tx_lock held! It will be unlocked for us. */ static void wfx_do_join(struct wfx_vif *wvif) { const u8 *bssid; @@ -659,6 +658,8 @@ static void wfx_do_join(struct wfx_vif *wvif) conf->basic_rates), }; + wfx_tx_lock_flush(wvif->wdev); + if (wvif->channel->flags & IEEE80211_CHAN_NO_IR) join.probe_for_join = 0; @@ -1180,10 +1181,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, } mutex_unlock(&wdev->conf_mutex); - if (do_join) { - wfx_tx_lock_flush(wdev); - wfx_do_join(wvif); /* Will unlock it for us */ - } + if (do_join) + wfx_do_join(wvif); } static void wfx_ps_notify(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd, From patchwork Tue Dec 17 16:15:09 2019 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: 1211518 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ju80BinX"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjy25jPcz9sRM for ; Wed, 18 Dec 2019 03:19:06 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728953AbfLQQPo (ORCPT ); Tue, 17 Dec 2019 11:15:44 -0500 Received: from mail-bn7nam10on2081.outbound.protection.outlook.com ([40.107.92.81]:6496 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728057AbfLQQPn (ORCPT ); Tue, 17 Dec 2019 11:15:43 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q65AsRvBPtHhIbxYf0ITjjrkcw8jBQqK4uS6rYBRZbEw1wxVuHIM7H//Udv0g+V38u0vPKZCL8scVuQnW3kFPiM5CmDuLttf3bohoXK0CV1kawZoCnxyLmyhMCtVpi98DAyMe1K8RkrxtkmB2sdcSuYInXf8ixSdhyMEP4fG2C9rgnLTlZ3RMYSHtw4nLyNHAYQJbLwNSGILT5TyE7sN+7BVV0s+smiQmJI++fRNFJ7jJQP3o2eji2zf9doLgmA73wM6uj1IT3K8JAtUKHjcurn+DOzpSHel4fXYCX5Uw0Y0ONfWxvr7/o5EhBQwEZXIRsYNKqBxVQEBzg24FyTEWA== 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=xjTf9a7HgmIEmVRpuLTL6kfHHNpjEbqX1VGUrVeMHzA=; b=W+Q4x8OJ/ELoVS+6UNZM8u/CZ4vG+wXnB39wqLAI/Q1RmQVoBDBQ68J4xjL6TitAlPbpfQH3n6LNDLxnzTm8rZBYgTSX3gtyS+vA35MzuEEQeKcbLxbKvmH5sH9eYa5hsjNxBsa00fHb/nZaRkOzQEm1M8qGvbIk4wHPnvt4shDqyMh0Ut5sxG/dj7s/XWyBDyRUTSL5BEz8Bss3bOQ/8B4LSOhQtKMMt3QMiuenp4usMfkgxqQPAMOzv86ro+DheD1gr/H58lzOVpGgO3dY83Whl1aee/a9BREoRRWaojMNTH9MIPUfIfcZWNz2IE+4mcf8Qmg1x/WR9Z1q36Jv2w== 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=xjTf9a7HgmIEmVRpuLTL6kfHHNpjEbqX1VGUrVeMHzA=; b=ju80BinXqwpevRgES9UM48RzDqT2xI0dukxaIcrjtzytPMk7tO7gqrRJZef+QX6ycHvwXeAIYVeETp50Twu9KgAMCboJdGVGtuNkpl6DTczh2DV8RT369dtSjfijDDT9NWPqg/XyYPFlfjRQ2Bxqo0G2P40L3vP2xR2onSXmKD4= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:40 +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.2538.019; Tue, 17 Dec 2019 16:15:39 +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 30/55] staging: wfx: firmware already handle powersave mode during scan Thread-Topic: [PATCH v2 30/55] staging: wfx: firmware already handle powersave mode during scan Thread-Index: AQHVtPUnTzH8bJzKeEKSffREJQG94w== Date: Tue, 17 Dec 2019 16:15:09 +0000 Message-ID: <20191217161318.31402-31-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e13c1a73-c823-4df5-96d2-08d7830c49bd x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: uJzShR5v9zv4c5Nfr9JIvGyH4/4ex22v/+LLg3VoD/P2hdpV6iwAmvOZ7RzogPTwfzyCKyZ00p1EvN1oLXAlP3xkTcHPudp6n90ewmrZdFqKbb+zIxRjUZrOb5ZUyj4+a7rOCkBQevirL+b/xx5+BaY81B3KkEh/DpvML2j76pvqOsfjKddcrxLMh3HmxLUu4rded/+WpgVE+UTL111qQb/ZYMAoq81cd1wMGHGJsRxWl84bDky9DSCVruUSR75jg+b3VIKScR+3n0wq3jwaJti8w+BraadxDJPk30tTdXy3xwXa5VFIAVMR0vm6+jZde94rZDwbCv8DlMNZrKPp/iU7+XqXAtcXqM5sKMiRPNxt6n2mFdXiRRwFYkPJSht2pi6UbHIe1y0Z8vl65pw5bzPVikigOTc+yBrHzlY+5PePN5jG9zHheyDlwT0BkSIc Content-ID: <9CC1FFE48CE545439E19B6ED967463F9@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e13c1a73-c823-4df5-96d2-08d7830c49bd X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:09.7801 (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: xJZSA2eF0LZ5ihSbyG/YYQWPBM4C5KWhF0E6D3D0x0MvHXZMYGe4PLFAxKUNF/PBUyZbbubgPHrGPkVKEgNnOw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller When user try to launch scan while connected, it is necessary to notify the AP that we cannot receive data (using power save mode). Firmware already handles this automatically so the code in the driver is redundant and can be dropped. By edge effect, hack of scan status in wfx_set_pm() is now useless. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 14 -------------- drivers/staging/wfx/sta.c | 7 +------ 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index cb7a1fdd0001..4b95e6a97df7 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -141,22 +141,11 @@ void wfx_scan_work(struct work_struct *work) .scan_req.scan_type.type = 0, /* Foreground */ }; struct ieee80211_channel *first; - bool first_run = (wvif->scan.begin == wvif->scan.curr && - wvif->scan.begin != wvif->scan.end); int i; down(&wvif->scan.lock); mutex_lock(&wvif->wdev->conf_mutex); - if (first_run) { - if (wvif->state == WFX_STATE_STA && - !(wvif->powersave_mode.pm_mode.enter_psm)) { - struct hif_req_set_pm_mode pm = wvif->powersave_mode; - - pm.pm_mode.enter_psm = 1; - wfx_set_pm(wvif, &pm); - } - } if (!wvif->scan.req || wvif->scan.curr == wvif->scan.end) { if (wvif->scan.output_power != wvif->wdev->output_power) @@ -177,9 +166,6 @@ void wfx_scan_work(struct work_struct *work) __ieee80211_scan_completed_compat(wvif->wdev->hw, wvif->scan.status ? 1 : 0); up(&wvif->scan.lock); - if (wvif->state == WFX_STATE_STA && - !(wvif->powersave_mode.pm_mode.enter_psm)) - wfx_set_pm(wvif, &wvif->powersave_mode); return; } first = *wvif->scan.curr; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 62e65493a4fe..fb45aa66fc56 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -375,7 +375,6 @@ int wfx_set_pm(struct wfx_vif *wvif, const struct hif_req_set_pm_mode *arg) { struct hif_req_set_pm_mode pm = *arg; u16 uapsd_flags; - int ret; if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid) return 0; @@ -396,11 +395,7 @@ int wfx_set_pm(struct wfx_vif *wvif, const struct hif_req_set_pm_mode *arg) msecs_to_jiffies(300))) dev_warn(wvif->wdev->dev, "timeout while waiting of set_pm_mode_complete\n"); - ret = hif_set_pm(wvif, &pm); - // FIXME: why ? - if (-ETIMEDOUT == wvif->scan.status) - wvif->scan.status = 1; - return ret; + return hif_set_pm(wvif, &pm); } int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value) From patchwork Tue Dec 17 16:15:11 2019 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: 1211519 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="BLYlqaLs"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjy74Wpbz9sNH for ; Wed, 18 Dec 2019 03:19:11 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729423AbfLQQTH (ORCPT ); Tue, 17 Dec 2019 11:19:07 -0500 Received: from mail-bn7nam10on2081.outbound.protection.outlook.com ([40.107.92.81]:6496 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728707AbfLQQPo (ORCPT ); Tue, 17 Dec 2019 11:15:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DvDDmHzaApdi2VW2QlCJEOqkn8v/oTe6TppNiUAQcSkrBwYLywDij1FsuKYaasp31Lx26Iia0ZfQwdPdENkaT1tddHV15CdURanW6Ewssori/eK5Y9iBZN2/ou5+gJVDbfG1QGAPIItjVwv0N8SQNdVaKaW1y2IL2mJjJbdNnPpHzUEDqFtWvbsU11OZpsrFqDWX2YVJwLkitBOt4wQr0MytupXffOf7hgBAUJ+y85r8AINKg7hl/uSNCKwuekdT8mlhUSZoOW5wcIyVysUiDReOXUOhZWxMk5L2FF+bu0I+nOPmTG/t8aPYvB+mLHK8a+9MXhcPlEgM/PQx7t5CvA== 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=6nWAnv+qpHBHZEfgEkRrgWIwRNoZUxsON81aiF6xIKo=; b=Oi5DAX5AC5lOkqImfFLXZZHvqnmeKwwpawrpuf64gEtU/HkRUU8itWu0/AJ5Qvs0OSfzxzJt8DxL4QGCceyIANGbUjegbn7xsf0Cdhup5ps6Avf0+u62EFRz/9IutgLBLNI6/fSbeNuGoYzNpfjQW13bbkqn/v5Nnu6V4sYwjRU3F+DPwXgrUA7SsjGW24zfpopAoyoyAHrTa21xHTZTZinqKQBvhq3otNinPCF7V8logn6QUEZKB0SokwkOsfN/Fnama7Qz5HW4v72pYOzEKwAi30WtRrewv8MBi3+lj2j7rI4B8YT01eXyAgm5aHCxw1WMqT5VgVPexnc7grC4ng== 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=6nWAnv+qpHBHZEfgEkRrgWIwRNoZUxsON81aiF6xIKo=; b=BLYlqaLsFdoovrp0Aq4t3zkEWOm2GTLARuEAYwuqi3Z9ZLNkajgFSudnkxBTaXo6ztq9FSyqieQumkQUuRsDh1032KQwZlC7SUjrjJv5yfTf4z7wA09vfOOaYaYloUhcnUEVT+06Swj7zOfhChGEWB8PX1RheRFOrnzXZcjv1Vw= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:40 +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.2538.019; Tue, 17 Dec 2019 16:15:40 +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 31/55] staging: wfx: declare wfx_set_pm() static Thread-Topic: [PATCH v2 31/55] staging: wfx: declare wfx_set_pm() static Thread-Index: AQHVtPUomNvdF9c8U06XszlJrpgzug== Date: Tue, 17 Dec 2019 16:15:11 +0000 Message-ID: <20191217161318.31402-32-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 135d5509-bd38-48f6-5616-08d7830c4a80 x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: lav8zDhbJ9zi7PJuf3gJZ1rF5cJFuQu2rUkvpm3VZPfHdFjhBIOQjtc1OKQdtNaJcsgqPdyRdshlEe4nCSixFi1mb/CY7M1SqpKFMjQlO2OrQykYTJpWrkf9o11G8ltXAPUprIAqYnl4uMCwh3QbE/51dVbizWTfEG4qp8ZV2RcCdqGS3GL1cwOMgklvLJ2kXGjZwVzzVuW/ok7OKJRZnmPZ+LDXXNPwvKtXMFZfQGzKZfnNqZuN7Ae6QHh5az2Umg6dUh6l4CfyRmHWpUbaG3oTy7f9ON1T3dth+Y05BE8QSWghuxkTLSPOJ0ibuqBf9h1ESjqYDv1H4K7ag+/iiOC5Kk1GpBp2wahHUSLd3lzrnCVrYJFjCBGPUQvMiD8IiAH+beCqnyoT4D2xp1nsYpidrigHnRMcl557Z/Saq4nZ3BlrT3sdW6wOitdhAea4 Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 135d5509-bd38-48f6-5616-08d7830c4a80 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:11.1254 (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: 9aLdogLEVfxVkdGidZrZasyKNRTj3Dygsh4T3rMpqTxVDgXF0ek4Ievwijk4qCtwjpI3yOyn2u+7m8KTnq51vA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller wfx_set_pm() is now only used by sta.c. It can be declared static. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 57 ++++++++++++++++++++------------------- drivers/staging/wfx/sta.h | 1 - 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index fb45aa66fc56..eb087b9c8097 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -326,6 +326,36 @@ void wfx_configure_filter(struct ieee80211_hw *hw, } } +static int wfx_set_pm(struct wfx_vif *wvif, + const struct hif_req_set_pm_mode *arg) +{ + struct hif_req_set_pm_mode pm = *arg; + u16 uapsd_flags; + int ret; + + if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid) + return 0; + + memcpy(&uapsd_flags, &wvif->uapsd_info, sizeof(uapsd_flags)); + + if (uapsd_flags != 0) + pm.pm_mode.fast_psm = 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) { + pm.pm_mode.enter_psm = 1; + pm.pm_mode.fast_psm = 0; + } + + if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, + msecs_to_jiffies(300))) + dev_warn(wvif->wdev->dev, + "timeout while waiting of set_pm_mode_complete\n"); + return hif_set_pm(wvif, &pm); +} + int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params) { @@ -371,33 +401,6 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, return ret; } -int wfx_set_pm(struct wfx_vif *wvif, const struct hif_req_set_pm_mode *arg) -{ - struct hif_req_set_pm_mode pm = *arg; - u16 uapsd_flags; - - if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid) - return 0; - - memcpy(&uapsd_flags, &wvif->uapsd_info, sizeof(uapsd_flags)); - - if (uapsd_flags != 0) - pm.pm_mode.fast_psm = 0; - - // Kernel disable PowerSave when multiple vifs are in use. In contrary, - // it is absolutly necessary to enable PowerSave for WF200 - if (wvif_count(wvif->wdev) > 1) { - pm.pm_mode.enter_psm = 1; - pm.pm_mode.fast_psm = 0; - } - - if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, - msecs_to_jiffies(300))) - dev_warn(wvif->wdev->dev, - "timeout while waiting of set_pm_mode_complete\n"); - return hif_set_pm(wvif, &pm); -} - int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value) { struct wfx_dev *wdev = hw->priv; diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index 721b7cee9c10..4719807bc25a 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -97,7 +97,6 @@ void wfx_suspend_resume(struct wfx_vif *wvif, // Other Helpers void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad); void wfx_update_filtering(struct wfx_vif *wvif); -int wfx_set_pm(struct wfx_vif *wvif, const struct hif_req_set_pm_mode *arg); int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable); #endif /* WFX_STA_H */ From patchwork Tue Dec 17 16:15:12 2019 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: 1211517 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="OTnAvgH5"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjxz1VCCz9sSK for ; Wed, 18 Dec 2019 03:19:03 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729402AbfLQQS6 (ORCPT ); Tue, 17 Dec 2019 11:18:58 -0500 Received: from mail-bn7nam10on2081.outbound.protection.outlook.com ([40.107.92.81]:6496 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728958AbfLQQPq (ORCPT ); Tue, 17 Dec 2019 11:15:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L83fGUrgq1dsjFLLLKJF0H9R2xcaw7j34SYlv0o48YqpVy0k09N8Zr9LoR1frUVCboJS7MNeLzdoO+H1RbJZL/eARy0JE1cU/tD3eJSahLI7s87F+g37EQElOoJTasE8Yw+B3/HnbUDttr9gdmR38Ed9aQT6QxQkN/+NAjBJfOBZJFxdwMXCRL2D4+Hf7HmoqfgWe4YyoP+XyG4ZJ5LaNGWZmFYwQZHNImDnKd3lK1CRq84Jwm0VSmxVkozQjO9O7qLHfxWV6qbJuWTsz3gW9JvfWLqK0sWONXN3iHW/cTLPb+vtD9THXjALV3UyGT2rGAfi2UdimSyvQ4fzL84yGg== 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=L2XACO0dpTiYEzM0HmaENcUMzlW+3tomdmhqT6ZUZlA=; b=ls913lfEcKqK+y50hTa+8fs0SwWodOljr5Tx0UcUuNX91ciDQv+lWN0ev3CAM57do0Cno8TkOz7JF9K7SvY6QydHKYp9I0c83wDt5stquDIVE1VXrhNyg+s8h1fRIErXIzvF26KBmrJsHu/zsPB4G9VdJ5q/9cWlTFpU025nvcxB6yJYyDbJSNkNsUdvNBA8aiN8Se609LzJVSnvRnXY+8LwO1BjLTIq64HGbXKe+bbvbua3GjGDwzXIyjBiCNLe+HP7ua971Tk92K0TUscNTVrJ2b51eUpjFU22P+A0G/bceY6q4HChH7bSLP0S3xKwJckJRcpxkZQ1n8G9OdpWlg== 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=L2XACO0dpTiYEzM0HmaENcUMzlW+3tomdmhqT6ZUZlA=; b=OTnAvgH58dNq/CI+qhTaM7B8/DtkxE3wYY8AiHElb6pJhIWyOJdkjEqveF+SE/Qohb8TS5Ej17zGQdSN3lUNitOhxeYX3D0OPO0KGFg+wD48QumRjnG5NW+ZvzPp48S41gjVAfTdQpXrPcK1HFtkOWfaXwcaohyDLjKGcmOgAbw= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:41 +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.2538.019; Tue, 17 Dec 2019 16:15:41 +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 32/55] staging: wfx: drop useless argument from wfx_set_pm() Thread-Topic: [PATCH v2 32/55] staging: wfx: drop useless argument from wfx_set_pm() Thread-Index: AQHVtPUpo7oG/S2dEEeGnUWnLCzT5g== Date: Tue, 17 Dec 2019 16:15:12 +0000 Message-ID: <20191217161318.31402-33-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f34e4e10-12fd-4e6e-c618-08d7830c4b54 x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:843; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: 08CT7vNgjEZs3BM0DuHb6N1veMpXsUs7++94t5RcQtjpnAOUOUCgiVXnysM8a+tdNucdcSQX9pa8yY74OLRjUgK3O32gAnVN82Y0F9ilbTsdrj5CiA9W9b50Mbp6nTvXPD2S/LXPoxRaWoJUgX8S8QptQiifVXYAThnlTG3GNAMHwlgK3Nu47Zvbt5rtw/B1/Dkz9syBL6r3doTiHo0JDj0jAFiyitFNNN/8u3+iH8kwdBFGnh6JXQ551vnqruv6TERlLoSd9IBphyQYrfgfPIoZZHhJRzgYmCR4eeb8SxM8hw/G4KVS7bC9LqECrBFi6P/ESHMuL0MDR9eAZJ0LD7od8LjHJ1+H6Zat5Xmpm5IMOxm0nro7rxm6xKPhhjENMKiM6O+V5G80YiwKdttFGlzHjpWrhWcg4V5hkNdBeFX3JO0/lUnyxPfFiedztwzn Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f34e4e10-12fd-4e6e-c618-08d7830c4b54 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:12.5756 (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: J8+/7z0f2ZknzlPAwxcygyXz559gwUieRGTsSc0hPzQ9nN7dOZZ5DOqm0irO7lXsSoIfoReq1G/Se/mUGCmB8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Argument to wfx_set_pm() is always wvif->powersave_mode. So, we can simplify it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index eb087b9c8097..ee1b15950389 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -326,12 +326,10 @@ void wfx_configure_filter(struct ieee80211_hw *hw, } } -static int wfx_set_pm(struct wfx_vif *wvif, - const struct hif_req_set_pm_mode *arg) +static int wfx_update_pm(struct wfx_vif *wvif) { - struct hif_req_set_pm_mode pm = *arg; + struct hif_req_set_pm_mode pm = wvif->powersave_mode; u16 uapsd_flags; - int ret; if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid) return 0; @@ -390,7 +388,7 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, if (!ret && wvif->setbssparams_done && wvif->state == WFX_STATE_STA && old_uapsd_flags != new_uapsd_flags) - ret = wfx_set_pm(wvif, &wvif->powersave_mode); + ret = wfx_update_pm(wvif); } } else { ret = -EINVAL; @@ -1014,7 +1012,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif, hif_set_bss_params(wvif, &wvif->bss_params); wvif->setbssparams_done = true; wfx_set_beacon_wakeup_period_work(&wvif->set_beacon_wakeup_period_work); - wfx_set_pm(wvif, &wvif->powersave_mode); + wfx_update_pm(wvif); } } @@ -1451,7 +1449,7 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed) } } if (wvif->state == WFX_STATE_STA && wvif->bss_params.aid) - wfx_set_pm(wvif, &wvif->powersave_mode); + wfx_update_pm(wvif); } wvif = wdev_to_wvif(wdev, 0); } @@ -1591,7 +1589,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) else hif_set_block_ack_policy(wvif, 0x00, 0x00); // Combo force powersave mode. We can re-enable it now - wfx_set_pm(wvif, &wvif->powersave_mode); + wfx_update_pm(wvif); } return 0; } @@ -1666,7 +1664,7 @@ void wfx_remove_interface(struct ieee80211_hw *hw, else hif_set_block_ack_policy(wvif, 0x00, 0x00); // Combo force powersave mode. We can re-enable it now - wfx_set_pm(wvif, &wvif->powersave_mode); + wfx_update_pm(wvif); } } From patchwork Tue Dec 17 16:15:13 2019 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: 1211520 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="LYnpbL/7"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjyG0tX9z9sRM for ; Wed, 18 Dec 2019 03:19:18 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729409AbfLQQTG (ORCPT ); Tue, 17 Dec 2019 11:19:06 -0500 Received: from mail-dm6nam12on2046.outbound.protection.outlook.com ([40.107.243.46]:6194 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728815AbfLQQPo (ORCPT ); Tue, 17 Dec 2019 11:15:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CeSLagWoXLcS4dkhIJVnT0VPJsfqkwYXYVukBb36GYYe7q7yHVownaKn5SAUv454ySF9oTuY/mCXMygcdgV2wIRi/DvfUB1DKuO/huTjKz6HI0J8uDbBJQgIdmNE8pu1wxEZELUPGTozNCDmlutha4/uWJucDIMu2+w9bVYF+qcAx4xfqSlq4x0/IhDGgOrmdA+DDPhpeMKveNDNDwcvMMKjSJVN7Cbcbmvxq+9moiDSVGvXuyPHFe6Es5VKT3b1izaIF6MC0o5lKJ8WEusZR8x4Y7FEgb48oEycI2i/Eov7uy6UhsOZabJtFYzXIIQuHT7FhpMcZvnKGpPPN3xtDQ== 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=qhyO1ai0BtzecUTGvSrEJr/1df5UB7nIlo07n7R6xAs=; b=bc3suMsD4ler8U2gM2OUd+ou3IVhTNg9gIFRIYsKhW5XnzqqewaroAs0ehsRJIB9elabcOpwQljoFYtJi+Nnf8CrDFmrNt9KLGH7ST7IcsXPj/Vyss4tGsys1rfUULNGgsdJkVjjZ9lpCNDFjO3oLiBZOjYfUARR4DrIWvw0ByWM8ziKoPe57yJyuy5SnSRfQT+G5EPKDLqAjRxAxnMTUDM22PHVTCDSXdMpd4Wglo1+lAV1ncPUV43Yt0n+KwRGd2H2F1FYBuV4hLpE6AxqqNzAri+rdlsYwjyzpwxFzSskHLRwzAxGguNQI/gXWkLkFJSBqtzEmbB5dlWmnL9IXA== 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=qhyO1ai0BtzecUTGvSrEJr/1df5UB7nIlo07n7R6xAs=; b=LYnpbL/7211wweAg+8MvunFAJA/PoCGqpJQ4FRON2vKxCVNonxQpO1ijLyDSZ4r+iIfBne3r9gFCn9bYbmW5AMDWDlnaUCOe9e04T+ga1pgCZlvEMr4fVlZW9t2itzY2yzc5gWG0PAAus617VtPUZagrxVHLJ0TJTSqcWHzVvuU= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:15:41 +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.2538.019; Tue, 17 Dec 2019 16:15:41 +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 33/55] staging: wfx: remove redundant test while calling wfx_update_pm() Thread-Topic: [PATCH v2 33/55] staging: wfx: remove redundant test while calling wfx_update_pm() Thread-Index: AQHVtPUp5AxRS0f8bk6v6H5krKe7aw== Date: Tue, 17 Dec 2019 16:15:13 +0000 Message-ID: <20191217161318.31402-34-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8a173258-b71b-4d2b-319b-08d7830c4c2b x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:785; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(66574012)(186003)(107886003)(8676002)(4744005)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4477; 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: KZobTmjnh2m6hUhfk6abJn9tJyHuQ4ii8n5KMGyniOSgm4c0bqklqeQzaj8R/kigrHi91tJSIUcf+XB9HZ+i722EfygHdeHY7X1QvJSwKm2ReO6eDb6XpfvSBLNoZmLlOhzkQjWI3irkCYiCkFYCX6ytMgrjRSLgbIdvbnusgHyBP58Al8DfUAOv788f9i5FJwl6p00ZAlG+SzQhtQOpvqohrOcPEbKS75WiK9vef4tcoVtEhvhyomZEqb1Ue/47rFPHa56TD5Cqhe/N+zCfbTyaPHWBwIp33h96SDt9DUIMBDBuBHfW60vwVdbx6fWF+qzHs0R1P6F2cvlk8ekoagZV6grLzvzcZDaLzyFWVoDMHkFjuTv6pTSXVA2xYmQRPNKuSXR4qTeobUN90wJbI61H/I7bQlnlU6KoDOQVlVtVgp1ThhDShq2i5I8tU0SP Content-ID: <628F67FF3ED5EA409F89810D2DC7E635@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a173258-b71b-4d2b-319b-08d7830c4c2b X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:13.9858 (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: 6elWPhr+K4ni/C3Vji995rhJddkrp//R58MTtdBC1Qiqr8/pOWXCfyIR5RYeySJwMgg10OKS7fvCKWnxiQEsrw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Condition about wvif->state and wvif->bss_params.aid is already checked at beginning of wfx_update_pm(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index ee1b15950389..91fa4d8aa37d 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -1448,8 +1448,7 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed) 2, 255); } } - if (wvif->state == WFX_STATE_STA && wvif->bss_params.aid) - wfx_update_pm(wvif); + wfx_update_pm(wvif); } wvif = wdev_to_wvif(wdev, 0); } From patchwork Tue Dec 17 16:15:15 2019 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: 1211494 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ebzYkDlc"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjtF1zLBz9sSb for ; Wed, 18 Dec 2019 03:15:49 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728982AbfLQQPr (ORCPT ); Tue, 17 Dec 2019 11:15:47 -0500 Received: from mail-dm6nam12on2071.outbound.protection.outlook.com ([40.107.243.71]:6540 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728959AbfLQQPq (ORCPT ); Tue, 17 Dec 2019 11:15:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WTpJKJ5kzI+DEwLrlOHtXew5NG1tCkkGgHbsBeRHU0PDSuC1bXiOh1y2B79+GZD5hYOTXJ2m80gFxJxkGOXXJOHvkTHmHYqQjtlt+Dtmh7TCb7WkHBDopxgSrqBl4405pc2Hyf0UrAhfPTFok6EYKw+zQDJFh05FwvKGNyyD1n7XF40zoWCe0psXFrHQnpsHgeFomqSp/OVQ4nyPRksA2+1EHyYTrhLNlRRYfEXKs5ydkONj0F2SMzWXvQtL+9KRa/SYceiaQNd1IXZ40QB9nwl60VBhPyfKZ3xZyVuDu/xiafLyiT0yZIe74ZsgMvrnbelD3znhUf0AmMPfCqTZFw== 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=Eufy3zFzbX1vAfWm/2yW+tV5AIgispF9pG/MHD3WeCY=; b=obpte9sksxVL8PyWi+96Ds2VTJtZ3WE9lPnNTmO2pYpuoqkDSLDWJVM8GTrnsRUnSDH8Oo3lLUBd7ol+dJaKFidVnaQ6LqY433Gqw3Vq0xaI6vC77kqgZnnOD/+i7P4xZNmURbMG1OOgYahko8OW7tAmrrOYIWyWYZtJPEXKVc2ECOtyppJETjXPdsch4XZv73tC7vSUdoAYTse5ipfzC0gZP9i4L5mrfXV8g6hwxa1x86mxBmJSHW3KT6mRzg8zoeX6iIHXuJjmLXdFuJNsHQ6IvY9kFoAlvqjjG6bas8gIrlmsfPae9uumYa2QzbJc2/zeMp8D9XYQzPv1iplmqQ== 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=Eufy3zFzbX1vAfWm/2yW+tV5AIgispF9pG/MHD3WeCY=; b=ebzYkDlcnf49ZLbKLUEWVe2NfqUXRmsyQoBYRlT4D1QNJNH7fGWSP6EwGhGfK90KlG/gmZ++ASrIscvXFNqCNtlG4RWwIJXldkPnUb1Go0Ire5Ee2+xFAru5yTigOaUDvXUsm8qRA+okuMfvMvsGESFeAELFlzXmevTVKp1+h1M= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:15:42 +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.2538.019; Tue, 17 Dec 2019 16:15:42 +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 34/55] staging: wfx: drop unnecessary wvif->powersave_mode Thread-Topic: [PATCH v2 34/55] staging: wfx: drop unnecessary wvif->powersave_mode Thread-Index: AQHVtPUqxAmwZ667vkKtQS/hW9fDrg== Date: Tue, 17 Dec 2019 16:15:15 +0000 Message-ID: <20191217161318.31402-35-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9917fdf6-7661-43e3-604c-08d7830c4d02 x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(66574012)(186003)(107886003)(8676002)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4477; 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: cTRlm+8G7iPKwnVrZkuevw4O/HrlLX4B2PiujFe+5kfy0XkwXGGReLJLSLzDhWiQAIXhMQbSlw7NmKWwbAafhB1JsmSJktOqY1CIgEyFv8hNRNTyVJNmVVGvE/IF33Y+LlKsuIVSbANXleqVRuI83n5K3sbVfE9WUEaJmYnb96t5VMo6pZ8Ou9qzITwvcWl+uksKNZmPNcD/FqAIS76zxpGmBbVDCNPNAdgFA4uV97lex1hTc5L405ML0U61/G5eMRHlAbE4e9pgowGNn6jYDOK98dtBkJl9aplhVwmees/nLrFJ8QVodrshQV3Ipejisu01Mzu83lg0omsXjGxgHpmKXgQpOmLUFo/pnr908QsmD+7ddyY7kXlm+Bc6XpPSH5JPmHlprMLup/aiQNtyHouK4r71Xdezl2dqtaoxDpK1rlTydkD4i4YBJggZW2fs Content-ID: <65266D1356439E4590E55DD1E0AE537C@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9917fdf6-7661-43e3-604c-08d7830c4d02 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:15.2551 (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: PpdKwURKeYetdX13dMc7Rh0i90wMKuBTYgOAeuynI2RGAj9x6Tbx0vtVhc+a4cdnxymwCHW5XIzpBtDSymytNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Power save status is already available in bss_conf. So there is no reason to keep information duplicated in wvif->powersave_mode. In add, type of wvif->powersave_mode is low level struct made to communicate with device. We would like to limit usage of this kind of struct in upper layers of the driver. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 31 +++++++++++++------------------ drivers/staging/wfx/wfx.h | 1 - 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 91fa4d8aa37d..c57135f77572 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -328,12 +328,23 @@ void wfx_configure_filter(struct ieee80211_hw *hw, static int wfx_update_pm(struct wfx_vif *wvif) { - struct hif_req_set_pm_mode pm = wvif->powersave_mode; + struct ieee80211_conf *conf = &wvif->wdev->hw->conf; + struct hif_req_set_pm_mode pm; u16 uapsd_flags; if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid) return 0; + memset(&pm, 0, sizeof(pm)); + if (conf->flags & IEEE80211_CONF_PS) { + pm.pm_mode.enter_psm = 1; + // Firmware does not support more than 128ms + pm.fast_psm_idle_period = + min(conf->dynamic_ps_timeout * 2, 255); + if (pm.fast_psm_idle_period) + pm.pm_mode.fast_psm = 1; + } + memcpy(&uapsd_flags, &wvif->uapsd_info, sizeof(uapsd_flags)); if (uapsd_flags != 0) @@ -1432,24 +1443,8 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed) if (changed & IEEE80211_CONF_CHANGE_PS) { wvif = NULL; - while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - memset(&wvif->powersave_mode, 0, - sizeof(wvif->powersave_mode)); - if (conf->flags & IEEE80211_CONF_PS) { - wvif->powersave_mode.pm_mode.enter_psm = 1; - if (conf->dynamic_ps_timeout > 0) { - wvif->powersave_mode.pm_mode.fast_psm = 1; - /* - * Firmware does not support more than - * 128ms - */ - wvif->powersave_mode.fast_psm_idle_period = - min(conf->dynamic_ps_timeout * - 2, 255); - } - } + while ((wvif = wvif_iterate(wdev, wvif)) != NULL) wfx_update_pm(wvif); - } wvif = wdev_to_wvif(wdev, 0); } diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 781a8c8ba982..c82d29764d66 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -125,7 +125,6 @@ struct wfx_vif { struct wfx_scan scan; - struct hif_req_set_pm_mode powersave_mode; struct completion set_pm_mode_complete; struct list_head event_queue; From patchwork Tue Dec 17 16:15:16 2019 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: 1211496 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Fl4yxAJf"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjtM5yzgz9sSb for ; Wed, 18 Dec 2019 03:15:55 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729043AbfLQQPy (ORCPT ); Tue, 17 Dec 2019 11:15:54 -0500 Received: from mail-bn7nam10on2081.outbound.protection.outlook.com ([40.107.92.81]:6496 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728975AbfLQQPs (ORCPT ); Tue, 17 Dec 2019 11:15:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PJW3WyGdL3SSh6zdPjFy/Oe7EgKzYIYJxWnITkVOFzUSRFbIkTli5eoVZFW3PZv+p2AoAjuAxIshwjxE7HcaaXzrgVPdmNqcH/UCGvWqsiy0Xeu1FfZK23vf2L1Ufoi7u6yogp+nTZHft9pBQY47PKnTxBfc9X7AgArRoofg3CWwcsVNpTcKFb8QzcL1ghl3+1Koxff+5TjU5UdADJFZZo3M/xw1n/gHdy98DVB0kduyG2x2WlG6Oe2oKqvULu8fSPf2TaHqfEctlfrdexWpsrNe8Sw/iQ0/zGTl78A+a2ga01lDnUBERsJyVuCjqKbGjqi2QMBGvyraNqHnb2Zmug== 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=LsYEN3xCNjMITk1ynv6bBic/C8RRN8e9RiyMJczZy8A=; b=jsp6naKKODLakAahNv/rdiekS035airqPrBnmNm/+tAU/LMumWpoAfMCHG4SMuMiZ3VInwpJejMMck4/soWCSdYz+N1227vVWI847ApFYQkL44iyRQo5cfyMir8EJCgYALpiHYViOOUehQFK5lOqKxPVR84Xxv4+omTGvpRSAHQ2b+wbkd0Im4UHj50FSQLyfFGIhvFx6LYTdiVwhUQT9wVvlCZ8xBkasbFn+24k35AcPK9wRTnjRi8WZLhHe0hYm5HzDiPphVN8A7kos01RMou/c7vCksk0GTBD5UfxdVu8mhficVzHqzeogT8dZqHTcVJGCueG8llXkzbkrqRZyg== 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=LsYEN3xCNjMITk1ynv6bBic/C8RRN8e9RiyMJczZy8A=; b=Fl4yxAJfBN3meDnMTJCq+gFdOVF6NmPVgK542UwpWqgZ6+R2TRKi48A5pMpZ/PnYo+NtW5iQQ1lhougv23aLcrWpyoRAy2riAoUrgeRdl+Vxqom+OfxGS+NoR+i+cwnaSVQLgCuHNDLq8hb9OeBTCXrIJFPEDYneaE0BDaK/WFg= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:42 +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.2538.019; Tue, 17 Dec 2019 16:15:42 +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 35/55] staging: wfx: do not try to save call to hif_set_pm() Thread-Topic: [PATCH v2 35/55] staging: wfx: do not try to save call to hif_set_pm() Thread-Index: AQHVtPUriD2tbdCv5kG06TO5hzkHMg== Date: Tue, 17 Dec 2019 16:15:16 +0000 Message-ID: <20191217161318.31402-36-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c4439483-8024-40f5-8c54-08d7830c4dc0 x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2803; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: oJmg0mNijgUFeAC7jq8UQlPXhK/Wrttw+QdeGl5z+OSwtFJb1Sa1h3sX/VA3B9tjHnbn3owficNr1A7iRpziZrDW1XunvseUhiw5JjmD4rWGKDI4RUDx0QIjLFlpMJDyE429uiK1a5LL5UpAvEosC8HcJGDQJVvQ0GaX+S6OV9+HKFwyPkH9IzQ8SQUixfSpOMAIzgQPaXXTumkJL4Uswi0xHVmLNaVti2jLwmZBgvywj5k/gqFaY46ensyWClwGqKHTK1CsOdW4fOKjDVMgoYNjoYJoccVSQLCeBEG2rRKtiV5aWI/wxGRTnhGDV89fmFMF2x1cM4/oMNqM2YBzPJMXvfFO3UWpnkfI/vO618uk+XydD253i9Vza8jJmbTrE/CsduZO5iOLIBMdww9GcqgAgmq5bnZO6OEOHFZqiFygeBMX8bvStY1FH3tGyBIE Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4439483-8024-40f5-8c54-08d7830c4dc0 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:16.5284 (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: YaO2E8bSZXFheEKAEh0bsLcAPhT2yQxCt4Bc3GPBaNxfnWxjCvVxcsbPmxDRCCGkcCZrlP1J79mIWup70WZBKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Current code try to not exchange data with device if it is not necessary. However, it seems that the additional code does not provide any gain. So, we prefer to keep a simpler code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index c57135f77572..dcb4693ec980 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -371,14 +371,11 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; int ret = 0; - /* To prevent re-applying PM request OID again and again*/ - u16 old_uapsd_flags, new_uapsd_flags; struct hif_req_edca_queue_params *edca; mutex_lock(&wdev->conf_mutex); if (queue < hw->queues) { - old_uapsd_flags = *((u16 *) &wvif->uapsd_info); edca = &wvif->edca.params[queue]; wvif->edca.uapsd_enable[queue] = params->uapsd; @@ -395,10 +392,8 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, if (wvif->vif->type == NL80211_IFTYPE_STATION) { ret = wfx_set_uapsd_param(wvif, &wvif->edca); - new_uapsd_flags = *((u16 *) &wvif->uapsd_info); if (!ret && wvif->setbssparams_done && - wvif->state == WFX_STATE_STA && - old_uapsd_flags != new_uapsd_flags) + wvif->state == WFX_STATE_STA) ret = wfx_update_pm(wvif); } } else { From patchwork Tue Dec 17 16:15:17 2019 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: 1211495 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="WftvVjyq"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjtL3f1xz9sRM for ; Wed, 18 Dec 2019 03:15:54 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729016AbfLQQPx (ORCPT ); Tue, 17 Dec 2019 11:15:53 -0500 Received: from mail-bn8nam11on2041.outbound.protection.outlook.com ([40.107.236.41]:6164 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728985AbfLQQPt (ORCPT ); Tue, 17 Dec 2019 11:15:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cc5woHWIBU1vVGxoCPShMpjuvN+dZMDzVjG/UZOHnomc6FVk022YIkQoWMwV90w8BIq+Mzl8bI4mSoU/6z3bvJ6J7Vc0N/C0CYQPqBn7Pyj/GeKSq6PbAV8vEij+FZWlPp7fJDA2mT6eqeTt48gb03SBWutfoY8cShkND/oZCs5Kw1SoFYsNAmVFmm1a/x9TVyhwhaNMcr1jn+yuhn3O+JbgsXwMFZq0Ab7gVokOATX2GkebFvmgrM+48vXUw3XVCaG27UvX98hwS+fc0FLKpae5DCVOmNDrI8mPa0TkCTzmg3Wp9Nh2tip2Esl3/3f0Ns0LKTrl+qs7YGORhuJDaQ== 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=fBtnj1bNQTnGGhOpk3jCRHj24nG0onADt+L/8QwqKtM=; b=WTrGBJD5fkei/w0qMvp7QqMXmzgat3iG5553q22oKs97DkvtffTlXZTFOn+f/w4ZDr6C6Q3Ix2lfaRidsZ6ZqddRyh/gl+4px3o3Rcw352NO1iaaai3Mp3LuE95oV+qqdBVa9otRxw56ezxm862/v+aLj5ZjTGlJHoC8jOEdM812GEPUhur1cYOaEi5qRTPON+5tyAy1Rj2MRAxO+NYPEMK6FXlreGDbLUnBu+rWbngljFzcqpThkMH/D2OGJ+UO8SBcNbG4fFPY0dgy5l7nKgzg3X6n0JSjTzJ2xd0RhzmbWlhGajGALyp/aoYQoOU7MvBJgm4I/FgvwsUYzpj8OA== 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=fBtnj1bNQTnGGhOpk3jCRHj24nG0onADt+L/8QwqKtM=; b=WftvVjyqZnei0p8O4OmcEjKk2S5ArJaLVkOa83oJ6/UbsX4OVKtd1rh8+vtvNHdgAo7JhRJlmS9Pe+J3STdJu03SqlfWucdH1/0Gelnt3Emv/Cn2nhPS/grexXd7SxRokyL/Xwph8lWtGPbAt/D75P9JNdqkDk4iNlg/ZC0nKFI= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:43 +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.2538.019; Tue, 17 Dec 2019 16:15:43 +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 36/55] staging: wfx: fix pm_mode timeout Thread-Topic: [PATCH v2 36/55] staging: wfx: fix pm_mode timeout Thread-Index: AQHVtPUsDpz282pF+Eq5j4+Emd0k5w== Date: Tue, 17 Dec 2019 16:15:17 +0000 Message-ID: <20191217161318.31402-37-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 61fabd90-d3f8-49cb-4329-08d7830c4e7e x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(4744005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: ND5P8JeLMI8X8Ol8TjkyJW4dltFse2Bu/0KieFDyB5/4FCO+m0f83+S1LLU4t8FMVlLEhCf8AZSxvkgw2wzwjqK2Ub3JbmBPQv6YPkBTfCLe79h4UMTTiGKoHOmB7hMeydqigvKCI9s+Dit0WFBH6c03GZbz6900ADVZO15QapCRZ8nvVQgkt703tsrZxaaBkcmrm3Go7a14OkyQwERPqECF0+gNmoOtZGMKgGLZOUcOGTIS8jxXW3zpVs6o7LU6JsWkJeGX+nMTh6k29GNwI6FibT+r6u730NvaK95hDGgwSjX7a5eOFA4F7anqtyMpx3aAMerWLCl+7MJ98ea4PR1J8mQJX7chyHVyUYguUkfgnvUU7RLe4brhabs2SwMla3bUCUwYqjS9VO7IMDid6w1ElCNp4Iwj7pjo5mOg80oeZ/W27vhdgH0LhQETmv+N Content-ID: <44BBF00B9B784E40BA7A13590F05A826@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61fabd90-d3f8-49cb-4329-08d7830c4e7e X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:17.8756 (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: AmDam+g1ibTXobGEfQ1M2c/dUYPXF8Ipp5ryuK6Xw/hICx2PBC8s6/x8MuUWwsUIV4F2wfNAHWzzhQ7RZRsVjg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Maximum request time (how long a request wait for the medium) is set in firmware to 512TU Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index dcb4693ec980..42b0d01d85cc 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -359,7 +359,7 @@ static int wfx_update_pm(struct wfx_vif *wvif) } if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, - msecs_to_jiffies(300))) + TU_TO_JIFFIES(512))) dev_warn(wvif->wdev->dev, "timeout while waiting of set_pm_mode_complete\n"); return hif_set_pm(wvif, &pm); From patchwork Tue Dec 17 16:15:19 2019 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: 1211516 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="cJurI9kj"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjxg4FRtz9sSF for ; Wed, 18 Dec 2019 03:18:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729291AbfLQQSf (ORCPT ); Tue, 17 Dec 2019 11:18:35 -0500 Received: from mail-bn8nam11on2041.outbound.protection.outlook.com ([40.107.236.41]:6164 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728959AbfLQQPu (ORCPT ); Tue, 17 Dec 2019 11:15:50 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PaoJZGR/y8WR5PuoajiMbvyW9R5WrwLQyiCA7489ISX47WErEgC4zYKe/TxN5fgsDuk1MVufLMUrbiPeMz+qXqCUTbmVYq8QJqbUA+/o4Uln9ftQ6WcsbmLHh1F3mEDVZkzUOBdjaVA1abcwq/m/ijeRdFATqsZR3FIbwodpsjRZZ1+maKwUjvHzAMpD9WhV+OQXtlru1Knhwjbu53gNvmKXSNXRMH9IoH5F2ROLxagxt4dkpGN6Q4EYhtAVdnXcT3uXIsqNfg7XV4vYdUdCynAVUNmAbJdFQj1f9h0IGYmKlloaUiL1UTw7m9v+Vh6ugloOktR1xQBYf/+nTaFRaA== 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=d6JE+ScPoQgbxTngVfkGUoTAsmuuz8DyIHnJzKHImn0=; b=bgelZaT6lBKBePakoWxjr9dNIYz22d56k+mt7bN1tiW2UCoW7y4u9KbiQgwQWMsp3SNOsXiVvaraIuFhHBqdTEYxKPfvJOeNyNfRNJIt18VoIkU4AhdIwr+SHXq00Ca60Zr6mNU4A9gZCf/qYGyGuxlhO4ZXn53jxTH9Ric6vVq5yCZqswZb379nJBxzcPuF7oy+C/CskyzldtqgLdYGDRA+WHAsRSxV0YDSo6R6/sz8xvpIVnoVjarsVW99GopK1s2uEDfj/UL1+NsYR5qdcG6zatCI271AHtwpb+7IcvSEfhFn2hGygboZlk6oS5qJPezUC9/5luRQIp0vodlSTA== 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=d6JE+ScPoQgbxTngVfkGUoTAsmuuz8DyIHnJzKHImn0=; b=cJurI9kj/g4sXdGCtalPj65FNrK8NmridCgJuloq1wGTw8zDnzak8p0drnd2pS9EjtZirdiOymB+cymt61/Dkm0CKRkz3XXiv1ufkbkHO6zW/GU0G8iPLTmeHITr1BQ6jmG5yJKUWaiPHjzsH3GXo5NQgoXgYmU3nPGM/xn//yM= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:43 +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.2538.019; Tue, 17 Dec 2019 16:15:43 +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 37/55] staging: wfx: simplify wfx_conf_tx() Thread-Topic: [PATCH v2 37/55] staging: wfx: simplify wfx_conf_tx() Thread-Index: AQHVtPUsL868vn81/0yJsYaLr+/fgQ== Date: Tue, 17 Dec 2019 16:15:19 +0000 Message-ID: <20191217161318.31402-38-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b68acbf3-b2e4-4097-e66c-08d7830c4f5e x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1728; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: S4PmgccgZEOB0PqA9Pdx9A8/O6uGj4XSFTn18KP48fTtQwQ88ijVtBsMuZL/TPR08phNl3TY0nSfFAzdjRcea+TGLVi+212dV4fs93ZX5V89FdO6HeUWL6RkxKu6Ht/3Xatr2PLEfi7g0/eJQjbc4kRMtqYx0N+COT226q1DsiH91QHq1v35QeHMP2fjYhO6ODqus+AuayPfah6HAUOT6iAGcxGd2fNf5q+X6wifSb4aTSYcYJhnOKmv7nThETXaK3pJo20aT+4YIRDbRnPN4GC5FV46IYI9d8XDTopFX4A5V4kbEHWHUWTczSbrWDzRTbtENHEJFCKNNC49uzTP07DC5FgCzt1P25C7S+9e5WsiXiK4eMNr6GACiVM2sAXyGXPwCxQNL6ESFtWKeAfhPeGplKKb8rlK3PVU1QEAj3fw0bN2rfrbXdZptR9dtgKt Content-ID: <14529C3CBA36A446A39E9ACBB38B1839@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b68acbf3-b2e4-4097-e66c-08d7830c4f5e X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:19.2179 (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: TAmuATt9jRc35LbTL2UiYro1ZcY9RHa0uiBd+q3e93LDq//EllmE9UiVo21ocX5Ds+ZuJrW7yi2KhhD6dx3dNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Error management of wfx_conf_tx() can be simplified. In add, the hardware command "hif_set_edca_queue_params" never returns any error. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 44 ++++++++++++++------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 42b0d01d85cc..045d3916ada8 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -370,39 +370,27 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, { struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; - int ret = 0; struct hif_req_edca_queue_params *edca; - mutex_lock(&wdev->conf_mutex); - - if (queue < hw->queues) { - edca = &wvif->edca.params[queue]; - - wvif->edca.uapsd_enable[queue] = params->uapsd; - edca->aifsn = params->aifs; - edca->cw_min = params->cw_min; - edca->cw_max = params->cw_max; - edca->tx_op_limit = params->txop * TXOP_UNIT; - edca->allowed_medium_time = 0; - ret = hif_set_edca_queue_params(wvif, edca); - if (ret) { - ret = -EINVAL; - goto out; - } + WARN_ON(queue >= hw->queues); - if (wvif->vif->type == NL80211_IFTYPE_STATION) { - ret = wfx_set_uapsd_param(wvif, &wvif->edca); - if (!ret && wvif->setbssparams_done && - wvif->state == WFX_STATE_STA) - ret = wfx_update_pm(wvif); - } - } else { - ret = -EINVAL; + mutex_lock(&wdev->conf_mutex); + wvif->edca.uapsd_enable[queue] = params->uapsd; + edca = &wvif->edca.params[queue]; + edca->aifsn = params->aifs; + edca->cw_min = params->cw_min; + edca->cw_max = params->cw_max; + edca->tx_op_limit = params->txop * TXOP_UNIT; + edca->allowed_medium_time = 0; + hif_set_edca_queue_params(wvif, edca); + + if (wvif->vif->type == NL80211_IFTYPE_STATION) { + wfx_set_uapsd_param(wvif, &wvif->edca); + if (wvif->setbssparams_done && wvif->state == WFX_STATE_STA) + wfx_update_pm(wvif); } - -out: mutex_unlock(&wdev->conf_mutex); - return ret; + return 0; } int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value) From patchwork Tue Dec 17 16:15:20 2019 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: 1211497 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="qGXjKH2a"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjtR6dyvz9sSF for ; Wed, 18 Dec 2019 03:15:59 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729057AbfLQQP4 (ORCPT ); Tue, 17 Dec 2019 11:15:56 -0500 Received: from mail-bn7nam10on2081.outbound.protection.outlook.com ([40.107.92.81]:6496 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728993AbfLQQPv (ORCPT ); Tue, 17 Dec 2019 11:15:51 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KokckUPELIkdJuN/VS/I1Hl82Sv6elSjn1iSG3oExz9J3PKMIqX1wc4/ZaAoKXKYAy+3EKYLyiVOOMjgVR5p3DOjrz9ycWNUVSa4lo1FOeHon+aamWXq/+dxicYi2kYgsXfhZ6GzAXbcMnD+Mt4P89oiBZApjx6DlXghT5tcSnl+uEfOrPT5h5FatQdGtXrJG6BIsr7LCMAD/9S1lDGXxUPJvtOmnP/bz8iC7kFDAwYEL1jsYA7bZeXInIRAtQK248GMODHy/1YLldzd6pu/iJKGsTJFfIXOjI+FbCKwhMMMXVlE4tMfUfqKFcAUv98A+4BWmb6m289Zy10JvTuvmw== 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=AKxfHIn3UfcP8BiheuajfFFSvjD3njr1+SQofPKu/sU=; b=J44TFIusLBGUO2ROUKvCRgHNaZVyZUz0EbIuyaGTRyDL8xPVDMHGXPDausW+6Je4SAOnlKdMW37xFs0+XCvdsg3rTOCMSTthBqNTQ/Kg8HUUxUJOThFDqfvpAVzZp2qCmT+WPizZee65VK4gjtyLV48XEhogy2z13Vq/1dkHX2yy0SAkQ2fM1yashmDyvxqMWPYBe6AHqUS8MtN+OudUgGbNts4aJArFM/9JjIaGZozZLZwknv/BOm4uM3g7JuiEULLu1rEf3CEPf9zt/fMakOKa3it1J8R5RGWJMmKiouOCMziqTDG3YS6Bp6M4uV0VP5LgeXVFm+h9ATedtzUNKA== 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=AKxfHIn3UfcP8BiheuajfFFSvjD3njr1+SQofPKu/sU=; b=qGXjKH2aIlvqlQLPCe0fB+01SVzHB2vIfGWrJ62fg05B1bNSttWvLZXljxcc45lyFGxUvBw6lpeVvz/Lfi84zYy3a7J7zOrgINBddOhKFaaleicWvzxGaWoKaFuFXXTES8zM24cW1QNSVHHeQFi9UAz0NQvFE8+Qm61pamFzeoY= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:44 +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.2538.019; Tue, 17 Dec 2019 16:15:44 +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 38/55] staging: wfx: prefer a bitmask instead of an array of boolean Thread-Topic: [PATCH v2 38/55] staging: wfx: prefer a bitmask instead of an array of boolean Thread-Index: AQHVtPUt4iwFHdNV4UmHD5bdoL1eVQ== Date: Tue, 17 Dec 2019 16:15:20 +0000 Message-ID: <20191217161318.31402-39-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 27d00fd2-14c1-4dde-4f31-08d7830c501c x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1060; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: NKT1oiInPTPtQP3NYIYiPMgBhXQutcCJ6DDSfiOkPoE34U4c13cN9JISEmVtO8GwMd8lc76FM4dV/FNGRLvM++zULlg1NzUsTdKweNk0j9PT4s8oLmCtkl+ml2T1EXxwdfRfWSzJLuXjw8b0sw4ox8Huu4IyKxx56vT0nwr1vUOUtVhYfGDkxje+dHChHOpVBjSQb1ldGWIiiT34rNnQP99zWEew3tYDdi27Yt0/GYm4prVcSfEx3Teyrh+b2yKUBoXTuPrCKoOvjXNi2upyagNqDeVIWlmgsoFDxsj5HBxGrUTgCTBnq64jWVAcweCVDi9c3LvyGZGueOT/1TcvK5zpDyELJ82TbIwQBma5OdDUZap04gy+2AKnRVvO2fiX2f2yedMYcQBVZNa2JhwnV9yXJqMm7S4UhTviPRyY0Kw57kDdzslnJOSrFdNaQXtV Content-ID: <43A6274CC90D97468DC7CC6E65370619@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27d00fd2-14c1-4dde-4f31-08d7830c501c X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:20.4802 (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: 6etrvSAvei9DvkuDsGH36pN4HBE6U/JmtFKZ0LagiqcYqH5/vpJE9kScnwC1gTY1pXszvibLHsmdPXM2cwIdvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller It is easier to manipulate a int than an array of booleans. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 17 +++++++---------- drivers/staging/wfx/sta.h | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 045d3916ada8..e59560f499ea 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -119,22 +119,22 @@ static int wfx_set_uapsd_param(struct wfx_vif *wvif, * VO [0,3], VI [1, 2], BE [2, 1], BK [3, 0] */ - if (arg->uapsd_enable[IEEE80211_AC_VO]) + if (arg->uapsd_mask & BIT(IEEE80211_AC_VO)) wvif->uapsd_info.trig_voice = 1; else wvif->uapsd_info.trig_voice = 0; - if (arg->uapsd_enable[IEEE80211_AC_VI]) + if (arg->uapsd_mask & BIT(IEEE80211_AC_VI)) wvif->uapsd_info.trig_video = 1; else wvif->uapsd_info.trig_video = 0; - if (arg->uapsd_enable[IEEE80211_AC_BE]) + if (arg->uapsd_mask & BIT(IEEE80211_AC_BE)) wvif->uapsd_info.trig_be = 1; else wvif->uapsd_info.trig_be = 0; - if (arg->uapsd_enable[IEEE80211_AC_BK]) + if (arg->uapsd_mask & BIT(IEEE80211_AC_BK)) wvif->uapsd_info.trig_bckgrnd = 1; else wvif->uapsd_info.trig_bckgrnd = 0; @@ -330,7 +330,6 @@ static int wfx_update_pm(struct wfx_vif *wvif) { struct ieee80211_conf *conf = &wvif->wdev->hw->conf; struct hif_req_set_pm_mode pm; - u16 uapsd_flags; if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid) return 0; @@ -345,9 +344,7 @@ static int wfx_update_pm(struct wfx_vif *wvif) pm.pm_mode.fast_psm = 1; } - memcpy(&uapsd_flags, &wvif->uapsd_info, sizeof(uapsd_flags)); - - if (uapsd_flags != 0) + if (wvif->edca.uapsd_mask) pm.pm_mode.fast_psm = 0; // Kernel disable PowerSave when multiple vifs are in use. In contrary, @@ -375,7 +372,7 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, WARN_ON(queue >= hw->queues); mutex_lock(&wdev->conf_mutex); - wvif->edca.uapsd_enable[queue] = params->uapsd; + assign_bit(queue, &wvif->edca.uapsd_mask, params->uapsd); edca = &wvif->edca.params[queue]; edca->aifsn = params->aifs; edca->cw_min = params->cw_min; @@ -1552,9 +1549,9 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) for (i = 0; i < IEEE80211_NUM_ACS; i++) { memcpy(&wvif->edca.params[i], &default_edca_params[i], sizeof(default_edca_params[i])); - wvif->edca.uapsd_enable[i] = false; hif_set_edca_queue_params(wvif, &wvif->edca.params[i]); } + wvif->edca.uapsd_mask = 0; wfx_set_uapsd_param(wvif, &wvif->edca); wfx_tx_policy_init(wvif); diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index 4719807bc25a..74755f6fa030 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -37,7 +37,7 @@ struct wfx_hif_event { struct wfx_edca_params { /* NOTE: index is a linux queue id. */ struct hif_req_edca_queue_params params[IEEE80211_NUM_ACS]; - bool uapsd_enable[IEEE80211_NUM_ACS]; + unsigned long uapsd_mask; }; struct wfx_grp_addr_table { From patchwork Tue Dec 17 16:15:21 2019 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: 1211514 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="mffPEm99"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjxK1r7Tz9sRc for ; Wed, 18 Dec 2019 03:18:29 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729249AbfLQQSU (ORCPT ); Tue, 17 Dec 2019 11:18:20 -0500 Received: from mail-bn8nam11on2041.outbound.protection.outlook.com ([40.107.236.41]:6164 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729005AbfLQQPx (ORCPT ); Tue, 17 Dec 2019 11:15:53 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZzV1dLT/F1eftNJPtdY7VhvRxFpQoJhaNU4AByz3vQ60ohgJ30nM1xf5JYgXsqLIQYzHdIyU+IU0tNxNnYGpiRDbt4lwKm26Fm2zYTN07fGljZUTffW9hvVuAWOhkqLBhd1inO/EKyC9qYlnb7P/ahbWohe9EUY36e675XB3EEm6rlTH7f0d7yiShpSaIZFVX9ypRTVSLHvxnG78kygpalfau6ZpeTdqbgJGY0F7LM17wkC/sT2QHSzpT42euuVgINmJi6i/0MxOizEbvKsA9O98c8kn93NSWxtgV2eVzCjF24r9+aPrbfYihQcYxdsFDJ1EN4V9R8nnAnJkqQ9fgw== 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=gbUIsP1n4dfYyvrZwB6Ai7//eAfTyJx2yF6/EgTbM1M=; b=aaMkLCRrdlCTHV7k9ObRxSp9JylWjIcmKfuAilgE2j1laY01CQUHHeteqEuEe9bLFj7kV/0uhWDhvBqIlGDsJtjavC1TLjnFxE6a5349xzhLpU1AjuGgvTYb1JzRIIY0gWfkEmSQdit54BAAILEqqzu3lQuc8dhhLHn3NoW65kT1tYB0d2WCwTP/pnYhWCHiwWvLjZvCh+ftdtKH8+B8qsKtLhScIfNu51U3lEl/qhHPBu0LrYdWlvtb+Bx6JeJ76PRx5Iuf5R6w2u2d8FGG5TC4QlA6AyKlr8T4/qkXSJjDxH5BcdVBNg79bPKkOrV1EkuzA4DHfJ82Pwh+USHWwQ== 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=gbUIsP1n4dfYyvrZwB6Ai7//eAfTyJx2yF6/EgTbM1M=; b=mffPEm99GFEshKnW3lR/so8ERPD2XnEOz3hjHjNM4mPzOFI42VW74Fk8zkFvc3tERBXnoQhLkqob6Bz0hrEoxdG6WTNiOrELa9h1f0BBIo9hPcZgfp6jnbTmVxJaTzopkejoUjPkiO7pmZAQIONS5bE88lRs1lbtqLIp7EM1ARw= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:44 +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.2538.019; Tue, 17 Dec 2019 16:15:44 +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 39/55] staging: wfx: simplify hif_set_uapsd_info() usage Thread-Topic: [PATCH v2 39/55] staging: wfx: simplify hif_set_uapsd_info() usage Thread-Index: AQHVtPUutvY+bqzUVUGYHrCZRp8FwA== Date: Tue, 17 Dec 2019 16:15:21 +0000 Message-ID: <20191217161318.31402-40-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7c9b3e30-aaa8-41b1-4627-08d7830c50e9 x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:632; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: PImR3VkIR02XhwzJJEHwUsndUlzeIV3Ant0xrCmIt4etF6R2qg1uVhHCgHXUgXByGd5nH/RBcwVjCClFFSm+pTFJe+WvMQPU/ecPaf+E0PWvVB0d18tufYvz8A/2CQO+vubGwU8J77Vs45YTUge+GNUbNMygGqWsydLQd9oc/UIwRO98NQvK4EaAPPq8I/vWAQW3mEu/Z+L2TLD7kVz67lx10I5lWamj6njGZtSl4UjAFaPq9qA2Gc+P9maceLSvryIERY/HtX9pWEYCSwEr/z5mjTjs9i1pTSG2I8ZuMVxTPigrCiTu+kKCIdkjElITFtRRIvY/4iER2Y1FKYUv9kfVjsEW7D2eud43GL0+DN0tbJ3XJfq+VVCIY9lE7wj0GWyYYkOw6s5m1R/Z+xjHSrhz6t3dWr/h6InpGg3TCkSjEzg0BqrerDqbQh0+hv0C Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c9b3e30-aaa8-41b1-4627-08d7830c50e9 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:21.8554 (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: ebV6/DXg1VZSNx70BbbAsStO2NfsDnMiZWWAt5tr8v4UQ2y/2/b/DiR40T8EKIeRV86PI/xrtVgoIVb9rXqBHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller It is useless to keep uapsd_info in struct wfx_vif. This structure can be rebuilt just before to be sent. In add, the struct hif_mib_set_uapsd_information comes from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch relocates the handling of this struct to hif_set_uapsd_info() (the low level function). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 15 +++++++++--- drivers/staging/wfx/sta.c | 42 ++------------------------------ drivers/staging/wfx/wfx.h | 1 - 3 files changed, 14 insertions(+), 44 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index 9be74881c56c..d77765f75f10 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -238,12 +238,21 @@ static inline int hif_use_multi_tx_conf(struct wfx_dev *wdev, &arg, sizeof(arg)); } -static inline int hif_set_uapsd_info(struct wfx_vif *wvif, - struct hif_mib_set_uapsd_information *arg) +static inline int hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val) { + struct hif_mib_set_uapsd_information arg = { }; + + if (val & BIT(IEEE80211_AC_VO)) + arg.trig_voice = 1; + if (val & BIT(IEEE80211_AC_VI)) + arg.trig_video = 1; + if (val & BIT(IEEE80211_AC_BE)) + arg.trig_be = 1; + if (val & BIT(IEEE80211_AC_BK)) + arg.trig_bckgrnd = 1; return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_SET_UAPSD_INFORMATION, - arg, sizeof(*arg)); + &arg, sizeof(arg)); } static inline int hif_erp_use_protection(struct wfx_vif *wvif, bool enable) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index e59560f499ea..9eca35d91ad3 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -112,44 +112,6 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad) mutex_unlock(&wvif->bss_loss_lock); } -static int wfx_set_uapsd_param(struct wfx_vif *wvif, - const struct wfx_edca_params *arg) -{ - /* Here's the mapping AC [queue, bit] - * VO [0,3], VI [1, 2], BE [2, 1], BK [3, 0] - */ - - if (arg->uapsd_mask & BIT(IEEE80211_AC_VO)) - wvif->uapsd_info.trig_voice = 1; - else - wvif->uapsd_info.trig_voice = 0; - - if (arg->uapsd_mask & BIT(IEEE80211_AC_VI)) - wvif->uapsd_info.trig_video = 1; - else - wvif->uapsd_info.trig_video = 0; - - if (arg->uapsd_mask & BIT(IEEE80211_AC_BE)) - wvif->uapsd_info.trig_be = 1; - else - wvif->uapsd_info.trig_be = 0; - - if (arg->uapsd_mask & BIT(IEEE80211_AC_BK)) - wvif->uapsd_info.trig_bckgrnd = 1; - else - wvif->uapsd_info.trig_bckgrnd = 0; - - /* Currently pseudo U-APSD operation is not supported, so setting - * MinAutoTriggerInterval, MaxAutoTriggerInterval and - * AutoTriggerStep to 0 - */ - wvif->uapsd_info.min_auto_trigger_interval = 0; - wvif->uapsd_info.max_auto_trigger_interval = 0; - wvif->uapsd_info.auto_trigger_step = 0; - - return hif_set_uapsd_info(wvif, &wvif->uapsd_info); -} - int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable) { wvif->fwd_probe_req = enable; @@ -382,7 +344,7 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, hif_set_edca_queue_params(wvif, edca); if (wvif->vif->type == NL80211_IFTYPE_STATION) { - wfx_set_uapsd_param(wvif, &wvif->edca); + hif_set_uapsd_info(wvif, wvif->edca.uapsd_mask); if (wvif->setbssparams_done && wvif->state == WFX_STATE_STA) wfx_update_pm(wvif); } @@ -1552,7 +1514,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) hif_set_edca_queue_params(wvif, &wvif->edca.params[i]); } wvif->edca.uapsd_mask = 0; - wfx_set_uapsd_param(wvif, &wvif->edca); + hif_set_uapsd_info(wvif, wvif->edca.uapsd_mask); wfx_tx_policy_init(wvif); wvif = NULL; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index c82d29764d66..ff29163436b6 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -114,7 +114,6 @@ struct wfx_vif { bool setbssparams_done; struct wfx_ht_info ht_info; struct wfx_edca_params edca; - struct hif_mib_set_uapsd_information uapsd_info; struct hif_req_set_bss_params bss_params; struct work_struct bss_params_work; struct work_struct set_cts_work; From patchwork Tue Dec 17 16:15:23 2019 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: 1211511 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="XzR/bIzE"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjwN4Mbcz9sNH for ; Wed, 18 Dec 2019 03:17:40 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729325AbfLQQRj (ORCPT ); Tue, 17 Dec 2019 11:17:39 -0500 Received: from mail-bn7nam10on2081.outbound.protection.outlook.com ([40.107.92.81]:6496 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729004AbfLQQP6 (ORCPT ); Tue, 17 Dec 2019 11:15:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gC545bVdgq9SuPEUe/m8h/QniYh7FeciN3ko3gli6ZftD1IYggek7zR1p1QU0sgiYTOxrht5wEp0RGI91HKv/p7zzFl3VA9rFD0EUjPnCEzCfk6lQn+pOReeXVMTI8xmGPJTVJacNs7D0MKYf0k1XSY6qu2pNymZwiewGk8XJJ2TQJ76ih7cGuqBlY51gziGfDYs2zUujIpkhnlaRfk4YcWiFCEcaiLvpFsHV9el/NMYiaT2FxsppRpxsT2fJk7faxwj74l82zWUjXqvEGGva/tLNHCz/yb5wbh8dphYHbyEQrQR6qREGlVyIz5TU3zRqcv4GYXv0THxN7EWhkg5Xg== 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=UZ+/IhbadXELF0xffX7LphSKuGR1MBVq/x6o+jcQSlY=; b=QuL5LobGa5ABEY6xTmyPxGow4hH2Lxdg0hoFTSF3tXmHuQhkNyd4VWiGfH44ukKRJaEX65ymg4gnzblgChI39TGvmrAEP9Du8s5r3CtnnL2puv2FH8sPWJG9JJEWdDWy+DU1uGy2ZwNCuBWcGMeKO8+PtSjDEPmK6Ejm3UcFhpWm+CoysBYd97sbgAFlYHcPTlMwlQU03aIt26Xm4DK1cOCZHKRJL3XOtspwoJSp3Pv0nDZgIh3jyuITHb8ZTHTQpt/wAd9+6LJJErDSxiO+R/2MA9zvo1Or32Sx5wyWYjYoahtxeYlE7PSFAy9kH7duMV/zbKc9WQuTOO6sFrkOAg== 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=UZ+/IhbadXELF0xffX7LphSKuGR1MBVq/x6o+jcQSlY=; b=XzR/bIzEDptyAGTEdDJNxpBu1JSnRw2Y1aZ/Y5DagTMs5aHbhgOFw1A1MzXMiiQXy2hqZpOEn0FiFOB6dqDGhr40fXXEVDf9pVsfPvTthLofZm+MDUWKRIjSL1LotdPgQlzBN1ZiY2BSGILatooTzmopxM7M8+4sysfwTACFwE0= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:45 +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.2538.019; Tue, 17 Dec 2019 16:15:45 +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 40/55] staging: wfx: simplify hif_set_pm() usage Thread-Topic: [PATCH v2 40/55] staging: wfx: simplify hif_set_pm() usage Thread-Index: AQHVtPUvEUamb7q6X02OnND4ftWuCw== Date: Tue, 17 Dec 2019 16:15:23 +0000 Message-ID: <20191217161318.31402-41-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 88c2fab3-f616-4839-7186-08d7830c51b0 x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: MwzzO59ORnjWkAZwlrN2PioEJY8SkxeScTYJCHeOuHHdLtPgxF34eAr7MBcg6lhNNDD+/YlHkuq6y3c+fx9X1IEuXiqPKdIklsOlZK8aCYyqcTJrVJPxgikiyry/s/kh0ZPTBKWUvi5HHCPleWLz1JwBnZNMKNHzijMClWeAsZrB339p2RSjZt1tvaoftba7KUf/ggEXZH4t7EN8tx1wZ++acGu1lgInsewmDFUXjCgvPM/spdag0Ry2r33aloSZQHn0qajRMTY4P9d7sgGYY38/nAMgXP3LBllMvuMxVBqUbPXiBaFeE6FRIXN5cK3WGB6ZnKR2SwOR0b4zfgxiCPLlmFIat+uoTy+Gznc5W8aGtsOickxB8WvCWJcKBqHEsZ4xt5LYVawZHKORB3VmNK+xCl8vrsUUIV/ScwQs69AdPEZIf5qgkZYZ8oMFQDMv Content-ID: <6F331650ADDD674097206FC493A9F806@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88c2fab3-f616-4839-7186-08d7830c51b0 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:23.1447 (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: xiidfCcFSLF3x8pNe6y5CuqQ9JplV0Fx9UbOeDmr0r4EPHgUEE89fC+8nerx4E75bxPCoB6lJFowW75aJAupRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The struct hif_req_set_pm_mode comes from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch relocate the handling of this struct to hif_set_pm() (the low level function). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 10 ++++++++-- drivers/staging/wfx/hif_tx.h | 2 +- drivers/staging/wfx/sta.c | 25 +++++++++---------------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 6fb98ddbc0e2..9cbf9d916f5f 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -360,13 +360,19 @@ int hif_set_edca_queue_params(struct wfx_vif *wvif, return ret; } -int hif_set_pm(struct wfx_vif *wvif, const struct hif_req_set_pm_mode *arg) +int hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout) { int ret; struct hif_msg *hif; struct hif_req_set_pm_mode *body = wfx_alloc_hif(sizeof(*body), &hif); - memcpy(body, arg, sizeof(*body)); + if (ps) { + body->pm_mode.enter_psm = 1; + // Firmware does not support more than 128ms + body->fast_psm_idle_period = min(dynamic_ps_timeout * 2, 255); + if (body->fast_psm_idle_period) + body->pm_mode.fast_psm = 1; + } wfx_fill_header(hif, wvif->id, HIF_REQ_ID_SET_PM_MODE, sizeof(*body)); ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); kfree(hif); diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h index f61ae7b0d41c..bb5860ee6542 100644 --- a/drivers/staging/wfx/hif_tx.h +++ b/drivers/staging/wfx/hif_tx.h @@ -47,7 +47,7 @@ int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, int hif_scan(struct wfx_vif *wvif, const struct wfx_scan_params *arg); int hif_stop_scan(struct wfx_vif *wvif); int hif_join(struct wfx_vif *wvif, const struct hif_req_join *arg); -int hif_set_pm(struct wfx_vif *wvif, const struct hif_req_set_pm_mode *arg); +int hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout); int hif_set_bss_params(struct wfx_vif *wvif, const struct hif_req_set_bss_params *arg); int hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 9eca35d91ad3..b4007afcd0c6 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -291,37 +291,30 @@ void wfx_configure_filter(struct ieee80211_hw *hw, static int wfx_update_pm(struct wfx_vif *wvif) { struct ieee80211_conf *conf = &wvif->wdev->hw->conf; - struct hif_req_set_pm_mode pm; + bool ps = conf->flags & IEEE80211_CONF_PS; + int ps_timeout = conf->dynamic_ps_timeout; + WARN_ON(conf->dynamic_ps_timeout < 0); if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid) return 0; - - memset(&pm, 0, sizeof(pm)); - if (conf->flags & IEEE80211_CONF_PS) { - pm.pm_mode.enter_psm = 1; - // Firmware does not support more than 128ms - pm.fast_psm_idle_period = - min(conf->dynamic_ps_timeout * 2, 255); - if (pm.fast_psm_idle_period) - pm.pm_mode.fast_psm = 1; - } - + if (!ps) + ps_timeout = 0; if (wvif->edca.uapsd_mask) - pm.pm_mode.fast_psm = 0; + 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) { - pm.pm_mode.enter_psm = 1; - pm.pm_mode.fast_psm = 0; + ps = true; + ps_timeout = 0; } if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, TU_TO_JIFFIES(512))) dev_warn(wvif->wdev->dev, "timeout while waiting of set_pm_mode_complete\n"); - return hif_set_pm(wvif, &pm); + return hif_set_pm(wvif, ps, ps_timeout); } int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, From patchwork Tue Dec 17 16:15:24 2019 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: 1211512 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ivxTa0FQ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjwb42XCz9sRM for ; Wed, 18 Dec 2019 03:17:51 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729224AbfLQQRu (ORCPT ); Tue, 17 Dec 2019 11:17:50 -0500 Received: from mail-bn8nam11on2041.outbound.protection.outlook.com ([40.107.236.41]:6164 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729026AbfLQQPz (ORCPT ); Tue, 17 Dec 2019 11:15:55 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WJNKjo8XtLM1Y3d2NxLd1GUvKr75bruHvRtQaDw/rHO0WjdkzQboX/1w8amjX9VVtLnqjVN5CMsRkYNxyuVsZ68rpwxIyvE8m1gRbPegijAd+rm6y4mn8niNviL8vjhIvtskslvfpWjatWhWqKbFGNWGW6+/T1DMYSM+ZFnGTn+bqYJzsXAqVBWZ/iw+xbkumRrbjm/EtzzAx8KQIUo3CFkkFA90QiJ7Lc8onTZCOaXVR3Llth00fpwIBInd/wwGFQEbOTkifiaedOe7e0MZikiwM0pteZINa9NSOb1VWLeR8oGh3cJcv3oAWidOKo+gX5/b0aZ8Ig4bdZ0TajZckg== 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=78O391xvezVfVShOvr/3rZg1ZEK/46UR+LHZdfYcB/k=; b=crWZO6iAfT6RqqmPbjqfx4Ce+WGlI16Ox5UUlKnICBOfftMiniU3DELNSK/zzxJmPW31qGUgtY8Q8p5Hk09huYhzldJUkVLb5j6pmKaIiWt4NWwd+ZYdUTWmahz5vPkPcQ6uNsKyRblfUBlb+XD7ckjw+kWAALwZ2hHtMtuiG8NZbkdkv9m58s0DfhvsxvQERF32aPOzq4RD7+Yja6P5xBeEPZzU7/A/iXHTJYKWFPlKA7RkCnPUzijW3zfvHZRwHKWL5nhSlw+GevFqTnaUTSBN2kCLxHsmAzoI1j3b4Waq+gwRgLw8l+c+VPTSpopRmDyOxOHc1Q+D+A4lPCozlg== 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=78O391xvezVfVShOvr/3rZg1ZEK/46UR+LHZdfYcB/k=; b=ivxTa0FQxERuu4sd1q1cLVZNHNijGaHuegUjP3UoEEbZIxWyT0TcRBcCQXTDqmYYXPjhAlGD7EpfFRWAEY9X6QmZjsZBoVsGR3D8iuKqCggnWegXJaoHWhfz7bqofDnNpON2MJw2vu3bJq88CNnc2bH2utoeKZg+64aZjEMdd+U= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:45 +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.2538.019; Tue, 17 Dec 2019 16:15:45 +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 41/55] staging: wfx: drop struct wfx_edca_params Thread-Topic: [PATCH v2 41/55] staging: wfx: drop struct wfx_edca_params Thread-Index: AQHVtPUwWk98GQmzz0KLSnhUUoS1sQ== Date: Tue, 17 Dec 2019 16:15:24 +0000 Message-ID: <20191217161318.31402-42-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e3bd905e-8e42-4130-cce2-08d7830c5273 x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1728; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: twcIQ2aNkEgCH5ECsCruoMffLR5NgJqlhImVa7+5P9z74eCbBgRvCLhuB2n3sZ6D52Dtt3Ff0dgr+WS3kk1+NVZKEgx5rENiVshqry89Jcl+qvlpO0CFY70jAe7+d6FuMOuhKhcrEA1xoUjr9zRXtPuJR9aptIyW7xqy8DYKP1tXSsMdhyrHIGwpyNEStccKj/lqzZJE1cNd5AI/ttdA5qBfJVb4kegw+13YLNkv0Lh2p5i6eiD5IjUC4EE3/YTUBI0T4fI7RcVieaXqxdYjTE4T3sSHRuL5enKeuVqJQke4gpXSo7tmKBVs9OfXW0Zr8S7KMsgzMQSN/q3rrKCbdP1mMK73ziRPscsAPKR99oRiR1NCM/YnxF6Oab3omGO9ZWtb0YsjoYcTg1c1DSL+VlLQ6sBHj/x+CAJqRXt1zbpWPw27p0VuKA0+qVNY324h Content-ID: <775F3C3EFA365240BDD3943E1FB4745D@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3bd905e-8e42-4130-cce2-08d7830c5273 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:24.3910 (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: xD5FiOFuvaTSSgxvzPYyI5RXNnhsmdIgL/V2N17oILzLu0Oh+lA1nfgERXrECKvTtCJStaH8GXMftqGROsafUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Intermediate structure wfx_edca_params does not help. This patch relocates its members directly in struct wfx_vif. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 4 ++-- drivers/staging/wfx/sta.c | 18 +++++++++--------- drivers/staging/wfx/sta.h | 6 ------ drivers/staging/wfx/wfx.h | 3 ++- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 680fed31cefb..16216afe6cfc 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -452,7 +452,7 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, for (i = 0; i < IEEE80211_NUM_ACS; ++i) { int queued; - edca = &wvif->edca.params[i]; + edca = &wvif->edca_params[i]; queued = wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[i], tx_allowed_mask); if (!queued) @@ -595,7 +595,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) wvif->pspoll_mask &= ~BIT(tx_priv->raw_link_id); /* allow bursting if txop is set */ - if (wvif->edca.params[queue_num].tx_op_limit) + if (wvif->edca_params[queue_num].tx_op_limit) burst = (int)wfx_tx_queue_get_num_queued(queue, tx_allowed_mask) + 1; else burst = 1; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index b4007afcd0c6..d52f618062a6 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -299,7 +299,7 @@ static int wfx_update_pm(struct wfx_vif *wvif) return 0; if (!ps) ps_timeout = 0; - if (wvif->edca.uapsd_mask) + if (wvif->uapsd_mask) ps_timeout = 0; // Kernel disable PowerSave when multiple vifs are in use. In contrary, @@ -327,8 +327,8 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, WARN_ON(queue >= hw->queues); mutex_lock(&wdev->conf_mutex); - assign_bit(queue, &wvif->edca.uapsd_mask, params->uapsd); - edca = &wvif->edca.params[queue]; + assign_bit(queue, &wvif->uapsd_mask, params->uapsd); + edca = &wvif->edca_params[queue]; edca->aifsn = params->aifs; edca->cw_min = params->cw_min; edca->cw_max = params->cw_max; @@ -337,7 +337,7 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, hif_set_edca_queue_params(wvif, edca); if (wvif->vif->type == NL80211_IFTYPE_STATION) { - hif_set_uapsd_info(wvif, wvif->edca.uapsd_mask); + hif_set_uapsd_info(wvif, wvif->uapsd_mask); if (wvif->setbssparams_done && wvif->state == WFX_STATE_STA) wfx_update_pm(wvif); } @@ -1426,7 +1426,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) }, }; - BUILD_BUG_ON(ARRAY_SIZE(default_edca_params) != ARRAY_SIZE(wvif->edca.params)); + BUILD_BUG_ON(ARRAY_SIZE(default_edca_params) != ARRAY_SIZE(wvif->edca_params)); if (wfx_api_older_than(wdev, 2, 0)) { default_edca_params[IEEE80211_AC_BE].queue_id = HIF_QUEUE_ID_BACKGROUND; default_edca_params[IEEE80211_AC_BK].queue_id = HIF_QUEUE_ID_BESTEFFORT; @@ -1502,12 +1502,12 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) hif_set_macaddr(wvif, vif->addr); for (i = 0; i < IEEE80211_NUM_ACS; i++) { - memcpy(&wvif->edca.params[i], &default_edca_params[i], + memcpy(&wvif->edca_params[i], &default_edca_params[i], sizeof(default_edca_params[i])); - hif_set_edca_queue_params(wvif, &wvif->edca.params[i]); + hif_set_edca_queue_params(wvif, &wvif->edca_params[i]); } - wvif->edca.uapsd_mask = 0; - hif_set_uapsd_info(wvif, wvif->edca.uapsd_mask); + wvif->uapsd_mask = 0; + hif_set_uapsd_info(wvif, wvif->uapsd_mask); wfx_tx_policy_init(wvif); wvif = NULL; diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index 74755f6fa030..9595e1fc60db 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -34,12 +34,6 @@ struct wfx_hif_event { struct hif_ind_event evt; }; -struct wfx_edca_params { - /* NOTE: index is a linux queue id. */ - struct hif_req_edca_queue_params params[IEEE80211_NUM_ACS]; - unsigned long uapsd_mask; -}; - struct wfx_grp_addr_table { bool enable; int num_addresses; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index ff29163436b6..5a2f8af17eb7 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -113,7 +113,8 @@ struct wfx_vif { int cqm_rssi_thold; bool setbssparams_done; struct wfx_ht_info ht_info; - struct wfx_edca_params edca; + unsigned long uapsd_mask; + struct hif_req_edca_queue_params edca_params[IEEE80211_NUM_ACS]; struct hif_req_set_bss_params bss_params; struct work_struct bss_params_work; struct work_struct set_cts_work; From patchwork Tue Dec 17 16:15:25 2019 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: 1211510 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="OESGwvMH"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjwF6lb1z9sSK for ; Wed, 18 Dec 2019 03:17:33 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729313AbfLQQRa (ORCPT ); Tue, 17 Dec 2019 11:17:30 -0500 Received: from mail-bn7nam10on2081.outbound.protection.outlook.com ([40.107.92.81]:6496 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728425AbfLQQQC (ORCPT ); Tue, 17 Dec 2019 11:16:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bE5boxovvErH0ODBlXrQaWRdw8CyfMR+fzVTx6WoGyvSlEh3jrJwnr4rWE26VzKfwFhZk2egVR5oItTa7kiSD66UpiTbOWvPk8AE8JPtcWJGUBtNDX2yLkowHZQHkaJB8tPWY+pfD8TUcqaBOgyIsUK9E7+pVkDY68XTr8r5TeHX4A6Znb7wl+6cshJjYstwoYzYyu8zmSpuVQIDq7/fkJeq2dQep/6L3P1Sg3ZfLRkuv7u6mGchbfouqTOWsULMb8FL5DVBGlahYwaosoyTQMayqkxMunYqbEDAcoMMRbu2O/ecZclL9uAp4kOXTiZGV6V0LvrORbkk8uEl58cAoQ== 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=yVrtL/C7YQ08Pb+7fFb5TFrEB10EjfSCEs5gRYHh874=; b=G0WmCX3wE8+pa2/9f9syNjBYwbMpR3GDmkC41LD0jDNPDQb27SGw5WhsQuxTGWY0wsS9W/K26jV18bIad9kzaWep25925XK6619vraqS3dxbyooF2JaE98WIMGwpn/yWNLkFLOvSVIi3SgGKr27q+wpIh51V81p3iI84pdmL12lmw5uJo4gDHBOSpbQqChBlJlfB8m4W7BZcU3Q4GELqiJr+fWzwiuqY/hpEe3HECnQHXquHTcuT8cI/Y1zeYYqOj2G7fSKMPnZj9BX9GQGzBieqWrg/d6VS/rZfkg4ulxLtIDuZJl2bP2yZ1ApjqPxFu8XJy1s5hdsGuerHByoyvg== 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=yVrtL/C7YQ08Pb+7fFb5TFrEB10EjfSCEs5gRYHh874=; b=OESGwvMH4PKRlqLA/+SMtSbrNohc6nawg0+6UYnIiqAZ07rTztX2xnkVhMXQ1SKQKW/ilWxhxUBbuklifUvGbE/Pr4AE8FF2eNAXxlaaXR2yVBKFeytTY+hS7U2m/LNYycTxdRPAGABKywuBwW+jGG9LhZSRFnpdXqV31Mf7t60= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:46 +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.2538.019; Tue, 17 Dec 2019 16:15:46 +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 42/55] staging: wfx: remove unnecessary EDCA initialisation Thread-Topic: [PATCH v2 42/55] staging: wfx: remove unnecessary EDCA initialisation Thread-Index: AQHVtPUwofWyj1n0J0CKAfv5Wa1qQg== Date: Tue, 17 Dec 2019 16:15:25 +0000 Message-ID: <20191217161318.31402-43-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 894078dc-2f2f-4b01-41df-08d7830c533d x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: 0fCiDJgmx5zzbEnBnq2Kvyj8ExDn9Oa1DRk38KLe1uBENizebxcnsm8OhMlV1TFIcb+FqOac/9KffFrsQArNc0drz6tS5Mgpl5FTRH7e22uhA9I1McI+N9nUcX/ToMbm64K269m7X9zsJheO5BHAOrtclrcHA+Zc1Erj5haHHzmMmrlQuDTo1Dx1kK5jYGmSIt2BJW105TR7J+/euri9U2hHm4A3q6oaSeRZ93xzyZoLenm9gfvUsa07yDpQP8knnAwTh4yvNUvPZwpPvBQjcWxOl3yx4jqE8JtxaF89ZUAEmSHGKarOeCQjub7CO8Sv4Xyw4NU5Az3n9bwaGABL5uS6aVa99EE2v3sL8HI527PilNxO+vzazvBxIXrzl1eYxpwPhJqDUcZjwFNJY0Wha/CFFAou3fxpWR6Ui+NHdNsOhkra5C2StzIWj9eUsKhf Content-ID: <3543C5DE4DCAD14E889C8E83B82B40CE@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 894078dc-2f2f-4b01-41df-08d7830c533d X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:25.7892 (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: p5Ul3sNca4OBBGhl8L/QWzPIcIkisU+Vr5NaSPVHDtiLfiF5yxDErA07MKOcWgJTpxCCfIGuDkeIxhemWrACJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller mac80211 already call wfx_conf_tx() on every VIF instanciation. So, the driver does not need to do it. Note that current code did dirty things with wvif->edca_params. This struct was initialized, but only 'queue_id' was really used. The other members are only used to store temporary values. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 51 +++++---------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index d52f618062a6..3504b6b3515e 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -334,6 +334,12 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, edca->cw_max = params->cw_max; edca->tx_op_limit = params->txop * TXOP_UNIT; edca->allowed_medium_time = 0; + edca->queue_id = 3 - queue; + // API 2.0 has changed queue IDs values + if (wfx_api_older_than(wdev, 2, 0) && queue == IEEE80211_AC_BE) + edca->queue_id = HIF_QUEUE_ID_BACKGROUND; + if (wfx_api_older_than(wdev, 2, 0) && queue == IEEE80211_AC_BK) + edca->queue_id = HIF_QUEUE_ID_BESTEFFORT; hif_set_edca_queue_params(wvif, edca); if (wvif->vif->type == NL80211_IFTYPE_STATION) { @@ -1393,44 +1399,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) int i; struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; - // FIXME: parameters are set by kernel juste after interface_add. - // Keep struct hif_req_edca_queue_params blank? - struct hif_req_edca_queue_params default_edca_params[] = { - [IEEE80211_AC_VO] = { - .queue_id = HIF_QUEUE_ID_VOICE, - .aifsn = 2, - .cw_min = 3, - .cw_max = 7, - .tx_op_limit = TXOP_UNIT * 47, - }, - [IEEE80211_AC_VI] = { - .queue_id = HIF_QUEUE_ID_VIDEO, - .aifsn = 2, - .cw_min = 7, - .cw_max = 15, - .tx_op_limit = TXOP_UNIT * 94, - }, - [IEEE80211_AC_BE] = { - .queue_id = HIF_QUEUE_ID_BESTEFFORT, - .aifsn = 3, - .cw_min = 15, - .cw_max = 1023, - .tx_op_limit = TXOP_UNIT * 0, - }, - [IEEE80211_AC_BK] = { - .queue_id = HIF_QUEUE_ID_BACKGROUND, - .aifsn = 7, - .cw_min = 15, - .cw_max = 1023, - .tx_op_limit = TXOP_UNIT * 0, - }, - }; - - BUILD_BUG_ON(ARRAY_SIZE(default_edca_params) != ARRAY_SIZE(wvif->edca_params)); - if (wfx_api_older_than(wdev, 2, 0)) { - default_edca_params[IEEE80211_AC_BE].queue_id = HIF_QUEUE_ID_BACKGROUND; - default_edca_params[IEEE80211_AC_BK].queue_id = HIF_QUEUE_ID_BESTEFFORT; - } vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER | IEEE80211_VIF_SUPPORTS_UAPSD | @@ -1501,13 +1469,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) mutex_unlock(&wdev->conf_mutex); hif_set_macaddr(wvif, vif->addr); - for (i = 0; i < IEEE80211_NUM_ACS; i++) { - memcpy(&wvif->edca_params[i], &default_edca_params[i], - sizeof(default_edca_params[i])); - hif_set_edca_queue_params(wvif, &wvif->edca_params[i]); - } - wvif->uapsd_mask = 0; - hif_set_uapsd_info(wvif, wvif->uapsd_mask); wfx_tx_policy_init(wvif); wvif = NULL; From patchwork Tue Dec 17 16:15:27 2019 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: 1211515 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="WHtWjzrV"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjxW718jz9sRX for ; Wed, 18 Dec 2019 03:18:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729381AbfLQQSh (ORCPT ); Tue, 17 Dec 2019 11:18:37 -0500 Received: from mail-dm6nam12on2072.outbound.protection.outlook.com ([40.107.243.72]:33729 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728992AbfLQQPu (ORCPT ); Tue, 17 Dec 2019 11:15:50 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GgzwJ0hlEvezJtY8O3TZqvSccIWrw+9YyMnbxmanDC8KDFGu+xHiPfj6KxI95u2fFxywF92vOYhgeTjPp4oQyjc1FyVx5fUT4fSz5tnaKGFy+rM7xw9BCVjOp/OREKzFQrKFq/kchat2Lq4BYaZkzu7hBXbMnETcdeIzAUlum1ZHhoMgGVKaSBrqE5Z3v4QiTRrhbpoCYqe9+0Re2kDM4VFI3pZNBa5c+5axe737EaR8vzgMJmUlxZpXjcnQMJ1AzJROtMOm62GdH/Dgfdur4ebDjnHcVupHg1sV8V3nSZDZFEf28QKD2h36nbu/l2/yhYszhaOvJAKUXZBNsOA9Vw== 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=DIpHRUtKubXnBMpIa6RaHPdcciiJMRqGRsFeN7dt758=; b=m5vxLgRFt4pqaxAZxmuyz/JPa8l5yq2byhYM0EENg2cxaWQ048HD/ys9ZKbVizy7qphqzBx9O+vjY0a/VgPnTuf+15VCTwcEt9AwV3+yLuHnZOFodOvlrsAzB3oHmXmZuD2arF8eTGZ/6hYVsez3jgpQEs062D/6QUNh3B5kWAi3kiyp3nQABsJ7oBxsH90Y9bmCyG6EfLOYEua7+AEbE081KrNoi7U+dpcrRK2N2VnSCcZUK6ZgSoMFkDKCz9kHXiTWiarNWG554ON9puYFWqYvN/qiZtVAlAIWZXdEJNnp4c/chHkXTDItyfGV2JE21N27LtDE9IakM7JAsnJrOg== 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=DIpHRUtKubXnBMpIa6RaHPdcciiJMRqGRsFeN7dt758=; b=WHtWjzrVxt5kFvH4ROqEjzjjmkMcWoFPVzudYr2iFBwRMuC3MoOSGfqxvV+7CiBlOENyXpXIhyfD07UT2jMhX789xAUO/bD1FvDmGwI2pMYx9Xo7ky7aEdZVFL5rXeFiIKQPmJEyA0Yt6r2CpObND21qUof2xM9RBZpkv20WGS0= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:15:47 +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.2538.019; Tue, 17 Dec 2019 16:15:47 +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 43/55] staging: wfx: simplify hif_set_edca_queue_params() usage Thread-Topic: [PATCH v2 43/55] staging: wfx: simplify hif_set_edca_queue_params() usage Thread-Index: AQHVtPUxnuzuKveVzEeke9ma2+AJDg== Date: Tue, 17 Dec 2019 16:15:27 +0000 Message-ID: <20191217161318.31402-44-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3e724edb-6861-4698-41bd-08d7830c5406 x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(66574012)(186003)(107886003)(8676002)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4477; 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: 7599oNK/IFzVSebeRc9EbR//fXPNAxKh+2ncA3HKqzQu22HITaDelqlW4NXxD+DqFLm1XrPVwkcF6pkSeIUfA3X2ZP8R0DpLagM4lnUQtw5lQQH+aRJRd1FXFkJ0ux60Cq3/JXnC6Y33GOXNj2RXyzV2UfnOP/m12Z4H5MLgYDUbe7QWjwi/3+t5e5vfy+pB4IslAFyy40gmYkjm4hdk8jSOXBdqA69Kz9YvkjrBjQM3e4dcsCTGDOcy7c5vrihZ7XHgSG3UVpK/WzygevSlhZ2YYWZREKQw80xhiK+TdnoZkGtJVBb6KMSpzRA1OkOQmACMnoTxhdo6Ak/sGPgZt5Ym0y5xs91Cf/qzqVsNv25fzEbt5z80dlroPP5bFDUxSZH88ZuNFfcrJab0kbLVxgRZX19yxjw0tyFOWJZtmelfg65RXH6tx5/hOgZniNzi Content-ID: <46EED93E65F86047AC85EED99F5D17E5@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e724edb-6861-4698-41bd-08d7830c5406 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:27.0396 (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: r5xyMpd3G7Zsv/LUiXNfrTS+9ph8gkcodkUzmgy5gmo3n5UrtHtFkmx2ZjzwS4uOmKSBiXAo6LUc8OiyJSapFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The struct hif_req_edca_queue_params comes from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch: 1. relocate the handling of this struct in hif_set_edca_queue_params() (the low level function) 2. replace it in wfx_vif by the mac80211 equivalent: struct ieee80211_tx_queue_params Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 20 +++++++++++++------- drivers/staging/wfx/hif_tx.h | 5 +++-- drivers/staging/wfx/queue.c | 6 +++--- drivers/staging/wfx/sta.c | 18 ++---------------- drivers/staging/wfx/wfx.h | 4 +++- 5 files changed, 24 insertions(+), 29 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 9cbf9d916f5f..259b49b99098 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -340,19 +340,25 @@ int hif_remove_key(struct wfx_dev *wdev, int idx) return ret; } -int hif_set_edca_queue_params(struct wfx_vif *wvif, - const struct hif_req_edca_queue_params *arg) +int hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue, + const struct ieee80211_tx_queue_params *arg) { int ret; struct hif_msg *hif; struct hif_req_edca_queue_params *body = wfx_alloc_hif(sizeof(*body), &hif); - // NOTE: queues numerotation are not the same between WFx and Linux - memcpy(body, arg, sizeof(*body)); - cpu_to_le16s(&body->cw_min); - cpu_to_le16s(&body->cw_max); - cpu_to_le16s(&body->tx_op_limit); + WARN_ON(arg->aifs > 255); + body->aifsn = arg->aifs; + body->cw_min = cpu_to_le16(arg->cw_min); + body->cw_max = cpu_to_le16(arg->cw_max); + body->tx_op_limit = cpu_to_le16(arg->txop * USEC_PER_TXOP); + body->queue_id = 3 - queue; + // API 2.0 has changed queue IDs values + if (wfx_api_older_than(wvif->wdev, 2, 0) && queue == IEEE80211_AC_BE) + body->queue_id = HIF_QUEUE_ID_BACKGROUND; + if (wfx_api_older_than(wvif->wdev, 2, 0) && queue == IEEE80211_AC_BK) + body->queue_id = HIF_QUEUE_ID_BESTEFFORT; wfx_fill_header(hif, wvif->id, HIF_REQ_ID_EDCA_QUEUE_PARAMS, sizeof(*body)); ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h index bb5860ee6542..d88019421fbc 100644 --- a/drivers/staging/wfx/hif_tx.h +++ b/drivers/staging/wfx/hif_tx.h @@ -12,6 +12,7 @@ #include "hif_api_cmd.h" +struct ieee80211_tx_queue_params; struct wfx_dev; struct wfx_vif; @@ -52,8 +53,8 @@ int hif_set_bss_params(struct wfx_vif *wvif, const struct hif_req_set_bss_params *arg); int hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg); int hif_remove_key(struct wfx_dev *wdev, int idx); -int hif_set_edca_queue_params(struct wfx_vif *wvif, - const struct hif_req_edca_queue_params *arg); +int hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue, + const struct ieee80211_tx_queue_params *arg); int hif_start(struct wfx_vif *wvif, const struct hif_req_start *arg); int hif_beacon_transmit(struct wfx_vif *wvif, bool enable); int hif_map_link(struct wfx_vif *wvif, u8 *mac_addr, int flags, int sta_id); diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 16216afe6cfc..abfbad7c9f75 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -443,7 +443,7 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, { static const int urgent = BIT(WFX_LINK_ID_AFTER_DTIM) | BIT(WFX_LINK_ID_UAPSD); - struct hif_req_edca_queue_params *edca; + const struct ieee80211_tx_queue_params *edca; unsigned int score, best = -1; int winner = -1; int i; @@ -458,7 +458,7 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, if (!queued) continue; *total += queued; - score = ((edca->aifsn + edca->cw_min) << 16) + + score = ((edca->aifs + edca->cw_min) << 16) + ((edca->cw_max - edca->cw_min) * (get_random_int() & 0xFFFF)); if (score < best && (winner < 0 || i != 3)) { @@ -595,7 +595,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) wvif->pspoll_mask &= ~BIT(tx_priv->raw_link_id); /* allow bursting if txop is set */ - if (wvif->edca_params[queue_num].tx_op_limit) + if (wvif->edca_params[queue_num].txop) burst = (int)wfx_tx_queue_get_num_queued(queue, tx_allowed_mask) + 1; else burst = 1; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 3504b6b3515e..19ca13543a25 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -17,7 +17,6 @@ #include "hif_tx.h" #include "hif_tx_mib.h" -#define TXOP_UNIT 32 #define HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES 2 static u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates) @@ -322,26 +321,13 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, { struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; - struct hif_req_edca_queue_params *edca; WARN_ON(queue >= hw->queues); mutex_lock(&wdev->conf_mutex); assign_bit(queue, &wvif->uapsd_mask, params->uapsd); - edca = &wvif->edca_params[queue]; - edca->aifsn = params->aifs; - edca->cw_min = params->cw_min; - edca->cw_max = params->cw_max; - edca->tx_op_limit = params->txop * TXOP_UNIT; - edca->allowed_medium_time = 0; - edca->queue_id = 3 - queue; - // API 2.0 has changed queue IDs values - if (wfx_api_older_than(wdev, 2, 0) && queue == IEEE80211_AC_BE) - edca->queue_id = HIF_QUEUE_ID_BACKGROUND; - if (wfx_api_older_than(wdev, 2, 0) && queue == IEEE80211_AC_BK) - edca->queue_id = HIF_QUEUE_ID_BESTEFFORT; - hif_set_edca_queue_params(wvif, edca); - + memcpy(&wvif->edca_params[queue], params, sizeof(*params)); + hif_set_edca_queue_params(wvif, queue, params); if (wvif->vif->type == NL80211_IFTYPE_STATION) { hif_set_uapsd_info(wvif, wvif->uapsd_mask); if (wvif->setbssparams_done && wvif->state == WFX_STATE_STA) diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 5a2f8af17eb7..f396a502283e 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -26,6 +26,8 @@ #include "hif_tx.h" #include "hif_api_general.h" +#define USEC_PER_TXOP 32 // see struct ieee80211_tx_queue_params + struct hwbus_ops; struct wfx_dev { @@ -114,7 +116,7 @@ struct wfx_vif { bool setbssparams_done; struct wfx_ht_info ht_info; unsigned long uapsd_mask; - struct hif_req_edca_queue_params edca_params[IEEE80211_NUM_ACS]; + struct ieee80211_tx_queue_params edca_params[IEEE80211_NUM_ACS]; struct hif_req_set_bss_params bss_params; struct work_struct bss_params_work; struct work_struct set_cts_work; From patchwork Tue Dec 17 16:15:28 2019 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: 1211513 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Mq++CyPp"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjx22nw9z9sSL for ; Wed, 18 Dec 2019 03:18:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729191AbfLQQSK (ORCPT ); Tue, 17 Dec 2019 11:18:10 -0500 Received: from mail-dm6nam12on2072.outbound.protection.outlook.com ([40.107.243.72]:33729 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729013AbfLQQPy (ORCPT ); Tue, 17 Dec 2019 11:15:54 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D9fymUrmZlaRhDthp6CRECFfOpT22K5ON5Mtda0sgr8oaIfIswnaGUYerPSDcm3GYbN7ck3LTStG0durbPt5FOZeHp2ZzHCN/RGIzNR6qnRrMO8t9UCcPiu8Jv3F09FeeJ/qIPz5FVTJi9tCtQkW3T3F6a19ccIHWrpy6RDgQxADCBHwvtDwMeEG6ACiu7sRiUPHwaxNyK15GupzmFvy78Xn5dpYv4d6R2apsc5MuVQ4GWSRaNpG6Te0+mm2zpKBy+FXckt8PmKtpOYfaHzsWBEVPbKSN1PD11FCGtLo4qVa2zWu/WjHIgYOxW3lN+SaLKWuWZhFZ+dLgx5DrO6bJw== 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=Me8/rbIanGxpbYOTeZgvzL3WSGozBd3Rm0cYjOm2ft0=; b=H5kweVL8y1gsvAjwqRWBwtyFoqq/LjRNJzfI0fejaCvOfkiH8e3jDxsNN0CpVchWl8AWyeXW1ySZ4ndP+03wwkIsOABLbKn9t6Rtx+iUUQ2AxPtNdeBNR7U5uN1bXA22RFUAhAw5WPY7Dj9e0yHQIB8Gyw3UkP5QKgWZvArsC7G6WTZ0vctdYqKIZ5O6hR/u25Fas5BsBM5KIkUvIO1qbZMv7TFbY0LQtJuDAx+JWvwrXSEe4OvuDKyg8QrB5f2nENQ9cZHA8kBRpjq7ryl7cw38iuharf0TQJ7yP2fsxL0c3V3uaVft2V9gkmx3pdtzcjPjreXmqIng0KPAiLkBAA== 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=Me8/rbIanGxpbYOTeZgvzL3WSGozBd3Rm0cYjOm2ft0=; b=Mq++CyPpBSPdRhLNSyVR70Pm0Md7AO4FM6bKa4ATzgjnyg/Qnf5nQY3fU5rMJi1+WUSNou/BpOCTtE6K4WOnJ1ZnYE5QRNi9qVyIjPiWaP4Q1vgLGdTlxBMqYBpw/UXblZpq8GORTrjVkXyZ/3+W+djod6rAPl8+PpfPqJ/Rmmk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:15:48 +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.2538.019; Tue, 17 Dec 2019 16:15:48 +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 44/55] staging: wfx: hif_scan() never fails Thread-Topic: [PATCH v2 44/55] staging: wfx: hif_scan() never fails Thread-Index: AQHVtPUyvEYYGiAvQkWgAuq5fP/76Q== Date: Tue, 17 Dec 2019 16:15:28 +0000 Message-ID: <20191217161318.31402-45-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e69c46a4-94cd-44f1-5385-08d7830c54c7 x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(186003)(107886003)(8676002)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4477; 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: 0eIBLABmbMQrdiVPf3o/CLEvTVYUhBW35a0h0GKqbyd43sNGJ8j3yV4Fa9k9sIqHrJnbDuFiKCnGBpWXedDAXEqgF7f2Ikm59nuTzMQJMUM8O0hBgbsnUGvZ6ZbnZqdDXfa611gJRrfQiVRLcJoLHC6Kv/KlnfwqOG8yJLTnL14EBV6MK5kjoafOD4U4VmkvTrAjgE4xU65hVST/MT3PxwG6Lo3CZwUVjkYsd1s4ocEU4vNBFW34LAjGaUsWRJ5NVnobclj7wNX8U/cN1a8ZEGUbAMymsyds6KEjQ3hir2q00OuNA9AkCTVk+2nmo1DwFHe1aPR0hG68Z4yVkp2ApevTQhYXP0m0hSmYWjJ3pRwJaCsl+ss4udFHx/JlgX73suiW0nxeEvkN4IDEy9+nbbYKdYkToko/RgWvq4oqTPFgXsfxDGpqvWlXjupwc/qj Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e69c46a4-94cd-44f1-5385-08d7830c54c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:28.2919 (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: 3UHIqdDLykm3GyqZmhRKhFyGBpw2mVA8i3TQ+Fcu3MgqjP6/vXd3Xq+cla6c2ZnC2kmlQj8jYxS8qMBeGLlS7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller If scan fails, status is returned in hif_ind_scan_cmpl. hif_scan always return a success. So, we can simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 20 ++------------------ drivers/staging/wfx/scan.h | 1 - 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 4b95e6a97df7..cdccb67cb30e 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -36,7 +36,6 @@ static void wfx_scan_restart_delayed(struct wfx_vif *wvif) static int wfx_scan_start(struct wfx_vif *wvif, struct wfx_scan_params *scan) { - int ret; int tmo = 500; if (wvif->state == WFX_STATE_PRE_STA) @@ -48,15 +47,8 @@ static int wfx_scan_start(struct wfx_vif *wvif, struct wfx_scan_params *scan) atomic_set(&wvif->wdev->scan_in_progress, 1); schedule_delayed_work(&wvif->scan.timeout, msecs_to_jiffies(tmo)); - ret = hif_scan(wvif, scan); - if (ret) { - wfx_scan_failed_cb(wvif); - atomic_set(&wvif->scan.in_progress, 0); - atomic_set(&wvif->wdev->scan_in_progress, 0); - cancel_delayed_work_sync(&wvif->scan.timeout); - wfx_scan_restart_delayed(wvif); - } - return ret; + hif_scan(wvif, scan); + return 0; } int wfx_hw_scan(struct ieee80211_hw *hw, @@ -245,14 +237,6 @@ static void wfx_scan_complete(struct wfx_vif *wvif) wfx_scan_work(&wvif->scan.work); } -void wfx_scan_failed_cb(struct wfx_vif *wvif) -{ - if (cancel_delayed_work_sync(&wvif->scan.timeout) > 0) { - wvif->scan.status = -EIO; - schedule_work(&wvif->scan.timeout.work); - } -} - void wfx_scan_complete_cb(struct wfx_vif *wvif, const struct hif_ind_scan_cmpl *arg) { diff --git a/drivers/staging/wfx/scan.h b/drivers/staging/wfx/scan.h index c7c0ab178c87..e71e5f0f522e 100644 --- a/drivers/staging/wfx/scan.h +++ b/drivers/staging/wfx/scan.h @@ -38,6 +38,5 @@ void wfx_scan_work(struct work_struct *work); void wfx_scan_timeout(struct work_struct *work); void wfx_scan_complete_cb(struct wfx_vif *wvif, const struct hif_ind_scan_cmpl *arg); -void wfx_scan_failed_cb(struct wfx_vif *wvif); #endif /* WFX_SCAN_H */ From patchwork Tue Dec 17 16:15:29 2019 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: 1211509 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="iBldJD8O"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjw56cCdz9sRh for ; Wed, 18 Dec 2019 03:17:25 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729111AbfLQQQD (ORCPT ); Tue, 17 Dec 2019 11:16:03 -0500 Received: from mail-dm6nam12on2072.outbound.protection.outlook.com ([40.107.243.72]:33729 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729077AbfLQQP7 (ORCPT ); Tue, 17 Dec 2019 11:15:59 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JTM4K8HZ6hgnWs/7jq1XoRwvXbluyPF7HOl+GcF6nbyuGpCNomcfJy1kv6sN2y0ZwIr09zCIVTIznwGyxkZwrIxi8E3ldB3yUqvHQXghIO74Jd1sDnVVnLZ32lG42+b3EKhFX+VhX2xg0S72p64dPzhaVdBWpkucKkMDo8aRmhMH0gTcIQMghiqSyQNSbZh1FQZd3EAYhBOXUSM9f0N3/rCdbv+MNq9/c8qyJI+IhxcfQ8f0dTt3AtpqfHycdD+sJwJeEgKEV3YLvOXeRaztd3l9IoZ3dMO97gAQXVwNraGVq/MRMSCjq5nsTGBT/dI6rUxkp6207rzb/kZwTcr3GQ== 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=LQUOd2k3H7PvGQvT3Gmu7+8VFJLJ0zbzv6DQPSsWlUM=; b=Wl80ivMEjfb7wOuamZso0vf0l18DgHLqBwdlUdu+nEi0VO8o5duntlw1kxcKADDx59q5TwTxYNXhKyo7k5Gu4FsoL5jIxbvLubmrgyRYEucD5BxPCMVc/xf+ie/Sr5mmotlNO9SktYvZebDS2upaQedni/+1/1+HM/hF+seomX8D4DwkUDoBo7dCriqvExVj3GoeRIBzlxaBk0wZHjUudBmQjzotwhLShQ723mQ6wxsOGhLNiABNI5SlZcBERMfsObd5rlCQsD1sNs6KDiOvZs0zwUsNfOWKBG8fMCs6SS20VTsntf6HiiDg5+0AeIBiN7ku0e3P+JaYcYuLI5AAew== 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=LQUOd2k3H7PvGQvT3Gmu7+8VFJLJ0zbzv6DQPSsWlUM=; b=iBldJD8OQ9uBIPwCxAqfnRI4W26LYEKIBqbwv032iDOtx7CcQlJhipZ7klFdFV/wo+HTUnsP9VNsxs/7Q1sRy9I0RtyT/SknO2Y2DDAw4WiZXdTn4KGlxEh42WfmOY+qhQ6oQcxtIvgs2MeaPrDR39dlEPbhJ9bgyKeFaZ+X/W8= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:15:51 +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.2538.019; Tue, 17 Dec 2019 16:15:51 +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 45/55] staging: wfx: device already handle sleep mode during scan Thread-Topic: [PATCH v2 45/55] staging: wfx: device already handle sleep mode during scan Thread-Index: AQHVtPUzjPg8Lu2rPUKHwVRjyrYluw== Date: Tue, 17 Dec 2019 16:15:29 +0000 Message-ID: <20191217161318.31402-46-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5f3b38bb-a3ab-4dc3-bc35-08d7830c5584 x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(66574012)(186003)(107886003)(8676002)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4477; 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: NWgU3uSr9ceh/qkFugBPi4sFgIJEnvCL1um9tvP3m6Oh4umno/BRCBJirvJpR29s7HwKsleBuEdovTEx/fqreeo7oY1OWR10cDHd0MvZI9SlvQNVnlMoen8ZW4qfhtzQdM1Y/Wy1z5m2xqNTuP0iKSrCqj1fs5lZqufpzx4omGGj/XsMMBxZuH83xLQLmIwg6MAV4dqC4rPw0W7awgdgnmc1mqUESJWQVc0JQEh0l6oWgwicdizZgnx2Qrv4mX90S//P8DCuHzU5cuWwYo0nW3Csg9owLrLidpKYphw8ikqtA1/LVl1xpECgwjKmqeF/Em1rakoQGxiqS1spVHRv3FUWx3D95EmGI2JtHwaCxf7yMXfKZ0DpCLkP/hOqo2b8JoSqwrSeyClqz3rZh0BEhFercyF6rFmf/5Jh3t0T70T29vsQ8I+4jeApwZR3wt9V Content-ID: <0FB045CF19D8A94E81EF85590E0334A4@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f3b38bb-a3ab-4dc3-bc35-08d7830c5584 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:29.5322 (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: omkMHNWcaGNGjTRKZRkZVJN9q/Ct+bS7CNpGrg66H96smhXMVocRw0VRHNR6G7+/JuNJp/8e5ty2ibbrdCRLEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The device is not allowed to enter in sleep mode during scan. However, this is already handled by the device. So driver does not have to care about it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 3 +-- drivers/staging/wfx/scan.c | 3 --- drivers/staging/wfx/wfx.h | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index 2432ba95c2f5..983c41d1fe7c 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -271,8 +271,7 @@ static void bh_work(struct work_struct *work) if (last_op_is_rx) ack_sdio_data(wdev); - if (!wdev->hif.tx_buffers_used && !work_pending(work) && - !atomic_read(&wdev->scan_in_progress)) { + if (!wdev->hif.tx_buffers_used && !work_pending(work)) { device_release(wdev); release_chip = true; } diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index cdccb67cb30e..397fe511d34a 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -44,7 +44,6 @@ static int wfx_scan_start(struct wfx_vif *wvif, struct wfx_scan_params *scan) tmo += scan->scan_req.num_of_channels * ((20 * (scan->scan_req.max_channel_time)) + 10); atomic_set(&wvif->scan.in_progress, 1); - atomic_set(&wvif->wdev->scan_in_progress, 1); schedule_delayed_work(&wvif->scan.timeout, msecs_to_jiffies(tmo)); hif_scan(wvif, scan); @@ -232,8 +231,6 @@ void wfx_scan_work(struct work_struct *work) static void wfx_scan_complete(struct wfx_vif *wvif) { up(&wvif->scan.lock); - atomic_set(&wvif->wdev->scan_in_progress, 0); - wfx_scan_work(&wvif->scan.work); } diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index f396a502283e..97373d047f58 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -60,7 +60,6 @@ struct wfx_dev { struct mutex rx_stats_lock; int output_power; - atomic_t scan_in_progress; }; struct wfx_vif { From patchwork Tue Dec 17 16:15:30 2019 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: 1211508 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Zh8UaDBU"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjw402Rgz9sSL for ; Wed, 18 Dec 2019 03:17:24 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729132AbfLQQQE (ORCPT ); Tue, 17 Dec 2019 11:16:04 -0500 Received: from mail-dm6nam12on2072.outbound.protection.outlook.com ([40.107.243.72]:33729 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728755AbfLQQQC (ORCPT ); Tue, 17 Dec 2019 11:16:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B2e09eJlnJc9bDFQA+znnFFNisREeGhmVJF2cteRr2Y8cNmWFpZz98h9z/mqPlULNZSH1jthfNev+i1TZKUXYbc+bx5TST8Wqkcl59luLVwct+L/yJp7e65vLKjwyT9xqOxlapppUFI0f2AhZZ9pJ/jenpzkN+XdKHXymk5WTqr7CDjHQ+qfyv6mOv11OxEnppE9aVMBqdVVICs4oEmKEiAI8M38ZOZjramTsJUsw/iLPgb5KpcdXs83saVYZtDsrvmtFQLRXNUmeWJEEMJuPqkfjl5sN6S8BZPX7C3A6310OsbETIBuK64B08yb+Waj5ADQMzxbBTCGZve4+ykDfw== 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=WG7mVDBIsOq/9wU8ZAkU7UURWDrXtRLbBUtGNBqDBOI=; b=jU/SuQRHE3HMkcgVKMxrINzin3VJINlnPsQXdK37RLhQwwX8JU9kHvSb8sCktqSbDub/VgZ6u6cmPuD+f/cvilC2SZpOiUYblOy7O2+KAJiKklA6B7Rsp0wjVUuYKwwz9KlHUlPzlcS4SA2iLgNQux3Wf29WcR8762V2R9RyxJljw5d1f6uWZNAL5hLXrtJnwXCuZGzeLYc6wrl5xhGylC0MMPGevAOanzlNgSSM3haSoJXk0u5nW262F6zRELek5/0rolRiQbMt+saALSuWuqTQamxXS9IPcN5owrWdWusvOqS4fsQvxCsU7tNuokgqoa24SCwkq3+SzkZ0PqphHg== 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=WG7mVDBIsOq/9wU8ZAkU7UURWDrXtRLbBUtGNBqDBOI=; b=Zh8UaDBUfoGkkFSTiD9lVJfUtfjDX4vjU1P521llDcd493Y4ojgjrELdzDk91wZKPbr4OeTnt9QiGYFIu65FY6Gp6qUdMDOTMU5CrsUuIe5HMXLhtyeLD3D2iuBWfjIA4DT1TsMGHFL1C6IB3U++zPYvtJPbq14vfLEOzmqZ/Ek= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:15:54 +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.2538.019; Tue, 17 Dec 2019 16:15:54 +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 46/55] staging: wfx: drop useless wfx_scan_complete() Thread-Topic: [PATCH v2 46/55] staging: wfx: drop useless wfx_scan_complete() Thread-Index: AQHVtPUzSLDxS8jNvEC7gRp7wIri1g== Date: Tue, 17 Dec 2019 16:15:30 +0000 Message-ID: <20191217161318.31402-47-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d3da11f6-715b-48df-a64d-08d7830c564e x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:747; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(66574012)(186003)(107886003)(8676002)(4744005)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4477; 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: UPE1fycq4WRyrxg0DUcA+u5cFPk/w9+oF+JtzrlTml45sV/x7DkOmPQny2AH5uz0ZqVvJNQJpd2dYwqgu5bhyFhX/iwxDJ5akgYIzgtQIqGhvyIB/8bz/TDIijpKOe/3yT0Iz18VVMYoDE3d5dAuZ+O94DYfuWKn9Uubkc2xLFmAQ6nuRG7cYEpiVFg/FOW8yPJ21Dm6R86iaKhz9nb/LQD+hXArggIhx5J70SbqeA9iOph1LHdXnFwgu3NRHLriGZgwf3G6PdKKYNLm/pmysZ59ZZvEjMwmMm0yiF7k5zpZmby2jdaYztKlF5mhE60+pwvjyuakWwM3LupdC1vZP4ZVaVm4SPORKMWyDwJXt0cfUZY1OFk6hpYe33KjZevqvuV9+HLDpt/wBYYnA2xIqzJqagNZFLqSbTUnWxDH1dOGOvmqqS/iQNaYOWYPKJMl Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3da11f6-715b-48df-a64d-08d7830c564e X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:30.8474 (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: bTcEyRO707FW0HTFKg9ogoQKk+XoM58XjPR96ozOe+kUQbA6aAjxIOmCRhdC+Vz+3/227pJqsotavaRrtPax2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Since wfx_scan_complete() is now only called from wfx_scan_complete_cb(), it make sense to merge the both functions. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 397fe511d34a..c043f2f79541 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -228,12 +228,6 @@ void wfx_scan_work(struct work_struct *work) schedule_work(&wvif->scan.work); } -static void wfx_scan_complete(struct wfx_vif *wvif) -{ - up(&wvif->scan.lock); - wfx_scan_work(&wvif->scan.work); -} - void wfx_scan_complete_cb(struct wfx_vif *wvif, const struct hif_ind_scan_cmpl *arg) { @@ -257,6 +251,7 @@ void wfx_scan_timeout(struct work_struct *work) wvif->scan.curr = wvif->scan.end; hif_stop_scan(wvif); } - wfx_scan_complete(wvif); + up(&wvif->scan.lock); + wfx_scan_work(&wvif->scan.work); } } From patchwork Tue Dec 17 16:15:32 2019 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: 1211507 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="V2jaMpLb"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjvx1XJBz9sRm for ; Wed, 18 Dec 2019 03:17:17 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729299AbfLQQRO (ORCPT ); Tue, 17 Dec 2019 11:17:14 -0500 Received: from mail-dm6nam12on2072.outbound.protection.outlook.com ([40.107.243.72]:33729 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729107AbfLQQQF (ORCPT ); Tue, 17 Dec 2019 11:16:05 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aSallF4DR8GCIj97298x4g2ChZkr9GAZcO5wUM22P8b8TWOpU27pBkHWGk9s9iZyD96SPUd6eAGJ3PJM1YaVPIbI112mC4Hy6nA8ibIRE0m8Q2nueBvMj+L2Ri4LtqkDcLK2UD9FRMtHpNTxgWcjmWmYiVNKOcjZEoNCCrmvv50n5MMZer3LanwrvWgsDVJiVZmuC51Ej2QzhBfym/yYEMna0Slk6pvdgnNnA/XHpyFaX5rFVAsl2dandiWSihq51SQBrUUA7ulUk9vgnEH0Fmg9PpN3/5ECupWgZtQaMXzaQqkLJs4wD12/cQcdCldHY4BRdVkHp1UVODwBR1akIg== 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=wbH9speXFVud+k2dooXEmIhIUnNVYavXYIFmWKDTAHc=; b=mRJ+BBzm9mBiFwWgKSJD0qba8LAuqVQmdl4pfTArUDbQvpoJ2nhEhFF8ShpeTDIYj1j/X0AwD4qH0MmfSAUOZAEfKDI86z/wAJkAgKpW0vSGEvlbeXpow2PYXgB6aOE9WpHGOhgoroM73hsoaB1B2ynCGOryVVf2CynxdI4HJkBsIlQqfCOHCRGJ+CB9I/GjTrkpuUsFx2YwXhY89f0kzq84z2eO7zf+oeFNdeAVJs+8dIyCNfkVYfwt6Gh63uDpEkVLiWmFblezGWVMuVEf1Rz42kIFFzTlOU9aexnntLbnOii/S95QjtI0c8pSGgA3ptrUN/7lE1q4jn6y/Mwn3g== 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=wbH9speXFVud+k2dooXEmIhIUnNVYavXYIFmWKDTAHc=; b=V2jaMpLbutqtGMhvQhPYowq3EbUr4rxtOfThiPvqLNVNovxi2F72iInwQc9Y4ZLDRcrlHDuT6InuPsuAq74h0qoC1armT4kSvp+Xisy7URR5CGLVfS/O9fEWKAE8kokz2NGeHvO6kSB657tj469MfMe+vAJnOfjNij3OHz9xMlk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:15:55 +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.2538.019; Tue, 17 Dec 2019 16:15:55 +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 47/55] staging: wfx: simplify hif_scan() usage Thread-Topic: [PATCH v2 47/55] staging: wfx: simplify hif_scan() usage Thread-Index: AQHVtPU0k58JN+hftUSF/1n35wvDzA== Date: Tue, 17 Dec 2019 16:15:32 +0000 Message-ID: <20191217161318.31402-48-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a19b595c-2111-42e1-c94c-08d7830c5710 x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(66574012)(186003)(107886003)(8676002)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4477; 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: 6r01MSXe2aFAf/ZiENh9p5+0tF7fvy423dEH9urVdDeUckGlI+iqdmHi3QNEUE5mYHmIrBCQxttj441suSrl71u4A85sM0P/yoXicTkr5WHBWNofqoB/kh0R2+pp1frV5kw86GXiV1HYvSOzMDSzVMnMatiV14UT96H1xqbvNwM+uvz1yuog7ouGgq9hNXCkvIDApuB4QuLcTrEPQxyfbEkxoEQ2cBexfs4yJEIjElezWVqCaHdhe4rJNzov/ZISvjFy1pKT1uURt4TfPly0OqZ5665/0BxA5VGWnnRUCHfCx2FllsdgKOE7qq4R+0VTECwgd+PYpM7jZ0yvPAeBIZDL7/AP9lgbS8AKmLI2ZEh+Ggiw6pyEvPlfDir/s45fDTgP6l+moekS0TR3/y84FzzDehgGM2Aogs6kjNH6E9R43ZlJ7GZ9q9azbiUPZ7rr Content-ID: <82EB23D1E0380A4597A80618F5B26810@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a19b595c-2111-42e1-c94c-08d7830c5710 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:32.1827 (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: uR22/Lf+ul/a6HuWm99dVwHFSLHVwjJ1gBHQwTTeUhireiJ7CTg3brifXeLzKFCk0PZpBzSRTsSUJ7snZdi8RQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The structures hif_req_start_scan and hif_ssid_def come from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch relocate handling of theses structures to hif_scan() (the low level function). This change also allows to drop struct wfx_scan_params. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 76 ++++++++++++++++++++++-------------- drivers/staging/wfx/hif_tx.h | 10 ++--- drivers/staging/wfx/scan.c | 54 ++++--------------------- drivers/staging/wfx/wfx.h | 1 + 4 files changed, 59 insertions(+), 82 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 259b49b99098..8a34a52dd5b9 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -220,41 +220,59 @@ int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, return ret; } -int hif_scan(struct wfx_vif *wvif, const struct wfx_scan_params *arg) +int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req, + int chan_start_idx, int chan_num) { int ret, i; struct hif_msg *hif; - struct hif_ssid_def *ssids; - size_t buf_len = sizeof(struct hif_req_start_scan) + - arg->scan_req.num_of_channels * sizeof(u8) + - arg->scan_req.num_of_ssids * sizeof(struct hif_ssid_def); - struct hif_req_start_scan *body = wfx_alloc_hif(buf_len, &hif); - u8 *ptr = (u8 *) body + sizeof(*body); - - WARN(arg->scan_req.num_of_channels > HIF_API_MAX_NB_CHANNELS, "invalid params"); - WARN(arg->scan_req.num_of_ssids > 2, "invalid params"); - WARN(arg->scan_req.band > 1, "invalid params"); - - // FIXME: This API is unnecessary complex, fixing NumOfChannels and - // adding a member SsidDef at end of struct hif_req_start_scan would - // simplify that a lot. - memcpy(body, &arg->scan_req, sizeof(*body)); - cpu_to_le32s(&body->min_channel_time); - cpu_to_le32s(&body->max_channel_time); - cpu_to_le32s(&body->tx_power_level); - memcpy(ptr, arg->ssids, - arg->scan_req.num_of_ssids * sizeof(struct hif_ssid_def)); - ssids = (struct hif_ssid_def *) ptr; - for (i = 0; i < body->num_of_ssids; ++i) - cpu_to_le32s(&ssids[i].ssid_length); - ptr += arg->scan_req.num_of_ssids * sizeof(struct hif_ssid_def); - memcpy(ptr, arg->ch, arg->scan_req.num_of_channels * sizeof(u8)); - ptr += arg->scan_req.num_of_channels * sizeof(u8); - WARN(buf_len != ptr - (u8 *) body, "allocation size mismatch"); + size_t buf_len = + sizeof(struct hif_req_start_scan_alt) + chan_num * sizeof(u8); + struct hif_req_start_scan_alt *body = wfx_alloc_hif(buf_len, &hif); + int tmo_chan_fg, tmo_chan_bg, tmo; + + WARN(chan_num > HIF_API_MAX_NB_CHANNELS, "invalid params"); + WARN(req->n_ssids > HIF_API_MAX_NB_SSIDS, "invalid params"); + + compiletime_assert(IEEE80211_MAX_SSID_LEN == HIF_API_SSID_SIZE, + "API inconsistency"); + for (i = 0; i < req->n_ssids; i++) { + memcpy(body->ssid_def[i].ssid, req->ssids[i].ssid, + IEEE80211_MAX_SSID_LEN); + body->ssid_def[i].ssid_length = + cpu_to_le32(req->ssids[i].ssid_len); + } + body->num_of_ssids = HIF_API_MAX_NB_SSIDS; + // Background scan is always a good idea + body->scan_type.type = 1; + body->scan_flags.fbg = 1; + body->tx_power_level = + cpu_to_le32(req->channels[chan_start_idx]->max_power); + body->num_of_channels = chan_num; + for (i = 0; i < chan_num; i++) + body->channel_list[i] = + req->channels[i + chan_start_idx]->hw_value; + if (req->no_cck) + body->max_transmit_rate = API_RATE_INDEX_G_6MBPS; + else + body->max_transmit_rate = API_RATE_INDEX_B_1MBPS; + if (req->channels[chan_start_idx]->flags & IEEE80211_CHAN_NO_IR) { + body->min_channel_time = cpu_to_le32(50); + body->max_channel_time = cpu_to_le32(150); + } else { + body->min_channel_time = cpu_to_le32(10); + body->max_channel_time = cpu_to_le32(50); + body->num_of_probe_requests = 2; + body->probe_delay = 100; + } + tmo_chan_bg = le32_to_cpu(body->max_channel_time) * USEC_PER_TU; + tmo_chan_fg = 512 * USEC_PER_TU + body->probe_delay; + tmo_chan_fg *= body->num_of_probe_requests; + tmo = chan_num * max(tmo_chan_bg, tmo_chan_fg); + 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; + return ret ? ret : usecs_to_jiffies(tmo); } int hif_stop_scan(struct wfx_vif *wvif) diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h index d88019421fbc..e8855ead3a18 100644 --- a/drivers/staging/wfx/hif_tx.h +++ b/drivers/staging/wfx/hif_tx.h @@ -13,15 +13,10 @@ #include "hif_api_cmd.h" struct ieee80211_tx_queue_params; +struct cfg80211_scan_request; struct wfx_dev; struct wfx_vif; -struct wfx_scan_params { - struct hif_req_start_scan scan_req; - struct hif_ssid_def *ssids; - u8 *ch; -}; - struct wfx_hif_cmd { struct mutex lock; struct mutex key_renew_lock; @@ -45,7 +40,8 @@ int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *buf, size_t buf_size); int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *buf, size_t buf_size); -int hif_scan(struct wfx_vif *wvif, const struct wfx_scan_params *arg); +int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req80211, + int chan_start, int chan_num); int hif_stop_scan(struct wfx_vif *wvif); int hif_join(struct wfx_vif *wvif, const struct hif_req_join *arg); int hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout); diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index c043f2f79541..122da87bbf92 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -34,19 +34,18 @@ static void wfx_scan_restart_delayed(struct wfx_vif *wvif) } } -static int wfx_scan_start(struct wfx_vif *wvif, struct wfx_scan_params *scan) +static int wfx_scan_start(struct wfx_vif *wvif, + int chan_start_idx, int chan_num) { - int tmo = 500; + int tmo; if (wvif->state == WFX_STATE_PRE_STA) return -EBUSY; - tmo += scan->scan_req.num_of_channels * - ((20 * (scan->scan_req.max_channel_time)) + 10); atomic_set(&wvif->scan.in_progress, 1); - schedule_delayed_work(&wvif->scan.timeout, msecs_to_jiffies(tmo)); - hif_scan(wvif, scan); + tmo = hif_scan(wvif, wvif->scan.req, chan_start_idx, chan_num); + schedule_delayed_work(&wvif->scan.timeout, tmo); return 0; } @@ -128,9 +127,6 @@ void wfx_scan_work(struct work_struct *work) { struct wfx_vif *wvif = container_of(work, struct wfx_vif, scan.work); struct ieee80211_channel **it; - struct wfx_scan_params scan = { - .scan_req.scan_type.type = 0, /* Foreground */ - }; struct ieee80211_channel *first; int i; @@ -173,48 +169,14 @@ void wfx_scan_work(struct work_struct *work) (*it)->max_power != first->max_power) break; } - scan.scan_req.band = first->band; - - if (wvif->scan.req->no_cck) - scan.scan_req.max_transmit_rate = API_RATE_INDEX_G_6MBPS; - else - scan.scan_req.max_transmit_rate = API_RATE_INDEX_B_1MBPS; - scan.scan_req.num_of_probe_requests = - (first->flags & IEEE80211_CHAN_NO_IR) ? 0 : 2; - scan.scan_req.num_of_ssids = wvif->scan.n_ssids; - scan.ssids = &wvif->scan.ssids[0]; - scan.scan_req.num_of_channels = it - wvif->scan.curr; - scan.scan_req.probe_delay = 100; - // FIXME: Check if FW can do active scan while joined. - if (wvif->state == WFX_STATE_STA) { - scan.scan_req.scan_type.type = 1; - scan.scan_req.scan_flags.fbg = 1; - } - - scan.ch = kcalloc(scan.scan_req.num_of_channels, - sizeof(u8), GFP_KERNEL); - - if (!scan.ch) { - wvif->scan.status = -ENOMEM; - goto fail; - } - for (i = 0; i < scan.scan_req.num_of_channels; ++i) - scan.ch[i] = wvif->scan.curr[i]->hw_value; - - if (wvif->scan.curr[0]->flags & IEEE80211_CHAN_NO_IR) { - scan.scan_req.min_channel_time = 50; - scan.scan_req.max_channel_time = 150; - } else { - scan.scan_req.min_channel_time = 10; - scan.scan_req.max_channel_time = 50; - } if (!(first->flags & IEEE80211_CHAN_NO_IR) && wvif->scan.output_power != first->max_power) { wvif->scan.output_power = first->max_power; hif_set_output_power(wvif, wvif->scan.output_power * 10); } - wvif->scan.status = wfx_scan_start(wvif, &scan); - kfree(scan.ch); + wvif->scan.status = wfx_scan_start(wvif, + wvif->scan.curr - wvif->scan.begin, + it - wvif->scan.curr); if (wvif->scan.status) goto fail; wvif->scan.curr = it; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 97373d047f58..35f5ddc2eeb3 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -27,6 +27,7 @@ #include "hif_api_general.h" #define USEC_PER_TXOP 32 // see struct ieee80211_tx_queue_params +#define USEC_PER_TU 1024 struct hwbus_ops; From patchwork Tue Dec 17 16:15:33 2019 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: 1211500 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="gcVj3wbA"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjv361nxz9sST for ; Wed, 18 Dec 2019 03:16:31 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729213AbfLQQQL (ORCPT ); Tue, 17 Dec 2019 11:16:11 -0500 Received: from mail-dm6nam12on2072.outbound.protection.outlook.com ([40.107.243.72]:33729 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729143AbfLQQQH (ORCPT ); Tue, 17 Dec 2019 11:16:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i7vRipy14vfywrxmPySUuyYONoDMSf0v+iLQpZadMAoYoljN85Tbam7LomX+ydwl1M+DUc1hULP0KMRToSmypHu9VMf3mR+tTQ+uQQQiI3/Qgve8QI7SE+W4anbYpvvF5MX+PLsIeHPPrj0KqfnXB34JIxYJ0lUQKeVy4eS0dN1ccw07a/M00+zTNa5whBzEwGwUplQ6mdS6/OKX7+OYOtzlFORxWoWmvQed3T0C2gjHFJK4TNyF43jLnLWnUWqOvaNGfhM9A5y17G+jTQ9NzdkzsC8cbAdtqn4WjelHiLG3IbcSk7oxOwK7Xc/960FVrugJY6P6N1dU1kHBDVQHOA== 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=kDlT1we7iUloIGeD2+QPkjZvQgP8SkCL4bnHISJpnvQ=; b=XrC0B31FDAmdpcr+j+kxrIyc8D3HUl8jZ8kra9VF1xHyUvlBMoVTxRsOd9/lC+7Rp1W2hpu45O4fDYsSYrh9K1grhIFX8Kg55t2H49vNrbxxRzeqnRnmOLo10bMTVon3mg/fuv3lRPVUF9GRtu0ly0cYaiFgfSrKASwP0ZhL2vq7XCfKxd/sBO+OOMGT5SMQmBuf5iy4PsMYVnEnis79N7jYMpjHDKKFp5BrAkwrBgt1/DK6XF9E39sAzzIECSOHgkvKaLp9jPCRUc4+3JfF1oSCfjRI+Mg+S2BOnnMKpGXabMaiFt+Ta8kEpLMiEOIXYdoyg8hlW5LJReH4zrOkzA== 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=kDlT1we7iUloIGeD2+QPkjZvQgP8SkCL4bnHISJpnvQ=; b=gcVj3wbANwXkewBloBMUF9EuSw1EFYLbHxlAXgdoSrwCSKE9fdvJ2nyhVgHPWNq0dBrfl7jAVZTkbvDAih/gFCrZKCCUaU12GMKmLFXa8GFgETt7LBUWP0SBvE/SHuzgo0yRstGrYHNywD60uHXajxoFvdGzMfjliQumgSwmHQE= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:15:56 +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.2538.019; Tue, 17 Dec 2019 16:15:56 +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 48/55] staging: wfx: introduce update_probe_tmpl() Thread-Topic: [PATCH v2 48/55] staging: wfx: introduce update_probe_tmpl() Thread-Index: AQHVtPU1dd3K0gcNdECLeABwaV69EQ== Date: Tue, 17 Dec 2019 16:15:33 +0000 Message-ID: <20191217161318.31402-49-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2fea9b41-b5f0-4122-8369-08d7830c57de x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1443; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(66574012)(186003)(107886003)(8676002)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(15650500001)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4477; 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: 3Os7X0pLblDRQ2Gk1X7kusWGlptHvRYX19BLcK81hl9yIVQ10C91YQJTZFoFG6Z0A4ziX6sR/4XnjB0SFUj5xI1buQfnTQn/Z6FPl8CksXb2c8Fs3d2YGGLGeNE/fvQUX1QDXCCsTo6p9qNr1Wo1pBWGrxJlq+UMUOf1xGR1qHGSLXRiFhjAYGTHfzUDmdSSGDvuzR6mLtKkGG3pD47Hab6ttQL3AtIm6z+IOZJat4F6TQfJmwK2NdyNmVdwnEGsUnUZ+5SpvPi+AkQ3Ew+nZTuuX6lQs3Zce8IP2KIou0n7Jwr/YgkBYE+95BF/IcDlCIHbLKVYHpzXNFb85n30BoYRo+WL4aWo1D7YlQbxY9zY2aI9iOf3FU8ZzN75edfpDzJwXDLhtbyvaZVKuuKmOyHIVak02arTMWrHcpbztrRgKGtCbLJbjN9H1pefJBmW Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fea9b41-b5f0-4122-8369-08d7830c57de X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:33.4870 (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: bfET/4ZuttNtER363muqfh/5qioEDwADxFVlK9So9w5pud00vL6EaLmTpiUmb8exhipySLK/QnyW5jmXW4qX9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Simplify wfx_hw_scan() by splitting out the update of the probe request. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 59 ++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 122da87bbf92..8b184efad0cf 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -49,6 +49,27 @@ static int wfx_scan_start(struct wfx_vif *wvif, return 0; } +static int update_probe_tmpl(struct wfx_vif *wvif, + struct cfg80211_scan_request *req) +{ + struct hif_mib_template_frame *tmpl; + struct sk_buff *skb; + + skb = ieee80211_probereq_get(wvif->wdev->hw, wvif->vif->addr, + NULL, 0, req->ie_len); + if (!skb) + return -ENOMEM; + + skb_put_data(skb, req->ie, req->ie_len); + skb_push(skb, 4); + tmpl = (struct hif_mib_template_frame *)skb->data; + tmpl->frame_type = HIF_TMPLT_PRBREQ; + tmpl->frame_length = cpu_to_le16(skb->len - 4); + hif_set_template_frame(wvif, tmpl); + dev_kfree_skb(skb); + return 0; +} + int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_scan_request *hw_req) @@ -56,9 +77,7 @@ int wfx_hw_scan(struct ieee80211_hw *hw, struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; struct cfg80211_scan_request *req = &hw_req->req; - struct sk_buff *skb; int i, ret; - struct hif_mib_template_frame *p; if (!wvif) return -EINVAL; @@ -72,29 +91,15 @@ int wfx_hw_scan(struct ieee80211_hw *hw, if (req->n_ssids > HIF_API_MAX_NB_SSIDS) return -EINVAL; - skb = ieee80211_probereq_get(hw, wvif->vif->addr, NULL, 0, req->ie_len); - if (!skb) - return -ENOMEM; - - if (req->ie_len) - memcpy(skb_put(skb, req->ie_len), req->ie, req->ie_len); - mutex_lock(&wdev->conf_mutex); - p = (struct hif_mib_template_frame *)skb_push(skb, 4); - p->frame_type = HIF_TMPLT_PRBREQ; - p->frame_length = cpu_to_le16(skb->len - 4); - ret = hif_set_template_frame(wvif, p); - skb_pull(skb, 4); - - if (!ret) - /* Host want to be the probe responder. */ - ret = wfx_fwd_probe_req(wvif, true); - if (ret) { - mutex_unlock(&wdev->conf_mutex); - dev_kfree_skb(skb); - return ret; - } + ret = update_probe_tmpl(wvif, req); + if (ret) + goto failed; + + ret = wfx_fwd_probe_req(wvif, true); + if (ret) + goto failed; wfx_tx_lock_flush(wdev); @@ -114,13 +119,11 @@ int wfx_hw_scan(struct ieee80211_hw *hw, dst->ssid_length = req->ssids[i].ssid_len; ++wvif->scan.n_ssids; } + schedule_work(&wvif->scan.work); +failed: mutex_unlock(&wdev->conf_mutex); - - if (skb) - dev_kfree_skb(skb); - schedule_work(&wvif->scan.work); - return 0; + return ret; } void wfx_scan_work(struct work_struct *work) From patchwork Tue Dec 17 16:15:34 2019 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: 1211501 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="gtWPbKiZ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjv56Lgqz9sSX for ; Wed, 18 Dec 2019 03:16:33 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729196AbfLQQQJ (ORCPT ); Tue, 17 Dec 2019 11:16:09 -0500 Received: from mail-dm6nam12on2072.outbound.protection.outlook.com ([40.107.243.72]:33729 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728755AbfLQQQH (ORCPT ); Tue, 17 Dec 2019 11:16:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iE2K/Doea4h75gGb+iAwpe9qRLMUQIsiFXTLQLGODM6ayqiLLw+8jXnF1oFiKAB//P58XoYsmxh0bfxLKON85U7siONU6X6zjSbY/B5sTqag3v/BVr/zbynewpi1BdRD20ywmRx6KeR1hu1B1J6SuGm2RQF7dPbI2jMzlkI+H2PwU0KmfuRejsoPgh02jmrMcu2+1bsvHrByJGNhPtxepsLlQ4Ol4B2hzho3XjGkSX8XOAWn6wIvqpz0qq5g27CQxkzAGGTFrSBtpLj5rp75OPCf31xhDCSaI4Db1UbPQgl4FdVC05SaIpj3bEOG4lTSfdJZUZJCnlh8A1u4DlgrEA== 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=Ee/z6m/vvrRSmvj8M3TfLohn1Xv4JRcuME8cta91xHM=; b=X2Axt3+Aub1+11QtO1uOuE1v1rMBSd+54GVYfgKvTBDVEOCP9nlhG+VA8XZAP+gz1fbmwzj6sxcPPZQgYZ02LyKfJYO5To7mHASmY7hXUsExJYVUhOV07gcx8T0Ezps+I7pd6Hnc5Cz+ijmtC3EeoRDM7abj38apLVsu7OhxwROppGD1PseXlFi6dWW49we6Yjp01L1pXCfs052tZdPWkJMQ/Wd9XcLEvPYAOZ0ciyvzB275phr0b8SAat0qW/mNxiJKXBxZK5/+rKy16rv8HpI3LnGR+2Fd1Yc5ryFFCrFtf1VZK5KmI39SVTeS6whE3qCgTbHLcXOn2aMbxvJMgg== 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=Ee/z6m/vvrRSmvj8M3TfLohn1Xv4JRcuME8cta91xHM=; b=gtWPbKiZs9Pq6YAOOQXcUD6J5fmgVJrsECw4dRr0yqK09vDi8hcXHHd1HdKz4mqrSFixzs56rVMEuLUuEWLeIoQamzwL/+BPteK2cj9mRMBj4HAr3vc51WHJqdfKzJK8Tj2TCoAmBi/nlWBKvjQagdr+68DUhsKTlxgTJ1ee3fQ= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:15:59 +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.2538.019; Tue, 17 Dec 2019 16:15:59 +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 49/55] staging: wfx: simplify hif_set_template_frame() usage Thread-Topic: [PATCH v2 49/55] staging: wfx: simplify hif_set_template_frame() usage Thread-Index: AQHVtPU27t+6bG2zg0qyvxNTFnYGUg== Date: Tue, 17 Dec 2019 16:15:34 +0000 Message-ID: <20191217161318.31402-50-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2f2b8e61-5884-43b3-3a35-08d7830c589c x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(66574012)(186003)(107886003)(8676002)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4477; 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: ImqAzruPbCt+dfDZNxioIW2C8Hj8Lz4pI+xJiX9ZzDhGoDl8CCTHBUBrtoOtfYpB2W33aNyl/9yWVkoaJH+RA8SUYmNOr5TuDXRHUuhuP0cnUlpEJmhF6afVgFxyn1i6sj0R+CKpW7jqs4EhysAVlOC9JfDSYjy3Q5Ur7d2myuYnuhm9nRUbMjGii38ODxr0nSWJym2B1EuCQkd3+aWsRor1DR4aVKu4V/eJf6mkisTtBicwW9vSerdwfQJs7Fs3SscwlX7S4AvNerA0ttbSa0JwUXToRDYe5haQ1OzO6eUjZfzxh804iDEM5szUmf7ZDYO+r0461itj1yR+hBw2nl9HAjYyfCiC3Yfg5ksKodsBIO2Yi0L/AG6xOtYZrmVp2zcGjhgredq7DeBw9mVbfkYujKb3fPYntUEBnTjd68nMu7ro+STeQHR/wVi9JySj Content-ID: <4C80F7D799C1AA4DAB6C0C60FBE369CA@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f2b8e61-5884-43b3-3a35-08d7830c589c X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:34.7273 (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: jx5tLeJMajjxLebmima1Vd8ZAvq+7fsUHnajcEWy31vCf3vccPGRuqxj5Z+0V4cNFxJyAkA9QN9BSnqLKVxFZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The structure hif_mib_template_frame come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, the current code for hif_set_template_frame() is dumb. All the difficult task is left to the caller. So, there is code to factorize here. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 11 ++++++++++- drivers/staging/wfx/scan.c | 7 +------ drivers/staging/wfx/sta.c | 29 +++++++---------------------- 3 files changed, 18 insertions(+), 29 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index d77765f75f10..b1eeda2a3ab3 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -130,8 +130,17 @@ static inline int hif_set_operational_mode(struct wfx_dev *wdev, } static inline int hif_set_template_frame(struct wfx_vif *wvif, - struct hif_mib_template_frame *arg) + struct sk_buff *skb, + u8 frame_type, int init_rate) { + struct hif_mib_template_frame *arg; + + skb_push(skb, 4); + arg = (struct hif_mib_template_frame *)skb->data; + skb_pull(skb, 4); + arg->init_rate = init_rate; + arg->frame_type = frame_type; + arg->frame_length = cpu_to_le16(skb->len); return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_TEMPLATE_FRAME, arg, sizeof(*arg)); } diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 8b184efad0cf..c82c04ff5d06 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -52,7 +52,6 @@ static int wfx_scan_start(struct wfx_vif *wvif, static int update_probe_tmpl(struct wfx_vif *wvif, struct cfg80211_scan_request *req) { - struct hif_mib_template_frame *tmpl; struct sk_buff *skb; skb = ieee80211_probereq_get(wvif->wdev->hw, wvif->vif->addr, @@ -61,11 +60,7 @@ static int update_probe_tmpl(struct wfx_vif *wvif, return -ENOMEM; skb_put_data(skb, req->ie, req->ie_len); - skb_push(skb, 4); - tmpl = (struct hif_mib_template_frame *)skb->data; - tmpl->frame_type = HIF_TMPLT_PRBREQ; - tmpl->frame_length = cpu_to_le16(skb->len - 4); - hif_set_template_frame(wvif, tmpl); + hif_set_template_frame(wvif, skb, HIF_TMPLT_PRBREQ, 0); dev_kfree_skb(skb); return 0; } diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 19ca13543a25..ba3e81fd477b 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -831,32 +831,20 @@ static int wfx_update_beaconing(struct wfx_vif *wvif) static int wfx_upload_beacon(struct wfx_vif *wvif) { - int ret = 0; - struct sk_buff *skb = NULL; + struct sk_buff *skb; struct ieee80211_mgmt *mgmt; - struct hif_mib_template_frame *p; if (wvif->vif->type == NL80211_IFTYPE_STATION || wvif->vif->type == NL80211_IFTYPE_MONITOR || wvif->vif->type == NL80211_IFTYPE_UNSPECIFIED) - goto done; + return 0; skb = ieee80211_beacon_get(wvif->wdev->hw, wvif->vif); - if (!skb) return -ENOMEM; + hif_set_template_frame(wvif, skb, HIF_TMPLT_BCN, + API_RATE_INDEX_B_1MBPS); - p = (struct hif_mib_template_frame *) skb_push(skb, 4); - p->frame_type = HIF_TMPLT_BCN; - p->init_rate = API_RATE_INDEX_B_1MBPS; /* 1Mbps DSSS */ - p->frame_length = cpu_to_le16(skb->len - 4); - - ret = hif_set_template_frame(wvif, p); - - skb_pull(skb, 4); - - if (ret) - goto done; /* TODO: Distill probe resp; remove TIM and any other beacon-specific * IEs */ @@ -864,14 +852,11 @@ static int wfx_upload_beacon(struct wfx_vif *wvif) mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP); - p->frame_type = HIF_TMPLT_PRBRES; - - ret = hif_set_template_frame(wvif, p); + hif_set_template_frame(wvif, skb, HIF_TMPLT_PRBRES, + API_RATE_INDEX_B_1MBPS); wfx_fwd_probe_req(wvif, false); - -done: dev_kfree_skb(skb); - return ret; + return 0; } static int wfx_is_ht(const struct wfx_ht_info *ht_info) From patchwork Tue Dec 17 16:15:35 2019 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: 1211502 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="exMRO7/R"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjvC3Y8kz9sSV for ; Wed, 18 Dec 2019 03:16:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728829AbfLQQQf (ORCPT ); Tue, 17 Dec 2019 11:16:35 -0500 Received: from mail-dm6nam12on2072.outbound.protection.outlook.com ([40.107.243.72]:33729 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728466AbfLQQQK (ORCPT ); Tue, 17 Dec 2019 11:16:10 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cw8moinRmfBl4rIvr5wD/f+wKnvXjMtwzfRXftWaJuQRHBHOK2byJnzeMvv7AXcP+9N76S2tjSnV921k3niFYdJ1w9x+iQNo0HnkgwExZs0H70LFMRcGmxejO/PjpZtCoDZ/iH41olPxHULVQGi3brW5VYoj0pRlgPwhLRwj/sWikRHLcsSwnno2C1RoV2ca8v3/r5nWQDv82uiIgjyA3Ow7ydBPLbFjwws5oYOrawGZPEC0k8TuacJhkAGG5m62dKwbCALKMvYLL3b71zi3+9pjrLtNoIBjc5NgsM0JxgMwluHqljq3AlvugQzEAPiNryQYyLVv0MPkDjTlEunCLA== 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=abwaC/EprcvfAMIMK5YnQofxaQusI+LMGZvh/14CrDk=; b=HUg3/B/Jez9gNW+QWRRWj/XT9/GYLWDv1QolepVr3PvFbx3MzYAs/iJfe0GMATR3IIQdyzAw4Zoh0HPX0O0J0qoX9XGS5Gtx/rpAp4TgX/sWYt0YG6xU5bA1r/RLNM3QaLNYcyXVTt0Ltmp6XhKNA0N9xN+3Bqg5L2hsYnCwvdhAKCXsfY2EBT14TzMrqvMSg35fhjL9S0sxdgoIDi2/KKXUlFww7Shu5lxT+3DjUbm1P0byaHFvqGIlaBgD84Ymc536O/UxK6Ftqm0/LGueMt1rYn6oYPal+OFuym99VfbUoW0mo8whgSVn7FhaIFwMd8CTt+f1RLHql0q+Ocxh0g== 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=abwaC/EprcvfAMIMK5YnQofxaQusI+LMGZvh/14CrDk=; b=exMRO7/R725PSXgikY3Ua/9KMAo78ZiqYomyTM6m219NsrGN5uypbRZXUxsTS5VHGJ3/1rgph2EiktmiY0QGBsbPSWOfnxCItLhiAQDg4czaOYppizF1WlkKmiFqwhnuj0M8RewfR+0sNU9rOwfK1qRK6zT0WiFfVAm+vJvOrMU= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:16:01 +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.2538.019; Tue, 17 Dec 2019 16:16:00 +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 50/55] staging: wfx: rewrite wfx_hw_scan() Thread-Topic: [PATCH v2 50/55] staging: wfx: rewrite wfx_hw_scan() Thread-Index: AQHVtPU2YDzg5LD5lUmnp93AvrDBXg== Date: Tue, 17 Dec 2019 16:15:35 +0000 Message-ID: <20191217161318.31402-51-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c928e248-e79d-41f5-7be7-08d7830c5959 x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(66574012)(186003)(107886003)(8676002)(30864003)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4477; 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: 0/Uj4GuW5hYQuFyjPq4L3AYJorDKvr1gOZ19LNxjQDMdlfjlUOj+6EuNzkhfhG/YL77KZTqNEVKpQ1C8VTJU4dKpF3/6ZsKYENEHk7eEKTMDZzswIxKhaRDOF+qtQzJiuV0vCkx8DXR1FwrSW0ul2FkYHd8o/ZrDpVcO1VRSJLTkFGGFizAD73oCvtX2R99pFEUOa9ARYJX3DgZlmyOOUWEBB4LnZ1k6ea4qqcPCq+4JSl7Cavqtn6VLiqOXEUKr81qYep21jwupdfNIqlzeZ7ny46ELqVu0lhviUGWAWv8HibISDB/gemeSkAK8MYH77JFsAwP06PpJdFQT1QKP1hRE8ZXgfEDPw7ReZRDOG8huVabI3X8KKDgkL5fX5JVeUiNhCN+PAAiM6kkC2h1ISVR9ddMnJBSYu6ZhxoRK++rSQeojpMVefhG9x2HlT9t/ Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: c928e248-e79d-41f5-7be7-08d7830c5959 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:35.9796 (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: UNSC6784cJbDyNIWK8YEfHtkr8ydgB2VXDGG9QCBG64lclOgs2pnZCGqWty5AII2YteYU/qQ6TrAX04Fuahs/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Scan requests from mac80211 must be splitted in a few hardware requests (it is necessary to split channels with active scan and channels with passive scan). Current code schedules a work_struct for each hardware request and one delayed_work to handle scan timeout. It is far simpler to run send all the hardware requests synchronously and replace delayed_work with a simple wait_for_completion_timeout(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 2 +- drivers/staging/wfx/scan.c | 225 ++++++++++------------------------- drivers/staging/wfx/scan.h | 23 +--- drivers/staging/wfx/sta.c | 39 ++---- drivers/staging/wfx/wfx.h | 4 +- 5 files changed, 81 insertions(+), 212 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 8a3ccdc60b7d..408967a4c457 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -206,7 +206,7 @@ static int hif_scan_complete_indication(struct wfx_dev *wdev, const struct hif_ind_scan_cmpl *body = buf; WARN_ON(!wvif); - wfx_scan_complete_cb(wvif, body); + wfx_scan_complete(wvif, body); return 0; } diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index c82c04ff5d06..b73e61e8da46 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -22,33 +22,6 @@ static void __ieee80211_scan_completed_compat(struct ieee80211_hw *hw, ieee80211_scan_completed(hw, &info); } -static void wfx_scan_restart_delayed(struct wfx_vif *wvif) -{ - if (wvif->delayed_unjoin) { - wvif->delayed_unjoin = false; - if (!schedule_work(&wvif->unjoin_work)) - wfx_tx_unlock(wvif->wdev); - } else if (wvif->delayed_link_loss) { - wvif->delayed_link_loss = 0; - wfx_cqm_bssloss_sm(wvif, 1, 0, 0); - } -} - -static int wfx_scan_start(struct wfx_vif *wvif, - int chan_start_idx, int chan_num) -{ - int tmo; - - if (wvif->state == WFX_STATE_PRE_STA) - return -EBUSY; - - atomic_set(&wvif->scan.in_progress, 1); - - tmo = hif_scan(wvif, wvif->scan.req, chan_start_idx, chan_num); - schedule_delayed_work(&wvif->scan.timeout, tmo); - return 0; -} - static int update_probe_tmpl(struct wfx_vif *wvif, struct cfg80211_scan_request *req) { @@ -65,153 +38,81 @@ static int update_probe_tmpl(struct wfx_vif *wvif, return 0; } -int wfx_hw_scan(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - struct ieee80211_scan_request *hw_req) +static int send_scan_req(struct wfx_vif *wvif, + struct cfg80211_scan_request *req, int start_idx) +{ + int i, ret, timeout; + struct ieee80211_channel *ch_start, *ch_cur; + + for (i = start_idx; i < req->n_channels; i++) { + ch_start = req->channels[start_idx]; + ch_cur = req->channels[i]; + WARN(ch_cur->band != NL80211_BAND_2GHZ, "band not supported"); + if (ch_cur->max_power != ch_start->max_power) + break; + if ((ch_cur->flags ^ ch_start->flags) & IEEE80211_CHAN_NO_IR) + break; + } + wfx_tx_lock_flush(wvif->wdev); + reinit_completion(&wvif->scan_complete); + ret = hif_scan(wvif, req, start_idx, i - start_idx); + if (ret < 0) + return ret; + timeout = ret; + ret = wait_for_completion_timeout(&wvif->scan_complete, timeout); + if (req->channels[start_idx]->max_power != wvif->wdev->output_power) + hif_set_output_power(wvif, wvif->wdev->output_power * 10); + wfx_tx_unlock(wvif->wdev); + if (!ret) { + dev_notice(wvif->wdev->dev, "scan timeout\n"); + hif_stop_scan(wvif); + return -ETIMEDOUT; + } + return i - start_idx; +} + +int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_scan_request *hw_req) { struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; - struct cfg80211_scan_request *req = &hw_req->req; - int i, ret; + int chan_cur, ret; - if (!wvif) - return -EINVAL; + WARN_ON(hw_req->req.n_channels > HIF_API_MAX_NB_CHANNELS); - if (wvif->state == WFX_STATE_AP) + if (vif->type == NL80211_IFTYPE_AP) return -EOPNOTSUPP; - if (req->n_ssids == 1 && !req->ssids[0].ssid_len) - req->n_ssids = 0; - - if (req->n_ssids > HIF_API_MAX_NB_SSIDS) - return -EINVAL; + if (wvif->state == WFX_STATE_PRE_STA) + return -EBUSY; + mutex_lock(&wvif->scan_lock); mutex_lock(&wdev->conf_mutex); - - ret = update_probe_tmpl(wvif, req); - if (ret) - goto failed; - - ret = wfx_fwd_probe_req(wvif, true); - if (ret) - goto failed; - - wfx_tx_lock_flush(wdev); - - WARN(wvif->scan.req, "unexpected concurrent scan"); - wvif->scan.req = req; - wvif->scan.n_ssids = 0; - wvif->scan.status = 0; - wvif->scan.begin = &req->channels[0]; - wvif->scan.curr = wvif->scan.begin; - wvif->scan.end = &req->channels[req->n_channels]; - wvif->scan.output_power = wdev->output_power; - - for (i = 0; i < req->n_ssids; ++i) { - struct hif_ssid_def *dst = &wvif->scan.ssids[wvif->scan.n_ssids]; - - memcpy(&dst->ssid[0], req->ssids[i].ssid, sizeof(dst->ssid)); - dst->ssid_length = req->ssids[i].ssid_len; - ++wvif->scan.n_ssids; - } - schedule_work(&wvif->scan.work); - -failed: + update_probe_tmpl(wvif, &hw_req->req); + wfx_fwd_probe_req(wvif, true); + chan_cur = 0; + do { + ret = send_scan_req(wvif, &hw_req->req, chan_cur); + if (ret > 0) + chan_cur += ret; + } while (ret > 0 && chan_cur < hw_req->req.n_channels); + __ieee80211_scan_completed_compat(hw, ret < 0); mutex_unlock(&wdev->conf_mutex); - return ret; -} - -void wfx_scan_work(struct work_struct *work) -{ - struct wfx_vif *wvif = container_of(work, struct wfx_vif, scan.work); - struct ieee80211_channel **it; - struct ieee80211_channel *first; - int i; - - down(&wvif->scan.lock); - mutex_lock(&wvif->wdev->conf_mutex); - - - if (!wvif->scan.req || wvif->scan.curr == wvif->scan.end) { - if (wvif->scan.output_power != wvif->wdev->output_power) - hif_set_output_power(wvif, - wvif->wdev->output_power * 10); - - if (wvif->scan.status < 0) - dev_warn(wvif->wdev->dev, "scan failed\n"); - else if (wvif->scan.req) - dev_dbg(wvif->wdev->dev, "scan completed\n"); - else - dev_dbg(wvif->wdev->dev, "scan canceled\n"); - - wvif->scan.req = NULL; - wfx_scan_restart_delayed(wvif); - wfx_tx_unlock(wvif->wdev); - mutex_unlock(&wvif->wdev->conf_mutex); - __ieee80211_scan_completed_compat(wvif->wdev->hw, - wvif->scan.status ? 1 : 0); - up(&wvif->scan.lock); - return; - } - first = *wvif->scan.curr; - - for (it = wvif->scan.curr + 1, i = 1; - it != wvif->scan.end && i < HIF_API_MAX_NB_CHANNELS; - ++it, ++i) { - if ((*it)->band != first->band) - break; - if (((*it)->flags ^ first->flags) & - IEEE80211_CHAN_NO_IR) - break; - if (!(first->flags & IEEE80211_CHAN_NO_IR) && - (*it)->max_power != first->max_power) - break; - } - if (!(first->flags & IEEE80211_CHAN_NO_IR) && - wvif->scan.output_power != first->max_power) { - wvif->scan.output_power = first->max_power; - hif_set_output_power(wvif, wvif->scan.output_power * 10); - } - wvif->scan.status = wfx_scan_start(wvif, - wvif->scan.curr - wvif->scan.begin, - it - wvif->scan.curr); - if (wvif->scan.status) - goto fail; - wvif->scan.curr = it; - mutex_unlock(&wvif->wdev->conf_mutex); - return; - -fail: - wvif->scan.curr = wvif->scan.end; - mutex_unlock(&wvif->wdev->conf_mutex); - up(&wvif->scan.lock); - schedule_work(&wvif->scan.work); -} - -void wfx_scan_complete_cb(struct wfx_vif *wvif, - const struct hif_ind_scan_cmpl *arg) -{ - if (cancel_delayed_work_sync(&wvif->scan.timeout) > 0) { - wvif->scan.status = 1; - schedule_work(&wvif->scan.timeout.work); + mutex_unlock(&wvif->scan_lock); + if (wvif->delayed_unjoin) { + wvif->delayed_unjoin = false; + wfx_tx_lock(wdev); + if (!schedule_work(&wvif->unjoin_work)) + wfx_tx_unlock(wdev); + } else if (wvif->delayed_link_loss) { + wvif->delayed_link_loss = false; + wfx_cqm_bssloss_sm(wvif, 1, 0, 0); } + return 0; } -void wfx_scan_timeout(struct work_struct *work) +void wfx_scan_complete(struct wfx_vif *wvif, + const struct hif_ind_scan_cmpl *arg) { - struct wfx_vif *wvif = container_of(work, struct wfx_vif, - scan.timeout.work); - - if (atomic_xchg(&wvif->scan.in_progress, 0)) { - if (wvif->scan.status > 0) { - wvif->scan.status = 0; - } else if (!wvif->scan.status) { - dev_warn(wvif->wdev->dev, "timeout waiting for scan complete notification\n"); - wvif->scan.status = -ETIMEDOUT; - wvif->scan.curr = wvif->scan.end; - hif_stop_scan(wvif); - } - up(&wvif->scan.lock); - wfx_scan_work(&wvif->scan.work); - } + complete(&wvif->scan_complete); } diff --git a/drivers/staging/wfx/scan.h b/drivers/staging/wfx/scan.h index e71e5f0f522e..03bc6c7e562d 100644 --- a/drivers/staging/wfx/scan.h +++ b/drivers/staging/wfx/scan.h @@ -8,8 +8,6 @@ #ifndef WFX_SCAN_H #define WFX_SCAN_H -#include -#include #include #include "hif_api_cmd.h" @@ -17,26 +15,9 @@ struct wfx_dev; struct wfx_vif; -struct wfx_scan { - struct semaphore lock; - struct work_struct work; - struct delayed_work timeout; - struct cfg80211_scan_request *req; - struct ieee80211_channel **begin; - struct ieee80211_channel **curr; - struct ieee80211_channel **end; - struct hif_ssid_def ssids[HIF_API_MAX_NB_SSIDS]; - int output_power; - int n_ssids; - int status; - atomic_t in_progress; -}; - int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_scan_request *req); -void wfx_scan_work(struct work_struct *work); -void wfx_scan_timeout(struct work_struct *work); -void wfx_scan_complete_cb(struct wfx_vif *wvif, - const struct hif_ind_scan_cmpl *arg); +void wfx_scan_complete(struct wfx_vif *wvif, + const struct hif_ind_scan_cmpl *ind); #endif /* WFX_SCAN_H */ diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index ba3e81fd477b..16f5db873275 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -277,13 +277,13 @@ void wfx_configure_filter(struct ieee80211_hw *hw, *total_flags &= FIF_OTHER_BSS | FIF_FCSFAIL | FIF_PROBE_REQ; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - down(&wvif->scan.lock); + mutex_lock(&wvif->scan_lock); wvif->filter_bssid = (*total_flags & (FIF_OTHER_BSS | FIF_PROBE_REQ)) ? 0 : 1; wvif->disable_beacon_filter = !(*total_flags & FIF_PROBE_REQ); wfx_fwd_probe_req(wvif, true); wfx_update_filtering(wvif); - up(&wvif->scan.lock); + mutex_unlock(&wvif->scan_lock); } } @@ -433,9 +433,9 @@ static void wfx_event_handler_work(struct work_struct *work) switch (event->evt.event_id) { case HIF_EVENT_IND_BSSLOST: cancel_work_sync(&wvif->unjoin_work); - if (!down_trylock(&wvif->scan.lock)) { + if (mutex_trylock(&wvif->scan_lock)) { wfx_cqm_bssloss_sm(wvif, 1, 0, 0); - up(&wvif->scan.lock); + mutex_unlock(&wvif->scan_lock); } else { /* Scan is in progress. Delay reporting. * Scan complete will trigger bss_loss_work @@ -501,7 +501,7 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) { mutex_lock(&wvif->wdev->conf_mutex); - if (atomic_read(&wvif->scan.in_progress)) { + if (!mutex_trylock(&wvif->scan_lock)) { if (wvif->delayed_unjoin) dev_dbg(wvif->wdev->dev, "delayed unjoin is already scheduled\n"); @@ -509,6 +509,7 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) wvif->delayed_unjoin = true; goto done; } + mutex_unlock(&wvif->scan_lock); wvif->delayed_link_loss = false; @@ -613,14 +614,6 @@ static void wfx_do_join(struct wfx_vif *wvif) mutex_lock(&wvif->wdev->conf_mutex); - /* Under the conf lock: check scan status and - * bail out if it is in progress. - */ - if (atomic_read(&wvif->scan.in_progress)) { - wfx_tx_unlock(wvif->wdev); - goto done_put; - } - /* Sanity check basic rates */ if (!join.basic_rate_set) join.basic_rate_set = 7; @@ -684,7 +677,6 @@ static void wfx_do_join(struct wfx_vif *wvif) } wfx_update_filtering(wvif); -done_put: mutex_unlock(&wvif->wdev->conf_mutex); if (bss) cfg80211_put_bss(wvif->wdev->hw->wiphy, bss); @@ -1346,7 +1338,7 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed) return 0; } - down(&wvif->scan.lock); + mutex_lock(&wvif->scan_lock); mutex_lock(&wdev->conf_mutex); if (changed & IEEE80211_CONF_CHANGE_POWER) { wdev->output_power = conf->power_level; @@ -1361,7 +1353,7 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed) } mutex_unlock(&wdev->conf_mutex); - up(&wvif->scan.lock); + mutex_unlock(&wvif->scan_lock); return ret; } @@ -1419,10 +1411,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) wvif->wep_default_key_id = -1; INIT_WORK(&wvif->wep_key_work, wfx_wep_key_work); - sema_init(&wvif->scan.lock, 1); - INIT_WORK(&wvif->scan.work, wfx_scan_work); - INIT_DELAYED_WORK(&wvif->scan.timeout, wfx_scan_timeout); - spin_lock_init(&wvif->event_queue_lock); INIT_LIST_HEAD(&wvif->event_queue); INIT_WORK(&wvif->event_handler_work, wfx_event_handler_work); @@ -1435,8 +1423,11 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) INIT_WORK(&wvif->bss_params_work, wfx_bss_params_work); INIT_WORK(&wvif->set_cts_work, wfx_set_cts_work); INIT_WORK(&wvif->unjoin_work, wfx_unjoin_work); - INIT_WORK(&wvif->tx_policy_upload_work, wfx_tx_policy_upload_work); + + mutex_init(&wvif->scan_lock); + init_completion(&wvif->scan_complete); + mutex_unlock(&wdev->conf_mutex); hif_set_macaddr(wvif, vif->addr); @@ -1462,10 +1453,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; int i; - // If scan is in progress, stop it - while (down_trylock(&wvif->scan.lock)) - schedule(); - up(&wvif->scan.lock); wait_for_completion_timeout(&wvif->set_pm_mode_complete, msecs_to_jiffies(300)); mutex_lock(&wdev->conf_mutex); @@ -1505,8 +1492,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, /* FIXME: In add to reset MAC address, try to reset interface */ hif_set_macaddr(wvif, NULL); - cancel_delayed_work_sync(&wvif->scan.timeout); - wfx_cqm_bssloss_sm(wvif, 0, 0, 0); cancel_work_sync(&wvif->unjoin_work); cancel_delayed_work_sync(&wvif->link_id_gc_work); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 35f5ddc2eeb3..3356d0cbf7af 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -125,7 +125,9 @@ struct wfx_vif { bool delayed_unjoin; struct work_struct unjoin_work; - struct wfx_scan scan; + /* avoid some operations in parallel with scan */ + struct mutex scan_lock; + struct completion scan_complete; struct completion set_pm_mode_complete; From patchwork Tue Dec 17 16:15:37 2019 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: 1211499 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="RUPq28xO"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjtz08Ckz9sSQ for ; Wed, 18 Dec 2019 03:16:27 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729248AbfLQQQP (ORCPT ); Tue, 17 Dec 2019 11:16:15 -0500 Received: from mail-dm6nam12on2072.outbound.protection.outlook.com ([40.107.243.72]:33729 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729202AbfLQQQN (ORCPT ); Tue, 17 Dec 2019 11:16:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JL6Z45X94EGcko5cVf3JA5YWXLPmSIEUAjDxn1RQJQvCJaBOCpAvfoHVJwkqtlNUa2QsZD5WoRTrYFax7EHlCkjrag0dZmFvnBjjuqjNC48agJZjhBCAsUaDAqjDolT6jtb2RjDjgbSFJE9zhKPK7SP2P8Ooqp+eE5C/PokQ//Hy+Eh7qpq04ZOePJC0KzVownQSgJog6eFL8X19MDJsMnnDMpDs/NM1Ls69z/D9+laj7HQ20+1MgVZjfRJvSX/D8yKd73tOdEOjZCPQ7A39RWW9nedICJJ2bihIxhqFPo2t0NB7fsJHiqZzhGVrBBcMBIU28Q7jGu1bkwR0AOwYtQ== 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=8yPmS4H5E8JPUG3xYt17LIXx6rW02POsO+7NNwVhTFw=; b=R3T6Lr7Y4nAcAMryfwKH6ECcraYLV4eIHHdMsmp8wA89WfqXXY2Tg5rbeZa5ynjRZIxVelWbDbD2MMWsN5EQ3/z3ySm8cffcAYkef2D+Z6ijZUTYVWqR9aWFBpUq1T3f460r7ZR1ROlAjK/wGvesVM7Z4jqX2dxME5s+tk6Un8nyKMtZDBXsLe8iel1ldSih/fSHwCw+3HoxBUr1G6u1ISWvhW40gxTWvWHOIK+3gCBAVVDl651NGmaH3yKPc1z68D6I008wzsfNw2RryWtTsbs7tKq4TrU5oRMYnKu4jYBizbXRn3+9I2dLnHilJM3fMkQP98x9sCna4pB/tG4evg== 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=8yPmS4H5E8JPUG3xYt17LIXx6rW02POsO+7NNwVhTFw=; b=RUPq28xOEwfZdaYnkfsnrXs4EM8w/5ojfZ/NsuvKaCl5QVqQMCOZ9Te4H+QtoFzo/erZxpJbXAEgxttllHY7dvfZ0CNyt5nDzlNkym+T+h3ZjrQ440xUBW71Yz3P9dePGC2EPQVIqfya5eNt4OxGb7m5PHKOz1Q3luxcJEgxIf0= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:16:02 +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.2538.019; Tue, 17 Dec 2019 16:16: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?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 51/55] staging: wfx: workaround bug with "iw scan" Thread-Topic: [PATCH v2 51/55] staging: wfx: workaround bug with "iw scan" Thread-Index: AQHVtPU3xiUk2oUs3kW8So34MmM/rw== Date: Tue, 17 Dec 2019 16:15:37 +0000 Message-ID: <20191217161318.31402-52-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a4a51ef6-660b-465b-2e3b-08d7830c5a19 x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(66574012)(186003)(107886003)(8676002)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4477; 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: SF/NnugUPFTBKeG4nBwzp1WqK+3K4OO+tCggqf4zo/I/RZaF2xI2OppESwktTV/rnL1SK5yxc6hdfEsKKQFObZyR0/HynQJk3ZGLf93esCFUxq+FE5U6qPzaFAUxt87m1tSVrZ6RTQkc7orYO1FktiTFWrI1d9+jUo+U+/ukzRfTwGwGxek/7FgZYM/zLLc4NjbtCo8u9V9U2THTykoy8EfmqtzJTjKK7HEQEpowsH0u0I4q7VoIq4RNBprrRsZXqkPGaLDlzAto255CVJ9LFYCqj84bJfOP3zsHO40T02UWS1Xe3sQYXr5E5mA6oluOa4JrC0eTsBqb3XBIZxjyUGff1nuEZ8yedCScCpbCac7xFj+4NroShvVejOWSrFZ7SwCXi4RRtDbtFLIhzquoO0ChER/QUWlCcMH3EwkQpWS//aInRCE1Phe+XDSAcWoB Content-ID: <90446FA95A74B94B8D05B0C4D380CEB4@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4a51ef6-660b-465b-2e3b-08d7830c5a19 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:37.2259 (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: w0YYV1ogO8TNKKrNdVrKuH+trGrUQKAXU635rZdr9S/LkV/TSMHMz6HJSlMUzQrKYYY9DUKnh+qDTuve7eMDPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller mac80211 specification does not forbid hw_scan() to call ieee80211_scan_completed(). However, from userspace point of view, not all applications support this behavior. In particular, the code of iw contains a big fat warning: /* * This code has a bug, which requires creating a separate * nl80211 socket to fix: * It is possible for a NL80211_CMD_NEW_SCAN_RESULTS or * NL80211_CMD_SCAN_ABORTED message to be sent by the kernel * before (!) we listen to it, because we only start listening * after we send our scan request. [...] * Alas, the kernel doesn't do that (yet). */ So, we have to avoid to call ieee80211_scan_completed() from hw_scan() (it's a kind of unwritten rule). This patch relocates the hw_scan() process to a work_struct to fix the problem. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 47 ++++++++++++++++++++++++-------------- drivers/staging/wfx/scan.h | 1 + drivers/staging/wfx/sta.c | 1 + drivers/staging/wfx/wfx.h | 2 ++ 4 files changed, 34 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index b73e61e8da46..540009b72240 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -71,23 +71,19 @@ static int send_scan_req(struct wfx_vif *wvif, return i - start_idx; } -int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - struct ieee80211_scan_request *hw_req) +/* + * It is not really necessary to run scan request asynchronously. However, + * there is a bug in "iw scan" when ieee80211_scan_completed() is called before + * wfx_hw_scan() return + */ +void wfx_hw_scan_work(struct work_struct *work) { - struct wfx_dev *wdev = hw->priv; - struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; + struct wfx_vif *wvif = container_of(work, struct wfx_vif, scan_work); + struct ieee80211_scan_request *hw_req = wvif->scan_req; int chan_cur, ret; - WARN_ON(hw_req->req.n_channels > HIF_API_MAX_NB_CHANNELS); - - if (vif->type == NL80211_IFTYPE_AP) - return -EOPNOTSUPP; - - if (wvif->state == WFX_STATE_PRE_STA) - return -EBUSY; - mutex_lock(&wvif->scan_lock); - mutex_lock(&wdev->conf_mutex); + mutex_lock(&wvif->wdev->conf_mutex); update_probe_tmpl(wvif, &hw_req->req); wfx_fwd_probe_req(wvif, true); chan_cur = 0; @@ -96,18 +92,35 @@ int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, if (ret > 0) chan_cur += ret; } while (ret > 0 && chan_cur < hw_req->req.n_channels); - __ieee80211_scan_completed_compat(hw, ret < 0); - mutex_unlock(&wdev->conf_mutex); + mutex_unlock(&wvif->wdev->conf_mutex); mutex_unlock(&wvif->scan_lock); + __ieee80211_scan_completed_compat(wvif->wdev->hw, ret < 0); if (wvif->delayed_unjoin) { wvif->delayed_unjoin = false; - wfx_tx_lock(wdev); + wfx_tx_lock(wvif->wdev); if (!schedule_work(&wvif->unjoin_work)) - wfx_tx_unlock(wdev); + wfx_tx_unlock(wvif->wdev); } else if (wvif->delayed_link_loss) { wvif->delayed_link_loss = false; wfx_cqm_bssloss_sm(wvif, 1, 0, 0); } +} + +int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_scan_request *hw_req) +{ + struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv; + + WARN_ON(hw_req->req.n_channels > HIF_API_MAX_NB_CHANNELS); + + if (vif->type == NL80211_IFTYPE_AP) + return -EOPNOTSUPP; + + if (wvif->state == WFX_STATE_PRE_STA) + return -EBUSY; + + wvif->scan_req = hw_req; + schedule_work(&wvif->scan_work); return 0; } diff --git a/drivers/staging/wfx/scan.h b/drivers/staging/wfx/scan.h index 03bc6c7e562d..b547f1927d72 100644 --- a/drivers/staging/wfx/scan.h +++ b/drivers/staging/wfx/scan.h @@ -15,6 +15,7 @@ struct wfx_dev; struct wfx_vif; +void wfx_hw_scan_work(struct work_struct *work); int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_scan_request *req); void wfx_scan_complete(struct wfx_vif *wvif, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 16f5db873275..4354bb8081c5 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -1427,6 +1427,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); mutex_unlock(&wdev->conf_mutex); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 3356d0cbf7af..b5f763c3fac7 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -127,7 +127,9 @@ struct wfx_vif { /* avoid some operations in parallel with scan */ struct mutex scan_lock; + struct work_struct scan_work; struct completion scan_complete; + struct ieee80211_scan_request *scan_req; struct completion set_pm_mode_complete; From patchwork Tue Dec 17 16:15:38 2019 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: 1211498 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="hJ4AJ0Lj"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjtt4vk1z9sRh for ; Wed, 18 Dec 2019 03:16:22 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729264AbfLQQQR (ORCPT ); Tue, 17 Dec 2019 11:16:17 -0500 Received: from mail-dm6nam12on2072.outbound.protection.outlook.com ([40.107.243.72]:33729 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728642AbfLQQQQ (ORCPT ); Tue, 17 Dec 2019 11:16:16 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qq3pnEtudPC0OsI+CTrGex6mHpTyrXQJs0+yKlT4F70qMpJvCV8r5QFwrArTODPf0AB5XpUBeOLHwXCd5zwPrqcRysldwnO2idZy7++wx5l5C63+VQvwxnAkzkYIxF/PtgBdCltk+hp1W1GgjNwf6nYt/28ehBBc/UwHyJ9gTiiGzCVY3kgvDlL9bpi7EBKuHdbwksUnBRUavE90J+pYLYU9mZs9csjLYtIBW0v8bFAnqxYiys4LxaNLfFK3biz2KAD0mpSds77MQ5M0odpvqnZPXf9Oe/H3IZXo28np7xRdeGDCvWHmbl9ih7vtoX6dOzuO0Jo9zw+t9j2ZHCSnBw== 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=pBmCupR+XfI8OUMBZwe9ajX+xNfE7EuQEetv3O31LBQ=; b=W6hcz9DlR82/7m2VZ9vyKG6I7Fat84lzu1s7mLbNczDjidoZFxgFUsvOmQhgvKMrfzqUxt04Mckp/gxdz9tRM5qMRCFeVjzFZIwt4uqr3bLwh5uP0UF/ux56RRBiBXRDvjwZbUsx++pArMYdWhbnS/NxMKXdNxWUuEDb8GcO4Cmi70a8LEluCmk3IwL4T+CfRpbyz7EHYhtj6WTsE4LzPZrmqjBhGwIejh0RR7PU1I6Ds1Hf/6UDpERKqzY+5nXXEdx14e7TWxif6vm3d+z/UIKi03svcOhU68FzX/BeDNJBzOLalPILJu2/tnMNEJ0eevsRvlnDp4dmEVA6XVH9jA== 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=pBmCupR+XfI8OUMBZwe9ajX+xNfE7EuQEetv3O31LBQ=; b=hJ4AJ0Lj4xtSYZqdIxs90e7cH3++PHa2IoKPo5bujlbOd0F6B3A1SX/EhJFxIGszBOI7Bq6tRx0XekDM/mLWCLr2oj1bzNx2DHIz8AwZWjGNOr0XWEoXfo3o1aCommVRdTMwGAEOeW8QQqIcZ9Gt3TOJSDrYKsVbmPV0T6TiXUo= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:16:02 +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.2538.019; Tue, 17 Dec 2019 16:16: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?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 52/55] staging: wfx: delayed_unjoin cannot happen Thread-Topic: [PATCH v2 52/55] staging: wfx: delayed_unjoin cannot happen Thread-Index: AQHVtPU4StV4QnRFhEulRZOnDeUv5Q== Date: Tue, 17 Dec 2019 16:15:38 +0000 Message-ID: <20191217161318.31402-53-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 560a8ec3-ce4b-4781-31ec-08d7830c5ae9 x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(66574012)(186003)(107886003)(8676002)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4477; 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: PMEc9ycfGc0ybDXiTU8L/wjWn4oktSBAQx/EaygEKnRWZ8wzpVYB110ytO+E2O2HsXD+e50b7b9ww3CZWje7BtRfBV+ednKp08gHNBlBU9ZVxeI2MVLVXsWET+HV8TopPRrIYAJVe4UmSbCa68+WoAaOZWZsnVnK7J0pOHtNUhykbeBQzmG7ob1Jg4hCvULDoGMHII82kcefYF3ZPmHYjRg0vyeUuZCuCDNjOy+qqKRL88Y0DZ9g06SASlx+PEsZynnzGmf24EnfJNKWLekXVy7TU1i8iJ2GyDWRXcz00MXAuqFOkDX/D1TLtIW3DEJ7gE1/HabFGjJXA/k+yfUvMGjXqUJ5JMyaMzHx0AjDBWI8cACeLoZkH+UcM7A/ySYm0Hj7rjIii2izzjcseohGu8+1r1BbFQf5Yze83Kj8saflLjpsY+wlghclMgFBczm7 Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 560a8ec3-ce4b-4781-31ec-08d7830c5ae9 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:38.6281 (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: UILzeyrL5vP9YQLvKiCbzE+q5cfB+7bSzQAJ+ET26HdqfsJKgCpy+4uyIp8o6OCVkCGoOAyU0VG7KDz3oxzGqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Original code allows to detect an unjoin request during a scan and delaying the unjoin request. However, it is far easier to just block the unjoin request until the end of the scan request. In fact, it is already the case since scan and unjoin are protected by conf_mutex. So, currently, the handling of delayed_unjoin is just dead code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 7 +------ drivers/staging/wfx/sta.c | 14 -------------- drivers/staging/wfx/wfx.h | 1 - 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 540009b72240..bdbce6926e91 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -95,12 +95,7 @@ void wfx_hw_scan_work(struct work_struct *work) mutex_unlock(&wvif->wdev->conf_mutex); mutex_unlock(&wvif->scan_lock); __ieee80211_scan_completed_compat(wvif->wdev->hw, ret < 0); - if (wvif->delayed_unjoin) { - wvif->delayed_unjoin = false; - wfx_tx_lock(wvif->wdev); - if (!schedule_work(&wvif->unjoin_work)) - wfx_tx_unlock(wvif->wdev); - } else if (wvif->delayed_link_loss) { + if (wvif->delayed_link_loss) { wvif->delayed_link_loss = false; wfx_cqm_bssloss_sm(wvif, 1, 0, 0); } diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 4354bb8081c5..7ae763e96455 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -66,10 +66,6 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad) wvif->delayed_link_loss = 0; cancel_work_sync(&wvif->bss_params_work); - /* If we have a pending unjoin */ - if (wvif->delayed_unjoin) - goto end; - if (init) { schedule_delayed_work(&wvif->bss_loss_work, HZ); wvif->bss_loss_state = 0; @@ -501,16 +497,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) { mutex_lock(&wvif->wdev->conf_mutex); - if (!mutex_trylock(&wvif->scan_lock)) { - if (wvif->delayed_unjoin) - dev_dbg(wvif->wdev->dev, - "delayed unjoin is already scheduled\n"); - else - wvif->delayed_unjoin = true; - goto done; - } - mutex_unlock(&wvif->scan_lock); - wvif->delayed_link_loss = false; if (!wvif->state) diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index b5f763c3fac7..5e7c911db024 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -122,7 +122,6 @@ struct wfx_vif { struct work_struct set_cts_work; int join_complete_status; - bool delayed_unjoin; struct work_struct unjoin_work; /* avoid some operations in parallel with scan */ From patchwork Tue Dec 17 16:15:39 2019 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: 1211506 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="D4NOo8/M"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjvj4GnMz9sSF for ; Wed, 18 Dec 2019 03:17:05 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729156AbfLQQRB (ORCPT ); Tue, 17 Dec 2019 11:17:01 -0500 Received: from mail-bn7nam10on2078.outbound.protection.outlook.com ([40.107.92.78]:31534 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728522AbfLQQQG (ORCPT ); Tue, 17 Dec 2019 11:16:06 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wr2yMnuf/26/ucrpMj2/xWg2CCm5d/iToXlXBmVcmyL+hIunThAcVsbvqRnA19q7s4DkVB/BQYXTTTqsBvRTmrCOj6X63Oym9nHcnoACTBP2rOZzLco16B0ISnD54K4VY0qs0QxHRmyZTl32Ijj7S6VVn3QzFh3V6sOhIpGh50Iz8Vnc5Ec9G3qgnpHX8a+joYtJjwQM+q3aelfTF1+DjEahTf0HxRtUxF6yMMxr32g6WD9KL3O7MYvZJjyrmWG2h38BdUoGQsBrgT7RsXKqHSO7fYu+VtURwJox/Z0wmTXnRiTSov8IE7cDqGHDIeLQvBmHopai0OSGJMvhRZ/oPQ== 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=Mu0mjoAQJzGjXwx+jJTT1bjBwlNSB4kdrjnvQDQ3lVc=; b=hnn9n98R8UjOTFstDPSGcWvjTJ+GlGcLSxnexj0TR8M3XxGidfsIQjDPtBo3YIEb/lw+lFoMfKsxar5YoFfY3C8WILDpjVWA0TOHkS2fZwxdqHVC2N6ip531KTi7ldKHTYF8V8wGRuae9EWTcu/YWAlhe9HeAR9jaAOWVcxuon5ry9xAf7bnq2e8Neer2qA/F7OqXU6y6ZD+Ole5lT6Qg5Omp/xbc5FvgVpeyPq1pvXT6j5QFROOqymLAMnPQc2X7gBVGejSsSTshq6ci6yh+9mb0Coz/0RYAL9Sl3qOjvG+2Twyyy4ViEgmOMC4UHh/7LORuz56l5l+SsTa2hUD7w== 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=Mu0mjoAQJzGjXwx+jJTT1bjBwlNSB4kdrjnvQDQ3lVc=; b=D4NOo8/MH/G3oqsD5wP3542nQeA4PUqoE/z2b4SVpyJVVQ4GBTJhtw4YWqlqcvqJiNJISPJQr48Z1oLfPAnyWhaJMAT/g7JkQBKtof7gnfXaY3ieNF7Aoos56A82WpVxMszES+eMm/jX6Z71Swt/foAENYaZ67sIDJpmLls7wTE= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:16:03 +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.2538.019; Tue, 17 Dec 2019 16:16:03 +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 53/55] staging: wfx: delayed_link_loss cannot happen Thread-Topic: [PATCH v2 53/55] staging: wfx: delayed_link_loss cannot happen Thread-Index: AQHVtPU5XBjY6+iTL0u1q/qrv4sC6Q== Date: Tue, 17 Dec 2019 16:15:39 +0000 Message-ID: <20191217161318.31402-54-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d55df1c4-5ce5-49a4-dfc6-08d7830c5baa x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: /ARgdrUUOqN22siMyq4IENtfTivLj+Oj3tKD8RWKC+DiKgq8fAaYULiV3TmeEG7RUeBnxZhxc+C0k9qL7gTTaa/RCNtGfgXHw/0PrpBdsVUyb54W6hUHXy+X3ZAH2TGEjJPISMR21Z1waO//qPnfa7hCqBRcM4XGBq3l9TI5Esw3+H7fFFnqlVUPY117dd01I9xsNbMjhuQGrljRmK+SRfPU0P/uQ8B/VOc9MuxT45bG17A22H3kIFppCAlQJUW5v0RjrNrrV68b9cS9L3r84hRQnLcebflXNG6b3UMi1sBB6qJ4kIxa7mZhADBz5WYnnQYFwP3YKOthjNBV+V/eY77ypFAFRcZtYg0+eGRn6LdOFphfPalGps8XgqBPUOKn+YK0yJ3ZAG/F3P6eCUiQHVHSk+TuPjqTWr0C6OpnO8Pb/Le/jDaufk+ZeHutjtFa Content-ID: <4014511410AD2A4DAB4D17017AEDD18B@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: d55df1c4-5ce5-49a4-dfc6-08d7830c5baa X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:39.8464 (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: SblUKLvPCvREFLNgCRvXH5ksnfs9CL809G+bQ4jLeodnePkYj/PDaXZiPCLz4QiGGsOVZjO9LSbz1u+mbFruWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Original code allows to detect an BSS loss during a scan and delaying the handling of BSS loss. However, there it is no real problem to just make these two events mutually exclusive (there is just a performance penalty). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 4 ---- drivers/staging/wfx/sta.c | 18 +++--------------- drivers/staging/wfx/wfx.h | 1 - 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index bdbce6926e91..dde2f8868147 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -95,10 +95,6 @@ void wfx_hw_scan_work(struct work_struct *work) mutex_unlock(&wvif->wdev->conf_mutex); mutex_unlock(&wvif->scan_lock); __ieee80211_scan_completed_compat(wvif->wdev->hw, ret < 0); - if (wvif->delayed_link_loss) { - wvif->delayed_link_loss = false; - wfx_cqm_bssloss_sm(wvif, 1, 0, 0); - } } int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 7ae763e96455..3296bc3521d5 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -63,7 +63,6 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad) int tx = 0; mutex_lock(&wvif->bss_loss_lock); - wvif->delayed_link_loss = 0; cancel_work_sync(&wvif->bss_params_work); if (init) { @@ -429,18 +428,9 @@ static void wfx_event_handler_work(struct work_struct *work) switch (event->evt.event_id) { case HIF_EVENT_IND_BSSLOST: cancel_work_sync(&wvif->unjoin_work); - if (mutex_trylock(&wvif->scan_lock)) { - wfx_cqm_bssloss_sm(wvif, 1, 0, 0); - mutex_unlock(&wvif->scan_lock); - } else { - /* Scan is in progress. Delay reporting. - * Scan complete will trigger bss_loss_work - */ - wvif->delayed_link_loss = 1; - /* Also start a watchdog. */ - schedule_delayed_work(&wvif->bss_loss_work, - 5 * HZ); - } + mutex_lock(&wvif->scan_lock); + wfx_cqm_bssloss_sm(wvif, 1, 0, 0); + mutex_unlock(&wvif->scan_lock); break; case HIF_EVENT_IND_BSSREGAINED: wfx_cqm_bssloss_sm(wvif, 0, 0, 0); @@ -497,8 +487,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) { mutex_lock(&wvif->wdev->conf_mutex); - wvif->delayed_link_loss = false; - if (!wvif->state) goto done; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 5e7c911db024..db433bee87af 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -70,7 +70,6 @@ struct wfx_vif { int id; enum wfx_state state; - int delayed_link_loss; int bss_loss_state; u32 bss_loss_confirm_id; struct mutex bss_loss_lock; From patchwork Tue Dec 17 16:15:41 2019 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: 1211505 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="e2ZQLv3d"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjvW0pjKz9sRM for ; Wed, 18 Dec 2019 03:16:54 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729179AbfLQQQI (ORCPT ); Tue, 17 Dec 2019 11:16:08 -0500 Received: from mail-bn7nam10on2078.outbound.protection.outlook.com ([40.107.92.78]:31534 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729151AbfLQQQH (ORCPT ); Tue, 17 Dec 2019 11:16:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oD5f2GYKWBs4eB01On7O+YEzhiXF3e88GKvLkuenBy87+M/xTJqgVzgBBDoj+tjfUesJBia+IpVVr71ithPw71OxnK3McD3ibaJPZJkW1Ys+YyFa6Jcg4JJo8cYvv+rjEc3ao1LIZuFDh12j/CjMKNYY+2iGBFSfBwLKsz7jePSyWu6VGMroceMva5ECWFP6HCY5KgQvuH3hQtmwnMkLKwLpGSApAcXFOOolOgrCOIoEumP+aTQxtzUkGnoI2fi42w3vvMRGFOaXc2yFDB/UWadEvWWcfbhx10D31HYPgovDOzVd5DstxsB8G9Xbye6svIwlwgCW/cS10OMqhFyy9Q== 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=Y33ignvCp+2GinP/MWfVexEnxeePITEC0OtPfj23pfw=; b=ikDeA878PmNNWxj7PD/YiovbQ5n7f670H1k/MrWTo1FEd9//WejDuP6elRfnk7jdEg8nPIMNCJjwlZYj6+tJq9C6hUk24+n50qR8yqe7cBoRYI29cDP/KWJyx3iQEAkp8w1WVbIVAWGfwFuFVEoBRKQHm+Q5LaAMW59Qusk9sRqDH1fwnwGzSEpXjOaZ2YujlmbxSTdFarw/r9L5Jdbgt4Z9ZcxMgi3Pt9FfWa/wPBxVN0r66V2Y0t0vgp1BEL7CZaH4o+Wck9CrVpLzrJ+fswGI3fxhQpy0dS3aYwqOkjfLYgWbQhhHohAB2cqxJyTIj8PJScTAbxx+qPPzDe9RsA== 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=Y33ignvCp+2GinP/MWfVexEnxeePITEC0OtPfj23pfw=; b=e2ZQLv3dUPXKMz4/PGLNas+UUVp+jyzvH8NwrOZAgF0FAO0H+R9FG0cPjuBi/nRRlTPOl4k5nNkANZRJ3/Di+TMewmVaV/Aj7PtE4Ab5zXD3eaEgL59KFypd90JMUUBNQ5ZK/CIQNSoI5Pp/12KpB9E+Xi3BQS83MSGGaZ9GOko= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:16:04 +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.2538.019; Tue, 17 Dec 2019 16:16:04 +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 54/55] staging: wfx: implement cancel_hw_scan() Thread-Topic: [PATCH v2 54/55] staging: wfx: implement cancel_hw_scan() Thread-Index: AQHVtPU6aYi057RR/UqffDEzXC3u2w== Date: Tue, 17 Dec 2019 16:15:41 +0000 Message-ID: <20191217161318.31402-55-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 46645ccd-6e4b-4a56-d2bd-08d7830c5c70 x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:372; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4208; 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: GFpyxRl1haePDjD2mVDpiaW4SFulRfyqSreqStJDf1fvM1vmWv245Jumg9W1RPbaZl1Tj39yHplBSaTKreTV1y7Z+pH293suz+DcPcN0aB23kPXiXNtCj4FZKRb9iceimPKHAQIk74yOtdJB3FX2OdxzKFPpJdxoosQdMGAFeGaG02VMUx6MBFKhHLarSnsrkk7M3uHWpu9ZOpiHqUOz7SBJP2n8A51+R8Ad7bN2U5kKFO2sEOXxVGm4ySR3rzM/ubIMJiR1bLBBYLBWFzllw/Uc99ULp4KCkeA9wzCpfnTHKF32yv5s2ICzJ911TPj6gGn19bKV26rEQQvX2A52RJ0ir0Ka7FNxzalY59fgO0yTxQ7Mx3NFzMF0SSb/dudxTOoi2J5vZbQWI7XLEYJfVlR2kd+L5o18qRtenZEkB+hA6bb1tFb3MIdYrjo+A9rf Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46645ccd-6e4b-4a56-d2bd-08d7830c5c70 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:41.1977 (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: 4qjIVPmUO53j+G9bYjYswiOTW5W6xtqUPu5fyEWQQpD91gygNiTR0JQK5A9OCUlpxyqvlFGdQqGOjXbzX0uIfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The device provides an API to abort a scan request. Expose this feature to mac80211. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 1 + drivers/staging/wfx/scan.c | 13 +++++++++++++ drivers/staging/wfx/scan.h | 1 + drivers/staging/wfx/wfx.h | 1 + 4 files changed, 16 insertions(+) diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index cf4bcb14a12d..45c9939b7e62 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -135,6 +135,7 @@ static const struct ieee80211_ops wfx_ops = { .tx = wfx_tx, .conf_tx = wfx_conf_tx, .hw_scan = wfx_hw_scan, + .cancel_hw_scan = wfx_cancel_hw_scan, .sta_add = wfx_sta_add, .sta_remove = wfx_sta_remove, .sta_notify = wfx_sta_notify, diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index dde2f8868147..24061d09c404 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -54,6 +54,7 @@ static int send_scan_req(struct wfx_vif *wvif, break; } wfx_tx_lock_flush(wvif->wdev); + wvif->scan_abort = false; reinit_completion(&wvif->scan_complete); ret = hif_scan(wvif, req, start_idx, i - start_idx); if (ret < 0) @@ -68,6 +69,10 @@ static int send_scan_req(struct wfx_vif *wvif, hif_stop_scan(wvif); return -ETIMEDOUT; } + if (wvif->scan_abort) { + dev_notice(wvif->wdev->dev, "scan abort\n"); + return -ECONNABORTED; + } return i - start_idx; } @@ -115,6 +120,14 @@ int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, return 0; } +void wfx_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif) +{ + struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv; + + wvif->scan_abort = true; + hif_stop_scan(wvif); +} + void wfx_scan_complete(struct wfx_vif *wvif, const struct hif_ind_scan_cmpl *arg) { diff --git a/drivers/staging/wfx/scan.h b/drivers/staging/wfx/scan.h index b547f1927d72..bba9f15a9ff5 100644 --- a/drivers/staging/wfx/scan.h +++ b/drivers/staging/wfx/scan.h @@ -18,6 +18,7 @@ struct wfx_vif; void wfx_hw_scan_work(struct work_struct *work); int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_scan_request *req); +void wfx_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif); void wfx_scan_complete(struct wfx_vif *wvif, const struct hif_ind_scan_cmpl *ind); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index db433bee87af..0a3df382af03 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -127,6 +127,7 @@ struct wfx_vif { struct mutex scan_lock; struct work_struct scan_work; struct completion scan_complete; + bool scan_abort; struct ieee80211_scan_request *scan_req; struct completion set_pm_mode_complete; From patchwork Tue Dec 17 16:15:42 2019 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: 1211504 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="WSx9dI7y"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47cjvM6rjrz9sRc for ; Wed, 18 Dec 2019 03:16:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729288AbfLQQQq (ORCPT ); Tue, 17 Dec 2019 11:16:46 -0500 Received: from mail-eopbgr680042.outbound.protection.outlook.com ([40.107.68.42]:26848 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729156AbfLQQQJ (ORCPT ); Tue, 17 Dec 2019 11:16:09 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PUJ1+GyR4vJ4S5c+7XVOKWz5AEACpK5VXnXpkQ7w+NqEu1BWvUuQLNrpooQv54Cro4uMhbSHNkZpSRweyjkxFXfp/mMbNqiGe5gHBdC2x+qJ6JSVU54sYNC8T9zRIIEarKFe5YsjcfedvRU7gI3catoSALPZPA5Q3KGi25xd2jfhJktamENfp2WxIS3iOVwuO7iT3MeN/QWPGaeuP1KfswaOUBLRrbjHkgEKt7eNzuzPTz68t9G75aOca5J96GdLmNCUGoatAhL25xIhaTqKHKjHcqYoEYmvhMK7jjVzXyjQywlJJR9DV4Io61NzUOoPwvUTDunuqjHmmbSQMqy24A== 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=Lrvld7QLg+34BaehMcizNTeqjcM2jdt+MzrGluOpN+U=; b=aaUuYsHVHOZWX2VR+PrWHsUjj0RqC17wp1EBKQzEyfb7ywN08WC44jW3glGzNS/RKciWIT5pUcSGMijeJZVjrbLb6VFkm0Gu1cFcvfVpLphAdvpfK0AW1OiyfIUA2au2z69pgY5oK9w2HOwPzbNVSMiDX4sjCr0DTALd6S0uAJ88JQf+TYYGQXnGXjDcdvNO5rF3v/VDae2SUgypwPmT2bMzuJRrzAcPP7PETjFFJrNYatmqmZpwJVS6FXlQSA62UzGWrfHI9eu/Hcv0e1240LJ6QMOOC4XCiikc6BKdrfxuT7dYA8vNwBRaoKzR+08CFYPQ72/nzPzLncHi4764ew== 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=Lrvld7QLg+34BaehMcizNTeqjcM2jdt+MzrGluOpN+U=; b=WSx9dI7yw84xtUHr/o5t34R1DDnQLavKk3hobBKr+2DrhQRwZ6H7f+IjCrijdpmqX5U9MJsAV0lsd1iPiOES3plqiwVi/sOp7dSquzUK4mT//yGK3SGBeswujqM+YGSdGSdXHPyrpk9XAiHsA2nItvs8C5Ox7hLyrpH4lfzGrMY= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3791.namprd11.prod.outlook.com (20.178.254.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Tue, 17 Dec 2019 16:16:06 +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.2538.019; Tue, 17 Dec 2019 16:16:06 +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 55/55] staging: wfx: update TODO Thread-Topic: [PATCH v2 55/55] staging: wfx: update TODO Thread-Index: AQHVtPU6C/GkqvVkY0OgUfqfRu8C9A== Date: Tue, 17 Dec 2019 16:15:42 +0000 Message-ID: <20191217161318.31402-56-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) 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.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a35cfc4f-93d0-454e-028c-08d7830c5d36 x-ms-traffictypediagnostic: MN2PR11MB3791: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(189003)(199004)(2906002)(52116002)(107886003)(2616005)(86362001)(478600001)(6486002)(15650500001)(4326008)(64756008)(66556008)(66476007)(81156014)(966005)(66946007)(6506007)(1076003)(316002)(66446008)(8936002)(71200400001)(81166006)(5660300002)(36756003)(26005)(186003)(8676002)(85202003)(6666004)(66574012)(85182001)(110136005)(54906003)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3791; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: D0d0TNcCV9I6VzbCVelZGhwjwy7eHP2uCXgmE09912exIvcLfSBjr+oChgIyxBj4OiVhhg95m8dxZhpkHZiVMk+KeokTTFSj8XmQ/b2Ww8kuWG1WRjHS9gt6A9QMurjgUVVTuiSq40UfQbhrJpLWBnoADXXo2G7QbLU6S7MKXgDqHFj+iUlIf4uo2orCY5BenYgwJJMhiQZbStlUlB6Xv2KT9Wk232Yxo6h4mnYdFd+ZaF0AJRFYtlaYsA61CWC4Ffm0OC2xxt4TutsgbsUF44a8sTtlSqi55MWk85gJgbI/bQpCRhuext67KRIdwl7LnUe4ObAEF+2VfLpnvzcdCxHhE26ABpQ1ieAG8VkAsQ11GKsmUHbvIgYmu8rqD3oc/dJcIkQgPNCTjL0IIh3Jn9cgRNxrHRX5oi7TIPTx1YLYTE2OGNXcVIXnMyxKEIEWYtMMvTIB3hbK0A8XR1vpo8PxK6SW2nKmB0scR8P7Ck0= Content-ID: <59C5E5F22469AC4DB54424F3CB45A775@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a35cfc4f-93d0-454e-028c-08d7830c5d36 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:42.4340 (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: PCGzH/MkwkBvlFG1OBMlxUMz3Hk5XlxT95YXGwUqxnvXENO/McgQuUne1+ogFzp8pu2wj7nLrm0lup71GcZtlQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3791 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Update the TODO list of wfx driver with a more precise list of items. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/TODO | 81 +++++++++++++++++++++++++++++++++------- 1 file changed, 67 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wfx/TODO b/drivers/staging/wfx/TODO index e44772289af8..6b1cdd24afc9 100644 --- a/drivers/staging/wfx/TODO +++ b/drivers/staging/wfx/TODO @@ -1,17 +1,70 @@ This is a list of things that need to be done to get this driver out of the staging directory. - - I have to take a decision about secure link support. I can: - - drop completely - - keep it in an external patch (my preferred option) - - replace call to mbedtls with kernel crypto API (necessitate a - bunch of work) - - pull mbedtls in kernel (non-realistic) - - - mac80211 interface does not (yet) have expected quality to be placed - outside of staging: - - Some processings are redundant with mac80211 ones - - Many members from wfx_dev/wfx_vif can be retrieved from mac80211 - structures - - Some functions are too complex - - ... + - Allocation of "link ids" is too complex. Allocation/release of link ids from + sta_add()/sta_remove() should be sufficient. + + - The path for packets with IEEE80211_TX_CTL_SEND_AFTER_DTIM flags should be + cleaned up. Currently, the process involve multiple work structs and a + timer. It could be simplifed. In add, the requeue mechanism triggers more + frequently than it should. + + - All structures defined in hif_api_*.h are intended to sent/received to/from + hardware. All their members whould be declared __le32 or __le16. These + structs should only been used in files named hif_* (and maybe in data_*.c). + The upper layers (sta.c, scan.c etc...) should manage mac80211 structures. + See: + https://lore.kernel.org/lkml/20191111202852.GX26530@ZenIV.linux.org.uk + + - Once previous item done, it will be possible to audit the driver with + `sparse'. It will probably find tons of problems with big endian + architectures. + + - hif_api_*.h whave been imported from firmware code. Some of the structures + are never used in driver. + + - Driver try to maintains power save status of the stations. However, this + work is already done by mac80211. sta_asleep_mask and pspoll_mask should be + dropped. + + - wfx_tx_queues_get() should be reworked. It currently try compute itself the + QoS policy. However, firmware already do the job. Firmware would prefer to + have a few packets in each queue and be able to choose itself which queue to + use. + + - As suggested by Felix, rate control could be improved following this idea: + https://lore.kernel.org/lkml/3099559.gv3Q75KnN1@pc-42/ + + - When driver is about to loose BSS, it forge its own Null Func request (see + wfx_cqm_bssloss_sm()). It should use mechanism provided by mac80211. + + - AP is actually is setup after a call to wfx_bss_info_changed(). Yet, + ieee80211_ops provide callback start_ap(). + + - The current process for joining a network is incredibly complex. Should be + reworked. + + - Monitoring mode is not implemented despite being mandatory by mac80211. + + - "compatible" value are not correct. They should be "vendor,chip". See: + https://lore.kernel.org/driverdev-devel/5226570.CMH5hVlZcI@pc-42 + + - The "state" field from wfx_vif should be replaced by "vif->type". + + - It seems that wfx_upload_keys() is useless. + + - "event_queue" from wfx_vif seems overkill. These event are rare and they + probably could be handled in a simpler fashion. + + - Feature called "secure link" should be either developed (using kernel + crypto API) or dropped. + + - In wfx_cmd_send(), "async" allow to send command without waiting the reply. + It may help in some situation, but it is not yet used. In add, it may cause + some trouble: + https://lore.kernel.org/driverdev-devel/alpine.DEB.2.21.1910041317381.2992@hadrien/ + So, fix it (by replacing the mutex with a semaphore) or drop it. + + - Chip support P2P, but driver does not implement it. + + - Chip support kind of Mesh, but driver does not implement it.