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: 11334159 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5E15138D 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 893DE22522 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?SsOpcsO0bWUgUG91aWxsZXI=?= , 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: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: 11334157 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ECD6B139A for ; Wed, 15 Jan 2020 12:20:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C209D22522 for ; Wed, 15 Jan 2020 12:20: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="Mabv1q/N" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730349AbgAOMMX (ORCPT ); Wed, 15 Jan 2020 07:12:23 -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 S1730223AbgAOMMV (ORCPT ); Wed, 15 Jan 2020 07:12:21 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PtruGSfjv42AqzdAHASlKYiKq5AHSlYpnV8dQmvC/o9APZR0/GB6eZSzp5e+2AcdCZYZ4k1gMpUCqYxbBpk5HEMTsrlM+bh2x8mvRumxaaO7M0v6EjQfcmR9CUlekO2L+kgtAiiVynIY4/xBue4yNA7ejb4GhIiHGFH6U/Xg1w5tlKwPsuVSoPXpCTiSgc6YGGHw2qaRIPzj/DX/4VNZGBrM1eQWZ/93pexlRzY0dreQ53lFWUiCM14eXbJuS3n3yags26LecuRcJFZJm6ZtnT61Jb3dsaawB6+kYHz+KbevsNDgQjnUJtviPb4pXW2wmsqwZvGN9FLSsyvZ6hFNyA== 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=OEZlc4WIt+v7EkS55ULjmBTrlz1CZWTH8qKnG2sxQBQ=; b=AEMvSCS14cDC+8pXca6HaCMev4Km0uKECoKr1H4VZr8ARy4+DL1u39Dow4Y5kzsrNQDY3jk2vkrGbj2/I81XXNzdJ9j1I+r67WqDqdlp80aLGx0JF9otUFHRNLS4qhr2XGcyG8uGRXIV/kgyfMGtfB+tQnhp+9k4ZRi7/qvOcV1AQ/dPDXZx6polofhdrdhDTGwJaVZto16BdY8zn55dT7dx3nH+c21s9MrfpmEFhW/oTCIK1J58MBgPH2ay4q75OkOLxdpGUoEdhj4GbchgdvttnCeYbpW7DQKG5vpHrgnsgpFIiHmxXgoSdrH4MQsb61WIz2nGAGLu/ohCb1WYLg== 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=OEZlc4WIt+v7EkS55ULjmBTrlz1CZWTH8qKnG2sxQBQ=; b=Mabv1q/Nt/O/R+/1l96Uw/k+hOaR4Wq1wyx1wXeYlas78cgBjh1hIfIqYAVCFcd+kJms2ChgJrcX2i1KQMUgKvX4anSnweJFA/I/ezHGxq9m/kidk018gaZ1ei4ISUBnkXAYg0EpZ5maG1XdZBn3kWE3K/FWXXw9Ey3s5v3l7OI= 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: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:12: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:12: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?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 02/65] staging: wfx: make hif_scan() usage clearer Thread-Topic: [PATCH 02/65] staging: wfx: make hif_scan() usage clearer Thread-Index: AQHVy50D4G/F8PmOR0KgBWJuNgXxng== Date: Wed, 15 Jan 2020 12:12:10 +0000 Message-ID: <20200115121041.10863-3-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: f9ae32e4-65ad-4071-7aa7-08d799b42612 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; 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: ayTQRX5yAfpSbj9rH3zsLcsIFMvnWvB7SOjtul/QYYR+9U21+q4HkXSaBZy/bgVPiVXEtqxu91gKbNoZ5rZMGDIBi3/EhSII5sFcr8Za9juLj5OfwxO1fyRcLvrbfKh3jxUAL0+Bnf0qsjRDLuYijkeptsIlBPZhSuWNYL5JtjtvfkYLI4wakIq0Y9eCeUeags7zoGvTYbx1n/neAFyy4BIlodeSodr5HIqAlQPU3CwP33ZRyedGwiblZWQuGGL/DsJBI8KtioDCHnXr7bWGTIA27jQ+pfb+b2Jla1btZi10Zcw3Vg43p+Fc1Je2izJZTiZmV50OZhvtUp7hDvz1kV1zwR08hBK3Z4791B0QtteTe17B1iXVawtM86wQKS8PYNwgQeCvm7pZKPbj9e9UopH1dIpxfYa6BKUWabVDz8V5E5e0VICjlqqvWc1AHoek Content-ID: <8D4424CE028897479C69643F6489D1E2@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9ae32e4-65ad-4071-7aa7-08d799b42612 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:11.0211 (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: Ip8KT6ZaCCRbR6Voqa9FZ/W4JL9D1VbPdGkpkz3Q+BqDEUPhrcqYR8hmRoJclGLONoRsYeK+mFQ+7Wdhgk67lw== 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 hif_scan() return max number of jiffies to wait before the completion indication. However, if this value is negative, an error has occurred. Reword the code to reflect that behavior. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 24061d09c404..9b3674b3226a 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -56,10 +56,9 @@ static int send_scan_req(struct wfx_vif *wvif, wfx_tx_lock_flush(wvif->wdev); wvif->scan_abort = false; reinit_completion(&wvif->scan_complete); - ret = hif_scan(wvif, req, start_idx, i - start_idx); - if (ret < 0) - return ret; - timeout = ret; + timeout = hif_scan(wvif, req, start_idx, i - start_idx); + 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 * 10); From patchwork Wed Jan 15 12:12: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: 11334149 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 178ED139A for ; Wed, 15 Jan 2020 12:19:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E07FF24671 for ; Wed, 15 Jan 2020 12:19:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="YAVm2oPO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730410AbgAOMM2 (ORCPT ); Wed, 15 Jan 2020 07:12:28 -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 S1730333AbgAOMMX (ORCPT ); Wed, 15 Jan 2020 07:12:23 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=maiQPnj8yj2QSp9V9tKr2W3oKeYHNkSIUehuc+gtK3Bexg3ZBNg1Z/jysQgRPCBK5RYlyeSyHvkGeJp3LnjOU/86HEC/UEIGtRaTTQLxRa3G/SEHW/tNWtrfUvP6dWi3oZM7aeiypVTLl7j1uJjWFc4vvhEJDxDEGfl0AIN8mH8EGH4OGk18XgLK7GlYT/mawGlU4l4qF8ZkiDjfPKgQ/eWegsHKotfY8X91Rz5tvyEF1dCT6q7pMV59vNtky53Tg7xbClWj68oC3OAKekMA71Jj42PllGbTDNjrZwvSHAgO5kTYcNtjzV89gG224jTwEmb/EDakijaWMUzSH1fQaw== 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=KhyMULnLyFgVEzsPUl6Rl1r3Lscd2QfGWEPYIvSlA+g=; b=XwYsIhgabY+K6o7BNDpmT589a/tDnizlI9uAr3egR3dT53FcEM/Jsyetph6lpAudXRrLUNXdLxN0r3qC2/6bGBVIZW4NnTepq5y8Rkc+SpDUde+M3qi06ZqHEnhZeVmkMXkbuNFpTqP5GKgN1d2/xwxuk774jy14qzLPZKlYzZlJJtqzgJXQgnQ7hD5on717ZdI0BJzcBLcS5ll9tGoNOIZr+cl3wVmFdAr9CSaW2r4BPFB5yFr5ZzmkrF6C9mM5YFRS8UPK/Mi7lrdvliHPDovqnwi7m+R6+wNZuGybQwygn8n0XH6n9M/4UsDkRVUEaYDI/x/iZmtNP+QHdCdtIg== 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=KhyMULnLyFgVEzsPUl6Rl1r3Lscd2QfGWEPYIvSlA+g=; b=YAVm2oPOf3NQotj4oCQYyYcq9aBwRNzFXyJ6PJwp1mrP3qiCceiSdUD1Bw9qPQDolngWl+kQNHsXBPswRPWiwfXVfuhxilg1cvqxsRwwuKpVIvF8S5DglT1Qn/x4LQxK1apGP4xp+xTpc4NIwZSPZeI3faYqIQvp0MTt+WOPvj4= 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:12 +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:12 +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: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?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 03/65] staging: wfx: add missing PROBE_RESP_OFFLOAD feature Thread-Topic: [PATCH 03/65] staging: wfx: add missing PROBE_RESP_OFFLOAD feature Thread-Index: AQHVy50EOMdl8bHC6UeIiK4r/bQsGA== Date: Wed, 15 Jan 2020 12:12:12 +0000 Message-ID: <20200115121041.10863-4-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: 37d9ab94-62a2-4751-d769-08d799b426ee 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)(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)(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: hb25g0w7scN0g2pfUlpzSJqCOSS3x9szvEQVylRgQVl3zh1YxAt/tpnqi2NTVuO7nyNT82cs/RRuqaec5bjgMnOlmA+dWnJNacuqhE2wH+x9dFasTcZoN4QFnc+rCvBFe5Va5AT3ZzBm9qzWA9BXH56s+XKi9pqmLW6V+lUHwgedN2f6Z6ATtgd4yGJ7fb02ol8jPgN1oYaKXWWky3Uixklj7wdNEqX+4vZ41/v1souFPIzRIZWDQAxpNjEbVok2MImvWwjPovqAObOfGQrDGfX/XIBjkdtqjf4Q/txaKN0qQMs4vV5VoQz7ZZeejDjC6xsvNXgSNqPPGrNwtJaXiCjAf/ko6sic3HnOyDCXYjHXyemrlZbzRCcHm8DnCdtDa7bwPx0MR+n6FXwK6pRlxnjLO+1IHYE9r33vZNJZVf0AatjjolOHlH8uzoHodxBs Content-ID: <5F1F1AB686CF3143BE98CFBC0EF95498@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37d9ab94-62a2-4751-d769-08d799b426ee X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:12.4543 (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: PkSXwRrj0sEgiOnnfqaFSTA4XOxkXdlYynxHy6lok6l7YNjyu+cReQDMlPlPujZVeJpXRkX5fa5yOQfhCHhE5g== 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 userspace tools (hostapd) rely on probe_resp_offload fields for certain features. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 45c9939b7e62..1904890c03fe 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -298,6 +298,11 @@ struct wfx_dev *wfx_init_common(struct device *dev, hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP); + hw->wiphy->probe_resp_offload = NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS | + NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 | + NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P | + NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U; + hw->wiphy->flags |= WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD; hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; hw->wiphy->max_ap_assoc_sta = WFX_MAX_STA_IN_AP_MODE; From patchwork Wed Jan 15 12:12:13 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: 11334153 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D2F2138D for ; Wed, 15 Jan 2020 12:20:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 46DCD222C3 for ; Wed, 15 Jan 2020 12:20: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="T0REsEuy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731081AbgAOMTy (ORCPT ); Wed, 15 Jan 2020 07:19:54 -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 S1730377AbgAOMM1 (ORCPT ); Wed, 15 Jan 2020 07:12:27 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j9wpfxaAiOXZ91com0JRYfo2TJTc/2yr2tV09oRxTwJ+zSR763ssXOVAzhC2hI0Eq+EnPGovTH/+YgMj7C3QtDTHQzOpzcz7Q7n9rDerqcXI+/V/V9Bw+/GsHamhkWmVb/daOujzmNp/PAzlaI3rLTeucZAIS3wy+2jS8USBC/kjBbNhENf5Sr+bGFzrW+/2zBtCX4zceeEcT/SoUMt8lCNxNHcKbon+0oVroG9vcCqi8GFWW637O+apY6O92P8Yu1BKXzxJqYWCN8ef64w84gTADCWNzB7w4r0fhKl1ojHTWm8LekrjzCEl3SGK0O/hdQ7WPUF1Xya1LXrlUWRDsg== 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=gq5Umz4L0UlsXSSwPFNYQaPHeYPTP/zJciKYxMzYSus=; b=m7dbZqn0D7dlWLZ5GXR13YS8Y4CDCVJUN06raEjRWD+3G3figgAps5hEWDJGLOtR5fxbApZDZFNWGhd4uitCKl2rwKUXExHEQi/zPv57cT6KWnwHaSEx7YpoIqB+LlgxOp71DHalztCU96pSsVVqcjRW9XRxPClK6MHDwn0WK/Lmt91GnyQKVLgpf/UzKdrCrcPZxcq5NfQuh2r0b15S2AwBjnpeXr21IZaP6R1yumPtWCIzT9sTPoLEyoYgtUoD6prFadY/fUA8To3s8DEeVjw/IcIN5vVwny49k1soE4shbrRwvUub1Xn4NWgQCjahKTT+sDkHXU3Px/kVoeL3NQ== 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=gq5Umz4L0UlsXSSwPFNYQaPHeYPTP/zJciKYxMzYSus=; b=T0REsEuy4t4G/THNFMEZDTBaymDOaqeW9H927EPW39hyIfmwQVBN1SP4hwlZRDav6Q4IWVQkqc8TfSjRflmRVqIZKsbbipuNqMEBJejInZb2u4mJLIz8+YDS3G/Z8WsrbmGcekvSK7t1GNxkpY2w0eI4aeTLGDr63OCWeRukl1w= 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:13 +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:13 +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:12 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 04/65] staging: wfx: send rate policies one by one Thread-Topic: [PATCH 04/65] staging: wfx: send rate policies one by one Thread-Index: AQHVy50FiohjPBflH0qwFWQsKYtkXg== Date: Wed, 15 Jan 2020 12:12:13 +0000 Message-ID: <20200115121041.10863-5-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: c519b72a-dffb-433e-d577-08d799b427c0 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: RayMog2P/VQWW2SKnNavntS+/FSFLglEakJR8/5hJde0QgIHp3ZBAS/gmiI00Nvi8DM5jevouFk+fca9ClbtcrikT22wQwaiYEcXKMAVBPFdLa6P7i76dfY2RRNDWEKY+ntVMVwnvGOItA0IAPWkn5EhOorW4SKWtFdycFMj3rA5MVSmTU6hfdAMJ9FhNAkwGZoT8WQ8evRkhDONA+oLjF8m1lyruQ9/hNB/Gc3Fz8eW98HqR7OuUVlNUFBjUP4aXSLDb/qv46JlvJUNeaN5usngLEU9ag+8lQR9BJlySG760EoOAkAzImFAZJpMYMM1laji0cQnV8+xEcp2epbx9/ONMkyIlN5JcR8JZDFGoAKhrj7Hw7kJbv3+aTReqiK1QcLP1MFHO/eXJt7dpl9ObkE9EWU68w5A36hw6Mi24rocWB8M3YkYUiuHbvaqHduv Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: c519b72a-dffb-433e-d577-08d799b427c0 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:13.8345 (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: nWCFg0ovRvWPSMB9KLB28n0p4s0f5R9J4L9xbWXdwgd/Bc1iW1Byu2ovLmWQZbjLHB3Zb/DEMKSg71AL7PX04Q== 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 Rate policies (aka. tx_rate_retry_policy in hardware API) are sent to device asynchronously from tx requests. So, the device maintains a list of active rate policies and the tx requests only reference an existent rate policy. The device API allows to send multiple rate policies at once. However, this property is very rarely used. We prefer to send rate policies one by one and simplify the architecture. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 53 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index b2a325c47b2d..fb51c5910ace 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -217,37 +217,34 @@ static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx) static int wfx_tx_policy_upload(struct wfx_vif *wvif) { - int i; - struct tx_policy_cache *cache = &wvif->tx_policy_cache; struct hif_mib_set_tx_rate_retry_policy *arg = - kzalloc(struct_size(arg, - tx_rate_retry_policy, - HIF_MIB_NUM_TX_RATE_RETRY_POLICIES), - GFP_KERNEL); - struct hif_mib_tx_rate_retry_policy *dst; + kzalloc(struct_size(arg, tx_rate_retry_policy, 1), GFP_KERNEL); + struct tx_policy *policies = wvif->tx_policy_cache.cache; + int i; - spin_lock_bh(&cache->lock); - /* Upload only modified entries. */ - for (i = 0; i < HIF_MIB_NUM_TX_RATE_RETRY_POLICIES; ++i) { - struct tx_policy *src = &cache->cache[i]; - - if (!src->uploaded && memzcmp(src->rates, sizeof(src->rates))) { - dst = arg->tx_rate_retry_policy + - arg->num_tx_rate_policies; - - dst->policy_index = i; - dst->short_retry_count = 255; - dst->long_retry_count = 255; - dst->first_rate_sel = 1; - dst->terminate = 1; - dst->count_init = 1; - memcpy(&dst->rates, src->rates, sizeof(src->rates)); - src->uploaded = true; - arg->num_tx_rate_policies++; + do { + spin_lock_bh(&wvif->tx_policy_cache.lock); + for (i = 0; i < HIF_MIB_NUM_TX_RATE_RETRY_POLICIES; ++i) + if (!policies[i].uploaded && + memzcmp(policies[i].rates, sizeof(policies[i].rates))) + 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)); + spin_unlock_bh(&wvif->tx_policy_cache.lock); + hif_set_tx_rate_retry_policy(wvif, arg); + } else { + spin_unlock_bh(&wvif->tx_policy_cache.lock); } - } - spin_unlock_bh(&cache->lock); - hif_set_tx_rate_retry_policy(wvif, arg); + } while (i < HIF_MIB_NUM_TX_RATE_RETRY_POLICIES); kfree(arg); return 0; } 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: 11334147 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88050138D 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 52BBD24671 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:16 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: 11334145 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13C4B139A for ; Wed, 15 Jan 2020 12:19:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D2BF4207FF for ; Wed, 15 Jan 2020 12:19: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="jPQIsgyh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731608AbgAOMT3 (ORCPT ); Wed, 15 Jan 2020 07:19:29 -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 S1730472AbgAOMMb (ORCPT ); Wed, 15 Jan 2020 07:12:31 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AivXb5v0EMcBrB4VV1/F39gVKJSsmR5F357bGI02YMNEs+cnNyxqqhnHq1NELDAB69hGSknxaNtDHIeMnevZWseYQanuWQN/6E07IwTP+Gc+xWLCV+XwEqotw8d5BF0/xQCeGFwr9X130Sftu/FMscBuo0h+n2l3S50CU4mjGGowsNARAPS7FXE7gFa5IYvVt8JYArI+1zYJyM6WeaUX++FG/KUZxk0zeKFjfKawwRsy7+TLD6Vni06rOWkx/5YLITSb9PmGSV7wAVCnKheezOPqQdTrOjTgKW3xI+alHxtEts4Qo5xRYJ5+aZNRYlJ+14IeSGrXezLFZ8XKSYeODw== 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=ZUo8LwBo1qK4cZ/ojBZuyySQUx8sEw77KK5ENOyqfFo=; b=WDt0KtFsaWkUYn/2+g1wlyQ0nEM4GJpVXrqQIr52jZfHgRkNj0JLJEIUZ84Xe2SOUk0akCQVONr0vAvvyzRLYtct8TSuefm64rarbV3urv2bvZ8POldhJ3HcVjN8YDQECNpgFpMnp7v5hDxFXhhZwggqlTuiTPCA3p0FP8uhKPvpht696g/NNsy1uaqViFkwRRf+rHIz0JMH8QxalhCMtYFXns9vpfegAMDgUuRULWk31LRddtfTAvN1y/NiG6Ab5QqBbzisj+thHEu3JnbAFzD8V++unVX/fxziZiKOjprd2tfSUsb1rBHfH2Oift7KYq9YOuVk3dtJB3JeCHX1vw== 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=ZUo8LwBo1qK4cZ/ojBZuyySQUx8sEw77KK5ENOyqfFo=; b=jPQIsgyh9vyzHt9IaYQCttd4MbAaQz7RlYWqZVrMtoDXiDWh5xh7nihuu14Zip3KNitns/PGRInGjwO81mlXpj0DWMKB11iMLKI8LR4qOSfybRYwIxsMgr43INtzmU7DQ3Lh96QwdhToci4EOqnOr7rEN5Iwq1X9EzAdBgdAkd8= 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:16 +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:16 +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: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?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 06/65] staging: wfx: simplify hif_set_output_power() usage Thread-Topic: [PATCH 06/65] staging: wfx: simplify hif_set_output_power() usage Thread-Index: AQHVy50H/O483S9OBU2uPei1KFhd3g== Date: Wed, 15 Jan 2020 12:12:16 +0000 Message-ID: <20200115121041.10863-7-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: 318814c5-b1ee-4d00-5c7c-08d799b42964 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: lDHhnp3Erxe9yb7GForCB+M0qOK5KWJsIqVe0zBEEtmnpIlImywMOiHThbJLbvw3Z9+Lc+0a/xIsLBJZOXBJ9mwgEXUjcb2p9UDXXJqYicr8q6Yrr/e27Z3kytVidKkBqv8uy4Jjh8Ollt/xdA1xYHh0msLBlbbKQfKPBZ2RCjIltYLmk8e73E7mZRvznnQnLIY7rJZNBJHPhklDlyu69GMPpJk4FvN2ew5uC7aKfeUnpiOg0KExZEOuuzoOjxr2ZNRlQ6p27vH5SKYbBa38T6C64SLYrlII2X6aBztRipjGghYxkBc5DlgOBtgWHkeVo9rlY1WbzR11oRS5QqflkRP1lrNoPwe5gZ4L7rn0DYXaUBlOH72AMsXQktWBEz3MdR3nTBLPqZBrCo33yC53GMOvNju05rABZ6pmwcp5LXXcwsC9jRybZvbXN6okbKC9 Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 318814c5-b1ee-4d00-5c7c-08d799b42964 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:16.5529 (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: /kJWNwCHR5ViGsi6cIn2VofKs1esCVsWY6YzYRP7tvlE3mBejXgKlO9aGJU6m6y19GIAkE8FW7A7soDA1GKZZw== 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 Hardware API use 10th of dBm for output power unit. Upper layers should use same units than mac80211 and the conversion should be done by low level layer of the driver (hif_set_output_power()) In add, current code of hif_set_output_power() use a __le32 while the device API specify a specific structure for this. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 8 +++++--- drivers/staging/wfx/scan.c | 2 +- drivers/staging/wfx/sta.c | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index ef033a409381..749df67131c3 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -15,13 +15,15 @@ #include "hif_tx.h" #include "hif_api_mib.h" -static inline int hif_set_output_power(struct wfx_vif *wvif, int power_level) +static inline int hif_set_output_power(struct wfx_vif *wvif, int val) { - __le32 val = cpu_to_le32(power_level); + struct hif_mib_current_tx_power_level arg = { + .power_level = cpu_to_le32(val * 10), + }; return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_CURRENT_TX_POWER_LEVEL, - &val, sizeof(val)); + &arg, sizeof(arg)); } static inline int hif_set_beacon_wakeup_period(struct wfx_vif *wvif, diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 9b3674b3226a..8e0ac89fd28f 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -61,7 +61,7 @@ static int send_scan_req(struct wfx_vif *wvif, 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 * 10); + hif_set_output_power(wvif, wvif->wdev->output_power); 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 8f53a78d7215..11e33a6d5bb5 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -503,7 +503,7 @@ 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 * 10); + 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); @@ -1063,7 +1063,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_TXPOWER && info->txpower != wdev->output_power) { wdev->output_power = info->txpower; - hif_set_output_power(wvif, wdev->output_power * 10); + hif_set_output_power(wvif, wdev->output_power); } mutex_unlock(&wdev->conf_mutex); @@ -1317,7 +1317,7 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed) 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 * 10); + hif_set_output_power(wvif, wdev->output_power); } if (changed & IEEE80211_CONF_CHANGE_PS) { From patchwork Wed Jan 15 12:12: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: 11334139 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7767A139A for ; Wed, 15 Jan 2020 12:19:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41A58222C3 for ; Wed, 15 Jan 2020 12:19: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="Lw8ZwO60" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730588AbgAOMMg (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 S1730514AbgAOMMc (ORCPT ); Wed, 15 Jan 2020 07:12:32 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UtjXnOTQoFtXGcJBowkj24VUUclcILk3p9DbpuApxggJVIUJVopXTMwZnt/BlotJ3cSAS0xBlNx5rPMNkbnWO86ZU8iAvuYVomuhuicjxos28CnXOJacF4+tjZH5Rckt/AMowi9XiP2MmtRl8vlFP0L7lfqFB4g0NCZ3IMkjU1tWZeiGGlkxEt03yxZVOo3iXm5x9Pw6O9n/EfOah8V91OXI3ESNkRfc4soII4tqkxIq8vFERsvU6hEg/sLsgc4ANNZVo+l5W4ZK8+3dPiCE6/oim22Igb+TYpjlJgVu8JOE0ccV8ME9KSKD2GDEPqDn8mrZEAlFRB5QK6FlCN7rpg== 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=+AJrNR5x6OaUELuP4bcANVom55NGF0XSik/Lq5n/m4E=; b=gw1K1ghqvUdqvK2fH5ymcgUO4ad8pzrgk4fY5HoD6PVJJJMxyg+CsSPU+0tgbSRQ/oHthEoQOEKGIxRYOOiMc1O71tmJ8kaSA8qe1keH76ON2nV33RRU91T8LX/PWzFr0zuAweeE5SZb9YogV8f2r3Pm9s79iN26jCGbGMg24SbgEPyyHYJryiXSOhcAFAV26Xd54wdVMCVof+pmMrIiNN5J7tNYidadiABA5GDJKjRgIGSf983rK7zZhy5WpnLEHscjvDQf1gOTskrUG8jEFU1ovtPTr9II/jJQeoqmWVt3vYSlwVIzzpmIkWgnK88M1VuZUYYhVFyYfqEIMUre1w== 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=+AJrNR5x6OaUELuP4bcANVom55NGF0XSik/Lq5n/m4E=; b=Lw8ZwO60VuF/tmMuhjPN93J3CEeIjVPq47vlKgR7iUiqXIJbplkgpnREdwOLxvGHIbDGJxqbB/+OBxPIzrmA7DlJMX4BWWJELn+i665Jf+WjgD1w36+TLURI9GUwWj6v3cTUOxInER05REGFuF/5gd2dm7OI5gRBnIEgWImkRzc= 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:18 +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:18 +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:16 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 07/65] staging: wfx: simplify hif_set_rcpi_rssi_threshold() usage Thread-Topic: [PATCH 07/65] staging: wfx: simplify hif_set_rcpi_rssi_threshold() usage Thread-Index: AQHVy50H7H/1251ZlUKOU4Y3OcPyWQ== Date: Wed, 15 Jan 2020 12:12:17 +0000 Message-ID: <20200115121041.10863-8-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: f39b3520-71b1-40cf-40f4-08d799b42a30 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; 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: +1oqiJqvm/0YbLrkEZCBQGN9hSD0qUQUaPQUMas2rud6xkvNtXT+wGPi4++WUN101HRdxFL8tKozYPMaij00iSShzMmaoVMtA7p2d6VLN1MkwHNDV3b6jlufMGo9PGwiQtUrcZaRJ8qytHk2TMZJL8ImTFPX2iN9wpo5Z9YBwqu86HCc7lRUxdU674y96sOGxMtoWApQmXDKb2jtPoUS1AoWUP8ttoYqPtYWJEATVINh4G23AgaZI4EaV4GnCYdjnk8bhjIaycII4N85qxsbPRbEfaWMA5W+RAV4zz23ZSrTq1ZH/M2mmcas/GiwpvNGAbCNPTyy4+yc1MA4dSxBVQc+nNiZiiXflVmzSLQ+4nhwY/w0FCbW1I53z+QBfU/P0zVngLlTbXWPVwTo3RZn7d6nkqd2AEuIQamKorIKgFAZ80NXVS0jsO0M/19dSh7p Content-ID: <847D589BD2517D49AE50D05C091C3662@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f39b3520-71b1-40cf-40f4-08d799b42a30 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:17.8951 (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: U4SjGGdD7UkGar3y3XOMX2gOjBw6j6R9Jo8vXvtQBwMXUGovOTqJWP4SCC7E5o7qccFJf12DdKwKAMipvv5jUA== 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_rcpi_rssi_threshold come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_rcpi_rssi_threshold() is 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 | 19 +++++++++++++++++-- drivers/staging/wfx/sta.c | 26 ++------------------------ 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index 749df67131c3..a8082508fbfd 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -44,10 +44,25 @@ static inline int hif_set_beacon_wakeup_period(struct wfx_vif *wvif, } static inline int hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif, - struct hif_mib_rcpi_rssi_threshold *arg) + int rssi_thold, int rssi_hyst) { + struct hif_mib_rcpi_rssi_threshold arg = { + .rolling_average_count = 8, + .detection = 1, + }; + + if (!rssi_thold && !rssi_hyst) { + arg.upperthresh = 1; + arg.lowerthresh = 1; + } else { + arg.upper_threshold = rssi_thold + rssi_hyst; + arg.upper_threshold = (arg.upper_threshold + 110) * 2; + arg.lower_threshold = rssi_thold; + arg.lower_threshold = (arg.lower_threshold + 110) * 2; + } + return hif_write_mib(wvif->wdev, wvif->id, - HIF_MIB_ID_RCPI_RSSI_THRESHOLD, arg, sizeof(*arg)); + HIF_MIB_ID_RCPI_RSSI_THRESHOLD, &arg, sizeof(arg)); } static inline int hif_get_counters_table(struct wfx_dev *wdev, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 11e33a6d5bb5..339acbce96fb 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -1033,31 +1033,9 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, hif_slot_time(wvif, info->use_short_slot ? 9 : 20); if (changed & BSS_CHANGED_ASSOC || changed & BSS_CHANGED_CQM) { - struct hif_mib_rcpi_rssi_threshold th = { - .rolling_average_count = 8, - .detection = 1, - }; - wvif->cqm_rssi_thold = info->cqm_rssi_thold; - - if (!info->cqm_rssi_thold && !info->cqm_rssi_hyst) { - th.upperthresh = 1; - th.lowerthresh = 1; - } else { - /* FIXME It's not a correct way of setting threshold. - * Upper and lower must be set equal here and adjusted - * in callback. However current implementation is much - * more reliable and stable. - */ - /* RSSI: signed Q8.0, RCPI: unsigned Q7.1 - * RSSI = RCPI / 2 - 110 - */ - th.upper_threshold = info->cqm_rssi_thold + info->cqm_rssi_hyst; - th.upper_threshold = (th.upper_threshold + 110) * 2; - th.lower_threshold = info->cqm_rssi_thold; - th.lower_threshold = (th.lower_threshold + 110) * 2; - } - hif_set_rcpi_rssi_threshold(wvif, &th); + hif_set_rcpi_rssi_threshold(wvif, info->cqm_rssi_thold, + info->cqm_rssi_hyst); } if (changed & BSS_CHANGED_TXPOWER && 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: 11333897 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F336138D 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 E573D24679 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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: 11334155 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 72024139A 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 46ABC22522 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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: 11334151 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A70D3138D 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 7311122522 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:23 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: 11334141 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6A41B138D for ; Wed, 15 Jan 2020 12:19:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3DD25207FF for ; Wed, 15 Jan 2020 12:19:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="NRkxrzOe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730497AbgAOMMb (ORCPT ); Wed, 15 Jan 2020 07:12:31 -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 S1730407AbgAOMMa (ORCPT ); Wed, 15 Jan 2020 07:12:30 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XDv21aBzTsS7RsYVVHxWWwhk5WXM8toij2/+boZBZ6kBo2BibeDxqvwFdmsTgXEQat52ibSiSvaA7+BiSwtKAn4CM4Mimmz9O1nmPVJ0YeWbe+fmN42vyDfdkGuDMOMPhmNRRvS2OeDSUMtr2wzrH9WyICzvuBhDMMTNijN2EXkNl/fns++zkEDGSXFtwZl31npvCb/411agw6eAO569pjmcSniBoGbU1yq+hV717muxKxl8akafhS1XqmXB5ptXh43/MiqE5BaeingmItglhMp9SRysZ/ZvUHpMYoyaaD0bagaYkmYRDq9PC3Nyh6z5J4wYYZr/0cyawv010t4Psg== 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=fhQww9H4Ug/YZqWy3+tCxx6M/uj8urd6WRAAOKOSgfk=; b=BGHr8emZ1LheOjJufVIsWb/LjhnPUAg4R1SoQ7CNo0zg4MQeiSnFEsZ2OhbFVUqV9VjiNBFmWGkOXJe6dgVJu7CQAo0Nq+XkbfnAU0V3WeLHAk3V1bInqvir8pLIRvQW4bTaAHgZrBEecQGMOASSzPYnAoLFnrRMuKf9jY5zzOliPLdAMpPinKCMJrs4osgCV1t6MH58Ph9ivR8gmyQamTkNSC7yp79v3qtwhHXfEpDl6CdaqjsEr19yAcNiAYaT/I0lcgYMkNCXs4wkS3nNXthbuyr+2o2j5E3cXnEcNHd4Sbo1hO3cv6xaxM6M001gfsByZF3+p3aZb4lQoIO22A== 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=fhQww9H4Ug/YZqWy3+tCxx6M/uj8urd6WRAAOKOSgfk=; b=NRkxrzOet4nAik84m5bqP/19zGskwiXV7U4YOZ1YxkF4NNkY5m395YnZVHoVFHLlHq4/yVKkPugk4XTu2sQydAQEJoVetIc2+urzEyj4FbNCSgSNJqAHDQX6GZeIwClSCRCbEm2uM4qspY/BXeOFDFEl3Swda7fQWRGBvOeUzoo= 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: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:12: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:22 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 11/65] staging: wfx: retrieve ampdu_density from sta->ht_cap Thread-Topic: [PATCH 11/65] staging: wfx: retrieve ampdu_density from sta->ht_cap Thread-Index: AQHVy50LtkZjjwN3TU6ocwOSVEE0eg== Date: Wed, 15 Jan 2020 12:12:23 +0000 Message-ID: <20200115121041.10863-12-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: b3701e95-c478-4a29-46af-08d799b42d72 x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:222; 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: ZVfgNNtPSMmdc6AKVptoSGZjdKYmJGCgP8ABezRxQcFWTJjkbC4y7ql+Bh5fkj2PQcv4ICMU8Djr5189GSFXCK/iU9/QbSSlUMzrqSYS81sajCMmC1nTDiyatrAccP+LSnSu2p+SgTxYLsckPUtowjFD8KvwXVrsMk51XcDodSFoi9icObTX+xMYT9NCOLq6NXR7a/DoWc2NqaM6dqGVpFQzwpCYfuz3YTlYiaq/MCvFnyOXBcSykHDKrDalOTb6se9x4756+DyB+AbAWgHtpOucpcLRNNkq6nupS/YTxTQbENlZSaIwjik51LYDO3JacUMoKOJk/0SX7HX1dkrIGzr3f/hBMW2kyihTSxDVHCeJg9bx4MrALRyN98J9/gmFiPY4IsfWputXvg8OMaXUC95MhOD84Eqson1zspZ2IxYWAesBWqRkHIz7x8faFboU Content-ID: <2D6BD7011FB07D4E986E06A336CDE004@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3701e95-c478-4a29-46af-08d799b42d72 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:23.3750 (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: Ro7gklOEQlLb502GJT4SME24Gr2yM1xji8Ihhc1ojV3wFo2+CIkhDqVOQH2vPXqJn/F6pFx+m9wGgbRU2Q4q0A== 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.ht_cap is a useless copy of sta->ht_cap. It makes no sense to rely on it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 660a75024f4b..f13a5b41735c 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -825,13 +825,6 @@ static int wfx_ht_greenfield(const struct wfx_ht_info *ht_info) IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT); } -static int wfx_ht_ampdu_density(const struct wfx_ht_info *ht_info) -{ - if (!wfx_is_ht(ht_info)) - return 0; - return ht_info->ht_cap.ampdu_density; -} - static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_bss_conf *info) { @@ -870,7 +863,8 @@ static void wfx_join_finalize(struct wfx_vif *wvif, 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); - association_mode.mpdu_start_spacing = wfx_ht_ampdu_density(&wvif->ht_info); + if (sta && sta->ht_cap.ht_supported) + association_mode.mpdu_start_spacing = sta->ht_cap.ampdu_density; wfx_cqm_bssloss_sm(wvif, 0, 0, 0); cancel_work_sync(&wvif->unjoin_work); 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: 11334143 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 92288138D 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 65EA3222C3 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:26 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: 11333899 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 93C34109A for ; Wed, 15 Jan 2020 12:12:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5EDF924679 for ; Wed, 15 Jan 2020 12:12: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="KCNE9nj1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730655AbgAOMMh (ORCPT ); Wed, 15 Jan 2020 07:12:37 -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 S1730407AbgAOMMg (ORCPT ); Wed, 15 Jan 2020 07:12:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J6zh68k01ZrTOlmG93C96OaWRdlFTyyGnwUJHxhEw3Wt6NS5WOa5J+JQZsIlI0XoNdvX755a5aoHbEi5OobMWcT1JQV49gkiUpup1zVRqbfU5Fbjjr4EFxXaeYvzW35XwOz6NR/VsEf07Y3Bm7he4iD9P9bzQUzu05kWD1tUBTJ5Z6AzVAkhBmYB0TnDBJ4M+iL5XNe4wdlVJ0Uipgk+20C2JBQc7J5sqxKm8jhU6RpXxKVjOhZRXJk5TnbrnuK988IoRa4MGFSEkPH9oQ/YDL+LOOEgho27yAHgPLsxAc0a1nwsEE7iFABkKmKdbTFrSvV6Ye0DV0/iC2CrnDZzYQ== 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=TkgqQrIIiJU7w+2JUxpXKH/R2F2qsPbaxSas1tRjHT8=; b=X603RyOwVYi58MELU9aiTtA09et6o2PkGfAUl7kIvkZ59ifPRfiuz2gFT/+MHFfJyuxdVrdDqWkpnCvrbn6atkGFw3gWjqGBCTo0H4zZEEW1nLTLnVQN/iz7hdixSqc/N7HlCBZ4DBLzm/AySr73hrcQVyNFtvWfdkA9GJ4HQ1n9/PIYZmBfZbLyxEcs1ptfwrKIDZ2591KRsLxURZ4+N/bcbJtLcC8VVvg2W69ZeT2kEINv45qwtT0fr5qd2psWgkCz4kwMDkdDH1Z7+QdbSSd8f/UpksNwvBRCpgtMomCngwFDA9eXVZvTtrijKLJxOFzzuZuW/+43myvjr6TSvg== 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=TkgqQrIIiJU7w+2JUxpXKH/R2F2qsPbaxSas1tRjHT8=; b=KCNE9nj1SV3WqpIvopym14gcliFzkybuhFowROUcFrRsHHGrI2ohlNBiZ6+7FBB+uaYHfGeFIkIbYQdBDdjwhVucPe4q1dM2UdMzTi6udFTUrXQDfPrSkhLox8cT6DRCco6ff4BjREWwJdC/HSHd4pkP6zvz8Rxz07e9ANCHav4= 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: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:12: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:12:24 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 13/65] staging: wfx: drop struct wfx_ht_info Thread-Topic: [PATCH 13/65] staging: wfx: drop struct wfx_ht_info Thread-Index: AQHVy50M0EAJP1ADu029KtQ4ImyJaA== Date: Wed, 15 Jan 2020 12:12:26 +0000 Message-ID: <20200115121041.10863-14-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: 042de682-f2cc-48a5-441e-08d799b42f04 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:242; 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: gnki82aZNuguNZgA9k/gphWZgoXKAjbiMWyom6WkCfYjduM+5RruFaCtuoFMAU58QWltRmrGK+3JwwztVW080Of4E8Uirbzw4mh9K0lCvumyfD6ptiNi2uSmAKkq+s9Y94rQdkpSD+SgaL1+TMc2Bzli4rzDaBpMG0MSKTVnF6rpCPVtFEz813ReyFM0iqhBX64UFp5L6anK1KZLgzJbxmMgs/uYyzBRfRt/mZD3QRxLGmkZh5kDKl2N3S3SyzsnQ55XApA5AHFBDVzgDx9oC8PprrWQhD225udCW6yP9KoMYjC++0BbUPmZlgO75lDj7+4bZammeiEJD/Fd0sw9kpGne4edTj/IrfO9V+UZH8+yePZGvT3YPGpht2EMuk7RBEoTCUwlXaJCz2m0h9P2vzCWUlMdTvdqZmZQsOVWfZO/4BXBjZb6k0W8P59bCpXc Content-ID: <83C039817D7DCD49AD70682547D5CCF7@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 042de682-f2cc-48a5-441e-08d799b42f04 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:26.5252 (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: PT/vV4sPAaLrAyldwSV8QnYEJd4EQHU9jVbahw1RegJjm/iIBQx9wrEDOTB33J+pfVt3aZu/K0qDbCcgk0D3Rg== 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 This struct is no more used. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 18 +++--------------- drivers/staging/wfx/sta.h | 6 ------ drivers/staging/wfx/wfx.h | 1 - 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index fcd9fe66e417..dd2d0422c9ca 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -517,7 +517,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) wfx_update_filtering(wvif); memset(&wvif->bss_params, 0, sizeof(wvif->bss_params)); wvif->setbssparams_done = false; - memset(&wvif->ht_info, 0, sizeof(wvif->ht_info)); done: mutex_unlock(&wvif->wdev->conf_mutex); @@ -812,11 +811,6 @@ static int wfx_upload_beacon(struct wfx_vif *wvif) return 0; } -static int wfx_is_ht(const struct wfx_ht_info *ht_info) -{ - return ht_info->channel_type != NL80211_CHAN_NO_HT; -} - static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_bss_conf *info) { @@ -830,17 +824,12 @@ static void wfx_join_finalize(struct wfx_vif *wvif, rcu_read_lock(); if (info->bssid && !info->ibss_joined) sta = ieee80211_find_sta(wvif->vif, info->bssid); - if (sta) { - wvif->ht_info.ht_cap = sta->ht_cap; + rcu_read_unlock(); + if (sta) wvif->bss_params.operational_rate_set = wfx_rate_mask_to_hw(wvif->wdev, sta->supp_rates[wvif->channel->band]); - wvif->ht_info.operation_mode = info->ht_operation_mode; - } else { - memset(&wvif->ht_info, 0, sizeof(wvif->ht_info)); + else wvif->bss_params.operational_rate_set = -1; - } - rcu_read_unlock(); - if (sta && info->ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) hif_dual_cts_protection(wvif, true); @@ -1224,7 +1213,6 @@ int wfx_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, WARN(wvif->channel, "channel overwrite"); wvif->channel = ch; - wvif->ht_info.channel_type = cfg80211_get_chandef_type(&conf->def); return 0; } diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index b5d8d6494157..e0b54332e98a 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -23,12 +23,6 @@ enum wfx_state { WFX_STATE_AP, }; -struct wfx_ht_info { - struct ieee80211_sta_ht_cap ht_cap; - enum nl80211_channel_type channel_type; - u16 operation_mode; -}; - struct wfx_hif_event { struct list_head link; struct hif_ind_event evt; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 0a3df382af03..ba6e0e923f4b 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -113,7 +113,6 @@ struct wfx_vif { u32 erp_info; int cqm_rssi_thold; bool setbssparams_done; - struct wfx_ht_info ht_info; unsigned long uapsd_mask; struct ieee80211_tx_queue_params edca_params[IEEE80211_NUM_ACS]; struct hif_req_set_bss_params bss_params; 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: 11334137 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E9B9138D 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 29FC2222C3 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:29 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: 11334135 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E7830139A for ; Wed, 15 Jan 2020 12:18:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B94B3222C3 for ; Wed, 15 Jan 2020 12:18:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="VK3jC2GO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730690AbgAOMMl (ORCPT ); Wed, 15 Jan 2020 07:12:41 -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 S1730667AbgAOMMj (ORCPT ); Wed, 15 Jan 2020 07:12:39 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CLcXEH/zSiNuU9B5w5J1iM/Ius5BvdDN45Nr8zGQLpyqbXPhmo4AoY4CTP4gOarYb54JjqzgTDA3w+i+f7Vutr524fSEFCKFcMkOkFW6hziDKyMKyTtMz9jiOgCXo/9I1tCl4hloVovE5TQD2wVl0c2dLqTAndbKoWEwNKagqKNRSa71v8+we3grQx614gsge1Zd/7YiR8yu2jNTD/nvr4Pdxe9+CAiUTTeCzNPGaMuEJvpknyF+dtjr0YiJhWuPAgIS/ueQLb+yMxOValV67U1gRiCCDQWb7tosa3v51r/OCtXzrYMZEg3ZSa4CA6Rz4JepchnhC9N66+4cpyXofw== 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=rMWYso2kX8M/LHUfsTraTHNa5REJyaaYdjFoAPnNI5Q=; b=P8zW3f9A4KwyB5uFYclpq4PSloFykOPDNVvijgp54zYq/jNTLiPEA3VHhlJRPn/j5jAO5vCAJOw4e1H1agEdNoNpgVdEdNSF20TBqDAyQGKhrN1JSnQRypciKj2e1abIEN2hlcSUaBySq/BDMtIGivTFHGRFP1mJ0j6c3N5WPxm7iUZCtNTj6AP/YzvwESYP3FJSndJMAKOw/NEgg3wgUHKvaFPgHpNJsMu4YkfeUxarHMRVYX//QiDKtgr5Bm/xNNvJJeEeiYg9P5RYeivPYT961iTQ932g56j16XTejCqsSclzkWLzy9QyvfcWOOqV0UT9fLqNyaDRmpdsIlX2Yw== 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=rMWYso2kX8M/LHUfsTraTHNa5REJyaaYdjFoAPnNI5Q=; b=VK3jC2GOzuvt4WSgzvVJw4YyMMJesLC5efgOlnKtMmQKk8z+MX663FE7pAg2fIyL3Z7ny8eOEFXlD6zMKSKgZ6gTXTNh1PfaXOVeCQimHqWzIJwvppBWq69Jg8r1GCbKErt6rhgMXT482YXlsPljobPdYggNDMBtt5eKGEqQCf0= 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: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:12: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:12:28 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 15/65] staging: wfx: simplify wfx_config() Thread-Topic: [PATCH 15/65] staging: wfx: simplify wfx_config() Thread-Index: AQHVy50O4xaOBsjVYU+xG4wx4XJeDg== Date: Wed, 15 Jan 2020 12:12:29 +0000 Message-ID: <20200115121041.10863-16-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: 8837c3d2-bc35-4e14-c0e2-08d799b430fa x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2276; 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: jIe7Jt4wN3GifHGqGBJZJJATusXENXbTwabQLGNy2JU2CxcYv3AryoghVyXlma2x+61LwIhYOyA4QwGpOF5sjSgzJwTDlknzt1pHcjyKhtcsdQL+2ieobt6f+4/zzh2BXKSBXLy2LcNJdL3Fh0+IxHjUtYmK1lOP2mQenhh2e0QmxLxeUjGSUbFnjgnqGoXT5XC6OXc8SemmVk8Ggd7u3wSmfBpzgagi4kzW7eAjnQ3yRtGV4ZoGucYWxE/EvWDBSRfp7IeSfn4g88drUHT4MD7Jvtts00a8IBmwDf+g/61jpIzk9HdYM+eOBV9F6QIOt05YDy3I1pxiVJhOa5Z291rYwmXHbkUqF/iAkcrKxukJRowRdS7s8UUtiABGu5wIxK8lBEje1c3s4Qp113Lcs0rfu94Caf/Q53UNjYD7u7TZMlzAXDo3Nzhg2zEgcJps Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8837c3d2-bc35-4e14-c0e2-08d799b430fa X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:29.2946 (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: XLeTU/V2R9RNWhpW5ZEMFKpJw4GFOYLUUbtluf2p+t6AtEqrJzNpHZmdlW5fd1wZQoQhPkQjt8B9AhF8J6QlVg== 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 Now that wfx_config() only handles IEEE80211_CONF_CHANGE_PS, it can be simplified. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index a0f19d33e972..451d0108a1b0 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -1230,22 +1230,13 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed) struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif; - // FIXME: Interface id should not been hardcoded - wvif = wdev_to_wvif(wdev, 0); - if (!wvif) { - WARN(1, "interface 0 does not exist anymore"); - return 0; - } - - mutex_lock(&wdev->conf_mutex); 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); - wvif = wdev_to_wvif(wdev, 0); + mutex_unlock(&wdev->conf_mutex); } - - mutex_unlock(&wdev->conf_mutex); return ret; } 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: 11334133 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9FC1139A 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 BEBB5222C3 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:32 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: 11334131 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 638FA138D for ; Wed, 15 Jan 2020 12:18:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 38726222C3 for ; Wed, 15 Jan 2020 12:18:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="SxOyG89c" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731637AbgAOMSb (ORCPT ); Wed, 15 Jan 2020 07:18:31 -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 S1730705AbgAOMMo (ORCPT ); Wed, 15 Jan 2020 07:12:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iutFJARPyJojSa+fh0ilIdC2cSdUrq8WtT6gPnb3W+PSkXPB/BMdUs2jm9h8ckELt/3w9LvFyNOg2t7QqubSUnYWWtMNtS84UO4eX/6lL5Kpr0JNRszYZdh2qw3NpAyESyzJAnu/j+xgg54het7IdmDFvMU279vydedYRWr2NJleDSHfrusH4kcN2e3djL9N/EipTKd7mV7XuJkVuqAiAzS/UKIFDuOv4Iw/RiTc+polDx7iPFB9Id4YJ1hXEpNmnwxjfSJuMBIAhylThjf0cQzUK6YQebmRuWLDpd7ctm7zQ5UWaVrASffMgQ0tkFy0AXIrN84h/QoXyGG2INGxxQ== 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=vzVf8PCsjhv48CVwVz+IbX+oGTKM2/8Ap4mn8+5bTGE=; b=YaRYrWusylgzNQ4+nWE71tpwWWTmSvEaFh6/rR3KS4Oir0upLI+ef8tOrhDstnyMC9nuIYf/Oyr3WeU6tINhCHcdAEU8VQ9rfThmFESW8beLm4Gmmihw//OUt9yfsThNYiMIStcx8aBWy0OFhlpJyQIUA/VMHvAsvVh6uuhsE6OKnuRl6nQtsFuYJ/Olqk9NGY8R3ymDAcnXy4DaRDiHR+FqCApGWIpVy3UcvYhuwi8pSo6jRWsiHE8iok0nA/ivFzHHyYPZkTLlOAxCqHeR/fV6BlOWF0SIJZW0MoqP3gPiVWVryX1w5brcnQG+TReyoQL0cE0PIVsMVQGrsP/kSQ== 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=vzVf8PCsjhv48CVwVz+IbX+oGTKM2/8Ap4mn8+5bTGE=; b=SxOyG89cI80V0UOFIQ60Oz5rfMzI1RulYyaPKitia34DJnrANa1upLwdUmmm+nXHR4tRhjs8tGGtp/vlvoa/VkWyf7rZghMvysyeQ++QsFKIk3ZXfTYENzJllEevh8UXoftJnoSC6UTnG1BbboJc+cmQxWr/T6Ii+nc0JxmslcM= 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: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:12: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:12:30 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 17/65] staging: wfx: simplify wfx_upload_ap_templates() Thread-Topic: [PATCH 17/65] staging: wfx: simplify wfx_upload_ap_templates() Thread-Index: AQHVy50QtpQv9u8EV0+rKqOV6r6udQ== Date: Wed, 15 Jan 2020 12:12:32 +0000 Message-ID: <20200115121041.10863-18-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: 44b5923c-d3cf-4cd0-c603-08d799b4329a x-ms-traffictypediagnostic: MN2PR11MB3934: 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)(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: J24eyhQJNAb6+g3tOSgGN+L9s9BQs08aaR3aynAQDVKwfN+Pb9/rb9F7NvKF1LHrwVa7oWF/3fW5LnEsIbv/7tLWk8OqQVlMiLUw3+S55YT3g6Vkg+N8nxxvwJLb3ZrwQiw7PmzIT6ecc2lbQtU94s4atZqDH9z2FJ/PlDeSLi3xbgaNHpZ/dQsZlmlIbKG+YqG3YwBWNBl0gcjLNoqKfkPVewaminCUNsxZ6vyEuLV6aI1dc3Qqnt+4q/BmTwH/DhR5LDgLraqUei2FBu1K5cFP9oueqaL2G4d8Ir/bNtUV5AoLCCMOS2dSmGYZAusj5T1J6O4955M2WBlptErzEH592ztoK8YhK2vIll68IERaPd999qIniWCF5WCEsX7/K+eOmJEAKqQ8YIFcgG+mYqutLZJikrHF3twqB5vnHprXFLDEERgz//nkbDPJStzm Content-ID: <4B9ABF37F3FCBC49850B621DB93AB3F3@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 44b5923c-d3cf-4cd0-c603-08d799b4329a X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:32.0120 (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: l8RxNVWBaiOFLYjGToGwFXqgMTO9+OuFZ+wRskBkUnjd7fcOs4e8g1FyKPy0WwQWfYoDS3QH2SPusn225auOpQ== 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 This function built probe response from data retrieved in beacon. Yet, this job can be done with ieee80211_proberesp_get(). So, we can simplify that code (and fix bugs like inclusion of TIM in probe responses). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index fdde7ab92302..1181203489f0 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -783,7 +783,6 @@ static int wfx_update_beaconing(struct wfx_vif *wvif) static int wfx_upload_ap_templates(struct wfx_vif *wvif) { struct sk_buff *skb; - struct ieee80211_mgmt *mgmt; if (wvif->vif->type == NL80211_IFTYPE_STATION || wvif->vif->type == NL80211_IFTYPE_MONITOR || @@ -795,14 +794,11 @@ static int wfx_upload_ap_templates(struct wfx_vif *wvif) return -ENOMEM; hif_set_template_frame(wvif, skb, HIF_TMPLT_BCN, API_RATE_INDEX_B_1MBPS); + dev_kfree_skb(skb); - /* TODO: Distill probe resp; remove TIM and any other beacon-specific - * IEs - */ - mgmt = (void *)skb->data; - mgmt->frame_control = - cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP); - + skb = ieee80211_proberesp_get(wvif->wdev->hw, wvif->vif); + if (!skb) + return -ENOMEM; hif_set_template_frame(wvif, skb, HIF_TMPLT_PRBRES, API_RATE_INDEX_B_1MBPS); dev_kfree_skb(skb); From patchwork Wed Jan 15 12:12: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: 11334113 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 575AB139A for ; Wed, 15 Jan 2020 12:18:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C292207FF for ; Wed, 15 Jan 2020 12:18:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="LHrbR3Q+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732419AbgAOMSQ (ORCPT ); Wed, 15 Jan 2020 07:18: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 S1730743AbgAOMMp (ORCPT ); Wed, 15 Jan 2020 07:12:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lWGAI9TFlapsI6BCaR0jtwJJkLtk0Zg8ow3EufufFLe9CczusR7AkvTwyxFhWlKSAcHxAOLod5Oc/J+7XWTkqRghwcCAfOUKvgL1jROAgdj93D1THv3b2OTIkJw76raA4wLWliK4NrNd9uSnzMfxcAYZJCSuAzt+4CarWD5gV14zQ9n+937hdqx3WAbGovYDWlkfkMiLaF3bZen8ib5XNEt8shfZu+bZcvKROJxXLe9hnm3ZLZ6td1yLsvOhIPq4Kv263C/hl1uYHUrTlDxCMA2zLj4DweE412eXsQBDlR28BELSBAz3m/JbsmF6n9RpzVCcvoGwktt1OQrIncfUpQ== 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=0WFNk92WggXIov5lK4aFRHDtvXTnPFFcz9MaezpiQ+I=; b=lezj/AAEk2gBxEcnggDmPQ4sfhqS+r4ChZUDZQpXo3xAcyrZIz0J/cSRwHValUyr6nfLYj+JIAcpHhYHnkG0SvUqFJxBQHCTrt4kG7VlAnt2edeFKXC9wK5Lk08R777P4F1sBQwpYwg5YCRyzJeiqbf6X0I9U/5KhaJxvwLQF1gDwXUhN26f2t6BcpuESX7jUVPfmu643wOVYtW00NekuwQ8dLm2FCKKQAwBu7RYeoz1aibiFWjpoS/aP8DpHYQJMWfXbav7OF73jaHbF1qjR+CWt5int4x+Nnfi11LGEkBwD4W/Cf6vbsoy+bD23oFLzlT5Iq5mR6RTUnpEIuLyeg== 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=0WFNk92WggXIov5lK4aFRHDtvXTnPFFcz9MaezpiQ+I=; b=LHrbR3Q+f6F6BpP1Tl9O+QQr4uv2CERahdWitv2Z0EZ3OfVm9p1oVRq5wgpg/SVwoR2fX+C6FdyqT5pzFnZoxwctHfINR5b+PSCjeGwlpShcO5KBKQ7WR9TY9QZc8FBCBVhvV2Dpot44QL06SfflKmObXZxIUSZ8RLYVTsUVy8s= 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: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:12: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:12: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?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 18/65] staging: wfx: simplify wfx_update_beaconing() Thread-Topic: [PATCH 18/65] staging: wfx: simplify wfx_update_beaconing() Thread-Index: AQHVy50RM8ificUHMEK/z+6ShGWyAg== Date: Wed, 15 Jan 2020 12:12:33 +0000 Message-ID: <20200115121041.10863-19-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: e1413e43-5ac5-418c-0e4d-08d799b43366 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:883; 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: iTMbUIbHOzA2KIScMMSRuSWzJ8i3bQ4iLDvJYtDCRwz+gVhkIOHZmHLnYgekN4QBb+xwDB7m0OoG9sfsaiRRvVm+KRdVtuMXz/ID4sH5LEkL59pJEvgPZlA4YUElcLnHTT1tJzqWaHI1LJfsT/sukxb/967p0Eylnz5BWNP2eplLa66QOQbAOnbdqVvD0aDaJdWvbVNe3UnKsFW2zF2vZGoxyc+qvmxadVbwSk9NYumUV6ErWUrjxdWqHfwB/bfos9pqO5C4vuLwASpOon9AiKE5GfPLJzPddGaCiR57wfF/XsFg++BEoMfLu76ITvw03VxKUmZlNFpcTftk+RBP1iVz26Lru64PSIvHCatCZFDB2rf2xQbCvRAtkoUsRLukeGhT8CSrkGku1Pl6KgUKbfuxKeXdCtb7y2MQThiz1dagEoSS702EjP6WVBRGlrTj Content-ID: <7607017DFEEC264DBA3A71FAA95E0406@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1413e43-5ac5-418c-0e4d-08d799b43366 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:33.3462 (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: 40S3PGBSkj5+Sa5YGP9cz+XUCitgIlaVMZl3HHAJ3jNwoisQUlKIkUyhQ8Lo6AMML+rbJLf/5qlOJuxdDq6x5g== 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 Remove most of indentation of wfx_update_beaconing() by reworking the error handling. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 1181203489f0..0c73691ab736 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -760,23 +760,17 @@ static int wfx_start_ap(struct wfx_vif *wvif) static int wfx_update_beaconing(struct wfx_vif *wvif) { - struct ieee80211_bss_conf *conf = &wvif->vif->bss_conf; - - if (wvif->vif->type == NL80211_IFTYPE_AP) { - /* TODO: check if changed channel, band */ - if (wvif->state != WFX_STATE_AP || - wvif->beacon_int != conf->beacon_int) { - wfx_tx_lock_flush(wvif->wdev); - if (wvif->state != WFX_STATE_PASSIVE) { - hif_reset(wvif, false); - wfx_tx_policy_init(wvif); - } - wvif->state = WFX_STATE_PASSIVE; - wfx_start_ap(wvif); - wfx_tx_unlock(wvif->wdev); - } else { - } - } + if (wvif->vif->type != NL80211_IFTYPE_AP) + return 0; + if (wvif->state == WFX_STATE_AP && + wvif->beacon_int == wvif->vif->bss_conf.beacon_int) + return 0; + wfx_tx_lock_flush(wvif->wdev); + hif_reset(wvif, false); + wfx_tx_policy_init(wvif); + wvif->state = WFX_STATE_PASSIVE; + wfx_start_ap(wvif); + wfx_tx_unlock(wvif->wdev); return 0; } 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: 11334085 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D15C7139A 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 9969E2467A 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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: 11333901 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1866D138D for ; Wed, 15 Jan 2020 12:12:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E100B2467C 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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: 11333909 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31948138D 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 F03A822522 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:38 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: 11334123 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8EB6138D for ; Wed, 15 Jan 2020 12:18:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A438C222C3 for ; Wed, 15 Jan 2020 12:18:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="TNQ+1hu6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730741AbgAOMMo (ORCPT ); Wed, 15 Jan 2020 07:12:44 -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 S1730698AbgAOMMn (ORCPT ); Wed, 15 Jan 2020 07:12:43 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YUqoQJH6ZfLWqE78d/3mCYzbCh7IESQyd4bR6V3b72TtNbVbUPjum0I60aaQaVb1BwOzqm3vB0ueiKCNOgYbAqMUMEwr/gYzQrFEXrd/K2y8/4dUttUC+CPTVHPRsQqeRG/wPJUD2MFBI42qsvwy0Sw2qB3jzk3Z3jUbGV4EOC8G+aHDUKagSh3lv1zYgKvNN77v1A6pkVDggqTguGrp3bYuY+bTsN2BATY8ouj8YTs3sgebi7s9mK9AgSb0YNG+IQxyiETX18liFp6U0zVXL0YtFSlh6Vfs/fWECD7PptNw389tYv1KVL/6veD+tuJMbCbAiGWh+1P23iDNQIE83w== 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=b50yWk0WdKoZEN9INKqfong0gAhkN4IuUW7QgFNvUOc=; b=b0Ri/iRh+CQQ+D+h0l0liSHW6FhipwDHmQ0UETTnWe73n/WqjpeuvAEiIkGv5KG6MW8PILDRMsb0cA7/6TRVRPooBJuyxHfaRJSAGzf7bL25NnTfNPfcwkj0jREWMJEzPZzI4ToskZU0z5ehJOeoOIT6MBG39cvYRcssHvNFyFsmJwoNw08OfKuhuOsldID3zcFfIx0TqM9lPpkBu2uBHaLYrXZitbi81qkyDFJgh2eJsfYmZVHTri+8NwPSCu+ZI1HGzrtyQId80PpfZm7tBSUclDgoGeGjMsy13h5U7EeLQmRL+jrOoYKOlhxwM6tVFl/kM902Lkd8gKElInc/Qg== 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=b50yWk0WdKoZEN9INKqfong0gAhkN4IuUW7QgFNvUOc=; b=TNQ+1hu6/10rXS87I+UUzPng1hQaRGPA8kin2h/6l5H7Iy/DIiV6ki4EV67f2EdKpkK6TYV5/+nBbZZUWkN74HEDPL3EVKUXuJkYM8Xds/ClOMpmaKHCzH01aZmr05qA4dVzUD1e9psWDMdbAsCnMHsNRe9Mqg/lSaZ+4YLGt0E= 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:38 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:12:38 +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:37 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 22/65] staging: wfx: drop wvif->dtim_period Thread-Topic: [PATCH 22/65] staging: wfx: drop wvif->dtim_period Thread-Index: AQHVy50UQPIxOEH670msKKVPymhU0g== Date: Wed, 15 Jan 2020 12:12:38 +0000 Message-ID: <20200115121041.10863-23-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: a8d35155-db27-46bb-6034-08d799b43686 x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; 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: J090Owbzf/Nbuc05nZRHJKsJptsXbzahK6wtFK/Oqzw8e2aun6qdDob/tc2viWu06A9/EiH9SgNvgCHidAe6hF4s+lR48J7qiCif5NMJCi4whAJvyskKiaej5NQqYofFtHpazJ6C9/1ZI+/eP4sUK71ceIlrF8W40iqQXGn/1HZpEeIUYzKw/8KDBJBhZXle99NdLnGl+5W7Umz5aaXHws53zzzCupAjrmP4UIZCZXqQlmYqNqhGiLARCGWWOkYUnWwTvXBxQMV6YDk8SudrmzxblLa24i79A1JihdZshm/7XFeuHLkGO1ZFvlSSWFIxFpn+kcYElQEOC0cmWlLvmQr1r4xVRe2SWJNSIMDBiTA0oZ9j079Nx+9cnk6Si6WfnTMuu1iZBmKY6oJmq0fF4aa0rdkPZqGT/hxhOb8uJLX740FmhhTkPKmZ5731pUBF Content-ID: <9AF613F12ED9E743A39CBCA025978E58@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8d35155-db27-46bb-6034-08d799b43686 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:38.6042 (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: 6D3wvYpOcqgw4U4XGaB85BIZiGpPD4biRuN1vsr3GfNPWl0+S5r+VxJd+crUdVd2SmOYs3nFXfxgUDfwHvKnDg== 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 is not necessary to keep a copy of dtim_period in wfx_vif. Prefer to just rely on bss_conf->dtim_period. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 20 ++++---------------- drivers/staging/wfx/wfx.h | 1 - 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 1af99b7930f4..376451433e9e 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -464,7 +464,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); - wvif->dtim_period = 0; hif_set_macaddr(wvif, wvif->vif->addr); wfx_free_event_queue(wvif); cancel_work_sync(&wvif->event_handler_work); @@ -557,10 +556,6 @@ static void wfx_do_join(struct wfx_vif *wvif) wvif->beacon_int = 1; join.beacon_interval = wvif->beacon_int; - - // DTIM period will be set on first Beacon - wvif->dtim_period = 0; - join.channel_number = wvif->channel->hw_value; memcpy(join.bssid, bssid, sizeof(join.bssid)); @@ -701,8 +696,6 @@ static int wfx_start_ap(struct wfx_vif *wvif) int ret; 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; @@ -766,10 +759,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_sta *sta = NULL; struct hif_mib_set_association_mode association_mode = { }; - if (info->dtim_period) - wvif->dtim_period = info->dtim_period; wvif->beacon_int = info->beacon_int; - rcu_read_lock(); if (info->bssid && !info->ibss_joined) sta = ieee80211_find_sta(wvif->vif, info->bssid); @@ -804,9 +794,6 @@ static void wfx_join_finalize(struct wfx_vif *wvif, wvif->bss_params.beacon_lost_count = 20; wvif->bss_params.aid = info->aid; - if (wvif->dtim_period < 1) - wvif->dtim_period = 1; - hif_set_association_mode(wvif, &association_mode); if (!info->ibss_joined) { @@ -1055,9 +1042,10 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) static void wfx_mcast_start_work(struct work_struct *work) { - struct wfx_vif *wvif = container_of(work, struct wfx_vif, - mcast_start_work); - long tmo = wvif->dtim_period * TU_TO_JIFFIES(wvif->beacon_int + 20); + 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) { diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index d201cceec1ab..bd4b55e07c73 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -98,7 +98,6 @@ struct wfx_vif { spinlock_t ps_state_lock; struct work_struct set_tim_work; - int dtim_period; int beacon_int; bool enable_beacon; bool filter_bssid; 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: 11334129 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F2315138D for ; Wed, 15 Jan 2020 12:18:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6487207FF 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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: 11334117 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B4F17138D 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 88DCB207FF 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:42 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: 11334079 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7032317EA for ; Wed, 15 Jan 2020 12:18:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4511D24671 for ; Wed, 15 Jan 2020 12:18:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="B9UKXii9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730790AbgAOMMr (ORCPT ); Wed, 15 Jan 2020 07:12:47 -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 S1730768AbgAOMMr (ORCPT ); Wed, 15 Jan 2020 07:12:47 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H48j5rsNlMcwo2UslbG/uCUru8vN1eI7mVVWi24+qGFmGNOoe+T5fZ1gLQF8+7zdBSUDh5t3KO+Zt9vEG/dDJHjEvoMU10zPo9nlWJI3/rSYyC72rOklH5F4vpJJOhYzHotY7geYZ5kTLRoyzUQsOkms2aUpHbCgVwOzV6IxGJUMk8MgYO0pEtv3mxXxNbyzMgfQzawZJUFtUtpoIia7GxHHXKKL1daExmlGmAHzBwKmrouO4O/0bNClZiBhcnUK8W8+w1gLLqcpIbhCA/txKl6iNDr+L7+jwz7F0X9g3uWXiNYtKzvH5wo0l52jt3PuYWuKJL8UHQ/UuHOaD1Jl6w== 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=tjKAuLPHt5gNg/Eo1CFrDExKSrzLBhwAanAjvAIxEpw=; b=XDIR5hJwkqXsiBX4yRAmRA2zrvhV3lGU9x5ccEMLrd4xJrTx6/Bt44y+c2d7hJi8e5z9cnxDw4DWGLRVSfdAQQfcRP74Ef9/JfUaaSh6WXyzzNK4Skykjf/RYRY1tZoaQbBH1EPemagmScQwQU2G/vMzvu/0zudi8agybzAJc7dQnm2TvOy1QtxOV2poQOLWpPsNh93BEvf2HqCNkIBDFNX01tsbZvvXAgYR6Z9ZI9S+6WdNbp4CpCSBW1cUusGIg19Z7nXwk40VJ8QUpX3//JkHoFpMDohbrbCyKwPfG1G8rLFdSoktibfl00ecCB+do7oQNKag+yXfAEZJezkbfw== 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=tjKAuLPHt5gNg/Eo1CFrDExKSrzLBhwAanAjvAIxEpw=; b=B9UKXii9bmPwmDNUpanH7WeWNp39UXpDNw664I/jA6m0Wzxz55tb+K/eNI4edBDyAHe0q0KCQNYvlPtlCUL7FzIr2rSkF4YeTZ2nLC8aYcMvv4ZLJgRy8r69jIltKTngw5vDtCUJuD4JP9A8cJsjXIN9jIFtrEq6UVPJnj/spBA= 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:42 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:12:42 +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:41 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 25/65] staging: wfx: drop wvif->setbssparams_done Thread-Topic: [PATCH 25/65] staging: wfx: drop wvif->setbssparams_done Thread-Index: AQHVy50WzQfPu0vHNUOzW0r1UjWjTQ== Date: Wed, 15 Jan 2020 12:12:42 +0000 Message-ID: <20200115121041.10863-26-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: 270c3111-4dff-4aee-7a72-08d799b438e5 x-ms-traffictypediagnostic: MN2PR11MB4096: 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)(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: iY5V72mlDdlh+oqsENl/+Z3Y1pyXDP2AllKH4wYnXppw775p7q5CIsIV4R8Kr3Th0zanfllM596pw2yBVXRpDhzwhYbXjNIspDtoCiPqQWgQPRdIT0MEO8NwtHHCUaxWanw2O25FosM5uS3tEo/VedassqWmFn6314t35qQe8iByaE4mwfd1RIZtomQtFNwEz1czGb7oj0oz+QpgJdewlNPH+hgM5Yfb51oXaEGPIDG0f3rA6u/Czv/AcWv77RTNJWV2AGAlskjMZPpCHtwKomO9FZ692T1BtcyRn7ZQAOWgjrANMX91xnLiQE0OFocy4+ea4CqOZny+JrPZNrvCSFDRMjsVO4+0B1CyVIJwD4TOsfocZYI+NEqjm1Xb3snF7oGBjLJ6bE6f1908o3ySijxdcznefqph9wz0xw7NIRysF1HROFp8y+mhapq3J5tK Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 270c3111-4dff-4aee-7a72-08d799b438e5 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:42.5789 (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: lwYIWj0HkurDu5ZdfS0mPfCkqg6ovO0WeF2nmYxocakdVuEJ0JnvreqWDUvmiDlB63X610gLoe2+RIacVl2G3g== 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 setbssparams_done was here to ensure that the firmware does not enable powersave before to get the first beacon. However, mac80211 already ensures it gets a beacon before to associate to the BSS. And even, if it won't, the firmware wake up at least on every DTIM, which is sufficient to finalize the association. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 8 +++----- drivers/staging/wfx/wfx.h | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 021daa9f7a33..7abe272ddc0d 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -326,8 +326,7 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, hif_set_edca_queue_params(wvif, queue, params); if (wvif->vif->type == NL80211_IFTYPE_STATION) { hif_set_uapsd_info(wvif, wvif->uapsd_mask); - if (wvif->setbssparams_done && wvif->state == WFX_STATE_STA) - ret = wfx_update_pm(wvif); + wfx_update_pm(wvif); } mutex_unlock(&wdev->conf_mutex); return ret; @@ -475,7 +474,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) wvif->disable_beacon_filter = false; wfx_update_filtering(wvif); memset(&wvif->bss_params, 0, sizeof(wvif->bss_params)); - wvif->setbssparams_done = false; done: mutex_unlock(&wvif->wdev->conf_mutex); @@ -799,7 +797,6 @@ static void wfx_join_finalize(struct wfx_vif *wvif, if (!info->ibss_joined) { hif_keep_alive_period(wvif, 30 /* sec */); hif_set_bss_params(wvif, &wvif->bss_params); - wvif->setbssparams_done = true; hif_set_beacon_wakeup_period(wvif, info->dtim_period, info->dtim_period); wfx_update_pm(wvif); @@ -1224,7 +1221,8 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) INIT_WORK(&wvif->mcast_stop_work, wfx_mcast_stop_work); timer_setup(&wvif->mcast_timeout, wfx_mcast_timeout, 0); - wvif->setbssparams_done = false; + memset(&wvif->bss_params, 0, sizeof(wvif->bss_params)); + mutex_init(&wvif->bss_loss_lock); INIT_DELAYED_WORK(&wvif->bss_loss_work, wfx_bss_loss_work); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 1b487d96eca2..5e1a763eb4b5 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; - bool setbssparams_done; unsigned long uapsd_mask; struct ieee80211_tx_queue_params edca_params[IEEE80211_NUM_ACS]; struct hif_req_set_bss_params bss_params; 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: 11334073 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B648139A 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 567BA24671 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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: 11333913 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9412C109A 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 69C9822522 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:46 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: 11333907 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C6520109A for ; Wed, 15 Jan 2020 12:13:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 912E5222C3 for ; Wed, 15 Jan 2020 12:13: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="orJWJUmx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730926AbgAOMMx (ORCPT ); Wed, 15 Jan 2020 07:12:53 -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 S1730879AbgAOMMw (ORCPT ); Wed, 15 Jan 2020 07:12:52 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f7PnEw2eJF6uGmfIgXn9RNVwgOtBzSNDEyPQM9dpoG65auZX5vUTUcIv9jsVsuG4dAqxX3d7dS53lXR05BK5W7WC0b6EF0bEee69pRW93MBDU+XBbO40qUzRF2zAPxooOVLHXbjkbN8yxUbh53ur7ledXdgsI9dnJMWzLjk1X9iRyMd2pk7NU63BJS+OJXuehr9cFE9H2EEbh1CxMAA5i81ue0CwRhEFMamflLwt6BFG2Wz0/f1UeMqdYkdtKUjWDYLocuFgOR4rS0PqqEekNM/1/vnnR96i0UjNOLdQKLdsd5xBh4gNF8DG/jQ2gAiymEwMmgbtu23qep17CBMMuw== 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=8Z6eY3YKLacQ9BswNsaslS7+IH+navlKtJGAw9pK9io=; b=BunwQhXYN7gGpQJBlzA290AIVMuRf/BSA0ipy83JgRQVI1PmrmpJH2UgvUI/I7x9rcfIJYDMm/RE8kwQKsAfIGuj4sUVdAKqp0Ayw+HMBEMD3WFwiLELJ5m2iy2l736OcfFu/hNOVtH6m8HS/CuvEUwhqCBQcTCItKrPNgE1NUb7WL2pIKp2LQfEedxkiqe5vlsF2UJ81I+eNnKM+JaxRpn0IUu62V9W+LxP6pTZ8Rcnk2eu6Nl90cZ4vI7fy/jv0pH3kmfWyUuo/t0G7781rt/ypsujFcW4OT/JQH+kVdWv0eeX3WZIezcXCz5oJuwkuHwtSDt50Z9ksRkeGfeklw== 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=8Z6eY3YKLacQ9BswNsaslS7+IH+navlKtJGAw9pK9io=; b=orJWJUmxIX7Q4E4j/F0U7UeS7eL1g72FeO3D/3hLFTgo5DoaYRl1wsQLr/lgVK1Dgw0Zj8TxBggwXcH76Y0Ea2VwsTyskqc+hss2FTIPIhQaJ0AuH8OUptprVNEyldlJDRe9PeQ1pZkMIdzoWjAcr1usQdGrsF8tipg77X5HhlA= 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:46 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:12:46 +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:45 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 28/65] staging: wfx: simplify hif_update_ie() Thread-Topic: [PATCH 28/65] staging: wfx: simplify hif_update_ie() Thread-Index: AQHVy50YupA1e6y6AkiqEv066abeeg== Date: Wed, 15 Jan 2020 12:12:46 +0000 Message-ID: <20200115121041.10863-29-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: 2f31d902-a808-4da9-1f8a-08d799b43b44 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)(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: Gn/Uv1P4fUIgLgT6GRpAXpVQ9jvH/Y19J3H8P0eGq+xHOjaTbTYrEuEWGpgqnAVtHTrv8Q+YiAbG74vKDnIA4aC7xSNBGNILuRk9UdKZtRNZYK7s2LkZEx5ryXJ1/iouT4mCqFSD95DNDYbxnk+DXqL054tdjCgh7L9vKDXTF5ZuQuAePKQglu7l7T/aIxM4kxrAcS6KJUyUwWypbKLBPB56OGcWHAz1r9ekb+00A8A/d7ykZJ54JHCrQzHqV7X43Zo4HRC56xDuZ4d4necYYdxLY6Docqcg9NSGTR1ItIZfzUChDJTtORIm9PudcZy2cIob/iEqm3WfmI++hQILMKCCcANlvF9XD+Sh5ep3Vzc89wQmMOOOQgisF8c96XHI5rNvzWYthtDIDNBVdRkRu1io9Vi1h3jbT+aKgOIWwAtAO3j1U5BAmJ+8WzRMPewO Content-ID: <343652A732663245BD14DAB38F2C0534@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f31d902-a808-4da9-1f8a-08d799b43b44 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:46.5416 (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: gczfl82uT8m8+D2P5WYI2IdqxyD81xVaJI+P4jwSt9T1wf7YdTNGsuWnLO+dvQhZNP0uXtlOzaMpZu7oK1aNlQ== 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 hif_update_ie() is only called to change the beacon template. So, specialize this function and simplify the way to call it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 5 ++--- drivers/staging/wfx/hif_tx.h | 3 +-- drivers/staging/wfx/sta.c | 10 ++-------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 8df6e43fe742..32eeba2fca47 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -461,15 +461,14 @@ int hif_map_link(struct wfx_vif *wvif, u8 *mac_addr, int flags, int sta_id) return ret; } -int hif_update_ie(struct wfx_vif *wvif, const struct hif_ie_flags *target_frame, - const u8 *ies, size_t ies_len) +int hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len) { int ret; struct hif_msg *hif; int buf_len = sizeof(struct hif_req_update_ie) + ies_len; struct hif_req_update_ie *body = wfx_alloc_hif(buf_len, &hif); - memcpy(&body->ie_flags, target_frame, sizeof(struct hif_ie_flags)); + body->ie_flags.beacon = 1; body->num_ies = cpu_to_le16(1); memcpy(body->ie, ies, ies_len); wfx_fill_header(hif, wvif->id, HIF_REQ_ID_UPDATE_IE, buf_len); diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h index fbaed991b112..924b889cad0a 100644 --- a/drivers/staging/wfx/hif_tx.h +++ b/drivers/staging/wfx/hif_tx.h @@ -57,8 +57,7 @@ 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, - const u8 *ies, size_t ies_len); +int hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len); int hif_sl_set_mac_key(struct wfx_dev *wdev, const u8 *slk_key, int destination); int hif_sl_config(struct wfx_dev *wdev, const unsigned long *bitmap); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index e02ebc39ed41..395a282346b1 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -881,9 +881,6 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_ASSOC || changed & BSS_CHANGED_ERP_CTS_PROT || changed & BSS_CHANGED_ERP_PREAMBLE) { - 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); @@ -892,7 +889,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (info->use_short_preamble) 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)); + hif_update_ie_beacon(wvif, erp_ie, sizeof(erp_ie)); } if (changed & BSS_CHANGED_ASSOC || changed & BSS_CHANGED_ERP_SLOT) @@ -960,9 +957,6 @@ void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) { struct sk_buff *skb; - struct hif_ie_flags target_frame = { - .beacon = 1, - }; u16 tim_offset, tim_length; u8 *tim_ptr; @@ -987,7 +981,7 @@ static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) tim_ptr[4] &= ~1; } - hif_update_ie(wvif, &target_frame, tim_ptr, tim_length); + hif_update_ie_beacon(wvif, tim_ptr, tim_length); dev_kfree_skb(skb); return 0; From patchwork Wed Jan 15 12:12:47 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: 11333903 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D2FF17EA for ; Wed, 15 Jan 2020 12:13:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4817924671 for ; Wed, 15 Jan 2020 12:13: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="AFpXz8FT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731011AbgAOMND (ORCPT ); Wed, 15 Jan 2020 07:13:03 -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 S1730909AbgAOMMy (ORCPT ); Wed, 15 Jan 2020 07:12:54 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UOfvYWqLe3RYbVxRB3aCNpKXsxc7srhoU6qER8pC4MEaMwmgSB37gkoJNgtJKPgdvx2TQUq+QIjLKEdaxcQX0SMgsLJdgtZ6e48MVRGfKiru2/Iijsryi9KPf4X4yW+axcEYdSjuXdKiMcFiE9LyS6C6AFSJny8WY2wiQbHquSFz2SE2QeRhhx3FOFjM4zTFmKO3i/kJZ2IFGQ8p+kmJ6PeS5uxiMjKtDIu31sT63++EIi9Dne7cDjLEKDWYmj7mO3Vd1D9g7+IyorxCwW5pwUZv/8jptTSTYLUZtupK/Uhz8U8hSjUqv8roaEq5Nt/0IoAxo0abIvXDxCo5f4RmEw== 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=lh4Sgj/UN1E/Qd8hmHGGL7HIEuTRhUu+NasuAtyaxyw=; b=ClC2R0B1Y4NTspszJaKIQB6TBdVvSs5nXMgxP+tdgHweL108zrbn8ocYcnTjzXEvVfX7lu3+0x1LsgDNtKUcVj6S+5SvwuVx+666HEfoJtRmQwqfscKG2jLeeXugTYU4cv8Gy8J5+V/nHkLTDqXWOo8FMo517lwFIKze5O3a5z3fZOu8PP5qwMCW459DXY6eDCWvicR9kwxaO2ZbX600o7sD+2SKKnr78H3/mChuHOc0/bA0AIqvtCDzXUhWFfrG09tQADCJ9IPrW7Z9jqviDHPT8vEykCBz/FhG+cB40sQj755mJj/81eC9ewNZaYe5fyt4PWdKVGOgiWRa43tAEg== 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=lh4Sgj/UN1E/Qd8hmHGGL7HIEuTRhUu+NasuAtyaxyw=; b=AFpXz8FT5txLxDzJ63zBNh5MqIg6nQksSMY+Mt0AZzrxc9FuP+C0YG2TxbKOyw91VIvecgUI2wgrW/CTye+f/as24xF7IsDZ0f29sC+VVj7czi75aUsTeqlDwkV7M7kjo84MZXRgSsi+NDZX9lCtT7BzHBTxdNL4ADb4jro9gi4= 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:48 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:12:48 +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:46 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 29/65] staging: wfx: simplify hif_join() Thread-Topic: [PATCH 29/65] staging: wfx: simplify hif_join() Thread-Index: AQHVy50Zs0mNUkjhK0qvoyD02QNuJw== Date: Wed, 15 Jan 2020 12:12:47 +0000 Message-ID: <20200115121041.10863-30-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: 833d5f0c-9616-423b-8eee-08d799b43c0f x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3173; 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: JDr1x/pOs94axCuPEgKl52vpYBWLCjKQCjeTrqtwkXlCLifJW4T0+DaBLGVxdRiXaGjZDb1gDeJVxWLy2WCH7ILJTBhqLAjRTiTOgN5jDu228YGSr5Fxz0oDDTmMGKWK0VrQ3ppLKhtiAdmy/MYKL69IAN+FruV5zqRgHwfbuCd05c5igSpZOXAB0VvK+9tQG9GRa40ZMqJ3gyxGl5lQDkH90W1xq4H2MTWkNvhmpU9P+7QDmDcDMpG5V/Fe10sL5FX6ri6JDSG+j8JkfHagdiU3Qf4euoJ+h5z9Nl7sXVitr6S5glvgjUeC8AEHgcZunYblEwNvbMfEkR4HjaXYpQTWH3fH9KAbME0S9fbpPiXEfwUr+XPA7cXgllFEEkCOdFWTpZTJMVHn6sJWJcT+jhmQ8xus11KssBLDD+54USk485FkeIAlN7MA1U+Ry1+v Content-ID: <28619855DCD0364BAEBE9BABCB52E6AE@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 833d5f0c-9616-423b-8eee-08d799b43c0f X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:47.8739 (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: RKhoGkWLKE1C5k3wt0yVbiX5d0tkxe2hbTs6WqDiUdl4+BopVKuGGZVe28N9rN38d4n/iXEX1cakEAEm5GNyFw== 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_join come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_join() 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 | 25 ++++++++++++++------ drivers/staging/wfx/hif_tx.h | 3 ++- drivers/staging/wfx/sta.c | 45 ++++++++---------------------------- 3 files changed, 30 insertions(+), 43 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 32eeba2fca47..2428363371fa 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -288,18 +288,29 @@ int hif_stop_scan(struct wfx_vif *wvif) return ret; } -int hif_join(struct wfx_vif *wvif, const struct hif_req_join *arg) +int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, + const struct ieee80211_channel *channel, const u8 *ssidie) { int ret; struct hif_msg *hif; struct hif_req_join *body = wfx_alloc_hif(sizeof(*body), &hif); - memcpy(body, arg, sizeof(struct hif_req_join)); - cpu_to_le16s(&body->channel_number); - cpu_to_le16s(&body->atim_window); - cpu_to_le32s(&body->ssid_length); - cpu_to_le32s(&body->beacon_interval); - cpu_to_le32s(&body->basic_rate_set); + WARN_ON(!conf->basic_rates); + body->infrastructure_bss_mode = !conf->ibss_joined; + body->short_preamble = conf->use_short_preamble; + if (channel && channel->flags & IEEE80211_CHAN_NO_IR) + body->probe_for_join = 0; + else + body->probe_for_join = 1; + 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)); + memcpy(body->bssid, conf->bssid, sizeof(body->bssid)); + if (!conf->ibss_joined && ssidie) { + body->ssid_length = cpu_to_le32(ssidie[1]); + memcpy(body->ssid, &ssidie[2], ssidie[1]); + } wfx_fill_header(hif, wvif->id, HIF_REQ_ID_JOIN, 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 924b889cad0a..20977e461718 100644 --- a/drivers/staging/wfx/hif_tx.h +++ b/drivers/staging/wfx/hif_tx.h @@ -45,7 +45,8 @@ int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req80211, int chan_start, int chan_num); int hif_stop_scan(struct wfx_vif *wvif); -int hif_join(struct wfx_vif *wvif, const struct hif_req_join *arg); +int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, + const struct ieee80211_channel *channel, const u8 *ssidie); int hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout); int hif_set_bss_params(struct wfx_vif *wvif, const struct hif_req_set_bss_params *arg); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 395a282346b1..30c62e3b3716 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -512,32 +512,19 @@ static void wfx_set_mfp(struct wfx_vif *wvif, static void wfx_do_join(struct wfx_vif *wvif) { - const u8 *bssid; + int ret; + const u8 *ssidie; struct ieee80211_bss_conf *conf = &wvif->vif->bss_conf; struct cfg80211_bss *bss = NULL; - struct hif_req_join join = { - .infrastructure_bss_mode = !conf->ibss_joined, - .short_preamble = conf->use_short_preamble, - .probe_for_join = 1, - .atim_window = 0, - .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev, - conf->basic_rates), - }; wfx_tx_lock_flush(wvif->wdev); - if (wvif->channel->flags & IEEE80211_CHAN_NO_IR) - join.probe_for_join = 0; - if (wvif->state) wfx_do_unjoin(wvif); - bssid = wvif->vif->bss_conf.bssid; - bss = cfg80211_get_bss(wvif->wdev->hw->wiphy, wvif->channel, - bssid, NULL, 0, + conf->bssid, NULL, 0, IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY); - if (!bss && !conf->ibss_joined) { wfx_tx_unlock(wvif->wdev); return; @@ -545,29 +532,15 @@ static void wfx_do_join(struct wfx_vif *wvif) mutex_lock(&wvif->wdev->conf_mutex); - /* Sanity check basic rates */ - if (!join.basic_rate_set) - join.basic_rate_set = 7; - /* Sanity check beacon interval */ if (!wvif->beacon_int) wvif->beacon_int = 1; - join.beacon_interval = wvif->beacon_int; - join.channel_number = wvif->channel->hw_value; - memcpy(join.bssid, bssid, sizeof(join.bssid)); - - if (!conf->ibss_joined) { - const u8 *ssidie; - - rcu_read_lock(); + rcu_read_lock(); + if (!conf->ibss_joined) ssidie = ieee80211_bss_get_ie(bss, WLAN_EID_SSID); - if (ssidie) { - join.ssid_length = ssidie[1]; - memcpy(join.ssid, &ssidie[2], join.ssid_length); - } - rcu_read_unlock(); - } + else + ssidie = NULL; wfx_tx_flush(wvif->wdev); @@ -578,7 +551,9 @@ static void wfx_do_join(struct wfx_vif *wvif) /* Perform actual join */ wvif->wdev->tx_burst_idx = -1; - if (hif_join(wvif, &join)) { + ret = hif_join(wvif, conf, wvif->channel, ssidie); + rcu_read_unlock(); + if (ret) { ieee80211_connection_loss(wvif->vif); wvif->join_complete_status = -1; /* Tx lock still held, unjoin will clear it. */ From patchwork Wed Jan 15 12:12:49 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: 11333911 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 01211138D 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 CA72C22522 for ; Wed, 15 Jan 2020 12:13:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="K1dbEoER" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731078AbgAOMNX (ORCPT ); Wed, 15 Jan 2020 07:13:23 -0500 Received: from mail-bn7nam10on2048.outbound.protection.outlook.com ([40.107.92.48]:31808 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730228AbgAOMNW (ORCPT ); Wed, 15 Jan 2020 07:13:22 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iqR+LEG8x+sNaDVK7gnAtwmWT9aPVwLs34LQWo0QS110WmsdCeLVP6hobPiwsvi4qElfD9ZZY5LhIyiiH+w03mrhkNAHyRnttOVK7AssLS45jXVVFtuSWENIQGi7QZ2F2q6GbV/WNiILd9NIyGpfHP9uaazyo+4ve1fQPybP1d9TsONBwD5LCP8B+MNyqo9fW5oHiPCL9+uOe9AP8R9ZSHRfr9VaX9aBmdFAdHRcOF8rMzz0Mx9ePc0dn+zly2TQGniBczoP1nInubmpzGEbif4an/A7Z+TJl5G4ysEfn+EPIZltQiaJJUqxs8YZLJKYVV522++cUlmZa0sD9HDWGg== 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=83XLPoKJOHbwgxaYl6x/ur2Ey8D+6u88X4pvsRD0nwY=; b=Zc2PV0uCk8jvzzC1uVNiPvPp48O7WfCG3J8l7G9HPl4H5gaB6R2DOJK5lxrq7cdRCRhLd+YTL9IIHOUb3TFxtGjV5pJz6+VSX0Px9KVc2Rp5r2kK2cSR6GL5xwvuutlsz/1n6wo+/hPBLvBs5v0KVegsgM9ZAsnEisDYBpEe7E+aJBQwicpZiArY3bk7PNHRyhtnR6sJn094MJjYiNix/6bV0Ldtz807CHPoWZCblYKjcPkWxmDn+FbVw8wWDAi6P09bRCF3N+4n3tTxgbYjNYMkQMT057PGHcwgsBJ8YOfs+iosVVNwiaKDBrVPfn2hB1qs2ss9+yZEKavX9wt0BA== 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=83XLPoKJOHbwgxaYl6x/ur2Ey8D+6u88X4pvsRD0nwY=; b=K1dbEoER4Z9UNZRG+XSiRJNI0+MYR5YR6AhYWAg9ZKu02jOfHgFxeV55DMW21MvwEk6DzO8ccfp+Qc1S56d4/IKpeF+ip2NC33HgzBRW3Woiwyz9FF5ruX28yOQ+qssTaD/tuTiSCxIv4NU0CeOKNjAaRFOHx6tuQhQ6mKuZGtk= 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: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:13: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:48 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 30/65] staging: wfx: simplify hif_set_association_mode() Thread-Topic: [PATCH 30/65] staging: wfx: simplify hif_set_association_mode() Thread-Index: AQHVy50aX1wStvuIQkKM+/3XwIvfFA== Date: Wed, 15 Jan 2020 12:12:49 +0000 Message-ID: <20200115121041.10863-31-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: 999f97ae-5f67-42c5-ec57-08d799b43ce2 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)(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: K7M9DAIAi+8BaYgufucqm22ba1YRlmlJryfAYdDz0PI+R1+pHeEaAP8AfuliwwL32hwnYXC8THCGBefan8vl180ekIWs+sJdylj9pc1lX5KPrj7KWjdM7NaIw0OX3gHPoVoraNpm3hZEpgGu6hlX06NLDn4U3Kd0YTMfEp7Gcz9+WedI2O/kZahAAheH8WKpvbU38widD4oCRYnZSbecRdOtQ2ZEUmn/B5JzWRJdxSeP5e2eD8nW0PhXKNCnvQvxD35vDHmllq1HOH9t4x8PpCLvq9Sr1kKWkVHwdYdxoQpsDS1Usm7uzuG6+0M2s91iPwo7jij/Vai2HC2TQaBPbYvYWuNmXDku2xNCOa6FUCvtPvd8GYc7899e/qFR9VfaI1FmjaNZ7vDBRnp7DCE94xfsG3IxvU4CKg8Mgx0rcHu1fE2IDst+gjZqhZ9auE76 Content-ID: <2C363E75B42A8D4DBFA8F6B10BA2A17F@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 999f97ae-5f67-42c5-ec57-08d799b43ce2 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:49.2910 (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: UCkTcN2pErUU6p1JKjZs5zh7huQzJrS8GDLwBBFM/LCJyyZ1JmNMiKrCwwe4Vu5/wN/EBCpu3PtE9zvVBsoirg== 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_set_association_mode come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_association_mode() 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 | 22 ++++++++++++++++++++-- drivers/staging/wfx/sta.c | 16 +--------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index 5b39200bd697..eec6f4157e60 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -191,10 +191,28 @@ static inline int hif_set_block_ack_policy(struct wfx_vif *wvif, } static inline int hif_set_association_mode(struct wfx_vif *wvif, - struct hif_mib_set_association_mode *arg) + struct ieee80211_bss_conf *info, + struct ieee80211_sta_ht_cap *ht_cap) { + int basic_rates = wfx_rate_mask_to_hw(wvif->wdev, info->basic_rates); + struct hif_mib_set_association_mode val = { + .preambtype_use = 1, + .mode = 1, + .rateset = 1, + .spacing = 1, + .short_preamble = info->use_short_preamble, + .basic_rate_set = cpu_to_le32(basic_rates) + }; + + // FIXME: it is strange to not retrieve all information from bss_info + if (ht_cap && ht_cap->ht_supported) { + val.mpdu_start_spacing = ht_cap->ampdu_density; + if (!(info->ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)) + val.greenfield = !!(ht_cap->cap & IEEE80211_HT_CAP_GRN_FLD); + } + return hif_write_mib(wvif->wdev, wvif->id, - HIF_MIB_ID_SET_ASSOCIATION_MODE, arg, sizeof(*arg)); + HIF_MIB_ID_SET_ASSOCIATION_MODE, &val, sizeof(val)); } static inline int hif_set_tx_rate_retry_policy(struct wfx_vif *wvif, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 30c62e3b3716..9030681858bb 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -712,7 +712,6 @@ static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_bss_conf *info) { struct ieee80211_sta *sta = NULL; - struct hif_mib_set_association_mode association_mode = { }; wvif->beacon_int = info->beacon_int; rcu_read_lock(); @@ -730,26 +729,13 @@ static void wfx_join_finalize(struct wfx_vif *wvif, else hif_dual_cts_protection(wvif, false); - association_mode.preambtype_use = 1; - association_mode.mode = 1; - association_mode.rateset = 1; - 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)); - 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; - wfx_cqm_bssloss_sm(wvif, 0, 0, 0); cancel_work_sync(&wvif->unjoin_work); wvif->bss_params.beacon_lost_count = 20; wvif->bss_params.aid = info->aid; - hif_set_association_mode(wvif, &association_mode); + hif_set_association_mode(wvif, info, sta ? &sta->ht_cap : NULL); if (!info->ibss_joined) { hif_keep_alive_period(wvif, 30 /* sec */); From patchwork Wed Jan 15 12:12:50 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: 11334051 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF4F217EA for ; Wed, 15 Jan 2020 12:17:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 948D3207FF for ; Wed, 15 Jan 2020 12:17:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="kPh1JrRa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731148AbgAOMNZ (ORCPT ); Wed, 15 Jan 2020 07:13:25 -0500 Received: from mail-bn7nam10on2048.outbound.protection.outlook.com ([40.107.92.48]:31808 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730258AbgAOMNY (ORCPT ); Wed, 15 Jan 2020 07:13:24 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FWBFUdCyLnESNWUeS+8Lgqfr3ZJQprfDAJDwyvHweFr6IUEn7/8M7aQ/FrLepn6pybSpHrsB4Z86O40DBF2+NqKw1b2zbckb5MfsDxDf/9RetLNVEkEr7pnqVb7spcKRdypH7dZvZ/B4e+WV0JKB5vIg9cmFRQCwx0RZz1xRs4ZhiDQYwlMIMa/APcnLyjysdGtrDuYIWhzWAWo4orvMmP9Vxw6xncjeRQibzvTO6aloLusEZVhFvBMxP1LvEROjtchJZh5zr94eJQZ0VGT2EWsF6vqN+6AVh4fLhviarE0HD9LNe7LLcI/i42w/e2mesAID4q/Mj4MwWzcuwy331w== 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=t7WXVyk7UNsnby0BTFvK7nM6kwOYLUjSDsqtkvRlZTw=; b=TGssdAEQo23RANr7+tiEleet3Bc9LEWRQp8whz2jY2P23CrXMNP4xIlKGC0ywvpMGktzai9V3zHyezJ9wxUjuKjirMBUUuWA07oYItqoKr/4lLTme0VE0ZGu4wf4xO2YS/Xo7tgSnqBB2Wxx0iSn848GePdTEPjlHwUHd55of56IBM2UGE9SP+yScwHJZc1FJqa3xcPXxv+BZIlk4+fGkE87rM4pQtLAH59oXyIUagkM0ejyRBUVsbXx4j1RCfxXzrPD75nzzJLqAyQ9ZRJsIsjqo9lwXNmn6ulUad1+BlUdXtRh0iTKlC+trcg8O/91BhhHIhcw+13ImBW4a+h1Vg== 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=t7WXVyk7UNsnby0BTFvK7nM6kwOYLUjSDsqtkvRlZTw=; b=kPh1JrRa9T12D7tW4JQNNhIIy/1GcXZqBvUQWNJYPAqLyrrlpwMQN1NZEQI9/9fFvxUGNrwhCJp60l9da1XfeLeIiOtrBOAJOxLdsRbVvs4mNJq8Mf2BPuNQR6RqBv3ZxO08ys96KiGWOJAYR/ZmJDQVV92apv0SGwAFJnChZzE= 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: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:13: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:49 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 31/65] staging: wfx: simplify hif_set_uc_mc_bc_condition() Thread-Topic: [PATCH 31/65] staging: wfx: simplify hif_set_uc_mc_bc_condition() Thread-Index: AQHVy50bKVfQ4tTy5ESA2ASoIlwUzA== Date: Wed, 15 Jan 2020 12:12:50 +0000 Message-ID: <20200115121041.10863-32-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: cda5b2c8-c044-49a1-d0d0-08d799b43dae x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; 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: upOqF/cCEKulQBTk60h6Iy9lJw5rN1HhIyVOkVgi5q33pE/4C0PUHzMBQcTlwHgVQWDSO4HCuuC/a7MkMD77bNqsxVmhL7N3LOiWjYS9vx5ygJKVYJrAviSwL2YwLDo8cqi/R/gTYtD+ItB5XXIfKWhtdjAE8iKGesf3+Ln+aQFjed4wKsxe67GzWCKRc+oFd3s3OUamCz1RuRblnbUEQhIuMuSI3ioSMdT90K+SXuwU9SednRgFCf8/gisV6UyYpZqJGXrLP/Sz+O9aLMSl0BDejuiEFaS2rJrG5VN5IDM92qjx7D9F8CBpiCqdH7MeHZ0lS9bjTFiUDBkNl1MRSiEjUPqVQd//wWAW+6h5eQcuRbVqWoUalHrLExpIp2ISIAudXzoiD+tyA2v7l0LeNgIKnRjaYclFglv5upCsoQLqDOmO6PRGWbVx81PaoAYI Content-ID: <4EC5639BD602334A9C8D44B4105A1518@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: cda5b2c8-c044-49a1-d0d0-08d799b43dae X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:50.5903 (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: VzBYYqxw/SD8ZBjY7dHGpZC9b7Cg686ZSUhl4BKVpfFzFL3FD0vIgtG3cJd16ruRbCKLWI7ssFVVqNz7M+jK7Q== 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_uc_mc_bc_data_frame_condition come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_uc_mc_bc_condition() 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 | 6 +----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index eec6f4157e60..4d171e6cfc9a 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -246,12 +246,20 @@ static inline int hif_set_mac_addr_condition(struct wfx_vif *wvif, arg, sizeof(*arg)); } -static inline int hif_set_uc_mc_bc_condition(struct wfx_vif *wvif, - struct hif_mib_uc_mc_bc_data_frame_condition *arg) +// FIXME: use a bitfield instead of 3 boolean values +static inline int hif_set_uc_mc_bc_condition(struct wfx_vif *wvif, int idx, + bool unic, bool multic, bool broadc) { + struct hif_mib_uc_mc_bc_data_frame_condition val = { + .condition_idx = idx, + .param.bits.type_unicast = unic, + .param.bits.type_multicast = multic, + .param.bits.type_broadcast = broadc, + }; + return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_UC_MC_BC_DATAFRAME_CONDITION, - arg, sizeof(*arg)); + &val, sizeof(val)); } static inline int hif_set_config_data_filter(struct wfx_vif *wvif, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 9030681858bb..79285927c7bf 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -120,7 +120,6 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, struct hif_mib_config_data_filter config = { }; struct hif_mib_set_data_filtering filter_data = { }; struct hif_mib_mac_addr_data_frame_condition filter_addr_val = { }; - struct hif_mib_uc_mc_bc_data_frame_condition filter_addr_type = { }; // Temporary workaround for filters return hif_set_data_filtering(wvif, &filter_data); @@ -144,10 +143,7 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, } // Accept unicast and broadcast - filter_addr_type.condition_idx = 0; - filter_addr_type.param.bits.type_unicast = 1; - filter_addr_type.param.bits.type_broadcast = 1; - ret = hif_set_uc_mc_bc_condition(wvif, &filter_addr_type); + ret = hif_set_uc_mc_bc_condition(wvif, 0, true, false, true); if (ret) return ret; From patchwork Wed Jan 15 12:12:51 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: 11333915 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 178DE138D for ; Wed, 15 Jan 2020 12:13:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DFC0122522 for ; Wed, 15 Jan 2020 12:13:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="kjCQ4RsG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731211AbgAOMN1 (ORCPT ); Wed, 15 Jan 2020 07:13:27 -0500 Received: from mail-bn7nam10on2048.outbound.protection.outlook.com ([40.107.92.48]:31808 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731112AbgAOMN0 (ORCPT ); Wed, 15 Jan 2020 07:13:26 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DyYhSTvdnekMJuF5ZCvhk7WitoLpoaO2HnGXjtmL7gGVXXYOZ/MFkDvQ93EAKWP8XniId7ybCiaSK6X/AAY4ArtIxQZEy3hH+D9J12/DlGxWKUhp27WzBgadHGHMbCEKRiYDguSYo90L2t9CS17rLak8Yo7+H+S3+WcmLMQp52KlqlcWbhcyN4O44NGId8fPZqofxqMv9zJCfRRfwON0nuZt0x2Tpr7lOwBSlQkFiNHauNi3rrTPEdktwilzVnXeRyEit2SmB07a9fIi3rKmQIN9tcBHZEo02N38daz0FAXzajXY2kFKZGFgt5R+MVIEowrDafm9SLU2jVIfoivAOQ== 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=ld8qSg592xPJar90gdpyQ+05JoxcTxmYOxSxOuYqNVc=; b=avu3Q0QioLjspWFV5ggQmuG4OupHSiZ260EM8HPXtDwi1eYm2/0TDNxwb+YPno1DeOUUbBb/RIYkjMATou7O4thbAJmVbauHpWdQm3sFUwq1LeW1zEW8o7bYqDIB+lmG9ffqD833Ze+xOBKQuwqSpX0COg7blLlM8Yv42HHOkiPI7bA/0/GFQWEJ3hQXyNBEp3qo0fPRVCtwe03vIfy/f37gFwuv/Zf+i4Z92htECOw8Rkhh2duBLu5BlUgPuIYA5dY62cHbYWz0BEZTg+51NqS30aU7suMXRFUmahTaT/xLtiPf2InMdWXDe/f9lzW/89ztAXJNzv7uJjc5CrxrCw== 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=ld8qSg592xPJar90gdpyQ+05JoxcTxmYOxSxOuYqNVc=; b=kjCQ4RsGAznGIibmTV7lCm0UvYFqXJsAs92IBAVyg8aPSjLum1L5q2JFfYIpNzwA/u8zUdq1w/RFLZbstcvhTor4ZBZBJPdl1MqgGLT36Hsr9FjpxVu9VjfjtwuuvTCNGhw7yM23vW8lNJuJhbANX1BoEDRgdKhMCuBT6ltC8b0= 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: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:13: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:50 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 32/65] staging: wfx: simplify hif_mib_uc_mc_bc_data_frame_condition Thread-Topic: [PATCH 32/65] staging: wfx: simplify hif_mib_uc_mc_bc_data_frame_condition Thread-Index: AQHVy50cmuDmA1KnS0eIgGEIxVm8ZA== Date: Wed, 15 Jan 2020 12:12:51 +0000 Message-ID: <20200115121041.10863-33-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: 692cab7d-cfcf-4c7f-5eee-08d799b43e75 x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:843; 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: M1PIrSe9+DUy3G0KP8tGnSTeZEWCSW5JzRiSio96udWMkj25qkR5Q9uHvdZJQNWh4LQmXYN6n2jMXry6DExT/UxRd9Ez/AC4XkY74cR5wZx8Vodx1FGLkzLr6zfknp+t03k697z3QamK910AwaoM1YUUrY1cMuyVr4q8+kmWjivoM+FX8w6c5E8Sx31snQkESuihh/wcyfgBHUozGG42dtB4tU+h6Bb3gSRfIksrZ5bzsXFDInjhQoOPulsaRcKnzqhJK3GOtp/oSuFZx9lYgm9Gg1AieWP3B7KVQtf/K/ZriQnZkeG0LYJbxsn302AD4bLeLGaaR1WEhmKj1i/LE1U26t/i4abH5WSUzP5+wksPfGE3iGsyEWFSvKE0ogMjIYTfum/SouR2+ADaoeSKx631pc+XuKAHbtKqMdMQ6wUdbUfRCB7VvZNNH1WiyEX7 Content-ID: <2BC6496AC88B394E9866E9042B56764D@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 692cab7d-cfcf-4c7f-5eee-08d799b43e75 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:51.8895 (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: PqWLFjCEoesWBCprIo8wd7dEMrbHGaeKSEXvXsC5lfiDa6yKME9wqiNHKG3oa//T9er+isx0/qp9hQ7M7nYRkQ== 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 current API defines bitfields. It is not very convenient. Prefer to use bitmasks. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_mib.h | 14 ++++---------- drivers/staging/wfx/hif_tx_mib.h | 9 +++------ drivers/staging/wfx/sta.c | 4 ++-- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/hif_api_mib.h index 1603b3074bf7..e0ef0337e01c 100644 --- a/drivers/staging/wfx/hif_api_mib.h +++ b/drivers/staging/wfx/hif_api_mib.h @@ -181,19 +181,13 @@ struct hif_mib_ipv6_addr_data_frame_condition { u8 i_pv6_address[HIF_API_IPV6_ADDRESS_SIZE]; } __packed; -union hif_addr_type { - u8 value; - struct { - u8 type_unicast:1; - u8 type_multicast:1; - u8 type_broadcast:1; - u8 reserved:5; - } bits; -}; +#define HIF_FILTER_UNICAST 0x1 +#define HIF_FILTER_MULTICAST 0x2 +#define HIF_FILTER_BROADCAST 0x4 struct hif_mib_uc_mc_bc_data_frame_condition { u8 condition_idx; - union hif_addr_type param; + u8 allowed_frames; u8 reserved[2]; } __packed; diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index 4d171e6cfc9a..6e8b050cbc25 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -246,15 +246,12 @@ static inline int hif_set_mac_addr_condition(struct wfx_vif *wvif, arg, sizeof(*arg)); } -// FIXME: use a bitfield instead of 3 boolean values -static inline int hif_set_uc_mc_bc_condition(struct wfx_vif *wvif, int idx, - bool unic, bool multic, bool broadc) +static inline int hif_set_uc_mc_bc_condition(struct wfx_vif *wvif, + int idx, u8 allowed_frames) { struct hif_mib_uc_mc_bc_data_frame_condition val = { .condition_idx = idx, - .param.bits.type_unicast = unic, - .param.bits.type_multicast = multic, - .param.bits.type_broadcast = broadc, + .allowed_frames = allowed_frames, }; return hif_write_mib(wvif->wdev, wvif->id, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 79285927c7bf..1c1b5a6c2474 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -142,8 +142,8 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, config.mac_cond |= 1 << i; } - // Accept unicast and broadcast - ret = hif_set_uc_mc_bc_condition(wvif, 0, true, false, true); + ret = hif_set_uc_mc_bc_condition(wvif, 0, HIF_FILTER_UNICAST | + HIF_FILTER_BROADCAST); if (ret) return ret; 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: 11334041 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 46CF3138D 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 1A6B9207FF 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:54 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: 11333971 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1651F139A for ; Wed, 15 Jan 2020 12:16:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DEAC424679 for ; Wed, 15 Jan 2020 12:16:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="k+I/s/OX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731368AbgAOMNd (ORCPT ); Wed, 15 Jan 2020 07:13:33 -0500 Received: from mail-bn7nam10on2048.outbound.protection.outlook.com ([40.107.92.48]:31808 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731168AbgAOMN3 (ORCPT ); Wed, 15 Jan 2020 07:13:29 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aFK9ROY0PS+SvG7EqAqp758RS6nVR2ki8BOAz7JjGQ8iWFqEcp4erBvPjXhEQFbkx6cNpoiZNY0VfBlFLRUpckNz2Rhzhm81po+tSyN2/+64kWCDSY5pyrJy7+Gfcg6At+iexqi7CmrU+9lKHQJowFr3CKMBKwUqPwcFyAKo6q7BzBbvbYwtR+SuMVOTEYD47aMszRYa3CyGZ+c4MTiZPZ+eFsXvbkt8PRiFcDNg0089TzWFFXrXntJCLfCLG/j/HF3bVZNS3GrgAw5aEXJqtZY8uNIyCYY/fWYk0l0OowNLX0WWS/bsx+R/Vpj4eo4X/acgcqzVB2o9vGAZyDPOqA== 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=XJqXurW4/VAnWUE+JXZ5tJhNqqZRExJP6P/RNttxtCI=; b=KM9ZuhHzVcjsbyyyjYXdlsa84udx8dAqjwcjYURwueCQ9ANnblDN8puAhu0uibKuE6Sk04t4QFehLpjZS0oeXQOD2gmsOWvGy+3OkJvDhNPEi2dGPkAIsNnZSEc66ikcC7uKKs6hx1518xRdl6zJjaChlj04j4gj3T4eHZT92cVWz5880sfgN7h7Peb/VDCp+ITT1hih0L49WsBDPapp7HeIeSR6yUw7VEisUke0HS+2eH6DkrAjgGQOFuU6O5gGMluFYlzrj74J93YXnDiT810D9XqanxGy2jLi7ztp0ysxlT+/tpF++nM2ZlWX8u1nJyetLJNUxg1pP2mIcftisg== 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=XJqXurW4/VAnWUE+JXZ5tJhNqqZRExJP6P/RNttxtCI=; b=k+I/s/OXgFSduMWtpN3G/hM1gmaKbMzvbPlCgGBYnFpNUwJe9NxgQzwuCWuKTV3xYE5Wig+PHE4r7x9c0y9SmtGu3rUnSfUyNUIWAcW4A291tggO5Mec1GGOHjm0cWOrwIPO4Itsd5z5o1vp0hceITUGx3BXlEI/YHsfWRg5d78= 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: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:13: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:53 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 34/65] staging: wfx: simplify hif_set_data_filtering() Thread-Topic: [PATCH 34/65] staging: wfx: simplify hif_set_data_filtering() Thread-Index: AQHVy50dtm/2WXbjVk+wIXdMzUynWQ== Date: Wed, 15 Jan 2020 12:12:54 +0000 Message-ID: <20200115121041.10863-35-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: 697bbd7f-0ea5-435c-2cfd-08d799b44002 x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; 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: O/mPZ3zGSbBvzozCU1+zOucP5TPNcdi9FL92jAlusUnj8FWuiq5Yfyqun6XzztkwvAhoNGMKQOrg7PVLXJdgIvkOrn3Uz1RQ2eEZIQKv/xw3HFXbVLfVXeyOapm5/9dGcqRomEr3GaCcQiO8ueoQF30jPmW5aZ768v0Owr7P7/gaEq8Tbsqngsw4oJ6xpuTY1l46DrFyVm5JehZ6sQHhhZ6h/bhOAB6/Rp054Qyo7yemXSdvhVrjfNkODP3JQYXwfGcKI6EQ/UKBty1dALQxzoGjlZVDotLPJC3A1XAg4vMSjG9DMPYipeQK0tk8STFC8Ol8v2uzylOEwjIywBCq0tUhVL01F7Qp48pzHA5zlVYT+p49JYKcAHo1GG5gWrs5jXkbgrZ4pcU7qYEYCSHfPJxSdG7a72mifE5vyRKn3V3drz1Rh2f9Ql9ypjlil5/r Content-ID: <5460FBAB1ECD934A8B0A172B9051A55D@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 697bbd7f-0ea5-435c-2cfd-08d799b44002 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:54.4950 (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: KZP+shmyT5vyf/6x1Fnx/dkC9fMuz3Rn+2y8tPaVmgWcF5dH5WKB5OQ5aYUYEEgoAsa0b6T+q14+gxtd3tLbxg== 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_set_data_filtering come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_data_filtering() 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 | 9 +++++++-- drivers/staging/wfx/sta.c | 13 ++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index 6e8b050cbc25..ee22c7169fab 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -267,10 +267,15 @@ static inline int hif_set_config_data_filter(struct wfx_vif *wvif, } static inline int hif_set_data_filtering(struct wfx_vif *wvif, - struct hif_mib_set_data_filtering *arg) + bool enable, bool invert) { + struct hif_mib_set_data_filtering val = { + .enable = enable, + .invert_matching = invert, + }; + return hif_write_mib(wvif->wdev, wvif->id, - HIF_MIB_ID_SET_DATA_FILTERING, arg, sizeof(*arg)); + HIF_MIB_ID_SET_DATA_FILTERING, &val, sizeof(val)); } static inline int hif_keep_alive_period(struct wfx_vif *wvif, int period) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 27248ea62aea..588094486a7a 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -118,16 +118,13 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, { int i, ret; struct hif_mib_config_data_filter config = { }; - struct hif_mib_set_data_filtering filter_data = { }; struct hif_mib_mac_addr_data_frame_condition filter_addr_val = { }; // Temporary workaround for filters - return hif_set_data_filtering(wvif, &filter_data); + return hif_set_data_filtering(wvif, false, true); - if (!fp->enable) { - filter_data.enable = 0; - return hif_set_data_filtering(wvif, &filter_data); - } + if (!fp->enable) + return hif_set_data_filtering(wvif, false, true); // A1 Address match on list for (i = 0; i < fp->num_addresses; i++) { @@ -154,9 +151,7 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, if (ret) return ret; - filter_data.enable = 1; - filter_data.invert_matching = 1; // discard all but matching frames - ret = hif_set_data_filtering(wvif, &filter_data); + ret = hif_set_data_filtering(wvif, true, true); return ret; } From patchwork Wed Jan 15 12:12:55 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: 11333975 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1658138D for ; Wed, 15 Jan 2020 12:17:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7585C22522 for ; Wed, 15 Jan 2020 12:17: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="eFYQT/Rc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731331AbgAOMNd (ORCPT ); Wed, 15 Jan 2020 07:13:33 -0500 Received: from mail-bn7nam10on2048.outbound.protection.outlook.com ([40.107.92.48]:31808 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731305AbgAOMNc (ORCPT ); Wed, 15 Jan 2020 07:13:32 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JgP5abDShITF00TM0zuLjMJWvu+jM6q7jeJ2xx0TFQIdqxW4JBDIRAYItOj7sGlus7szZa2wB6nq/xbGNoq+gNsAZoMVVOjeKZIndtek64wzmbeJZSZg0+FUs1OYZhvxRC5QgKPNJiw4ED3H0vHnLetc69gTOLSlbcxQJJijA3FvWN0TWTO/sRzlvOw2eekEn2LIceC8VvxtihX4KaKh4oLYVNP+7uml89cn/GF6mLQ8HOuYPiRz91Q0teEyAst60W0OsYig2BZv/cCLwJ2YRvHCFoTZt82rhJrtTLSPEA9gVUBTRCgDN3frYnlvA8Br0sW6zR2+9tu4HiIX8/Dtwg== 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=wE4NZayrc5/OqYjwEoTG0wWNVVdW3mn+wI1Dx4BnsqA=; b=W04jmEGQUq/owXfuuFa63PzmhjmnONj4q7sMkrl/pQJ31E+s0Xtg0JmcZzzkFoFNf9vb8vV8atrTiepk7exVdILi5oeum2s/B9YNY+o5Kn0Wi+5DkJQnS1xpa2eeH8iJwPebNkVxB8KitFtfjpgRk0/eTAWS5A5tNLW3xsBeq5eyY8GqvAEEQ40jyu/xtq50VvFxzuipDwW/mZ4Zpd2Lvbv7F9vcCa5ltuAPVkP/682B58bFcO4olsM5siD4jZ63DnPI1HymnklmFLlT1NfDfkHCdbTxgNmC95hgqhZ2cTVN1NnBMUbAam2TYU2nPGbmL1t7VFSukAoT5piJjeA1HA== 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=wE4NZayrc5/OqYjwEoTG0wWNVVdW3mn+wI1Dx4BnsqA=; b=eFYQT/RcF7a83/fFzUwYHgRO6ZV0Rjlt8dp9s2eV1yemN51GVVdrXoeWcE/IHsJ1xJx1D3L94UF+Mr+Gc/1VpNR67iCMmKLbpUOP3t+A6sOfm82GtI/eM1W45nTKmyvV3hEBY4pBd8tQaZiH/cGqKHt87370xHaYuUwDWMa1Z/Y= 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: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:13: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:54 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 35/65] staging: wfx: simplify hif_set_mac_addr_condition() Thread-Topic: [PATCH 35/65] staging: wfx: simplify hif_set_mac_addr_condition() Thread-Index: AQHVy50ecNC0Ux3kl0yNLHwNJCt/cw== Date: Wed, 15 Jan 2020 12:12:55 +0000 Message-ID: <20200115121041.10863-36-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: b45e65fd-aab2-4968-6cfb-08d799b440c8 x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3173; 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: lLJvPx+0OP2dcn/bsZveMeMwxI8IHZKOicVNq5pCoN5crRgY63F7ZIFpxP0x7GuE/3NDUHPjzpnprnMb9QVnKHsdsVwx8L3EgkkPIJkF74pFyCMgtW/PyeeM+BuDgcKt3AUjD1+1q07X/I6spx/CCqj2EsOgboFDADUTZkCPdp8dySVjTAczfGry1vAJ0z5249es/peV8nlcMu+Z+mLOREK+aKDMnFRH1dP4/tvO6R9beydAAGobTISYgNkezQmmT4O2g4NHqK9Vuk+nw6bYaSH6/syooQfEQGVR/Hk3/BLGbTOKDxwLpGsWrZurgJTOo3WZE6FPWjQHEezmHrsp+YZh5NfJU+P4eaS7AmR4aRIuIH+DAQFSo/7Gop8oWlV/0ukK6nhjBzYaXGxzgVRnjWkr+j8+65OKHBYrFJ5EOSyYs5KRVXVe2JzCg39ePOqF Content-ID: <3E5D283AD3451D4CB9861EA4FB41B356@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b45e65fd-aab2-4968-6cfb-08d799b440c8 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:55.7943 (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: vKSNuksgCUsuANcOsIUfjvWjeGpu5qwg8EXnD5HAuvUI3qbiWp7UtAtxNfKDb+mOeoTrpLix245ohVCp1kqliA== 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_mac_addr_data_frame_condition come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_mac_addr_condition() 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 | 10 ++++++++-- drivers/staging/wfx/sta.c | 9 +-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index ee22c7169fab..90474b1c5ec3 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -239,11 +239,17 @@ static inline int hif_set_tx_rate_retry_policy(struct wfx_vif *wvif, } static inline int hif_set_mac_addr_condition(struct wfx_vif *wvif, - struct hif_mib_mac_addr_data_frame_condition *arg) + int idx, const u8 *mac_addr) { + struct hif_mib_mac_addr_data_frame_condition val = { + .condition_idx = idx, + .address_type = HIF_MAC_ADDR_A1, + }; + + ether_addr_copy(val.mac_address, mac_addr); return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_MAC_ADDR_DATAFRAME_CONDITION, - arg, sizeof(*arg)); + &val, sizeof(val)); } static inline int hif_set_uc_mc_bc_condition(struct wfx_vif *wvif, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 588094486a7a..b74e0ce41069 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -118,7 +118,6 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, { int i, ret; struct hif_mib_config_data_filter config = { }; - struct hif_mib_mac_addr_data_frame_condition filter_addr_val = { }; // Temporary workaround for filters return hif_set_data_filtering(wvif, false, true); @@ -126,14 +125,8 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, if (!fp->enable) return hif_set_data_filtering(wvif, false, true); - // A1 Address match on list for (i = 0; i < fp->num_addresses; i++) { - filter_addr_val.condition_idx = i; - filter_addr_val.address_type = HIF_MAC_ADDR_A1; - ether_addr_copy(filter_addr_val.mac_address, - fp->address_list[i]); - ret = hif_set_mac_addr_condition(wvif, - &filter_addr_val); + ret = hif_set_mac_addr_condition(wvif, i, fp->address_list[i]); if (ret) return ret; config.mac_cond |= 1 << i; 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: 11334009 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6A8CC139A 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 3F3F9207FF 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:58 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: 11333967 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B1D5B138D for ; Wed, 15 Jan 2020 12:16:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85A09207FF for ; Wed, 15 Jan 2020 12:16:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="R5KFS8gR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731821AbgAOMQd (ORCPT ); Wed, 15 Jan 2020 07:16:33 -0500 Received: from mail-bn7nam10on2048.outbound.protection.outlook.com ([40.107.92.48]:31808 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731307AbgAOMNe (ORCPT ); Wed, 15 Jan 2020 07:13:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CNfNMp5BUSKdlT8lafMpCvTd2i+N9k6cJPWuPtkvlkOIhgVA3pwZnh/SDzadexnEkICGKg3Yq3LfOuZL8tsuzkuQPSbIbhG0xxF5dbBbtWqol3JE3yhqR3PmExwC5vCy7x0XCNfjzvmhwaCPnxIjKNAQ9Adcw63y43ztjfT54GzKmczzjgoK+wWCh/vBZJyjtpdBEtcTbt5R/pj/kHImWpZXvnnd4ORhF2aGTd/AZVmzP9AHLN9iQg5z7mcXcIAbDHtjb55QdPJS2mO9MCSpAqupA7Um3sX8o+fmEbCJFOHUFi6DZ5uavTeHUBfrbQmLhBrS/cyXqN3NCJaJxl7YkQ== 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=HqaSYkN3+5Zn6ohlAX6hVbCkz5NgCFZL+6QN3uKKY08=; b=CBaXNPMvbAQ5kZMs3yMkL4wJfKb9U8Fdu8r8vzW9Cok8lJ8OusMjpMJ4aKlKj9HBAWE5EG+FkGbXGiy7IshzKCubIz4BkjJQ70QeQE5m3VcDme2oomot+T6euvVgoaku+oZhtK2YLPFOaHY52WnUAZG22fEN3AREjkhu052jslnso/qNDbvajfUNEbf/JvfwGZn8z+VBfpyFoP1Uy2LjLTVANgAs55TLrBw44gSldjFHm2L/IbmYojXobtybQp8Do3ok5tEZSiECOMuN0DlnpsNrqWs9I91jqsoEbmhBcNtWYTLDyeco+OF/dd9kCCajeCdyelwal2ZKtFDL11i2Xg== 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=HqaSYkN3+5Zn6ohlAX6hVbCkz5NgCFZL+6QN3uKKY08=; b=R5KFS8gRH0ItUXIDfI7esF9lB+4D7GixRU5S2KaaY2E4rp6CdhWcZqVUmDIFlP4A8uQjBPvr4iapHlVqgY5gyiR9JK9uvR3VV9Jyvgv1rRDNuLUoHhgUpUbb1mnkVfX9dcK1A/q0nA7yi1W0XzrcIL/xcn4zwKrO+HukYh8MRTE= 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:57 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 37/65] staging: wfx: simplify wfx_set_mcast_filter() Thread-Topic: [PATCH 37/65] staging: wfx: simplify wfx_set_mcast_filter() Thread-Index: AQHVy50ffyZ+1pzr9kexID2HJOS3AQ== Date: Wed, 15 Jan 2020 12:12:58 +0000 Message-ID: <20200115121041.10863-38-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: 02b9fd2b-5f37-4140-02be-08d799b44254 x-ms-traffictypediagnostic: MN2PR11MB4096: 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)(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: 4MavCGGu3CReDAA87N6vK2Tu/JIizp7yMGPem6VB0eYDzD6cxbAI2vBkgWpNwhRVGvS/EIjpg/nmhhAry9WaiU0I8JHIm1kSbill5gKUnQyivLtDJ6nBRrXZIkeXckFGl5s0+3rFTAkIDCdCJN9jyqysOfQS2NTMv5uvzLrv+lwfj4BwxKm1+cUXn0DtEZOf/lqCzqaM8rVyHV33t5OBHNzUFXXuRisb8YgndtEoupANtiWJ9tqA1gUTnWJhXiVxY+rnsTmGGldyE0ATnwW3ciWqFw7q7KaeZBRTbQCrAsC0tUDnTW48b9EdTZRsyqudVNCeCkETusYgMATtt5v8/vFWqYmFJavAbucywx2Toin11H15xjfnJuJPG0l89X6/irlNFWSRr3ulE5KqLrpRQMi/vg/O0xIpjkkjAQfzELVjnjY2cN7DsZIfIBMy6LpO Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02b9fd2b-5f37-4140-02be-08d799b44254 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:58.3898 (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: d1drJ1rc7yBYXSAKNQirHJiFb8WnXYzAIr1upGkqansa6n7zsHmC7GiNvjDCeopEBkU/fDmDZONJdQfUYUgIow== 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 HIF functions return only serious errors (OOM or device freeze). The current handling of errors in wfx_set_mcast_filter() does not bring anything. Finally it may disturb the developer more than it helps. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index e71b99aa1f63..a934f66f3a4c 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -116,7 +116,7 @@ int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable) static int wfx_set_mcast_filter(struct wfx_vif *wvif, struct wfx_grp_addr_table *fp) { - int i, ret; + int i; // Temporary workaround for filters return hif_set_data_filtering(wvif, false, true); @@ -124,25 +124,15 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, if (!fp->enable) return hif_set_data_filtering(wvif, false, true); - for (i = 0; i < fp->num_addresses; i++) { - ret = hif_set_mac_addr_condition(wvif, i, fp->address_list[i]); - if (ret) - return ret; - } - - ret = hif_set_uc_mc_bc_condition(wvif, 0, HIF_FILTER_UNICAST | - HIF_FILTER_BROADCAST); - if (ret) - return ret; - - ret = hif_set_config_data_filter(wvif, true, 0, BIT(1), - BIT(fp->num_addresses) - 1); - if (ret) - return ret; - - ret = hif_set_data_filtering(wvif, true, true); - - return ret; + for (i = 0; i < fp->num_addresses; i++) + hif_set_mac_addr_condition(wvif, i, fp->address_list[i]); + hif_set_uc_mc_bc_condition(wvif, 0, + HIF_FILTER_UNICAST | HIF_FILTER_BROADCAST); + hif_set_config_data_filter(wvif, true, 0, BIT(1), + BIT(fp->num_addresses) - 1); + hif_set_data_filtering(wvif, true, true); + + return 0; } void wfx_update_filtering(struct wfx_vif *wvif) 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: 11333969 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4105C139A 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 15B51207FF 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:01 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: 11334025 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5731A139A for ; Wed, 15 Jan 2020 12:17:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2BA13207FF for ; Wed, 15 Jan 2020 12:17: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="BZzYWldJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732678AbgAOMRY (ORCPT ); Wed, 15 Jan 2020 07:17:24 -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 S1731173AbgAOMN2 (ORCPT ); Wed, 15 Jan 2020 07:13:28 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LfQ3RMOqVT8LtW0sbsf5gAt9+OmNVhlr+DCaqYqbbL4n2hLmW2nVerqI0Si2TjbM9Z27zMkNwcsAWKJ3VL5ym2/BDO7X2GLkk0VBq8XonW+VjgSGgiCXJZ4pWdihoiDPCk914GFYzfUo1OI+qiRhD5t/J9MCa/zM3eILPpKcPSUHaAZIUMqN7ptfCf2hTCsRGbePpy7D1g4o5htwifNIraBau1/eeTQrzxJVw8x0wgqzYs29yfoIESjY7pzbRmd2pUn5ViRmOn+tQtKXW+p2F2TJjjiYtK+krEGeFYBy5ipnNVATGbwqrks/dPMm0mf82KyJAuAlYY/tp8BS+yIZ4A== 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=p7xw4WCj2d15OmRXMql5kVmIrhFJ5wVO8llOWfUVcAg=; b=NJdHTD4xtMtbXGiSsFSl8PMeofohy8TOKCTVBJIe9nysip+TwqRxeX69XIXUzrxdqWnueHLMqesimksfDdD+YpOQRfVDYODg0YisEcEogTitleOHkykM7tPrr2HGfcIhU3v8x86iDgJECa5c5almeAyEtHuyfwNnm2JJk8YXBmbzlP7xcS1bb7rib7KjwXYegtY80mm6vwlyYU2f+DjhG+RuWwzmXD1MoWVOx61ZFfqaYhjDV4u2JPt59o51mWu+aovENuHh1q469eC1ftK9S4dnC5sc6oz0B1BzgpRHb5AO73iEVzB1L/9I0ghHgnnZyrpZNZR0UJhImfLjilVhnw== 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=p7xw4WCj2d15OmRXMql5kVmIrhFJ5wVO8llOWfUVcAg=; b=BZzYWldJPihUjNluNMOcIHFgKycHDtb2avJnuof30NMxFpuxOFn0UfX/Uxl6MPyuJZBIKCwzwki5qISfn7uROqGEEqG96+Va4LoNl17Odkzq7b9UmNWf7EjdOn1Ymfv9NiBak4MlgJT7y8quYE0r8Jq8VLb1X8/ElJiW5H6wbf4= 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:25 +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:25 +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:59 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 39/65] staging: wfx: simplify wfx_scan_complete() Thread-Topic: [PATCH 39/65] staging: wfx: simplify wfx_scan_complete() Thread-Index: AQHVy50hZQc7OdNZT0aVGeI+gFYOqA== Date: Wed, 15 Jan 2020 12:13:01 +0000 Message-ID: <20200115121041.10863-40-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: 2d915965-17be-42d1-45f7-08d799b443e1 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1360; 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: M5UdNjyepYUXD5RottGyfoJ/k2yIxuZ0Bt+cagp+L7y+X25XC7DEmMHVkRlT2a3ZFqH0Tjcz7TOyzVg7VhM3Oc1WX+B7vaRynWr8KE/3lIsTIyGnpax7DZ/Dfr84tf+QE6wHKO0J15igctNFuV0BOTtSD9fF2cYYDFmybAqqedtqL+Avt17H13G9s4jErRhtfqjv6v7OGaUgla5/UOPv6jYq037iPxtFwVsUQMzM63qhKAiZ3bdt5jUgF1dL6V+o+gJ3eNevh+84aZlYJqpj9G3IONrNZBh7W8sU556xCj8B3bQhAUY47Sk3u11VAHLwXTW51UtqOKM39z8PnNh/zNYGEhZHVPyzxAcCm7vRRFXV4NWOEgWbfq8u5ooGNTIajF4tsimLx4tWzBtKrAerPJ/+A6UtntEPtlM8xHQ2hMvxE1basl8wuSW2e2/mqq2t Content-ID: <921C9397FCAF7F4585AF0A224DE77616@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d915965-17be-42d1-45f7-08d799b443e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:01.0103 (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: N7nJc6Tq3DCt3mx4c9YFuq/v701tQiYKQgasTm7t/tGWYFjQml/LoQqD3UUa17Hs1RLU2MdJY2md/Cm+qinz2w== 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_scan_complete() do nothing with argument hif_ind_scan_cmpl. In add, hif_ind_scan_cmpl come from hardware API and is not expected to be used with upper layers of the driver. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 3 +-- drivers/staging/wfx/scan.c | 3 +-- drivers/staging/wfx/scan.h | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 408967a4c457..f04afc6db9a5 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -203,10 +203,9 @@ static int hif_scan_complete_indication(struct wfx_dev *wdev, const void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); - const struct hif_ind_scan_cmpl *body = buf; WARN_ON(!wvif); - wfx_scan_complete(wvif, body); + wfx_scan_complete(wvif); return 0; } diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 5cc9df5eb6a1..6e1e50048651 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -127,8 +127,7 @@ void wfx_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif) hif_stop_scan(wvif); } -void wfx_scan_complete(struct wfx_vif *wvif, - const struct hif_ind_scan_cmpl *arg) +void wfx_scan_complete(struct wfx_vif *wvif) { complete(&wvif->scan_complete); } diff --git a/drivers/staging/wfx/scan.h b/drivers/staging/wfx/scan.h index bba9f15a9ff5..2eb786c9572c 100644 --- a/drivers/staging/wfx/scan.h +++ b/drivers/staging/wfx/scan.h @@ -10,8 +10,6 @@ #include -#include "hif_api_cmd.h" - struct wfx_dev; struct wfx_vif; @@ -19,7 +17,6 @@ void wfx_hw_scan_work(struct work_struct *work); int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_scan_request *req); void wfx_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif); -void wfx_scan_complete(struct wfx_vif *wvif, - const struct hif_ind_scan_cmpl *ind); +void wfx_scan_complete(struct wfx_vif *wvif); #endif /* WFX_SCAN_H */ 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: 11333973 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 18C46138D 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 E1A3822522 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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: 11333957 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B3035139A for ; Wed, 15 Jan 2020 12:16:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86E2F2077B for ; Wed, 15 Jan 2020 12:16:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="d1mjQDjH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731519AbgAOMNi (ORCPT ); Wed, 15 Jan 2020 07:13:38 -0500 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:33252 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731359AbgAOMNf (ORCPT ); Wed, 15 Jan 2020 07:13:35 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f+iZ1MI26p4qjhTv1/zcjmE2mz+aqLiukqIROtqj8B92PRRVM6JW+Mriogr1wh/MV8Lq1Rj2mmeURKfYOxtenLiV+xJPHWcEWFRZoKwdDjzW6o6qTJlffAE8sbyaC01z/CwizA+Pb4XgE7GIXWTyMcIrNiRjC8L5I58yaG3GAggjg/ZBuGxHF59RcLRXvvt3CttE8XuuRQzV2zlMgNDCTkpk/VTT5fIGJrsrrsQ/uQW2eGsi3AiuA0vwsY0W5C2TDXLuXgYLW5srw0IIESCUHPi+q4rN3uYIf/p4FI5NfpXGcyG0w8uRT9/04wAt2vJ0qMHpDr/TXi5rnFdIbExD1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MGqfP+Bn6ViYrv+vCujkkmwbpYVEsmfRDXGsJC6g80s=; b=jhQNvJ+96i44rxygzyKYXtcEPaQYFOuyvQT2+ThDBwZY3a3CO2wy72iFmMjD2SUKSw7Iy1KDFEIwdkICHxe/cPNqGBxyAJzTPa1xbT1f0TnWLhtlAbXiPGzZWkw3mT+Bicl3VrXx/iGWtnbE3NffzNktiWqkI8God1f9OL1w5LylxTHvwFE4IVdQTdxH+e0n4Itfsyc6YyyVbiwH1P3H+Ecpq0YfSMA/ybeL8qQurXWV4ZIJgTueacJ2ZJqsljGseWpSYoOE+BRVFkgau3F1NiW+woFvmJAdXqS23rSXf7ZMvgwr462kIY1FcnbFvqGm2oTAdh9Lp1cyV7C+cnZ7Jw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MGqfP+Bn6ViYrv+vCujkkmwbpYVEsmfRDXGsJC6g80s=; b=d1mjQDjHMYXW7pseOcQ+a7GRwJht/toJs/c6kAVkm5zRJ6JZdD/ICJOAELxIoCgNheDYBxp1IJVhzp2tpsZu3MB2OSPWCHAld7/05RR6cHnIHaBbTZf9XK7mMHfc/OCNwTj/jjI1KJtjs/swR8GITFrQ0LBe8BuMI6LnKUWMOko= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13:26 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:26 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:02 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 41/65] staging: wfx: with multiple vifs, force PS only if channels differs Thread-Topic: [PATCH 41/65] staging: wfx: with multiple vifs, force PS only if channels differs Thread-Index: AQHVy50jNHs/r+2QPUSLTwTNLpC5mA== Date: Wed, 15 Jan 2020 12:13:03 +0000 Message-ID: <20200115121041.10863-42-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8f87840e-eda5-4757-a2be-08d799b44574 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB3934;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DDakmXH9HhhdCt4K6Y0uD57zaegbJdSUnmCu8IgGIjYIqloSyJO1mOrB93LhdIOcZ9U2S50gy3vilq+aQG6oPodlroTCM/k/N/MCkGUqkT0l05bM8JdPHRbaITOnVDbgoSQL2J1dSfC0TgmX2fMc0xUjwxd8LOowqrhUNxJCXmvbjKfNxUg0wfejWnm/kxEmjLpQl0k7hnP4vfj70WsaDxvV5/qQT+I/ph5ERYcgSiG8B748gK6dh0bBgoK4PvqdI/AzWS8ZoYgKv67V/O9sThtg3/zFjRa7zzzlSfkSwVmlAGqT3y2zVr077OcRrgGLVOouzQpH37x5FLeZFLBY8EYF+vE/x26BjRFs+iTH3ycOssJQXYe+rf3PTNlqEuyFMct7DNbgAVMtyB2cQP9Qw7Z/E3JKAbqhJPg8ssc2mDB/r8JXfmndeEEbwXEvlbep Content-ID: <3E7C9B63822EC1499DA40A00A13065EB@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f87840e-eda5-4757-a2be-08d799b44574 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:03.6438 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: wDx2GrZZ7d3dhVFnhU2xCKciA6P/K8brO5Gtdgi3tpzZqqjBU2BiILCIKNRZRnlmf91MsaZZTYg4maMZCvRYrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller When multiple vif are in use (the only supported configuration is one station and one AP), the driver force power save flag on station. This behavior allows the station to leave the station channel and make its business on AP channel. However, this has a big impact on station performances (especially since only legacy PS is supported). When both vifs use the same channel, it is not necessary to keep this restriction. This greatly improve station performances. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 94683a1440c8..bf285389c303 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -251,6 +251,7 @@ static int wfx_update_pm(struct wfx_vif *wvif) struct ieee80211_conf *conf = &wvif->wdev->hw->conf; bool ps = conf->flags & IEEE80211_CONF_PS; int ps_timeout = conf->dynamic_ps_timeout; + struct ieee80211_channel *chan0 = NULL, *chan1 = NULL; WARN_ON(conf->dynamic_ps_timeout < 0); if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid) @@ -260,10 +261,15 @@ static int wfx_update_pm(struct wfx_vif *wvif) if (wvif->uapsd_mask) ps_timeout = 0; - // Kernel disable PowerSave when multiple vifs are in use. In contrary, - // it is absolutly necessary to enable PowerSave for WF200 - // FIXME: only if channel vif0 != channel vif1 - if (wvif_count(wvif->wdev) > 1) { + // Kernel disable powersave when an AP is in use. In contrary, it is + // absolutely necessary to enable legacy powersave for WF200 if channels + // are differents. + if (wdev_to_wvif(wvif->wdev, 0)) + chan0 = wdev_to_wvif(wvif->wdev, 0)->vif->bss_conf.chandef.chan; + if (wdev_to_wvif(wvif->wdev, 1)) + chan1 = wdev_to_wvif(wvif->wdev, 1)->vif->bss_conf.chandef.chan; + if (chan0 && chan1 && chan0->hw_value != chan1->hw_value && + wvif->vif->type != NL80211_IFTYPE_AP) { ps = true; ps_timeout = 0; } 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: 11333961 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AFD9F138D 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 84D9C22522 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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: 11333965 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB9FD139A 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 B07A9207FF 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:07 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: 11333959 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67C19139A for ; Wed, 15 Jan 2020 12:16:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C12622522 for ; Wed, 15 Jan 2020 12:16:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="oNzguT8Q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731166AbgAOMQG (ORCPT ); Wed, 15 Jan 2020 07:16:06 -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 S1731168AbgAOMNi (ORCPT ); Wed, 15 Jan 2020 07:13:38 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U7zwm7eFkgO3XERSpK/QlGem8Icioxr/YAQVxQHXF2HnhZVG2jHQHbCKfTKBeKnz8iLIbdqb+eVEVxvRDz2mGtFi2uyhNhA3Th2QjWBJ3shCBB7dX/cnc21F5QsKeCSOUevO8veqyYCjH6sk+7eJc3FjGWqVwXdqmnXyzQZA9YwWq8b3ykW25jIYko4MymSYvJTvOQ9N+3rE8RAd1U1a4QVx1vhdYvyeti09QX3phGpYaD6wheM+PKaJWhgBwD6pV168sb6k1+Zjupg3ng8t2+wWI8ECxF20earnZsVVpyZFVtUpvvZxmcU3BEAjw1hmg877nrMbXcCrVVXUljRKrA== 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=4OQhlUt+sYJ/eiAbIL8ycTks4MYvs5U6ohNWOamkvK4=; b=oC6GJiv0PUH0ElrVkAh4cDlpd7iK4dJjcDkheTvoWBu38wpkkqzTmviXs3UC9DJmHKvSSVZStUz0h/CM2jsBjINuAQOHAauCWTX0v87PUCta3RybC8ZkRflaUTp9rbIKazMNY+NjGINFnZwn2lkq6FXObJH2jJ+fGHf6tgyyFODp+OE+ipH9D3AAiu92Vu6xccQv9rGzok89pHERw72mvyF4z7i+MPhKs4Ezm+ml4PjO5IBsWmD0xi6siPnMPwUHTUCJl0OCV4j+BVTLOPQk7sWnb2z8/2duVgv0SNzVveEX0R2niClD14zE2+9nV+78/hHE9zxIICAW4qO+bvjPRg== 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=4OQhlUt+sYJ/eiAbIL8ycTks4MYvs5U6ohNWOamkvK4=; b=oNzguT8Qsew5bl8ZR/kr+tXVTKA0hzlpKdUZebiGediLq9tsk0I2vRcdALuareXxy43KUUkokafKcrOoI1fq0ohJDYgq7ThnhoNI/kyOsSsjFq0tNcWSd3PIbu/0ce6wkH+WT8f4+vZQFQcIeSWeVNEZ3C3q0YpeAr2WpB7DrdE= 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: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:13: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:13:06 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 44/65] staging: wfx: fix possible overflow on jiffies comparaison Thread-Topic: [PATCH 44/65] staging: wfx: fix possible overflow on jiffies comparaison Thread-Index: AQHVy50lOqVR9Z75Hk21qa/iiiYguA== Date: Wed, 15 Jan 2020 12:13:07 +0000 Message-ID: <20200115121041.10863-45-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: 1bd844c3-9b9d-4720-09ca-08d799b447e6 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1332; 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)(16251815004);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: OhKTix534WezpdaMRbyppCSpogpSaK2XZVORUMKyyVbfhIcC7Q57vkdKhlw7TIRU4th+1dv+uAgJK+5Cf0J4QXijSmGeKtuQjQxsK/JcIOXzovt/Nk9j7YaUqpRUxMAtrYFjVxqAApw5Q3VexlRpSfigWt5rIxHXinlDUJNwIhzPVnEqXcvTKjwUuk5YEXc4I9YcHOYMsAiAm+xR2+a2Dp3weaUtX8kyj+5OwFgIPvOlJSYo9on6Yf+DIymgQZy64Oi3mJMmnvvn15tbPZ7PjJH382Sx8QpsyYwL97dkVPLRdJza84xfQosSKEBqfeygY6NA60HSDqSBybZGZZWUb86aNnPDXkIC5TqyAwM7iFr5n5BhvimgQDVeb9NxBekOAKBujH2AYf2MbrSCRmyoRbzwkG35s5R/vxy63yk28V7kweRaYcOzIdMMFfIXZG3cxG1cSTVNROKjYVf1eTeLnrwkvuBnnM6j+CBSCLx94Kd0d/H3n5BsVpgsjOT65PlB Content-ID: <7636D479EFCB0D499131B2314C6A38A6@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bd844c3-9b9d-4720-09ca-08d799b447e6 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:07.7394 (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: BT6hC5vIs5lGVeFmKMRapth2Lw0PbLGZiVX0hnRjv8yNJosCuQfLSr4M7JENI+PeFa+IHLBCGRK9VkFpmMnRpg== 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is recommended to use function time_*() to compare jiffies. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 60459299a3a9..704ebfe1cd05 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -270,8 +270,7 @@ void wfx_tx_policy_init(struct wfx_vif *wvif) static int wfx_alloc_link_id(struct wfx_vif *wvif, const u8 *mac) { int i, ret = 0; - unsigned long max_inactivity = 0; - unsigned long now = jiffies; + unsigned long oldest; spin_lock_bh(&wvif->ps_state_lock); for (i = 0; i < WFX_MAX_STA_IN_AP_MODE; ++i) { @@ -280,13 +279,10 @@ static int wfx_alloc_link_id(struct wfx_vif *wvif, const u8 *mac) break; } else if (wvif->link_id_db[i].status != WFX_LINK_HARD && !wvif->wdev->tx_queue_stats.link_map_cache[i + 1]) { - unsigned long inactivity = - now - wvif->link_id_db[i].timestamp; - - if (inactivity < max_inactivity) - continue; - max_inactivity = inactivity; - ret = i + 1; + if (!ret || time_after(oldest, wvif->link_id_db[i].timestamp)) { + oldest = wvif->link_id_db[i].timestamp; + ret = i + 1; + } } } From patchwork Wed Jan 15 12:13: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: 11333951 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0ADBC139A for ; Wed, 15 Jan 2020 12:15:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CAB0B24671 for ; Wed, 15 Jan 2020 12:15: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="Mb8ynQrA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731398AbgAOMPn (ORCPT ); Wed, 15 Jan 2020 07:15:43 -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 S1731538AbgAOMNk (ORCPT ); Wed, 15 Jan 2020 07:13:40 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BXmQbNOXPkWCp7E6tQ1eFaxo5KVu8VhQcVHeCBJ+UXNcCfO5VGeDDj76d5whGmYVV+p79o6Eyzcb1+dcU8RV4NRgHnqfCdIXy4QY0kBtBA8+Zt5k9W21iGuSXspgblsEAup1TjbUji0A9EgA3F38uIencBWfw/KpaHNZRFRIf1KUV+FVI+/r7yM93JmYtA6IncY1n43gQQ4bS4NzpEdQUp2vcfRhoA/7EM2PGIojBGLylfyvdlMBPK/Ny8F6JwtJcU0O6PYymzC2wC81Ne9b5U+Nr1n7G9UF3dvWfun/GWyfNRlG5HqrwT/ZXEA9EH6EO6JTzH7wZhI1d1AQAisGgA== 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=uzh1e1358l4KeQ62pZnLo1Vb2AqkkwvyM03nJIeYgK8=; b=dHbhiwv9q7H/N6P5CRdJx0ekcsnFVZjYv/N+wwdbbZCw6VVY/MLrvV/AOO2hSOXQzpGV7YkqCK1gzyz9Whn/xEg2fduDXw+uCKpeIJhH2qVWzVXjbETY00B6x4aytknwmhmdT0aeTqWbLQ9vGlZMzDHQhmNOYAGU0fT3b3zrQg6wYDqKZ0bJgJ5BQHhu80lhfO5520A257D6dZEMDaabEvO3kDrFZF+vi41hcq/i47FYzosA6uKHgmGkLRJn28rC4/fZzYMQzvcwkCw4sHepc+rZ7g4yvbOGszTbgzBq8K/bXo10LIJUsjV3S8Hpwvy667BMCwRoJFYTnx+nso88Ow== 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=uzh1e1358l4KeQ62pZnLo1Vb2AqkkwvyM03nJIeYgK8=; b=Mb8ynQrAEzfsbNfUuzc+BuDjRcK+E87n14P/nnDdWVaKk0z6qaeWsRsiVLeW624hEKF5NEU/v0syjy7mqBvn5fbp8ICaOWTIxqXU4eIFQtrqWO2ZgFws5/tMhfmPowyB+LGIRYrVX469r1nHTNdqq2utCIydYd7L1hkhlm7QU5Q= 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: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:13: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:13:07 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 45/65] staging: wfx: remove handling of "early_data" Thread-Topic: [PATCH 45/65] staging: wfx: remove handling of "early_data" Thread-Index: AQHVy50meZbmnDLbNEm11vC0VJj28w== Date: Wed, 15 Jan 2020 12:13:09 +0000 Message-ID: <20200115121041.10863-46-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: 8c4d5665-08d3-4df4-ada7-08d799b448ab x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:265; 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: hHfOD4EGUtM7+lN7cyTV+Hf5YX2OOB6MWWssJA6yAPQwDsk7W0jtVzFCozH5Firv08EMA6nEi0LMD0/OSswzc5atXf80PHXNuivEcHqIeZZAAWSYwcLm3cdObqEz0htd36ZyfGKy3e7St5sSSUSAWd8w5YJNm3WuluP7zcTr4wJX9NXuQ8vX0d3B1+jbUqXjiRoHNBwfAGf9JtFD11TUxuqnvbkRMALFwOWCwiKDk7WWz4u/EeD5qplCpBKJ8vZafMXvMmNFPadA/QEM5h3BdP86NRxixQDKXTzSRlbVsleAIueBejZz9LDJNAIxHtRpFVR2DgxsxdaGeDVwLA793G4lxXyEzDbgzOygsIWzLBvfgYZmwg8p4diekmBY558qSmhcB+Mo60RhLV1gW7vYiBEqiWoyUfYJWcNrKVaiElwus20eloB8W00CS08TQU58 Content-ID: <2098199893BB864A869D1A9E07D937D5@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c4d5665-08d3-4df4-ada7-08d799b448ab X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:09.0447 (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: OWnyqF7Q7IBxcO8UW2UJoyQzLjZIAS2ljGAXFygrTTn/+1lBTjKZT4dEREYgwJb8EMY9DTE3iU3qVhnDs6Lisg== 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 seems that purpose of "early_data" was to prevent sending data to mac80211 before station was completely associated. It is a useless precaution. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.c | 17 +---------------- drivers/staging/wfx/data_tx.c | 3 --- drivers/staging/wfx/data_tx.h | 1 - drivers/staging/wfx/sta.c | 3 --- 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c index 0ab71c911f84..e26bc665b2b3 100644 --- a/drivers/staging/wfx/data_rx.c +++ b/drivers/staging/wfx/data_rx.c @@ -108,7 +108,6 @@ void wfx_rx_cb(struct wfx_vif *wvif, struct ieee80211_hdr *frame = (struct ieee80211_hdr *)skb->data; struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; struct wfx_link_entry *entry = NULL; - bool early_data = false; memset(hdr, 0, sizeof(*hdr)); @@ -121,9 +120,6 @@ void wfx_rx_cb(struct wfx_vif *wvif, if (link_id && link_id <= WFX_MAX_STA_IN_AP_MODE) { entry = &wvif->link_id_db[link_id - 1]; entry->timestamp = jiffies; - if (entry->status == WFX_LINK_SOFT && - ieee80211_is_data(frame->frame_control)) - early_data = true; } if (arg->status == HIF_STATUS_MICFAILURE) @@ -181,18 +177,7 @@ void wfx_rx_cb(struct wfx_vif *wvif, schedule_work(&wvif->update_filtering_work); } } - - if (early_data) { - spin_lock_bh(&wvif->ps_state_lock); - /* Double-check status with lock held */ - if (entry->status == WFX_LINK_SOFT) - skb_queue_tail(&entry->rx_queue, skb); - else - ieee80211_rx_irqsafe(wvif->wdev->hw, skb); - spin_unlock_bh(&wvif->ps_state_lock); - } else { - ieee80211_rx_irqsafe(wvif->wdev->hw, skb); - } + ieee80211_rx_irqsafe(wvif->wdev->hw, skb); return; diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 704ebfe1cd05..e669fc4485e6 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -292,7 +292,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); - skb_queue_head_init(&entry->rx_queue); wfx_tx_lock(wvif->wdev); if (!schedule_work(&wvif->link_id_work)) @@ -400,8 +399,6 @@ void wfx_link_id_gc_work(struct work_struct *work) next_gc = min_t(unsigned long, next_gc, ttl); } } - if (need_reset) - skb_queue_purge(&wvif->link_id_db[i].rx_queue); } spin_unlock_bh(&wvif->ps_state_lock); if (next_gc != -1) diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index 078d0cfc521a..54738c2e3eac 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -34,7 +34,6 @@ struct wfx_link_entry { u8 mac[ETH_ALEN]; u8 old_mac[ETH_ALEN]; u8 buffered[WFX_MAX_TID]; - struct sk_buff_head rx_queue; }; struct tx_policy { diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 6a43decd5ae6..4a44d72f0db1 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -571,7 +571,6 @@ int wfx_sta_add(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; struct wfx_link_entry *entry; - struct sk_buff *skb; if (wvif->vif->type != NL80211_IFTYPE_AP) return 0; @@ -589,8 +588,6 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK) wvif->sta_asleep_mask |= BIT(sta_priv->link_id); entry->status = WFX_LINK_HARD; - while ((skb = skb_dequeue(&entry->rx_queue))) - ieee80211_rx_irqsafe(wdev->hw, skb); spin_unlock_bh(&wvif->ps_state_lock); return 0; } 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: 11333953 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A9AB139A for ; Wed, 15 Jan 2020 12:15:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D972324671 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:11 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: 11333947 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EFA05138D for ; Wed, 15 Jan 2020 12:15:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C447724671 for ; Wed, 15 Jan 2020 12:15:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="dauG/V73" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731628AbgAOMNl (ORCPT ); Wed, 15 Jan 2020 07:13:41 -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 S1731583AbgAOMNk (ORCPT ); Wed, 15 Jan 2020 07:13:40 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DZH85UdByGCkDU/MMYgNd1RgkI3u7kytJ9bepj+5mI4plB5okRohypl1U8AT5xVVfyEjLUn18yMyjjRPI8igLAAVJmpmKYCDimboJIC4mGxMgS4GLOVo725hegnLwLecKY2nvFaaZI62VfLWd+M6jwMcemX7vVADOeBVr+BaDf8uro7XnPexCPZPQWXErx4EdqlSJFBKuiDMS0HxLuBvnoTicC08KzROzrnFVwOXDjinMT19G3W9I9U3PakdxOw1V0m2Fgp7879hq55jR2npCR9t7BpJ0p2IjwcUgSSjxxmm76ocly3V/tPJoZ1KU7Yr/lhK3y3hyP1OgD4R45c62w== 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=MmEvffuL1FL6nPJSGxWSnv9QgrUnGsDyHOKx+ciWH7s=; b=h669kTaS41dGLCCN3aIQ+9ccCfnUBv6DCssLc0oMFg4cBEGpwESy8hcVTFsSnhYTzwS3LNX7XKwi7jD3fJULQ1+A68T0KAq2vGFStWjQYzP0gBpFfOz3gt3PU7wTYwa0F3kn5Qw6qKwxs/Mz51oEB0Yu3zjz6e0oLeTfp6IZ9sjpcrtmwRCFixMXGgE3zZ5fOoglLOTnz8NdOA3qD4uykdBQfuxZ4ehRlAts5kTcd7TuY4xjrFKvnGlp4pv8rvNatrxzOmx9r8jyFopEMNgxpgr9WEbaYS+uByakqXoC3Lvv698w5PMRP/Wi0pvsdMsHETv4iQ4kax5uEs+P5aQ4dg== 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=MmEvffuL1FL6nPJSGxWSnv9QgrUnGsDyHOKx+ciWH7s=; b=dauG/V73kqWNDKebKm8J8grYdaq12/PyALredZCem5jLBStvp4XYbEAX13Z8PUxsa1xAluGhF6DM7LCWCCYUEMpYqxvvOgdlOPpsvCIcK1MMSg+UY17Ll0LrIxQ0t6Y+z2FG4tTSiHxkcY28KWE4aungf2VOUcwBLn8I6zSwPuA= 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: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:10 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 47/65] staging: wfx: fix bss_loss Thread-Topic: [PATCH 47/65] staging: wfx: fix bss_loss Thread-Index: AQHVy50nWkEZyBXnaEW7ErKQIpaudQ== Date: Wed, 15 Jan 2020 12:13:11 +0000 Message-ID: <20200115121041.10863-48-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: 70be08f9-b675-4886-ab1c-08d799b44a3d x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; 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: 9IAtb72GmTDcFLIW11+yamKz6ksw3QO/dBIfcGqGHe9L+WInMDmHgdI+2r+4EIZc3dG1oNWa9rWFvhYALQxCErCOpSpAsuJsZ5oJ7CMwx6GK0Jzw60GPepIBHvrL3AS8W4UaVczWMPD9Lxf2/n6s6/Nx/q5xeJFdDZvD3N+My8ukdOo2s9FJ2DrgllwpenVP9f+KuISn/wAR9oMqR/qxxcnNHxvE0AeHy8zlF8A/CahoCsGKxf5dDKPUy3DLJDy2YCQBHTgQij6ZewFldJ8WnYJchTCBw+FYK1aGC/68Cdln98TNfSernX7esPpVRN1jTqK7zxLXytT+7DGWwwjf0lOaWrr/np9XU416yD0FZ75TtwbnjcQ68kswA3X5bT6aGS7jJYfKL3iw6VligefwtYFY+o5FwyZuAsyb2MnZV1KZuMitHvk4mAPoYEhjVsu4 Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70be08f9-b675-4886-ab1c-08d799b44a3d X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:11.6791 (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: BlEt43zUGFsWYkaS43DlSLSSrfX+RKnA1UxIZeQ0JDrqKmCfJit9oXhXtkLANdt4PDVwMTYzDHjJ46kPdRNRQQ== 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_confirm_cb() retrieves the station associated with a frame using the MAC address from the 802.11 header. In the other side wfx_tx() retrieves the station using sta field from the ieee80211_tx_control argument. In wfx_cqm_bssloss_sm(), wfx_tx() was called directly without valid sta field, but with a valid MAC address in 802.11 header. So there the processing of this packet was unbalanced and may produce weird bugs. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index aebce96dcd4a..80a2a9e8256f 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -88,19 +88,25 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad) // FIXME: call ieee80211_beacon_loss/ieee80211_connection_loss instead if (tx) { struct sk_buff *skb; + struct ieee80211_hdr *hdr + struct ieee80211_tx_control control = { }; wvif->bss_loss_state++; skb = ieee80211_nullfunc_get(wvif->wdev->hw, wvif->vif, false); if (!skb) goto end; + hdr = (struct ieee80211_hdr *)skb->data; memset(IEEE80211_SKB_CB(skb), 0, sizeof(*IEEE80211_SKB_CB(skb))); IEEE80211_SKB_CB(skb)->control.vif = wvif->vif; IEEE80211_SKB_CB(skb)->driver_rates[0].idx = 0; IEEE80211_SKB_CB(skb)->driver_rates[0].count = 1; IEEE80211_SKB_CB(skb)->driver_rates[1].idx = -1; - wfx_tx(wvif->wdev->hw, NULL, skb); + rcu_read_lock(); // protect control.sta + control.sta = ieee80211_find_sta(wvif->vif, hdr->addr1); + wfx_tx(wvif->wdev->hw, &control, skb); + rcu_read_unlock(); } end: mutex_unlock(&wvif->bss_loss_lock); 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: 11333945 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 757D2138D 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 4A62E22522 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:14 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: 11333943 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B2036139A for ; Wed, 15 Jan 2020 12:15:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7CF3422522 for ; Wed, 15 Jan 2020 12:15:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ZRBXljsf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731494AbgAOMPN (ORCPT ); Wed, 15 Jan 2020 07:15:13 -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 S1731597AbgAOMNn (ORCPT ); Wed, 15 Jan 2020 07:13:43 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QDIq/r4/k3pwHnv5aauj9j+4PQgtL5gPsE69mcHzayEjRPLPvftysriCYweweniqzgB9qY+xMmAvqGfpqL8bo0JfnhG9kET7KFIpkBGEmopb/mtr6x7mpPWhehU3HRoVkAug6HkNrMCkdMpPupRFDH9kq1eCChuZnkRreKZfVDTCZ1Bdaz1LbLHPFaOfUaXBAebPsQQKQOhDS3ZsuVPgsl37YU6qxhZ4h8cublUpS0AEhKQY7v+qeTH2mfil/NCwnRakqEi6Sp+0nLHznymAIfmQxkUkcJkpoA60k8/JxzTPNW/8zAnzwtfAsIJ9j0B0U+uJ2iH5xgKMQJeA5m5R5g== 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=sBpMtVw4Bzufoc9c1Lv0GypFZxbeCWfS1uC6i42B9q0=; b=UvPhkHzne5HE+bfTmquxoPAyrIAw5hokd3Uf513CEUJ00u5FEDyTTlfx04o2fBvGQPCTJmEv9L3CwwniCfi060JKirlKPiv7s0Bt+61gcXPphO13GwL8Cp28tfZ4XAwcgLYWjFRJbne8j3/vFKtcFUzNwmv3SexbAZnpW4yqmuMSIT37SSoxVPO9ctj9Wqb/B0m6qy5X7GCwnWcuBj0p4rNUGqKSbhoUHsUtketshVOhEWKxb1IcuJWXbkX36gIDxiwg3GGr8ckBd03u/8f+fT1wUWMl1iLc3iktBx9qpGUNZYv1LaF8+n2pBln5FJbIKc61UMmhug4Zn3H8kMhrVA== 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=sBpMtVw4Bzufoc9c1Lv0GypFZxbeCWfS1uC6i42B9q0=; b=ZRBXljsfBcy/Ioml0Nk4cNktZkN9+zfeatd6dc4qzQqF1Q+D6xsAO5v/h+dlYywavNkP4t30w76MEb10tLlZFGU52f+TU8IwP9DnZyzDpFlIf6Eg5oxBaSsW5r4PyBihJNlhmwrsTLhPiacxJWfDQiGH7fBrN0ZNXCeyqLX9ZAU= 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:31 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:31 +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:13 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 49/65] staging: wfx: simplify wfx_set_tim_impl() Thread-Topic: [PATCH 49/65] staging: wfx: simplify wfx_set_tim_impl() Thread-Index: AQHVy50pM5JkyPfNJEGVPJow5DsikQ== Date: Wed, 15 Jan 2020 12:13:14 +0000 Message-ID: <20200115121041.10863-50-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: b3170333-d940-49bb-ee4d-08d799b44bca 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)(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: u2CL40jdt3mLGJ9RLoQJEnH38ElffJL4lQV+AHArk3VEffWKDmkDStIGw7qLIhvqUo+/WGkZBstJC7WHJYt3cGyzzxGNnFSaplmy31B9xan25c+XfWMNwUskn7WmXjCjsjB/jjY2ta2hRSCIbTJPZtboDUhUyeCwA/UIitBqe4iV7AwRNQDdSe/BErFAjlOrClXZ/7cRFF9ebzoLS5dm+VNNhaBwgaXztIzgC4M5SeTWj3Gza+83PtrAsreKJW5BiV19NHZIwZZOKxzt/OwcHI8vztWVWYe/e9SD2eVsQNBD0QCkrn6ispYyj3mFHIP7dz7ZZFRB8Id1JPCtwRbnUyqD9bvMBR9kgfAFtXP5/49uOwtjKpmHuEcyVZgSz8zpMZG3rU/75jNHsdI7eIz/DNuOBfYqsJMMSNVQNGh6icplAprHqCsCXdkH5kOBkrbv Content-ID: <3E67FAC9F9E9E14CA07EFA6A15EFEEEF@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3170333-d940-49bb-ee4d-08d799b44bca X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:14.2956 (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: bJfslAESvqFssrbPltj9ognj9xUszEvwSpYplQj64+exrY5qwhTSNT3SCnWUhWaoz51EyB2wTSFvIkq+nsae0Q== 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 Argument provided to wfx_set_tim_impl() is always wvif->aid0_bit_set and there is no reason to provide another argument. Also rename wfx_set_tim_impl() into wfx_update_tim() to reflect the new behavior. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 18 +++++++++--------- drivers/staging/wfx/wfx.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index d50b583af187..47271b7eeaab 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -895,7 +895,7 @@ void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, wfx_ps_notify(wvif, notify_cmd, sta_priv->link_id); } -static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) +static int wfx_update_tim(struct wfx_vif *wvif) { struct sk_buff *skb; u16 tim_offset, tim_length; @@ -916,7 +916,7 @@ static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) tim_ptr[2] = 0; /* Set/reset aid0 bit */ - if (aid0_bit_set) + if (wvif->aid0_bit_set) tim_ptr[4] |= 1; else tim_ptr[4] &= ~1; @@ -928,11 +928,11 @@ static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) return 0; } -static void wfx_set_tim_work(struct work_struct *work) +static void wfx_update_tim_work(struct work_struct *work) { - struct wfx_vif *wvif = container_of(work, struct wfx_vif, set_tim_work); + struct wfx_vif *wvif = container_of(work, struct wfx_vif, update_tim_work); - wfx_set_tim_impl(wvif, wvif->aid0_bit_set); + wfx_update_tim(wvif); } int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) @@ -941,7 +941,7 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) struct wfx_sta_priv *sta_dev = (struct wfx_sta_priv *) &sta->drv_priv; struct wfx_vif *wvif = wdev_to_wvif(wdev, sta_dev->vif_id); - schedule_work(&wvif->set_tim_work); + schedule_work(&wvif->update_tim_work); return 0; } @@ -955,8 +955,8 @@ static void wfx_mcast_start_work(struct work_struct *work) cancel_work_sync(&wvif->mcast_stop_work); if (!wvif->aid0_bit_set) { wfx_tx_lock_flush(wvif->wdev); - wfx_set_tim_impl(wvif, true); wvif->aid0_bit_set = true; + wfx_update_tim(wvif); mod_timer(&wvif->mcast_timeout, jiffies + tmo); wfx_tx_unlock(wvif->wdev); } @@ -971,7 +971,7 @@ static void wfx_mcast_stop_work(struct work_struct *work) del_timer_sync(&wvif->mcast_timeout); wfx_tx_lock_flush(wvif->wdev); wvif->aid0_bit_set = false; - wfx_set_tim_impl(wvif, false); + wfx_update_tim(wvif); wfx_tx_unlock(wvif->wdev); } } @@ -1118,7 +1118,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) INIT_DELAYED_WORK(&wvif->link_id_gc_work, wfx_link_id_gc_work); spin_lock_init(&wvif->ps_state_lock); - INIT_WORK(&wvif->set_tim_work, wfx_set_tim_work); + 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); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index f56a91ea082d..cb359150e2ad 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -96,7 +96,7 @@ struct wfx_vif { u32 sta_asleep_mask; u32 pspoll_mask; spinlock_t ps_state_lock; - struct work_struct set_tim_work; + struct work_struct update_tim_work; int beacon_int; bool filter_bssid; From patchwork Wed Jan 15 12:13: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: 11333939 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99322109A for ; Wed, 15 Jan 2020 12:15:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 58431222C3 for ; Wed, 15 Jan 2020 12:15: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="FTMUwFu5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730768AbgAOMPA (ORCPT ); Wed, 15 Jan 2020 07:15:00 -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 S1731598AbgAOMNp (ORCPT ); Wed, 15 Jan 2020 07:13:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hdUJWeekIDGkCXuD+81ViM2moo1c0IRs+7OXXYDToCOrEZkShv/9mx8rRDqQvdBrx3Zum7wXlwRaMSTvsfhUCfh8/ANUFoZ/ZD6T8DQ1ijb9418Ta4F8oVPZF++DKJbHxzLhTg4Hv6KBuE4TcC4m3tm8HmJ43pOe303H+JCACf1JC8lOerlQlNuZmdoBmNSuEBwpcZPL8/TWBYH2ycB/HNPukwKpPw1HcpgtN9JtRlK48XnTS8ZUdd4FR24sIgXRX+VqbHLF3X0SNIz9wV9McC7JnITSSTB4gSE+3K3W5tflrU2RBdBcPoa/P2FTye7kumTwxMrT8HFdOtukiYT1iA== 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=2r1KHmuYwHYrtSyOXbL8C9r6F9Gd/c/2V2HQmo8psco=; b=ln6jhiee/mcFjwKGbmntJy8/0KkKpnJQ2mCSZpmp3LdQvpjDVumlDv9mJU4RbgjAckJW5Ut3AqQmcLU4ADU5FYeHncWCMXEmWi1oV/o0fRKQD1Gylb+arZPmBteGV1/+ES4+Lrb2xjW/P+5KnBh3ofWyP7v3etnQEl1GpV5SM/Y6GiNIWc7Kp/gB2IJ3V70cYfVoqhGjbmhOhypFWHjkyWS39W5ZZ9xOMgefSpQjj/0tNPDj0S7EW1tqa+H9QuAqYH1wMMJ6tR5zHuHJWCBjoDFjcs4uecL5P17SumkC5FtRFqI8nf1H9fhtVCj22HlU6+gG7PICEVDPspmEXhKirA== 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=2r1KHmuYwHYrtSyOXbL8C9r6F9Gd/c/2V2HQmo8psco=; b=FTMUwFu5LO5+BBs6Fwl/i80ym4J+4YWmQvlVtFn0t+Lv++Fm+85kJ59KhPWuOoBoQnMW2LSurgIC8W+lowI98B3+b7lEjNwUzUcGnyAFT1puuEopmzMFM9z6XXv42cHCFXZzGyxJxv2KzfjvotAM7KfnO6ZO8kKZxTlHTtAl4NI= 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:31 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:31 +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: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?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 50/65] staging: wfx: simplify the link-id allocation Thread-Topic: [PATCH 50/65] staging: wfx: simplify the link-id allocation Thread-Index: AQHVy50qlCIKdN8kJkWbsKJxV4EMgg== Date: Wed, 15 Jan 2020 12:13:15 +0000 Message-ID: <20200115121041.10863-51-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: 2c174085-2e98-476b-736f-08d799b44c95 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)(30864003)(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: yUkJdBxVhZUH0nclZu9jbI/vowLwDpH7yAwbsqHAmhXkY5iKgl3iT/906EYhWsV0DAM3UwwU546KjsotBuSt1TzT09hP+up2J/arT0tJbTsbdlNoN9U0SUpP5ndl9TaVFhloqLiBLMEn/NUSGtuHRb//Y3VCTOTMmpIPMNzreVny4kAwPLdcdNFFvBXeDkTykA3fgbGOi6m3CrH69LT0YEOcIM6goAXhKZFc7cj4M7RzZA7oEzXzG2g06kb+Ku/8ROiHb3EE3h9OOYMstBzIz45j2FtPYDgGLCbPT0ssaHTa0KCmsLWETPz3csQKt+apOqZXT2p7xB5YfdJDVEJd0p2Kx0zgTasaK79WI+BO0q7+upqD6aWN3DtRgqu79kbiP/P/On7FYm8INXtPGo1Lm2qOOQ0f94KMRbT5llqoILVcn9G64MF7dMS0pAmOLJ9X Content-ID: <082D8C809E5C6C428FBAB6D0478B7116@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c174085-2e98-476b-736f-08d799b44c95 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:15.7208 (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: rKCLf9z1QofPSe4brTiAGnBhAPnqyoPR2LFQZZE/WBK2QUs0hrfkaD6IVwabMoDwQB2KnnKA/L5cNbZQSa4laA== 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 "link-id" is a slot number provided to the chip. A link-id is allocated to every station associated with the chip (mainly when the chip is in AP mode). It is more or less the same thing than the association ID, but it is limited to 14 values. Firmware uses the link-id to track the power save status of the stations. The current code try to associate a link-id as soon as data are exchanged with station. It is far easier to rely on sta_add() and sta_remove(). Until now the value WFX_LINK_ID_NO_ASSOC, was only used when no more link-id was available. Now, we also use this value for not-yet-associated stations (that was its primary behavior). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.c | 7 -- drivers/staging/wfx/data_tx.c | 164 +--------------------------------- drivers/staging/wfx/data_tx.h | 19 ---- drivers/staging/wfx/queue.c | 7 +- drivers/staging/wfx/queue.h | 7 +- drivers/staging/wfx/sta.c | 58 ++++-------- drivers/staging/wfx/wfx.h | 3 - 7 files changed, 24 insertions(+), 241 deletions(-) diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c index e26bc665b2b3..699e2d60fa89 100644 --- a/drivers/staging/wfx/data_rx.c +++ b/drivers/staging/wfx/data_rx.c @@ -103,11 +103,9 @@ static int wfx_drop_encrypt_data(struct wfx_dev *wdev, void wfx_rx_cb(struct wfx_vif *wvif, const struct hif_ind_rx *arg, struct sk_buff *skb) { - int link_id = arg->rx_flags.peer_sta_id; struct ieee80211_rx_status *hdr = IEEE80211_SKB_RXCB(skb); struct ieee80211_hdr *frame = (struct ieee80211_hdr *)skb->data; struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; - struct wfx_link_entry *entry = NULL; memset(hdr, 0, sizeof(*hdr)); @@ -117,11 +115,6 @@ void wfx_rx_cb(struct wfx_vif *wvif, ieee80211_is_beacon(frame->frame_control))) goto drop; - if (link_id && link_id <= WFX_MAX_STA_IN_AP_MODE) { - entry = &wvif->link_id_db[link_id - 1]; - entry->timestamp = jiffies; - } - if (arg->status == HIF_STATUS_MICFAILURE) hdr->flag |= RX_FLAG_MMIC_ERROR; else if (arg->status) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 9313c8f5d4d8..8c9f986ec672 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -17,7 +17,6 @@ #include "hif_tx_mib.h" #define WFX_INVALID_RATE_ID 15 -#define WFX_LINK_ID_NO_ASSOC 15 #define WFX_LINK_ID_GC_TIMEOUT ((unsigned long)(10 * HZ)) static int wfx_get_hw_rate(struct wfx_dev *wdev, @@ -265,156 +264,6 @@ void wfx_tx_policy_init(struct wfx_vif *wvif) list_add(&cache->cache[i].link, &cache->free); } -/* Link ID related functions */ - -static int wfx_alloc_link_id(struct wfx_vif *wvif, const u8 *mac) -{ - int i, ret = 0; - unsigned long oldest; - - spin_lock_bh(&wvif->ps_state_lock); - for (i = 0; i < WFX_MAX_STA_IN_AP_MODE; ++i) { - if (!wvif->link_id_db[i].status) { - ret = i + 1; - break; - } else if (wvif->link_id_db[i].status != WFX_LINK_HARD && - !wvif->wdev->tx_queue_stats.link_map_cache[i + 1]) { - if (!ret || time_after(oldest, wvif->link_id_db[i].timestamp)) { - oldest = wvif->link_id_db[i].timestamp; - ret = i + 1; - } - } - } - - if (ret) { - struct wfx_link_entry *entry = &wvif->link_id_db[ret - 1]; - - entry->status = WFX_LINK_RESERVE; - ether_addr_copy(entry->mac, mac); - wfx_tx_lock(wvif->wdev); - - if (!schedule_work(&wvif->link_id_work)) - wfx_tx_unlock(wvif->wdev); - } else { - dev_info(wvif->wdev->dev, "no more link-id available\n"); - } - spin_unlock_bh(&wvif->ps_state_lock); - return ret; -} - -int wfx_find_link_id(struct wfx_vif *wvif, const u8 *mac) -{ - int i, ret = 0; - - spin_lock_bh(&wvif->ps_state_lock); - for (i = 0; i < WFX_MAX_STA_IN_AP_MODE; ++i) { - if (ether_addr_equal(mac, wvif->link_id_db[i].mac) && - wvif->link_id_db[i].status) { - wvif->link_id_db[i].timestamp = jiffies; - ret = i + 1; - break; - } - } - spin_unlock_bh(&wvif->ps_state_lock); - return ret; -} - -static int wfx_map_link(struct wfx_vif *wvif, - struct wfx_link_entry *link_entry, int sta_id) -{ - int ret; - - ret = hif_map_link(wvif, link_entry->mac, 0, sta_id); - - if (ret == 0) - /* Save the MAC address currently associated with the peer - * for future unmap request - */ - ether_addr_copy(link_entry->old_mac, link_entry->mac); - - return ret; -} - -int wfx_unmap_link(struct wfx_vif *wvif, int sta_id) -{ - u8 *mac_addr = NULL; - - if (sta_id) - mac_addr = wvif->link_id_db[sta_id - 1].old_mac; - - return hif_map_link(wvif, mac_addr, 1, sta_id); -} - -void wfx_link_id_gc_work(struct work_struct *work) -{ - struct wfx_vif *wvif = - container_of(work, struct wfx_vif, link_id_gc_work.work); - unsigned long now = jiffies; - unsigned long next_gc = -1; - long ttl; - u32 mask; - int i; - - if (wvif->state != WFX_STATE_AP) - return; - - wfx_tx_lock_flush(wvif->wdev); - spin_lock_bh(&wvif->ps_state_lock); - for (i = 0; i < WFX_MAX_STA_IN_AP_MODE; ++i) { - bool need_reset = false; - - mask = BIT(i + 1); - if (wvif->link_id_db[i].status == WFX_LINK_RESERVE || - (wvif->link_id_db[i].status == WFX_LINK_HARD && - !(wvif->link_id_map & mask))) { - if (wvif->link_id_map & mask) { - wvif->sta_asleep_mask &= ~mask; - wvif->pspoll_mask &= ~mask; - need_reset = true; - } - wvif->link_id_map |= mask; - if (wvif->link_id_db[i].status != WFX_LINK_HARD) - wvif->link_id_db[i].status = WFX_LINK_SOFT; - - spin_unlock_bh(&wvif->ps_state_lock); - if (need_reset) - wfx_unmap_link(wvif, i + 1); - wfx_map_link(wvif, &wvif->link_id_db[i], i + 1); - next_gc = min(next_gc, WFX_LINK_ID_GC_TIMEOUT); - spin_lock_bh(&wvif->ps_state_lock); - } else if (wvif->link_id_db[i].status == WFX_LINK_SOFT) { - ttl = wvif->link_id_db[i].timestamp - now + - WFX_LINK_ID_GC_TIMEOUT; - if (ttl <= 0) { - need_reset = true; - wvif->link_id_db[i].status = WFX_LINK_OFF; - wvif->link_id_map &= ~mask; - wvif->sta_asleep_mask &= ~mask; - wvif->pspoll_mask &= ~mask; - spin_unlock_bh(&wvif->ps_state_lock); - wfx_unmap_link(wvif, i + 1); - spin_lock_bh(&wvif->ps_state_lock); - } else { - next_gc = min_t(unsigned long, next_gc, ttl); - } - } - } - spin_unlock_bh(&wvif->ps_state_lock); - if (next_gc != -1) - schedule_delayed_work(&wvif->link_id_gc_work, next_gc); - wfx_tx_unlock(wvif->wdev); -} - -void wfx_link_id_work(struct work_struct *work) -{ - struct wfx_vif *wvif = - container_of(work, struct wfx_vif, link_id_work); - - wfx_tx_flush(wvif->wdev); - wfx_link_id_gc_work(&wvif->link_id_gc_work.work); - wfx_tx_unlock(wvif->wdev); -} - /* Tx implementation */ static bool ieee80211_is_action_back(struct ieee80211_hdr *hdr) @@ -447,9 +296,6 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, if (wvif->sta_asleep_mask) schedule_work(&wvif->mcast_start_work); } - - if (tx_priv->raw_link_id) - wvif->link_id_db[tx_priv->raw_link_id - 1].timestamp = jiffies; spin_unlock_bh(&wvif->ps_state_lock); if (sta && tx_priv->tid < WFX_MAX_TID) { @@ -468,7 +314,6 @@ static u8 wfx_tx_get_raw_link_id(struct wfx_vif *wvif, struct wfx_sta_priv *sta_priv = sta ? (struct wfx_sta_priv *) &sta->drv_priv : NULL; const u8 *da = ieee80211_get_DA(hdr); - int ret; if (sta_priv && sta_priv->link_id) return sta_priv->link_id; @@ -476,14 +321,7 @@ static u8 wfx_tx_get_raw_link_id(struct wfx_vif *wvif, return 0; if (is_multicast_ether_addr(da)) return 0; - ret = wfx_find_link_id(wvif, da); - if (!ret) - ret = wfx_alloc_link_id(wvif, da); - if (!ret) { - dev_err(wvif->wdev->dev, "no more link-id available\n"); - return WFX_LINK_ID_NO_ASSOC; - } - return ret; + return WFX_LINK_ID_NO_ASSOC; } static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates) diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index d02a7b325b27..83720b343484 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -18,20 +18,6 @@ struct wfx_tx_priv; struct wfx_dev; struct wfx_vif; -enum wfx_link_status { - WFX_LINK_OFF, - WFX_LINK_RESERVE, - WFX_LINK_SOFT, - WFX_LINK_HARD, -}; - -struct wfx_link_entry { - unsigned long timestamp; - enum wfx_link_status status; - u8 mac[ETH_ALEN]; - u8 old_mac[ETH_ALEN]; -}; - struct tx_policy { struct list_head link; int usage_count; @@ -63,11 +49,6 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg); void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb); -int wfx_unmap_link(struct wfx_vif *wvif, int link_id); -void wfx_link_id_work(struct work_struct *work); -void wfx_link_id_gc_work(struct work_struct *work); -int wfx_find_link_id(struct wfx_vif *wvif, const u8 *mac); - static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb) { struct ieee80211_tx_info *tx_info; diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 92bb9a794f30..3d40388739e3 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -378,13 +378,8 @@ static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, action = do_drop; break; case NL80211_IFTYPE_AP: - if (!wvif->state) { + if (!wvif->state) action = do_drop; - } else if (!(BIT(tx_priv->raw_link_id) & - (BIT(0) | wvif->link_id_map))) { - dev_warn(wvif->wdev->dev, "a frame with expired link-id is dropped\n"); - action = do_drop; - } break; case NL80211_IFTYPE_ADHOC: if (wvif->state != WFX_STATE_IBSS) diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 21566e48b2c2..813c2d09e034 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -13,9 +13,10 @@ #include "hif_api_cmd.h" #define WFX_MAX_STA_IN_AP_MODE 14 -#define WFX_LINK_ID_AFTER_DTIM (WFX_MAX_STA_IN_AP_MODE + 1) -#define WFX_LINK_ID_UAPSD (WFX_MAX_STA_IN_AP_MODE + 2) -#define WFX_LINK_ID_MAX (WFX_MAX_STA_IN_AP_MODE + 3) +#define WFX_LINK_ID_NO_ASSOC 15 +#define WFX_LINK_ID_AFTER_DTIM (WFX_LINK_ID_NO_ASSOC + 1) +#define WFX_LINK_ID_UAPSD (WFX_LINK_ID_NO_ASSOC + 2) +#define WFX_LINK_ID_MAX (WFX_LINK_ID_NO_ASSOC + 3) struct wfx_dev; struct wfx_vif; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 47271b7eeaab..84853aa90f4b 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -573,28 +573,26 @@ static void wfx_unjoin_work(struct work_struct *work) int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta) { - struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; 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; - sta_priv->vif_id = wvif->id; - sta_priv->link_id = wfx_find_link_id(wvif, sta->addr); - if (!sta_priv->link_id) { - dev_warn(wdev->dev, "mo more link-id available\n"); - return -ENOENT; - } - entry = &wvif->link_id_db[sta_priv->link_id - 1]; + // FIXME: in station mode, the current API interprets new link-id as a + // tdls peer. + if (vif->type == NL80211_IFTYPE_STATION) + return 0; + sta_priv->link_id = ffz(wvif->link_id_map); + wvif->link_id_map |= BIT(sta_priv->link_id); + WARN_ON(!sta_priv->link_id); + WARN_ON(sta_priv->link_id >= WFX_MAX_STA_IN_AP_MODE); + hif_map_link(wvif, sta->addr, 0, sta_priv->link_id); + spin_lock_bh(&wvif->ps_state_lock); if ((sta->uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK) == IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK) wvif->sta_asleep_mask |= BIT(sta_priv->link_id); - entry->status = WFX_LINK_HARD; spin_unlock_bh(&wvif->ps_state_lock); return 0; } @@ -602,23 +600,15 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta) { - struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *) &sta->drv_priv; - struct wfx_link_entry *entry; - if (wvif->vif->type != NL80211_IFTYPE_AP || !sta_priv->link_id) + // FIXME: see note in wfx_sta_add() + if (vif->type == NL80211_IFTYPE_STATION) return 0; - - entry = &wvif->link_id_db[sta_priv->link_id - 1]; - spin_lock_bh(&wvif->ps_state_lock); - entry->status = WFX_LINK_RESERVE; - entry->timestamp = jiffies; - wfx_tx_lock(wdev); - if (!schedule_work(&wvif->link_id_work)) - wfx_tx_unlock(wdev); - spin_unlock_bh(&wvif->ps_state_lock); - flush_work(&wvif->link_id_work); + // FIXME add a mutex? + hif_map_link(wvif, sta->addr, 1, sta_priv->link_id); + wvif->link_id_map &= ~BIT(sta_priv->link_id); return 0; } @@ -627,8 +617,6 @@ static int wfx_start_ap(struct wfx_vif *wvif) int ret; wvif->beacon_int = wvif->vif->bss_conf.beacon_int; - memset(&wvif->link_id_db, 0, sizeof(wvif->link_id_db)); - wvif->wdev->tx_burst_idx = -1; ret = hif_start(wvif, &wvif->vif->bss_conf, wvif->channel); if (ret) @@ -861,7 +849,7 @@ static void wfx_ps_notify(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd, dev_warn(wvif->wdev->dev, "unsupported notify command\n"); bit = 0; } else { - bit = wvif->link_id_map; + bit = wvif->link_id_map & ~1; } prev = wvif->sta_asleep_mask & bit; @@ -1114,9 +1102,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) wvif->vif = vif; wvif->wdev = wdev; - INIT_WORK(&wvif->link_id_work, wfx_link_id_work); - INIT_DELAYED_WORK(&wvif->link_id_gc_work, wfx_link_id_gc_work); - + wvif->link_id_map = 1; // link-id 0 is reserved for multicast spin_lock_init(&wvif->ps_state_lock); INIT_WORK(&wvif->update_tim_work, wfx_update_tim_work); @@ -1171,11 +1157,11 @@ void wfx_remove_interface(struct ieee80211_hw *hw, { struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; - int i; wait_for_completion_timeout(&wvif->set_pm_mode_complete, msecs_to_jiffies(300)); mutex_lock(&wdev->conf_mutex); + WARN(wvif->link_id_map != 1, "corrupted state"); switch (wvif->state) { case WFX_STATE_PRE_STA: case WFX_STATE_STA: @@ -1185,13 +1171,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, wfx_tx_unlock(wdev); break; case WFX_STATE_AP: - for (i = 0; wvif->link_id_map; ++i) { - if (wvif->link_id_map & BIT(i)) { - wfx_unmap_link(wvif, i); - wvif->link_id_map &= ~BIT(i); - } - } - memset(wvif->link_id_db, 0, sizeof(wvif->link_id_db)); wvif->sta_asleep_mask = 0; wvif->mcast_tx = false; wvif->aid0_bit_set = false; @@ -1213,7 +1192,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, wfx_cqm_bssloss_sm(wvif, 0, 0, 0); cancel_work_sync(&wvif->unjoin_work); - cancel_delayed_work_sync(&wvif->link_id_gc_work); del_timer_sync(&wvif->mcast_timeout); wfx_free_event_queue(wvif); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index cb359150e2ad..365aacc073fb 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -74,9 +74,6 @@ struct wfx_vif { struct delayed_work bss_loss_work; u32 link_id_map; - struct wfx_link_entry link_id_db[WFX_MAX_STA_IN_AP_MODE]; - struct delayed_work link_id_gc_work; - struct work_struct link_id_work; bool aid0_bit_set; bool mcast_tx; 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: 11333941 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4601F139A 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 23A5524671 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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: 11333937 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 792D4138D 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 3A0A924671 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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: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: 11333927 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 74CFD109A for ; Wed, 15 Jan 2020 12:14:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FA98222C3 for ; Wed, 15 Jan 2020 12:14: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="NibSf/RK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730819AbgAOMOM (ORCPT ); Wed, 15 Jan 2020 07:14:12 -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 S1731673AbgAOMNs (ORCPT ); Wed, 15 Jan 2020 07:13:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UBh4Y08K0w8HE9sxblNhpWvS/R9cYFtOEsAF0MN7cefjEEseQUypIT/ZYeniPai6185r/OgiyOOG1VY070b7NYxEnNwb8X+5WNMFD7ErC1Bv/xdudSivA51v1OEuuZNo2FtIZERQ7IG9J7QunPnvPlLDeMhLGZv2rYPEvNIAW+fRerwSsDIXosjPQrGCrKSxoMGkqzebSyWw/HEm3hQtn4Mf6TwMcq7osQfPe0suyVlfhi+jvoXMFtVl9wtThMOrmMBONijVx5e/OLsKdk1p4If85zDB4viUEYaOm1x122nt9hQSKKjQ19USFpyceBJBPbQIjxyxn6zk7M6GOWEDqg== 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=GOfkk1dzUC/6ez+F5LEQHcokA7G0L9veToOFnzjqtGc=; b=FjQ3FLHIwc/z4rzUanEB8ye8k8Xw9n0RY1dYf/AO5pYzSjdjkirHMOVRfBUJpTykYtMvlFtKs3wq52GzSoglFTVVusEtv1D8HrVjkqxq+L4MZIGlDICMz7PGMXhVCotdgPp6AGbzxxikGIYUPbdUjpeWNhe5Fnpg1716T6HldMNReFfWNl6lKZTomnTPT3B5XGp6MGNDaFRIecUHe+Q2swAkdLvPSAFjA8RZcLzhZZZR55oaSUbekA6hrvvPTdrTHcLy4AjK2igSRN70fPCddR3xcND3AFh3SNFkJbaigtipTutfc7JiEjvc3iJw/ms/Wc0K/zBePZ4ZNYp60+Q3WA== 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=GOfkk1dzUC/6ez+F5LEQHcokA7G0L9veToOFnzjqtGc=; b=NibSf/RK+EHrPsp0R3M4D1g5zVjyfcOFOVc95DQ4/Asma9wb/l/tRpO824cCoAEAfMpUZHk6fHSL9siJoPICNmgri4++03KI1ULA17XOMwer3JvIWffUikBbS9pIqxq+oebwOiGz5fsP/LWLQwyCimXPcZnaBdL/7ptMCRAcxoo= 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: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?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 53/65] staging: wfx: pspoll_mask make no sense Thread-Topic: [PATCH 53/65] staging: wfx: pspoll_mask make no sense Thread-Index: AQHVy50sVno8itD1SEeZHKH340+g7w== Date: Wed, 15 Jan 2020 12:13:19 +0000 Message-ID: <20200115121041.10863-54-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: aaa1a99d-f173-4142-c042-08d799b44f09 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:283; 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: LGeeV9p1rMvugEHmbAbpHiakR8EcuRoNUCuNusK5ZGI9vHj2kfylpKTLg3MWqBQ2m6vFexY6O0APHeBGydUNqT/B8Bm8LWC0960hPd946Pjhi33+N6ewkmqdzFiMMM+7cyv59ijtCVUlchqNgsOXBSDI0wjlJdihZyQQqSWh3fPgqNCKILiHcxRKkE+G5+XKJjzMxBlnoNy7RWbJ0oNy2+O9I98JLMSo8tNQX16h0czFftY2w3Qq15D8kE01T3sm223/WcVG/zxL1Zs4yCJjihjOMc5YVUm9SEM9THe/0IJC1G+QL5LwLbGUhZjjqpu2Sa6og0v9J0z+bSgEbICogzM+SVMLZxFcJm9GZzd7TjIgOVYTWy68wsW+UMbAPjbJOXhPIURMmJMs7hRTCQ5uCQLC1KCr+LMTTDYc+pD0XFxHvl8BPmpZ8T76Mj9/3quz Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: aaa1a99d-f173-4142-c042-08d799b44f09 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:19.7195 (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: MSrfxtv+CQ5IueRNroK5Cg/9hGoA8qMvo9OieA51DYOxtXLhNViL5O6kGn7Ver3uDwX9Eoc05h8QuXtIes5ziA== 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 pspoll_mask is here to send data buffered in driver. But since station is marked buffered, TIM for this station is 1 and mac80211 will call sta_notify when a ps-poll is received. So pspoll_mask is useless and sta_alseep_mask is sufficient. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.c | 39 ----------------------------------- drivers/staging/wfx/data_tx.c | 4 +--- drivers/staging/wfx/queue.c | 8 ++----- drivers/staging/wfx/sta.c | 2 -- drivers/staging/wfx/wfx.h | 1 - 5 files changed, 3 insertions(+), 51 deletions(-) diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c index 699e2d60fa89..5d198457c6ce 100644 --- a/drivers/staging/wfx/data_rx.c +++ b/drivers/staging/wfx/data_rx.c @@ -13,41 +13,6 @@ #include "bh.h" #include "sta.h" -static int wfx_handle_pspoll(struct wfx_vif *wvif, struct sk_buff *skb) -{ - struct ieee80211_sta *sta; - struct ieee80211_pspoll *pspoll = (struct ieee80211_pspoll *)skb->data; - int link_id = 0; - u32 pspoll_mask = 0; - int i; - - if (wvif->state != WFX_STATE_AP) - return 1; - if (!ether_addr_equal(wvif->vif->addr, pspoll->bssid)) - return 1; - - rcu_read_lock(); - sta = ieee80211_find_sta(wvif->vif, pspoll->ta); - if (sta) - link_id = ((struct wfx_sta_priv *)&sta->drv_priv)->link_id; - rcu_read_unlock(); - if (link_id) - pspoll_mask = BIT(link_id); - else - return 1; - - wvif->pspoll_mask |= pspoll_mask; - /* Do not report pspols if data for given link id is queued already. */ - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - if (wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[i], - pspoll_mask)) { - wfx_bh_request_tx(wvif->wdev); - return 1; - } - } - return 0; -} - static int wfx_drop_encrypt_data(struct wfx_dev *wdev, const struct hif_ind_rx *arg, struct sk_buff *skb) @@ -125,10 +90,6 @@ void wfx_rx_cb(struct wfx_vif *wvif, goto drop; } - if (ieee80211_is_pspoll(frame->frame_control)) - if (wfx_handle_pspoll(wvif, skb)) - goto drop; - hdr->band = NL80211_BAND_2GHZ; hdr->freq = ieee80211_channel_to_frequency(arg->channel_number, hdr->band); diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 7da1afd6e9b5..7914c06578aa 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -286,10 +286,8 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, int tid = ieee80211_get_tid(hdr); spin_lock_bh(&wvif->ps_state_lock); - if (ieee80211_is_auth(hdr->frame_control)) { + if (ieee80211_is_auth(hdr->frame_control)) wvif->sta_asleep_mask &= mask; - wvif->pspoll_mask &= mask; - } if (tx_priv->link_id == WFX_LINK_ID_AFTER_DTIM && !wvif->mcast_buffered) { diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 3d40388739e3..42d64534c92c 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -493,12 +493,10 @@ static int wfx_tx_queue_mask_get(struct wfx_vif *wvif, /* Search for unicast traffic */ tx_allowed_mask = ~wvif->sta_asleep_mask; tx_allowed_mask |= BIT(WFX_LINK_ID_UAPSD); - if (wvif->sta_asleep_mask) { - tx_allowed_mask |= wvif->pspoll_mask; + if (wvif->sta_asleep_mask) tx_allowed_mask &= ~BIT(WFX_LINK_ID_AFTER_DTIM); - } else { + else tx_allowed_mask |= BIT(WFX_LINK_ID_AFTER_DTIM); - } idx = wfx_get_prio_queue(wvif, tx_allowed_mask, &total); if (idx < 0) return -ENOENT; @@ -585,8 +583,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) if (hif_handle_tx_data(wvif, skb, queue)) continue; /* Handled by WSM */ - wvif->pspoll_mask &= ~BIT(tx_priv->raw_link_id); - /* 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; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 61d64beb6143..6697c736a054 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -867,7 +867,6 @@ 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; - wvif->pspoll_mask &= ~bit; if (link_id && !wvif->sta_asleep_mask) schedule_work(&wvif->mcast_stop_work); wfx_bh_request_tx(wvif->wdev); @@ -1178,7 +1177,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, wvif->mcast_tx = false; wvif->aid0_bit_set = false; wvif->mcast_buffered = false; - wvif->pspoll_mask = 0; /* reset.link_id = 0; */ hif_reset(wvif, false); break; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 365aacc073fb..8491f050478d 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -91,7 +91,6 @@ struct wfx_vif { struct work_struct tx_policy_upload_work; u32 sta_asleep_mask; - u32 pspoll_mask; spinlock_t ps_state_lock; struct work_struct update_tim_work; 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: 11333921 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 28ED9138D 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 F2984222C3 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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: 11333917 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 24765109A for ; Wed, 15 Jan 2020 12:13:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC9BB222C3 for ; Wed, 15 Jan 2020 12:13:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="MTySAJMa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730422AbgAOMNu (ORCPT ); Wed, 15 Jan 2020 07:13:50 -0500 Received: from mail-co1nam11on2064.outbound.protection.outlook.com ([40.107.220.64]:28929 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731675AbgAOMNt (ORCPT ); Wed, 15 Jan 2020 07:13:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bCQEoSnB9R5vVySa1kVyYNiHVlhuxW0BopIMuMIleqyqSgNW8r8CMmNpzywiTXaOgZWDDmfBW+rg80s+a9FYUOTc2sJ8VHGHM75TZLzvM/pcrideEsj5LTzXiIzyg21yIriQZFdf3ChIhN95v48R6ZYycOO4Y59J3gEWFrzTYLsgmczN6Ez/GoJQNCNfmTEdRR198RU3vxohajFEWj1F16DLG6NFPjY8Qk5XEe24sRUkvMvQl+QFCkX7p/j7soBSY1Wdch5KK1SNQCtv+bTtO/JtLDcs0640WMEZioF7dOLRmvHhg4RxeEsrWDTygoyKjGj2Bz5FK6rhq9WSg8+uGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B+zq5T9uMxfb/CgmD1ygDpRDLGnzrLVhppu2bg4VgJQ=; b=NW+NvbNgpApKXpyBJFhUnOdixbMw3Tc0+9dDQrGFI+Se5Q2fNKUQOKYM6qNtNXODeTWKO1Ei+M0OTHjJvKU+pLWa6AC+SmeVqQdtK3BrbEiivCk3fQCXnHyAGHeSuzTgBZzgYBez7QacpJNFYsvU2i6PY4Rw72X/6hSzbxQVxxOUsop0DJD8vwk+NKd0mJnyzfu3OS0vCmY+ngtcSqg/HDaRktqOZlL7/bTXJ1ToMfxbQ54JVA9u6IahwJO+6KhN+KUfqpyCQKg+8MX0ESwvUQcIO9ODw+Mo3oHJp0xq6flGfdpvjmGOcTBOoe+WukJG7PwvAnz8bz4j/ZIh0Ld4/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B+zq5T9uMxfb/CgmD1ygDpRDLGnzrLVhppu2bg4VgJQ=; b=MTySAJMaDsVDiqeHg8iQPniY0dv+NgCd5DXdN9q8+rz83iXoH8k77mTGozF19JbrVFKID+sqZUDQxB9i7pBG0YU/B8VxecEP+ySiGX2ZeaBARZxXuNPpYTBtMwg3I5yP6es+mkg3qcAwkYLhhN6wREmaqNVDq+qoqWC1FKlZ5dk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13:34 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:34 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:21 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 55/65] staging: wfx: firmware never return PS status for stations Thread-Topic: [PATCH 55/65] staging: wfx: firmware never return PS status for stations Thread-Index: AQHVy50uPuhrVCL5JUid2UVR7lkP9g== Date: Wed, 15 Jan 2020 12:13:22 +0000 Message-ID: <20200115121041.10863-56-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 783d192f-f107-49d3-80e4-08d799b4509c x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB3934;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OcX5SeFyt8VMlwMga49ftRfYugosQgEsOnY1Z7CP1cvdEtkNWrqNS/gv3Jc+OISnM8RKLe7fUbNHUeFhe2UYG3TZweT32Gt9ZnehPAwFisvGutQ4z0z2KsHSPQAribfcV+Jyc+Lveum1F1GJrGC3jf+7t66MuaDpJymZmP5zty/e8krmVqB2WkFd1OTXA/PsJrKKFej04EO2x4xlTWymVcnFm6tArh8nwltb6ZfhiRUo64sKEsBh52wVqGngBRyrZjWKGSKfTxU3rT4W/Mzi5ia3+99HgplVmYeLh6S/l2ebPhLQsitbUFBhbxfIcMCXjq9itR6eX8t3eWKe7UADgLlPeVP8MV8QE4ptWJWVZguJjQ4aHsonJnMNjgdYJWUP59UnoX3s/77yhSKqD6+CTuLFfRGSP2OUfNHKzV03BZ/jtMkTMbShizAPCX9usJQG Content-ID: <119AB7DD32FCA94C9AFD7932B6368CD4@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 783d192f-f107-49d3-80e4-08d799b4509c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:22.4110 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sbw8C2DfxG5jxnYm91YY/LFbO6XRTxdJhn7ssdWianN0/W+MYww0m7CZ4XvcHR3aphcokYwyrJ84hTwsl9QF1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller At the beginning, firmware could send suspend_resume indication to notify that a station wake up or sleep down. However, mac80211 already handles power save status of stations and this behavior has been removed from the firmware. So now, when suspend_resume indication is received, it is always to notify that a DTIM is about to be sent. So, it is possible to simply wfx_suspend_resume(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 43 ++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index d4c11b07497f..ce83a57397c8 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -985,38 +985,29 @@ int wfx_ampdu_action(struct ieee80211_hw *hw, return -ENOTSUPP; } -static void wfx_dtim_notify(struct wfx_vif *wvif) -{ - spin_lock_bh(&wvif->ps_state_lock); - wvif->sta_asleep_mask = 0; - wfx_bh_request_tx(wvif->wdev); - spin_unlock_bh(&wvif->ps_state_lock); -} - void wfx_suspend_resume(struct wfx_vif *wvif, const struct hif_ind_suspend_resume_tx *arg) { - if (arg->suspend_resume_flags.bc_mc_only) { - bool cancel_tmo = false; + bool cancel_tmo = false; - spin_lock_bh(&wvif->ps_state_lock); - if (!arg->suspend_resume_flags.resume) - wvif->mcast_tx = false; - else - wvif->mcast_tx = wvif->aid0_bit_set && - wvif->mcast_buffered; - if (wvif->mcast_tx) { - cancel_tmo = true; - wfx_bh_request_tx(wvif->wdev); - } - spin_unlock_bh(&wvif->ps_state_lock); - if (cancel_tmo) - del_timer_sync(&wvif->mcast_timeout); - } else if (arg->suspend_resume_flags.resume) { - wfx_dtim_notify(wvif); - } else { + if (!arg->suspend_resume_flags.bc_mc_only) { dev_warn(wvif->wdev->dev, "unsupported suspend/resume notification\n"); + return; } + + spin_lock_bh(&wvif->ps_state_lock); + if (!arg->suspend_resume_flags.resume) + wvif->mcast_tx = false; + else + wvif->mcast_tx = wvif->aid0_bit_set && + wvif->mcast_buffered; + if (wvif->mcast_tx) { + cancel_tmo = true; + wfx_bh_request_tx(wvif->wdev); + } + spin_unlock_bh(&wvif->ps_state_lock); + if (cancel_tmo) + del_timer_sync(&wvif->mcast_timeout); } int wfx_add_chanctx(struct ieee80211_hw *hw, From patchwork Wed Jan 15 12:13:23 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: 11333955 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3AF2D138D for ; Wed, 15 Jan 2020 12:16:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 062FC207FF for ; Wed, 15 Jan 2020 12:16: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="Gu89VLCw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731753AbgAOMP7 (ORCPT ); Wed, 15 Jan 2020 07:15:59 -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 S1731461AbgAOMNj (ORCPT ); Wed, 15 Jan 2020 07:13:39 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=es03BDidJGJIWzYK4zM/xqndsYAPL3cyk/xvGuyt0oTq3mtA7O+gA1e4Bqpm+kbSzfd/30QCDp8N8Jjk9Fv0lPC/YkWti+N7wHXQdouE1QEWK3PZmAEk7XfetLCVrXwGw0bxeJZXRyzeYB4DdkhpxJl10N+ZaBk0KIRV9Bvof9U3cDuQ6o07pLomFGJojtTU599+grWwFe59J7wxuZ/3HYm6T0qOFT+tLrXKASo6K6MI5n4h1DQo9DNnuvid0M7zHHanguElyx2zNX7KTzoP1lqptfP/1hn5CYdq+8e4S8p9cG8GjHMQtTqiTJMfqsfH6tOsJ9qsd+goBEWRulIf5g== 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=5kV1mbBs0jOG7Or6aTX90C/te15BM0ZpZCx4HAP9Y5w=; b=echtPNL5TTI44qk50A90nlGn4NOep9XiQ4CusmUwyOs4b1YYTocSj4kIu0NvE9cv+f4vBQbupE/bg9DeHeFMMdsb8Gjd+T4JSfhR7xm+ewmkiO4iOsxppPWQ3brT5+gGeeLgyatxvTW68Vj42hLhFq5myryFJmLa32DGRYhajY6KIrQ/JmmBsamXmHFJQfY7FsNMsKug3fujVVxAN3sZ2LWEdZYgJo1biolHhZ3W8OQDMBnBeJ0eCfdU97qg52KuD6VK/Lxy1O02ZTvzC+Yb3u/6rZ/Zdv3UZiOBR+3+dDR449vMP78vXOPHxbDy77s38NKcwcIGfY/B56+zFK0pLQ== 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=5kV1mbBs0jOG7Or6aTX90C/te15BM0ZpZCx4HAP9Y5w=; b=Gu89VLCw/mzo8x2MO0/KfzEZfcGr6Q9lK1BjdkxM1DYOXhbanUSa+mS2j8p9C5otWJZpI0ni4A9/Euu90ojjRL+QXJDtu797IapxkZVgkE+PTd6+YR+vn2+4sgqdqhZ7CmNE38TvzwRhgRqxpHfOU9rW6sgcvBjoXVutE2GXEtQ= 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:22 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 56/65] staging: wfx: simplify wfx_suspend_resume_mc() Thread-Topic: [PATCH 56/65] staging: wfx: simplify wfx_suspend_resume_mc() Thread-Index: AQHVy50v4qDMzV+kQkmNjY0FuosDNA== Date: Wed, 15 Jan 2020 12:13:23 +0000 Message-ID: <20200115121041.10863-57-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: 4af61dcb-ed44-41ca-94c1-08d799b4516d 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)(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: +YVbE2n5rnoyRPLKDwlSZdZ3DsyIJf7hWi9muntGcxmgHG/cy+sa2e7fxoQgt6xxhzew9tqMQfcV6OPYhWUc+czUPz7nHnZETuGREqA+Ec+/fVwbOXW39clydXEpkGDk3NCqV1i4Mk4BWck2qydFInSoP+AeOpwflY0edK/o2VrUBfZO/0y6gpYBxMSbL6pNUpU1Bi/pjrLT4asgTEyGMiyne5dbGmx1h2ClbMec5RhQpTd4LRUKXL+GOHdDKMsZPSWYCRlCYcBLydjjMOjRBHP4VZFooAZ6KD3V0pfZ8tTTDg6IvUma3HO9A6U3kJgGWMaTRURDBmDiBDLLGUqpl5ibimlTvErisvas7Hq0Gt0JiSgMkRrWoYydnS/BIE4ijmeTUflUH8bbkxisUmD6zWdMv9fxj0drE1Iaq9Dh/QY+9WBKYQ5tXOttRbE8fkuf Content-ID: <0590BED78D148B4DB4866472D22F022B@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4af61dcb-ed44-41ca-94c1-08d799b4516d X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:23.7562 (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: j25C4Viz+OAR8APZLIGhrUkYG2sNH2VHc8AJVOvYXEgjigI2Fo2q+KZR1dGYoNNaAYN8dHzB67NUptuzuefqtQ== 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 Indeed, it is not necessary to pass whole hif_ind_suspend_resume_tx to wfx_suspend_resume_mc(). In add, the structure hif_ind_suspend_resume_tx come from hardware API. It is not intended to be manipulated in upper layers of the driver. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 7 +------ drivers/staging/wfx/hif_rx.c | 6 +++++- drivers/staging/wfx/sta.c | 10 ++-------- drivers/staging/wfx/sta.h | 3 +-- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 7914c06578aa..8710383f66e5 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -600,13 +600,8 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) tx_info->flags |= IEEE80211_TX_STAT_ACK; } else if (arg->status == HIF_REQUEUE) { /* "REQUEUE" means "implicit suspend" */ - struct hif_ind_suspend_resume_tx suspend = { - .suspend_resume_flags.resume = 0, - .suspend_resume_flags.bc_mc_only = 1, - }; - WARN(!arg->tx_result_flags.requeue, "incoherent status and result_flags"); - wfx_suspend_resume(wvif, &suspend); + wfx_suspend_resume_mc(wvif, STA_NOTIFY_SLEEP); tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; } else { if (wvif->bss_loss_state && diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index f04afc6db9a5..f798cd6973b6 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -230,7 +230,11 @@ static int hif_suspend_resume_indication(struct wfx_dev *wdev, const struct hif_ind_suspend_resume_tx *body = buf; WARN_ON(!wvif); - wfx_suspend_resume(wvif, body); + WARN(!body->suspend_resume_flags.bc_mc_only, "unsupported suspend/resume notification"); + if (body->suspend_resume_flags.resume) + wfx_suspend_resume_mc(wvif, STA_NOTIFY_AWAKE); + else + wfx_suspend_resume_mc(wvif, STA_NOTIFY_SLEEP); return 0; } diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index ce83a57397c8..d647dff46673 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -985,18 +985,12 @@ int wfx_ampdu_action(struct ieee80211_hw *hw, return -ENOTSUPP; } -void wfx_suspend_resume(struct wfx_vif *wvif, - const struct hif_ind_suspend_resume_tx *arg) +void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) { bool cancel_tmo = false; - if (!arg->suspend_resume_flags.bc_mc_only) { - dev_warn(wvif->wdev->dev, "unsupported suspend/resume notification\n"); - return; - } - spin_lock_bh(&wvif->ps_state_lock); - if (!arg->suspend_resume_flags.resume) + if (notify_cmd == STA_NOTIFY_SLEEP) wvif->mcast_tx = false; else wvif->mcast_tx = wvif->aid0_bit_set && diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index e832405d604e..cf99a8a74a81 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -82,8 +82,7 @@ void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf); // WSM Callbacks -void wfx_suspend_resume(struct wfx_vif *wvif, - const struct hif_ind_suspend_resume_tx *arg); +void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd); // Other Helpers void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad); 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: 11333949 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 15EC0138D for ; Wed, 15 Jan 2020 12:15:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB5A524671 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:26 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: 11333919 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D1BCA109A for ; Wed, 15 Jan 2020 12:14:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A634E222C3 for ; Wed, 15 Jan 2020 12:14: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="Lbo3DgIA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731825AbgAOMN4 (ORCPT ); Wed, 15 Jan 2020 07:13:56 -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 S1731736AbgAOMNt (ORCPT ); Wed, 15 Jan 2020 07:13:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SkAph8WeGD/jFYrP/74XIq9c3cdFOa47TK8VNxJ9NQ0pPS7JbpWApn3c2yHsYBd5ZyQiolj0u2O50F+muaZW+Rel7V8/pw3WzjORHC4a4Bc3aZo4wsSMtOHCsHHlBReUgLx4SdmUmzW5rMatm7YbhHnfG2EBAFezxk1BnO/KUBOBi5hlDfbcFc/jhkRySH7aLVkATfUi0JJXccCbhG6Xca3FydocH9XY6OSZLenuHz0iXBn3pj7g958OjpGrpl4r/O9mBC7wR+BB7c+Xz58DE2nPGN05uW/zvct0Mb1wwiktEnSN9JA3g3WLK3XwMu0R88oShYvoQZOp9pLNJ3RDLA== 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=KdY34f6/5pVjPW8ktmpJGZ8wwaxZNv+zB55DXZmEGhY=; b=b888WijhZhKliOhj/Qbh8oXL2QXkiWZVVW57j+0587T644L8SDcYLCfSyMYtC6MXTZOTJS+tGoMYtpdS3DIHWFNJ35Vx2592VUgJ6rI8TWKOqozUBPqOJoVzyGAvdngkXZwRJ+JxD+HWi6i9N2/A8gDqCs2FEMbDlnTta/E9vxy90jvQ8aCcqqg6xuslf8YmaxPri6py0vsvl5b36ZrQEFbfZCeVYdlyGUqj2qPS4Mt2HBIAb24hn/0OWQAs2k7SwC1bYOXI3oxhd56b2bGZe5OT+XSzi7Qv9Nj1Ddf7eJeIZyGiyoDrTq0uJwzq0O1dYomd1ytX6/3Ol1tjyCyvpQ== 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=KdY34f6/5pVjPW8ktmpJGZ8wwaxZNv+zB55DXZmEGhY=; b=Lbo3DgIAbqmtTTuD7u+FpTv5kbiAmAjah08gd2TrmH/84aI87703NfpDa58V3QeFBCWCjApyWF2Fh//WWWiZeT+1EgpV9oyJf3YnvAHFjr446pJI4GJsy1xwqAyj8wvqq8hoDUBQVE90Nn/D1kzYFCfYKsDZb7+ZD+Foder5o1Y= 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: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:13: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:13:25 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 58/65] staging: wfx: simplify wfx_ps_notify_sta() Thread-Topic: [PATCH 58/65] staging: wfx: simplify wfx_ps_notify_sta() Thread-Index: AQHVy50w6TEiPc00BUGEr/tp+4T/ew== Date: Wed, 15 Jan 2020 12:13:26 +0000 Message-ID: <20200115121041.10863-59-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: 810c92fb-a78c-46ac-e74f-08d799b45316 x-ms-traffictypediagnostic: MN2PR11MB3934: 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)(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: 1o3AqzSkuwd3sVk/94c9kPZQLlZn/jaNlyNm8yMA019UzRlHciWykY6coaKVmFKMJBGEMvVtOpMj/mgDb4BgEz3d/4qFG44KADM1wXEFZ4BzGvt963Mey6EtTShvMgeLqHgpQqeb6p5vQdtzj4IhQyPVlUbWJg9k9YS4tXRAjOrztsxZRdWockAwez2kyFCxi9A+QbNjdDr203M36mtoj1AnaOveC2HjnM0wUQ5KhM6quHOLEpvHT0+4sIzya3zluhiwaHaa2GyTXhHDTz8izQdUYusFwKAj7Z/8Xq9rZfgjQjaAcF/gJCPS+wqZezwNO1D7sKMnS8bHp9xEmoKSbUCElYIzgEsHafsZ/I91iC5smIVZrQu5W9JaeoWko55NU3Nq5lFcQvdrW/03ATfdzJQ/tFCbmKInSHPQDuWOK8RRJ5xTZ87Zf+ZpaLL9LDmQ Content-ID: <465800C37CFC0E4DABCD93C50CD4D0B8@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 810c92fb-a78c-46ac-e74f-08d799b45316 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:26.5506 (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: 4O42KUlctC+cQN+TYEFimTvRYOGjLIkRW1fyPjxO7hfOi2anwphmUeqzjDeMHDXM1AtHs7fjQSYtiqwMvi0g4g== 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_sta() is too complex compared to the task it do. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 01eee06a1ef4..726884091706 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -842,26 +842,14 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, 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); - bit = BIT(link_id); - prev = wvif->sta_asleep_mask & bit; - - switch (notify_cmd) { - case STA_NOTIFY_SLEEP: - if (!prev) { - wvif->sta_asleep_mask |= bit; - } - break; - case STA_NOTIFY_AWAKE: - if (prev) { - wvif->sta_asleep_mask &= ~bit; - wfx_bh_request_tx(wvif->wdev); - } - break; - } + if (notify_cmd == STA_NOTIFY_SLEEP) + wvif->sta_asleep_mask |= BIT(link_id); + else // notify_cmd == STA_NOTIFY_AWAKE + wvif->sta_asleep_mask &= ~BIT(link_id); spin_unlock_bh(&wvif->ps_state_lock); + if (notify_cmd == STA_NOTIFY_AWAKE) + wfx_bh_request_tx(wvif->wdev); } void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, From patchwork Wed Jan 15 12:13: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: 11333935 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3981138D for ; Wed, 15 Jan 2020 12:14:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9A87124671 for ; Wed, 15 Jan 2020 12:14: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="Md8ezmzL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731015AbgAOMOb (ORCPT ); Wed, 15 Jan 2020 07:14:31 -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 S1730768AbgAOMOa (ORCPT ); Wed, 15 Jan 2020 07:14:30 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fOWwIz/yItcWai/D+jqCjDW5Lyq3GUnRTCc4bYv8CdBL56OT0Gjasmjt6iScVLosc7lw1KJXVKyR11rc2nbxgOFuvjJHpfcikFQ8j0o8H/pOLLay8b046AgZpo0M7UwYm681hbWGfz77t4MhaTRHQZIimpnHUvyzuRCng+ImjUQhmoeZpaofTFaUasuv+AQ3lxmPNWb7PxuVxr5ynEdIFV0YoNSlg6NWcOfLFLxy278bbEBG+FJYLJiqaJRd19RdgCyrH1OE/YPh+i33/vg6xm21DE3PpfQAgqWX0cHwo4o/1Y/HhBg0HJ5QhWZRa0K/fGRtRxBO2w3O+erBPTxjNA== 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=NV6i8iFSi16VOyb/8DY1eR4/NhyYerJyThLKXln0oV0=; b=XPD7eGgGJB8SnYnyWjnpE8bnLBOVfH2V64n0iQMBjHBBLS3sC06HPXbrzvRhJ1TaB68ZQifLyBigU0ae54RhBzhPdA9lu7CQAPQMGrZU/BEFnOfbxf2L0JjfZRd0FMf66hSL+nJgKXh/YZM5upYZrUj/WTL1Annowh8wnAh8IhsOqWYEXWWjIsqPQJaQtyCdy+sj0S7cPupht+8tb0utH0uln4Pq3jZzBsVdiZngtD9MCh6lPkrCJcAJ7E0Q761XeKlj7BoiLC0FtwYpjiMrY3LGbuFjJOoDRbFTzq3diHbn4zyjxlxHEdrmb95HSPEFt/BOW9jhxNEMZv0wkvUDqQ== 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=NV6i8iFSi16VOyb/8DY1eR4/NhyYerJyThLKXln0oV0=; b=Md8ezmzLb3VrPsDPer2OczEMomSCJTd09QasSMk85RyIXwOkYSKQl7TyVpZA88W4Act7/6q/HvAYPE9CxKNuoqgxVC5ARuKUFTa6D5FUg65eAhc24mm59K396+qTYe/5tH2zDDTaVAAbfdkmXHSxyTugYnV6JSlogv4DATzAk+s= 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: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:13: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:13: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?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 59/65] staging: wfx: ensure that packet_id is unique Thread-Topic: [PATCH 59/65] staging: wfx: ensure that packet_id is unique Thread-Index: AQHVy50xnP1XCgggU0yByloZoEVwtg== Date: Wed, 15 Jan 2020 12:13:27 +0000 Message-ID: <20200115121041.10863-60-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: 719e2ba5-2756-4a2e-19e0-08d799b453e3 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)(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: SkDaqEicunoEpjBJodALyj6uvC17gLYAt+/y/m3RT3Y3LxVWhobDneKusaNrlTot0LF8AYbfKxwGdysk29D9G/3ufqM59izY7FfClM81/b2PyrYDc4f63yGIaMcIEuS8r1x0F3Lo7k58kRr6OnEQXE6VtzQkCchq8XznnzfPs7Sv+GFYLb+oJ8hWjbGhBsUoBEw6TAefpDl5PYHA2/5we/p/YnRdcIH7gzJ8FZASHZpE9tjJab8hInXRKxOLAcA302T+yM9LsgyeQqFiBwBhouTq12uMwHeHrjbMj6STupzlWPMkbUa6nRe8LPAfejJt/EX9lOqnjTlfHrI5FKHqG+0vtH1iRq0XRi7iEDtmhUQ3esBmv+w3Pwjmc/iN/Oxsjm/tz2HtkSW5gTDMRAUk23+MXsJfJJLumwmONSRFNxWiCEePbVC1XZAJuPqTQQcq Content-ID: <2E2E1E9D06C44042AC13A8C067BEC5E5@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 719e2ba5-2756-4a2e-19e0-08d799b453e3 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:27.8818 (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: tKa55qBrvxqBf5/Jbu9FTy4yVDqv96VrhNZUhs7scy/PhUjRIjsPux0eUkaX5MKCF+GuxDdR9tS6F7wKNQ76ag== 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 current code, packet_id is derivated from mac802.11 packet sequence number, but this number is only unique for a station. It is not sufficient. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 8 ++++++-- drivers/staging/wfx/wfx.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index c32994553633..20f4740734f2 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -469,8 +469,12 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, // Fill tx request req = (struct hif_req_tx *)hif_msg->body; - req->packet_id = queue_id << 16 | - IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)); + // packet_id just need to be unique on device. 32bits are more than + // necessary for that task, so we tae advantage of it to add some extra + // data for debug. + req->packet_id = queue_id << 28 | + IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)) << 16 | + (atomic_add_return(1, &wvif->wdev->packet_id) & 0xFFFF); req->data_flags.fc_offset = offset; if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) req->data_flags.after_dtim = 1; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 5d61946e33e0..8b85bb1abb9c 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -54,6 +54,7 @@ struct wfx_dev { int tx_burst_idx; atomic_t tx_lock; + atomic_t packet_id; u32 key_map; struct hif_req_add_key keys[MAX_KEY_ENTRIES]; From patchwork Wed Jan 15 12:13:29 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: 11333923 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 55ED5138D for ; Wed, 15 Jan 2020 12:14:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A83A22522 for ; Wed, 15 Jan 2020 12:14: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="G9mD9jgS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732223AbgAOMOR (ORCPT ); Wed, 15 Jan 2020 07:14:17 -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 S1732137AbgAOMOP (ORCPT ); Wed, 15 Jan 2020 07:14:15 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N5exO7vYm2/zjjKRDMMti+bgaSS8fMGzGjYMv3fTAo6Yt7iZwDpIt+Czx+LYHBWHLNk8D+li2OLxtylMoOaEvhUAJXrfRRue4TSgQX12NB8x8BFiLBuBwjan6Xt7qqwc/ejToeGR14YwGWIZdN+/jP8akMW2pgYdvTL4xB7MluudfNftJoo33e8+fr6wtRbpq/qUmyq8hWL29cxhHkyiM8UzEX7qb0LxURBtDLyt9zTlZgOl1aUlOe9ONAl4XBziEjvS0N3lT072cfRl1xXnY/7AVj2WDM3XqLv5+yjno7eIuLS3iWRCwuS1rqijFIrOcz3fq/kniPGwv3/F9RaHBA== 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=luKP9pYxXrpl3mvhVrHrZpccjgG6OVYJbBR4szwSZPY=; b=Q9W63Og/3G0SyCZOAPEEPUdV9ZJbst2G+RxxZ0kxgxPgWEOTVmcRL9YLp5NpFksJVg7KQFyCRQ5em75z4Dk3CgOCpSx9Q8J1l3eEK1gHwbdfUt6x0uzLS1A0x4wzOyT3uDSZWILx1IiOennmkQEC0sNdbXd68KizD2KWaTu/NzWhCB3DkNzYqOI9RMpQb8Gzxd9QinfYwTaUEGWiOblxVEEPUvy/phl5VKnFeIXTHOLS/mAQcX2sYfOudRXWcH/gwoOBbK7J/21qBwgzpOfAwUA7LWxttQUj9yx5mKHCS3BRSv6xKA9xXvU7OyPPAtgjxYDT8mUBAY5I+dh6U13Fmw== 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=luKP9pYxXrpl3mvhVrHrZpccjgG6OVYJbBR4szwSZPY=; b=G9mD9jgSHLFgtdB8AERT6quvBvnjKMNdNhcKrQaTMtGIZ3HdQzq6Lr42Bf6vYvOulhEmykONdqSyNdfkWF9+0XMbLrS/FrTbMbjZnSROi9z5oRW3NRp8V1kmvAaikH6O7S51XcD8MoWvbkxh96OSDfruaUCvrWUTDMUgWgmkAPc= 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:28 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 60/65] staging: wfx: remove unused do_probe Thread-Topic: [PATCH 60/65] staging: wfx: remove unused do_probe Thread-Index: AQHVy50yZCDG14x/QEqvO443wPtmqA== Date: Wed, 15 Jan 2020 12:13:29 +0000 Message-ID: <20200115121041.10863-61-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: 52bed07b-b07f-4dba-1384-08d799b454b7 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:457; 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)(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: tIPToy6PUNN5DL0B0xUzYZGG5ofgGVBXVjc7DxZGKl+fPW2GGMc25pH7aaF4h0pYp4pPWUn1OR1BmzANuPGBq2mACYqU4b5O+mH2Bpws/QXwkqE7etEoh4MrNpq+AOuxgXbRWz3eris0DoU3CiZWeeNcVZLS7RyLBx4HU1c6I49Ku3c2iaqigayMnaB8M3XBi0I/Gsq7eVRpXEq99SMVlTvgU7tK2k/lKAVbsrDDPqlEw0tAIrCllNhZ936mDktgKXBiArsjjz2s7F7SqNvNs2S2pK006nF3xqsG8Pqwl1dz/fmwbSlrhCkz+dfttrmX6LOA6MUhLzg/d5FRS/f6uonq5BZDP3gEULS62LQw//D9GDvO3qoTWP/xTMFDu1F6hjX3VMKVBab3bHAH2H0fipEPkDDWTYSBkEXW7kiaHrsSk71LmT55E+xh3nE2ALUe Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52bed07b-b07f-4dba-1384-08d799b454b7 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:29.3859 (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: tZH5YHYabW5lW0J4Ju6M901ciwnsTGSbz+aHD596/EohdbqE1TIz6WObVigJ7iXztDg2kM9wXI4gQKGKitSiyw== 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 identifier do_probe is unused since "staging: wfx: remove workaround to send probe requests" Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index ec11a63a2ff9..c87d64fbb88f 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -365,7 +365,6 @@ 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_probe, do_drop, do_wep, do_tx, 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: 11333925 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 86D49109A 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 5B0CD2077B 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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:32 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: 11333963 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC08217EA for ; Wed, 15 Jan 2020 12:16:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0E3922522 for ; Wed, 15 Jan 2020 12:16: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="UNPs+pWL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730951AbgAOMQP (ORCPT ); Wed, 15 Jan 2020 07:16:15 -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 S1730891AbgAOMQO (ORCPT ); Wed, 15 Jan 2020 07:16:14 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iLponxSJEF6br/h/swea5p/IrRFOY/YHO2SHQ6/7RT6tdHsmX7seasBXpZF7GoTI/AkqNoBOkAXXjICgt594ioT5HR87h7LwnpMfA+4OBzBgR9j34/4In1i5Lp8e+chKUr6IEAcpN37EwJj/TlhtHPR3MjkhXu7VQBZDXnA/dmJaXazDwfxKwdVg5HoHNiWAWxal2l0gEuj3QqUL0PYAk8joVerxuBjlS6T7mYKevLRamJgV+Y1Ig2PCBk7If41aJeQeRX7XZcFO9EO9JPaR1nFZVdnXDio9yw1Ze5PdykPMdOdIv0ipVmuJrQtlQRfpkadRfr4i46Es1eTzZHfwPg== 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=BRdkCaupn/fgxCt3IoUfgFaos2qDQtkFasABJ9hW8nY=; b=knuzKRsx6nNJhin67XXHeIwlLKgAFsccVGf/M+z0Q1bQmsE2gl3q3atDokNMa+v8ogM9HygcIOmdOET/wKnQV8UVBz2VGxKCGKPpbJQ6c4mOsDyWjYu+ACBga1fUsBT/ZWk5oPvrKrDQPnuTkGwyiKWoL7hAlIU4jegNNK4NVRFakqzqS5PUhMiJ4PzV+Hdjb+BKiUUzAXASvZPjFIPWK3STWgZ4ikRykmEEEHVcgzhfdKlnl0hjmiOKcBX0uvAC46VMorf23gG/It7bz0Vsrzsh0QZtG6KV8pSGotw8vgG0dycwLyo+KGaCLzdQ0GF96Y/82TUaJxDgL8+f7JUHWA== 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=BRdkCaupn/fgxCt3IoUfgFaos2qDQtkFasABJ9hW8nY=; b=UNPs+pWL9vTakTDtIrIwEO6237OvRp+zUb83lO56RV9IKlP3MUBH0tjYvzdNvtM48IBB0dCffa6eRQlRMnJsG6mmFSUJD1UXufxD1exKdkcz9hhK90UQEg9x0fB69MInDgnpVgAEBKjT/UfgObjGLwkQda83xL1JdiKOgNsQoZo= 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:31 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 62/65] staging: wfx: simplify hif_handle_tx_data() Thread-Topic: [PATCH 62/65] staging: wfx: simplify hif_handle_tx_data() Thread-Index: AQHVy500ydyKh/6ySEmSAtr/gZ90xg== Date: Wed, 15 Jan 2020 12:13:32 +0000 Message-ID: <20200115121041.10863-63-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: 39480ecd-140c-4fc6-70a7-08d799b4566e 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: Pn1YoRD5L/3Ot1vGA4Dn2Zwp1h5jnthg1iP42Hw6f2a/EFz/81AwkdcBfkSwuw10Elj7QVNjy5aLQL6MrDAfZs8b8ZVOrKJLYdpDIv7pIglB9A5jr4x36es5fWAzxxCJ6yQHjWBv4jkK6id0jLOZqmCGRnH0KGWvGy8wDNzNexUXvVkKoDQgwTYWro3T1i6LKDMh1jQQvUiDuzCQg8K9e0zUVZPuZy2E/f2xYD76cGcQw/fWV3dlWsVEoI3mQXjYFvzOQ20dnnUGnUgZ2j4GayMJgLOPxRQQizfjIbGrmuTfY4ZlPXmqjgRebIKC6Ghkrw0Hs8hYGuKxw+qWX391L3txtKipxC0/GyUAEEv5HsbwumOAKu1OjJDVPPnBEFKsurDaZsR0T75CozmlvusAKx0MsXsWQ33gCdJmLWM/LYDKWIrYMR92uaH8fLQIh958 Content-ID: <271E883533FEAC44A75DD4C9AE41E05C@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39480ecd-140c-4fc6-70a7-08d799b4566e X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:32.1794 (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: 6C3JbunodojFvMqmYFUVBvrd8+JagsSNDKyrOeR/4ftJEt9H8IqNQhzQO3vD149L8QRpI2YaGrGDHcN6PKxKrA== 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 Since enum action has now only two cases, it can be dropped. Then hif_handle_tx_data() can be simplified. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 40 ++++++++++++++----------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index e0c609c35a7b..024497eb19ac 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -359,16 +359,13 @@ bool wfx_tx_queues_is_empty(struct wfx_dev *wdev) static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, struct wfx_queue *queue) { - bool handled = false; - struct wfx_tx_priv *tx_priv = wfx_skb_tx_priv(skb); struct hif_req_tx *req = wfx_skb_txreq(skb); - struct ieee80211_hdr *frame = (struct ieee80211_hdr *) (req->frame + req->data_flags.fc_offset); - - enum { - do_wep, - do_tx, - } action = do_tx; + struct ieee80211_key_conf *hw_key = wfx_skb_tx_priv(skb)->hw_key; + struct ieee80211_hdr *frame = + (struct ieee80211_hdr *)(req->frame + req->data_flags.fc_offset); + // FIXME: mac80211 is smart enough to handle BSS loss. Driver should not + // try to do anything about that. if (ieee80211_is_nullfunc(frame->frame_control)) { mutex_lock(&wvif->bss_loss_lock); if (wvif->bss_loss_state) { @@ -376,31 +373,24 @@ static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, 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_wep: + // FIXME: identify the exact scenario matched by this condition. Does it + // happen yet? + if (ieee80211_has_protected(frame->frame_control) && + hw_key && hw_key->keyidx != wvif->wep_default_key_id && + (hw_key->cipher == WLAN_CIPHER_SUITE_WEP40 || + hw_key->cipher == WLAN_CIPHER_SUITE_WEP104)) { wfx_tx_lock(wvif->wdev); WARN_ON(wvif->wep_pending_skb); - wvif->wep_default_key_id = tx_priv->hw_key->keyidx; + wvif->wep_default_key_id = hw_key->keyidx; wvif->wep_pending_skb = skb; if (!schedule_work(&wvif->wep_key_work)) wfx_tx_unlock(wvif->wdev); - handled = true; - break; - case do_tx: - break; - default: - /* Do nothing */ - break; + return true; + } else { + return false; } - return handled; } static int wfx_get_prio_queue(struct wfx_vif *wvif, 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: 11333933 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 55004109A 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 298FE24671 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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: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: 11333931 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA799138D for ; Wed, 15 Jan 2020 12:14:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F45F2467E for ; Wed, 15 Jan 2020 12:14:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ekIaZ0jn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732483AbgAOMOi (ORCPT ); Wed, 15 Jan 2020 07:14:38 -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 S1730768AbgAOMOe (ORCPT ); Wed, 15 Jan 2020 07:14:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W8kqNxPIcq8FIgQMhXfRZTbmbl+b57UYRLkQ3nhHNr5jP19eekiuogZt1EoEMFwxvvc3G6oI8dk2LVEkWgv9YZJ8KCR9M/2SPoEei6k06SCvvbonxSIyXEHWJTUosfV0dhqXb/oVCIzaTtacjzr36pslZIFR5q4HJ88g+SvsTb2BTg1at6FAfaDU1rmZ0ldgdLusuUYyzJA/nvt02riplEGL0iRv1Y79xQqxhb4I71ltGOY/iVm3rv1+mGiyKyoUfKngWjdJx0a/TZruXv5JBOrDZQYPVcyFk5SIMLGjJkxAGMKssDNXzgDAtLbqRLv8rhpiYtQFlYBPXaMhrD+QwQ== 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=p3u2E2RuWsPeDBspbS1BYQcNKcjt+UuC5v4vUdV+0qA=; b=R5xWqPPiiuq5J4xSRQqyg1281YzaewpXdOlimKhZVD8zXwuZ7bNOj3x5r2RWnWS/s8WC2vGoZtymnhi/KXNZUzxuY7bmvHCuG25AXwP0O7yrWS796gxfVlO+hvt8DhmXOojhyoEl1Z7JYo+A+1kfZEXY3N6MgRy3AGXasAfLG6SeYwMfHCCpe33stCarA9ICW73j6A4g/IzETM4cdXkUY11LSwC0A0WQyzaLclhXZUyRvmkW5/vZpVNSYAXvGV8kJ8VRWad3GU5bY75WFDbVPRRJdbMU4vQMFb1HEMjR8vYit/SeIDfHfYwbflXZ62771JXJ9vpqgwPEi3UIrDXzWg== 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=p3u2E2RuWsPeDBspbS1BYQcNKcjt+UuC5v4vUdV+0qA=; b=ekIaZ0jn/Wx920JY77/vQ24RBFqswYeoQGs5xPVMf6mxuQjpZKFakV7QNKzfHN4wc219qyW4ei8ctoisAaYM1TMd+ezbfMj1bNPzEdE07qj0ofF0YhTfcOihMwGUrKP8OKoUX04GOVRBEmqsaw8xD9o8GjY7yMYRR+iRijQIhNM= 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: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?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 64/65] staging: wfx: simplify hif_multi_tx_confirm() Thread-Topic: [PATCH 64/65] staging: wfx: simplify hif_multi_tx_confirm() Thread-Index: AQHVy501HoKuGDgN9ECTgXQynTSwOA== Date: Wed, 15 Jan 2020 12:13:34 +0000 Message-ID: <20200115121041.10863-65-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: ea5a3e45-74cf-46cb-9f22-08d799b45817 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; 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: K0W22SMnn9wpOAfLMOBkFjS/42B6Yao1R3MDOzqbU9dOrgMKAkJR3JxPbarY7HBviKj53qhTWIGXnQQaF99xBUD676O48eD69YMy36cl2pEOqD9dURab4SuHX84e2vzLFi/h4jMt8rZKlzTY/HYdUxkqoT7LZJcicz5VhWNdIbQbHu/zHihrnV30Y2I47IosZ9Hd3pOa+nrv9Wi02X5FZBAJOwg95wpBxRwMd2jSobaJa1vc9Mrs8bpnRd/so+4d4k43Fk4OzBw9BepviYOeoCU5Bd0O6VwR21BrYnrPjmH7MoQdF7zxzuJx/va7+5ojhvoySy0JhSLg/APIQgwZvcj9v8cbHu21AYSELOAqTtkGuRRVoLAjCc8CM4E5EAghpvLMDCSbqS5A7WGJ1WLgICMj/bZkKfmwTTjNNW0ZsgqqJBbvyHfXfysu3WN0G0WI Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea5a3e45-74cf-46cb-9f22-08d799b45817 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:34.9299 (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: ePdqJJWqWZL1kW1cz+v/TH+xYMPJmmBBTTVpm7X66kSDmaSaWpXn2CgmUX4lTV4F0dliNnFo1XRF3hVKWQJ35w== 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 Usage of the "buf_loc" variable does not simplify the function. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index f798cd6973b6..33c22c5d629d 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -77,21 +77,16 @@ static int hif_multi_tx_confirm(struct wfx_dev *wdev, const struct hif_msg *hif, const void *buf) { const struct hif_cnf_multi_transmit *body = buf; - const struct hif_cnf_tx *buf_loc = - (const struct hif_cnf_tx *)&body->tx_conf_payload; struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); - int count = body->num_tx_confs; int i; - WARN(count <= 0, "corrupted message"); + WARN(body->num_tx_confs <= 0, "corrupted message"); WARN_ON(!wvif); if (!wvif) return -EFAULT; - for (i = 0; i < count; ++i) { - wfx_tx_confirm_cb(wvif, buf_loc); - buf_loc++; - } + for (i = 0; i < body->num_tx_confs; i++) + wfx_tx_confirm_cb(wvif, &body->tx_conf_payload[i]); return 0; } 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: 11333929 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8D683138D 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 61DDB2077B 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?SsOpcsO0bWUgUG91aWxsZXI=?= 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