From patchwork Wed Apr 15 16:11:44 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: 216005 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.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 44787C2BA19 for ; Wed, 15 Apr 2020 16:13:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D67C206F9 for ; Wed, 15 Apr 2020 16:13: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="frVDpIDi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1415275AbgDOQNG (ORCPT ); Wed, 15 Apr 2020 12:13:06 -0400 Received: from mail-bn8nam12on2054.outbound.protection.outlook.com ([40.107.237.54]:6138 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1415244AbgDOQNA (ORCPT ); Wed, 15 Apr 2020 12:13:00 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gRhExUrctMZxxmugiV57+YkvEAV8rFGVWXsb7NcmOjOwdIzDBo0R5E8E/F2wCQcqWwjrQav1+2LjEErRMWC9q+A5hWOYkN1blLd3HeJmDF1312xODFoYQv4pYPTz1M+5HUpUnT4eqVdruR6v6K0YBb71aziWRjRxmmb8bm0xgPVmvFoB//D9KwxwQNWHLY2oeHDBpmAKRUzO1Zwwnj//FnXYYxTANiRaW61D6Dx43C8+Zhv/zozOAyB2PwaF6+SCtFGh9boYcppUakoo8veHxIpfJed+hrYKpETa9e7jiC2agLcdAlR2ilcyBa8ZEgFwWeXWvqv136xCYKZI1jxg8w== 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=PsLs1OxEeKp373acEswvEzW2lwt+yt9ZoQQ9xvugGxc=; b=CErpnoB3ydnf5AwfRodH6hQ9idkEY9vP9eN6RjrpLGOdSGH8Oe0H68jA+mf1ourRDcHBaLj8n/ljrl8dwNsmlLi1md2hky8yvXJFhKaQfT0hRdYHl5IlSZd182KyDLvhuQjvDhF1iZHhDp9IzuMzUXjCvM+9E2Yz+ZyFvIdMIv9687Tv6uK9z2mutVVQRe/eDQTOofSAFMysZ9Dob6APLiZS4A+rYJGKI0qXTLvZi75RCtz/FajPYDrTJvXlr+zT6rMEIrgbf933PRDBtK7UbZe5iWHQ9nUHh2c0uH4RMe2aE5vwhJv8GHNdLM9xT+K/F4dbBM77BT3nsD/vBKZyzQ== 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=PsLs1OxEeKp373acEswvEzW2lwt+yt9ZoQQ9xvugGxc=; b=frVDpIDi/GshSU3iwaa3n/84W7bQyYS4otzWPuPP3PrU0kNNwdyJKUGczHMSPmFx6Kf+zjxLAQV3lO+qQCMVAq51TMab3y0XC7Qgg6aR8sYNTMwtaSMBheAgHJE0nOlsPZNoDxvzTsiPxBH1T+8boeqzPcIMEZFQ3ilxXxL55dg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1327.namprd11.prod.outlook.com (2603:10b6:300:2a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15; Wed, 15 Apr 2020 16:12:56 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::81d5:b62b:3770:ffbe]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::81d5:b62b:3770:ffbe%10]) with mapi id 15.20.2921.024; Wed, 15 Apr 2020 16:12:56 +0000 From: Jerome Pouiller 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/20] staging: wfx: split out wfx_filter_beacon() Date: Wed, 15 Apr 2020 18:11:44 +0200 Message-Id: <20200415161147.69738-18-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200415161147.69738-1-Jerome.Pouiller@silabs.com> References: <20200415161147.69738-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR1PR01CA0027.eurprd01.prod.exchangelabs.com (2603:10a6:102::40) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (2a01:e35:2435:66a0:544b:f17b:7ae8:fb7) by PR1PR01CA0027.eurprd01.prod.exchangelabs.com (2603:10a6:102::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.25 via Frontend Transport; Wed, 15 Apr 2020 16:12:53 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:544b:f17b:7ae8:fb7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ea04f042-a629-4c60-e80a-08d7e157db9d X-MS-TrafficTypeDiagnostic: MWHPR11MB1327: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 0374433C81 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(39850400004)(136003)(346002)(366004)(376002)(396003)(4326008)(81156014)(107886003)(52116002)(54906003)(8676002)(478600001)(8936002)(6506007)(5660300002)(6512007)(36756003)(8886007)(86362001)(316002)(6486002)(1076003)(2616005)(186003)(2906002)(66574012)(6666004)(66556008)(16526019)(66946007)(66476007); DIR:OUT; SFP:1101; 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: O2Lp7+U/OT/rMJQBeD0/iBf8c2b/yhzRtiCQNs+i48TsH3kW3V4lGONUcI8DosZPexZKXibdizDt6QyxBvMQBQZlxP3B/LZlhSY1BgDUSibI1ExNxo1dS+E5CCkfBBS1OW/i+MsgrH4UbE37CYm/ESlfN0w0tQSqaM4YYcDLpP9GONWUvoF2UEfSj6RKWsesVQsrZsbr0yd+OZfR8MpW6FGpLy3GAZ+jw94UuJHlIVavP4dsn4PxM/1UcrpdM5kTozJRXtvJ1jLtBxKINWlOgXxelbwsjnY1kZZzhcJTaCr17Ix0KkvbJ0PxK9teYFreYNdoCtaR5pompl+Vg1D0B4Eo0xtePjL4HBpIzaYZZdHRaxhKCRh36XG+YmOZccWV5yLW8EXovjpY+OYjTBZYyAb0jDq70jnb/XX+HDHLwUnP9gbRNzFCjH6PiMRSNjcY X-MS-Exchange-AntiSpam-MessageData: 05Osgtzraxa5JC0PyCJDDxDkke/AGxh74JWqKTJRwrdYsv3urwAdvrYes4v8gcVU3Ee7T2MwucWTmg/nmOZGLA5mYV8vqzTdf1/2xGe8RIYq4mwpXNfJiclDXt5bDxT/nZ8Mn4ihRVDEAQSR6md0J/u+4KJGHVI7dVvWPXPpA9kEGbYBUp8p8b7oU504quxt3T6QwBEYOAxwuncruHlidg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea04f042-a629-4c60-e80a-08d7e157db9d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2020 16:12:56.2256 (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: isU5zsJC5pe/1+Sc0h0ujkpKofWmY/dSbC0oxiA5pvJOOQl9z0YXYmmzKej6I/xELhKERMCrn3SYON0xN7MH2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1327 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Currently, wfx_update_filtering() is sometime called only to apply the value of wvif->filter_beacon to the hardware. It is nicer to have a specific function for beacon filtering. In add, an attentive reader would note that wfx_update_filtering() is always called after change of wvif->filter_beacon. Thus, it not necessary to store filter_beacon in the struct wfx_vif. We can just pass it as parameter. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 23 +++++++++++++---------- drivers/staging/wfx/wfx.h | 1 - 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index a9261ef4b4c5..1ccd40a3322f 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -113,9 +113,8 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad) mutex_unlock(&wvif->bss_loss_lock); } -void wfx_update_filtering(struct wfx_vif *wvif) +static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon) { - int i; const struct hif_ie_table_entry filter_ies[] = { { .ie_id = WLAN_EID_VENDOR_SPECIFIC, @@ -136,13 +135,18 @@ void wfx_update_filtering(struct wfx_vif *wvif) } }; - if (!wvif->filter_beacon) { + if (!filter_beacon) { hif_set_beacon_filter_table(wvif, 0, NULL); hif_beacon_filter_control(wvif, 0, 1); } else { hif_set_beacon_filter_table(wvif, 3, filter_ies); hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE, 0); } +} + +void wfx_update_filtering(struct wfx_vif *wvif) +{ + int i; // Temporary workaround for filters hif_set_data_filtering(wvif, false, true); @@ -194,7 +198,7 @@ void wfx_configure_filter(struct ieee80211_hw *hw, { struct wfx_vif *wvif = NULL; struct wfx_dev *wdev = hw->priv; - bool filter_bssid, filter_prbreq; + bool filter_bssid, filter_prbreq, filter_beacon; // Notes: // - Probe responses (FIF_BCN_PRBRESP_PROMISC) are never filtered @@ -213,9 +217,10 @@ void wfx_configure_filter(struct ieee80211_hw *hw, // Note: FIF_BCN_PRBRESP_PROMISC covers probe response and // beacons from other BSS if (*total_flags & FIF_BCN_PRBRESP_PROMISC) - wvif->filter_beacon = false; + filter_beacon = false; else - wvif->filter_beacon = true; + filter_beacon = true; + wfx_filter_beacon(wvif, filter_beacon); if (*total_flags & FIF_ALLMULTI) { wvif->filter_mcast = false; @@ -501,8 +506,7 @@ static void wfx_do_join(struct wfx_vif *wvif) * Disable filtering temporary to make sure the stack * receives at least one */ - wvif->filter_beacon = false; - wfx_update_filtering(wvif); + wfx_filter_beacon(wvif, false); } wfx_tx_unlock(wvif->wdev); } @@ -703,8 +707,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, info->dtim_period); // We temporary forwarded beacon for join process. It is now no // more necessary. - wvif->filter_beacon = true; - wfx_update_filtering(wvif); + wfx_filter_beacon(wvif, true); } /* assoc/disassoc, or maybe AID changed */ diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 310d95478824..c30e6984aec1 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -90,7 +90,6 @@ struct wfx_vif { int filter_mcast_count; u8 filter_mcast_addr[8][ETH_ALEN]; bool filter_mcast; - bool filter_beacon; unsigned long uapsd_mask; struct hif_req_set_bss_params bss_params;