]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Define QCA vendor subcommand to fetch QSH Wi-Fi statistics
authorPabitra Dash <pdash@qti.qualcomm.com>
Tue, 13 Jan 2026 10:52:29 +0000 (16:22 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 22 Jan 2026 15:51:38 +0000 (17:51 +0200)
Context-aware modules like Qualcomm Sensing Hub (QSH) run in low-power
domains (e.g., Sensor DSP) and require Wi-Fi scan and ranging services
for location and context-awareness purposes. These services often
operate continuously, even while the host system is in power-save sleep
mode, without involving the host subsystem.

However, sometimes the host subsystem needs to monitor these services.
To enable monitoring, introduce a vendor subcommand to the QCA nl80211
vendor interface.

QCA_NL80211_VENDOR_SUBCMD_QSH_GET_STATS:
Retrieves the Wi-Fi scan count from the sensor (currently only scan
count; might be extended to include additional statistics in the
future), enabling analysis of power usage related to QSH-driven scans.

This enhancement improves visibility into QSH scan behavior for better
performance in resource-constrained and latency-critical scenarios.

Signed-off-by: Pabitra Dash <pdash@qti.qualcomm.com>
src/common/qca-vendor.h

index 9adf402e46ab620843b421e9a4cc3b45677e72dd..d27fcd8122ae0c50fa3a05e796a8ecb0c8fe19bd 100644 (file)
@@ -1468,6 +1468,13 @@ enum qca_radiotap_vendor_ids {
  *
  *     The attributes used with this command are defined in
  *     enum qca_wlan_vendor_attr_dcs.
+ *
+ * @QCA_NL80211_VENDOR_SUBCMD_QSH_GET_STATS: Retrieve Qualcomm Sensing Hub (QSH)
+ *     related Wi-Fi statistics from the sensor. Currently supports scan count;
+ *     might be extended in the future.
+ *
+ *     No attributes are used in the request. The response includes attributes
+ *     defined in enum qca_wlan_vendor_attr_qsh_stats.
  */
 enum qca_nl80211_vendor_subcmds {
        QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
@@ -1721,6 +1728,7 @@ enum qca_nl80211_vendor_subcmds {
        QCA_NL80211_VENDOR_SUBCMD_GET_COEX_STATS = 267,
        QCA_NL80211_VENDOR_SUBCMD_ATF_OFFLOAD_OPS = 268,
        QCA_NL80211_VENDOR_SUBCMD_DCS_CONFIG = 269,
+       QCA_NL80211_VENDOR_SUBCMD_QSH_GET_STATS = 270,
 };
 
 /* Compatibility defines for previously used subcmd names.
@@ -23186,4 +23194,22 @@ enum qca_wlan_vendor_attr_dcs {
        QCA_WLAN_VENDOR_ATTR_DCS_AFTER_LAST - 1
 };
 
+/**
+ * enum qca_wlan_vendor_attr_qsh_stats - Attributes used by
+ * %QCA_NL80211_VENDOR_SUBCMD_QSH_GET_STATS.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_QSH_STATS_SCAN_COUNT: 32-bit unsigned value
+ *     representing the Wi-Fi scan count from the sensor. This attribute is
+ *     mandatory. It's a response-only attribute.
+ */
+enum qca_wlan_vendor_attr_qsh_stats {
+       QCA_WLAN_VENDOR_ATTR_QSH_STATS_INVALID = 0,
+       QCA_WLAN_VENDOR_ATTR_QSH_STATS_SCAN_COUNT = 1,
+
+       /* keep last */
+       QCA_WLAN_VENDOR_ATTR_QSH_STATS_AFTER_LAST,
+       QCA_WLAN_VENDOR_ATTR_QSH_STATS_MAX =
+       QCA_WLAN_VENDOR_ATTR_QSH_STATS_AFTER_LAST - 1
+};
+
 #endif /* QCA_VENDOR_H */