]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add QCA vendor attributes for P2P GO NoA cancellation
authorJianmin Zhu <jianminz@qti.qualcomm.com>
Thu, 25 Dec 2025 03:58:51 +0000 (19:58 -0800)
committerJouni Malinen <j@w1.fi>
Mon, 19 Jan 2026 21:30:56 +0000 (23:30 +0200)
Add QCA_WLAN_VENDOR_ATTR_P2P_SET_GO_CANCEL_ONE_SHOT_NOA and
QCA_WLAN_VENDOR_ATTR_P2P_SET_GC_KEEP_AWAKE_DURING_ONE_SHOT_NOA to
support firmware-managed automatic cancellation of P2P GO Notice of
Absence (NoA) schedules in multi-channel concurrency (MCC) scenarios.

Background:
In P2P GO + STA MCC scenarios (e.g., Miracast), when a local STA
interface sharing the same radio with the P2P GO performs
connection/roaming operations on a different channel, the firmware
automatically starts a one-shot NoA schedule on the P2P GO to facilitate
the STA's channel operations. This firmware-initiated NoA can cause:
- Delayed data transmission to P2P clients during the absence period
- Connection timeouts on P2P clients during extended absence
- Poor user experience during critical operations like video streaming

Why configurable instead of automatic:
While the firmware initiates NoA automatically, cancellation requires
explicit configuration because:
1. This optimization should only be enabled when both the P2P GO and all
   connected P2P Clients support this capability
2. Peer capability is determined by userspace through OUI-based device
   whitelists or vendor-specific information elements
3. The feature is intended for specific use cases (e.g., Miracast 1:1
   scenarios) where both devices are known to support early NoA
   cancellation

Scope and limitations:
This feature can be used when a P2P GO and all its connected P2P Clients
support this capability. Since NoA configuration affects all clients in
the group, the feature should only be enabled when all connected clients
are verified to support early NoA cancellation.
Peer capability is not standardized in P2P yet; for now, the GO/client is
expected to know peer client/GO capability via vendor-specific userspace
policy/mechanisms, e.g., device model / OUI based whitelists or out of band
capability handshake via Bluetooth.

Solution:
Add two new vendor attributes to the existing
QCA_NL80211_VENDOR_SUBCMD_P2P_SET_NOA command:

1. QCA_WLAN_VENDOR_ATTR_P2P_SET_GO_CANCEL_ONE_SHOT_NOA (for P2P GO):
   When enabled (value=1):
   - The firmware will cancel the current firmware-initiated one-shot NoA
     schedule when the local STA interface completes its
     connection/roaming operation
   - The cancellation will be reflected in subsequent beacons (typically
     the next beacon, though timing may vary based on beacon scheduling)
   - This unblocks P2P data transmission immediately after the STA
     operation completes

   When disabled (value=0, default): NoA behavior remains unchanged.

2. QCA_WLAN_VENDOR_ATTR_P2P_SET_GC_KEEP_AWAKE_DURING_ONE_SHOT_NOA
   (for P2P GC):
   When enabled (value=1):
   - The client will stay awake during one-shot NoA periods instead of
     entering sleep
   - This allows the client to immediately receive frames when the GO
     cancels NoA early, without waiting for the originally configured NoA
     duration to expire

   When disabled (value=0, default): GC enters sleep during NoA as usual.

Feature capability advertisement:
Two new feature flags are added to allow devices to advertise support:
- QCA_WLAN_VENDOR_FEATURE_SUPPORT_P2P_GO_CANCEL_ONE_SHOT_NOA
- QCA_WLAN_VENDOR_FEATURE_SUPPORT_P2P_GC_KEEP_AWAKE_DURING_ONE_SHOT_NOA

These flags can be used by userspace to determine local device
capabilities.

Signed-off-by: Jianmin Zhu <jianminz@qti.qualcomm.com>
src/common/qca-vendor.h

index 6743f1bc85bcea169dd031917c4e9b7e5f6e98d6..9adf402e46ab620843b421e9a4cc3b45677e72dd 100644 (file)
@@ -2524,6 +2524,19 @@ enum qca_wlan_vendor_acs_hw_mode {
  *     immediately after receiving a Channel Switch Announcement from the
  *     connected DFS AP on its STA interface.
  *
+ * @QCA_WLAN_VENDOR_FEATURE_SUPPORT_P2P_GO_CANCEL_ONE_SHOT_NOA: Flag indicates
+ * that the device supports cancellation of firmware-initiated one-shot NoA
+ * schedules on a P2P GO interface. This capability allows the P2P GO to cancel
+ * NoA early when a local STA interface (sharing the same radio) completes a
+ * connection or roaming operation.
+ *
+ * @QCA_WLAN_VENDOR_FEATURE_SUPPORT_P2P_GC_KEEP_AWAKE_DURING_ONE_SHOT_NOA:
+ * Flag indicates that the device in P2P Client mode supports staying awake
+ * during one-shot NoA periods instead of entering sleep. This allows the
+ * group client to immediately receive frames when the P2P GO cancels an NoA
+ * early (using QCA_WLAN_VENDOR_ATTR_P2P_SET_GO_CANCEL_ONE_SHOT_NOA), without
+ * waiting for the originally configured NoA duration to expire.
+ *
  * @NUM_QCA_WLAN_VENDOR_FEATURES: Number of assigned feature bits
  */
 enum qca_wlan_vendor_features {
@@ -2562,6 +2575,8 @@ enum qca_wlan_vendor_features {
        QCA_WLAN_VENDOR_FEATURE_SUPPORT_STA_INDOOR_CH_SCC = 32,
        QCA_WLAN_VENDOR_FEATURE_SUPPORT_STA_DFS_CH_SCC_P2P = 33,
        QCA_WLAN_VENDOR_FEATURE_SUPPORT_P2P_ASSISTED_DFS = 34,
+       QCA_WLAN_VENDOR_FEATURE_SUPPORT_P2P_GO_CANCEL_ONE_SHOT_NOA = 35,
+       QCA_WLAN_VENDOR_FEATURE_SUPPORT_P2P_GC_KEEP_AWAKE_DURING_ONE_SHOT_NOA = 36,
        NUM_QCA_WLAN_VENDOR_FEATURES /* keep last */
 };
 
@@ -20583,6 +20598,62 @@ enum qca_wlan_vendor_iq_inference_status {
  * specifies the start offset time (in milliseconds) of the first absence period
  * after the beacon advertising the NoA. If this attribute not present, the
  * driver will use the default start offset value.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_P2P_SET_GO_CANCEL_ONE_SHOT_NOA: Optional u8 attribute
+ * for use with QCA_NL80211_VENDOR_SUBCMD_P2P_SET_NOA on a P2P GO interface.
+ *
+ * In multi-channel concurrency (MCC) scenarios, when a local STA interface
+ * sharing the same radio with the P2P GO performs a connection or roaming
+ * operation on a different channel, the firmware automatically initiates a
+ * one-shot NoA schedule on the P2P GO to facilitate the STA's channel
+ * operations. This attribute controls whether the firmware should automatically
+ * cancel this one-shot NoA schedule when the STA operation completes.
+ *
+ * This feature should only be enabled when all connected P2P Clients support
+ * staying awake during one-shot NoA (see
+ * QCA_WLAN_VENDOR_ATTR_P2P_SET_GC_KEEP_AWAKE_DURING_ONE_SHOT_NOA). Peer device
+ * capability should be determined through vendor-specific mechanisms such as
+ * device model/OUI whitelists or capability handshake via Bluetooth.
+ *
+ * Values:
+ * 1 - Enable: The firmware will cancel the current firmware-initiated one-shot
+ *     NoA schedule when the local STA interface completes its connection or
+ *     roaming operation. The cancellation will be reflected in subsequent
+ *     Beacon frames (typically the next Beacon frame, though timing may vary
+ *     based on beacon scheduling). This allows immediate resumption of P2P data
+ *     transmission.
+ * 0 - Disable (default): NoA schedules are not automatically cancelled and
+ *     will run for their full configured duration.
+ *
+ * Note: This attribute only affects firmware-initiated one-shot NoA schedules
+ * created for MCC STA operations. It does not affect NoA schedules explicitly
+ * configured by userspace through other attributes of this command.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_P2P_SET_GC_KEEP_AWAKE_DURING_ONE_SHOT_NOA: Optional
+ * u8 attribute for use with QCA_NL80211_VENDOR_SUBCMD_P2P_SET_NOA on a P2P
+ * Client interface.
+ *
+ * This attribute controls whether the P2P Client should stay awake during
+ * one-shot NoA periods instead of entering sleep. This is designed to work in
+ * conjunction with QCA_WLAN_VENDOR_ATTR_P2P_SET_GO_CANCEL_ONE_SHOT_NOA on the
+ * P2P GO side.
+ *
+ * This feature should only be enabled when the peer P2P GO supports early NoA
+ * cancellation (see QCA_WLAN_VENDOR_ATTR_P2P_SET_GO_CANCEL_ONE_SHOT_NOA).
+ * Peer device capability should be determined through vendor-specific
+ * mechanisms such as device model/OUI whitelists or capability handshake via
+ * Bluetooth.
+ *
+ * Values:
+ * 1 - Enable: The P2P Client will stay awake during one-shot NoA periods
+ *     instead of entering sleep. This allows the client to immediately receive
+ *     frames when the P2P GO cancels a one-shot NoA early, without waiting for
+ *     the originally configured NoA duration to expire.
+ * 0 - Disable (default): The P2P Client enters sleep during NoA periods as
+ *     specified in the NoA schedule received from the P2P GO.
+ *
+ * Note: This attribute only affects behavior during one-shot NoA periods. It
+ * does not affect behavior during continuous NoA schedules.
  */
 enum qca_wlan_vendor_attr_p2p_set_noa {
        QCA_WLAN_VENDOR_ATTR_P2P_SET_NOA_INVALID = 0,
@@ -20590,6 +20661,8 @@ enum qca_wlan_vendor_attr_p2p_set_noa {
        QCA_WLAN_VENDOR_ATTR_P2P_SET_NOA_DURATION = 2,
        QCA_WLAN_VENDOR_ATTR_P2P_SET_NOA_INTERVAL = 3,
        QCA_WLAN_VENDOR_ATTR_P2P_SET_NOA_START = 4,
+       QCA_WLAN_VENDOR_ATTR_P2P_SET_GO_CANCEL_ONE_SHOT_NOA = 5,
+       QCA_WLAN_VENDOR_ATTR_P2P_SET_GC_KEEP_AWAKE_DURING_ONE_SHOT_NOA = 6,
 
        /* keep last */
        QCA_WLAN_VENDOR_ATTR_P2P_SET_NOA_AFTER_LAST,