From patchwork Tue Jun 20 19:55:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 9800141 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 5DA83600F5 for ; Tue, 20 Jun 2017 19:56:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5448B28161 for ; Tue, 20 Jun 2017 19:56:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4876E28420; Tue, 20 Jun 2017 19:56:10 +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 7DC9528161 for ; Tue, 20 Jun 2017 19:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752132AbdFTT4I (ORCPT ); Tue, 20 Jun 2017 15:56:08 -0400 Received: from mail-dm3nam03on0071.outbound.protection.outlook.com ([104.47.41.71]:30144 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752117AbdFTT4G (ORCPT ); Tue, 20 Jun 2017 15:56:06 -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=l4qTbdqGcX3Q4C2Ue3p60AH3vwrqVKSgFOqbgD9mRAs=; b=JkY9GkfvsVb+HoYF1uqJ3L5cnk6HsutAgutW7iGc/pKHlbcOPGegMN/6iabRQwkV+68euSc2X8/Q81f1ouFCIzbYzQZ2Dmwax/HgrqE8z77frze+wIlLudEzqt4SH/2Nv0HZKwbVZQbR8o3jGCHaQacieks9WBvUPuxJtls/D28= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=quantenna.com; Received: from bars.quantenna.com (195.182.157.76) by CY1PR05MB1931.namprd05.prod.outlook.com (10.162.216.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.6; Tue, 20 Jun 2017 19:56:01 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Sergey Matyukevich Subject: [PATCH 5/8] qtnfmac: enable reporting the current operating channel Date: Tue, 20 Jun 2017 22:55:14 +0300 Message-Id: <20170620195517.18373-6-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170620195517.18373-1-sergey.matyukevich.os@quantenna.com> References: <20170620195517.18373-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.76] X-ClientProxiedBy: HK2PR0401CA0005.apcprd04.prod.outlook.com (10.170.145.15) To CY1PR05MB1931.namprd05.prod.outlook.com (10.162.216.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 110522dd-6199-4326-1d31-08d4b816624b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR05MB1931; X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1931; 3:2Yg/37gtj3DMRWXjZN1WTz5jRmkPyBgKdTQkNgscxt0xHejgE/yKvXn5fLwRzVMmq0rbb97AFJmQBvZJt/pXPwQSy7V/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+Ep9WfB+zMAxuYo6NB+S+3RiIOppildWwoy4QVufS3pndhrfFGxOJOdBkX65XoMjIsalQeBdphHADZtvLK0VGnOJ+W3K2O9XdU+IfYBzmXjD9/D4Hi5Q6f4YFmtIK8zzUrHDKVyybmGUNJOQ0DxHfb/RaKLBQUiPvwlpDZgSuEsfc76g7v8T8J6DA8gZ3C2CimjGJaLUzFoozgjljXcNT+++5NhAuHWzOgySWgZy+OAhZLoEEWuGRLjHJdmrzI2F6m55Mw2NTl8kNAYRV2z3aVTLv7JXODkzlo6K48htqttTB2bdrhPj6GfuIjMfEPUT9nzZ0VocQYb63vjwzngJO1LEEMhSlrwsa1E09ieaLvQLlHtX9sJWmydAly2nhl2xgX7hfhtI6+iRFxI84D0lmzFQY07juqUuc X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(21532816269658)(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR05MB1931; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR05MB1931; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR05MB1931; 4:+6qpRih4BXIRz8qAk8nBM4/NAiuTaiQYWwVXyGWd/W?= =?us-ascii?Q?YROEdwmlIYazNRESOnUbBybMPst4vjB/q23uspL11KUC80mKYyEDQvD/Czbh?= =?us-ascii?Q?JDiGDAGXO9xQnKVH7m+9jgxvtL1lg2TalfzN2y9/VEp+U7jncRE6p8Deyva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emH/6Jlin3yWTgIUILj9ejq?= =?us-ascii?Q?Mwe9wh3N34CjBthPXgJV5XVt72Zj96jpsxbRQVAvl6mu62rd/B1HUOIlxFOq?= =?us-ascii?Q?XkrJrjMPiJnPopg0wlrga+v3VFopAMkkGgEYNDeOMKQTMCaykqk5syBB9PrJ?= =?us-ascii?Q?AriN1zDV9GdRFTXFj9oVx30D8PK5t1g/j6SfwS1/r9C5TwVVZsPFnC/g=3D?= =?us-ascii?Q?=3D?= X-Forefront-PRVS: 03449D5DD1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39400400002)(39410400002)(39450400003)(39830400002)(6916009)(2950100002)(110136004)(107886003)(38730400002)(2361001)(53416004)(54906002)(53936002)(36756003)(2351001)(66066001)(47776003)(50986999)(189998001)(76176999)(42186005)(6666003)(8676002)(6486002)(103116003)(305945005)(7736002)(4326008)(5660300001)(1076002)(50226002)(86362001)(575784001)(5003940100001)(48376002)(33646002)(478600001)(25786009)(50466002)(2906002)(3846002)(6116002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR05MB1931; H:bars.quantenna.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR05MB1931; 23:6B/egUXt1yW6fFowZ6ZXLCHLbIFFD11Wi540VlWsf?= =?us-ascii?Q?Wk65Rkoh/QQ7zsWLzEk+3DsCnMf1ZcN1ZmZ/PXEMszFdcgGgSjKvGdjS2mon?= =?us-ascii?Q?WbnoesjoW6avJjpTA2XroTym61LmL0MWUvt5Nh+h0swZz3ljVzemVRcAr+9Y?= =?us-ascii?Q?xcByz/gRCc7vnlICKv+5vcw57REre3aCdWjxX53opTcjw2MwZZDiW4GK4opV?= =?us-ascii?Q?R4mcFnEotTzOPdyYUyQ6dDee8oI28l8Vqos8hkC+XbgB2XXHklUAW35QUsGP?= =?us-ascii?Q?zHlkoJ1MSQRUW7sqvuTe7JYglcyb9PudCRplsakZWwuwMdMkqaBtxWCJlXnV?= =?us-ascii?Q?XC9rWQMKFW2UEA/CAHFiH5Jf4aqJLf7FBccD1q/GjaPB+/D+qzgtcX/PL74U?= =?us-ascii?Q?FYflLThkFxtfxdmplq1CBLnE4/kj58PUhB6tFGFl4aWWAVABLyxmS/uu88J7?= =?us-ascii?Q?PrlfTMDalZc9vEZYjcJ3gRqYCfp1BYut/Qdk5yUIRprPW2xtDchcm0x/O3Ih?= =?us-ascii?Q?hShreRcftYcMsoXI2/upnLuI4W+uX4fvDOnkt6mfM87aWMUOHVKsPckEh6sH?= =?us-ascii?Q?N7hMglpDORlQbK5nrvrBCHXYJoDOanDAS0kOzQKA+F3DVZXB4HqCwTwQQsQc?= =?us-ascii?Q?x54pXK2CuTQn4L2q6vo+PBGH6sDNmoIh4DQc347UOxL/FShTNR/7g9Acf0ku?= =?us-ascii?Q?B9Ed/BeJSap+wQq117ORdeLOeAmYIZfmlVmbsadU/4no25KWalSsHszXcM+S?= =?us-ascii?Q?VwIEOeDl7RfD6lPnBvsJQkMRDxc0D/MB2L413bth25nO0ezruy4SZ+TPbAtx?= =?us-ascii?Q?O2u0a7fmSKKTjrp8lr1Gqa2MluWx7AWbxmmFFkka3dIWdCLkIBBtZCgk6p2P?= =?us-ascii?Q?q1Rr83xp0uVsnbL2hMovBnyHDWY+L4g5R4vIWi1q6GpP56VbJVdfN77tJJf8?= =?us-ascii?Q?Mw+7bhkGq7YNHxiFC8+y+EjbmBc17CYU3n7/ls4ipFvYwjAcWl11le4WJNYY?= =?us-ascii?Q?BbQKs9xgPatIBHKmvP7ZZnZgWr66CxlwcTXuTPQ23227nxPk24njsDrV/Dzb?= =?us-ascii?Q?G2m5EyqiFMHq14vzi1TyUwbTeW6SvUN91XGjGYg9td8SwtqYUhTbM4lyHEbC?= =?us-ascii?Q?XI3gF2UtE8=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR05MB1931; 6:gULSHI3XlV5/duxeMAFYn+BACcM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mgbCVPhFNGOhLTfBeDOihTshHZDrQ+mFgZ6XJmSLm4x?= =?us-ascii?Q?jycn+FYchVu1c0jiC34GYSJw7oaL8Sxo7Cp9mhuRWda3zJOwKIVXDoWFxcG7?= =?us-ascii?Q?U=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1931; 5:wf4qprzzV3WE5ApCHaoNGNa1KYK94q0HHkuAcc87Q6ZpnznrmkcU+Co/KDt2JCiLnRLiLr9V9xtiJMqEzJkDxn/kNuDcrCaG4kHLh42K4ykZUUAXvisBy1B9TCDNKH0WXSJAN+dzuFrz2l5uFQctG9XH9YWPy4tKnecP3nLwhiIquw7dKJuv2E5EJqgdYdks0RbdAbEiyvHuKYOcPbScccshpnEV1a3LjSTpgFwUnNV+8TMF4gQF/bHJamRKSXtrRNtb9OLltt+0zeSwqbjb8ZAHDGinsFO0ALCqC9Wd7pFonNdeh2rOJa/l6PWPu/mGevtPhrtUza0cqrSj/lGp3xaHo/rwUsX8a4i9aZGxnrpNQFQY1znOoTxsVz8P8IzqdeqPF8faEr33gHm8wgC7ZEpX8yB6AOafY0Aahd8i604CYw/EoAYbpFv60vTWBuzXgjMmofRx0rsorkXeg6z4YQUzFBbNusWYcV2Jyu5k2tncMAidJwU8yfJzq51vpFvU; 24:B0w8KA07yfHk5XO1kLgtvZ7QFgT8ItLEwQ6xzm9e38zkfsvan0+YMiVzLyDVxXyBrRScn97cI0yX02t7IExDoTpQQgAXeUADIINjm4GxDBE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1931; 7:aNx0XumprEOSPZhoR2J+mgldGTdwcjoutdmpCjGfs2smGTXEXLHp5hnzzIrw0CrG06fMDxnt+pCke5arxUjoySpk57Iz7LHPKC99u/BioQ5/lGieV80RdGzcOpKVr3yYnq4F3IcxFRs80ryYZG8IBP9gX+JR7d3fVceztcHvPKrvzqKOmwua2fSQ3iTMUsM6QH47GZ/r9W1FlxthT2Ez1pwOfnhWVZC3jvCUlAjoP5onFgDljTlV41rG7CQ4CswQe0N4ylvGHHthuhUvnIZr9Xv7FuEhPfLBo4B7iQYDBhCSuvAnAsYpaHacXobfcquOQKfO7c7GqtJzLrE3ao9tgjnXV/EPsEEyKLGw8HOtTHhx/9eaTvTj9+W7CP4C7xyjAuSAt5+fus4zP34LPdlX3DLGgrBaqJiqiyxVndR/qjCwEXbQqCig19rZrIFL/90D/LCIRlrL36BHZRX+o4+EcPuDgHbGn7GLFyykO3pfCAdVBRzWex834QMKyrpOErYvcRryIFxIUOtI+4oWFlEobm6d3Ji0AC0LEi5U4/WS4VSfBhno8Omtb/uVRZ3UOwNu9ndrxMdUq4a/U/YIJIb3coqLInBr6vxw2yf402GOzfqVSHgofpOfC1p35zZa7psLtiQZj83J89LglEIPjgnr9X6U+EojYdh4QBz7KfiBlHXIB7cIGoh34MOk12vCiKXWRMbQaG96W5v9msy2WRBVHEE6M6KU2v3LOmU/E9BJBSnqMMuCz6vLrLRqzEFIjX1R3Pv3dSrI+3Uv2BxyGvl7ZhUyZTlzuoLIpHfWw+CFITQ= X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2017 19:56:01.7088 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR05MB1931 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 This patch implements all the necessary features needed to keep operating channel information in sync between firmware and driver: - implement cfg80211 qtnf_get_channel handler - implement QLINK_EVENT_FREQ_CHANGE event handling using this event firmware notifies host when operating channel is changed - update qtnf_dump_survey specify current channel in use in survey report - update qtnf_connect pass to firmware channel number rather than frequency Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 66 ++++++++++++++++++++++- drivers/net/wireless/quantenna/qtnfmac/commands.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/event.c | 60 ++++++++++++++++++++- drivers/net/wireless/quantenna/qtnfmac/qlink.h | 15 +++++- 4 files changed, 136 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index eb648f02aa40..77afc0fc8c03 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -755,6 +755,7 @@ qtnf_connect(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_connect_params *sme) { struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); + struct cfg80211_chan_def chandef; struct qtnf_bss_config *bss_cfg; int ret; @@ -767,9 +768,20 @@ qtnf_connect(struct wiphy *wiphy, struct net_device *dev, bss_cfg = &vif->bss_cfg; memset(bss_cfg, 0, sizeof(*bss_cfg)); + if (sme->channel) { + /* FIXME: need to set proper nl80211_channel_type value */ + cfg80211_chandef_create(&chandef, sme->channel, + NL80211_CHAN_HT20); + /* fall-back to minimal safe chandef description */ + if (!cfg80211_chandef_valid(&chandef)) + cfg80211_chandef_create(&chandef, sme->channel, + NL80211_CHAN_HT20); + + memcpy(&bss_cfg->chandef, &chandef, sizeof(bss_cfg->chandef)); + } + bss_cfg->ssid_len = sme->ssid_len; memcpy(&bss_cfg->ssid, sme->ssid, bss_cfg->ssid_len); - bss_cfg->chandef.chan = sme->channel; bss_cfg->auth_type = sme->auth_type; bss_cfg->privacy = sme->privacy; bss_cfg->mfp = sme->mfp; @@ -845,10 +857,15 @@ qtnf_dump_survey(struct wiphy *wiphy, struct net_device *dev, { struct qtnf_wmac *mac = wiphy_priv(wiphy); struct ieee80211_supported_band *sband; + struct cfg80211_chan_def *bss_chandef; struct ieee80211_channel *chan; struct qtnf_chan_stats stats; + struct qtnf_vif *vif; int ret; + vif = qtnf_netdev_get_priv(dev); + bss_chandef = &vif->bss_cfg.chandef; + sband = wiphy->bands[NL80211_BAND_2GHZ]; if (sband && idx >= sband->n_channels) { idx -= sband->n_channels; @@ -867,6 +884,10 @@ qtnf_dump_survey(struct wiphy *wiphy, struct net_device *dev, survey->channel = chan; survey->filled = 0x0; + if (bss_chandef->chan) + if (chan->hw_value == bss_chandef->chan->hw_value) + survey->filled |= SURVEY_INFO_IN_USE; + ret = qtnf_cmd_get_chan_stats(mac, chan->hw_value, &stats); switch (ret) { case 0: @@ -905,6 +926,46 @@ qtnf_dump_survey(struct wiphy *wiphy, struct net_device *dev, return ret; } +static int +qtnf_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, + struct cfg80211_chan_def *chandef) +{ + struct net_device *ndev = wdev->netdev; + struct qtnf_bss_config *bss_cfg; + struct qtnf_vif *vif; + + if (!ndev) + return -ENODEV; + + vif = qtnf_netdev_get_priv(wdev->netdev); + bss_cfg = &vif->bss_cfg; + + switch (vif->wdev.iftype) { + case NL80211_IFTYPE_STATION: + if (vif->sta_state == QTNF_STA_DISCONNECTED) { + pr_warn("%s: STA disconnected\n", ndev->name); + return -ENODATA; + } + break; + case NL80211_IFTYPE_AP_VLAN: + /* AP_VLAN: get primary vif and pass through to AP */ + vif = vif->u.vlan.parent; + bss_cfg = &vif->bss_cfg; + case NL80211_IFTYPE_AP: + if (!(vif->bss_status & QTNF_STATE_AP_START)) { + pr_warn("%s: AP not started\n", ndev->name); + return -ENODATA; + } + break; + default: + pr_err("unsupported vif type (%d)\n", vif->wdev.iftype); + return -ENODATA; + } + + memcpy(chandef, &bss_cfg->chandef, sizeof(*chandef)); + return 0; +} + static struct cfg80211_ops qtn_cfg80211_ops = { .add_virtual_intf = qtnf_add_virtual_intf, .change_virtual_intf = qtnf_change_virtual_intf, @@ -926,7 +987,8 @@ static struct cfg80211_ops qtn_cfg80211_ops = { .scan = qtnf_scan, .connect = qtnf_connect, .disconnect = qtnf_disconnect, - .dump_survey = qtnf_dump_survey + .dump_survey = qtnf_dump_survey, + .get_channel = qtnf_get_channel }; static void qtnf_cfg80211_reg_notifier(struct wiphy *wiphy_in, diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 22741bf6f4ac..2e7034a560aa 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -2087,7 +2087,7 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif, ether_addr_copy(cmd->bssid, bss_cfg->bssid); if (bss_cfg->chandef.chan) - cmd->freq = cpu_to_le16(bss_cfg->chandef.chan->center_freq); + cmd->channel = cpu_to_le16(bss_cfg->chandef.chan->hw_value); cmd->bg_scan_period = cpu_to_le16(bss_cfg->bg_scan_period); diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index 9b61e9a83670..6e1e93ccc40e 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -211,8 +211,8 @@ qtnf_event_handle_bss_leave(struct qtnf_vif *vif, pr_debug("VIF%u.%u: disconnected\n", vif->mac->macid, vif->vifid); - cfg80211_disconnected(vif->netdev, leave_info->reason, NULL, 0, 0, - GFP_KERNEL); + cfg80211_disconnected(vif->netdev, le16_to_cpu(leave_info->reason), + NULL, 0, 0, GFP_KERNEL); vif->sta_state = QTNF_STA_DISCONNECTED; netif_carrier_off(vif->netdev); @@ -350,6 +350,58 @@ qtnf_event_handle_scan_complete(struct qtnf_wmac *mac, return 0; } +static int +qtnf_event_handle_freq_change(struct qtnf_wmac *mac, + const struct qlink_event_freq_change *data, + u16 len) +{ + struct wiphy *wiphy = priv_to_wiphy(mac); + struct cfg80211_chan_def chandef; + struct ieee80211_channel *chan; + struct qtnf_bss_config *bss_cfg; + struct qtnf_vif *vif; + int freq; + int i; + + if (len < sizeof(*data)) { + pr_err("payload is too short\n"); + return -EINVAL; + } + + freq = le32_to_cpu(data->freq); + chan = ieee80211_get_channel(wiphy, freq); + if (!chan) { + pr_err("channel at %d MHz not found\n", freq); + return -EINVAL; + } + + pr_info("MAC%d switch to new channel %u MHz\n", mac->macid, freq); + + /* FIXME: need to figure out proper nl80211_channel_type value */ + cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_HT20); + /* fall-back to minimal safe chandef description */ + if (!cfg80211_chandef_valid(&chandef)) + cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_HT20); + + for (i = 0; i < QTNF_MAX_INTF; i++) { + vif = &mac->iflist[i]; + if (vif->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED) + continue; + + if (vif->netdev) { + bss_cfg = &vif->bss_cfg; + memcpy(&bss_cfg->chandef, &chandef, + sizeof(bss_cfg->chandef)); + + mutex_lock(&vif->wdev.mtx); + cfg80211_ch_switch_notify(vif->netdev, &chandef); + mutex_unlock(&vif->wdev.mtx); + } + } + + return 0; +} + static int qtnf_event_parse(struct qtnf_wmac *mac, const struct sk_buff *event_skb) { @@ -400,6 +452,10 @@ static int qtnf_event_parse(struct qtnf_wmac *mac, ret = qtnf_event_handle_bss_leave(vif, (const void *)event, event_len); break; + case QLINK_EVENT_FREQ_CHANGE: + ret = qtnf_event_handle_freq_change(mac, (const void *)event, + event_len); + break; default: pr_warn("unknown event type: %x\n", event_id); break; diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 847c80f40a9a..5859ef624058 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -390,7 +390,7 @@ enum qlink_sta_connect_flags { struct qlink_cmd_connect { struct qlink_cmd chdr; __le32 flags; - __le16 freq; + __le16 channel; __le16 bg_scan_period; u8 bssid[ETH_ALEN]; u8 payload[0]; @@ -673,6 +673,7 @@ enum qlink_event_type { QLINK_EVENT_SCAN_COMPLETE = 0x0025, QLINK_EVENT_BSS_JOIN = 0x0026, QLINK_EVENT_BSS_LEAVE = 0x0027, + QLINK_EVENT_FREQ_CHANGE = 0x0028, }; /** @@ -739,7 +740,17 @@ struct qlink_event_bss_join { */ struct qlink_event_bss_leave { struct qlink_event ehdr; - u16 reason; + __le16 reason; +} __packed; + +/** + * struct qlink_event_freq_change - data for QLINK_EVENT_FREQ_CHANGE event + * + * @freq: new operating frequency in MHz + */ +struct qlink_event_freq_change { + struct qlink_event ehdr; + __le32 freq; } __packed; enum qlink_rxmgmt_flags {