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: 216657 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 9353FC33CB7 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 5677F207FF 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?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= 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;