From patchwork Wed Jan 15 12:12:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0455AC33CB1 for ; Wed, 15 Jan 2020 12:16:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6169207FF for ; Wed, 15 Jan 2020 12:16:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="o1f3fcQA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731505AbgAOMQd (ORCPT ); Wed, 15 Jan 2020 07:16:33 -0500 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:6048 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731380AbgAOMNe (ORCPT ); Wed, 15 Jan 2020 07:13:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TCg8fCw95yLkxyQ0PRDgyDfFm1XyC2AbpBicsV6xE2uqyw7xe9GXYwSEybOA3D9jWdnFPzw+DvbC00U3DwShJg+eIs3mzVMUdc1Gs70jPiiwllMMm/ENRRzgDE+OxeFBA5gxh4QGftWuaRmZs/h1PVo/VRPFS0lZeJIhUi2LRn48jjcs0LNklCE0pSpxShtRoQ/yNQfsgzSLDn+k5yfPbilQ3cAljlmR8tcJXP1V7/igPKZ6Moa2ES9qxQvxx8N6m+xlKNtzzqXdEN2uN8aReP/xbgOoBVkDOkZFC33VCORgi/gu2x1g8N5Bly/3/CO0EaPc76t2nN6VKfyb4yP5dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+r+hH6i8d3N1IAb/CKSuC2M9LsNeoz8vnFD1h6dEiDg=; b=SEOBk7oU7/SpoTfFyQnW7DQMqUekPuJQVuCDYlIIebbyq8bT+JqajIGgA2B7rCKO5HIuIF8xmleYQLRhtoqoKaALMVNaGqrzMDDDJ6TVHvzYMpwsuVnz6Uf3JFfJUxxp6f8nmwR6CbTWqqiSeZP1H2H/V8t5f0+dCBOr7vlQWthwzOytkFmHIzcIrR8W3FUCPVksg5SXqU+pPI9YzecZXmjhwZQlvUZII5Ooi5d/sfrLNOjGZFGeSAUmP/TJbWay9ilmihMeWFRnFyKKwpEZJYbumrsqCjj497akcCuTnKzRkGqwBIyUScjlYOzvFS+YyTq53JmLEW0sKv21YRDt7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+r+hH6i8d3N1IAb/CKSuC2M9LsNeoz8vnFD1h6dEiDg=; b=o1f3fcQAwWkUgpGIl6rAFvGQIEwnmgWOpMP6AWH6cY6meQRNV9nJmO5yBBchfuEQ67Pxttw5tR/p2L6fQv/lfRG/KX2SDIsyASjSgn3QUmp/cZyXYYFnj0dz6PkJCmdA2i+12lyhxX6DGJsd3/pES8egwfB9gqNl8S97rfpX03Q= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4096.namprd11.prod.outlook.com (20.179.150.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:13:24 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:24 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12:58 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH 38/65] staging: wfx: simplify wfx_update_filtering() Thread-Topic: [PATCH 38/65] staging: wfx: simplify wfx_update_filtering() Thread-Index: AQHVy50gmE8hFxRoREC7HU8Jsv9+fA== Date: Wed, 15 Jan 2020 12:12:59 +0000 Message-ID: <20200115121041.10863-39-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 45dbcff9-751c-42c6-1739-08d799b4431c x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1051; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(366004)(376002)(136003)(199004)(189003)(85202003)(66946007)(66446008)(66476007)(2906002)(107886003)(66556008)(1076003)(66574012)(64756008)(5660300002)(8936002)(6486002)(186003)(26005)(8676002)(316002)(81156014)(36756003)(52116002)(2616005)(7696005)(478600001)(16526019)(956004)(54906003)(110136005)(86362001)(71200400001)(85182001)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4096; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0poF44AWJ/9kBC8BtCiJsWsars4LnQm5ig5eCFqBakDUrAiP5rrjtDSLpTEKlQfpAgBqjGYw0Qf3WJ0gK6uLPMUTAAqkqLh4iH1MWI49J5abHDLIPPcOWV3uc08dW1byvO6sh1qbykTqdbozJZg1XTb3AknH3xt2brd1SgG5zoMTd7mCy/LiqM89V1fY4COO8zo102ii2ne+bQ+0ro/bUDBuDM4l2vsqVEjKVQr0Ij5jcspKZhwHCB6nrko0VI0Mg8j/bgTcbkmfq9hxfKbGFRhxlk5YSaKuvnbezViRTdKT1Z778DN0BiSFs8zL9swijs7NF/myqWNoLlRGS+jMcdnz6vgiX5REk4Ocvjxy9eWf9Vd3+JHLt81hysFDzjfCT4ehniw3vPqfS7DC431LTqf0pcB5UBEXeo08N7x6TGGOGcwTV0MTUNcsOlG7hVkY Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45dbcff9-751c-42c6-1739-08d799b4431c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:59.7050 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: iYzGDwfqFyK48NSBFtBgIoZ9WMKovooRidRC6cSLDaa8oDBhjgcnWZgiz60271EIsuSh9WprwNwVt54V7sxFSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4096 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_update_filtering() has no reason to instantiate a struct hif_mib_bcn_filter_enable. Drop it and simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index a934f66f3a4c..0c3150a94c7c 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -138,10 +138,9 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, void wfx_update_filtering(struct wfx_vif *wvif) { int ret; - bool is_sta = wvif->vif && NL80211_IFTYPE_STATION == wvif->vif->type; - bool filter_bssid = wvif->filter_bssid; - bool fwd_probe_req = wvif->fwd_probe_req; - struct hif_mib_bcn_filter_enable bf_ctrl; + int bf_enable; + int bf_count; + int n_filter_ies; struct hif_ie_table_entry filter_ies[] = { { .ie_id = WLAN_EID_VENDOR_SPECIFIC, @@ -161,33 +160,29 @@ void wfx_update_filtering(struct wfx_vif *wvif) .has_appeared = 1, } }; - int n_filter_ies; if (wvif->state == WFX_STATE_PASSIVE) return; if (wvif->disable_beacon_filter) { - bf_ctrl.enable = 0; - bf_ctrl.bcn_count = 1; + bf_enable = 0; + bf_count = 1; n_filter_ies = 0; - } else if (!is_sta) { - bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE | - HIF_BEACON_FILTER_AUTO_ERP; - bf_ctrl.bcn_count = 0; + } else if (wvif->vif->type != NL80211_IFTYPE_STATION) { + bf_enable = HIF_BEACON_FILTER_ENABLE | HIF_BEACON_FILTER_AUTO_ERP; + bf_count = 0; n_filter_ies = 2; } else { - bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE; - bf_ctrl.bcn_count = 0; + bf_enable = HIF_BEACON_FILTER_ENABLE; + bf_count = 0; n_filter_ies = 3; } - ret = hif_set_rx_filter(wvif, filter_bssid, fwd_probe_req); + ret = hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->fwd_probe_req); if (!ret) - ret = hif_set_beacon_filter_table(wvif, n_filter_ies, - filter_ies); + ret = hif_set_beacon_filter_table(wvif, n_filter_ies, filter_ies); if (!ret) - ret = hif_beacon_filter_control(wvif, bf_ctrl.enable, - bf_ctrl.bcn_count); + ret = hif_beacon_filter_control(wvif, bf_enable, bf_count); if (!ret) ret = wfx_set_mcast_filter(wvif, &wvif->mcast_filter); if (ret)