OSDN Git Service

wifi: nl80211: add RX and TX timestamp attributes
authorAvraham Stern <avraham.stern@intel.com>
Wed, 26 Jan 2022 14:06:35 +0000 (16:06 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 22 Jul 2022 12:28:23 +0000 (14:28 +0200)
Add attributes for reporting hardware timestamps for management frames
RX and TX. These attributes will be used for reporting hardware
timestamps for Timing measurement and Fine Timing Measurement action
frames, which will allow userspace applications to measure the path
delay between devices and sync clocks.

For TX, these attributes are used for reporting the frame RX time and
the ack TX time. For TX, they are used for reporting the frame TX time
and the ack RX time.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/uapi/linux/nl80211.h

index d4d6ba5..5275dcb 100644 (file)
  *     %NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA
  *     counters which will be updated to the current value. This attribute
  *     is used during CSA period.
+ *     For RX notification, %NL80211_ATTR_RX_HW_TIMESTAMP may be included to
+ *     indicate the frame RX timestamp and %NL80211_ATTR_TX_HW_TIMESTAMP may
+ *     be included to indicate the ack TX timestamp.
  * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
  *     command may be used with the corresponding cookie to cancel the wait
  *     time if it is known that it is no longer necessary.  This command is
  *     transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
  *     the TX command and %NL80211_ATTR_FRAME includes the contents of the
  *     frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
- *     the frame.
+ *     the frame. %NL80211_ATTR_TX_HW_TIMESTAMP may be included to indicate the
+ *     tx timestamp and %NL80211_ATTR_RX_HW_TIMESTAMP may be included to
+ *     indicate the ack RX timestamp.
  * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
  *     backward compatibility.
  *
@@ -2720,6 +2725,18 @@ enum nl80211_commands {
  * @NL80211_ATTR_EML_CAPABILITY: EML Capability information (u16)
  * @NL80211_ATTR_MLD_CAPA_AND_OPS: MLD Capabilities and Operations (u16)
  *
+ * @NL80211_ATTR_TX_HW_TIMESTAMP: Hardware timestamp for TX operation in
+ *     nanoseconds (u64). This is the device clock timestamp so it will
+ *     probably reset when the device is stopped or the firmware is reset.
+ *     When used with %NL80211_CMD_FRAME_TX_STATUS, indicates the frame TX
+ *     timestamp. When used with %NL80211_CMD_FRAME RX notification, indicates
+ *     the ack TX timestamp.
+ * @NL80211_ATTR_RX_HW_TIMESTAMP: Hardware timestamp for RX operation in
+ *     nanoseconds (u64). This is the device clock timestamp so it will
+ *     probably reset when the device is stopped or the firmware is reset.
+ *     When used with %NL80211_CMD_FRAME_TX_STATUS, indicates the ack RX
+ *     timestamp. When used with %NL80211_CMD_FRAME RX notification, indicates
+ *     the incoming frame RX timestamp.
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -3245,6 +3262,9 @@ enum nl80211_attrs {
        NL80211_ATTR_EML_CAPABILITY,
        NL80211_ATTR_MLD_CAPA_AND_OPS,
 
+       NL80211_ATTR_TX_HW_TIMESTAMP,
+       NL80211_ATTR_RX_HW_TIMESTAMP,
+
        /* add attributes here, update the policy in nl80211.c */
 
        __NL80211_ATTR_AFTER_LAST,