mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-22 03:42:41 +00:00
Some checks failed
Build OpenWrt/uCentral images / build (cig_wf186h) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf186w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf188n) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf189) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf196) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-a1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-b1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap102) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap104) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap105) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap111) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap112) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_3) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xe) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (indio_um-305ax) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sercomm_ap72tip) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630c-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-211g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-id2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-od2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr5018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018-v4) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax820) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax840) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap640) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap650) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap655) (push) Has been cancelled
Build OpenWrt/uCentral images / trigger-testing (push) Has been cancelled
Build OpenWrt/uCentral images / create-x64_vm-ami (push) Has been cancelled
Signed-off-by: John Crispin <john@phrozen.org>
148 lines
5.0 KiB
Diff
148 lines
5.0 KiB
Diff
From 741fa523d6dd195195a9b7514a9583699f43ba3a Mon Sep 17 00:00:00 2001
|
|
From: Nagarajan Maran <quic_nmaran@quicinc.com>
|
|
Date: Wed, 7 Jun 2023 12:26:25 +0530
|
|
Subject: [PATCH] iw: Add support to handle streaming stats in target.
|
|
|
|
Signed-off-by: Nagarajan Maran <quic_nmaran@quicinc.com>
|
|
---
|
|
iw.h | 13 +++++++-
|
|
sawf_stats.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
2 files changed, 99 insertions(+), 1 deletion(-)
|
|
create mode 100644 sawf_stats.c
|
|
|
|
--- a/iw.h
|
|
+++ b/iw.h
|
|
@@ -79,7 +79,8 @@ enum qca_nl80211_vendor_subcmds {
|
|
QCA_NL80211_VENDOR_SUBCMD_SAWF_DEF_Q_MAP_REP = 209,
|
|
QCA_NL80211_VENDOR_SUBCMD_TELEMETRY_SLA_THERSHOLD_CFG = 210,
|
|
QCA_NL80211_VENDOR_SUBCMD_TELEMETRY_SLA_SAMPLES_COLLECTION_CFG = 211,
|
|
- QCA_NL80211_VENDOR_SUBCMD_TELEMETRY_SLA_BREACH_DETECTION_CFG = 212
|
|
+ QCA_NL80211_VENDOR_SUBCMD_TELEMETRY_SLA_BREACH_DETECTION_CFG = 212,
|
|
+ QCA_NL80211_VENDOR_SUBCMD_SAWF_STREAMING_STATS = 213,
|
|
QCA_NL80211_VENDOR_SUBCMD_SAWF_SLA_BREACH = 214,
|
|
};
|
|
/* Attributes for data used by
|
|
@@ -95,6 +96,17 @@ enum qca_wlan_vendor_attr_config {
|
|
QCA_WLAN_VENDOR_ATTR_CONFIG_AFTER_LAST - 1,
|
|
};
|
|
|
|
+enum ath12k_vendor_attr_sawf_streaming {
|
|
+ QCA_WLAN_VENDOR_ATTR_SAWF_STREAMING_INVALID = 0,
|
|
+ QCA_WLAN_VENDOR_ATTR_SAWF_STREAMING_BASIC_STATS = 1,
|
|
+ QCA_WLAN_VENDOR_ATTR_SAWF_STREAMING_EXTND_STATS = 2,
|
|
+ QCA_WLAN_VENDOR_ATTR_MLO_LINK_ID = 3,
|
|
+ /* keep last */
|
|
+ QCA_WLAN_VENDOR_ATTR_SAWF_STREAMING_AFTER_LAST,
|
|
+ QCA_WLAN_VENDOR_ATTR_SAWF_STREAMING_MAX =
|
|
+ QCA_WLAN_VENDOR_ATTR_SAWF_STREAMING_AFTER_LAST - 1,
|
|
+};
|
|
+
|
|
enum ath12k_vendor_attr_sawf_def_q_map {
|
|
QCA_WLAN_VENDOR_ATTR_SAWF_DEF_Q_MAP_INVALID = 0,
|
|
QCA_WLAN_VENDOR_ATTR_SAWF_DEF_Q_MAP_SVC_ID = 1,
|
|
--- /dev/null
|
|
+++ b/sawf_stats.c
|
|
@@ -0,0 +1,102 @@
|
|
+/*
|
|
+ * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
|
+
|
|
+ * Permission to use, copy, modify, and/or distribute this software for any
|
|
+ * purpose with or without fee is hereby granted, provided that the above
|
|
+ * copyright notice and this permission notice appear in all copies.
|
|
+
|
|
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
+ */
|
|
+#include <errno.h>
|
|
+#include <string.h>
|
|
+#include <stdio.h>
|
|
+#include <math.h>
|
|
+
|
|
+#include <netlink/genl/genl.h>
|
|
+#include <netlink/genl/family.h>
|
|
+#include <netlink/genl/ctrl.h>
|
|
+#include <netlink/msg.h>
|
|
+#include <netlink/attr.h>
|
|
+
|
|
+#include <arpa/inet.h>
|
|
+
|
|
+#include "nl80211.h"
|
|
+#include "iw.h"
|
|
+
|
|
+#define OUI_QCA 0x001374
|
|
+#define STREAMING_STATS_MIN_ARGUMENTS 1
|
|
+#define STREAMING_STATS_MAX_ARGUMENTS 3
|
|
+#define STREAMING_STATS_MAX_VALUE 3
|
|
+#define STREAMING_STATS_BASIC_EN_EXTND_DIS 1
|
|
+#define STREAMING_STATS_BASIC_DIS_EXTND_EN 2
|
|
+
|
|
+
|
|
+SECTION(streaming_stats);
|
|
+
|
|
+static int handle_streaming_stats(struct nl80211_state *state,
|
|
+ struct nl_msg *msg, int argc, char **argv,
|
|
+ enum id_input id)
|
|
+{
|
|
+ struct nlattr *stats;
|
|
+ unsigned long value;
|
|
+ uint8_t basic_stats = 0, extnd_stats = 0, link_id;
|
|
+ char *end;
|
|
+
|
|
+ if (argc < STREAMING_STATS_MIN_ARGUMENTS ||
|
|
+ argc > STREAMING_STATS_MAX_ARGUMENTS)
|
|
+ goto err;
|
|
+
|
|
+ errno = 0;
|
|
+ value = strtoul(argv[0], &end, 10);
|
|
+ if (*end != '\0' || value > STREAMING_STATS_MAX_VALUE || errno == ERANGE)
|
|
+ goto err;
|
|
+ argc--;
|
|
+
|
|
+ nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_QCA);
|
|
+ nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
|
|
+ QCA_NL80211_VENDOR_SUBCMD_SAWF_STREAMING_STATS);
|
|
+
|
|
+ stats = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
|
|
+ if (!stats)
|
|
+ return -ENOBUFS;
|
|
+
|
|
+ if (value & STREAMING_STATS_BASIC_EN_EXTND_DIS)
|
|
+ basic_stats = 1;
|
|
+ if (value & STREAMING_STATS_BASIC_DIS_EXTND_EN)
|
|
+ extnd_stats = 1;
|
|
+
|
|
+ nla_put_u8(msg, QCA_WLAN_VENDOR_ATTR_SAWF_STREAMING_BASIC_STATS, basic_stats);
|
|
+ nla_put_u8(msg, QCA_WLAN_VENDOR_ATTR_SAWF_STREAMING_EXTND_STATS, extnd_stats);
|
|
+
|
|
+ if (argc) {
|
|
+ argc--;
|
|
+ if (!strcmp(argv[1], "-l") || !argc)
|
|
+ goto err;
|
|
+ errno = 0;
|
|
+ link_id = strtoul(argv[2], &end, 10);
|
|
+ if (*end != '\0' || value > MAX_MLD_LINK || errno == ERANGE) {
|
|
+ goto err;
|
|
+ }
|
|
+ nla_put_u8(msg, QCA_WLAN_VENDOR_ATTR_MLO_LINK_ID, link_id);
|
|
+ }
|
|
+
|
|
+ nla_nest_end(msg, stats);
|
|
+ return 0;
|
|
+
|
|
+err:
|
|
+ printf("Invalid SAWF streaming stats command format: Usage\n");
|
|
+ printf("iw dev <devname> streaming_stats configure <value> [-l <link_id>]\n");
|
|
+ printf("\t value: 0 - Disable both Basic and Extended stats\n");
|
|
+ printf("\t value: 1 - Enable Basic and Disable Extended stats\n");
|
|
+ printf("\t value: 2 - Disable Basic and Enable Extended stats\n");
|
|
+ printf("\t value: 3 - Enable both Basic and Extended stats\n");
|
|
+ return -EINVAL;
|
|
+}
|
|
+
|
|
+COMMAND(streaming_stats, handle, "<value> [-l <link_id>]", NL80211_CMD_VENDOR, 0, CIB_NETDEV, handle_streaming_stats, ".");
|