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;