From patchwork Tue Jun 20 19:55:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 9800139 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 DCA71600F5 for ; Tue, 20 Jun 2017 19:56:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D317328161 for ; Tue, 20 Jun 2017 19:56:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C791528420; Tue, 20 Jun 2017 19:56:06 +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 0160228161 for ; Tue, 20 Jun 2017 19:56:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752112AbdFTT4E (ORCPT ); Tue, 20 Jun 2017 15:56:04 -0400 Received: from mail-dm3nam03on0059.outbound.protection.outlook.com ([104.47.41.59]:45824 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752116AbdFTT4C (ORCPT ); Tue, 20 Jun 2017 15:56:02 -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=fywlQ3tASMs3jR2kZdzwLzHN3KwCgLkYqNdB2s+RUhM=; b=eIBmM8bVsNkGx/0rhZ3Mocw+8KYBM1PopFfgm2+5gmuyBvI8mc6cl6a+jpncD5PKoy3OVaw92U2omU8v2teTg7GzJPCWBpQ7eZhQNkoKU19gm+o9I+E6mRU9E1uwleuGj1mbvg7ZPs7Mlle+0ghajhEBNX7Ji9K3wCo5hsBJUhs= 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:55:58 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Sergey Matyukevich Subject: [PATCH 4/8] qtnfmac: implement cfg80211 dump_survey handler Date: Tue, 20 Jun 2017 22:55:13 +0300 Message-Id: <20170620195517.18373-5-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: a82b692c-e64b-4b3c-d178-08d4b816601a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR05MB1931; X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1931; 3:NqX4PRnJBgXl8eqxjHeFSx3hkUJf/dwH8oLW7dhD1n+ZFNkqTBkzqN9pK2TPrt7NEvQtDPy2Dg3qHDWGDOb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w+4/YZ42sMQXBD/0rW2Nr0TdOGxeJhSHIlg56K0lqX5QGC4ntZYp+4TVwVNgPqkxcqz2Xdq7YA+ptHMqUShs3wtZ475gw39cp7nYsCPyswgzqncxqmLppX+CV2B+TRPQf49NfbzNHq27+MbVhEdIWqMufjeKOo8cIIuExompe4l5kUDUzDUYNbvkF1tiWs0Zeo/x4fW8QNW0kowzVS94t24zypIEoKszzUP5JFQPxl4nPYsBQ9UAEMf2Vn1Ms5hX8Yt4WDpOqj+nemnD3C/4amUVzH52RehQr86rVj/zZyO/zsX1HF9v3fs/Q2Es31I65OyGikbYI8MKdmhdIn7XnUcgP+logiD52KHxzjlE1I7eRik/7uej7oq4X+sz+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(21532816269658); 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:jMt51Zr09aPuXubYo9/aTEtFIV7UuSUAOVO/tXrJbm?= =?us-ascii?Q?2mmkrGD3vSnu6D6HWMvWSVXg86A1kB+oj5EJdfuWRS4ZVeULM68UmnQgOUXQ?= =?us-ascii?Q?ONq/Q+B7f+9C4EeJ/1fHP3Db3CyKAgdN83euwFOgq7O2TaTzJvuHkvpEZKEE?= =?us-ascii?Q?BjbMwqQXPJJ5y/f23S+Jl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Puwf?= =?us-ascii?Q?7hP9Ga2lHjB8WCMaDXuKOMIGKo3YDxpJFwJHtdI+a4p3tWddYXXQLgWxTEq7?= =?us-ascii?Q?/NT9fiElAji8m1CKjzi/u4N62Qt/sleOu06bkUVcfFGKNd9fPnpVSUUyT+Q4?= =?us-ascii?Q?4+kiEV18dCok0=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:t4VX4vFVUsQZAoSqrbuNaKJuwp181UAHjaCzU6R1C?= =?us-ascii?Q?5z9E5/FOmblE8pQAU9+DXPAFVMtynd0PVPDqQkwewAqZRErELGyvrYBMa8ux?= =?us-ascii?Q?XgJ4ytIe5bpRGTVKWLBVJ1kHKKBF5z2kaBWM7CQcmzS/gPIdO6iZYlY/cp40?= =?us-ascii?Q?0yINce5lt6rxaP7A81EPtvWPScnelHKmFnAut/mH9smxmHo4TJ6rM21tAZUh?= =?us-ascii?Q?xNa1iO6YO/udUo6NZ8FhT0PYULtQnqyQqX8VUHJo0wa5RHclyW0Jldm7FUQ4?= =?us-ascii?Q?A5DrExGnNMrm8V7L5202lVdFzMbpXq5IqCveyrJvpf7sPiQb3+nXLzAl/xzO?= =?us-ascii?Q?IhDtONTL1nRf3SbD39K9FKqQjnBTBC2XX5Zcto3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Q?O3E0ldriW6QBdv4xuatEkf3FRbp4fT9BSdkMdSt6GBuOw3cpfyfNLPcaTN8V?= =?us-ascii?Q?g=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1931; 5:o2LoScIhpaNRTKf4l/k3z8FGhLR0coKFjw+NLwkIaX5zSzDsJ6bSbaYknVOFCCil5fKYeMGvpsETGctEqMam+vJ4ufi4Wh/PTegnfBUyT9RtMQX8AJwWHQQlJdhjHGXuxqPFSzbOckdxYAKDtYJ5rh8aE2G+q3puFYBHhztS6YCEjo4v/NvuWM/lXKwHxf9N4smn3u+2UFhUhDbZ9upzUdzxvvDfibp6wMsjgZdAq47VTMPxfZdkHUJakdbVtcr5qxwplUti2SBPUHL9s3QhC0zFxKVNRnPXXHAoN4Jp948xgpV8jJIncqs4Y3KHLtMJ8frzPRt/clfbAKC8mQjTC44dJKRVpIofXDi5Sr0p29x5sbFEO5QQJ3FkNWr0ouAIQciMCH2ql/lfvirluW3c7cvPFk5e2sTvWxREt8WdEUO5HS1WMvukzu9GWt81N+/wF5ImjaHn2SB+HAkMff/6tSTqUVVL616PsYmYf2UT4ZwUMjoTtSVYrEqYHJI6omWL; 24:fuBIoZYkyZRcw+GA/6RKWQULfikqPpTbSd1Qs2uxLFrzqGMdKoepS0aBzcncvnN2Gy5Kn4s0B/DQzmTJsnG+zcZRRLAOqVXZNN6cKz11FDY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1931; 7:C0o+4MBhiM71+gd04fp9kTPn2SKZxf921LbXXXyA0UHMd9yC3ZK6o5RiDgnwAZcb9PZIlf1/U3sADze3OnrBQ801BEqwguAr2AoeegPq69fqmta/7buhh9nWXz8W9VD/1am0YgSVx97seN0AdFttfvJ9QLHkKJJYqtTrWtOiVOE7slqy8CF5hgdwdMZsud0427zJCU9WJgUMJHibCIdC/QBUzasKUT8Qx2cW5q4dkdu0UQv14F9el6KHgzPs9mJc0Mg9kTPwp2z18CS4ZI4UFOUAVWkZFxN3FRXrKNZh8PhT7O7/L7zupmGH71j0jMubUYZJaOD3TNCdJxTyBoh8X97HePx/n7E3GZ+tl2DAcDZlyK/LPPW75fD2HmaM8RAS7TL1myNnamMgrGodUCLwZoJOcY4H9Vd2dh0E3I2/RvnUs1sDSKOWLut7zzu9ia/8ZBXUoGh5LwqPBWZ7U8P1KyjCs7mxxeeBcSQk0rtnx0uwrvNFXkuWZ/l+Yh7bUrdXCb6ZbkDVsjka5r9ybTYQfRqrgpLWBpHsoL1H4XSd2orcFBO8Is2PV5TcqutvoN5tf5DXos2l9sNkOSnfvkuXt1RGavOQBoZ02woZjD1Xnu07dLxaNv5mxwckH2DykFwQyOt/zxN8eeERUjPgHzkHv+w3qDUaufA7j4nZKfIkro9AWbjAZ+baJBxvSpA8o92In6koYYbBUPhY0SY9swlw1qCQdOi8RGEtvN3jvKJXFnGa8HotjwfXMsSTvlbYUR+QyhaNcNL2haojVv9qYrFhnMbxL/vHsoNRLDw5mM3DAvg= X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2017 19:55:58.0681 (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 cfg80211 dump_survey handler enabling per-channel survey data reports. Signed-off-by: Avinash Patil Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 69 +++++++++++++- drivers/net/wireless/quantenna/qtnfmac/commands.c | 107 ++++++++++++++++++++++ drivers/net/wireless/quantenna/qtnfmac/commands.h | 2 + drivers/net/wireless/quantenna/qtnfmac/core.h | 9 ++ drivers/net/wireless/quantenna/qtnfmac/qlink.h | 31 +++++++ 5 files changed, 217 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index e222e8d038d3..eb648f02aa40 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -839,6 +839,72 @@ qtnf_disconnect(struct wiphy *wiphy, struct net_device *dev, return 0; } +static int +qtnf_dump_survey(struct wiphy *wiphy, struct net_device *dev, + int idx, struct survey_info *survey) +{ + struct qtnf_wmac *mac = wiphy_priv(wiphy); + struct ieee80211_supported_band *sband; + struct ieee80211_channel *chan; + struct qtnf_chan_stats stats; + int ret; + + sband = wiphy->bands[NL80211_BAND_2GHZ]; + if (sband && idx >= sband->n_channels) { + idx -= sband->n_channels; + sband = NULL; + } + + if (!sband) + sband = wiphy->bands[NL80211_BAND_5GHZ]; + + if (!sband || idx >= sband->n_channels) + return -ENOENT; + + chan = &sband->channels[idx]; + memset(&stats, 0, sizeof(stats)); + + survey->channel = chan; + survey->filled = 0x0; + + ret = qtnf_cmd_get_chan_stats(mac, chan->hw_value, &stats); + switch (ret) { + case 0: + if (unlikely(stats.chan_num != chan->hw_value)) { + pr_err("received stats for channel %d instead of %d\n", + stats.chan_num, chan->hw_value); + ret = -EINVAL; + break; + } + + survey->filled = SURVEY_INFO_TIME | + SURVEY_INFO_TIME_SCAN | + SURVEY_INFO_TIME_BUSY | + SURVEY_INFO_TIME_RX | + SURVEY_INFO_TIME_TX | + SURVEY_INFO_NOISE_DBM; + + survey->time_scan = stats.cca_try; + survey->time = stats.cca_try; + survey->time_tx = stats.cca_tx; + survey->time_rx = stats.cca_rx; + survey->time_busy = stats.cca_busy; + survey->noise = stats.chan_noise; + break; + case -ENOENT: + pr_debug("no stats for channel %u\n", chan->hw_value); + ret = 0; + break; + default: + pr_debug("failed to get chan(%d) stats from card\n", + chan->hw_value); + ret = -EINVAL; + break; + } + + return ret; +} + static struct cfg80211_ops qtn_cfg80211_ops = { .add_virtual_intf = qtnf_add_virtual_intf, .change_virtual_intf = qtnf_change_virtual_intf, @@ -859,7 +925,8 @@ static struct cfg80211_ops qtn_cfg80211_ops = { .set_default_mgmt_key = qtnf_set_default_mgmt_key, .scan = qtnf_scan, .connect = qtnf_connect, - .disconnect = qtnf_disconnect + .disconnect = qtnf_disconnect, + .dump_survey = qtnf_dump_survey }; 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 221804f8c43a..22741bf6f4ac 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -1358,6 +1358,62 @@ static int qtnf_cmd_resp_proc_phy_params(struct qtnf_wmac *mac, return 0; } +static int +qtnf_cmd_resp_proc_chan_stat_info(struct qtnf_chan_stats *stats, + const u8 *payload, size_t payload_len) +{ + struct qlink_chan_stats *qlink_stats; + const struct qlink_tlv_hdr *tlv; + size_t tlv_full_len; + u16 tlv_value_len; + u16 tlv_type; + + tlv = (struct qlink_tlv_hdr *)payload; + while (payload_len >= sizeof(struct qlink_tlv_hdr)) { + tlv_type = le16_to_cpu(tlv->type); + tlv_value_len = le16_to_cpu(tlv->len); + tlv_full_len = tlv_value_len + sizeof(struct qlink_tlv_hdr); + if (tlv_full_len > payload_len) { + pr_warn("malformed TLV 0x%.2X; LEN: %u\n", + tlv_type, tlv_value_len); + return -EINVAL; + } + switch (tlv_type) { + case QTN_TLV_ID_CHANNEL_STATS: + if (unlikely(tlv_value_len != sizeof(*qlink_stats))) { + pr_err("invalid CHANNEL_STATS entry size\n"); + return -EINVAL; + } + + qlink_stats = (void *)tlv->val; + + stats->chan_num = le32_to_cpu(qlink_stats->chan_num); + stats->cca_tx = le32_to_cpu(qlink_stats->cca_tx); + stats->cca_rx = le32_to_cpu(qlink_stats->cca_rx); + stats->cca_busy = le32_to_cpu(qlink_stats->cca_busy); + stats->cca_try = le32_to_cpu(qlink_stats->cca_try); + stats->chan_noise = qlink_stats->chan_noise; + + pr_debug("chan(%u) try(%u) busy(%u) noise(%d)\n", + stats->chan_num, stats->cca_try, + stats->cca_busy, stats->chan_noise); + break; + default: + pr_warn("Unknown TLV type: %#x\n", + le16_to_cpu(tlv->type)); + } + payload_len -= tlv_full_len; + tlv = (struct qlink_tlv_hdr *)(tlv->val + tlv_value_len); + } + + if (payload_len) { + pr_warn("malformed TLV buf; bytes left: %zu\n", payload_len); + return -EINVAL; + } + + return 0; +} + int qtnf_cmd_get_mac_info(struct qtnf_wmac *mac) { struct sk_buff *cmd_skb, *resp_skb = NULL; @@ -2227,3 +2283,54 @@ int qtnf_cmd_reg_notify(struct qtnf_bus *bus, struct regulatory_request *req) return ret; } + +int qtnf_cmd_get_chan_stats(struct qtnf_wmac *mac, u16 channel, + struct qtnf_chan_stats *stats) +{ + struct sk_buff *cmd_skb, *resp_skb = NULL; + struct qlink_cmd_get_chan_stats *cmd; + struct qlink_resp_get_chan_stats *resp; + size_t var_data_len; + u16 res_code = QLINK_CMD_RESULT_OK; + int ret = 0; + + cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, QLINK_VIFID_RSVD, + QLINK_CMD_CHAN_STATS, + sizeof(*cmd)); + if (!cmd_skb) + return -ENOMEM; + + qtnf_bus_lock(mac->bus); + + cmd = (struct qlink_cmd_get_chan_stats *)cmd_skb->data; + cmd->channel = cpu_to_le16(channel); + + ret = qtnf_cmd_send_with_reply(mac->bus, cmd_skb, &resp_skb, &res_code, + sizeof(*resp), &var_data_len); + if (unlikely(ret)) { + qtnf_bus_unlock(mac->bus); + return ret; + } + + if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { + switch (res_code) { + case QLINK_CMD_RESULT_ENOTFOUND: + ret = -ENOENT; + break; + default: + pr_err("cmd exec failed: 0x%.4X\n", res_code); + ret = -EFAULT; + break; + } + goto out; + } + + resp = (struct qlink_resp_get_chan_stats *)resp_skb->data; + ret = qtnf_cmd_resp_proc_chan_stat_info(stats, resp->info, + var_data_len); + +out: + qtnf_bus_unlock(mac->bus); + consume_skb(resp_skb); + return ret; +} diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.h b/drivers/net/wireless/quantenna/qtnfmac/commands.h index 155b265d42bf..41e2d50988b7 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.h +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.h @@ -71,5 +71,7 @@ int qtnf_cmd_send_disconnect(struct qtnf_vif *vif, int qtnf_cmd_send_updown_intf(struct qtnf_vif *vif, bool up); int qtnf_cmd_reg_notify(struct qtnf_bus *bus, struct regulatory_request *req); +int qtnf_cmd_get_chan_stats(struct qtnf_wmac *mac, u16 channel, + struct qtnf_chan_stats *stats); #endif /* QLINK_COMMANDS_H_ */ diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index 0d06ec932caf..8824e3d0b5bc 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -138,6 +138,15 @@ struct qtnf_mac_info { size_t n_limits; }; +struct qtnf_chan_stats { + u32 chan_num; + u32 cca_tx; + u32 cca_rx; + u32 cca_busy; + u32 cca_try; + s8 chan_noise; +}; + struct qtnf_wmac { u8 macid; u8 wiphy_registered; diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 892752599109..847c80f40a9a 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -165,6 +165,7 @@ enum qlink_cmd_type { QLINK_CMD_CHANGE_STA = 0x0051, QLINK_CMD_DEL_STA = 0x0052, QLINK_CMD_SCAN = 0x0053, + QLINK_CMD_CHAN_STATS = 0x0054, QLINK_CMD_CONNECT = 0x0060, QLINK_CMD_DISCONNECT = 0x0061, }; @@ -440,6 +441,16 @@ struct qlink_cmd_chans_info_get { } __packed; /** + * struct qlink_cmd_get_chan_stats - data for QLINK_CMD_CHAN_STATS command + * + * @channel: channel number according to 802.11 17.3.8.3.2 and Annex J + */ +struct qlink_cmd_get_chan_stats { + struct qlink_cmd chdr; + __le16 channel; +} __packed; + +/** * enum qlink_reg_initiator - Indicates the initiator of a reg domain request * * See &enum nl80211_reg_initiator for more info. @@ -641,6 +652,16 @@ struct qlink_resp_phy_params { u8 info[0]; } __packed; +/** + * struct qlink_resp_get_chan_stats - response for QLINK_CMD_CHAN_STATS cmd + * + * @info: variable-length channel info. + */ +struct qlink_resp_get_chan_stats { + struct qlink_cmd rhdr; + u8 info[0]; +} __packed; + /* QLINK Events messages related definitions */ @@ -813,6 +834,7 @@ enum qlink_tlv_id { QTN_TLV_ID_COVERAGE_CLASS = 0x0213, QTN_TLV_ID_IFACE_LIMIT = 0x0214, QTN_TLV_ID_NUM_IFACE_COMB = 0x0215, + QTN_TLV_ID_CHANNEL_STATS = 0x0216, QTN_TLV_ID_STA_BASIC_COUNTERS = 0x0300, QTN_TLV_ID_STA_GENERIC_INFO = 0x0301, QTN_TLV_ID_KEY = 0x0302, @@ -1014,4 +1036,13 @@ struct qlink_auth_encr { u8 control_port_no_encrypt; } __packed; +struct qlink_chan_stats { + __le32 chan_num; + __le32 cca_tx; + __le32 cca_rx; + __le32 cca_busy; + __le32 cca_try; + s8 chan_noise; +} __packed; + #endif /* _QTN_QLINK_H_ */