]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Define QCA_NL80211_VENDOR_SUBCMD_GET_COEX_STATS
authorWu Gao <wugao@qti.qualcomm.com>
Mon, 22 Sep 2025 02:31:48 +0000 (19:31 -0700)
committerJouni Malinen <j@w1.fi>
Tue, 7 Oct 2025 15:06:28 +0000 (18:06 +0300)
Define a new vendor subcommand QCA_NL80211_VENDOR_SUBCMD_GET_COEX_STATS
to retrieve Wi-Fi and Bluetooth coexistence statistics from the driver.

This subcommand allows userspace applications to query information about
the current Bluetooth Coexistence (BTC) mode and policy settings. The
implementation provides the following information:
- PDEV ID
- Current BTC mode
- Current BTC policy

This subcommand helps diagnose interference issues between Wi-Fi and
Bluetooth, monitor coexistence mechanisms, and optimize performance when
both radios are operating simultaneously.

Signed-off-by: Wu Gao <wugao@qti.qualcomm.com>
src/common/qca-vendor.h

index 7eb2231201f300383b5c98ef645d9d976e1f38dd..4a61fbd81a4c150034ce31d06b8e070c7d6fde0e 100644 (file)
@@ -1448,6 +1448,12 @@ enum qca_radiotap_vendor_ids {
  *     a specific feature enablement based on the OUI data and capabilities of
  *     the AP. The attributes used with this command are defined in
  *     enum qca_wlan_vendor_attr_feature_config.
+ *
+ * @QCA_NL80211_VENDOR_SUBCMD_GET_COEX_STATS: Vendor subcommand used to retrieve
+ *     Wi-Fi and Bluetooth coexistence statistics from the driver.
+ *
+ *     The attributes used with this command are defined in
+ *     enum qca_wlan_vendor_attr_coex_stats.
  */
 enum qca_nl80211_vendor_subcmds {
        QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
@@ -1698,6 +1704,7 @@ enum qca_nl80211_vendor_subcmds {
        QCA_NL80211_VENDOR_SUBCMD_LINK_STATE_CHANGE = 264,
        QCA_NL80211_VENDOR_SUBCMD_DAR = 265,
        QCA_NL80211_VENDOR_SUBCMD_FEATURE_CONFIG = 266,
+       QCA_NL80211_VENDOR_SUBCMD_GET_COEX_STATS = 267,
 };
 
 /* Compatibility defines for previously used subcmd names.
@@ -13496,18 +13503,22 @@ enum qca_wlan_vendor_attr_add_sta_node_params {
  * enum qca_btc_chain_mode - Specifies BT coex chain mode.
  * This enum defines the valid set of values of BT coex chain mode.
  * These values are used by attribute %QCA_VENDOR_ATTR_BTC_CHAIN_MODE of
- * %QCA_NL80211_VENDOR_SUBCMD_BTC_CHAIN_MODE.
+ * %QCA_NL80211_VENDOR_SUBCMD_BTC_CHAIN_MODE or
+ * %QCA_NL80211_VENDOR_SUBCMD_GET_COEX_STATS.
  *
  * @QCA_BTC_CHAIN_SHARED: chains of BT and WLAN 2.4 GHz are shared.
  * @QCA_BTC_CHAIN_SEPARATED_HYBRID: chains of BT and WLAN 2.4 GHz are
  * separated, hybrid mode.
  * @QCA_BTC_CHAIN_SEPARATED_FDD: chains of BT and WLAN 2.4 GHz are
  * separated, fixed FDD mode.
+ * @QCA_BTC_CHAIN_DBAM: DBAM (Dedicated BT Antenna Mode) for BT/WLAN
+ * coexistence.
  */
 enum qca_btc_chain_mode {
        QCA_BTC_CHAIN_SHARED = 0,
        QCA_BTC_CHAIN_SEPARATED_HYBRID = 1,
        QCA_BTC_CHAIN_SEPARATED_FDD = 2,
+       QCA_BTC_CHAIN_DBAM = 3,
 };
 
 /* deprecated legacy name */
@@ -13537,6 +13548,50 @@ enum qca_vendor_attr_btc_chain_mode {
        QCA_VENDOR_ATTR_BTC_CHAIN_MODE_LAST - 1,
 };
 
+/**
+ * enum qca_btc_policy - Specifies Bluetooth coexistence (BTC) policy.
+ * This enum defines the valid set of BTC policy values.
+ * These values are used by attribute %QCA_WLAN_VENDOR_ATTR_COEX_BTC_POLICY.
+ *
+ * @QCA_BTC_POLICY_FREE_FRUN: "Free run" mode for BTC. WLAN operates without
+ * strict BTC constraints.
+ *
+ * @QCA_BTC_POLICY_OCS: "OCS" (Off Channel Scheme) mode for BTC. Specific
+ * coexistence mechanisms are enforced to manage interference between Bluetooth
+ * and WLAN.
+ *
+ * @QCA_BTC_POLICY_INVALID: Invalid policy value. Used for error handling or
+ * uninitialized state.
+ */
+enum qca_btc_policy {
+       QCA_BTC_POLICY_FREE_FRUN = 0,
+       QCA_BTC_POLICY_OCS = 1,
+       QCA_BTC_POLICY_INVALID = 255
+};
+
+/**
+ * enum qca_wlan_vendor_attr_coex_stats - Coexistence statistics attributes
+ * @QCA_WLAN_VENDOR_ATTR_COEX_STATS_ARRAY_INDEX: Nested attribute containing
+ * the following attributes:
+ *      %QCA_WLAN_VENDOR_ATTR_COEX_PDEV_ID
+ *      %QCA_WLAN_VENDOR_ATTR_COEX_BTC_POLICY
+ *      %QCA_VENDOR_ATTR_BTC_CHAIN_MODE
+ * @QCA_WLAN_VENDOR_ATTR_COEX_PDEV_ID: 8-bit unsigned value to indicate PDEV ID.
+ * @QCA_WLAN_VENDOR_ATTR_COEX_BTC_POLICY: 8-bit unsigned value to current BTC
+ * policy. The policies are defined in enum qca_btc_policy.
+ */
+enum qca_wlan_vendor_attr_coex_stats {
+       QCA_WLAN_VENDOR_ATTR_COEX_STATS_INVALID = 0,
+       QCA_WLAN_VENDOR_ATTR_COEX_STATS_ARRAY_INDEX = 1,
+       QCA_WLAN_VENDOR_ATTR_COEX_PDEV_ID = 2,
+       QCA_WLAN_VENDOR_ATTR_COEX_BTC_POLICY = 3,
+
+       /* keep last */
+       QCA_WLAN_VENDOR_ATTR_COEX_STATS_AFTER_LAST,
+       QCA_WLAN_VENDOR_ATTR_COEX_STATS_MAX =
+       QCA_WLAN_VENDOR_ATTR_COEX_STATS_AFTER_LAST - 1,
+};
+
 /**
  * enum qca_vendor_wlan_sta_flags - Station feature flags
  * Bits will be set to 1 if the corresponding features are enabled.