From patchwork Wed Jan 15 12:12:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216647 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C08E2C33CB1 for ; Wed, 15 Jan 2020 12:20:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88504222C3 for ; Wed, 15 Jan 2020 12:20:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="SH07mGd1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730287AbgAOMMU (ORCPT ); Wed, 15 Jan 2020 07:12:20 -0500 Received: from mail-co1nam11on2084.outbound.protection.outlook.com ([40.107.220.84]:24056 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730191AbgAOMMU (ORCPT ); Wed, 15 Jan 2020 07:12:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ETqoM2s6c0MVVUUsz+HPVX9fcViEXpXSnItJof9FD0PTuBMEoI+fl9Asd/UFDRpQ1Z7T/uh+qboRdi1mq+DvnV+8QRcexrCYtoplgjsbYx1PdbbcFqu5z0iod9v88uptQb5WhmyB/H+kvlSISGhS4r7DmL+jo38oaXU/WvRj0kf6RsN4wh93jS04zjwqY9uZJAHiS9wOMg60W/02Z2Wb5hmlK9YW+TF/VBFivThTmnROLK8+6y8Hi2ihwIjwYq/Z0UVCdFGMX+9P7XjxlMEnY92hKoaYRTWFGKbCGcSwFSeZzkfI0OrMuhWZ0dsNgqU4RCIpqJCNcERDhZz4CKp29g== 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=WJKgaa7pmmCRqtSbENrnVw4XdApYgK6og7UgQlebpmM=; b=bHvR5VKlHyhKXbNDkzzLgymElcdY4OJjvrLsKDuQm+bIi02S6FdxeJh77Zr1snNEvort3++pxVPentDqWQpLf5dRS6/bVczjsG+qVCjl6I/gD6BD3erj03+27g5Ofe/UI1Qf71RKFQpEHz1DeKEvHUpEf+4RUJroY111pnYcc+VzsV3Y0s6bjtX4Pdhm23PJ9lkmA59R+hgx09KS+wwV8lilj6Ot35kEu2bz+izC5ASTb58MDrIW8NVkVm+b++KsfK8cO3K/aDA29iSFV9SiWadRgX8OfuDJiGpMfRs3yKgc4ysW3ZSV2LU6YfnwLbG+sE2BfpFjXsoWzvPiOCPzEA== 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=WJKgaa7pmmCRqtSbENrnVw4XdApYgK6og7UgQlebpmM=; b=SH07mGd1q2IVwui1+8PucbC9mju2s5OkzOB+daVoaSMvbwnyCMv8y4hbOf7vdFs7Zy+oL+fzIB82tkpmFuqCM8jCsmXJjC5aOUU0W8RrCyPG3G8DKAc7G/h46Okv5mPhfgb0lQUqEphdkjiTagg6aqW47FF397NeoSr+n6Q/x/g= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:12:10 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:12:09 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12: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?= , Pascal Prime , Jules Irenge Subject: [PATCH 01/65] staging: wfx: revert unexpected change in debugfs output Thread-Topic: [PATCH 01/65] staging: wfx: revert unexpected change in debugfs output Thread-Index: AQHVy50CgXXZf+D1OU60c4tUE9Izlw== Date: Wed, 15 Jan 2020 12:12:09 +0000 Message-ID: <20200115121041.10863-2-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e3cdbf29-fc88-4812-4960-08d799b42534 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:220; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kFCS2mMuil2Ju5OoK+WzY+/gRjQjSKqy1xc0p12AFqYM4uv0g+TKh2x+XvfNLSJb0Qiq+MeGzcQDZJit1A9bTZbfIz2egMTQNW5iMY6j83VuADfnCEy8yWqliY8toH1dqO3N+a+r7tHRkKwjVCRYjt4VPAFhBEoYYljQkTHiZhJdYr3GVAVXYZ2zOLehSrhXbQc/v0UGWHe1/yGd8LwcrK8Dvz2f89XKc1pRxuDJiL0tDJhWdM2WyhCO/BfOYadY2l0vrtoT1sYjqLEF/RE/3f8sThs3l+0r/Lu1HQXBE1PqxjOUDFTYWrcnCCWn263JT1UeP/t5uPVn6ckhBhrv1wJzdyZl6IrAOeTsEwynCLJnghhrENFkH7YTR4vU1jSIsVVxHAor2CazYt1dAmLjwjRq8wdlSVIddmQl+7r+XiQpF+CB4bzLLizmEVCv7aqc Content-ID: <0BA67E860FF98E48B3A2DC1D62D69292@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3cdbf29-fc88-4812-4960-08d799b42534 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:09.6429 (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: NMVx9Nh0uy6i403LGCNareI46n4IHfntyzv22zNJvmZ2Z8Ct9pNYtnnCYczRyR9c4IVX46SOxH+ZLAwOWBdWeQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller It appears that commit 8c7128c4cf4e ("staging: align to fix warnings of line over 80 characters") do slightly more than what is explained in commit log. Especially, it changes the output of the file rx_stats from debugfs. >From some point of view, this file can be considered as a part of the API. Any change on it should be clearly announced. Since the change introduced does not seems to have any justification, revert it. Reported-by: Pascal Prime Cc: Jules Irenge Fixes: 8c7128c4cf4e ("staging: align to fix warnings of line over 80 characters") Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c index d17a75242365..1164aba118a1 100644 --- a/drivers/staging/wfx/debug.c +++ b/drivers/staging/wfx/debug.c @@ -145,7 +145,7 @@ static int wfx_rx_stats_show(struct seq_file *seq, void *v) st->pwr_clk_freq, st->is_ext_pwr_clk ? "yes" : "no"); seq_printf(seq, - "N. of frames: %d, PER (x10e4): %d, Throughput: %dKbps/s\n", + "Num. of frames: %d, PER (x10e4): %d, Throughput: %dKbps/s\n", st->nb_rx_frame, st->per_total, st->throughput); seq_puts(seq, " Num. of PER RSSI SNR CFO\n"); seq_puts(seq, " frames (x10e4) (dBm) (dB) (kHz)\n"); From patchwork Wed Jan 15 12:12:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216650 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7056BC33CB1 for ; Wed, 15 Jan 2020 12:19:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33335222C3 for ; Wed, 15 Jan 2020 12:19:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="SE8z5CRR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732257AbgAOMTm (ORCPT ); Wed, 15 Jan 2020 07:19:42 -0500 Received: from mail-co1nam11on2084.outbound.protection.outlook.com ([40.107.220.84]:24056 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730408AbgAOMM3 (ORCPT ); Wed, 15 Jan 2020 07:12:29 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hYnnIqhHJHnksMtdod8FEFFEX8TMstlZXSvwaS+76MgfFcjj5Xjg+VzHvsFsSPm+gKOin1JgudhzFGn7NLncE4gZH0nA3U2nhwvEtPbJiFdiFJlrwTRROxCqw8dYuHK8EWQtX3em9lipheZpusGfxvCI6BJ5NHT6k+hZt4d5WF3NrId6Df/UZPIuhzrpR4ssm73kDvre/j8zZ9YSid0CcOSnSbr42E5AKU3hdomOqeOu1k35d1QnCIx6VrOfVk57KKaQFvZydC+M1ecgw8unaZ5h/F5/tvUOjtQoBQpORvSjJOqVJfTCfBQVvQlYw1hNGJ1GYjmz7lZQueLqI1Ffww== 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=VwI3KjAJe6wvPLS63CfYdnAwDrZRt0I+K5mruf2SzxI=; b=l3Y0pPJEFd1Pb+gpab4kIMyuEAuBCKxrHhbUwHC1lTYD6t8SW+C35bDT0e9WHUM2+m9XBsivuiDVphJZx0BbVsAJfHDdPnBQmoijcaXKnz9xgr3H5Pwi1Nus9j3/WcAK3hh0u85PiBF65i94WFD7tfUpuQ3vmO0alvvNNYR+auACH+Q20kFLTxPsAEwNOzMFMeOcEQ5UGVRYdstYZpzzm1Su6leOrF36pTmDDEeilehf6FElbZicAJK+SrEP1WDieQ/mbbaxmgTWGGg+RLJX5GU9dZz9jcjlYMposwBitxqCXjQYHaQjnuPle9fW/FojzX4aWC1wBXU0SQxObwmvLg== 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=VwI3KjAJe6wvPLS63CfYdnAwDrZRt0I+K5mruf2SzxI=; b=SE8z5CRREtQi5DMxVpW4+SFe0jFrijO1Jp7/A7lvU/b1DPuDw8voN/n1UbUlWTt6VD8gP31I8XTY2CRX7WgwdPReUjbditmpOpM5F80MnK1MYWip7MkczLhlupn34dFn8Tr4d4CoWaqcBBEJwU3XuI9t2pMxq5okpuDNOYqE06U= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:12:15 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:12:15 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12:14 +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 05/65] staging: wfx: simplify hif_set_tx_rate_retry_policy() usage Thread-Topic: [PATCH 05/65] staging: wfx: simplify hif_set_tx_rate_retry_policy() usage Thread-Index: AQHVy50GWkyiLFnTvUOIaynlklVO2w== Date: Wed, 15 Jan 2020 12:12:15 +0000 Message-ID: <20200115121041.10863-6-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dc86e444-50af-4163-4d28-08d799b42891 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: m3/FFN0Mx4c7Vzjxl5UeXjqhIIfJ7KYNV4JmGM6PxwdWEJJNEphAmV2sl7k6zpbX96bjnRXpaQXw8Tb6LJl0fKZlgt2rmMVtLyX/roQz8hd54KzKp8Yh5ASfOb7GjfaDzAqt4JP7RKOm0KVyl8wdPWzLwy2XCyxYUq6J69OIVSQgitmftBmtVQmKvQpVDs+g5mynHSQOBlEDWIM6SZu2HRActiyNI4LErApHLM+rI9jpj4eU20Jo+Qj/1FAv/YlsQoflsyQPjWmpJtVn3tiexGKvIKz/DGOTseRwIGYHcOT5FwNwb2xJJKXzQmrTPIIRDymPRo/9xRAfy7r7PeAQNQ+QHE7yobOoCmo/Kxt9FRlEsZogog3t7Kkulk9HnlntVtZIfbGuBtm1lgU8A7chqTtPH5NJpVzZR46UdETap7MSOAKwzSLIS5r2ue3Ki0x4 Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc86e444-50af-4163-4d28-08d799b42891 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:15.2027 (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: jLKuwobqKv0R/HbenwU3E41e3Ps6FHwyVQvdppvP9avellDnf6pZkWxr3DLHja0iazvtO0ELCcTqQ2VBhyYFZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The structure hif_mib_set_tx_rate_retry_policy come from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch relocate handling of this structure to hif_set_tx_rate_retry_policy() (the low level function). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 16 +++------------- drivers/staging/wfx/hif_tx_mib.h | 23 ++++++++++++++++++----- drivers/staging/wfx/sta.c | 2 +- drivers/staging/wfx/sta.h | 1 + 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index fb51c5910ace..60459299a3a9 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -217,9 +217,8 @@ static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx) static int wfx_tx_policy_upload(struct wfx_vif *wvif) { - struct hif_mib_set_tx_rate_retry_policy *arg = - kzalloc(struct_size(arg, tx_rate_retry_policy, 1), GFP_KERNEL); struct tx_policy *policies = wvif->tx_policy_cache.cache; + u8 tmp_rates[12]; int i; do { @@ -230,22 +229,13 @@ static int wfx_tx_policy_upload(struct wfx_vif *wvif) break; if (i < HIF_MIB_NUM_TX_RATE_RETRY_POLICIES) { policies[i].uploaded = 1; - arg->num_tx_rate_policies = 1; - arg->tx_rate_retry_policy[0].policy_index = i; - arg->tx_rate_retry_policy[0].short_retry_count = 255; - arg->tx_rate_retry_policy[0].long_retry_count = 255; - arg->tx_rate_retry_policy[0].first_rate_sel = 1; - arg->tx_rate_retry_policy[0].terminate = 1; - arg->tx_rate_retry_policy[0].count_init = 1; - memcpy(&arg->tx_rate_retry_policy[0].rates, - policies[i].rates, sizeof(policies[i].rates)); + memcpy(tmp_rates, policies[i].rates, sizeof(tmp_rates)); spin_unlock_bh(&wvif->tx_policy_cache.lock); - hif_set_tx_rate_retry_policy(wvif, arg); + hif_set_tx_rate_retry_policy(wvif, i, tmp_rates); } else { spin_unlock_bh(&wvif->tx_policy_cache.lock); } } while (i < HIF_MIB_NUM_TX_RATE_RETRY_POLICIES); - kfree(arg); return 0; } diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index b1eeda2a3ab3..ef033a409381 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -181,13 +181,26 @@ static inline int hif_set_association_mode(struct wfx_vif *wvif, } static inline int hif_set_tx_rate_retry_policy(struct wfx_vif *wvif, - struct hif_mib_set_tx_rate_retry_policy *arg) + int policy_index, uint8_t *rates) { - size_t size = struct_size(arg, tx_rate_retry_policy, - arg->num_tx_rate_policies); + struct hif_mib_set_tx_rate_retry_policy *arg; + size_t size = struct_size(arg, tx_rate_retry_policy, 1); + int ret; - return hif_write_mib(wvif->wdev, wvif->id, - HIF_MIB_ID_SET_TX_RATE_RETRY_POLICY, arg, size); + arg = kzalloc(size, GFP_KERNEL); + arg->num_tx_rate_policies = 1; + arg->tx_rate_retry_policy[0].policy_index = policy_index; + arg->tx_rate_retry_policy[0].short_retry_count = 255; + arg->tx_rate_retry_policy[0].long_retry_count = 255; + arg->tx_rate_retry_policy[0].first_rate_sel = 1; + arg->tx_rate_retry_policy[0].terminate = 1; + arg->tx_rate_retry_policy[0].count_init = 1; + memcpy(&arg->tx_rate_retry_policy[0].rates, rates, + sizeof(arg->tx_rate_retry_policy[0].rates)); + ret = hif_write_mib(wvif->wdev, wvif->id, + HIF_MIB_ID_SET_TX_RATE_RETRY_POLICY, arg, size); + kfree(arg); + return ret; } static inline int hif_set_mac_addr_condition(struct wfx_vif *wvif, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 9011b5d78706..8f53a78d7215 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -19,7 +19,7 @@ #define HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES 2 -static u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates) +u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates) { int i; u32 ret = 0; diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index 9595e1fc60db..b5d8d6494157 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -92,5 +92,6 @@ void wfx_suspend_resume(struct wfx_vif *wvif, 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_fwd_probe_req(struct wfx_vif *wvif, bool enable); +u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates); #endif /* WFX_STA_H */ From patchwork Wed Jan 15 12:12:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EDEFC33CB1 for ; Wed, 15 Jan 2020 12:12:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2541222C3 for ; Wed, 15 Jan 2020 12:12:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="HPnl98zI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730612AbgAOMMg (ORCPT ); Wed, 15 Jan 2020 07:12:36 -0500 Received: from mail-co1nam11on2084.outbound.protection.outlook.com ([40.107.220.84]:24056 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730218AbgAOMMf (ORCPT ); Wed, 15 Jan 2020 07:12:35 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TDb7t2/chHtMSNwo7HMctUnWKXCbIqyS4hBR+EjI7lVBznUmtbPFKkvPEcVqwBcpkIXwKYAfdX2TqSKJQc8RRqM1iAoZWyEcy8naVPXzmhFAt6UKlVF1H2D3OnecD0/auUMkmw5ySwh5d6pcgcvJzHTlXbZUsvMYIeQbdGb+LaN1TuKvhL39Oe1ekpb0PKPCtDpSkgtN8j0UkEtN8huGMe+ihmqdXRnzuVXBYB59lBO0DG2FftO9VM+qAN3PZUXNsqQ0bXLq61lJFv0RgPuWcRrwR/SthVAZSZq0QJ3aVToNI11HKc7YzihNvsirPiLAdgDGBN32v+AfAAXiuMkpJA== 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=1xbX4O+7DVFKMuBoAyyVIDQfYyePPJ696cihc2JM5rQ=; b=H4OgCiYbIV8ssY0mbwgvRNlUWXooz+btXC9TPSn7AYg8omiNpLBWtnFeTjgg7dhGrnx8812OV7lDbnaZ4nhqSFUQQxRPquB93JzFH1AbRO3VONaqLtXocvBcSYMhAvrY26yfRqyLALmHjj9U7gLTYS2kAvJHbQzgF+K8S2vXEMkYhrNsiF8fRrdBeK5VCZpqX2OlZdcXua3cbL1xh/dJYYlAnnhZScANU0HyS9TbxcNR34YdN8lGDg9hJf6q9lxv4XamBBBSMreBbgLjXUEO1cBqpSGvSTmr9017FqxOKXi3kacUqbOaOeTLdf04nmAiTB07pcy71EVLhv1+X9zQjg== 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=1xbX4O+7DVFKMuBoAyyVIDQfYyePPJ696cihc2JM5rQ=; b=HPnl98zI9D3+4ajNmxlUQ5qPpW/CZbNBkuLyHT6rf8vsd7sMVMrVhdwTq7NijAhZldM2Y71Japn9Fc8atLbiVKtpjV9H7vm1mzhMJZV7ml7kFgFIkMizdRwFOlw6cd7+/ecKy2T/ZM3yll5gTPMrTVjrwVvrXXRsZYA9OjGU7x0= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:12:19 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:12:19 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12:18 +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 08/65] staging: wfx: simplify hif_set_arp_ipv4_filter() usage Thread-Topic: [PATCH 08/65] staging: wfx: simplify hif_set_arp_ipv4_filter() usage Thread-Index: AQHVy50Im5dbQg2Lpke2wSUOQkIzGw== Date: Wed, 15 Jan 2020 12:12:19 +0000 Message-ID: <20200115121041.10863-9-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 76e85dbf-9094-4dc8-e8a9-08d799b42afc x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2887; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IAo2YqZ3fTzQUGOIq/OTHNXGlZCfy2ZlmN/OeSJCfK5bdCN1VAn6OV/pUu6ki/segQ+ID6xo9aB+33y6CX8Dgjw5xHn2qypGt5FWUG3oCAiwPFdzRLHsnKihl1dZmg2plUy+KxKn+hOcRrk1kh+5p/HBPP4kuKZ2QwYkh9KiFK/1MNhFN8dtD15atd3gQQU0VEYOSY3R41PKdnvP6XhJWI/cJW6D1/CWMHjVhP9JKY70HRrEDpuDA5tSKtO+s6Ms3hesxByNL27U2Es7Lc9Ag9c3HOHCHSPupy08HkYROpS4kZFLktHRoQTo5yUHOM4/7kDTcqEZeStq9asqKpHnETbw3xqDkDcLs2oGi1Tg1SksYAMDtm0+B4TNeaXi7Hn2zdur1C2WBC3m9QtZbQq4iWHMuH89M9SFdTUZ81+ok1YwEptK8xBHoB6lvkb+eUGM Content-ID: <521C4DC7DEED7941AC74B1AA443CFAEA@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76e85dbf-9094-4dc8-e8a9-08d799b42afc X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:19.2384 (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: hIyWPtxxfEeTQLJ05lV7wfL/4wmHhwTUK2hf81vt3Q4QFqmOrwjRPGmHRNPqflbFVfMTvyZ5T+OpIgCqPnK+Xg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The structure hif_mib_arp_ip_addr_table come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_arp_ipv4_filter() is too dumb. It should pack data using the hardware representation instead of leaving all work to the caller. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 16 +++++++++++++--- drivers/staging/wfx/sta.c | 25 +++++++------------------ 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index a8082508fbfd..a325c870b4ea 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -260,12 +260,22 @@ static inline int hif_keep_alive_period(struct wfx_vif *wvif, int period) &arg, sizeof(arg)); }; -static inline int hif_set_arp_ipv4_filter(struct wfx_vif *wvif, - struct hif_mib_arp_ip_addr_table *fp) +static inline int hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, + __be32 *addr) { + struct hif_mib_arp_ip_addr_table arg = { + .condition_idx = idx, + .arp_enable = HIF_ARP_NS_FILTERING_DISABLE, + }; + + if (addr) { + // Caution: type of addr is __be32 + memcpy(arg.ipv4_address, addr, sizeof(arg.ipv4_address)); + arg.arp_enable = HIF_ARP_NS_FILTERING_ENABLE; + } return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_ARP_IP_ADDRESSES_TABLE, - fp, sizeof(*fp)); + &arg, sizeof(arg)); } static inline int hif_use_multi_tx_conf(struct wfx_dev *wdev, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 339acbce96fb..8c55089b1ea4 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -915,30 +915,19 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; bool do_join = false; int i; - int nb_arp_addr; mutex_lock(&wdev->conf_mutex); /* TODO: BSS_CHANGED_QOS */ if (changed & BSS_CHANGED_ARP_FILTER) { - struct hif_mib_arp_ip_addr_table filter = { }; - - nb_arp_addr = info->arp_addr_cnt; - if (nb_arp_addr <= 0 || nb_arp_addr > HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES) - nb_arp_addr = 0; - for (i = 0; i < HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES; i++) { - filter.condition_idx = i; - if (i < nb_arp_addr) { - // Caution: type of arp_addr_list[i] is __be32 - memcpy(filter.ipv4_address, - &info->arp_addr_list[i], - sizeof(filter.ipv4_address)); - filter.arp_enable = HIF_ARP_NS_FILTERING_ENABLE; - } else { - filter.arp_enable = HIF_ARP_NS_FILTERING_DISABLE; - } - hif_set_arp_ipv4_filter(wvif, &filter); + __be32 *arp_addr = &info->arp_addr_list[i]; + + if (info->arp_addr_cnt > HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES) + arp_addr = NULL; + if (i >= info->arp_addr_cnt) + arp_addr = NULL; + hif_set_arp_ipv4_filter(wvif, i, arp_addr); } } From patchwork Wed Jan 15 12:12:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216648 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 869CDC33CB1 for ; Wed, 15 Jan 2020 12:20:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45BEC222C3 for ; Wed, 15 Jan 2020 12:20:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="pRjVAmzy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730390AbgAOMM1 (ORCPT ); Wed, 15 Jan 2020 07:12:27 -0500 Received: from mail-bn7nam10on2050.outbound.protection.outlook.com ([40.107.92.50]:24527 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730191AbgAOMMX (ORCPT ); Wed, 15 Jan 2020 07:12:23 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FW7txK/+GpNqYiW2hnxnejNqUMOha/s1CGY2VEtJSzAr05W9jEOKb8Wlx1U1r5VtQR64XakDdc+h2yFqLosP3N9PvHcwW1cUmDl5hryCWzr7TEcvPiHmiHIHV40a5wqcZgJJMaXKVbQtvqF3YV2mqzP5wbf/KRuNXVsNcW4FCfHBIGpu8gCdYeDnrXQ9EbzOTYkdxYjveuSZP/jdNCVpCk691Z3vzMG90eETUMysKdu7VkMfoKiYAytad9koxyCP9zWumDnxYKo4N8tUMtBu/YqzA8Tp99Ci13I6la2awL3a/ORFISltyo6kadEeSEOVpeaW0EH072w7owpAhpihZA== 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=tz6rRPqYovKmS4+0y3NaPK/jPsF16HaTkAo8p/CyYzE=; b=ZJE90e8AXRxNQLrAn3igRoXE8LwQMGOMtAUCmSLRtqFEytzlGOe5+CARUAJrigQ8xF428e7c7jaVbxvDYq2aTPHRlbHjEDciDfgQW0TsezQZ5hmK/Tecxlf9p8r8tubNZn6K8fWUHuP87WVPe7UqgTrK17S5tX3ADVlO7k+Pv9Uca7kQmTi/3eCmFj/xvhuycIsjmHt9NBiWQ0Tmrf37pkOy6EK7//G0+qw6ru+iaAst5oRGdxcc0FttVkeWHpWC0uofLS8/VcSY/+U1ZOY1FD+gkEhZEGChsQGia3OxophICGUQ0W3koSDlqxmkvqPChjGwuhMzRuhP56Fr0g9rQA== 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=tz6rRPqYovKmS4+0y3NaPK/jPsF16HaTkAo8p/CyYzE=; b=pRjVAmzyQnBiwOPZgQFYfN6K873kbqhKL5E5GAPJHOgn07CkQ2fyZ/4phg3yoq68PGS4K1R40bLbpfEhSKr8J7S8wY28Fic8p8BvhqQbPlg1KgVl0/+k9WU0tTOhjXar8aPVIeaGzXzvv5WWTiPzWcHXttm5Fnuc90p/AneWG3o= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4096.namprd11.prod.outlook.com (20.179.150.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:12:20 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:12:20 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12:19 +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 09/65] staging: wfx: simplify hif_start() usage Thread-Topic: [PATCH 09/65] staging: wfx: simplify hif_start() usage Thread-Index: AQHVy50JgE81QsoikkK+Xtsk9e+c0w== Date: Wed, 15 Jan 2020 12:12:20 +0000 Message-ID: <20200115121041.10863-10-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e46af8c4-756d-4195-2804-08d799b42bcc x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(366004)(376002)(136003)(199004)(189003)(85202003)(66946007)(66446008)(66476007)(2906002)(107886003)(66556008)(1076003)(66574012)(64756008)(5660300002)(8936002)(6486002)(186003)(26005)(8676002)(316002)(81156014)(36756003)(52116002)(2616005)(7696005)(478600001)(16526019)(956004)(6666004)(54906003)(110136005)(86362001)(71200400001)(85182001)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4096; 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: cR1uc2CpUJTaOc0Hvs9gQP4UsoGVOr+7+bV+Qihum89BpI8DTwbD7AAWLCFcvmgZ0Zcwv/d9yFsfuNLYToHhMhS8zwrn/Tie5pQlDiJKt+i7kV0sRNzKApVee7djwFxuIDBfgZLBgrPjoCRRGML+tFFLyskNaLM+XrCGWYpppwWky8UddLgfUFet4vYSUHrtVKRj85hiZoY479uUyABkbyZneNMlC8gW1r/yzEh+wF7ndRzyC9maKJDPMp10jcbT92HxVj6pxOwXKPX2JF+83KYwEguWkEWK0njMe60OM9Iu3JxN/S3qB1fzDsi3be0DIogJY3gK3NaEqBZY+6B6L5NorHJn4XPEk3Bk1Pz8YAQ4y5A5HRdUTmSQqzSDgsLN/fLAzMcBeqOBGmlJUv8JhcmafrSpFbYojDs2hg4xNovtpw+DjFOq6Y5zhHalhbga Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e46af8c4-756d-4195-2804-08d799b42bcc X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:20.5896 (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: ElLLv8P1mBsGibfbIJ7QOJmgVF8K7qWQAm/AqkWZplXdAr6NTl+grmF2JasIWFjHfJgMv3A0NVO14jn5br/G7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4096 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The structure hif_req_start come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_start() is too dumb. It should pack data with hardware representation instead of leaving all work to the caller. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 17 ++++++++++----- drivers/staging/wfx/hif_tx.h | 5 ++++- drivers/staging/wfx/sta.c | 40 ++++++++++++------------------------ 3 files changed, 29 insertions(+), 33 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index d8e159670eae..be3138590a4f 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -409,16 +409,23 @@ int hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout) return ret; } -int hif_start(struct wfx_vif *wvif, const struct hif_req_start *arg) +int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, + const struct ieee80211_channel *channel) { int ret; struct hif_msg *hif; struct hif_req_start *body = wfx_alloc_hif(sizeof(*body), &hif); - memcpy(body, arg, sizeof(*body)); - cpu_to_le16s(&body->channel_number); - cpu_to_le32s(&body->beacon_interval); - cpu_to_le32s(&body->basic_rate_set); + body->dtim_period = conf->dtim_period, + body->short_preamble = conf->use_short_preamble, + body->channel_number = cpu_to_le16(channel->hw_value), + body->beacon_interval = cpu_to_le32(conf->beacon_int); + body->basic_rate_set = + cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates)); + if (!conf->hidden_ssid) { + body->ssid_length = conf->ssid_len; + memcpy(body->ssid, conf->ssid, conf->ssid_len); + } wfx_fill_header(hif, wvif->id, HIF_REQ_ID_START, 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 e8855ead3a18..fbaed991b112 100644 --- a/drivers/staging/wfx/hif_tx.h +++ b/drivers/staging/wfx/hif_tx.h @@ -12,6 +12,8 @@ #include "hif_api_cmd.h" +struct ieee80211_channel; +struct ieee80211_bss_conf; struct ieee80211_tx_queue_params; struct cfg80211_scan_request; struct wfx_dev; @@ -51,7 +53,8 @@ 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, u16 queue, const struct ieee80211_tx_queue_params *arg); -int hif_start(struct wfx_vif *wvif, const struct hif_req_start *arg); +int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, + const struct ieee80211_channel *channel); 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); int hif_update_ie(struct wfx_vif *wvif, const struct hif_ie_flags *target_frame, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 8c55089b1ea4..660a75024f4b 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -740,38 +740,24 @@ static void wfx_set_cts_work(struct work_struct *work) static int wfx_start_ap(struct wfx_vif *wvif) { int ret; - struct ieee80211_bss_conf *conf = &wvif->vif->bss_conf; - struct hif_req_start start = { - .channel_number = wvif->channel->hw_value, - .beacon_interval = conf->beacon_int, - .dtim_period = conf->dtim_period, - .short_preamble = conf->use_short_preamble, - .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev, - conf->basic_rates), - }; - memset(start.ssid, 0, sizeof(start.ssid)); - if (!conf->hidden_ssid) { - start.ssid_length = conf->ssid_len; - memcpy(start.ssid, conf->ssid, start.ssid_length); - } - - wvif->beacon_int = conf->beacon_int; - wvif->dtim_period = conf->dtim_period; + wvif->beacon_int = wvif->vif->bss_conf.beacon_int; + wvif->dtim_period = wvif->vif->bss_conf.dtim_period; memset(&wvif->link_id_db, 0, sizeof(wvif->link_id_db)); wvif->wdev->tx_burst_idx = -1; - ret = hif_start(wvif, &start); - if (!ret) - ret = wfx_upload_keys(wvif); - if (!ret) { - if (wvif_count(wvif->wdev) <= 1) - hif_set_block_ack_policy(wvif, 0xFF, 0xFF); - wvif->state = WFX_STATE_AP; - wfx_update_filtering(wvif); - } - return ret; + ret = hif_start(wvif, &wvif->vif->bss_conf, wvif->channel); + if (ret) + return ret; + ret = wfx_upload_keys(wvif); + if (ret) + return ret; + if (wvif_count(wvif->wdev) <= 1) + hif_set_block_ack_policy(wvif, 0xFF, 0xFF); + wvif->state = WFX_STATE_AP; + wfx_update_filtering(wvif); + return 0; } static int wfx_update_beaconing(struct wfx_vif *wvif) From patchwork Wed Jan 15 12:12:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216649 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF477C33CB1 for ; Wed, 15 Jan 2020 12:20:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 71B25222C3 for ; Wed, 15 Jan 2020 12:20:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="hvpE6VqJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730237AbgAOMTy (ORCPT ); Wed, 15 Jan 2020 07:19:54 -0500 Received: from mail-bn7nam10on2050.outbound.protection.outlook.com ([40.107.92.50]:24527 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730223AbgAOMM1 (ORCPT ); Wed, 15 Jan 2020 07:12:27 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gJZbRQolcu1G/oxoklS7YlprRezAnmwhUujEH4xorsoXqAEGydeXElUveSdSTKMwTAofcahtB1hRoOnqWm+q/CC2fouwRop/unnPl0OGl6S8WDLUf45rnGHix/InJPwObTEwvnYpmwOxUCxP7HB2irxX4AdW32HlrwjQ+tDs4uuAxOIBqjSWd83QgD9/St1VdxUheA0Bjm5jTYcYrn4p4tkOyRBNbZ4kmg2oDdCh5nSk4CG5mpOrJnPlQSThoLgZDMPw1wXMkwRj3m0/nCVLlq+nClay7pUggVneQMF52aQqZxYVzDEi3HGIFAs5KxsZXVpp/zcGzG36zHmD1tBX7w== 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=NyI3qpeaw1sCvgNMoy3SoJLojFxutx56dQKR09Nvy+U=; b=e50kVGnCEFrDYPAckq6xODQhI/nn2/lLIJR6jt6nbJsCr2yMQPDyOQ1hHwRXYb51w10AUjtZbiWyrAe53rONjnt+Rm6jeaYbAoiHKc/cDxOgmJUsmhKT6ftRVkZjKICniOdgiu+nT2eIC+YsdWx8lPszJ3uFtI0uAh7CPnNZiw/pm5dCbvXFR2m/zi7W/EwsD546tnTJ88ekZ4sz78I5iickwY/piVHA4WWF12xuvxu+omMtITMlZtT17BcvmKTzslu+LwG9fRCJJO/UTem1aYAZSrSht1Cyy7eKIkkuhuFMdgSj5uAAzMr2z4ZHqS35wgdckqkCsdOiIZZzwqf8+A== 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=NyI3qpeaw1sCvgNMoy3SoJLojFxutx56dQKR09Nvy+U=; b=hvpE6VqJYBoqvN4QCAVMYnOFA8QtAcPDf5shP9wuAzorulrw1WQ4Ctc6XZe4yXESlEjb+sotTeA5+jiFvSIbloNfenfUA0V/J2rnAhqmbbbATkqRGXChkFukNg04vbFyyBdWrQ2+BoDboPjqFGOggybbAxhSrxXeEdWaLPufzNE= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4096.namprd11.prod.outlook.com (20.179.150.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:12:22 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:12:22 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12:20 +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 10/65] staging: wfx: use specialized structs for HIF arguments Thread-Topic: [PATCH 10/65] staging: wfx: use specialized structs for HIF arguments Thread-Index: AQHVy50KLWYv+/f8d0mulv7JbySJsA== Date: Wed, 15 Jan 2020 12:12:21 +0000 Message-ID: <20200115121041.10863-11-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c0716d3a-0150-4afb-4942-08d799b42c97 x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(366004)(376002)(136003)(199004)(189003)(85202003)(66946007)(66446008)(66476007)(2906002)(107886003)(66556008)(1076003)(64756008)(5660300002)(8936002)(6486002)(186003)(26005)(8676002)(316002)(81156014)(36756003)(52116002)(2616005)(7696005)(478600001)(16526019)(956004)(54906003)(110136005)(86362001)(71200400001)(85182001)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4096; 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: /e/KnE7tQYi0c/TulMO0txoiV85ovPTTsGasNSSpBa7Y3BsCXW3Ongga3qAiaUy5t2WCzpjBr/qktzxkvA2Rh/pN/5kfxw/Fi13MJVDCe34jziITBcrikASnOasTX2MdOTU5XjZRy5Y7/HJ+y0QYvfY6ynJxUjYBQcCK9izMMKB8HaNcepN29wAp8BjsfJkSM94VDS6NhUeQFE2DlMrS7EEjMSUDJleFSj6QCe1s207sR74DiNALgZFqmUSbyJpjPx0W8Q3vBR0Y43iB/oR5sWSeiv+mVaz9bpdEfeOpzCyrmY6rQf3uc2o3+WGh+Cg5uw6M0i6+2VZV0BaRLpbgHiounN7ZUyiDAg/FZe6+2KpveMbEVCjznoHqCgp3lsMP3Mf5f66NOsvDvQ7Eni4+4ns2qVYjLiXXoyQNMtcdmE/osYDmQq1fBD8zKsmRhCk7 Content-ID: <153D7851AA9F7A40BC023E6052A3DC3E@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0716d3a-0150-4afb-4942-08d799b42c97 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:21.9508 (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: ILG0zpONQ+tkYp4QMD1YiYwBnlgob4Bi5oiQPVzrWD81xWoRkpkaqWg9cjuDKvsEuzOPFPoDBvuPsRqQTRjEoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4096 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Most of the commands that are sent to device should take struct in argument. In the current code, when this struct is binary compatible with a __le32, the driver use a __le32. This behavior is error prone. This patch fixes that and uses the specialized structs instead. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 4 ++-- drivers/staging/wfx/hif_tx_mib.h | 27 ++++++++++++++++++--------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index be3138590a4f..2d541601e224 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -432,14 +432,14 @@ int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, return ret; } -int hif_beacon_transmit(struct wfx_vif *wvif, bool enable_beaconing) +int hif_beacon_transmit(struct wfx_vif *wvif, bool enable) { int ret; struct hif_msg *hif; struct hif_req_beacon_transmit *body = wfx_alloc_hif(sizeof(*body), &hif); - body->enable_beaconing = enable_beaconing ? 1 : 0; + body->enable_beaconing = enable ? 1 : 0; wfx_fill_header(hif, wvif->id, HIF_REQ_ID_BEACON_TRANSMIT, sizeof(*body)); ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index a325c870b4ea..5b39200bd697 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -278,10 +278,11 @@ static inline int hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, &arg, sizeof(arg)); } -static inline int hif_use_multi_tx_conf(struct wfx_dev *wdev, - bool enabled) +static inline int hif_use_multi_tx_conf(struct wfx_dev *wdev, bool enable) { - __le32 arg = enabled ? cpu_to_le32(1) : 0; + struct hif_mib_gl_set_multi_msg arg = { + .enable_multi_tx_conf = enable, + }; return hif_write_mib(wdev, -1, HIF_MIB_ID_GL_SET_MULTI_MSG, &arg, sizeof(arg)); @@ -306,7 +307,9 @@ static inline int hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val) static inline int hif_erp_use_protection(struct wfx_vif *wvif, bool enable) { - __le32 arg = enable ? cpu_to_le32(1) : 0; + struct hif_mib_non_erp_protection arg = { + .use_cts_to_self = enable, + }; return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_NON_ERP_PROTECTION, &arg, sizeof(arg)); @@ -314,16 +317,18 @@ static inline int hif_erp_use_protection(struct wfx_vif *wvif, bool enable) static inline int hif_slot_time(struct wfx_vif *wvif, int val) { - __le32 arg = cpu_to_le32(val); + struct hif_mib_slot_time arg = { + .slot_time = cpu_to_le32(val), + }; return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_SLOT_TIME, &arg, sizeof(arg)); } -static inline int hif_dual_cts_protection(struct wfx_vif *wvif, bool val) +static inline int hif_dual_cts_protection(struct wfx_vif *wvif, bool enable) { struct hif_mib_set_ht_protection arg = { - .dual_cts_prot = val, + .dual_cts_prot = enable, }; return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_SET_HT_PROTECTION, @@ -332,7 +337,9 @@ static inline int hif_dual_cts_protection(struct wfx_vif *wvif, bool val) static inline int hif_wep_default_key_id(struct wfx_vif *wvif, int val) { - __le32 arg = cpu_to_le32(val); + struct hif_mib_wep_default_key_id arg = { + .wep_default_key_id = val, + }; return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_DOT11_WEP_DEFAULT_KEY_ID, @@ -341,7 +348,9 @@ static inline int hif_wep_default_key_id(struct wfx_vif *wvif, int val) static inline int hif_rts_threshold(struct wfx_vif *wvif, int val) { - __le32 arg = cpu_to_le32(val > 0 ? val : 0xFFFF); + struct hif_mib_dot11_rts_threshold arg = { + .threshold = cpu_to_le32(val > 0 ? val : 0xFFFF), + }; return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_DOT11_RTS_THRESHOLD, &arg, sizeof(arg)); From patchwork Wed Jan 15 12:12:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AD33C33CB1 for ; Wed, 15 Jan 2020 12:19:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 659C9207FF for ; Wed, 15 Jan 2020 12:19:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ESGgX2Rj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730842AbgAOMTT (ORCPT ); Wed, 15 Jan 2020 07:19:19 -0500 Received: from mail-bn7nam10on2050.outbound.protection.outlook.com ([40.107.92.50]:24527 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730333AbgAOMMb (ORCPT ); Wed, 15 Jan 2020 07:12:31 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZXbKK+SLJIeEGPMneT37MTlMQbRvWs219TwJoGUqleLzRc8avhoqkKnSp1lwXtDgaAH95YCnnS5ek1P1qxXIC8oUz4BQtxNiT6ThQTjoYAKQjn/HaDS0oJKiOwgumD0SQJF1/TrtjCbD7zFUnYy0DwRmCVjKrECEPBotoS7W92u3IlsPn/Wh3NNweT/6kR3jtFjP73oiMwS/WqPlQYO16CAkiB3j1hTM8PTl3GaO8JpNL99bTeec5ORnmJPfoJ4RDB0tr2DeltLGU+xVvAImGIKURqvZVSFflOPzLxepJwwr60O77QEbnzLEGZEypB9LB5cTn2yP3ahljS9pWoi3uA== 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=qXjwnQ3yvU8lyBSO2Sod3uaseaRMamnlynrVm+tTnXQ=; b=eo55ObKd7EBMnYy5EJcQVbo89noUAlJiWomVGMhlrD+7oEGrAzuvZKJqzY9Tel/jEjITmUn3tv2d+GeMBJr5mud3KkzFzX9lmLn1RmFAPG2FeTQ+jmWGtR6onzEXH3pHB/iuY7QExWGCo9RMyA9wRjhOG9cZeyHUnoU1w6jVjb23nNL85W30EfpTb6NLfo2KFvLnPOwu7dUiK3Bb0kAW6TSYciBUfumxO2b1fWrh4e0iN5rhavWCFtiunf3lCpaSOw4vyR1U5jj25axZZUAEQUKHIxibSlq54aw6R0dEHa6zZ+3r9on21luGafa85ByOHnCmY6xRg8/rEcLCTp7asQ== 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=qXjwnQ3yvU8lyBSO2Sod3uaseaRMamnlynrVm+tTnXQ=; b=ESGgX2RjWwzekhAetFpuTsq99f4bS7qrqcBRsjbtsFn8RbL51+8d9J4Relw12Bmdf20F5bDlREM1CPuSNVl+8MMrxeazQ9ZKe9JCkFwsP/m3dsiezSvvwl4de4oYBxZScuMFgObDPAuaPLr3OnnCPDyU3PnieJH0If8lEAtMd18= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4096.namprd11.prod.outlook.com (20.179.150.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:12:24 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:12:24 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12:23 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH 12/65] staging: wfx: retrieve greenfield mode from sta->ht_cap and bss_conf Thread-Topic: [PATCH 12/65] staging: wfx: retrieve greenfield mode from sta->ht_cap and bss_conf Thread-Index: AQHVy50LTsPXvOgDXUODFi8ErFW3kw== Date: Wed, 15 Jan 2020 12:12:24 +0000 Message-ID: <20200115121041.10863-13-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2a608148-22f8-4b2c-a044-08d799b42e3e x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:341; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(366004)(376002)(136003)(199004)(189003)(85202003)(66946007)(66446008)(66476007)(2906002)(107886003)(66556008)(1076003)(64756008)(5660300002)(8936002)(6486002)(186003)(26005)(8676002)(316002)(81156014)(36756003)(52116002)(2616005)(7696005)(478600001)(16526019)(956004)(54906003)(110136005)(86362001)(71200400001)(85182001)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4096; 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: H6O127am20eMXytAkEyhlTQvlQ7c9Mn8rIFEg8Q8EIwTEMwKw/1ruMHEeODggYOUlrYwAqJ0W9jvfJeKdeuYV3AFYWihX1i2BDgKEwXBBRraL3ULxPxFiN8cJzGHrfRSR0pMYXIQ3ia4cv6olwIAKQHKSAEi4KBWT4GmFHfFyTEHetYjBayt2hkg8IwHtn0SgcDcyH0uLpJUEqXaChlVbdrLSFhNQKgNMEGXJVjnFVEOuIGkRyDGqJaIr3HBdY/DRgovjBo29pMP2ePM2DYsmmRfYneThF366Di8WaCYJOFOqJrzNcdX+JgMrwwc06+attQn6o+pOff/nG9TCWf4mLclYizoulbK+fhvLXsMs2Mchaim3QbhHBOrWmoVMjWI6OYkfTajejPZr0eXYLB7Rc+oQiQLGpjOeUoBToSDkhY+hrO3JqRrx3vJiR3oX1wn Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a608148-22f8-4b2c-a044-08d799b42e3e X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:24.7012 (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: 1L/cqEYuU+TOp5KfdHPL85ikjpasdRTWOYbE1ZYePU55HfTYHAf3AlMzJcA9NbnrGDBgmhe0hXSshxpC1ZPwGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4096 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wvif->ht_info contains useless copies of sta->ht_cap and bss_conf->ht_operation_mode. Prefer to retrieve information from the original structs instead of rely on wvif->ht_info. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index f13a5b41735c..fcd9fe66e417 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -817,14 +817,6 @@ static int wfx_is_ht(const struct wfx_ht_info *ht_info) return ht_info->channel_type != NL80211_CHAN_NO_HT; } -static int wfx_ht_greenfield(const struct wfx_ht_info *ht_info) -{ - return wfx_is_ht(ht_info) && - (ht_info->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD) && - !(ht_info->operation_mode & - IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT); -} - static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_bss_conf *info) { @@ -849,9 +841,8 @@ static void wfx_join_finalize(struct wfx_vif *wvif, } rcu_read_unlock(); - /* Non Greenfield stations present */ - if (wvif->ht_info.operation_mode & - IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) + if (sta && + info->ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) hif_dual_cts_protection(wvif, true); else hif_dual_cts_protection(wvif, false); @@ -862,7 +853,10 @@ 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.greenfield = wfx_ht_greenfield(&wvif->ht_info); + if (sta && sta->ht_cap.ht_supported && + !(info->ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)) + association_mode.greenfield = + !!(sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD); if (sta && sta->ht_cap.ht_supported) association_mode.mpdu_start_spacing = sta->ht_cap.ampdu_density; From patchwork Wed Jan 15 12:12:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216652 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CA39C33CB2 for ; Wed, 15 Jan 2020 12:19:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 09F58207FF for ; Wed, 15 Jan 2020 12:19:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="eII7E9kP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731054AbgAOMSz (ORCPT ); Wed, 15 Jan 2020 07:18:55 -0500 Received: from mail-co1nam11on2084.outbound.protection.outlook.com ([40.107.220.84]:24056 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730635AbgAOMMi (ORCPT ); Wed, 15 Jan 2020 07:12:38 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mk2n9F9senpdR9cPwtiVRRtWJ/05WGJtWWLXX7i8sXwPVyvI4IqGAlcpX1a0X4iQICLNX8hbZU+sYi8pPdsWojiNIH6BxuynmLA4wPKquBv7OFx5SWrbjMZFz0ZgipsylErHp6BMfmBUP7XK0RhWbFMfAHUOfduULDmD/VuxrMeai4+RyGyWViMTRVE36LhJARUJrz0+oyXWmr10OLPxTx8fpRcLbPYaOl8QWm3OjBxAYnrcs88WgyKsPjTx+iLudOykpjtolVJyfydZ6Ek+MVp1BPtLr7OvYYAf+0g/mdhv+AGtvh6YvGoe7SB8ZWIqTV3wYcalKBmtZQezuZ71Ug== 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=NlkiUJxQPHorVMQBL0ZcjgHGbnm7YMMbP4keAThtSs4=; b=SR5KcgkvPWmXDlCjJIHd6DIHVeU1OEJ9Rhse1m1TBAWow3erH1gJsD2y4f4ijVCOPgfWpcnO8xs7ol5g8zUSxwJjJ/sS+hd/biVYLZhLA72DDsbGZzTw0qs8ghWHuY/IUhMZUbz/ebqI2nypP0wRQliF7ulAXcUIToWf65kZDWUSePLL9GQi3NrFw4BxXb+le8tlhHrpmfp3oww87AhNi6WsVZZbTo20KyLB0rR167lo5BjUi28jG8lvpOcE/4dRt1lC9KH/QvPb6FoiaBdb3tgGNO6BCtrTPlLyuzPGc/7gOQucTZZxqAymSLpE91ElXCDmm9ttIv9xCwI2rhoLAQ== 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=NlkiUJxQPHorVMQBL0ZcjgHGbnm7YMMbP4keAThtSs4=; b=eII7E9kPq2iS+sGVco2ZM3DSIrlanU7xKLwijJxrZ9Usx7E2X21p/s0jmE5jH935B1BrXWmL+/ehwURjCO5705vdOXeYPHP1wbu8tOedzleGh8dc4Uhb7DoWuLitrH8XF5voASb+VWPuleH2IXRfOkoNvEi3drsbezx0azsUOVM= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:12: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.2623.018; Wed, 15 Jan 2020 12:12:28 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12:26 +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 14/65] staging: wfx: drop wdev->output_power Thread-Topic: [PATCH 14/65] staging: wfx: drop wdev->output_power Thread-Index: AQHVy50NUN5rnIj6Ek2YycwTsMt/DQ== Date: Wed, 15 Jan 2020 12:12:27 +0000 Message-ID: <20200115121041.10863-15-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2a440b69-4fc3-4336-755a-08d799b4301f x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 84hWzqGWJ1QhE1SrmYSgypEkOaaeTQdn8NXQkchoyXUmHZGjxLOCY6rBuJAhS9fZA87cqDY07LSKku2+SEtBaZUf0KklSeExbral24iciglBeu1uqn9omZvGnAAiavbMvaJeG2E1uoYZURCqvSxF156yZ/1cK9KY8VQnLn2gSfCeY4V/40BkJu6c1/xpDHdGzHqA/JtmJTu2CCVrvmZa9NJV+L+rlsZdWKvCMXjR75A1FO1CWp+K8yQV2yPwkvq4rOQGCKa3Ff6JVp4ShI+6+egRZkCAIxwd1/xE76WLgFjmKapBqzXVUJgro9LqoErSgnqWbPiXWAA3WTJAtEKD7pus0WNTH5xGs1U1haPqDyeACvA4Tiid57tLgcZ2ZmPd6t/gE4YFIOknHtDhAyqBnhZ7ujoeE47tuGOZdkjWQnCx4rtDCjBrbppdA7XUbQOp Content-ID: <56FD5F5330DE414795F2EEEFB06EC88C@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a440b69-4fc3-4336-755a-08d799b4301f X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:27.9104 (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: wQD690XfIUN85AzEaa1Bpah1CwqtuI0LSUumKLi5No6BKfvHgmGfXTprHDOC8PzeehtGNH7vC7fznCvByHUomg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller mac80211 and the device are both able to control tx power per vif. But, the current code retrieve tx power from wfx_config(). So, it does not allow to setup the tx power independently for each vif. Driver just has to rely on bss_conf->txpower to get the correct information. In add, it is no more necessary to protect access to wdev->output_power with scan_lock. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 4 ++-- drivers/staging/wfx/sta.c | 16 ++-------------- drivers/staging/wfx/wfx.h | 2 -- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 8e0ac89fd28f..5cc9df5eb6a1 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -60,8 +60,8 @@ static int send_scan_req(struct wfx_vif *wvif, if (timeout < 0) return timeout; 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); + if (req->channels[start_idx]->max_power != wvif->vif->bss_conf.txpower) + hif_set_output_power(wvif, wvif->vif->bss_conf.txpower); wfx_tx_unlock(wvif->wdev); if (!ret) { dev_notice(wvif->wdev->dev, "scan timeout\n"); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index dd2d0422c9ca..a0f19d33e972 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -503,7 +503,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) hif_keep_alive_period(wvif, 0); hif_reset(wvif, false); wfx_tx_policy_init(wvif); - hif_set_output_power(wvif, wvif->wdev->output_power); wvif->dtim_period = 0; hif_set_macaddr(wvif, wvif->vif->addr); wfx_free_event_queue(wvif); @@ -990,11 +989,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, info->cqm_rssi_hyst); } - if (changed & BSS_CHANGED_TXPOWER && - info->txpower != wdev->output_power) { - wdev->output_power = info->txpower; - hif_set_output_power(wvif, wdev->output_power); - } + if (changed & BSS_CHANGED_TXPOWER) + hif_set_output_power(wvif, info->txpower); mutex_unlock(&wdev->conf_mutex); if (do_join) @@ -1232,7 +1228,6 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed) { int ret = 0; struct wfx_dev *wdev = hw->priv; - struct ieee80211_conf *conf = &hw->conf; struct wfx_vif *wvif; // FIXME: Interface id should not been hardcoded @@ -1242,13 +1237,7 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed) return 0; } - mutex_lock(&wvif->scan_lock); mutex_lock(&wdev->conf_mutex); - if (changed & IEEE80211_CONF_CHANGE_POWER) { - wdev->output_power = conf->power_level; - hif_set_output_power(wvif, wdev->output_power); - } - if (changed & IEEE80211_CONF_CHANGE_PS) { wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) @@ -1257,7 +1246,6 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed) } mutex_unlock(&wdev->conf_mutex); - mutex_unlock(&wvif->scan_lock); return ret; } diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index ba6e0e923f4b..155dbe5704c9 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -59,8 +59,6 @@ struct wfx_dev { struct hif_rx_stats rx_stats; struct mutex rx_stats_lock; - - int output_power; }; struct wfx_vif { From patchwork Wed Jan 15 12:12:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216653 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBF0DC33CB1 for ; Wed, 15 Jan 2020 12:18:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 98D50207FF for ; Wed, 15 Jan 2020 12:18:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="OoQqwSqy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730718AbgAOMMn (ORCPT ); Wed, 15 Jan 2020 07:12:43 -0500 Received: from mail-co1nam11on2084.outbound.protection.outlook.com ([40.107.220.84]:24056 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730407AbgAOMMl (ORCPT ); Wed, 15 Jan 2020 07:12:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xw1T0HiQfGYPJ0UOUZHp46Yhq8QtNXvUNV+6tpTxgKIvG5XaOFs9v6cvrNBFVhX5/LTm26JRKeK3gbKxVMYU4Vh6rXpfkVRTKrzrlX8eo5OJyJ/yDwdY+UJ8sIIduvU4zypqptxtIv9s9/+IdNon3eFM1LD3XCAxOVo66qCIrVlA70aWZWadKz42QkAbwsXdAk06HuHcs0WsLB4Lqd1e7LV5MZv7TFZAcqgiaUlJ67fiZmJ6AaEIWOhaO7MNb27HY3C56syHaM0GammuRtfHeMwH9hpQXust8rEp9pxLXEZq79MSW1D0h0OZLD1N3Lth95Fgur4G4Xuv30+FuEUZPQ== 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=1JtJ2THuxCUky/HiJ4NGgOwKReUaawaehfR0nk8oPx4=; b=J3wxdf1RiHtVEV7wOzGjO0AW7bUf36rRjYj973jLAzqQUC74J45Qd5ozyeGOxVy9WjYHr1FzyuhmktToz70nVwnxbtRupMN5VHCjRxyxqVj628NMfvBvYSjOhF89h+Pfr8q+sqzJatps3B6xS5RwRlFwyujK7XsYAptM5ZV+b7VaMdS5bTLr8abqv7HnLMWrRtEar3jCopRQIVjHMExAunz99wob51/99TJhmNGffo+a/K9eVhCtwlN0EcEuPmtjHT7QNiegGyyH+n+yTtQHrL1qR9+KY6/yPe+kXQwawhIRqH59wJAkIpOKtQk/DUcYHYFKS97AURX/iWAkvOEuqQ== 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=1JtJ2THuxCUky/HiJ4NGgOwKReUaawaehfR0nk8oPx4=; b=OoQqwSqyzzcjcaj1gpOZ4Xam6oDjzDVSuRd0QqR7lNKTHkrv8UPQcl5+5Ua3wg6eQW+1uvjI72nTCpR7Gw2q80J6tVbYzmNsp3qCAmqAKqNvfNnPE/vq3fYt5hdB/q4mC8WlI//L91BI3abOBrdLUDodDi2lBKXDDPqQ3xx4Brk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:12:30 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:12:30 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12: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 16/65] staging: wfx: rename wfx_upload_beacon() Thread-Topic: [PATCH 16/65] staging: wfx: rename wfx_upload_beacon() Thread-Index: AQHVy50PpJG7UY/aIUKTSlWUlo6u3w== Date: Wed, 15 Jan 2020 12:12:30 +0000 Message-ID: <20200115121041.10863-17-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d308cfb6-fb06-4a8f-822c-08d799b431cd x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2449; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(6666004)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EsqIws3pe/dzwK9AEElHLSS+954zpeYXabz8fdWpm2aeG9iWftcQ9YqjKn2y7OkfwftNIZ7AbF4nGwJR/uH3vT7KC7p4qYRa9aDZaihC7cLJndS5Jo5pOGstj2oecjupmrQHMFl53UO+D6WPO5bgxhQFsRWKvyhLoz79ik4zHcab+z4RAGcYL6+Jcf9QhAINKiXmKuj+caK8oxyfmbB2r+SgdtGWfncPrVNU4z73G+ejCicUIEYxzxzrRUPigFIz3rQUnSU9NTvp9xPXXyDhIDO0kqXLiUK2pkdpM4p5VCq4JkQMbvfm8Vxg2OK+sACihcLw+KQlWWPCTR92ZUBc0sVX2tJpas7rhbAmHkpJGVH9OwheXLIdx9wKzZ3mLyIAOXattz0nkAyFPqioJ5J+ykqg35tN6AtguIdGwlVI8eFZGnB2bxatLRIUZl+EQ0q+ Content-ID: <7AB41A9B60CBFF43A7E2AFE1C4A0CAB7@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: d308cfb6-fb06-4a8f-822c-08d799b431cd X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:30.6748 (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: CM7ejtR+vjnN+tT3VwpqDPRw2LsXewybbCvt1Qo6YUwE48CepMq+kIRtklomo5JRQrWhY0TaErqxDHXrAL5oug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller In fact, wfx_upload_beacon() uploads beacon and probe response. So, rename it in wfx_upload_ap_templates(). The call to wfx_fwd_probe_req() has nothing to do with template uploading, so relocate it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 451d0108a1b0..fdde7ab92302 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -780,7 +780,7 @@ static int wfx_update_beaconing(struct wfx_vif *wvif) return 0; } -static int wfx_upload_beacon(struct wfx_vif *wvif) +static int wfx_upload_ap_templates(struct wfx_vif *wvif) { struct sk_buff *skb; struct ieee80211_mgmt *mgmt; @@ -805,7 +805,6 @@ static int wfx_upload_beacon(struct wfx_vif *wvif) hif_set_template_frame(wvif, skb, HIF_TMPLT_PRBRES, API_RATE_INDEX_B_1MBPS); - wfx_fwd_probe_req(wvif, false); dev_kfree_skb(skb); return 0; } @@ -900,7 +899,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, changed & BSS_CHANGED_IBSS) { wvif->beacon_int = info->beacon_int; wfx_update_beaconing(wvif); - wfx_upload_beacon(wvif); + wfx_upload_ap_templates(wvif); + wfx_fwd_probe_req(wvif, false); } if (changed & BSS_CHANGED_BEACON_ENABLED && From patchwork Wed Jan 15 12:12:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216656 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5C3CC35240 for ; Wed, 15 Jan 2020 12:18:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9962E24679 for ; Wed, 15 Jan 2020 12:18:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="FynQyQ2w" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731323AbgAOMSJ (ORCPT ); Wed, 15 Jan 2020 07:18:09 -0500 Received: from mail-co1nam11on2084.outbound.protection.outlook.com ([40.107.220.84]:24056 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730407AbgAOMMq (ORCPT ); Wed, 15 Jan 2020 07:12:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OQq7Q9LehLQW3Thb+uWUut9Z7aA2oXVtng8hS8rLOKI4FyJJVtpdGU6nQWfw+DT0wU1bf2iBymqJe+0ymBxI0SDGaW77EHjNVp9TC5eYnh6e8EkeSWkaxQZPQzKPJc/5uI+dC0+NtxXg61ODbgx6ZM68eis1AeiPIZcU9lXBum0ShUtM9wgapYvypV8T3rLPWuKCcVpiaIvb/c3zyReKTzlTIfo4bEDM19VmMbWOZb5FA6AoxlCKBddEGVdQuZ5GAW95Da6XBBBzBBK1g6BYL2/30a6Le3hmdZYz48hzfh2uRrWdozq5k6LxfZqXwlcQadk9xje6N4hIW/tB/kxqHg== 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=9v8lmwrZH/RnjmTRFxIndgVQtr5M/Rb020b3Yufs6f8=; b=QNeKUj5HmSjuc65LXVLgIzp7SYKmShV2WI+GxlYSJoJOYGhIPXrLAHVKbT0HUN+uW7GAGKLpBjFD6R8CvLXhxEwMtwa+AvEbNsEGcZJSliMAcPDV0vOkYwK9UGdJLP5gvnhbpnBabcJyiIfMg+79CjP2elf0bOq7Edx/TVOuj5kN4Et6/Roqjdp06prlnemfFIefA9fS21ufoG1CU559km9wq+c7+wZ/91u4lCKta+iMQ38tT8FNijZJgxAkshWm39XGc9tifW1HJUeqK/7QW8WIJSUp+Vg5H6YLnY8sotMchFE9bg8dESk+DeglTy29CX2Ovro5uhvHy+OcakgEuQ== 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=9v8lmwrZH/RnjmTRFxIndgVQtr5M/Rb020b3Yufs6f8=; b=FynQyQ2wB78C+inSL7uxxhi4yJHt3KwmZ+f2Tq/rpRHA4lDU2Kps78OQVAKjwI9jx4N6AhHA8jegV4Y4bujb5MDKAXblYf0fc4Oloj/CNbiPvUbdm0OzDqmoL9K9l5uFl/IPf9amR7OoGsrXefWnjJPvGI4SA7fnHvCDWZuF3qQ= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:12:34 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:12:34 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12:33 +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 19/65] staging: wfx: fix __wfx_flush() when drop == false Thread-Topic: [PATCH 19/65] staging: wfx: fix __wfx_flush() when drop == false Thread-Index: AQHVy50ROBMg+v6CA0G5VLJRshsWqg== Date: Wed, 15 Jan 2020 12:12:34 +0000 Message-ID: <20200115121041.10863-20-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7fd5b2cd-36b5-41b5-d03a-08d799b4342f x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QTKzTObCJ3EziBd/aRPvpBy91zeCyy4/Tnwn1hy/2nlPkNOqoWnxVzughdiA0+A9a1LrJncMPiGtz9qIh1VH9NDsiOWYuPQfLSPcIpsl+6hts/g4w1WGOs4WtF1o6DeoaAp3Fk6ItQpY3ufSFWDtrWS0nbzMX1fs1ucr3Ez+GBrphGKK+Q742dDlPby4U/QlsgUlAJTzWFjVitYlPOgQV5D182jxAuGaE5qqwrHVHTZS3LJcKpt0xH+FR3rSGjwX7pFG2Iai1uGR+WJlD06SopNg7LR5tcPAiO5BUi7wtK19RMVFlyc0gDnbb7k2Rmu+kPB2E8w9iKhcuJijDKNiy4Wz6Jx1+Fzi+1sK+vAU4sEkQdXybPUkWFPKU188S+3NVx2vm9/2dPCUJPOW5V0rigEn+HvM1Q5aBkxr/euV4KYcjBBjXIcTW7KYhSk/lkeQ Content-ID: <5B443518F7D18A40B3FD716F3E52EC9A@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7fd5b2cd-36b5-41b5-d03a-08d799b4342f X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:34.6585 (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: 5leVy8NqAAfjL6mK14t/iRLQEiyBLtp4gNwGjTTPUBycbHm55ZGEfzsWajxDVwFA1aVpIchgfjWtCbXEd+T6VA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_tx_queues_clear() only clear not yet sent requests. So, it always necessary to wait for tx_queue_stats.wait_link_id_empty whatever the value of "drop" argument. In add, it is not necessary to return with tx queue locked since all calls to __wfx_flush() unlock the tx queue just after the call to __wfx_tx_flush(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 2 -- drivers/staging/wfx/sta.c | 42 ++++++++++--------------------------- 2 files changed, 11 insertions(+), 33 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index abfbad7c9f75..92bb9a794f30 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -31,8 +31,6 @@ void wfx_tx_flush(struct wfx_dev *wdev) { int ret; - WARN(!atomic_read(&wdev->tx_lock), "tx_lock is not locked"); - // Do not wait for any reply if chip is frozen if (wdev->chip_frozen) return; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 0c73691ab736..3d665eef8ba7 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -343,42 +343,25 @@ int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value) return 0; } -/* If successful, LOCKS the TX queue! */ static int __wfx_flush(struct wfx_dev *wdev, bool drop) { - int ret; - for (;;) { - if (drop) { + if (drop) wfx_tx_queues_clear(wdev); - } else { - ret = wait_event_timeout( - wdev->tx_queue_stats.wait_link_id_empty, - wfx_tx_queues_is_empty(wdev), - 2 * HZ); - } - - if (!drop && ret <= 0) { - ret = -ETIMEDOUT; - break; - } - ret = 0; - - wfx_tx_lock_flush(wdev); - if (!wfx_tx_queues_is_empty(wdev)) { - /* Highly unlikely: WSM requeued frames. */ - wfx_tx_unlock(wdev); - continue; - } - break; + if (wait_event_timeout(wdev->tx_queue_stats.wait_link_id_empty, + wfx_tx_queues_is_empty(wdev), + 2 * HZ) <= 0) + return -ETIMEDOUT; + wfx_tx_flush(wdev); + if (wfx_tx_queues_is_empty(wdev)) + return 0; + dev_warn(wdev->dev, "frames queued while flushing tx queues"); } - return ret; } void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 queues, bool drop) { - struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif; if (vif) { @@ -389,10 +372,8 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, !wvif->enable_beacon) drop = true; } - // FIXME: only flush requested vif - if (!__wfx_flush(wdev, drop)) - wfx_tx_unlock(wdev); + __wfx_flush(hw->priv, drop); } /* WSM callbacks */ @@ -1046,8 +1027,7 @@ static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) skb = ieee80211_beacon_get_tim(wvif->wdev->hw, wvif->vif, &tim_offset, &tim_length); if (!skb) { - if (!__wfx_flush(wvif->wdev, true)) - wfx_tx_unlock(wvif->wdev); + __wfx_flush(wvif->wdev, true); return -ENOENT; } tim_ptr = skb->data + tim_offset; From patchwork Wed Jan 15 12:12:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 001B3C33CB3 for ; Wed, 15 Jan 2020 12:12:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C04FD222C3 for ; Wed, 15 Jan 2020 12:12:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ed75+Q7T" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730853AbgAOMMt (ORCPT ); Wed, 15 Jan 2020 07:12:49 -0500 Received: from mail-co1nam11on2084.outbound.protection.outlook.com ([40.107.220.84]:24056 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730774AbgAOMMs (ORCPT ); Wed, 15 Jan 2020 07:12:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EIvhs5/bMPTur7d+v3iYBoaLnWcmfN9uhS89qeibfrqaq4gEjoS0QRQLIMKMSzyC7aQkBCfXkERPOBR7bahjK1PSbwWGhxl0ZhuGGqi0MegqPD+cA1opRsgAvPL6NX04FeP8+yH6NE6Lhs06iT7LRqrS81LzXAq7EJRAS1Qry0CxXaRgPvg83p9jCvvyu74zwN0cJivUef74rX87K4dNdMW6fQGI/W1NAxSiKJoFBmC/RhLFuwxpwmu6zPPW86miuuUGUW2qro9ea8Q7tsbiVpXnB1JK566UCWLL++epyumTpZBue+ffmlnlporhiKoe6gO4+ryY2PwuWUM4a0mJHA== 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=n2ETDyqVciDrVTsElmWoRWuQT1mIpukmooLN9gH5YIg=; b=lPVAuvPAUtikXE1ogZOnwmdLWJLEwwW5/73YXdgH/hWHcToPnG6Ndh1O6LFmZrQJyrrxbcZ2m9fHV9AN32k3FBh6/qNhDEhUy8PH9+Z7trWLOMinRIxia8rF8oebi5fxexQbDiP2GohmEl5wHsxqkmjO8ChxkoaFzEGusl6lcdtKefkZ8O5epHpdRPWC5Cwz0U4zrJdyGs74vOAPuuC8v5oYQsIIMk8j7WLNGcwUALKnOU+tisY+15anWXp2qSoN3grKQsFFflaUBXhJaaQqxkaLcspOM3gTemaXiQOPXjOs/G6EWDBIXhQ1aIus4LOR/kOd2aRYQ2RUx/Ctm5uZPQ== 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=n2ETDyqVciDrVTsElmWoRWuQT1mIpukmooLN9gH5YIg=; b=ed75+Q7TVSf69D+b07eUmEMufg4S/cEvNlaiXhNsLIcJEaY3LScVYxNGXYXrdzeblSEMvUgEZIP+ttDCnjCno/Ge2wpHY/guKTgs8oIz9GwLFoX/Fhc22YsXybe4Ng08WQJdLWe88Y4ZEj/mIpLV0JTfdZxPAs+KVVz++WoYhEg= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:12: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.2623.018; Wed, 15 Jan 2020 12:12:36 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12: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 20/65] staging: wfx: simplify wfx_flush() Thread-Topic: [PATCH 20/65] staging: wfx: simplify wfx_flush() Thread-Index: AQHVy50S5Npa2w6+aU60uLFekLvtug== Date: Wed, 15 Jan 2020 12:12:35 +0000 Message-ID: <20200115121041.10863-21-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8eebd3c9-ba64-4375-bda5-08d799b434f7 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2cIcSOotlZNRxRRtnk0MnIL0Z4hcmTutzrMerWKoegEYM8u0rSpaRkJ8Z42tMSggHMq1gZCxiaAzfpvnkMYSt8oRuWo/ZicCfn1BQ+bQnONMkeISUzwiNl7QBuf56fw/ii1gi1fXqd9xa0yJms6myUXXJh0Utno6efTQLDivrxrEtU1ChwyMQ4fyRL+hlDXLZHuXpZFOkSKdbSzkLVjCfQAdpFAwqW+jNY2tu7qvZjz8q07v6yCunNHNRxl1dPrVZdnE3NYSqn3G9d62pohu9cMKfyZWPgTRHjK31k2Ednnko0pjPwAHiu16vziTUli2QLddSVFDe5rq4266Fpdm1MWLFCFO3+NIDAwn41CB057aQM4YTjnUi2+AQ1dm/pQz0eIISuywa5G1n4mntmSVgi882Y8fUqJjDtX7tkuzJNGbDtxfrY3FOsKVWJSFYQgY Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8eebd3c9-ba64-4375-bda5-08d799b434f7 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:35.9767 (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: RQEdIoH1e0bCY9mA6mATss/zuPX6gQtkTdFsgqQIPo1ti25t5VMd23efCR/HRLlDs6bUVWyCQqsuuHG0ayNFLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Current code of wfx_flush() force to drop packets in some contexts. However, there is no obvious reasons to do that. It looks like a workaround for a bug with the old implementation of __wfx_flush(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 3d665eef8ba7..ae01f7be0ddb 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -362,17 +362,7 @@ static int __wfx_flush(struct wfx_dev *wdev, bool drop) void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 queues, bool drop) { - struct wfx_vif *wvif; - - if (vif) { - wvif = (struct wfx_vif *) vif->drv_priv; - if (wvif->vif->type == NL80211_IFTYPE_MONITOR) - drop = true; - if (wvif->vif->type == NL80211_IFTYPE_AP && - !wvif->enable_beacon) - drop = true; - } - // FIXME: only flush requested vif + // FIXME: only flush requested vif and queues __wfx_flush(hw->priv, drop); } From patchwork Wed Jan 15 12:12:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FBDDC33CB1 for ; Wed, 15 Jan 2020 12:13:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CFDB1222C3 for ; Wed, 15 Jan 2020 12:13:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Txa3x4fI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731048AbgAOMNQ (ORCPT ); Wed, 15 Jan 2020 07:13:16 -0500 Received: from mail-co1nam11on2084.outbound.protection.outlook.com ([40.107.220.84]:24056 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730816AbgAOMMt (ORCPT ); Wed, 15 Jan 2020 07:12:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hRsfeqAyFwXr/kOu+Erxv42FynlcnzK7oQMsd3f7h6cN1dhRDY/GgrmsKgdHDL+LEbTJ+cthwHknG+Q+lgz6+o8i+mTxr5LgftuW0p29LeKXd+IXmaKxQki4SVBWBXEjzIyGgO45bQ4ww9sbHO8+rvBvpIlGeaYbi+PRODQ9JlwkUiW48yhtFxaRXq6X7/DOiESilCARUjlNSoHjTn5hAS1I4vsoPeebH92bk/2wewYVLxqNmdLHlwsA4pN8rUE4jOoj0/edKb8o/euF7jF1RoeLOGyWcdRVGSF9Tai0pzUqtQP4dWrzggZpxxoj9BWwcbzCLC5JCgYx9M5VvY0CIg== 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=ZlidXQn8i1jas5J/LLCgvEICvbLWAL1DhgHsKcUtOo4=; b=QAbk+OajiAIWg2qlsAtBOOh9OGv3Y6O/W1ia3dA4seuZPyGG8j34LYbh448EBus19CIw1eEtRQT5i2EFS9HV5WaeXgAb+mUXNviYTY0AiP+kscF9sguDZ8mNT2bNBTeJGVdqUEOowDcbVH7hW4Q/929mxoF275jeqoJseG4zKRqfGkmwm6qCO4SqvXfhZ4AzWfK5B6F9yDJmEpAexQTY32qBTbf/dnZRsRlk4E8m6T8nsy9iMQah6JcRkfICCMCDHDEs4LIqRnxd0Ff/fyQ0Y+G5q0jiD//4HzAyj1vSX1AI9pG62RSJGBxAvPrLi8RprnCBRjrTGw4ABBPNECn55Q== 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=ZlidXQn8i1jas5J/LLCgvEICvbLWAL1DhgHsKcUtOo4=; b=Txa3x4fIvoFGa+DiIidxYvCObB4cDucp21jZDSaXOaP8RrrZBKqH9r3aWQKebpjVuNLlwM56HCousIZ44KTb93u5/Vt9SRcaHJ+xHWQckZIsT2nrUKKdJcMKKaG+6di45eg04x92eWN+jUp+sm4ngCfjQ+Nrq4RdRIq/D4IZgHU= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:12: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.2623.018; Wed, 15 Jan 2020 12:12:37 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12: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 21/65] staging: wfx: simplify update of DTIM period Thread-Topic: [PATCH 21/65] staging: wfx: simplify update of DTIM period Thread-Index: AQHVy50T30mp2MFZCEm6jRoRXY90lw== Date: Wed, 15 Jan 2020 12:12:37 +0000 Message-ID: <20200115121041.10863-22-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 81393438-d28c-4be2-840a-08d799b435bf x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2657; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003)(15650500001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: i7f/c6Vtj3gAL5gwGmRKM+Lk/eypVya7Viq1rNoiQRzH3IiVZ/GcrNaLSMGMM1Bn7PWQiPHVXp03RLQBarSDFNwtCg/3vBMOMkmlieGVGOJKZmSDLoamuYrDeFZnW4bg7kqJPLdRHCoDgvLL7Ev8jBW5wnB8svGgdCGlGNW0N2a8yLKkODp7mXoGTJmoirmUDxb8UXrt6tKZ7vfXIqRfxwglN126U6NK3LoLT1woKwB00yFl5bCZ3dp8s3aqmePBo4sNvuCXFtCvROch3ZiL05aH8ijJjRuplhMIfAqRAl8an2Xs5woAYCatC2WSvS24z/eIV5N6Fo3k7JZZew7G3knO5tVq0LfooJ5wRl/47PUIeJIu08j2ySljPIWz6E5SUBXVb0I3moScEjJGSNuR4hySbNzG58LU5AL89MvbWWXJ6ajzMC2ISW5WxkRAxAHj Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81393438-d28c-4be2-840a-08d799b435bf X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:37.2820 (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: eNuj48AimowsHTDEMv2fZG8qZ9eEO99jpqLEOaG3zTWg/IiQH/fZKTxbUTILfrzoOYg2vECGopXv63MDEzuyvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Current code parse the TIM and retrieve the DTIM period. It is far easier to rely on bss_info_changed() for this job. It is no more necessary to run task asynchronously. So set_beacon_wakeup_period_work is now useless. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.c | 14 -------------- drivers/staging/wfx/sta.c | 19 ++++++------------- drivers/staging/wfx/wfx.h | 2 -- 3 files changed, 6 insertions(+), 29 deletions(-) diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c index d460c0ffca1f..0ab71c911f84 100644 --- a/drivers/staging/wfx/data_rx.c +++ b/drivers/staging/wfx/data_rx.c @@ -173,20 +173,6 @@ void wfx_rx_cb(struct wfx_vif *wvif, !arg->status && wvif->vif && ether_addr_equal(ieee80211_get_SA(frame), wvif->vif->bss_conf.bssid)) { - const u8 *tim_ie; - u8 *ies = mgmt->u.beacon.variable; - size_t ies_len = skb->len - (ies - skb->data); - - tim_ie = cfg80211_find_ie(WLAN_EID_TIM, ies, ies_len); - if (tim_ie) { - struct ieee80211_tim_ie *tim = (struct ieee80211_tim_ie *)&tim_ie[2]; - - if (wvif->dtim_period != tim->dtim_period) { - wvif->dtim_period = tim->dtim_period; - schedule_work(&wvif->set_beacon_wakeup_period_work); - } - } - /* Disable beacon filter once we're associated... */ if (wvif->disable_beacon_filter && (wvif->vif->bss_conf.assoc || diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index ae01f7be0ddb..1af99b7930f4 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -446,15 +446,6 @@ static void wfx_bss_params_work(struct work_struct *work) mutex_unlock(&wvif->wdev->conf_mutex); } -static void wfx_set_beacon_wakeup_period_work(struct work_struct *work) -{ - struct wfx_vif *wvif = container_of(work, struct wfx_vif, - set_beacon_wakeup_period_work); - - hif_set_beacon_wakeup_period(wvif, wvif->dtim_period, - wvif->dtim_period); -} - static void wfx_do_unjoin(struct wfx_vif *wvif) { mutex_lock(&wvif->wdev->conf_mutex); @@ -466,7 +457,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) goto done; cancel_work_sync(&wvif->update_filtering_work); - cancel_work_sync(&wvif->set_beacon_wakeup_period_work); wvif->state = WFX_STATE_PASSIVE; /* Unjoin is a reset. */ @@ -823,7 +813,8 @@ static void wfx_join_finalize(struct wfx_vif *wvif, hif_keep_alive_period(wvif, 30 /* sec */); hif_set_bss_params(wvif, &wvif->bss_params); wvif->setbssparams_done = true; - wfx_set_beacon_wakeup_period_work(&wvif->set_beacon_wakeup_period_work); + hif_set_beacon_wakeup_period(wvif, info->dtim_period, + info->dtim_period); wfx_update_pm(wvif); } } @@ -872,6 +863,10 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, } } + if (changed & BSS_CHANGED_BEACON_INFO) + hif_set_beacon_wakeup_period(wvif, info->dtim_period, + info->dtim_period); + /* assoc/disassoc, or maybe AID changed */ if (changed & BSS_CHANGED_ASSOC) { wfx_tx_lock_flush(wdev); @@ -1260,8 +1255,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) init_completion(&wvif->set_pm_mode_complete); complete(&wvif->set_pm_mode_complete); - INIT_WORK(&wvif->set_beacon_wakeup_period_work, - wfx_set_beacon_wakeup_period_work); INIT_WORK(&wvif->update_filtering_work, wfx_update_filtering_work); INIT_WORK(&wvif->bss_params_work, wfx_bss_params_work); INIT_WORK(&wvif->set_cts_work, wfx_set_cts_work); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 155dbe5704c9..d201cceec1ab 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -101,8 +101,6 @@ struct wfx_vif { int dtim_period; int beacon_int; bool enable_beacon; - struct work_struct set_beacon_wakeup_period_work; - bool filter_bssid; bool fwd_probe_req; bool disable_beacon_filter; From patchwork Wed Jan 15 12:12:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216654 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A4E3C33CB2 for ; Wed, 15 Jan 2020 12:18:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6B7C222C3 for ; Wed, 15 Jan 2020 12:18:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="FmOPBYxk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731946AbgAOMSc (ORCPT ); Wed, 15 Jan 2020 07:18:32 -0500 Received: from mail-bn7nam10on2047.outbound.protection.outlook.com ([40.107.92.47]:27390 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730667AbgAOMMo (ORCPT ); Wed, 15 Jan 2020 07:12:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LbjcVHYr7ws+4mhmKNFYK48MT0k3pJf1smHl1f1TIV58mwDDV3pa3m6vKghsrtg5Cy0Ck9Zn4mPJbsORpjv79X2TNj5iaplWybBfuOOSXPZ49R4r8HAKgr1DmYc+5jCM0WLUfVB4odsPUVNYa71hBH/kUxw/jAjw4e4djnwfGieOliDUXBYrO/UBO+PFm/vhoTKw6MoRQkID+ONu5JNIlerA8erW9Fe+Cu/2RDS5ykZdt/0cwdbhPGlj/GgU0eHAaMdxVGgqKZEx89KVJKGpdN7rgvm9JL5BxxxiMXBN8LYfQ0ddAUAiFEqOJvQA9lPK0h/7cjYDizYIt6tP7VN1lA== 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=EyDWq4MM5XzguJy/1tVdbLRwVPRpywmE0qbRXL02dkc=; b=kDA5UTSxUXKYadMhHd+XB+nevKSmUtYbuqVdBpu0Cui63jmbko3NeERgvr3MzsABoJwP3RzbI/f3Xl6CLdI93yL2R5WaWEuWiv2LkCQLpE4NkpRJ4qFqEepbFb8bG9Nc0+1/JKJ3GPIg6SWsEhiVzxWgQdxq6lS0XlXcqy63Uuxn82e+OG/CUsJTeD/TNN4SFgw6eeyV9Z8NyRhBI+ZEVP2VKCiUDz3I5GDqsFWsWG6E82rHn3m9NQ+u8YapROUsPlIkjpdorZQu6h/6BlKbMJb7jdooRL8TVm2nMxJDAPPCSwVdrKPEKBf6tuaf0gUMSwSXd9rwZeeTgfzfQ9zMjA== 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=EyDWq4MM5XzguJy/1tVdbLRwVPRpywmE0qbRXL02dkc=; b=FmOPBYxkfjZMLtuTGwtEx/uVVVBkIlDYm2T09vZlpPz2v5SvjVd2Zn4FXfbL6sewaXYSzwMg5XUsKgiq0X9zvc7bTpBT+ILS4XB8VeQe32cO4NBB+TapCTD+76HdRqxqLlBx6NMS5ugAeknaQmVCIBh2zDJwLmeuhPkG0ZhpLHQ= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4096.namprd11.prod.outlook.com (20.179.150.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:12: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.2623.018; Wed, 15 Jan 2020 12:12:40 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12: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 23/65] staging: wfx: drop wvif->enable_beacon Thread-Topic: [PATCH 23/65] staging: wfx: drop wvif->enable_beacon Thread-Index: AQHVy50UuRVBqeQDKEKkOLFm7Uu3iw== Date: Wed, 15 Jan 2020 12:12:39 +0000 Message-ID: <20200115121041.10863-24-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b0a2e61d-31f2-465f-373e-08d799b43758 x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(366004)(376002)(136003)(199004)(189003)(85202003)(66946007)(66446008)(66476007)(2906002)(107886003)(66556008)(1076003)(64756008)(5660300002)(8936002)(6486002)(186003)(26005)(8676002)(316002)(81156014)(36756003)(52116002)(2616005)(7696005)(478600001)(16526019)(956004)(54906003)(110136005)(86362001)(71200400001)(85182001)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4096; 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: Lwy1ep467sgeo32ZaPmGZu4ZxXrgQu1Kt6gQTqRiYtqJSyNnpmrId365NgwPlKIpjhzNRdbNgurYlcKTu2Of7S1xcaBsoQBryAT1sm9CH/IUbSknMxWZqC1oAv1l0qAO+zkUqUYs80Pynvg3dCTxo25qcxhK8wem8w3PZM/gwvTXR4nA9cEmrhcT5h7TwxYCJP8HyJQ+rN02Sb1EQRnlHVWDN/xGyi93nXTZGsZvEAKQeyrZM0ItSguilW/iWYtBcSdZ+btaHlLYdHRbJMwMGBJ0gnPDdNTnJ4MLC72OmIvEq1CCU9xEQ+0FyzR7+/S5IOcqijHhYrRWMBZ2C7dzj1TuywI0nEHmjLiBcsxMYW/3JMQ+R0LYN5sD47xpouHoj/GMRFmaS6zcizSMIJCHYFZYu/Q3qU+Wn6IWdBZd4LRQcMUnRLfUGLQKsp9nvBOU Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0a2e61d-31f2-465f-373e-08d799b43758 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:39.9584 (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: fp9Rp6WTtWb1koJoPUuRQbewjQ2ttWpplPrVOxJHy0SxLU8/Ze0N3qANSjHh+UKsrpJoXYLEFDbVrF/bZMu29w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4096 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller It seems that current code try to save calls to hif_beacon_transmit() by keeping a copy of the previous value of bss_conf->enable_beacon. However, hif_beacon_transmit() does not cost so much and mac80211 already take care to not send useless events. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 9 ++------- drivers/staging/wfx/wfx.h | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 376451433e9e..dede6323bb17 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -843,12 +843,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, } if (changed & BSS_CHANGED_BEACON_ENABLED && - wvif->state != WFX_STATE_IBSS) { - if (wvif->enable_beacon != info->enable_beacon) { - hif_beacon_transmit(wvif, info->enable_beacon); - wvif->enable_beacon = info->enable_beacon; - } - } + wvif->state != WFX_STATE_IBSS) + hif_beacon_transmit(wvif, info->enable_beacon); if (changed & BSS_CHANGED_BEACON_INFO) hif_set_beacon_wakeup_period(wvif, info->dtim_period, @@ -1299,7 +1295,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, } memset(wvif->link_id_db, 0, sizeof(wvif->link_id_db)); wvif->sta_asleep_mask = 0; - wvif->enable_beacon = false; wvif->mcast_tx = false; wvif->aid0_bit_set = false; wvif->mcast_buffered = false; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index bd4b55e07c73..84cb3a83e5d9 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -99,7 +99,6 @@ struct wfx_vif { struct work_struct set_tim_work; int beacon_int; - bool enable_beacon; bool filter_bssid; bool fwd_probe_req; bool disable_beacon_filter; From patchwork Wed Jan 15 12:12:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C01C2C47409 for ; Wed, 15 Jan 2020 12:18:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8994124671 for ; Wed, 15 Jan 2020 12:18:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Kte1Yz6T" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731675AbgAOMSP (ORCPT ); Wed, 15 Jan 2020 07:18:15 -0500 Received: from mail-bn7nam10on2047.outbound.protection.outlook.com ([40.107.92.47]:27390 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730742AbgAOMMq (ORCPT ); Wed, 15 Jan 2020 07:12:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JINZpR9ppCncbJyVhCZOf0bG6WJfl4nmllmCmxC/TrWEQ28N4ERjG302pyC/tuMQZijh3sgTIsChM08S5f/D7uqq0kImxHf/8Pl3b9R7wpsOt4GZzmRjM7eiCBSYzoipwRkXKWWU3KFXY8F1hmRYscwpGBFarwOUbWNhiBs/orzgZ0MYZIaKxYtAc5OyRQPDxkHRYSVZMMqdx0mEQspEI8TwuaXxKpQ7oSxvkDRE7MVaCc/zBlechuG9Gj0IwT7d401tGq5SFAwoqpbvW9f716c7QvDz4sUXRwdDH1qIkJOoTXTFB0FmpRzk5zGZXm1z56c7tUge7829HHPuuH9aDA== 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=eRYmR3/mjgpAV7ya5W2JQ6zVOdZn/cH6Vo2ZfQhWaqo=; b=H39Y5mHq5zWbeiCJsdS7QAouBxYL2kkzD6BAKaEdDGLhdtbn8m/7Z2SS6TEOt+agIZyoWAWrjzIi15eDh+0MBlEHZMg8lLA269DDMEodGkFV4p2ng865beO+PCpbe/0oyY+EsvtVxUAkL53Wn7wmfCrOtP6B8MIzPUkgNUV5cUBsCGCTb8y5fsc02o6oand2gcf0fVxHS7/5k10kfUdpaBTt0pkyWUyEU0Y8vqAUXDbkdT4BFiWGn/XEsk4hVgmxin72ieNL+OfulLTCg4gYdVu5LRvbzSdQ5bv8JmnYW+vM+Na+AviviCDUf0TEivxlji/ObO0wVKsXOcvbAV1K+w== 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=eRYmR3/mjgpAV7ya5W2JQ6zVOdZn/cH6Vo2ZfQhWaqo=; b=Kte1Yz6TJSatDu+ln9wzzQXwgdGnes4EyckHCK19zlM6oWx0mPZaYLQ8aYrVRYXKRqf2U+fw6jMxmhQFAuCLCnIuCLHx0oIZ/1pC4nVWU02GWHUipcj0OYLkvk984ut+EL9AGA21o/dSaoiCFCyJNnltQ1sLVO2THu4PW1EjYto= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4096.namprd11.prod.outlook.com (20.179.150.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:12: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.2623.018; Wed, 15 Jan 2020 12:12:41 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12: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 24/65] staging: wfx: drop wvif->cqm_rssi_thold Thread-Topic: [PATCH 24/65] staging: wfx: drop wvif->cqm_rssi_thold Thread-Index: AQHVy50ViJN/SnAErkqSJEtdc+UaCQ== Date: Wed, 15 Jan 2020 12:12:41 +0000 Message-ID: <20200115121041.10863-25-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: be41f336-d626-41a8-1366-08d799b4381f x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1824; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(366004)(376002)(136003)(199004)(189003)(85202003)(66946007)(66446008)(66476007)(2906002)(107886003)(66556008)(1076003)(64756008)(5660300002)(8936002)(6486002)(186003)(26005)(8676002)(316002)(81156014)(36756003)(52116002)(2616005)(7696005)(478600001)(16526019)(956004)(54906003)(110136005)(86362001)(71200400001)(85182001)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4096; 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: tLxRswoRUYfzArLvjewZPVKw1DvucsNhCvkgIs1b4zGSvrYYIWgr62I+ao/oTgiV+vxvCoKceqHzfZyYS0eams+oacVUEVV3fHkwqz7AGTR/eWzUQd86lEFt9hTVFG9+JU6QOtQeTGgCyE054thmjqbIheB1X7Sx9IMDIKbp/HE61dTaVEKNFGz/kLygCBuDbOaPHxj8baYwzIpC2dMxIooHU1QEXr75Wjl3wy3vvXoToDALtfaSljoZccz1T8F1IvdZF8JO4k9iFvFKuJ4P5VDrBVT80R3pz/it8fOeSd4Le0MTz4z2bEi1rEQODMRJRYjQJaC5lRE2Ye/6ee+ncoAb1xovBD2Rd35BrG1N94i2ueXSc3KPClvxrqACXc9aJPNlhOJZmxdXqH1IDH0Hexz2JslG2fFf/VSBB/KduGiEqbjoTdWokcLr7MYs1bBi Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: be41f336-d626-41a8-1366-08d799b4381f X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:41.2607 (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: +c2sKhI7KO3r8A8erfz7CK0GaodpfDtxt5a13IVNluYNF9RrUlGlCK4XjYzN1YH0tfLJa2nFryYX/fHSNvg39g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4096 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Current code keeps a copy of bss_conf->cqm_rssi_thold in wfx_vif. There is no sane reason for that. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 6 ++---- drivers/staging/wfx/wfx.h | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index dede6323bb17..021daa9f7a33 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -377,7 +377,7 @@ static void wfx_event_report_rssi(struct wfx_vif *wvif, u8 raw_rcpi_rssi) int cqm_evt; rcpi_rssi = raw_rcpi_rssi / 2 - 110; - if (rcpi_rssi <= wvif->cqm_rssi_thold) + if (rcpi_rssi <= wvif->vif->bss_conf.cqm_rssi_thold) cqm_evt = NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW; else cqm_evt = NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH; @@ -922,11 +922,9 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, 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 || changed & BSS_CHANGED_CQM) { - wvif->cqm_rssi_thold = info->cqm_rssi_thold; + if (changed & BSS_CHANGED_ASSOC || changed & BSS_CHANGED_CQM) hif_set_rcpi_rssi_threshold(wvif, info->cqm_rssi_thold, info->cqm_rssi_hyst); - } if (changed & BSS_CHANGED_TXPOWER) hif_set_output_power(wvif, info->txpower); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 84cb3a83e5d9..1b487d96eca2 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -105,7 +105,6 @@ struct wfx_vif { struct work_struct update_filtering_work; u32 erp_info; - int cqm_rssi_thold; bool setbssparams_done; unsigned long uapsd_mask; struct ieee80211_tx_queue_params edca_params[IEEE80211_NUM_ACS]; From patchwork Wed Jan 15 12:12:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9353FC33CB7 for ; Wed, 15 Jan 2020 12:18:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5677F207FF for ; Wed, 15 Jan 2020 12:18:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Kfy55T2O" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731063AbgAOMR5 (ORCPT ); Wed, 15 Jan 2020 07:17:57 -0500 Received: from mail-bn7nam10on2047.outbound.protection.outlook.com ([40.107.92.47]:27390 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730776AbgAOMMs (ORCPT ); Wed, 15 Jan 2020 07:12:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aKBU6PhD2cC8DyRVeML1nKSEVg5zd7KROI2VFWAcn0JFQ4uv0K7Jaj7imRxPQlQstQOvpGw/wqvWZuq7UQUvB+hVadsH1nRDUtnjBJGQkH5xv3b0JhnlkdkwgpKBCt2jKsrGeVxnYk38cfgVuIfY8lfK2aVOjqFUGOiNkzBfpa6kfKOibxVI42mr1XLyhfUK+b1BnU+A7DQiODDMZ0qYDMqFocvNfp2pAfe9SlwSUPP+EAx5+EPtqL9XXP7R5c/bD8OCdkUHuWmH1HvdtgkhGCGQHbNtaEYhysIPVZpV8Yi6JEvXmqQgYu8wfTCcQMXtUV/yIBr6xgvbj26fQTfAOQ== 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=j/9iTfaxfTcnYc8YPZNodlKI4v6m4/uHAT4ZHAmep34=; b=HsguAn1tshBQfboSAr/bmyX8ViEj697Kgji58aFmTWqTnfBmoQ5oLU+hLyw+om8ygDa5044hbc1elwG7C6jMWNh80AO9ZmILWGJcJc/ffQLMxnmK//yvLSrgUEnCs7MAipm/HgDiJs4A01wLnWL3rjGdvTCaPTx2Mx06OcygGE028SfLWK7ZR/J9wRygQPgFz/EdgwI4UTpQrrtykTC6EHpOIFBpChJ+aqX4OsX83W6GFN8X63EMBLvOoJ7PUSOryQuBbt1O4F0cOWdD8Yx0wxeR/WcO3DH34maeFlxwIKwPq+mLY5dcitwYqP9VBGoHdDD8qIusS9pQ9I63OX25IA== 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=j/9iTfaxfTcnYc8YPZNodlKI4v6m4/uHAT4ZHAmep34=; b=Kfy55T2ORkw7TcuspLPDIMF0luqX8s+zEn5UaotujyzvaKckf5NYGC2rjxiXSOnIVUxSpOjKqgPl4HKKDgsQAX7RkPNTzfOJKzS9dT8mQY1BWsQSrcErMYw1yAKH7bKJtdIzPpHIWb8A5o7X82mwN4UttJPXOm9zr7HP4B9/VYo= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4096.namprd11.prod.outlook.com (20.179.150.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:12: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.2623.018; Wed, 15 Jan 2020 12:12:44 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12: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 26/65] staging: wfx: drop wfx_set_cts_work() Thread-Topic: [PATCH 26/65] staging: wfx: drop wfx_set_cts_work() Thread-Index: AQHVy50XS1F8Nym7N0mDF65g+7U93A== Date: Wed, 15 Jan 2020 12:12:43 +0000 Message-ID: <20200115121041.10863-27-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 54ecaa24-9037-4f26-e54f-08d799b439b2 x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(366004)(376002)(136003)(199004)(189003)(85202003)(66946007)(66446008)(66476007)(2906002)(107886003)(66556008)(1076003)(66574012)(64756008)(5660300002)(8936002)(6486002)(186003)(26005)(8676002)(316002)(81156014)(36756003)(52116002)(2616005)(7696005)(478600001)(16526019)(956004)(54906003)(110136005)(86362001)(71200400001)(85182001)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4096; 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: 8WgcLhFgU1bgzIct20FbHbX+I1Gxq3H4gWzZGzL2KBFoXURgv/Whk2v3drRRzP5EVo0OQIvwIKs65hy1F5PifESJBCmglSkLE5KsvZfbM96uaeQ8NyAeFE5oJSpZ8hRig+6/8LyJi79dgPC/E97eT4AZf4RwKvKx/wI1ZA4aWOFNjMZ0gQIT5Z9VzcyqYQcF8OOTvOAaiOZ1A7vAw6iBZz6zXk0Y61i5RqfW1iRtDeX3tXhOyainvIfDrc+wLMtcox9kUIyvWrb0dTDy9agccVIJtuPmKzfKUMNSf6I05vDMKTNAOoPIYSt9FBBgbwzpn/uQwFykHMo1dVTnIaQTg2nq8tu4f1QEFotn8qEVYXlNHZAkPjXJ96PuCPtie8/g7Y96d0wX8PelWK7GBaJbMVAnlapRnyLee3Vx0bNif/jTSroMwAld5TguaDIGvpj9 Content-ID: <1D529A718145244FBF40CCF6AF0153DF@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 54ecaa24-9037-4f26-e54f-08d799b439b2 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:43.9201 (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: DOeUhCNGSYgxmUQK0qSJVgs7icT/b2cqAnn/lSKWAJY6kvnhTFldHH34X717yYEG3QldDV0ghcz4Yfu5+6hZ8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4096 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_bss_info_changed() is not called from atomic contexts. So, it is not necessary to raise an asynchronous work to change ERP. Thus wfx_set_cts_work() become useless. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 40 +++++++++------------------------------ drivers/staging/wfx/wfx.h | 2 -- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 7abe272ddc0d..e02ebc39ed41 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -671,24 +671,6 @@ int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, return 0; } -static void wfx_set_cts_work(struct work_struct *work) -{ - struct wfx_vif *wvif = container_of(work, struct wfx_vif, set_cts_work); - u8 erp_ie[3] = { WLAN_EID_ERP_INFO, 1, 0 }; - struct hif_ie_flags target_frame = { - .beacon = 1, - }; - - mutex_lock(&wvif->wdev->conf_mutex); - erp_ie[2] = wvif->erp_info; - mutex_unlock(&wvif->wdev->conf_mutex); - - hif_erp_use_protection(wvif, erp_ie[2] & WLAN_ERP_USE_PROTECTION); - - if (wvif->vif->type != NL80211_IFTYPE_STATION) - hif_update_ie(wvif, &target_frame, erp_ie, sizeof(erp_ie)); -} - static int wfx_start_ap(struct wfx_vif *wvif) { int ret; @@ -896,24 +878,21 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, } } - /* ERP Protection */ if (changed & BSS_CHANGED_ASSOC || changed & BSS_CHANGED_ERP_CTS_PROT || changed & BSS_CHANGED_ERP_PREAMBLE) { - u32 prev_erp_info = wvif->erp_info; + struct hif_ie_flags target_frame = { + .beacon = 1, + }; + u8 erp_ie[3] = { WLAN_EID_ERP_INFO, 1, 0 }; + hif_erp_use_protection(wvif, info->use_cts_prot); if (info->use_cts_prot) - wvif->erp_info |= WLAN_ERP_USE_PROTECTION; - else if (!(prev_erp_info & WLAN_ERP_NON_ERP_PRESENT)) - wvif->erp_info &= ~WLAN_ERP_USE_PROTECTION; - + erp_ie[2] |= WLAN_ERP_USE_PROTECTION; if (info->use_short_preamble) - wvif->erp_info |= WLAN_ERP_BARKER_PREAMBLE; - else - wvif->erp_info &= ~WLAN_ERP_BARKER_PREAMBLE; - - if (prev_erp_info != wvif->erp_info) - schedule_work(&wvif->set_cts_work); + erp_ie[2] |= WLAN_ERP_BARKER_PREAMBLE; + if (wvif->vif->type != NL80211_IFTYPE_STATION) + hif_update_ie(wvif, &target_frame, erp_ie, sizeof(erp_ie)); } if (changed & BSS_CHANGED_ASSOC || changed & BSS_CHANGED_ERP_SLOT) @@ -1237,7 +1216,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) complete(&wvif->set_pm_mode_complete); INIT_WORK(&wvif->update_filtering_work, wfx_update_filtering_work); 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); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 5e1a763eb4b5..f56a91ea082d 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -104,12 +104,10 @@ struct wfx_vif { bool disable_beacon_filter; struct work_struct update_filtering_work; - u32 erp_info; unsigned long uapsd_mask; 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; int join_complete_status; struct work_struct unjoin_work; From patchwork Wed Jan 15 12:12:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D151C33CB3 for ; Wed, 15 Jan 2020 12:13:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68784222C3 for ; Wed, 15 Jan 2020 12:13:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="GPuGcuA/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731109AbgAOMNY (ORCPT ); Wed, 15 Jan 2020 07:13:24 -0500 Received: from mail-bn7nam10on2047.outbound.protection.outlook.com ([40.107.92.47]:27390 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730843AbgAOMMt (ORCPT ); Wed, 15 Jan 2020 07:12:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X9bTpbzRcSkJOwKjRAW7u58cqaX4QC+cLw2UrA7/r7kCSZIoewOx0PruvjK/GPYfH96KLNwDVd2gVPORueLeOm4kbfvNP7oAV6Ly3BRaBdFeStzznoTSjp8XjjjQk1gDbg0UmuIuc+Bf8y0i3FjKxKlR/1GBhlJHRZninoL9kKbdmYCglaLzQC3xCuiUOyrK2h1++8ZB0njKRXmaFJ3+VnaCH2aoNBGwIBk8g6C7Eyitc3pBffPwJX4NPkY98ulFpC/Y0obUyIs6/gAwqaaBbtVtxSmDkk2uiBSQ6d1OJ7M5YD0+n+ZlJHkYvfs/xMyZjGspLfM6o4oVLtxrKFdtYg== 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=tvHPtKXlsvQwnf5lOZyIuOjtMJUoc4RQcmbJFZUNCiI=; b=a4zEUW9yonr6m9d1gksT2rPQzcZo4Ml3KwpPpagH0MPXBmBjmPShu9yK1SjQ1X3sPtxS7Wg/naAAkxmS6FLjqx9yBgGonMaTx2f++9gT+KvovziG1faX9XlDo9oNSJJAgMru0ZK2M2wIv+TPG00K7i6iq6qb0ZhekH1lUTduZ5Bso4HDe6aXRzTVdVLbdtN2VPN+sqqqa4m81sKjfPFZpNNZwuZpUPy/xB2Iie0JMSWaO36KGdv5vOWfYldlOTTOy1GXcDwP5hCJqhOfiRJcRUg2HWukkHOrfI5MUzv3ewpEVA9D1hd0r8FiNvx3IwN7GjAk82AmF7OYDKFatioNfA== 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=tvHPtKXlsvQwnf5lOZyIuOjtMJUoc4RQcmbJFZUNCiI=; b=GPuGcuA/Jq7Y0ydO991eFqz0hhtE8X0mzdOWH9B4L6yJ39+MyG7KC6xWAlkauzL1p5u8QqVMyMZb/gq2MAjWJWjFWtaWosTn0MHtm9srLQC84JHGzke3O2iSs5eCT3D25XIaYiuGB5zn6uS+0AojrQAPy6b8iy1ta4H50hyzMFg= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4096.namprd11.prod.outlook.com (20.179.150.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:12: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.2623.018; Wed, 15 Jan 2020 12:12:45 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12: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 27/65] staging: wfx: SSID should be provided to hif_start() even if hidden Thread-Topic: [PATCH 27/65] staging: wfx: SSID should be provided to hif_start() even if hidden Thread-Index: AQHVy50YjeNNjquSUk2pE0qCTN+9EQ== Date: Wed, 15 Jan 2020 12:12:45 +0000 Message-ID: <20200115121041.10863-28-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bdb0882c-3d32-450a-abb6-08d799b43a7a x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(366004)(376002)(136003)(199004)(189003)(85202003)(66946007)(66446008)(66476007)(2906002)(107886003)(66556008)(4744005)(1076003)(64756008)(5660300002)(8936002)(6486002)(186003)(26005)(8676002)(316002)(81156014)(36756003)(52116002)(2616005)(7696005)(478600001)(16526019)(956004)(54906003)(110136005)(86362001)(71200400001)(85182001)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4096; 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: lf5/5CKDTB49xdvsgXo6lim722nmlwBQg9maoQ+IFFSfetY2pRF0xsogqYoWmz0rpPw6dRJAhU7N000FJkus/xMGysKte5oiVhUA9vePL8oTCPJ7FMOZulSZckbMD0ybsC1SyPMgMnK1RG1LurMjp2zCAS854VNelmmerwyA3MLDFJPRwkDirMToBP1vLs3qE2xIJ4uWn0cUvKX6vMkRSQhtD2NZr4AfIqKb7aaTz9SnDS1Gmnb8Gz4tFTGWkEQUvfDO61aU6NhlHEjVzU3OAYv/enjn8UE9ut74xRoqqytTtHC0qHo/EKMoNuWnn8MKGs2F2NvPvDpGXkZVIXXm4oTrY6aGmPtrKnhnmd4muTxa1B9ufvL8nDyKsA3bun3x6X2DiM8Unvcn20eBLRxFsl4OvG3N9//Rz2OGNU3OFLQHIWBtKJNRhncYjpxVIbKf Content-ID: <08CF7DD9E031CE48B2A501D84D602C51@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdb0882c-3d32-450a-abb6-08d799b43a7a X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:45.2184 (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: DTJ8DoAzVrP9+CgYlT8lEs2o5tihZE6N/xLDAwvgBoXI31v2L2z92vmGvLE+SGUXGUbqV7LRnGVK924+Y8V4rA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4096 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller SSID is hidden in beacon but firmware has to know to which probe requests it has to answer. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 2d541601e224..8df6e43fe742 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -422,10 +422,8 @@ int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, body->beacon_interval = cpu_to_le32(conf->beacon_int); body->basic_rate_set = cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates)); - if (!conf->hidden_ssid) { - body->ssid_length = conf->ssid_len; - memcpy(body->ssid, conf->ssid, conf->ssid_len); - } + body->ssid_length = conf->ssid_len; + memcpy(body->ssid, conf->ssid, conf->ssid_len); wfx_fill_header(hif, wvif->id, HIF_REQ_ID_START, sizeof(*body)); ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); kfree(hif); From patchwork Wed Jan 15 12:12:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216658 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F6F0C33CB2 for ; Wed, 15 Jan 2020 12:17:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1B2F1222C3 for ; Wed, 15 Jan 2020 12:17:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="bAu4Ylja" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731399AbgAOMRi (ORCPT ); Wed, 15 Jan 2020 07:17:38 -0500 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:6048 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731124AbgAOMN0 (ORCPT ); Wed, 15 Jan 2020 07:13:26 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pn/FMUccoWhlTyXuaS4IOqRdA8EkoUmzG/Y2d+ULevHUorhDGu/gQTg/mr4IeBUVdi+pnV3JF7VueKinVHKMMcqaLk1IvHaOEBTySeapbvXNSdtPrsIquG8LrURAj5kulVe+NxoZTaA5v5SsowGmYpx112rNM3EgDtylYAkD4xgOvMDIYwSvWVGlLV7MHHK0lAWs2mybrVecrkCSEKr2RvpIIOKtFBt1nsMGsw5Ewc+msWEpNLR950hU0ZBm+VQ33K/jrb1nvgbfDS0xLEjBuivR2Gaw20yNu4rxCcAroaEyMCc5WIb5CPTtnOXXcImPNnH3SIjs/m7Bn1E2SVEbng== 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=A2/Jm6w1JZAbFd2GIhM4GZMXqZt/BV+Jj6ZkQwLi2xk=; b=Mt7ZBONgR7sz6eX1RBSPcxXdRI2Kkj4mZXPLBR1HmV1c1b3C/ir+MdM9hprwjVAgQgXn7at0+LVEHvhChgbWJ5l9Cn3fFfQ+zuHUCzKYcj9Und7INBybVWJa3hf1kcI/u49OW/9F9oqN9koLOpHfbk7IFLXwm1CIAynvlSq7O1U+EbLPHaEnL8gRiACvMsfaveetKCZfULKqTAnoUgPoY9DK2w/dPGQODSSRogua91dpSVAB1B2RC7Vs1URZl3GNol7JSDhJlG/QlqQxuRuySktWJCi4kl9K7nYWjwvQdwmZmyRSlR1dMz5o7O6DzVhWELjiFi3xVOQGNU/Q7h78Ig== 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=A2/Jm6w1JZAbFd2GIhM4GZMXqZt/BV+Jj6ZkQwLi2xk=; b=bAu4YljaYh8T2MHPAMWFXxB3ixM2Doc4/cXWIJXpj+k8GjRAi8fqwMZX5kalhbgXxlHqo80kh5+xlLiRGSmflmHgrmS0eFtaOF+CMoXvuclI23Z44/EXlisKSgrkckJq7qhyrgiZBoz79EkCsr8gNHKr5qa5xb1stqUYVYHFpbk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4096.namprd11.prod.outlook.com (20.179.150.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:13:21 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:21 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12:52 +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 33/65] staging: wfx: simplify hif_mib_set_data_filtering Thread-Topic: [PATCH 33/65] staging: wfx: simplify hif_mib_set_data_filtering Thread-Index: AQHVy50c0vdkJWjWbU+56y4sJ/OM1g== Date: Wed, 15 Jan 2020 12:12:53 +0000 Message-ID: <20200115121041.10863-34-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 312ec85e-983a-46c0-3f92-08d799b43f3a x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1091; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(366004)(376002)(136003)(199004)(189003)(85202003)(66946007)(66446008)(66476007)(2906002)(107886003)(66556008)(1076003)(64756008)(5660300002)(8936002)(6486002)(186003)(26005)(8676002)(316002)(81156014)(36756003)(52116002)(2616005)(7696005)(478600001)(16526019)(956004)(54906003)(110136005)(86362001)(71200400001)(85182001)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4096; 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: o54hdyBVLjzMCmRmesKdVVZ4yRXsqA+GQKtwPIaK021FswYsw7Fy0RfGcSjVzbrlZrbptqTX1WBXODAfv26Kc4HDEIaugzQCpKsU6YlnJHXRwB401A+y//CSb+OQuf5Nv+wDB1acD986yWjKz+cJjc5UcoaMP3mnKYcYM5lyCuhLJWMX+YBO4VV/A9hc+dHqe+A9iLIHBqSA8nNMjCedjfcHcwtBuZSNl81h2sD+zipsDycwdmuDBGBjC/BPATnHmaZurTVYbgyS8ABJmO8WGz4liyOstyktF75ZRs/y1oZN9CV6Z6iwUys1ZoQWWaYWzquwb3OIjngkZSLCwbYwVRA7mNWDoe7OgOq4XP+U0/HnqU1I/ACSdNZ4oFDffDq0JNHD8HVc8D3j+1th/A98ZOEog8EH4vEO2AZVXk6vKOthVS7SbNC9rmIOUwdx3wBi Content-ID: <5F6F0D71D8A3A64DA79AA88675271063@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 312ec85e-983a-46c0-3f92-08d799b43f3a X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:53.1848 (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: ZPvBcMgLcdDtDXmzCqaHjT4RsrTI2aWqFW/kAQ9ohwhezmqJEOO9GV2Ib4DJXZ97DbOnUYN7aQl+Tq5y2AFClQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4096 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The field "default_filter" was not obvious. In add, explicitly declare that fields default_filter and enable are booleans. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_mib.h | 8 +++++--- drivers/staging/wfx/sta.c | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/hif_api_mib.h index e0ef0337e01c..0c67cd4c1593 100644 --- a/drivers/staging/wfx/hif_api_mib.h +++ b/drivers/staging/wfx/hif_api_mib.h @@ -206,9 +206,11 @@ struct hif_mib_config_data_filter { } __packed; struct hif_mib_set_data_filtering { - u8 default_filter; - u8 enable; - u8 reserved[2]; + u8 invert_matching:1; + u8 reserved1:7; + u8 enable:1; + u8 reserved2:7; + u8 reserved3[2]; } __packed; enum hif_arp_ns_frame_treatment { diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 1c1b5a6c2474..27248ea62aea 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -154,9 +154,8 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, if (ret) return ret; - // discard all data frames except match filter filter_data.enable = 1; - filter_data.default_filter = 1; // discard all + filter_data.invert_matching = 1; // discard all but matching frames ret = hif_set_data_filtering(wvif, &filter_data); return ret; From patchwork Wed Jan 15 12:12:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42412C33CB1 for ; Wed, 15 Jan 2020 12:17:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0FA20222C3 for ; Wed, 15 Jan 2020 12:17:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Sn38m4k7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732451AbgAOMRK (ORCPT ); Wed, 15 Jan 2020 07:17:10 -0500 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:6048 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731301AbgAOMNc (ORCPT ); Wed, 15 Jan 2020 07:13:32 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kFT8VjBlFUcb+O1keJWFGa7gntfpQQNHsKkaQVYCfv5By1hzdvRG31alPQqIhQx2k7JylFj8e0wfe46Ylcyp4xOUizGWVWX6KmIIQJa/JNRaqLjf6WXC3OO4JBmE9mUrL0rlQwwQOsJhBHuYLW/eVO9qR5pVP3wYNCUo/TpIhB4iFpWZWTuj/F60ipi+HR/783NQAaUTaXojN2UyowdBuURs2ALc3hBdy4D2vjqE/uOyUtv7gvI9ytMynMa8qb1mZwXdcLitRgYSGC+cdzN1QKQkn+aZhLTvi+NZ/boUQcbALIa7vBuI6qp1tRmLG4/ceMIF0TfxGK8xaBiZbSWN1Q== 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=NyYErm/+SiSh/FDrosP5g9wl3yLmrIQ5MCjg3/oJYyg=; b=MiwEdcxj8FoQGgkBbbXK9qA91bvik9jJt5LQV3NwI70smlScr3o/mKkIVRy3YnlDN518lFGcr0hEDSyX6Yu6f0RpZTHiOZ0qRGi3XtwzSRmTMD+1dX1i3AHQuEfgtjpit4fFbzRUofmr+UQIIXUcHzF0rD7pFuXcPxUsc5htOom4Pm9wuEKXqV7MgTinlHrEfIRD0iv2Q9HI1xZ6U+2DykGEys49gLiu4TO9IuE/XnLpbAoIuJDZprPyNTvZ6V8nTkeXh4gObhj5KzH98oWugz8vI8Hd0ytEZeGyvqGxB6JgOcWebiE42Sa+tMxKCvu6ExVqiugMiR66BoOkgcEBNQ== 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=NyYErm/+SiSh/FDrosP5g9wl3yLmrIQ5MCjg3/oJYyg=; b=Sn38m4k7s6Bsd24oxsf2i6A3hpQm+BGzIgCgSN3l/Q1LRB2DDZLmCPEsciuEg5IpUHdAdP19ZDopEIwB2suVwsXIaUAjiGQcyxO1APsMHtdhk2fFesJx7vVxNZl0UnZ37t5YE8DhQUdXwO8qK7yUhIGwYwyr/FirgVTB6zpvFwk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4096.namprd11.prod.outlook.com (20.179.150.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:13:23 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:23 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12: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 36/65] staging: wfx: simplify hif_set_config_data_filter() Thread-Topic: [PATCH 36/65] staging: wfx: simplify hif_set_config_data_filter() Thread-Index: AQHVy50fkq83Hb3UakCQCbvjcwuX4g== Date: Wed, 15 Jan 2020 12:12:57 +0000 Message-ID: <20200115121041.10863-37-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 565ea02c-eec3-4fcd-e54e-08d799b4418f x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2887; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(366004)(376002)(136003)(199004)(189003)(85202003)(66946007)(66446008)(66476007)(2906002)(107886003)(66556008)(1076003)(66574012)(64756008)(5660300002)(8936002)(6486002)(186003)(26005)(8676002)(316002)(81156014)(36756003)(52116002)(2616005)(7696005)(478600001)(16526019)(956004)(54906003)(110136005)(86362001)(71200400001)(85182001)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4096; 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: mGioZBYYrhexDzbuwXFUqxH6M7nNmCCevlZRMU+INUGK+LyIGhiNfNBOsquNGf4kYQ0UwEhjcvB/pUikRukjZkpvmLai444yyhEPqLxmI2P7yzhaY6SqxNEBaCoNcN6BVTTm8RNsAtoZin2NULIGqMpt0BY4UiLRJdVygia2KTzj0CqRQzxUjffq48ldF18JkQ4j7qluoSdunB/yAjBql3JXhtNUZw3Z7ROhZm3s14GCLwywQ9HXNEMicxwD2X+mQ6Hbqr8g3Aa5r/jDwrP265hOY4vW5QwLuxCmGbUuqB3WzErkeQhO8VDD4jJAyI8dyRM91lACnlnxSYkKqA8454Fr62P+JCcmlRYQUVA/jBWF/FhABlmMwb+o500QJOhSZrdZe/RFNh3iXuLrUTnWvJca2y94+qZxLxVoUTup+jMVOOuFhimKGqdLoxEKpLS8 Content-ID: <9A3D5CCB791FDF4DA6955F6403DA68A0@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 565ea02c-eec3-4fcd-e54e-08d799b4418f X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:57.1075 (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: ZA71KEhminT6buNxRyPBHEZhUAGF5xphcohECBvS0p1M8PjBvX3tSFn0NJ+z7zzBxO0cRfqdDrz22MZ9Tolm5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4096 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The structure hif_mib_config_data_filter come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_config_data_filter() is too dumb. It should pack data with hardware representation instead of leaving all work to the caller. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 14 +++++++++++--- drivers/staging/wfx/sta.c | 8 ++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index 90474b1c5ec3..ccea3f15a34d 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -265,11 +265,19 @@ static inline int hif_set_uc_mc_bc_condition(struct wfx_vif *wvif, &val, sizeof(val)); } -static inline int hif_set_config_data_filter(struct wfx_vif *wvif, - struct hif_mib_config_data_filter *arg) +static inline int hif_set_config_data_filter(struct wfx_vif *wvif, bool enable, + int idx, int mac_filters, + int frames_types_filters) { + struct hif_mib_config_data_filter val = { + .enable = enable, + .filter_idx = idx, + .mac_cond = mac_filters, + .uc_mc_bc_cond = frames_types_filters, + }; + return hif_write_mib(wvif->wdev, wvif->id, - HIF_MIB_ID_CONFIG_DATA_FILTER, arg, sizeof(*arg)); + HIF_MIB_ID_CONFIG_DATA_FILTER, &val, sizeof(val)); } static inline int hif_set_data_filtering(struct wfx_vif *wvif, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index b74e0ce41069..e71b99aa1f63 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -117,7 +117,6 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, struct wfx_grp_addr_table *fp) { int i, ret; - struct hif_mib_config_data_filter config = { }; // Temporary workaround for filters return hif_set_data_filtering(wvif, false, true); @@ -129,7 +128,6 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, ret = hif_set_mac_addr_condition(wvif, i, fp->address_list[i]); if (ret) return ret; - config.mac_cond |= 1 << i; } ret = hif_set_uc_mc_bc_condition(wvif, 0, HIF_FILTER_UNICAST | @@ -137,10 +135,8 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, if (ret) return ret; - config.uc_mc_bc_cond = 1; - config.filter_idx = 0; // TODO #define MULTICAST_FILTERING 0 - config.enable = 1; - ret = hif_set_config_data_filter(wvif, &config); + ret = hif_set_config_data_filter(wvif, true, 0, BIT(1), + BIT(fp->num_addresses) - 1); if (ret) return ret; From patchwork Wed Jan 15 12:12:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0455AC33CB1 for ; Wed, 15 Jan 2020 12:16:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6169207FF for ; Wed, 15 Jan 2020 12:16:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="o1f3fcQA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731505AbgAOMQd (ORCPT ); Wed, 15 Jan 2020 07:16:33 -0500 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:6048 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731380AbgAOMNe (ORCPT ); Wed, 15 Jan 2020 07:13:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TCg8fCw95yLkxyQ0PRDgyDfFm1XyC2AbpBicsV6xE2uqyw7xe9GXYwSEybOA3D9jWdnFPzw+DvbC00U3DwShJg+eIs3mzVMUdc1Gs70jPiiwllMMm/ENRRzgDE+OxeFBA5gxh4QGftWuaRmZs/h1PVo/VRPFS0lZeJIhUi2LRn48jjcs0LNklCE0pSpxShtRoQ/yNQfsgzSLDn+k5yfPbilQ3cAljlmR8tcJXP1V7/igPKZ6Moa2ES9qxQvxx8N6m+xlKNtzzqXdEN2uN8aReP/xbgOoBVkDOkZFC33VCORgi/gu2x1g8N5Bly/3/CO0EaPc76t2nN6VKfyb4yP5dw== 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=+r+hH6i8d3N1IAb/CKSuC2M9LsNeoz8vnFD1h6dEiDg=; b=SEOBk7oU7/SpoTfFyQnW7DQMqUekPuJQVuCDYlIIebbyq8bT+JqajIGgA2B7rCKO5HIuIF8xmleYQLRhtoqoKaALMVNaGqrzMDDDJ6TVHvzYMpwsuVnz6Uf3JFfJUxxp6f8nmwR6CbTWqqiSeZP1H2H/V8t5f0+dCBOr7vlQWthwzOytkFmHIzcIrR8W3FUCPVksg5SXqU+pPI9YzecZXmjhwZQlvUZII5Ooi5d/sfrLNOjGZFGeSAUmP/TJbWay9ilmihMeWFRnFyKKwpEZJYbumrsqCjj497akcCuTnKzRkGqwBIyUScjlYOzvFS+YyTq53JmLEW0sKv21YRDt7A== 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=+r+hH6i8d3N1IAb/CKSuC2M9LsNeoz8vnFD1h6dEiDg=; b=o1f3fcQAwWkUgpGIl6rAFvGQIEwnmgWOpMP6AWH6cY6meQRNV9nJmO5yBBchfuEQ67Pxttw5tR/p2L6fQv/lfRG/KX2SDIsyASjSgn3QUmp/cZyXYYFnj0dz6PkJCmdA2i+12lyhxX6DGJsd3/pES8egwfB9gqNl8S97rfpX03Q= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4096.namprd11.prod.outlook.com (20.179.150.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:13:24 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:24 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12: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 38/65] staging: wfx: simplify wfx_update_filtering() Thread-Topic: [PATCH 38/65] staging: wfx: simplify wfx_update_filtering() Thread-Index: AQHVy50gmE8hFxRoREC7HU8Jsv9+fA== Date: Wed, 15 Jan 2020 12:12:59 +0000 Message-ID: <20200115121041.10863-39-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 45dbcff9-751c-42c6-1739-08d799b4431c x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1051; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(366004)(376002)(136003)(199004)(189003)(85202003)(66946007)(66446008)(66476007)(2906002)(107886003)(66556008)(1076003)(66574012)(64756008)(5660300002)(8936002)(6486002)(186003)(26005)(8676002)(316002)(81156014)(36756003)(52116002)(2616005)(7696005)(478600001)(16526019)(956004)(54906003)(110136005)(86362001)(71200400001)(85182001)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4096; 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: 0poF44AWJ/9kBC8BtCiJsWsars4LnQm5ig5eCFqBakDUrAiP5rrjtDSLpTEKlQfpAgBqjGYw0Qf3WJ0gK6uLPMUTAAqkqLh4iH1MWI49J5abHDLIPPcOWV3uc08dW1byvO6sh1qbykTqdbozJZg1XTb3AknH3xt2brd1SgG5zoMTd7mCy/LiqM89V1fY4COO8zo102ii2ne+bQ+0ro/bUDBuDM4l2vsqVEjKVQr0Ij5jcspKZhwHCB6nrko0VI0Mg8j/bgTcbkmfq9hxfKbGFRhxlk5YSaKuvnbezViRTdKT1Z778DN0BiSFs8zL9swijs7NF/myqWNoLlRGS+jMcdnz6vgiX5REk4Ocvjxy9eWf9Vd3+JHLt81hysFDzjfCT4ehniw3vPqfS7DC431LTqf0pcB5UBEXeo08N7x6TGGOGcwTV0MTUNcsOlG7hVkY Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45dbcff9-751c-42c6-1739-08d799b4431c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:59.7050 (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: iYzGDwfqFyK48NSBFtBgIoZ9WMKovooRidRC6cSLDaa8oDBhjgcnWZgiz60271EIsuSh9WprwNwVt54V7sxFSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4096 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_update_filtering() has no reason to instantiate a struct hif_mib_bcn_filter_enable. Drop it and simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index a934f66f3a4c..0c3150a94c7c 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -138,10 +138,9 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, void wfx_update_filtering(struct wfx_vif *wvif) { int ret; - bool is_sta = wvif->vif && NL80211_IFTYPE_STATION == wvif->vif->type; - bool filter_bssid = wvif->filter_bssid; - bool fwd_probe_req = wvif->fwd_probe_req; - struct hif_mib_bcn_filter_enable bf_ctrl; + int bf_enable; + int bf_count; + int n_filter_ies; struct hif_ie_table_entry filter_ies[] = { { .ie_id = WLAN_EID_VENDOR_SPECIFIC, @@ -161,33 +160,29 @@ void wfx_update_filtering(struct wfx_vif *wvif) .has_appeared = 1, } }; - int n_filter_ies; if (wvif->state == WFX_STATE_PASSIVE) return; if (wvif->disable_beacon_filter) { - bf_ctrl.enable = 0; - bf_ctrl.bcn_count = 1; + bf_enable = 0; + bf_count = 1; n_filter_ies = 0; - } else if (!is_sta) { - bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE | - HIF_BEACON_FILTER_AUTO_ERP; - bf_ctrl.bcn_count = 0; + } else if (wvif->vif->type != NL80211_IFTYPE_STATION) { + bf_enable = HIF_BEACON_FILTER_ENABLE | HIF_BEACON_FILTER_AUTO_ERP; + bf_count = 0; n_filter_ies = 2; } else { - bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE; - bf_ctrl.bcn_count = 0; + bf_enable = HIF_BEACON_FILTER_ENABLE; + bf_count = 0; n_filter_ies = 3; } - ret = hif_set_rx_filter(wvif, filter_bssid, fwd_probe_req); + ret = hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->fwd_probe_req); if (!ret) - ret = hif_set_beacon_filter_table(wvif, n_filter_ies, - filter_ies); + ret = hif_set_beacon_filter_table(wvif, n_filter_ies, filter_ies); if (!ret) - ret = hif_beacon_filter_control(wvif, bf_ctrl.enable, - bf_ctrl.bcn_count); + ret = hif_beacon_filter_control(wvif, bf_enable, bf_count); if (!ret) ret = wfx_set_mcast_filter(wvif, &wvif->mcast_filter); if (ret) From patchwork Wed Jan 15 12:13:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CF95C33CB1 for ; Wed, 15 Jan 2020 12:17:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE1D0207FF for ; Wed, 15 Jan 2020 12:17:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="hWoeHkwd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731652AbgAOMQz (ORCPT ); Wed, 15 Jan 2020 07:16:55 -0500 Received: from mail-bn7nam10on2085.outbound.protection.outlook.com ([40.107.92.85]:6101 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731304AbgAOMNd (ORCPT ); Wed, 15 Jan 2020 07:13:33 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PDyTyk9vLjtwuwpQx/+LwZr88OZM/k6SCZdAAbbwx1vYvMgV2bg2XupcmTO+83Zaef+qMDISNheviOkYwV+YFY67/oMcdBcl8kJffSeJ1uZ2NlfLrSrkymEc6wbVXYqEwtLhJDBt/z6zSwWPfqXUFZ1euf8ie6pay31nPx3sEFKD6SPJZK7PLHI21zkVSw/zecL20yOchU9ojoPiiskYGUCx0i5JgRHkjpL+/+6rugkX+ZueCGe0Xj9nY2oYOLVwcyFeHpot4OZXHlJFtnlQVNgR+SspgJ1gWEovn6avwcbF0V0OHAWHakv2qrH11vzIkDPn7/g04RrgbAmOTmah2g== 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=dyYeovap0+RlWylFVGyolLwgpnfFNImokIBu+J3RC7k=; b=Bk/B59DBpUor6oocZpujrWBw2YWavj2rDBAs6aU62pcs3ceNQotl0Y6Y5W6ExATF4XIv9AxrnQQE909vLUB4/Tk6C+AuYQW5rP5n0OFzGLqWIr49A6y1dt9qHbzYo0xpcHyS1OOy9Ud4JHTb+KFeTxEafOsunImejx2AuoxByhDYPfTv48fg2Zt8IteEBMXfNNnvGCwZAcG51X7VqWtUdYP+jMoP9uBhgzL/LixxmiTlDCDnwkqlvUSYfEiuIbH63qZd8AYOxKNZ2j5RNIwN+GruIQuINeMcCgHWOyBnb5LHwvGKVisRobGLmguHfar7AgKzkuZTWLATem2rWtZtmw== 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=dyYeovap0+RlWylFVGyolLwgpnfFNImokIBu+J3RC7k=; b=hWoeHkwdYAw84Bw+5zlJoIvxUJXLdR4q9ljd6fGwNb5zLfjnTP+EFTgT24f5whhAcFX/rCEA5MPGh1NtssAZNKYWIyBbFuuJ3hoCmuY58A5N5+Zfqsp0bYKiX1JInmwqSkFwf4uJhMkuHQd7S4tP6itZUdaUcsXAMFUy+43CRWo= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13:26 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:26 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:01 +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 40/65] staging: wfx: update power-save per interface Thread-Topic: [PATCH 40/65] staging: wfx: update power-save per interface Thread-Index: AQHVy50i9glpmyHt302vrCTD6a5IRw== Date: Wed, 15 Jan 2020 12:13:02 +0000 Message-ID: <20200115121041.10863-41-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: efa3bf8a-eace-4c16-2ee7-08d799b444ab x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003)(60793003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qdWwfoOnhVUL9FL1CxB2ekQ5KH+pCMHajdNIk287eptjvPegaqxlF2Z/oJu7QAXchj7XZBwqB/tGD5FSvhZfwaDS50tf9gs8c0Epvv2HEnnmeCM4SJSCJnUAimng5DTkv8nuHHI6LADRz2if4sTuGY46benDJKD9oUny8U8wkJCeRqCaoY0e5hHk6sr0lvVQVbDZW2Cpllcp6ZH9TL13ovptEeXRBNmSYicQYXAf0oqFagzQeIj1YTjpvIm800GqJ6+A3N2qsC5FePfaGR8B0iqRON/wABk3Lc3uoTcSNau10J9G1FjFaWEXdmjyukc80YWxPckOtHMROEBycIseD6KYsv840ulcoQMPBlrjsIqIU/KvYi68Tuz3TRY3df8QxReiMST+Oj0Kwhdpx7G4IWfVzxwsUfYGnFu0QrGxa8Q8YCC3zjib0C+MV7EEMluD4vwmVFDxXDwLPAxyvEG14pIAQJkyhqXb6WbHb9IAwYw= Content-ID: <5C799CD8486500429F58F7BABF31182D@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: efa3bf8a-eace-4c16-2ee7-08d799b444ab X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:02.3215 (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: 6MqGMlVk8U4dvW/+2A2FRQuQz+3B1pP47Ew3oYMPoA/l07hytr64/xNo1wcHnN1V8Z3gauiT7zturvt15kmn0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller mac80211 and the device are both able to control power-save per vif. But, the current code retrieve power-save from wfx_config(). So, it does not allow to setup power-save independently for each vif. Driver just has to rely on wfx_bss_info_changed() instead of wfx_config(). wfx_config() has nothing to do anymore, but we keep it since it is mandatory for mac80211. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 2 +- drivers/staging/wfx/sta.c | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 1904890c03fe..84adad64fc30 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -131,7 +131,7 @@ static const struct ieee80211_ops wfx_ops = { .stop = wfx_stop, .add_interface = wfx_add_interface, .remove_interface = wfx_remove_interface, - .config = wfx_config, + .config = wfx_config, .tx = wfx_tx, .conf_tx = wfx_conf_tx, .hw_scan = wfx_hw_scan, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 0c3150a94c7c..94683a1440c8 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -826,6 +826,10 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_TXPOWER) hif_set_output_power(wvif, info->txpower); + + if (changed & BSS_CHANGED_PS) + wfx_update_pm(wvif); + mutex_unlock(&wdev->conf_mutex); if (do_join) @@ -1058,18 +1062,7 @@ void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, int wfx_config(struct ieee80211_hw *hw, u32 changed) { - int ret = 0; - struct wfx_dev *wdev = hw->priv; - struct wfx_vif *wvif; - - if (changed & IEEE80211_CONF_CHANGE_PS) { - mutex_lock(&wdev->conf_mutex); - wvif = NULL; - while ((wvif = wvif_iterate(wdev, wvif)) != NULL) - ret = wfx_update_pm(wvif); - mutex_unlock(&wdev->conf_mutex); - } - return ret; + return 0; } int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) From patchwork Wed Jan 15 12:13:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216664 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDD14C33CB1 for ; Wed, 15 Jan 2020 12:16:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88086207FF for ; Wed, 15 Jan 2020 12:16:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="d1mjQDjH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731519AbgAOMNi (ORCPT ); Wed, 15 Jan 2020 07:13:38 -0500 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:33252 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731359AbgAOMNf (ORCPT ); Wed, 15 Jan 2020 07:13:35 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f+iZ1MI26p4qjhTv1/zcjmE2mz+aqLiukqIROtqj8B92PRRVM6JW+Mriogr1wh/MV8Lq1Rj2mmeURKfYOxtenLiV+xJPHWcEWFRZoKwdDjzW6o6qTJlffAE8sbyaC01z/CwizA+Pb4XgE7GIXWTyMcIrNiRjC8L5I58yaG3GAggjg/ZBuGxHF59RcLRXvvt3CttE8XuuRQzV2zlMgNDCTkpk/VTT5fIGJrsrrsQ/uQW2eGsi3AiuA0vwsY0W5C2TDXLuXgYLW5srw0IIESCUHPi+q4rN3uYIf/p4FI5NfpXGcyG0w8uRT9/04wAt2vJ0qMHpDr/TXi5rnFdIbExD1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MGqfP+Bn6ViYrv+vCujkkmwbpYVEsmfRDXGsJC6g80s=; b=jhQNvJ+96i44rxygzyKYXtcEPaQYFOuyvQT2+ThDBwZY3a3CO2wy72iFmMjD2SUKSw7Iy1KDFEIwdkICHxe/cPNqGBxyAJzTPa1xbT1f0TnWLhtlAbXiPGzZWkw3mT+Bicl3VrXx/iGWtnbE3NffzNktiWqkI8God1f9OL1w5LylxTHvwFE4IVdQTdxH+e0n4Itfsyc6YyyVbiwH1P3H+Ecpq0YfSMA/ybeL8qQurXWV4ZIJgTueacJ2ZJqsljGseWpSYoOE+BRVFkgau3F1NiW+woFvmJAdXqS23rSXf7ZMvgwr462kIY1FcnbFvqGm2oTAdh9Lp1cyV7C+cnZ7Jw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MGqfP+Bn6ViYrv+vCujkkmwbpYVEsmfRDXGsJC6g80s=; b=d1mjQDjHMYXW7pseOcQ+a7GRwJht/toJs/c6kAVkm5zRJ6JZdD/ICJOAELxIoCgNheDYBxp1IJVhzp2tpsZu3MB2OSPWCHAld7/05RR6cHnIHaBbTZf9XK7mMHfc/OCNwTj/jjI1KJtjs/swR8GITFrQ0LBe8BuMI6LnKUWMOko= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13:26 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:26 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:02 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH 41/65] staging: wfx: with multiple vifs, force PS only if channels differs Thread-Topic: [PATCH 41/65] staging: wfx: with multiple vifs, force PS only if channels differs Thread-Index: AQHVy50jNHs/r+2QPUSLTwTNLpC5mA== Date: Wed, 15 Jan 2020 12:13:03 +0000 Message-ID: <20200115121041.10863-42-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8f87840e-eda5-4757-a2be-08d799b44574 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DDakmXH9HhhdCt4K6Y0uD57zaegbJdSUnmCu8IgGIjYIqloSyJO1mOrB93LhdIOcZ9U2S50gy3vilq+aQG6oPodlroTCM/k/N/MCkGUqkT0l05bM8JdPHRbaITOnVDbgoSQL2J1dSfC0TgmX2fMc0xUjwxd8LOowqrhUNxJCXmvbjKfNxUg0wfejWnm/kxEmjLpQl0k7hnP4vfj70WsaDxvV5/qQT+I/ph5ERYcgSiG8B748gK6dh0bBgoK4PvqdI/AzWS8ZoYgKv67V/O9sThtg3/zFjRa7zzzlSfkSwVmlAGqT3y2zVr077OcRrgGLVOouzQpH37x5FLeZFLBY8EYF+vE/x26BjRFs+iTH3ycOssJQXYe+rf3PTNlqEuyFMct7DNbgAVMtyB2cQP9Qw7Z/E3JKAbqhJPg8ssc2mDB/r8JXfmndeEEbwXEvlbep Content-ID: <3E7C9B63822EC1499DA40A00A13065EB@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f87840e-eda5-4757-a2be-08d799b44574 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:03.6438 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: wDx2GrZZ7d3dhVFnhU2xCKciA6P/K8brO5Gtdgi3tpzZqqjBU2BiILCIKNRZRnlmf91MsaZZTYg4maMZCvRYrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller When multiple vif are in use (the only supported configuration is one station and one AP), the driver force power save flag on station. This behavior allows the station to leave the station channel and make its business on AP channel. However, this has a big impact on station performances (especially since only legacy PS is supported). When both vifs use the same channel, it is not necessary to keep this restriction. This greatly improve station performances. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 94683a1440c8..bf285389c303 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -251,6 +251,7 @@ static int wfx_update_pm(struct wfx_vif *wvif) struct ieee80211_conf *conf = &wvif->wdev->hw->conf; bool ps = conf->flags & IEEE80211_CONF_PS; int ps_timeout = conf->dynamic_ps_timeout; + struct ieee80211_channel *chan0 = NULL, *chan1 = NULL; WARN_ON(conf->dynamic_ps_timeout < 0); if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid) @@ -260,10 +261,15 @@ static int wfx_update_pm(struct wfx_vif *wvif) if (wvif->uapsd_mask) ps_timeout = 0; - // Kernel disable PowerSave when multiple vifs are in use. In contrary, - // it is absolutly necessary to enable PowerSave for WF200 - // FIXME: only if channel vif0 != channel vif1 - if (wvif_count(wvif->wdev) > 1) { + // Kernel disable powersave when an AP is in use. In contrary, it is + // absolutely necessary to enable legacy powersave for WF200 if channels + // are differents. + if (wdev_to_wvif(wvif->wdev, 0)) + chan0 = wdev_to_wvif(wvif->wdev, 0)->vif->bss_conf.chandef.chan; + if (wdev_to_wvif(wvif->wdev, 1)) + chan1 = wdev_to_wvif(wvif->wdev, 1)->vif->bss_conf.chandef.chan; + if (chan0 && chan1 && chan0->hw_value != chan1->hw_value && + wvif->vif->type != NL80211_IFTYPE_AP) { ps = true; ps_timeout = 0; } From patchwork Wed Jan 15 12:13:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F109C33CB3 for ; Wed, 15 Jan 2020 12:16:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5AC52207FF for ; Wed, 15 Jan 2020 12:16:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="l5VTvPHT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731498AbgAOMNi (ORCPT ); Wed, 15 Jan 2020 07:13:38 -0500 Received: from mail-bn7nam10on2085.outbound.protection.outlook.com ([40.107.92.85]:6101 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731379AbgAOMNg (ORCPT ); Wed, 15 Jan 2020 07:13:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oa40S3DBCy17O4FBAXtobZlZBfhcedFATYhiHVihvWoiiM+f1IRi1M/j9sYZOvan3JgO2yVwpWwn9mO8vGW1Jeg9kgYQ85ewDXacH79tY1G3l/M1+pKZZDmUNZvnacgyQDfiqmC3rPbERuUY6zy5Nw26tOA7FZbqbVxYIxNVLqD2/VeYpjhDR0m2Y59qF7zxQvN9FkE07cEFV0n23EaiVYY+Ouv6SITz/BXcxuIfayKO+TEcoZH1gGRx6/bUvz4Ukk4673G5BDf35QzS2P7IA32kokYMouBtzTyJO3CrF2rMFP6WpBaDb6hgJX7qd5rMhYPt175SXKi9NNCpWzysxA== 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=VRUV34dVR5FpqMHul/yJ0EDmgmWG5LdkxOQALJF4n3w=; b=WSkZ6pKh4QxAhZPgZ7JpIZ6F6eIqS+KDzyKxzulfC8Z5PoGaLjI06Xp7qd2A08EyN9fXwp4evLNm+Pue20XQM4jYQrCRs2Ca2LGvJl1oqYY/8lVixJnmxEGE+TSpxwRTOWHAfkpewCFHl0jjdHiCvFPdkP3w3WH/wvvodiNuVu+OY/xDuDvg0FKItTyrKyKrq3gDKbsoJMw+898rh4ufNKlnMaRfAxJ4XWspNF6U4xno6mcDKGUn+dgtbAp8TwlOf3MMxkkKBqRzw+LQvWWgaAkaON3MpymNjPPcoy9FAO3iDNU8oxNWXLBUvKv1kIEuhRPfngtcqowBABkXoIktVg== 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=VRUV34dVR5FpqMHul/yJ0EDmgmWG5LdkxOQALJF4n3w=; b=l5VTvPHTNEf3onrVUf+ipwJyx9v/5Tdd2L90j6WwEgJPF576Sy9uehG1P2XaYZjKtN3e26zlus/XNs0m3RTr+GwYE2RO7AiGuLFZ0GUD4ez5S9IkTKP49WMX9aFHs6r3lb8pNJrjMYjhkTC9qcBhxf/UXmr6DI46Bs+mrymMXcY= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13:27 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:27 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13: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 42/65] staging: wfx: do not update uapsd if not necessary Thread-Topic: [PATCH 42/65] staging: wfx: do not update uapsd if not necessary Thread-Index: AQHVy50jb5azjf0rhUKUQExZDeVmYQ== Date: Wed, 15 Jan 2020 12:13:04 +0000 Message-ID: <20200115121041.10863-43-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 37cd727a-bc87-4abe-bbb5-08d799b4463a x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3631; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003)(15650500001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dsuFSXiedqcpa+nGXw9sLexhiATHQAT38avBhipqjW+/bePhBth+RYnq5gBdps2kDYOeIYowLQEy0tkDKnn26CN+P+ui9Sf/AcGQMrypxwb73lrvQHYpdPFfSfKFXjrA1JLiB1EDDUr/Nm9/inBUVDaCyabrKRW28XivXHjWJEuaqufr8fEdidXnKvO5mCP/HnP0Z3SQFopWBfZu1GY8Ie7ROUPpHAmc48iLQQ65GqqeIz5C/Yvb05TpJQA+uE//53y3dMPMNeaJ97q3zG1Gl3fV1O5f8w7gXK4yNC6lEbo+vm4PK3Vv9AZ8noXBCsRMyg335IQ9sucTlbRkvZU7lNlNuvkaRbIRHDzCNwd79edXT6Rbuifi5W5TxUYoQ85cMkCJ0RNWYYiZFy0XV6B0YobZq5hW+RgURNR7heCc08sQhGlAaSW1WTUJ2zcd2xAj Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37cd727a-bc87-4abe-bbb5-08d799b4463a X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:04.9350 (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: 5VT88pcmJ4pPQK3YJlTLGApuTgsIPbniXdLkeIJcNj/eDJzaWa8Maa31QzuXc+LkWjYHSeFIOYcGnxxa4mqVbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_conf_tx() is called for each queue. On every call, the function updates UAPSD mask and PM mode for all queues. It is a pity since the UAPSD configuration very rarely changes and it makes exchanges between the host and the chip more difficult to track. This patch avoid to update UAPSD and Power Mode in most usual cases. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index bf285389c303..6a43decd5ae6 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -286,6 +286,7 @@ 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 old_uapsd = wvif->uapsd_mask; int ret = 0; WARN_ON(queue >= hw->queues); @@ -294,7 +295,8 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, assign_bit(queue, &wvif->uapsd_mask, params->uapsd); memcpy(&wvif->edca_params[queue], params, sizeof(*params)); hif_set_edca_queue_params(wvif, queue, params); - if (wvif->vif->type == NL80211_IFTYPE_STATION) { + if (wvif->vif->type == NL80211_IFTYPE_STATION && + old_uapsd != wvif->uapsd_mask) { hif_set_uapsd_info(wvif, wvif->uapsd_mask); wfx_update_pm(wvif); } From patchwork Wed Jan 15 12:13:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216662 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C774BC33CB1 for ; Wed, 15 Jan 2020 12:16:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9245E2072B for ; Wed, 15 Jan 2020 12:16:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="KkBCNfdP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732532AbgAOMQX (ORCPT ); Wed, 15 Jan 2020 07:16:23 -0500 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:33252 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731458AbgAOMNh (ORCPT ); Wed, 15 Jan 2020 07:13:37 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S8JZRa9IuLitV8XepUyNF2tVURV3tfJLOOhX0/YkRCgVXF1nUUhXryW+MRVXQUqGeJCKkgo/SPEzLET8oY7RgcutfgZdp5YlHKHDZ71pLJT+7hRLbj5GnyrCwjpneDmexkfXTDtIsPJqJaF4CiRUn9saZTE0M5PwOEZhi0QQjy4i9OGgV4VaJM+KCqOMtTiUDp0O1l9OeOrHDymcd+jnCgh4fIFzdCBsJhdjry0qnj0liv1LBAPRVjkfcNvZctf47fLDRw1KSJYYzW/+Wt4aTVe7783kkakg24KYfJi5Fecep9D1B6347WSKraRe1UPl1siCTWVCUh47NAJygUIPIA== 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=deqXYivdmrIQ1V4pRuNVzQroye4fOZlmczykJ4IKe6k=; b=kXUxCC9l8zsMYHajV9HdePMrTesmvOWfPkJl5zjK2XCwoVAiPLJcSlnG0jh6ciDJTVLFH3x+i3Sf3hJk4xaueV4nyjU0tcB+On1qOePFkZhdc3XdnJ7sgsOprzwWMdZIza7bFMhe2wwBS+g3vu2qxsizhGJCBzvTsk/jNohVRxmFaJXcx/tTQdPT5MPaYbq/+27g0PLSko5bYWzVa2mD4AzqhNjA5p8tSWSk27Krx2/LknClY6yDuNaATKluIeM+4NP47frnfpAg4NtYIa0hsU63g81fji8EI9Ja1Z9yCjZcJCBlGTxkxiBqx5NqBBJgowddrsBL0G5q12xRs45YJA== 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=deqXYivdmrIQ1V4pRuNVzQroye4fOZlmczykJ4IKe6k=; b=KkBCNfdPcXjVDv2AeGUckCTx7zur7iVIpE6UXk62EXblAOe1V3hVv+l8BjpB5eTPpR97cMnNWsY+INIKn6rfIdvADOXhi7NX31FTM0lcxTS20iPeJKQZ9Xh84d1tfgMpYEX6LgqMEp2BYNJR44+D1BmUYQqBRCO/0NJh8Q6qZGA= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13:27 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:27 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:05 +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 43/65] staging: wfx: fix case where RTS threshold is 0 Thread-Topic: [PATCH 43/65] staging: wfx: fix case where RTS threshold is 0 Thread-Index: AQHVy50kG5G+Faw/0UycvuxK/spbsw== Date: Wed, 15 Jan 2020 12:13:06 +0000 Message-ID: <20200115121041.10863-44-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f5c65040-9760-41a4-49cf-08d799b44701 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2958; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(4744005)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Jf4tpGdOdTO3Ebv1sNh4datFZgdQMLmx2Gtf43AUnqYxhJNiahIBmi0BI+zF1bEZUgqtud4W0N2Zsre5sTVvxysDZ8QKjPzTPRxGpY1Y9DPIOQW/rBdvg1yuOo1OpKGu6xzGeFoZofP7815anw7oyES/fioV147jFdgqDCpF071N64JDaPePoT/BFMB/sDr4d/Nmlk97fKYC77sLCH/3FPs2PdOqkI3PqlcLaon5KbeFE+NtK1PR+Zu6qY90m1lyW8e4ldqVzjQ7VrF2ASkDymQ+dPV6LRyimxDkJKloyh4xD/AZkMc2Fb98FRQDuPL0v9fXemyHneRudD3AEn1f/h2/xLmGajG9b27DzyIM/adjGG+sCiHx9S2+qkHyWXiT3ObSNCxaZSCjkMw+DWTvJjAeJ4ns/Bko2OzhI2enu7JpHOqTltr0DAyWIKLpGuRx Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5c65040-9760-41a4-49cf-08d799b44701 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:06.3532 (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: 0LtHWpH9fKgynkeVzYTClfioIz1JeE3c/mGeZCGYdBmjtTbvzsD1tRZu2ws+pLcsluJN8bk1y4QJC/CNjERh9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller If RTS threshold is 0, it currently disables RTS. It should mean "enabled for every frames". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index ccea3f15a34d..bf3769c2a9b6 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -391,7 +391,7 @@ static inline int hif_wep_default_key_id(struct wfx_vif *wvif, int val) static inline int hif_rts_threshold(struct wfx_vif *wvif, int val) { struct hif_mib_dot11_rts_threshold arg = { - .threshold = cpu_to_le32(val > 0 ? val : 0xFFFF), + .threshold = cpu_to_le32(val >= 0 ? val : 0xFFFF), }; return hif_write_mib(wvif->wdev, wvif->id, From patchwork Wed Jan 15 12:13:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216665 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0F6FC33CB1 for ; Wed, 15 Jan 2020 12:15:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A929C207FF for ; Wed, 15 Jan 2020 12:15:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="loWejBgf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731736AbgAOMPn (ORCPT ); Wed, 15 Jan 2020 07:15:43 -0500 Received: from mail-bn7nam10on2085.outbound.protection.outlook.com ([40.107.92.85]:6101 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731575AbgAOMNk (ORCPT ); Wed, 15 Jan 2020 07:13:40 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ggxraxOI1OMjINjkuWjebk69nYB+QiBSJgycxNSC2Dt09WfW95R+0+LK4HxBUaplmx3i0zcG12rnedjtZdMP/AhQsk2pPE10baM6WP60HFixiSajeX7T7QDGMFsAAR3Kgj+HhQKgUmEFpDp36QugXLagd0rIYXOndqzowGRUsyHgyATdU3A7Ia1Sn6U/a4hzTfGquaPnAazDn3+LHqJPqz7c1OcuzMmqj+htEsecK7XjKnq1f5iXw4K2haMbEaoxZB8pqKjeriJQORiDNDPbh70kKvOQju2KGzp769SJVp6WGC8tHuw+FYujjvwNoadXPxMaPzvGldPBTvoDT2KwWQ== 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=Bwh7lWsf/cwWs0AEW/3avuQIgItjw4kHtgAkBvBt6+k=; b=L6zMtreKOzVaNQB5qFuvcLPIi3tOt5b78A79PTy34Qf33CHKsbVJIP3Fw98hSeJGYbBB1LHw73HEhN1c2AZnlrd1WDMomlp+WRwhW/rpFvEaUWzI9X2O7/B46J+40Gmb+nl43Zmw0iIH0bnKuInYSVsxN3gwU3Ay+TRXCT+qUqf5Mv+Qd0HxOZpt4dsQ47jgkjIEUctwBCORMyDoYyDxXkZrAiAaYwRjM5gmfm4NsyQ2ccmwxfROGlygwqNJUlO60Iq/ZhLR+LaMqdfdMFzTWztSMBl7JlKD75tT2E6T3CxsGCTET6B7Q74K2LqDlt7eVfB9nfkruTZd8D9PFnex/A== 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=Bwh7lWsf/cwWs0AEW/3avuQIgItjw4kHtgAkBvBt6+k=; b=loWejBgfNvra6ax5zN/EEMgefsrE0ZNNIvrTlctaAaX3gqGQl9yPwVaZ5RyDo4XQqJzKKVqzShQ3I/SKoGJLRwDH/7J4PBXhppeePqyG5P0mxbeKrJM4qCKcv+FLbvUToesElWgFNlIIlw6kltJKKo1rcBnS2VQbp7b3T/pFFpg= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13: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.2623.018; Wed, 15 Jan 2020 12:13:29 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:09 +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 46/65] staging: wfx: relocate "buffered" information to sta_priv Thread-Topic: [PATCH 46/65] staging: wfx: relocate "buffered" information to sta_priv Thread-Index: AQHVy50niFufYYhXXUi7ur01UA/VBg== Date: Wed, 15 Jan 2020 12:13:10 +0000 Message-ID: <20200115121041.10863-47-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 00a05abf-aa9a-40c5-1d03-08d799b44977 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(6666004)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ugP1FkdkT4V8cz6cnMyIEh24Ju9StnQbwvTHfcm0lOfnYgJm7kvR99GUooFJ0SNc4vIhQYGnvdkR//dEGQFcHJLeuN2UNUIKmfqA+YmJXXJ1BkLbFA81UjfTGyPsevmPTIIMuPW4N7+Z+Za2qD7QkQtYIZPe9ErJX/Eeg0AfNh0y+hzD3IrshQzpBNPN/w9s+0Rav55zLvXjzPko/Q2nZ+4uY9sKtEK0p8OKnZV9Vviy9Z/A6Umri95hMnFZqYbi7ikeaaoPt/+kN8ylGyaiZhQeNEV+qvMDxLa9dKkFagYLV8Jg1Tb5TWL+0Dv1ieAMPOUsmYKoL42FO2WJTRVal8vAm7G+6T3CyO8GzLZXRiCh5y9v8z38klzBsv1RNBFekzdW5MBdLHpyM1wYqZiSvM0AaH7IL1lLZykIYFaYMEuWHOOaNfsEAort8Xrt17Va Content-ID: <55EF408303BCF94AAF076682E458552B@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00a05abf-aa9a-40c5-1d03-08d799b44977 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:10.3719 (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: kDcftgAokO2QqtXl6ZP5OklzBIlLLfjmqNQ002C4mxVc16ztoisKrmBPkjgEIeQLR6tH2WD3LPFNpsbmkUKtKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller It simplify the code if field buffered is hosted in the struct sta_priv instead of in the struct wfx_link_entry. More globally, struct wfx_link_entry has no real reasons to exist and should be dropped soon. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 50 ++++++++++++++++------------------- drivers/staging/wfx/data_tx.h | 4 --- drivers/staging/wfx/sta.c | 1 + drivers/staging/wfx/sta.h | 6 +++++ 4 files changed, 30 insertions(+), 31 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index e669fc4485e6..9313c8f5d4d8 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -291,7 +291,6 @@ static int wfx_alloc_link_id(struct wfx_vif *wvif, const u8 *mac) entry->status = WFX_LINK_RESERVE; ether_addr_copy(entry->mac, mac); - memset(&entry->buffered, 0, WFX_MAX_TID); wfx_tx_lock(wvif->wdev); if (!schedule_work(&wvif->link_id_work)) @@ -434,6 +433,7 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, struct ieee80211_sta *sta) { u32 mask = ~BIT(tx_priv->raw_link_id); + struct wfx_sta_priv *sta_priv; spin_lock_bh(&wvif->ps_state_lock); if (ieee80211_is_auth(hdr->frame_control)) { @@ -448,15 +448,17 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, schedule_work(&wvif->mcast_start_work); } - if (tx_priv->raw_link_id) { + if (tx_priv->raw_link_id) wvif->link_id_db[tx_priv->raw_link_id - 1].timestamp = jiffies; - if (tx_priv->tid < WFX_MAX_TID) - wvif->link_id_db[tx_priv->raw_link_id - 1].buffered[tx_priv->tid]++; - } spin_unlock_bh(&wvif->ps_state_lock); - if (sta) + if (sta && tx_priv->tid < WFX_MAX_TID) { + sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; + spin_lock_bh(&sta_priv->lock); + sta_priv->buffered[tx_priv->tid]++; ieee80211_sta_set_buffered(sta, tx_priv->tid, true); + spin_unlock_bh(&sta_priv->lock); + } } static u8 wfx_tx_get_raw_link_id(struct wfx_vif *wvif, @@ -789,31 +791,25 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) wfx_pending_remove(wvif->wdev, skb); } -static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb, - struct hif_req_tx *req) +static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb) { + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_sta *sta; - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + struct wfx_sta_priv *sta_priv; int tid = wfx_tx_get_tid(hdr); - int raw_link_id = req->queue_id.peer_sta_id; - u8 *buffered; - if (raw_link_id && tid < WFX_MAX_TID) { - buffered = wvif->link_id_db[raw_link_id - 1].buffered; - - spin_lock_bh(&wvif->ps_state_lock); - WARN(!buffered[tid], "inconsistent notification"); - buffered[tid]--; - spin_unlock_bh(&wvif->ps_state_lock); - - if (!buffered[tid]) { - rcu_read_lock(); - sta = ieee80211_find_sta(wvif->vif, hdr->addr1); - if (sta) - ieee80211_sta_set_buffered(sta, tid, false); - rcu_read_unlock(); - } + rcu_read_lock(); // protect sta + sta = ieee80211_find_sta(wvif->vif, hdr->addr1); + if (sta && tid < WFX_MAX_TID) { + sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; + spin_lock_bh(&sta_priv->lock); + WARN(!sta_priv->buffered[tid], "inconsistent notification"); + sta_priv->buffered[tid]--; + if (!sta_priv->buffered[tid]) + ieee80211_sta_set_buffered(sta, tid, false); + spin_unlock_bh(&sta_priv->lock); } + rcu_read_unlock(); } void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb) @@ -827,7 +823,7 @@ void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb) WARN_ON(!wvif); skb_pull(skb, offset); - wfx_notify_buffered_tx(wvif, skb, req); + wfx_notify_buffered_tx(wvif, skb); wfx_tx_policy_put(wvif, req->tx_flags.retry_policy_index); ieee80211_tx_status_irqsafe(wdev->hw, skb); } diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index 54738c2e3eac..d02a7b325b27 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -14,9 +14,6 @@ #include "hif_api_cmd.h" #include "hif_api_mib.h" -// FIXME: use IEEE80211_NUM_TIDS -#define WFX_MAX_TID 8 - struct wfx_tx_priv; struct wfx_dev; struct wfx_vif; @@ -33,7 +30,6 @@ struct wfx_link_entry { enum wfx_link_status status; u8 mac[ETH_ALEN]; u8 old_mac[ETH_ALEN]; - u8 buffered[WFX_MAX_TID]; }; struct tx_policy { diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 4a44d72f0db1..aebce96dcd4a 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -572,6 +572,7 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *) &sta->drv_priv; struct wfx_link_entry *entry; + spin_lock_init(&sta_priv->lock); if (wvif->vif->type != NL80211_IFTYPE_AP) return 0; diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index e0b54332e98a..47d94d6b8590 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -12,6 +12,9 @@ #include "hif_api_cmd.h" +// FIXME: use IEEE80211_NUM_TIDS +#define WFX_MAX_TID 8 + struct wfx_dev; struct wfx_vif; @@ -37,6 +40,9 @@ struct wfx_grp_addr_table { struct wfx_sta_priv { int link_id; int vif_id; + u8 buffered[WFX_MAX_TID]; + // Ensure atomicity of "buffered" and calls to ieee80211_sta_set_buffered() + spinlock_t lock; }; // mac80211 interface From patchwork Wed Jan 15 12:13:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D8A3C33CB1 for ; Wed, 15 Jan 2020 12:15:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 46580222C3 for ; Wed, 15 Jan 2020 12:15:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="aDXvbV9m" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732591AbgAOMPV (ORCPT ); Wed, 15 Jan 2020 07:15:21 -0500 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:33252 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731595AbgAOMNl (ORCPT ); Wed, 15 Jan 2020 07:13:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LhPC/Oz7GTWoTlcKRzY7XIX5VutUKlmUfIiylZ95AiIZkjwmlWHw4A5cxNYa9lpKsuNor4Y2CZaLVwOzsREHwF/fhuJ1gorc8XqeexQIqBWfck1ECS/GN9cQzk58Ln0kgQuPcZeCbs5V1+CJfu872f5C30zvwUBbN5CI26Y6MhtwOUtDpd/9zr9QC7GXskhAW49teAIAkoTo3t4E2khgNUZm7DE7CalRqU01Xg+h4aqQzzQhC+1dACDVBIKFgeJe3ZQWRVA174kKLICUaB81yExDCVIqN5Kd/1K/As8P+MTBA9v0HOBKdMIwD/hzlUyVeSo3/WkG13Gg+1eGk1dRHw== 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=X87pVtcmYHDi0ljQJpF2xoldyQ1lZON43WhiEKBHxLo=; b=oel8xPEjpbVMT2wntj27hXOGXbl43b3aTnI4gzYVgo+NG7CnbuCf/Lo8shp5gs3q0eQNlxQZE0ircO0vZz/FyDYQ3Mvpqkhso/z7L2hg0uBVJVPtU5eeSr7NPTsEDRnyfqFJQIYeW7KMWslg2rEcfF0d0yokySytA06BYcw49TBEyqthRvX+vi5JFFjxUQJi1a3jjRO+UK1Rp2G7g9+QIEfvy53YOPKXvwYKRfhMUBYpqCg2lSuXNRpKM2h++0CDjNXBYlIk20hUdqLn5drLg7QcQJTn3eUCNgShwkOh5v+CX5QzO4on/7oz9afXFJA5M0YvMi3LJH3cLK87zDcILQ== 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=X87pVtcmYHDi0ljQJpF2xoldyQ1lZON43WhiEKBHxLo=; b=aDXvbV9mo8zO47E+mQXW4uunAbCadxuOPi+7z1FZXYrpTPi2UVR5My5RWgVn8M5HnQFfMxpm8LzsS0scK01T5vYKQcWF2tkhr/9riB/DLliw96uVbpOmv+wEnNsAsH8Hdl460kITTx5cZ5qor8Jy75X4d+Oui90fmvntjesJ50I= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13:30 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:30 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:11 +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 48/65] staging: wfx: fix RCU usage Thread-Topic: [PATCH 48/65] staging: wfx: fix RCU usage Thread-Index: AQHVy50ocDCEU8Gjt0qJg2yqX6q8RA== Date: Wed, 15 Jan 2020 12:13:12 +0000 Message-ID: <20200115121041.10863-49-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e1cf2f07-0ed3-4bff-7185-08d799b44b05 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:390; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9Ij81oAA8ek2uA77ex5PEIvaq6reXFaTaLSD+7a+avmCEPPHb+EsHRnCWNv0LFkbh0HLlUH/Kw+xRJkYN/D9kAGc30FQ4SIbfk9h8nJfQg7c2SIf+arEj/9jNj5m88H7uAYfLhf4ZcL0kCmpY7lRd5a54eCPHNOSsxm3oeBo9FoFJGfF14kwb1O3qMEu5cyPFSCDUE//s6t+bkZ4StME/BT5/m3GjwBLk0kTDb/41+i2iiMnYsnYDoz/+9WIYzGvFPuNodbeLHJkXH95cHIAojSfPXbZsgrDVH6YeenOJYx7LjIs5B6ig7MmLLXr9retqld0vuuETdxt7oPBK9XNDcMoyui+NKsff0H0LwB0P7z6/nVsAWuzSL9zEYjRST+Fpd7ljFIJwL5w3v/nsyi7h4sJGUtv+R2yAAXZljKvoGWz9S52XdiiHtY9XbH1n9A0 Content-ID: <1823F1EF4BF0EE4F80C3CF25E5E2925E@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1cf2f07-0ed3-4bff-7185-08d799b44b05 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:12.9854 (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: AdhJuCBuoHwIOaIixyVYpN6cmFksCNJMK9SpLyfPnlTGwkw7RMG2wUbPDEQ7AhFPXsf/jbliBX+tsp828C6NIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Indeed, sta was used after call to rcu_unlock() Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 80a2a9e8256f..d50b583af187 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -690,10 +690,9 @@ static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_sta *sta = NULL; wvif->beacon_int = info->beacon_int; - rcu_read_lock(); + rcu_read_lock(); // protect sta if (info->bssid && !info->ibss_joined) sta = ieee80211_find_sta(wvif->vif, info->bssid); - rcu_read_unlock(); if (sta) wvif->bss_params.operational_rate_set = wfx_rate_mask_to_hw(wvif->wdev, sta->supp_rates[wvif->channel->band]); @@ -712,6 +711,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif, wvif->bss_params.aid = info->aid; hif_set_association_mode(wvif, info, sta ? &sta->ht_cap : NULL); + rcu_read_unlock(); if (!info->ibss_joined) { hif_keep_alive_period(wvif, 30 /* sec */); From patchwork Wed Jan 15 12:13:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216668 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EDD7C33CB1 for ; Wed, 15 Jan 2020 12:15:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 232B4222C3 for ; Wed, 15 Jan 2020 12:15:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="cZZoVOHT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731659AbgAOMNo (ORCPT ); Wed, 15 Jan 2020 07:13:44 -0500 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:33252 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731359AbgAOMNn (ORCPT ); Wed, 15 Jan 2020 07:13:43 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=agwcgjHRZaA9WVhzDzSz803EfnI8P5q9Taw5vTRMure25EDci8TXyfwoUYxscMFWLc1NfH7ZLYSyMBeMnmSLnGGG4efoeh9jFrmbYr8INxLIW1sy/ObqCBq8WvdwhS468CQ3n3LKYfgm5gb1NuTnchua5J0GzpBlgEWUXlgfeGVuYkE0DixCuQI24hxlpAUsthY5AsRMZgeNq7USOEJt7rEm0PleY+1bKt4+qN+vpaw4lkMEXH0Q71yCZdt1HloXtc8nupkpatN7IvFOXVHd6O0VW03aB9+jj4WFi7kITkxcOjXNFZGenf9+eey4vp5/QkmhEtwMLgL+iO9Cju9udg== 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=8/3KphuIWHT7wDKlqvwRmqG9upHZnSnHv+Ck1RpM3WI=; b=O50jqMiMnKXEubqYeF1+SgSxHsiBYm8DynB8ESdmi6TW825HnpBYAltZHkfBIPoTpXZr0JXgiJAqBkYy+X8YL+t+7/Uf+emjXJ8KCzxBIdcg4ZgVy5YC2aTpuC6Edh18Xgwto2L5YsQqYPHaIWAY1w+5wSQwulUxx3KMIZ+mDSdKuJyeOj+c4QlvCNTt++OsPEh+abQREBS5ewfcQ+vgJmsnH86KTFTDMmjpkZSTwgaE3r0z5jIsR9uqsGMpDIeQDEuvDXKefqZh9U2n8I9q+PLUH0Nxpir1nPXjHFOac9OOF4HldJyf3vvJVpWRW0VOzV721AC8K3sxRWrNcMGKnA== 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=8/3KphuIWHT7wDKlqvwRmqG9upHZnSnHv+Ck1RpM3WI=; b=cZZoVOHTskDlSW8m94SkTh5kRIWKj3MIVDY7OVts5F5DHmqDmrW5Xo+cgg38u1x5Hu5Scj5tes/F6AiiH7TlivFN4kY5UFjyyrTMlQVPDxPxTYBgIqzEzBZMzyAA5CELkqJaUG642qUMCh/ZYkx7HDixR7xAIo7Xc8o/4FyUTyA= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13: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.2623.018; Wed, 15 Jan 2020 12:13:32 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:15 +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 51/65] staging: wfx: check that no tx is pending before release sta Thread-Topic: [PATCH 51/65] staging: wfx: check that no tx is pending before release sta Thread-Index: AQHVy50rR3kGt5+U4kCXWFe+sokjlQ== Date: Wed, 15 Jan 2020 12:13:17 +0000 Message-ID: <20200115121041.10863-52-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e4c34091-f227-48dc-6416-08d799b44d6d x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1227; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(1076003)(66556008)(64756008)(66446008)(4744005)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: X+HL4LzkScJWQNGEJhU//zPCgh22q0pFhK+nGlc8RmxQAmY2XtrMK83mDB8/PjR/vyDiG2lA21sPU+Yx+/LevWUWQ7vhhHR6eWkg00Gtu6TeDUXI/oxvFWIkVeHtaAg7d5fOiWqSek6I2EYZ2tHEU48Wey5XkmiOc8u/cU5m/tWN+c6bPyNig++cuTvRJ5xNZV5awU2LPaTv7PvPY+9XMLGbJ14sPLaY7Oq1hW4FlZaQD38NCPe5yk80FK5aVrJapGR0WcKjDDOKCwcoVUpJ9dBGM0RDByOvkdakPjy+B/LpXMHoe2fN8gZxlYsRNIuAd1VCZ+Oq0Ny0RPKsYDvY5T/x1G75iclLoyxDs20mFR/Kvitk9llwmspNmEUQEx5RIm6eGJ7Czc7Fm/WaoqKUEKAmB3NpZm31WXtb1AZYpqsd825e//zo8+aMt+kCpUNG Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4c34091-f227-48dc-6416-08d799b44d6d X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:17.1260 (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: Yzrq2KAy7xoZV19qkibJdPLLc6XdRNvn4P6BW9lW4sHdwFG6u7kMfgKgGdWONb5fppG9vEmt7yEg3KwgXhj/PA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Just for sanity. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 84853aa90f4b..eebbd3292b1b 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -602,7 +602,10 @@ int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, { struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *) &sta->drv_priv; + int i; + for (i = 0; i < WFX_MAX_TID; i++) + WARN(sta_priv->buffered[i], "release station while Tx is in progress"); // FIXME: see note in wfx_sta_add() if (vif->type == NL80211_IFTYPE_STATION) return 0; From patchwork Wed Jan 15 12:13:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 784E0C33CB1 for ; Wed, 15 Jan 2020 12:14:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 373D5222C3 for ; Wed, 15 Jan 2020 12:14:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="atNMXd2L" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731702AbgAOMNr (ORCPT ); Wed, 15 Jan 2020 07:13:47 -0500 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:33252 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731641AbgAOMNp (ORCPT ); Wed, 15 Jan 2020 07:13:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OlbpDQCMMxbU2NGU68+KmDcWsxQ5+08LVJf2EDYbwPS27DHFGJ76BiRGmASHvUxap+l1b0hhPrrwK/yqX8KrH+cFDxbUlBTwKRGManooMPoXLGFY4cux5cy7f03ybPOmvQwMbuRNSO2bBTJIVW004aAliiDQPBzrX2iXpThUBwOcHYVaVEOxdXp2yt33F/5aqbvTZXHQjwsEvWRhvxHm/FQZ0erAOsDvOY3AoEAj0Xsm5uLW7KGH+Sx2TKtrwYr+xPlmMFbu5dWlaqNgaseyHfBhkNujTPSOHYMdKWWG4xzqXZha0B2u61gNFbj+Db3AvRxlfYI7MUMzeLcbtVpcPQ== 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=q+fCfnSJaynmH2NnQWzXjSclI/C2yFd80gnTfbqgY1w=; b=YM0JJU3lLa25QE4B4S2r3A8yCNHLnzSmBQY2fD3V53aDlxG/BG3NcvPPHX52H0djnUEbskmG2fasxd0G475d1CD51e2Jv+YJTaOOKSSMmeroT5jVyqC4Qe3iQFF64tE0hw7Z/xYJMe8lWYFq/jQPsCXS5iCegDgZ4U7qRxj0cWzk0uuJbNES/TwTkM71ECwGcd9MCO2WC0ROPpZ0mr3gaUD8zV5uZdHvN8loFmgZ7HFaMgMdqv8T6YiX2mjPOH13Uib4HW5JJ4ZM+bBrgfmXIk8hOns1KUlU52mIDKfnxNfvsoUE2XqlS2SqLQT6vmbW6ImY9CGAEVylBREFhKsWtg== 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=q+fCfnSJaynmH2NnQWzXjSclI/C2yFd80gnTfbqgY1w=; b=atNMXd2LpfjvqiwvjrwQqYQ8gtwU8yaHK3HUafpZWPaY5s6qPF4wPL2YosHFtAz+lIiy0xNvT6Rq0kqy9Exp2jHEreLlb5sI5jhhlAMzK6RoytFti6ihA2CKKaTzIB25wLIjxRfWiTR87Dt+wNwprwlEwVUqIV/xn03PTXr50Eo= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13:33 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:33 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:17 +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 52/65] staging: wfx: replace wfx_tx_get_tid() with ieee80211_get_tid() Thread-Topic: [PATCH 52/65] staging: wfx: replace wfx_tx_get_tid() with ieee80211_get_tid() Thread-Index: AQHVy50rurdsYUjCaUy7e1acwjtaVQ== Date: Wed, 15 Jan 2020 12:13:18 +0000 Message-ID: <20200115121041.10863-53-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ec78330e-f651-4c1c-e41a-08d799b44e42 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: G5ncbAkW9gjf6HpgxqYX7Kc+R2YZT6kC5EQoVu011BbTHg2aXOmLhhCxadiczYtvokFXP6pn+fBIB/N1K5SOwGxguu4OaZt+1M/rFqWEvGyHaghjd+GoiVIki1X7njiTa9RLeJD0JiXBRc+EpoWNs49JIcxbgrUjvQstX4NLMkcTE5PHcsgAlCiewL1c7tCP9C17jjcisPMZrH/OMb/OUeKmk2pAwXmQwyyB4B7U13kQaKNJ3beIGEct8V5dR+Ctq4A6j3D9nu2/HIRd+ZBEJEObC+XANBteEjDAK0Oz6gI1Mxj373G7NBnPD9NRRYvtsX+wQzdsUnC9JjRsThCNoel05gaUi7Hw5Rs947nh5jVFdoDQAGQ3RcNusYXuCufyj2J0WzVqBQpEk+CvxsNsLGBzKaN5FfDfKPuJvMmvuppEs+LggvEKfgu4bFphEQC6 Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec78330e-f651-4c1c-e41a-08d799b44e42 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:18.4133 (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: fmPuQ5v1/71URSEnnEyfPWXYan/1wr3JUv0qdDc1OoN2HPtDXMiJoHTkIs7YILP3mCWO6Oc9dOJunQWqk64Rwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_tx_get_tid() was used as a wrapper around ieee80211_get_tid(). It did sometime return WFX_MAX_TID to ask to upper layers to not include the frame in "buffered" counter. The objective of this behavior is not clear, but tests has shown that wfx_tx_get_tid() can be replaced by ieee80211_get_tid() without any regressions. BTW, it is not necessary to save the tid in tx_rpiv since it can be retrieved from the 802.11 header. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 23 ++++++----------------- drivers/staging/wfx/data_tx.h | 1 - drivers/staging/wfx/sta.c | 2 +- drivers/staging/wfx/sta.h | 5 +---- 4 files changed, 8 insertions(+), 23 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 8c9f986ec672..7da1afd6e9b5 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -283,6 +283,7 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, { u32 mask = ~BIT(tx_priv->raw_link_id); struct wfx_sta_priv *sta_priv; + int tid = ieee80211_get_tid(hdr); spin_lock_bh(&wvif->ps_state_lock); if (ieee80211_is_auth(hdr->frame_control)) { @@ -298,11 +299,11 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, } spin_unlock_bh(&wvif->ps_state_lock); - if (sta && tx_priv->tid < WFX_MAX_TID) { + if (sta) { sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; spin_lock_bh(&sta_priv->lock); - sta_priv->buffered[tx_priv->tid]++; - ieee80211_sta_set_buffered(sta, tx_priv->tid, true); + sta_priv->buffered[tid]++; + ieee80211_sta_set_buffered(sta, tid, true); spin_unlock_bh(&sta_priv->lock); } } @@ -418,17 +419,6 @@ static struct hif_ht_tx_parameters wfx_tx_get_tx_parms(struct wfx_dev *wdev, str return ret; } -static u8 wfx_tx_get_tid(struct ieee80211_hdr *hdr) -{ - // FIXME: ieee80211_get_tid(hdr) should be sufficient for all cases. - if (!ieee80211_is_data(hdr->frame_control)) - return WFX_MAX_TID; - if (ieee80211_is_data_qos(hdr->frame_control)) - return ieee80211_get_tid(hdr); - else - return 0; -} - static int wfx_tx_get_icv_len(struct ieee80211_key_conf *hw_key) { int mic_space; @@ -460,7 +450,6 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, memset(tx_info->rate_driver_data, 0, sizeof(struct wfx_tx_priv)); // Fill tx_priv tx_priv = (struct wfx_tx_priv *)tx_info->rate_driver_data; - tx_priv->tid = wfx_tx_get_tid(hdr); tx_priv->raw_link_id = wfx_tx_get_raw_link_id(wvif, sta, hdr); tx_priv->link_id = tx_priv->raw_link_id; if (ieee80211_has_protected(hdr->frame_control)) @@ -634,11 +623,11 @@ static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb) struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_sta *sta; struct wfx_sta_priv *sta_priv; - int tid = wfx_tx_get_tid(hdr); + int tid = ieee80211_get_tid(hdr); rcu_read_lock(); // protect sta sta = ieee80211_find_sta(wvif->vif, hdr->addr1); - if (sta && tid < WFX_MAX_TID) { + if (sta) { sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; spin_lock_bh(&sta_priv->lock); WARN(!sta_priv->buffered[tid], "inconsistent notification"); diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index 83720b343484..04b2147101b6 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -38,7 +38,6 @@ struct wfx_tx_priv { struct ieee80211_key_conf *hw_key; u8 link_id; u8 raw_link_id; - u8 tid; } __packed; void wfx_tx_policy_init(struct wfx_vif *wvif); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index eebbd3292b1b..61d64beb6143 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -604,7 +604,7 @@ int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *) &sta->drv_priv; int i; - for (i = 0; i < WFX_MAX_TID; i++) + for (i = 0; i < ARRAY_SIZE(sta_priv->buffered); i++) WARN(sta_priv->buffered[i], "release station while Tx is in progress"); // FIXME: see note in wfx_sta_add() if (vif->type == NL80211_IFTYPE_STATION) diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index 47d94d6b8590..e832405d604e 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -12,9 +12,6 @@ #include "hif_api_cmd.h" -// FIXME: use IEEE80211_NUM_TIDS -#define WFX_MAX_TID 8 - struct wfx_dev; struct wfx_vif; @@ -40,7 +37,7 @@ struct wfx_grp_addr_table { struct wfx_sta_priv { int link_id; int vif_id; - u8 buffered[WFX_MAX_TID]; + u8 buffered[IEEE80211_NUM_TIDS]; // Ensure atomicity of "buffered" and calls to ieee80211_sta_set_buffered() spinlock_t lock; }; From patchwork Wed Jan 15 12:13:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37E3DC33CB1 for ; Wed, 15 Jan 2020 12:14:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F096D2077B for ; Wed, 15 Jan 2020 12:14:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ZZszIlYe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731919AbgAOMOE (ORCPT ); Wed, 15 Jan 2020 07:14:04 -0500 Received: from mail-bn7nam10on2085.outbound.protection.outlook.com ([40.107.92.85]:6101 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731672AbgAOMNs (ORCPT ); Wed, 15 Jan 2020 07:13:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FVnfitd+OVjfs8rXtLNZpfdit1nRnDt2AfGepmIjEdCPfKsq9unw3H+mlIJRAQtJ+6+h22M0vuFVSPkMgV21dMJaHUEOjUu05PeNx+awsnC0d7nfF3lg+wNUrpczjxKJjQtFgHfJgGrAxy701oRvfRflM4NtzKjAvS1lhuUaEipNVkvkj38Tw0ANoiqbXIPE1EGkw7fZQmWY/C437jY7F0G8LbVJ+7/I7MyZnDfMPFxMrC0UpJJskOqSwLFOp1J3HHnyISThQWkmlSjeZeHEgxpK4hUy4wxBz1W4uIzMosF47x7JFr4nva2YZMAw1kiIuq/Cgm0+AShh39Wsb+1t1A== 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=6dZsB0RqG6LXb8hxypQ6AkKcB+Wj+er1SgaAyqW9fPQ=; b=fmhFQRliNwquPt5HCZ8iD4loFSv+5V9/Fvbr3MZR7vMSMWIvQRcgGoIULvaPi/9SNJE9kwPcZnjcgP5iwwtItRx1UdVaMkcfgycfLQbfOTepUUq3sIBVNA2OGLFHGW3rLhOzukENv9u5JAyloSi6kY/qtfvgWeyT2ruHNWHSzGI/F5uy50WsCzUi4IQizZ6d7AkkrT9ahuZca0TmLRXVGunZemE11s6tDCS3EN+EM5V8YjHJY91Bcx31U6ce6zyzucSAsCwu0fM/wH4WqMaJaaWEhtvDLd+cjSopEIn8i+bltQKiXB6UQalwvtzx1BRWb3BPa714x7KlZEnKQ1tKTQ== 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=6dZsB0RqG6LXb8hxypQ6AkKcB+Wj+er1SgaAyqW9fPQ=; b=ZZszIlYeO1B1EawCMkKWsOk9XI8n23Y/JT31NLQUYjm0QWiyfAsRX3we3Q0Xuj8J2iKtY+pMXP3feJdh+a28QMdBI+3edhTvWL0kpQyV9fEHzcLgvsg5d86VqmLzip+kSnJzOXsJoH8r2JeKVo9kLTgMR3nBii/+ygSJ5U+fE3w= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13:34 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:34 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:19 +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 54/65] staging: wfx: sta and dtim Thread-Topic: [PATCH 54/65] staging: wfx: sta and dtim Thread-Index: AQHVy50toUATEVqARUSRYKOv/KUFlA== Date: Wed, 15 Jan 2020 12:13:21 +0000 Message-ID: <20200115121041.10863-55-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 66e5c17a-22ff-46de-86ab-08d799b44fd1 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(6666004)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /nzFn41BV1QrhCP9+43CEPdaESivtsAtGXGStCihuT6NJXMtaGiv/WRz6UC+SGziXFqFwXpQnaZzFah0w7Ny5qZyqPT2mKUJUo/aGn7RFO9kIEYPrQFx0CoBgLjhJRRe01vjJqYX5xsbEQxOsvja+WhfAzPSfbdLA3gyXqBryc01UgxcVGoJsbwrVh2Xab1So+jQGwf1arB38b9bSJDeCmxAwaMAJslb4WvOiXmUJjNeZFVyteULt1XGqRynlibWBSadalByNwIC0yHoi+uhLJLRwJdiRDGvKjKQ+cdOAlYXuEs+SxOKDMdQ3VLxdQy3rIeFUsltEk7bAIQ1fNFRZaV/O+ARQ58VU55wOXbeK9KbR1BJf3Tp2y4R4iP0GVroUZlspTHQZBEDYYiPqq/WEldxuvH62sRtv6ARSZ7kP0JsZZT4Yqoi+oTUgVPBbuie Content-ID: <65101027284F0643AD35FD3FDF3B6E6E@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66e5c17a-22ff-46de-86ab-08d799b44fd1 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:21.0457 (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: yQ3f+9S4fL6ncjYYGtnjrc/aPrKagIBv2oRIisEx1f4gFrJBXLF0LYeaqFyJwR3p+DjZhSX/IzTsJl/ClggepQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_ps_notify() is called for any changes in the TIM. However, association ID 0 is a very special case that should be handled independently. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 6697c736a054..d4c11b07497f 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -839,21 +839,13 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, wfx_do_join(wvif); } -static void wfx_ps_notify(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd, - int link_id) +static void wfx_ps_notify_sta(struct wfx_vif *wvif, + enum sta_notify_cmd notify_cmd, int link_id) { u32 bit, prev; spin_lock_bh(&wvif->ps_state_lock); - /* Zero link id means "for all link IDs" */ - if (link_id) { - bit = BIT(link_id); - } else if (notify_cmd != STA_NOTIFY_AWAKE) { - dev_warn(wvif->wdev->dev, "unsupported notify command\n"); - bit = 0; - } else { - bit = wvif->link_id_map & ~1; - } + bit = BIT(link_id); prev = wvif->sta_asleep_mask & bit; switch (notify_cmd) { @@ -867,7 +859,7 @@ static void wfx_ps_notify(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd, case STA_NOTIFY_AWAKE: if (prev) { wvif->sta_asleep_mask &= ~bit; - if (link_id && !wvif->sta_asleep_mask) + if (!wvif->sta_asleep_mask) schedule_work(&wvif->mcast_stop_work); wfx_bh_request_tx(wvif->wdev); } @@ -882,7 +874,7 @@ void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *) &sta->drv_priv; - wfx_ps_notify(wvif, notify_cmd, sta_priv->link_id); + wfx_ps_notify_sta(wvif, notify_cmd, sta_priv->link_id); } static int wfx_update_tim(struct wfx_vif *wvif) @@ -993,6 +985,14 @@ int wfx_ampdu_action(struct ieee80211_hw *hw, return -ENOTSUPP; } +static void wfx_dtim_notify(struct wfx_vif *wvif) +{ + spin_lock_bh(&wvif->ps_state_lock); + wvif->sta_asleep_mask = 0; + wfx_bh_request_tx(wvif->wdev); + spin_unlock_bh(&wvif->ps_state_lock); +} + void wfx_suspend_resume(struct wfx_vif *wvif, const struct hif_ind_suspend_resume_tx *arg) { @@ -1013,12 +1013,9 @@ void wfx_suspend_resume(struct wfx_vif *wvif, if (cancel_tmo) del_timer_sync(&wvif->mcast_timeout); } else if (arg->suspend_resume_flags.resume) { - // FIXME: should change each station status independently - wfx_ps_notify(wvif, STA_NOTIFY_AWAKE, 0); - wfx_bh_request_tx(wvif->wdev); + wfx_dtim_notify(wvif); } else { - // FIXME: should change each station status independently - wfx_ps_notify(wvif, STA_NOTIFY_SLEEP, 0); + dev_warn(wvif->wdev->dev, "unsupported suspend/resume notification\n"); } } From patchwork Wed Jan 15 12:13:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216674 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A0CBC3F68F for ; Wed, 15 Jan 2020 12:13:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 704D722522 for ; Wed, 15 Jan 2020 12:13:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="MTySAJMa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730422AbgAOMNu (ORCPT ); Wed, 15 Jan 2020 07:13:50 -0500 Received: from mail-co1nam11on2064.outbound.protection.outlook.com ([40.107.220.64]:28929 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731675AbgAOMNt (ORCPT ); Wed, 15 Jan 2020 07:13:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bCQEoSnB9R5vVySa1kVyYNiHVlhuxW0BopIMuMIleqyqSgNW8r8CMmNpzywiTXaOgZWDDmfBW+rg80s+a9FYUOTc2sJ8VHGHM75TZLzvM/pcrideEsj5LTzXiIzyg21yIriQZFdf3ChIhN95v48R6ZYycOO4Y59J3gEWFrzTYLsgmczN6Ez/GoJQNCNfmTEdRR198RU3vxohajFEWj1F16DLG6NFPjY8Qk5XEe24sRUkvMvQl+QFCkX7p/j7soBSY1Wdch5KK1SNQCtv+bTtO/JtLDcs0640WMEZioF7dOLRmvHhg4RxeEsrWDTygoyKjGj2Bz5FK6rhq9WSg8+uGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B+zq5T9uMxfb/CgmD1ygDpRDLGnzrLVhppu2bg4VgJQ=; b=NW+NvbNgpApKXpyBJFhUnOdixbMw3Tc0+9dDQrGFI+Se5Q2fNKUQOKYM6qNtNXODeTWKO1Ei+M0OTHjJvKU+pLWa6AC+SmeVqQdtK3BrbEiivCk3fQCXnHyAGHeSuzTgBZzgYBez7QacpJNFYsvU2i6PY4Rw72X/6hSzbxQVxxOUsop0DJD8vwk+NKd0mJnyzfu3OS0vCmY+ngtcSqg/HDaRktqOZlL7/bTXJ1ToMfxbQ54JVA9u6IahwJO+6KhN+KUfqpyCQKg+8MX0ESwvUQcIO9ODw+Mo3oHJp0xq6flGfdpvjmGOcTBOoe+WukJG7PwvAnz8bz4j/ZIh0Ld4/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B+zq5T9uMxfb/CgmD1ygDpRDLGnzrLVhppu2bg4VgJQ=; b=MTySAJMaDsVDiqeHg8iQPniY0dv+NgCd5DXdN9q8+rz83iXoH8k77mTGozF19JbrVFKID+sqZUDQxB9i7pBG0YU/B8VxecEP+ySiGX2ZeaBARZxXuNPpYTBtMwg3I5yP6es+mkg3qcAwkYLhhN6wREmaqNVDq+qoqWC1FKlZ5dk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13:34 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:34 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:21 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH 55/65] staging: wfx: firmware never return PS status for stations Thread-Topic: [PATCH 55/65] staging: wfx: firmware never return PS status for stations Thread-Index: AQHVy50uPuhrVCL5JUid2UVR7lkP9g== Date: Wed, 15 Jan 2020 12:13:22 +0000 Message-ID: <20200115121041.10863-56-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 783d192f-f107-49d3-80e4-08d799b4509c x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OcX5SeFyt8VMlwMga49ftRfYugosQgEsOnY1Z7CP1cvdEtkNWrqNS/gv3Jc+OISnM8RKLe7fUbNHUeFhe2UYG3TZweT32Gt9ZnehPAwFisvGutQ4z0z2KsHSPQAribfcV+Jyc+Lveum1F1GJrGC3jf+7t66MuaDpJymZmP5zty/e8krmVqB2WkFd1OTXA/PsJrKKFej04EO2x4xlTWymVcnFm6tArh8nwltb6ZfhiRUo64sKEsBh52wVqGngBRyrZjWKGSKfTxU3rT4W/Mzi5ia3+99HgplVmYeLh6S/l2ebPhLQsitbUFBhbxfIcMCXjq9itR6eX8t3eWKe7UADgLlPeVP8MV8QE4ptWJWVZguJjQ4aHsonJnMNjgdYJWUP59UnoX3s/77yhSKqD6+CTuLFfRGSP2OUfNHKzV03BZ/jtMkTMbShizAPCX9usJQG Content-ID: <119AB7DD32FCA94C9AFD7932B6368CD4@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 783d192f-f107-49d3-80e4-08d799b4509c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:22.4110 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sbw8C2DfxG5jxnYm91YY/LFbO6XRTxdJhn7ssdWianN0/W+MYww0m7CZ4XvcHR3aphcokYwyrJ84hTwsl9QF1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller At the beginning, firmware could send suspend_resume indication to notify that a station wake up or sleep down. However, mac80211 already handles power save status of stations and this behavior has been removed from the firmware. So now, when suspend_resume indication is received, it is always to notify that a DTIM is about to be sent. So, it is possible to simply wfx_suspend_resume(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 43 ++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index d4c11b07497f..ce83a57397c8 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -985,38 +985,29 @@ int wfx_ampdu_action(struct ieee80211_hw *hw, return -ENOTSUPP; } -static void wfx_dtim_notify(struct wfx_vif *wvif) -{ - spin_lock_bh(&wvif->ps_state_lock); - wvif->sta_asleep_mask = 0; - wfx_bh_request_tx(wvif->wdev); - spin_unlock_bh(&wvif->ps_state_lock); -} - void wfx_suspend_resume(struct wfx_vif *wvif, const struct hif_ind_suspend_resume_tx *arg) { - if (arg->suspend_resume_flags.bc_mc_only) { - bool cancel_tmo = false; + bool cancel_tmo = false; - spin_lock_bh(&wvif->ps_state_lock); - if (!arg->suspend_resume_flags.resume) - wvif->mcast_tx = false; - else - wvif->mcast_tx = wvif->aid0_bit_set && - wvif->mcast_buffered; - if (wvif->mcast_tx) { - cancel_tmo = true; - wfx_bh_request_tx(wvif->wdev); - } - spin_unlock_bh(&wvif->ps_state_lock); - if (cancel_tmo) - del_timer_sync(&wvif->mcast_timeout); - } else if (arg->suspend_resume_flags.resume) { - wfx_dtim_notify(wvif); - } else { + if (!arg->suspend_resume_flags.bc_mc_only) { dev_warn(wvif->wdev->dev, "unsupported suspend/resume notification\n"); + return; } + + spin_lock_bh(&wvif->ps_state_lock); + if (!arg->suspend_resume_flags.resume) + wvif->mcast_tx = false; + else + wvif->mcast_tx = wvif->aid0_bit_set && + wvif->mcast_buffered; + if (wvif->mcast_tx) { + cancel_tmo = true; + wfx_bh_request_tx(wvif->wdev); + } + spin_unlock_bh(&wvif->ps_state_lock); + if (cancel_tmo) + del_timer_sync(&wvif->mcast_timeout); } int wfx_add_chanctx(struct ieee80211_hw *hw, From patchwork Wed Jan 15 12:13:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216666 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5132C33CB3 for ; Wed, 15 Jan 2020 12:15:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A840B222C3 for ; Wed, 15 Jan 2020 12:15:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="gm50jlYy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731819AbgAOMPg (ORCPT ); Wed, 15 Jan 2020 07:15:36 -0500 Received: from mail-bn7nam10on2041.outbound.protection.outlook.com ([40.107.92.41]:41024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731587AbgAOMNl (ORCPT ); Wed, 15 Jan 2020 07:13:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TNwuQWnWdrDQ96JsXEgRqJPYMVxlkPim+zZajKI0pMxSCwZ9zWfz6cxSw6bkvatq4TwaWqsBRO3bsnLKLe8qJ7U6vELqeWRLs4+1/RbODkiCs0kHOkG7Fd+oMFtgghXy3ICBpqEI2bB3PUoxGRagb6nOhpBOSgnd1qxa/NSv78AFCzkvoJMBgLRnsX+oa7siM5fXsrfG8cACJsw8h1qo+3rG57pcAMcUSSZECoUpE8XFSSHrBh6pRJxtL74wM7q2nrQe9jE7qS089rF3hhIj7zCw6baJwfU2qs9Jj795xXLmwqAspXe918HwKK6RnZAJSOoBNSm3X88LBzGwtNI09Q== 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=CuCxTNamhTKvagEGXTSZU9kDme339RW5P24dM+rmcnk=; b=X5ZWugXotLUjJ0c1ymDcTti4TjAzBegEJQyMd9WhhuNnFaq+3HS4xW2MQ2q1e1WFkIHnLRoQrs74dFVIODEWcwbfgEL2Nr7Lgb+mG2J4YhYniodjQPIYsKFtdsdbqn/bz5kCUQGXBVtRQ1qMz2lRuATErADf2WnI12cpNtfVCW8hOFJ09LPteNx4l9iD99rpbemMa4BKJVSoB+YIT7EbQAZRbOYpnaKxUqvDRToJw0RLKah+ln4afUPUDFjlajSr2qXutgOxL723xE+pBkNGM7Xr5Xn0jAkHKOgC1fKJLl20e6AaCM+QDkicuqQ9bpSvX03AirmIWVAjvJpqHuxTDQ== 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=CuCxTNamhTKvagEGXTSZU9kDme339RW5P24dM+rmcnk=; b=gm50jlYyuEkOliT/+EJXEgHVneWx+92qEIoVf7l+F/+vvE5dwk3Z7XB6lTE79iZv276FjQp4gSahhED682mCppP6OJpfS9im/JIzVb900/42QSz3W0fQam3+PJO2OAwzY91PQj4ofmJsp+EqpU0Jt9JBW5lf80jSA+pBH0Qq0j4= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4096.namprd11.prod.outlook.com (20.179.150.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:13:35 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:35 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:23 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH 57/65] staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM Thread-Topic: [PATCH 57/65] staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM Thread-Index: AQHVy50vvumr+aqGsEK05OGHlYveig== Date: Wed, 15 Jan 2020 12:13:25 +0000 Message-ID: <20200115121041.10863-58-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e0f4346a-fb28-4111-f6b3-08d799b4523e x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(366004)(376002)(136003)(199004)(189003)(85202003)(66946007)(66446008)(66476007)(2906002)(107886003)(66556008)(1076003)(66574012)(64756008)(5660300002)(8936002)(6486002)(30864003)(186003)(26005)(8676002)(316002)(81156014)(36756003)(52116002)(2616005)(7696005)(478600001)(16526019)(956004)(54906003)(110136005)(86362001)(71200400001)(85182001)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4096; 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: AqhkVvj6TuUKgkJLp2Ua8THY6alDpRmVIYBL+EoVj0sQ9unYlbNC621B0QTCqEIMUMo3ABfMMVs7PmvXCx//nygyWwHAQ6eGVZAHUg5nBypLr+fory+1bq62QVXFdoAJIUzZS+3DURnjvILrTZ5khiT4SLZVgEvFMUm0aRqLe8SBMFjwowoZW5bCaksqctTamkoHAjNV5bXPXMedFuJ2fq5MnBWTjrfiG+veuV0YUDMY2tQtDsl0bIdm0/j3UDZSjWj15BU+x5EijBTxLiXeCWMkaKxT8P546rPKfFLYFPXYyrHZiYnUIbHPx9KD45TXTQO2nm6e2PTMTTGmUK24+bmS3HWG1QdJzGsZgOHCHmbAXKzUgh9W7MeEl4LrsfUEzeu2kKyZ2XXep+Dve46DssgkrJQ/eCwzRnsvQ77YM90RPAn7couCyhRo3MFChfPo Content-ID: <3DEE5AC00917494EB2EBD6F722741B18@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0f4346a-fb28-4111-f6b3-08d799b4523e X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:25.1824 (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: JpZ5YW4LMk5Z/HXZ5sTsxf3Zi5uWZbrTYflHApf7YDifDNlaVggCAy4AhNrVwZXTIJKm9Y1oEL3MC3oGGv/jzQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4096 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller When mac80211 ask for a frame to be sent after a DTIM, driver should: 1. Update TIM with multicast bit set (using update_ie). This function can be called whenever. 2. Keep buffered all frames marked "after dtim" 3. When it receive a suspend_resume indication (see wfx_suspend_resume_mc()), send all the buffered frames. This indication is sent by the firmware 4ms before the dtim. 4. If one of the frames returns status "REQUEUE", it means that the DTIM period was ended before to be able to send the frame. 5. When all the buffered frames were sent or if DTIM period was ended, driver should update the TIM with multicast bit reset. All the mess with the asynchronous works can be dropped. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 17 +++--- drivers/staging/wfx/hif_api_cmd.h | 3 +- drivers/staging/wfx/queue.c | 98 +++++++++++++++---------------- drivers/staging/wfx/queue.h | 1 + drivers/staging/wfx/sta.c | 78 ++---------------------- drivers/staging/wfx/wfx.h | 7 +-- 6 files changed, 66 insertions(+), 138 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 8710383f66e5..c32994553633 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -288,13 +288,6 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, spin_lock_bh(&wvif->ps_state_lock); if (ieee80211_is_auth(hdr->frame_control)) wvif->sta_asleep_mask &= mask; - - if (tx_priv->link_id == WFX_LINK_ID_AFTER_DTIM && - !wvif->mcast_buffered) { - wvif->mcast_buffered = true; - if (wvif->sta_asleep_mask) - schedule_work(&wvif->mcast_start_work); - } spin_unlock_bh(&wvif->ps_state_lock); if (sta) { @@ -479,6 +472,8 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, req->packet_id = queue_id << 16 | IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)); req->data_flags.fc_offset = offset; + if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) + req->data_flags.after_dtim = 1; req->queue_id.peer_sta_id = tx_priv->raw_link_id; // Queue index are inverted between firmware and Linux req->queue_id.queue_id = 3 - queue_id; @@ -488,6 +483,8 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, // Auxiliary operations wfx_tx_manage_pm(wvif, hdr, tx_priv, sta); wfx_tx_queue_put(wvif->wdev, &wvif->wdev->tx_queue[queue_id], skb); + if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) + schedule_work(&wvif->update_tim_work); wfx_bh_request_tx(wvif->wdev); return 0; } @@ -599,9 +596,11 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) else tx_info->flags |= IEEE80211_TX_STAT_ACK; } else if (arg->status == HIF_REQUEUE) { - /* "REQUEUE" means "implicit suspend" */ WARN(!arg->tx_result_flags.requeue, "incoherent status and result_flags"); - wfx_suspend_resume_mc(wvif, STA_NOTIFY_SLEEP); + if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) { + wvif->after_dtim_tx_allowed = false; // DTIM period elapsed + schedule_work(&wvif->update_tim_work); + } tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; } else { if (wvif->bss_loss_state && diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index fc078d54bfbf..5554d6eddbf3 100644 --- a/drivers/staging/wfx/hif_api_cmd.h +++ b/drivers/staging/wfx/hif_api_cmd.h @@ -253,7 +253,8 @@ struct hif_queue { struct hif_data_flags { u8 more:1; u8 fc_offset:3; - u8 reserved:4; + u8 after_dtim:1; + u8 reserved:3; } __packed; struct hif_tx_flags { diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 42d64534c92c..ec11a63a2ff9 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -235,7 +235,6 @@ static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, break; } } - WARN_ON(!skb); if (skb) { tx_priv = wfx_skb_tx_priv(skb); tx_priv->xmit_timestamp = ktime_get(); @@ -473,23 +472,12 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, static int wfx_tx_queue_mask_get(struct wfx_vif *wvif, struct wfx_queue **queue_p, - u32 *tx_allowed_mask_p, - bool *more) + u32 *tx_allowed_mask_p) { int idx; u32 tx_allowed_mask; int total = 0; - /* Search for a queue with multicast frames buffered */ - if (wvif->mcast_tx) { - tx_allowed_mask = BIT(WFX_LINK_ID_AFTER_DTIM); - idx = wfx_get_prio_queue(wvif, tx_allowed_mask, &total); - if (idx >= 0) { - *more = total > 1; - goto found; - } - } - /* Search for unicast traffic */ tx_allowed_mask = ~wvif->sta_asleep_mask; tx_allowed_mask |= BIT(WFX_LINK_ID_UAPSD); @@ -501,64 +489,83 @@ static int wfx_tx_queue_mask_get(struct wfx_vif *wvif, if (idx < 0) return -ENOENT; -found: *queue_p = &wvif->wdev->tx_queue[idx]; *tx_allowed_mask_p = tx_allowed_mask; return 0; } +struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif) +{ + struct wfx_dev *wdev = wvif->wdev; + struct ieee80211_tx_info *tx_info; + struct hif_msg *hif; + struct sk_buff *skb; + int i; + + for (i = 0; i < IEEE80211_NUM_ACS; ++i) { + skb_queue_walk(&wdev->tx_queue[i].queue, skb) { + tx_info = IEEE80211_SKB_CB(skb); + hif = (struct hif_msg *)skb->data; + if ((tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) && + (hif->interface == wvif->id)) + return (struct hif_msg *)skb->data; + } + } + return NULL; +} + struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) { struct sk_buff *skb; struct hif_msg *hif = NULL; - struct hif_req_tx *req = NULL; struct wfx_queue *queue = NULL; struct wfx_queue *vif_queue = NULL; u32 tx_allowed_mask = 0; u32 vif_tx_allowed_mask = 0; const struct wfx_tx_priv *tx_priv = NULL; struct wfx_vif *wvif; - /* More is used only for broadcasts. */ - bool more = false; - bool vif_more = false; int not_found; int burst; + int i; + + if (atomic_read(&wdev->tx_lock)) + return NULL; + + wvif = NULL; + while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { + if (wvif->after_dtim_tx_allowed) { + for (i = 0; i < IEEE80211_NUM_ACS; ++i) { + skb = wfx_tx_queue_get(wvif->wdev, + &wdev->tx_queue[i], + BIT(WFX_LINK_ID_AFTER_DTIM)); + if (skb) { + hif = (struct hif_msg *)skb->data; + // Cannot happen since only one vif can + // be AP at time + WARN_ON(wvif->id != hif->interface); + return hif; + } + } + // No more multicast to sent + wvif->after_dtim_tx_allowed = false; + schedule_work(&wvif->update_tim_work); + } + } for (;;) { int ret = -ENOENT; int queue_num; - struct ieee80211_hdr *hdr; - - if (atomic_read(&wdev->tx_lock)) - return NULL; wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { spin_lock_bh(&wvif->ps_state_lock); not_found = wfx_tx_queue_mask_get(wvif, &vif_queue, - &vif_tx_allowed_mask, - &vif_more); - - if (wvif->mcast_buffered && (not_found || !vif_more) && - (wvif->mcast_tx || - !wvif->sta_asleep_mask)) { - wvif->mcast_buffered = false; - if (wvif->mcast_tx) { - wvif->mcast_tx = false; - schedule_work(&wvif->mcast_stop_work); - } - } + &vif_tx_allowed_mask); spin_unlock_bh(&wvif->ps_state_lock); - if (vif_more) { - more = true; - tx_allowed_mask = vif_tx_allowed_mask; - queue = vif_queue; - ret = 0; - break; - } else if (!not_found) { + if (!not_found) { if (queue && queue != vif_queue) dev_info(wdev->dev, "vifs disagree about queue priority\n"); tx_allowed_mask |= vif_tx_allowed_mask; @@ -595,15 +602,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) else wdev->tx_burst_idx = -1; - /* more buffered multicast/broadcast frames - * ==> set MoreData flag in IEEE 802.11 header - * to inform PS STAs - */ - if (more) { - req = (struct hif_req_tx *) hif->body; - hdr = (struct ieee80211_hdr *) (req->frame + req->data_flags.fc_offset); - hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA); - } return hif; } } diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 813c2d09e034..096ae86135cc 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -47,6 +47,7 @@ void wfx_tx_queues_clear(struct wfx_dev *wdev); bool wfx_tx_queues_is_empty(struct wfx_dev *wdev); void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); +struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif); void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index d647dff46673..01eee06a1ef4 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -851,16 +851,12 @@ static void wfx_ps_notify_sta(struct wfx_vif *wvif, switch (notify_cmd) { case STA_NOTIFY_SLEEP: if (!prev) { - if (wvif->mcast_buffered && !wvif->sta_asleep_mask) - schedule_work(&wvif->mcast_start_work); wvif->sta_asleep_mask |= bit; } break; case STA_NOTIFY_AWAKE: if (prev) { wvif->sta_asleep_mask &= ~bit; - if (!wvif->sta_asleep_mask) - schedule_work(&wvif->mcast_stop_work); wfx_bh_request_tx(wvif->wdev); } break; @@ -898,7 +894,7 @@ static int wfx_update_tim(struct wfx_vif *wvif) tim_ptr[2] = 0; /* Set/reset aid0 bit */ - if (wvif->aid0_bit_set) + if (wfx_tx_queues_get_after_dtim(wvif)) tim_ptr[4] |= 1; else tim_ptr[4] &= ~1; @@ -927,47 +923,12 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) return 0; } -static void wfx_mcast_start_work(struct work_struct *work) +void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) { - struct wfx_vif *wvif = - container_of(work, struct wfx_vif, mcast_start_work); - struct ieee80211_bss_conf *conf = &wvif->vif->bss_conf; - long tmo = conf->dtim_period * TU_TO_JIFFIES(wvif->beacon_int + 20); - - cancel_work_sync(&wvif->mcast_stop_work); - if (!wvif->aid0_bit_set) { - wfx_tx_lock_flush(wvif->wdev); - wvif->aid0_bit_set = true; - wfx_update_tim(wvif); - mod_timer(&wvif->mcast_timeout, jiffies + tmo); - wfx_tx_unlock(wvif->wdev); - } -} - -static void wfx_mcast_stop_work(struct work_struct *work) -{ - struct wfx_vif *wvif = container_of(work, struct wfx_vif, - mcast_stop_work); - - if (wvif->aid0_bit_set) { - del_timer_sync(&wvif->mcast_timeout); - wfx_tx_lock_flush(wvif->wdev); - wvif->aid0_bit_set = false; - wfx_update_tim(wvif); - wfx_tx_unlock(wvif->wdev); - } -} - -static void wfx_mcast_timeout(struct timer_list *t) -{ - struct wfx_vif *wvif = from_timer(wvif, t, mcast_timeout); - - dev_warn(wvif->wdev->dev, "multicast delivery timeout\n"); - spin_lock_bh(&wvif->ps_state_lock); - wvif->mcast_tx = wvif->aid0_bit_set && wvif->mcast_buffered; - if (wvif->mcast_tx) - wfx_bh_request_tx(wvif->wdev); - spin_unlock_bh(&wvif->ps_state_lock); + WARN(!wfx_tx_queues_get_after_dtim(wvif), "incorrect sequence"); + WARN(wvif->after_dtim_tx_allowed, "incorrect sequence"); + wvif->after_dtim_tx_allowed = true; + wfx_bh_request_tx(wvif->wdev); } int wfx_ampdu_action(struct ieee80211_hw *hw, @@ -985,25 +946,6 @@ int wfx_ampdu_action(struct ieee80211_hw *hw, return -ENOTSUPP; } -void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) -{ - bool cancel_tmo = false; - - spin_lock_bh(&wvif->ps_state_lock); - if (notify_cmd == STA_NOTIFY_SLEEP) - wvif->mcast_tx = false; - else - wvif->mcast_tx = wvif->aid0_bit_set && - wvif->mcast_buffered; - if (wvif->mcast_tx) { - cancel_tmo = true; - wfx_bh_request_tx(wvif->wdev); - } - spin_unlock_bh(&wvif->ps_state_lock); - if (cancel_tmo) - del_timer_sync(&wvif->mcast_timeout); -} - int wfx_add_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf) { @@ -1090,10 +1032,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) spin_lock_init(&wvif->ps_state_lock); INIT_WORK(&wvif->update_tim_work, wfx_update_tim_work); - INIT_WORK(&wvif->mcast_start_work, wfx_mcast_start_work); - INIT_WORK(&wvif->mcast_stop_work, wfx_mcast_stop_work); - timer_setup(&wvif->mcast_timeout, wfx_mcast_timeout, 0); - memset(&wvif->bss_params, 0, sizeof(wvif->bss_params)); mutex_init(&wvif->bss_loss_lock); @@ -1156,9 +1094,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, break; case WFX_STATE_AP: wvif->sta_asleep_mask = 0; - wvif->mcast_tx = false; - wvif->aid0_bit_set = false; - wvif->mcast_buffered = false; /* reset.link_id = 0; */ hif_reset(wvif, false); break; @@ -1175,7 +1110,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, wfx_cqm_bssloss_sm(wvif, 0, 0, 0); cancel_work_sync(&wvif->unjoin_work); - del_timer_sync(&wvif->mcast_timeout); wfx_free_event_queue(wvif); wdev->vif[wvif->id] = NULL; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 8491f050478d..5d61946e33e0 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -75,13 +75,8 @@ struct wfx_vif { u32 link_id_map; - bool aid0_bit_set; - bool mcast_tx; - bool mcast_buffered; + bool after_dtim_tx_allowed; struct wfx_grp_addr_table mcast_filter; - struct timer_list mcast_timeout; - struct work_struct mcast_start_work; - struct work_struct mcast_stop_work; s8 wep_default_key_id; struct sk_buff *wep_pending_skb; From patchwork Wed Jan 15 12:13:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216672 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EEEBC33CB2 for ; Wed, 15 Jan 2020 12:14:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B87D222C3 for ; Wed, 15 Jan 2020 12:14:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="o1g9Ccf5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732359AbgAOMOW (ORCPT ); Wed, 15 Jan 2020 07:14:22 -0500 Received: from mail-bn7nam10on2041.outbound.protection.outlook.com ([40.107.92.41]:26034 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731673AbgAOMOV (ORCPT ); Wed, 15 Jan 2020 07:14:21 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PGBmIEVWJI59VB40LyVj6Cg8QJYwopBJQSmF6fuv2LRt6arcIY/YyLnlxgTlg2fI3psUJaeT6cHba6vWKu9x7oOUoJf1JTJH2oTe5snrRxRSiHI0SR29oHD6irYbVz+aCBi6bp35i+LwaEU//tsQJZImx4x4X4WAJttLNMKbo5yYn/WVf65oIsmB+H6XInJlKhUSJU+o4N/IUCEluXy290VvpKQc0jtT3Llu9L1aECdVv7allKUg4wDMSRYtnOvpOLe0Dt8Zoei5EZ8iDLuGxmc8gJZJ43JUXG7psnJNy6WX48aWOYjwO0GLzERJzR/9um7Qv00sur5k+MZpsmZmYw== 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=8+/BAwuFw3oM+BjgaBfIk2/+u4QYUxQhfRyJJYfrKBY=; b=YDpu+bDyxbsYbyPHjR//KOdfIDECL9gVkJG/WFINStllXuDBnmVW4+D9TnVTFFYoZcPZ7w2+85dR6+sKKMrFpF80/WTOYizNiOyvS3DiI5clEPRT/5XNFqg4dW0mD+Uhlt9ADhWq0XQA2IUmSUu/Jczo6AM/qmzZWfM8VgMNQQIKFbPkFw3kf2ATh0Z0UwcxhZqS47wgU8RZ+tlcj0oDkJnYCKxp2ZJWWRMpsybzxjqDphoYB8vC6GnI+LOz0BK7cEzCb3tEYGpBTnibXXFvrQ/Ts35Q/cz8qENxBqlHKJW/Qy45IyOFh7OXX9cmWGFrT9MXLRU786s7EZ4tINRHqA== 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=8+/BAwuFw3oM+BjgaBfIk2/+u4QYUxQhfRyJJYfrKBY=; b=o1g9Ccf5TuWZteQeY5vpXNXtf7FuKu6IIq1KK8HRpE77GlvhKhyvlX9zzfabE9NnR3/m8adnlMPxWadp0sPWdvtjPqYB9U7oDO0/LtfPiJt/cMridDfO3Qc19g0tqruWawseLSp3JZVOXihal7NR4WcIzYXNd7DS9ZjB61KjRE8= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:14: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.2623.018; Wed, 15 Jan 2020 12:14:08 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13: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 61/65] staging: wfx: remove check for interface state Thread-Topic: [PATCH 61/65] staging: wfx: remove check for interface state Thread-Index: AQHVy50z6uIySu6Zi0W6oWxHuh7ezg== Date: Wed, 15 Jan 2020 12:13:30 +0000 Message-ID: <20200115121041.10863-62-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fe8279a2-fbba-4dbf-2313-08d799b4559c x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(6666004)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fS4QVqhQPFN2N6pyRLaMh3vGuN6wKkjn+DK0Ojoadblqwh+oIYH2MO28pCR7dMlKYfcr/6O3F5F6HOwQZz4EtSkBwVuwfkgYqeV93hUCKgA4wGTkQ2OSvs3PbFj2FlxgpGs2DXSKHaXFaOoya3nlQVobcTCL0qaF/6Mn9QkS/67hVEvaC9cUjE1zDYr+UMlzcC6BCqkmL3vzA6yOfZq5PYNs75OwZfiBUJu/INSTZcFC6DJmhxmKonD19v2BD6+YvuzN423ozeaAPqDZs8MEcj7fRujYVhg6MHFHJ1o7/pQQaeF6pmnabn9D9fm0rimeV25OMytgYGGVNwoOfwhvGdIwqynH/Oh+kJ/6ZeDWBwZS3NgYDZHWv2cIwKQTk4qGZ6X+IfgPwAGGGqznSCkH36vovkWO66I9ZeW9rk8ZgsZ8WybtLnA1suOSTR1khqSm Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe8279a2-fbba-4dbf-2313-08d799b4559c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:30.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: FDdIAR9iUq9JV5ZCSgp5XN9odbAGzeW+/9+dD8Sl1X5BdKRNuJoQbzrFgLnRK5MhxYHvpP4UNfim3V/thgujrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Obviously, the value of wvif->state as no reason to be wrong. At least, if it the case, dropping the frame is probably not the bast thing to do. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 50 +++++++++---------------------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index c87d64fbb88f..e0c609c35a7b 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -365,52 +365,26 @@ static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, struct ieee80211_hdr *frame = (struct ieee80211_hdr *) (req->frame + req->data_flags.fc_offset); enum { - do_drop, do_wep, do_tx, } action = do_tx; - switch (wvif->vif->type) { - case NL80211_IFTYPE_STATION: - if (wvif->state < WFX_STATE_PRE_STA) - action = do_drop; - break; - case NL80211_IFTYPE_AP: - if (!wvif->state) - action = do_drop; - break; - case NL80211_IFTYPE_ADHOC: - if (wvif->state != WFX_STATE_IBSS) - action = do_drop; - break; - case NL80211_IFTYPE_MONITOR: - default: - action = do_drop; - break; - } - - if (action == do_tx) { - if (ieee80211_is_nullfunc(frame->frame_control)) { - mutex_lock(&wvif->bss_loss_lock); - if (wvif->bss_loss_state) { - wvif->bss_loss_confirm_id = req->packet_id; - req->queue_id.queue_id = HIF_QUEUE_ID_VOICE; - } - mutex_unlock(&wvif->bss_loss_lock); - } else if (ieee80211_has_protected(frame->frame_control) && - tx_priv->hw_key && - tx_priv->hw_key->keyidx != wvif->wep_default_key_id && - (tx_priv->hw_key->cipher == WLAN_CIPHER_SUITE_WEP40 || - tx_priv->hw_key->cipher == WLAN_CIPHER_SUITE_WEP104)) { - action = do_wep; + if (ieee80211_is_nullfunc(frame->frame_control)) { + mutex_lock(&wvif->bss_loss_lock); + if (wvif->bss_loss_state) { + wvif->bss_loss_confirm_id = req->packet_id; + req->queue_id.queue_id = HIF_QUEUE_ID_VOICE; } + mutex_unlock(&wvif->bss_loss_lock); + } else if (ieee80211_has_protected(frame->frame_control) && + tx_priv->hw_key && + tx_priv->hw_key->keyidx != wvif->wep_default_key_id && + (tx_priv->hw_key->cipher == WLAN_CIPHER_SUITE_WEP40 || + tx_priv->hw_key->cipher == WLAN_CIPHER_SUITE_WEP104)) { + action = do_wep; } switch (action) { - case do_drop: - wfx_pending_remove(wvif->wdev, skb); - handled = true; - break; case do_wep: wfx_tx_lock(wvif->wdev); WARN_ON(wvif->wep_pending_skb); From patchwork Wed Jan 15 12:13:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216670 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38BBFC33CB1 for ; Wed, 15 Jan 2020 12:14:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 00F85222C3 for ; Wed, 15 Jan 2020 12:14:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="JlEOMjuE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732417AbgAOMOe (ORCPT ); Wed, 15 Jan 2020 07:14:34 -0500 Received: from mail-co1nam11on2064.outbound.protection.outlook.com ([40.107.220.64]:28929 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730835AbgAOMOd (ORCPT ); Wed, 15 Jan 2020 07:14:33 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IVwvLh6+UjY6cNClOasG3tk5BZNz/P1XTQ/aDl42WJKG8cZitL7/d2XoTbq3NvH5sD8tjrcaREZ6/U0npt5kzJSsvinQLF011pUmNACdT33kGnX0cUEzbjQZFXvulY2PyXqMWpqmydFch4qB4AEmF7I0PrghXElxnEuuNq8ybpoXd1a9DjA+gmAjMYqGk6jZAfLg9eOoLTDgOzq8ffCQvDsVxQ+O3h7vu4jFesVTZKlLOE3yfNKSZVkLmeabtKzQ6w0wcJ1PWw4xPs5rsRABP7/Bsmrj5daD8mOopWcU0UkN7Aj7RvKmL/AfXQ0QRt+2ctl+thvHbVFnvfoOtThHiw== 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=ro9I2rSIp0iul/hKKxPII0gO0+PaKdaAxCdGr0ktzNc=; b=TCozFyTEuKF5pjoefDduA/ntQCK2+2zS/EjnVIV4st0m3D1lTNOLFh7MWXTXtIuCpEo5R/bU5j1oW38sIDZUaIo5y+zZOuhfyEJahjBdp25PPg67baJ74tGiK60ArqfTsrMSEgbvy4x7uo4DYcsYnzPPaguNxZXy8yFjamVufiSlZwuBijLiLnJGlWRXTrjbBijzogrfkCpGH6zMw6cVjSD3Lw/7t5/JlAD6BYObvcvFAGoCncdVaDEH2K/bVImtG1bXx5RQGjegncaOi7FoShGlR3ZXwdvoJ9BtNbL3sBsLkvUQrXek3hk/ZPZJUyAgwlTR2t5mypa0TihmJWTnhQ== 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=ro9I2rSIp0iul/hKKxPII0gO0+PaKdaAxCdGr0ktzNc=; b=JlEOMjuE6h/f+n6NbKKGSw95/1ikg0tn1pO/1x0Q3vf7OzTojSMlwXA9syshGN9AOWWJCxFLTeJ45WSCdV8CjCYFWut4Qig+loj0h++sGCG8zlGeB1vxfDebIRKn6DpDzr8RVWW+E3Cid/3XPPrxlGo5/s0BgbfQiyIcayn0Qso= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:14:10 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:14:10 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13: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 63/65] staging: wfx: simplify wfx_tx_queue_get_num_queued() Thread-Topic: [PATCH 63/65] staging: wfx: simplify wfx_tx_queue_get_num_queued() Thread-Index: AQHVy500cBdLiMxjj0yOc+OxlTaMWQ== Date: Wed, 15 Jan 2020 12:13:33 +0000 Message-ID: <20200115121041.10863-64-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bd7060b7-2ef7-40db-cefb-08d799b4574a x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1417; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: H5Vac0nH6cbXeksLaV+Bn2jae/g+nU8b9jrVNjNRfQNnfehvvNeP1fFfF90+pjegiuH1o9EUgxaT6U4E2CeJUExYHuONVuT9cbLmmoQufPdDrq+aZITEX7BVVHyaWP/uWGiNf2L5YCSRvhJbaNI9D/9oYOtG6EbZj3NfgeupX0ThcwiqDXURJu1TjTqgnQjHLp3Wr6RJFpx6F1Vw0Sa51IGGQTX+7KztEaDJKaIbmmm+ZjGNldSLwHXU4Dx8WoyeWykbWkWAI0QHBmbhVaqSBEJJDUNtUxOIJrOQ9hN9RU+3wjeG/E8d1Nmo2OdatdpDA5ll7jJoEj41eT3G4ccaz30TFiU9bstDMbUN+/+PYKXy1jbPNuTnwa8TvRBHVVa5WgFhjV6vhbZKg7ToNhp7UUShbz9SYi+UuJubwGXJpKRddZYEkmXR8l1QN6wKLVQS Content-ID: <97CF986C7242434BA321724AE2F96DFA@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd7060b7-2ef7-40db-cefb-08d799b4574a X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:33.5806 (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: 43jk542TTATfS4nuBvrD2lBhNm6HzBBpJYrrEY6+XJiRarXMPBPS8r+ix5A7y6j8OxO9IhS76MPEp8G/IIOQhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_tx_queue_get_num_queued() can take advantage of BIT() instead of maintaining one variable for a counter and another for a mask. In add, wfx_tx_queue_get_num_queued() has no real reason to return a size_t instead of an int. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 14 +++++--------- drivers/staging/wfx/queue.h | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 024497eb19ac..0bcc61feee1d 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -175,11 +175,9 @@ void wfx_tx_queues_deinit(struct wfx_dev *wdev) wfx_tx_queues_clear(wdev); } -size_t wfx_tx_queue_get_num_queued(struct wfx_queue *queue, - u32 link_id_map) +int wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map) { - size_t ret; - int i, bit; + int ret, i; if (!link_id_map) return 0; @@ -189,11 +187,9 @@ size_t wfx_tx_queue_get_num_queued(struct wfx_queue *queue, ret = skb_queue_len(&queue->queue); } else { ret = 0; - for (i = 0, bit = 1; i < ARRAY_SIZE(queue->link_map_cache); - ++i, bit <<= 1) { - if (link_id_map & bit) + for (i = 0; i < ARRAY_SIZE(queue->link_map_cache); i++) + if (link_id_map & BIT(i)) ret += queue->link_map_cache[i]; - } } spin_unlock_bh(&queue->queue.lock); return ret; @@ -555,7 +551,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) /* allow bursting if txop is set */ if (wvif->edca_params[queue_num].txop) - burst = (int)wfx_tx_queue_get_num_queued(queue, tx_allowed_mask) + 1; + burst = wfx_tx_queue_get_num_queued(queue, tx_allowed_mask) + 1; else burst = 1; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 096ae86135cc..90bb060d1204 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -51,7 +51,7 @@ struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif); void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb); -size_t wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map); +int wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map); struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb); From patchwork Wed Jan 15 12:13:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96C10C33CB1 for ; Wed, 15 Jan 2020 12:14:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 62548222C3 for ; Wed, 15 Jan 2020 12:14:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="owpeVvve" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732465AbgAOMOh (ORCPT ); Wed, 15 Jan 2020 07:14:37 -0500 Received: from mail-co1nam11on2064.outbound.protection.outlook.com ([40.107.220.64]:28929 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732440AbgAOMOg (ORCPT ); Wed, 15 Jan 2020 07:14:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WFSoCFLtfMc/MB188BnaH/FikyttZcUc/P4pZD9lhnRw4qqJZGuozxL2tN08N2HrWcrPIFjjMCpZiAIyH1BVjp0scpZLlI6ceqsA87F35LX3QGK8LTws6Srs37B2zyntH8D7RK13g5SngTAXVrD60l0BLYHj7OpVV0h7/OQFzgI0xMQ5cRpEArGPowrPy66L107XjX7e0JWk6sBmY/f39kGKVNkJCIhUWuZh5Nz1jzmQDtZ//a4aLldVK7SUbI+05jUxIME9kc+Fz6qfXSTfPSyrOLytooATdgsam9UCy16M3DFVsZ0dXqEBXdy/C4pntPpmGPZ23VUdMmW06Q1IRA== 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=ZpOPAFOQYwb3EhZHWrbwX3WD6n9UaCup1R7sH9XqU0M=; b=IZHlnvaB5/zX9USiiKqRxSbb3WLwSsuiRT07Q2GPfzcGz4qbTrbNpsbgtgU/Dre3l0TL+pzb6V19UJ8w7NTJ3WLNAjYd2tp/RMv7yx9roxwGp45F7/OeaJPZrqDfA7NTVGpDjvPJV2o4tRXFEX0eurTtk0n6KYJa0bmHROHBMGPnmMCLI+UmsU3iNxeEf4ztNPdY/Dl6fwuoXz1zM9N/hoyWNiYwhn2dV5XS8nJntS2bV5R2DK5bFgULJ6shQRqBPrFthPOs9p85wAvF6+8l65OxR+KBYTBsObnvxNPwyXNup387Cbq/SQEgWmW68CXBCKrne4LYX+6X79pNjabBqg== 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=ZpOPAFOQYwb3EhZHWrbwX3WD6n9UaCup1R7sH9XqU0M=; b=owpeVvve4IldpmhWbtDFTInIqa5suLrS3uFB0sCwKNPcwrUc1264oY9M4gAigyx8fyFmysFX9J26wrwx5ycSEp+g5iSHLZ0NOQG2QIHRs+srn00+odQIiCAGI4Wychg0hzSoiZuKbJNRPRvYYb+TGQhRwZZkiTxKDYkhlA7Fg8U= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:14:11 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:14:11 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:35 +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 65/65] staging: wfx: update TODO Thread-Topic: [PATCH 65/65] staging: wfx: update TODO Thread-Index: AQHVy502FmB46xD2v0GFf69obNsAfA== Date: Wed, 15 Jan 2020 12:13:36 +0000 Message-ID: <20200115121041.10863-66-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8689424e-7255-460e-d789-08d799b458e1 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(966005)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 93bljOmxw10NkibHUKqOrvbOJZYMxIfx1LbI1r2Iv7iF2yBNzWhXa8J1hk8aYb/5pd3tXNNNM6UlPP3e8aGrbLhHdywEp7eaz6+Wi/vLtDs+mNz0VZzJHHiORezY1Zqgj2PbPt/nlBLtJu4OSaXRD1dpgw7NjCtSEB/S4btuZ9S9mYglr4IvvJBOqDH9BfjPZKDekJDkMT0vFncFyW/KNNSZnYD99qCyTQDR1jqLu9mSQHqPrR/WHmtt6TLybsJjHHmGmCk8VIzTh/Xwmn6oc/k5RKGl92UEWG//+aj4+yCMNLggHu2KFx1X07uz+TOFldUpGKBzLoRIyuMlXhH+mTPUVOcmk7XclhnDysTkepE6SbbPNFBCmDMlFcBeotkApZ1ACjxaNyQ5krIPNKqdpM2J6VOWfaXJWacrqHi/d5zIcSjcmS5lPIwfUfOB0DZZve/HUQxOglWJRjAJ3xzRpXgS1/dPHNlxptQhFr3VO/nhXH6SVpLM8LAquon07VI/wafpirs5OMggM7ppPWYrqg== Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8689424e-7255-460e-d789-08d799b458e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:36.3171 (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: DH5gObkuFIG82R0WAuxUG3zk0owDXz/I/ekHTpvfvrVB/+aV1Baod5c/D1Bkd9TyizKjS/EyFRImw2XeLRdmuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Some work has been done :) Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/TODO | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/staging/wfx/TODO b/drivers/staging/wfx/TODO index 6b1cdd24afc9..efcb7c6a5aa7 100644 --- a/drivers/staging/wfx/TODO +++ b/drivers/staging/wfx/TODO @@ -1,18 +1,8 @@ This is a list of things that need to be done to get this driver out of the staging directory. - - 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. + hardware. All their members whould be declared __le32 or __le16. See: https://lore.kernel.org/lkml/20191111202852.GX26530@ZenIV.linux.org.uk