From patchwork Wed Jan 15 13:54: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: 216626 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 45010C33CB3 for ; Wed, 15 Jan 2020 13:59:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 105AE222C3 for ; Wed, 15 Jan 2020 13:59: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="ihQxyinT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729615AbgAON7l (ORCPT ); Wed, 15 Jan 2020 08:59:41 -0500 Received: from mail-dm6nam11on2047.outbound.protection.outlook.com ([40.107.223.47]:4897 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729094AbgAONzZ (ORCPT ); Wed, 15 Jan 2020 08:55:25 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KCMVSh/0QubU+a+Dwu00HMpBHE/nwCBnFfBWPpMxHllPr4kHM/IorzXUdW1OAOTHh3ucC0s1Yp5lmhEXhwIJCKJR2XcS9LzYeJ2y4EcfCIZHZ3Wknxb1mgVWzqwOmNjqWoxGE4EB4P4Ljlw1pXOkBsUkf6zrt5XHdWH+O142JUEuaZ9J6eeFAyfc64m1gc49ezGyYDS9YwLNMQFbPxJVrUZ55Xp8DlJX/V/jbRQ+9MBg6AqiYWawA+0PxaUp4B4qbzlnWFdRYyEPRQxoS63dF4vUM3RrIljNZonrCPPAmi3+ujVvBGDCVc1whEp8c8dmqBSI0cVNKvql2Kf5woVveg== 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=msVx5qw+W+LVqb9yy8/e80n57ObGemuagj4XuCpN8idmzEAGe7O8RsC1OVDo7ZlVCIQaXy62+9DbTCFRAZRBBwFhNJ1YNm+XU/xCLzUbAhRgLUmTADr8+R/9Arri8Rs3IdWa+t+C3M+57HJEGBoUKs+zJpsSP2s5uU85Cz2RsZAYcahmzw9dP3YRfT4DKPL8cp6+Qnp2gQUPDAYtJ8Mkzx0lHGhl+zMqy8pu5sFBIiXjgj6Fn2iTvSqn6epewsvWZEGw+kWuuFWc3W+BTXn1P1mKYsE9lqEG3bKM0uys7xnzkOI0003tNBaY9RlSN8x+wIt92yIVQxt5IJX4eJ85RQ== 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=ihQxyinT5GCuANc4wTn5hhoPM7+ojBqeQ2DT6/BKKGcV3J+QEFyysDjnz7FgP9+hvCoeRmQUcegy1YnCr8Com8L6jp85a7XAK2n59V9XPd7CJSi9Wxno9I/odywXnf8INl8FhfmFNMpew2ehDibUBBp1DkpL0zOp491qMC2F3WI= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:55: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 13:55:20 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:57 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 38/65] staging: wfx: simplify wfx_update_filtering() Thread-Topic: [PATCH v2 38/65] staging: wfx: simplify wfx_update_filtering() Thread-Index: AQHVy6tfngHVt8U6GUCny0hqIaFlXQ== Date: Wed, 15 Jan 2020 13:54:58 +0000 Message-ID: <20200115135338.14374-39-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9bdc3c1d-fa54-4082-2e92-08d799c28213 x-ms-traffictypediagnostic: MN2PR11MB4094: 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)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(66574012)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sMhPG2Na9Bjv3m+MKKLzbzxraZmqo7HKw+RU6H9FkH8sRysShj3V9ZIWcrUS8YoWD2babPsmCsrJfBfhL6ln2UzEW9ZHmFGEwNQHZgj6fXr5egJhzAdBPInSEDfuO98iOdNY5WfbdQSsU6SlEIzsK7o536/Ol+5ow6QRJsN0OwisBFA0h3DmI2JQtQgZU0uHdU6YhdKmjBPkAOq6Zu2dJNBuPixZ/s6j7An0A82/3a2iDLFI091/cGWgd282+JKNlQQ56LhvkALuRltW2BU5+BLfvrJsdbyJ3TcHZsri8CEG+NG3CPmXdtmoId8RQkaQXQaWyh34j6Y7jMCaZVw9QbJkOc6Kx062WC5+/aC3QibsQrjgMjBcpYWVTs+0jEpgqb+R0oUmAamhxvBTxsjwMDXMsxJ9N9fONcO82QqtTteI2VJLeQW9BUWVxqi/NaI5 Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9bdc3c1d-fa54-4082-2e92-08d799c28213 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:58.2983 (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: z6B2m58fbrnGoyN+JyotBmbajF8jP4GH2cJavooqiKerxAZXsTm46YOKoLL+Jio83U7jEQg6AQn5IyVcldvJRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 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)