]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add QCA_NL80211_VENDOR_SUBCMD_DCS_CONFIG vendor command
authorWu Gao <wugao@qti.qualcomm.com>
Thu, 30 Oct 2025 11:17:06 +0000 (04:17 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 9 Jan 2026 10:21:17 +0000 (12:21 +0200)
Add a new vendor command QCA_NL80211_VENDOR_SUBCMD_DCS_CONFIG to allow
applications to get and set Dynamic Channel Selection (DCS)
configuration parameters through the nl80211 vendor interface.

DCS monitors the operating channel of an AP or P2P GO for interference
and can steer the interface to a cleaner channel when policy thresholds
are met.

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

index 9e6a7916c762939030473c6efbef8ad00174632e..a1f98257ab48ca9a15eb9210b07a3c2498b29967 100644 (file)
@@ -1458,6 +1458,16 @@ enum qca_radiotap_vendor_ids {
  * @QCA_NL80211_VENDOR_SUBCMD_ATF_OFFLOAD_OPS: This vendor subcommand is used to
  *     configure airtime fairness. The attributes used with this subcommand
  *     are defined in enum qca_wlan_vendor_attr_atf_offload_ops.
+ *
+ * @QCA_NL80211_VENDOR_SUBCMD_DCS_CONFIG: Vendor subcommand used to get or set
+ *     Dynamic Channel Selection (DCS) configuration parameters. This enables or
+ *     disables different types of interference mitigation. DCS monitors
+ *     wireless channels for periodic interference events, typically one event
+ *     per second, and automatically switches to a cleaner channel when
+ *     necessary.
+ *
+ *     The attributes used with this command are defined in
+ *     enum qca_wlan_vendor_attr_dcs.
  */
 enum qca_nl80211_vendor_subcmds {
        QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
@@ -1710,6 +1720,7 @@ enum qca_nl80211_vendor_subcmds {
        QCA_NL80211_VENDOR_SUBCMD_FEATURE_CONFIG = 266,
        QCA_NL80211_VENDOR_SUBCMD_GET_COEX_STATS = 267,
        QCA_NL80211_VENDOR_SUBCMD_ATF_OFFLOAD_OPS = 268,
+       QCA_NL80211_VENDOR_SUBCMD_DCS_CONFIG = 269,
 };
 
 /* Compatibility defines for previously used subcmd names.
@@ -23008,4 +23019,89 @@ enum qca_wlan_vendor_attr_beacon_miss_stat {
        QCA_WLAN_VENDOR_ATTR_BEACON_MISS_STAT_AFTER_LAST - 1,
 };
 
+/**
+ * enum qca_wlan_vendor_attr_dcs - Attributes used by
+ * %QCA_NL80211_VENDOR_SUBCMD_DCS_CONFIG.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_DCS_LINK_ID: 8-bit unsigned value for link ID.
+ * Specifies which link to set/get in a multi-link setup.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_DCS_CMD_TYPE: 8-bit unsigned value for DCS command type
+ *     0: GET – Retrieve the current DCS configuration.
+ *        Userspace must provide QCA_WLAN_VENDOR_ATTR_DCS_CMD_TYPE.
+ *        QCA_WLAN_VENDOR_ATTR_DCS_LINK_ID is also required in multi-link AP
+ *        scenarios.
+ *        The driver will return the following attributes:
+ *             QCA_WLAN_VENDOR_ATTR_DCS_ENABLE
+ *             QCA_WLAN_VENDOR_ATTR_DCS_INTERFERENCE_DETECTION_THRESHOLD
+ *             QCA_WLAN_VENDOR_ATTR_DCS_PHY_ERR_PENALTY
+ *             QCA_WLAN_VENDOR_ATTR_DCS_PHY_ERR_THRESHOLD
+ *             QCA_WLAN_VENDOR_ATTR_DCS_RADAR_ERR_THRESHOLD
+ *             QCA_WLAN_VENDOR_ATTR_DCS_TX_ERR_THRESHOLD
+ *             QCA_WLAN_VENDOR_ATTR_DCS_INTERFERENCE_DETECTION_WINDOW
+ *             QCA_WLAN_VENDOR_ATTR_DCS_COCHANNEL_INTERFERENCE_THRESHOLD
+ *             QCA_WLAN_VENDOR_ATTR_DCS_MAX_CU
+ *     1: SET – Update the DCS configuration.
+ *        Userspaxce must provide QCA_WLAN_VENDOR_ATTR_DCS_CMD_TYPE.
+ *        QCA_WLAN_VENDOR_ATTR_DCS_LINK_ID is also required in multi-link AP
+ *        scenarios.
+ *        One or more of the above attributes must be included with new
+ *        values to apply the configuration update.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_DCS_ENABLE: 16-bit bitmap to set/get enable/disable DCS
+ *     bit 0: Enable Continuous Wave Interference Management (CW IM)
+ *     bit 1: Enable WLAN Interference Management (WLAN IM)
+ *
+ * @QCA_WLAN_VENDOR_ATTR_DCS_INTERFERENCE_DETECTION_THRESHOLD: 32-bit unsigned
+ * value to set/get interference detection threshold. This attribute specifies
+ * the number of interference events required to trigger a channel switch.
+ * Higher values decrease sensitivity, making DCS less likely to switch.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_DCS_PHY_ERR_PENALTY: 32-bit unsigned value to set/get
+ * the PHY error penalty. This value specifies the amount of channel time
+ * (in microseconds) counted as wasted for each PHY error when estimating
+ * interference.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_DCS_PHY_ERR_THRESHOLD: 32-bit unsigned value to set/get
+ * the PHY error count threshold.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_DCS_RADAR_ERR_THRESHOLD: 32-bit unsigned value to
+ * set/get radar error count threshold.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_DCS_TX_ERR_THRESHOLD: 32-bit unsigned value to set/get
+ * TX error count threshold.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_DCS_INTERFERENCE_DETECTION_WINDOW: 32-bit unsigned
+ * value to set/get the interference detection sampling window. The unit is a
+ * count of sampling intervals, where each interval corresponds to one second.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_DCS_COCHANNEL_INTERFERENCE_THRESHOLD: 8-bit unsigned
+ * value to set/get the co-channel interference threshold level, interpreted as
+ * a percentage of channel time affected by same-channel interference.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_DCS_MAX_CU: 8-bit unsigned value to set/get the maximum
+ * channel utilization percentage allowed. If the combined TX and RX channel
+ * utilization exceeds this configured maximum CU, treats the condition as WLAN
+ * interference.
+ */
+enum qca_wlan_vendor_attr_dcs {
+       QCA_WLAN_VENDOR_ATTR_DCS_INVALID = 0,
+       QCA_WLAN_VENDOR_ATTR_DCS_LINK_ID = 1,
+       QCA_WLAN_VENDOR_ATTR_DCS_CMD_TYPE = 2,
+       QCA_WLAN_VENDOR_ATTR_DCS_ENABLE = 3,
+       QCA_WLAN_VENDOR_ATTR_DCS_INTERFERENCE_DETECTION_THRESHOLD = 4,
+       QCA_WLAN_VENDOR_ATTR_DCS_PHY_ERR_PENALTY = 5,
+       QCA_WLAN_VENDOR_ATTR_DCS_PHY_ERR_THRESHOLD = 6,
+       QCA_WLAN_VENDOR_ATTR_DCS_RADAR_ERR_THRESHOLD = 7,
+       QCA_WLAN_VENDOR_ATTR_DCS_TX_ERR_THRESHOLD = 8,
+       QCA_WLAN_VENDOR_ATTR_DCS_INTERFERENCE_DETECTION_WINDOW = 9,
+       QCA_WLAN_VENDOR_ATTR_DCS_COCHANNEL_INTERFERENCE_THRESHOLD = 10,
+       QCA_WLAN_VENDOR_ATTR_DCS_MAX_CU = 11,
+
+       /* keep last */
+       QCA_WLAN_VENDOR_ATTR_DCS_AFTER_LAST,
+       QCA_WLAN_VENDOR_ATTR_DCS_MAX =
+       QCA_WLAN_VENDOR_ATTR_DCS_AFTER_LAST - 1
+};
+
 #endif /* QCA_VENDOR_H */