From patchwork Thu Oct 5 01:38:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mitsyanko X-Patchwork-Id: 9986283 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4E78760291 for ; Thu, 5 Oct 2017 01:38:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 400CF28C06 for ; Thu, 5 Oct 2017 01:38:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34F3128C3F; Thu, 5 Oct 2017 01:38:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B182628C06 for ; Thu, 5 Oct 2017 01:38:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751331AbdJEBi2 (ORCPT ); Wed, 4 Oct 2017 21:38:28 -0400 Received: from mail-sn1nam01on0084.outbound.protection.outlook.com ([104.47.32.84]:52980 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751314AbdJEBi0 (ORCPT ); Wed, 4 Oct 2017 21:38:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=y2S+vaWKzn+vFBHazV63tL+1EVjU8/NED4ArO0OQ/xw=; b=aLiYi65BfOOkifgO7j6aorIaIDglYsmvOFwtCI7X9vtrn4DLUqHRFrAtyTIj9Peh20jNyr8mTQ0hDWVKZTpjy1a1+YwvSzJMjYIG5gSpRTHlrsYmCmzZFiFmSY7I4TRHsbq6IK5c2urPSaRS2bPZTT9mffvUeGRl3bnaq6aeGE4= Received: from dodo-dell.quantenna.com (12.131.200.68) by SN1PR0501MB2047.namprd05.prod.outlook.com (10.163.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.5; Thu, 5 Oct 2017 01:38:23 +0000 From: igor.mitsyanko.os@quantenna.com To: linux-wireless@vger.kernel.org Cc: sergey.matyukevich.os@quantenna.com, avinashp@quantenna.com, johannes@sipsolutions.net Subject: [PATCH V2 8/8] qtnfmac: do not cache current channel info in driver's state Date: Wed, 4 Oct 2017 18:38:13 -0700 Message-Id: <20171005013813.13332-9-igor.mitsyanko.os@quantenna.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com> References: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [12.131.200.68] X-ClientProxiedBy: MWHPR20CA0031.namprd20.prod.outlook.com (10.172.102.145) To SN1PR0501MB2047.namprd05.prod.outlook.com (10.163.227.20) X-MS-Office365-Filtering-Correlation-Id: c4313c87-4dc7-43c9-f1c7-08d50b91c4a5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:SN1PR0501MB2047; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 3:ZFM+WVesZ2kGbkg6NVZHTBms25MwFdTGNRssK69pLIARIg+LsbXCEcxrpMg5RaCGsxJgMWvDuCCKD6gMfMK5gOKLcVfNZiFIzQNvxsRlPUtfV9EfCwKGV2X46z2JeYtcrS/L/mQT5j69Xpubr4vybRIZvzSLDz9vI+UhbGhqFAE2TVOAnVboYT4d14zdzgwhwguB1qgVhE0RnPk24NccN+jO06nPLICI3gEcXdqpAzFYg+L8lZPYgApZNixiPwMR; 25:C8L89IPvdUhU1iYsZOlY2JFPPZp3HKpY/tjR01bz5Es5h+dOhl1CrEVRptVjUMWnrTh0dyU3QsAbVQRTjrKNT84a20Ci4j0lgEyw+HR49111E2wljdOjIQvDrQl+dSfSvwrHOsMRnoh5Vw9hPh2nR42OgJVACraJf6lUaNGfAJJ0uIUUfjpJt2Ma6RBYbB4IB/+Zuf+a8VVydfyjhaTomMQoJfkiDb1Ya3mjFEv0XDJ+Yox5A7DUuGZjqBb9RxvffoSSGS/922TGfhwRyFln4CgIP0zV9j/MnawtEx+XE1WRDprQ70m8bWCfAk/Y32XcSCgSEsW7dhwe6UIGOJSRQQ==; 31:Lbkh20aHyshZdHp9Jpsv0L3PQgM1WK+nwD8B1+TnoFgJLoOnbBzdlXWf5/RVBXPnNByoZMPI7ybmL/tHlgCxwXnVxMotRQceQJr6KydJZ6p6GWUu58+l9oqbSykSKknZXP+hlKi3Y5Kd4aJ3EdI6/yKZUHk9UwjBILwar2Lv9w/vgB6frhdtvjwbXW0updLrSiZ71opu2pDE4UoRLH0tgibZPbNffVOgS2JmV1y7lTQ= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PR0501MB2047: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=igor.mitsyanko.os@quantenna.com; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 20:uSoIbs6cVup5SFlo8APx6d0M3I+2ZnzfrBGsOgBoyUMDXmoBmTuAY984yuUUv9W8QdLn0dGlaVFWnmdf0d2aGTS9QPhFMWqOoNkqdMatDWYydc8ZtxNsvSJ50AwKtEeKPaMGNOlfxh9KL+K7JiQ0CYfMvjDhdrMRCaykB+FTLBhjaBp/Eg1C0zNpJiidFEr7D8MXT0hXcLuUc+zalHfurt2Zjyx/ZQtfnbTNgbfiOguAlaH0Zy/HR2QwZ0pPJdSf+Ta8EMe2jM86SgogUxBYzv1zMWvHvqfk3gFEMse2oLcrbTXMexkN6FIsrNui/pP10AASv49H+JtZIJ8OPfUmGQiX/my5vL1uKfJSU0hnJXXPVawkw6lr8dt3p5Ms+DBjBAnxICkZQHQvLRVObJZT8//qUuRoflSbAqWmoMnH5EhGlV+JOjVnXU0bMhTMisV9bjTSvzy5dJZZPwn6tSvo7E4Ug9oSyiv/hw2C4ueRRF/SPwwALdSPQMgGqWlj+gCelOjYIY4gcC7pDoQE5eWiSqDNKF3zClHIAWpZBSPNVwx6fGWKan1WbCF6Z6X+HA3h8cP0B/h+VgFtjM3d+6sdAuS41YLe9XwyPPSPLt3WDzw=; 4:ripHUq9+LxtUF9zFzSD6dreNrSBY9dMiw2JssGomuH+hvzuOLE6HfNMsY9IWBOS8lBB8NlzaMJB36K+RKfWi6rlKBmBDCHiDvdepm2bjoXYK+w6k5PLAAl1vCQuexn2Ckqk5oC6BFn6XdIIeRzroG7MoxTc8wTeOw1mvi8vvDPHvHvRXC2ca9Ytb+1zgEWFEBOGWTuF+psLDyMysztkE1INPTr0oe2WXztUL1So9WEPyTAqhf7vl8Cq2WVwIMbzi X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR0501MB2047; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR0501MB2047; X-Forefront-PRVS: 04519BA941 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39830400002)(189002)(199003)(25786009)(106356001)(103116003)(105586002)(2351001)(33646002)(69596002)(53416004)(2361001)(3846002)(16526018)(85782001)(53936002)(66066001)(16586007)(2906002)(316002)(1076002)(47776003)(6116002)(478600001)(7736002)(8676002)(68736007)(575784001)(86362001)(6666003)(97736004)(101416001)(6486002)(81166006)(76176999)(48376002)(189998001)(2950100002)(50986999)(8936002)(5660300001)(4326008)(36756003)(6916009)(50226002)(50466002)(5003940100001)(305945005)(81156014)(9686003)(85772001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0501MB2047; H:dodo-dell.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0501MB2047; 23:z33eIqmyfV8agqaQ1aNbx1gJilxSnmunh+uvldo?= =?us-ascii?Q?KLOVmztyPtp2Ce+Qt+C0oZoV0uT9+/h7DJ4ToZ0IHM9aWvItfIZpGHSxEwxL?= =?us-ascii?Q?eq3LOUZn84DzJi3NcyVqiTCHq0/xfLHOEUSXj7x0qGu+MCdcT64XyJ8OEr8Q?= =?us-ascii?Q?BTzhEmDqkNk14e40h3oXbvr77JvbKM1Cyma9VtMED3TbGxeG3/Jf1lT+pmLX?= =?us-ascii?Q?hFN0s7wn9mxF1L1pjMXcQs4aVZIIDEwN+Dib/so35z0+gsGN41g9KWdqWQfA?= =?us-ascii?Q?GcW5AkTGpMmIdCatlG8vrc0hNC/TL/vqduG/7Z7qaK18wuESNwApN/XoQXsH?= =?us-ascii?Q?ODSIXhWPvAXAbKYy2xrq7Q3inkxeghINHeRR25jROWRS9AnHBciJb5NfzYib?= =?us-ascii?Q?u/Ae9HrxZVVhWUJ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1PR0501MB2047; 6:y9oQ8a3Nb36/3fOzCPCv5SN+Y8aEl6So02p0AEQA8ZVpwssrHotb5NMqNJLxF01Gh22yrWUz8Jsvd8vpUOyumwIZg1G4vbel2mk84rtIjxXurS2TTyNsAAa+O25JLM3apLVw091aCEUXKe5bMMdQMgxIqxbGfyoC7dF20Nr8AzYU/zPiapmFV0SZNPoDG54VK+fzVJFcWEKUYsmfnZuVj1cQIcTPUolafqGemyYtzLSM5MnMMPjJSrR08d0ZR91gXtymbsnkRyg4+OUadePqFPV84VsM8Xl6qQFk3JTJ1ykL3zHRZw/gBRGsqeCr0THEakqIb7Jf5LiUUTRborAziA==; 5:juA+j4/CGoc3AizT0/md7iWfohLGcC5MsovIVkNbvoCbXrAb8zLILHVFvK1k85Zufw9ww6tGtBM7kyxMcMMwxZG9qx3XJG7HlKNkSeKDKWXgtUby7UvS8wlSlYMIlxJsyiQL1It5tGzMKvZ01y7rIg==; 24:CJe4s9iLsPqKKUGJhfZJnfIPcm0H3QvA1YZcubc+DxAAN/Gw5E0AFu5muMJrSUetw4fuQLHccfDLHG89gNoWRSw3PwE1RtT95dNnuM6viM4=; 7:Iaf2k8EQIpXGSu9R7PlX/4Fze/T+WFoe5GxBISZ2rWEsuklHgIPQXAtW0B2LIcXI/DGXaOjKQh3zOh+NTQHmPGiIrSIdSKT19EesGg9BHUEAXJ9PffliAyT8J9JtcVVgsuj81xQj7LDFzyu4ftQsynAUINQBNyJKzfazUY0ur9vP+4pF4WSbWWwCL9nBFkmYYkSM6cDHyxJBnExfPKcnOfYTvjir4jpt4JlesPlleh0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2017 01:38:23.4384 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0501MB2047 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Igor Mitsyanko Linux Wireless device structure already has current channel information that can be used when needed. Start using it. Since driver's channel info is not used anymore, remove it. Signed-off-by: Igor Mitsyanko --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 7 ++----- drivers/net/wireless/quantenna/qtnfmac/core.h | 1 - drivers/net/wireless/quantenna/qtnfmac/event.c | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index cf0f19ef..028bed1 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -630,15 +630,15 @@ qtnf_dump_survey(struct wiphy *wiphy, struct net_device *dev, int idx, struct survey_info *survey) { struct qtnf_wmac *mac = wiphy_priv(wiphy); + struct wireless_dev *wdev = dev->ieee80211_ptr; struct ieee80211_supported_band *sband; - struct cfg80211_chan_def *chandef; + const struct cfg80211_chan_def *chandef = &wdev->chandef; struct ieee80211_channel *chan; struct qtnf_chan_stats stats; struct qtnf_vif *vif; int ret; vif = qtnf_netdev_get_priv(dev); - chandef = &mac->chandef; sband = wiphy->bands[NL80211_BAND_2GHZ]; if (sband && idx >= sband->n_channels) { @@ -705,7 +705,6 @@ static int qtnf_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, struct cfg80211_chan_def *chandef) { - struct qtnf_wmac *mac = wiphy_priv(wiphy); struct net_device *ndev = wdev->netdev; struct qtnf_vif *vif; int ret; @@ -728,8 +727,6 @@ qtnf_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, ret = -ENODATA; } - memcpy(&mac->chandef, chandef, sizeof(mac->chandef)); - out: return ret; } diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index 5234a9e..44a2cbb 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -126,7 +126,6 @@ struct qtnf_wmac { struct qtnf_mac_info macinfo; struct qtnf_vif iflist[QTNF_MAX_INTF]; struct cfg80211_scan_request *scan_req; - struct cfg80211_chan_def chandef; struct mutex mac_lock; /* lock during wmac speicific ops */ struct timer_list scan_timeout; }; diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index d7fb076..f639ea3 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -372,8 +372,6 @@ qtnf_event_handle_freq_change(struct qtnf_wmac *mac, mac->macid, chandef.chan->hw_value, chandef.center_freq1, chandef.center_freq2, chandef.width); - memcpy(&mac->chandef, &chandef, sizeof(mac->chandef)); - for (i = 0; i < QTNF_MAX_INTF; i++) { vif = &mac->iflist[i]; if (vif->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED)