Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1134846pxb; Wed, 6 Apr 2022 09:31:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxEGB5iNqUE16neGaJdIG4k3VRhzNqLN7fdWXhyK0YUKKDGpN9FQHYXEQW8Qeegizs7/mY X-Received: by 2002:a17:902:ea12:b0:156:1bfa:13ac with SMTP id s18-20020a170902ea1200b001561bfa13acmr9423073plg.80.1649262662305; Wed, 06 Apr 2022 09:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649262662; cv=none; d=google.com; s=arc-20160816; b=JyzrUJXhjQEMlEBURU0mCBAmoQJkdCGk2c2iI9CmlFFN5h20Ut+ynyTPEj/EX2CofC I1ketJpueHPsrsPwH8I2e9fFTKcS3Pp705smacVtwlqO/IXxMskfiezhXGoLH/apjI/Y MhXbmQOL1eE6N76lZdGA/oxdSmoN74A50Yb9Y48pWeLF7kuwQ0xAcToPDzCa5bCp+GaF V2yBNhPjmN9akigBZK3kYmt7RaGlwiyM9zKAF0bd8cT7jzySZ0BETRKyxLyAq8mY4PH5 Oew37OB1kSDch2/P8vgCm4oAyjlk6xGmmrfvwM09ZphM2oHp/oyxap0GdVccHVbVzwCy vENg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from; bh=xKaWE0JDvLznHWpbiw9oKpXIIGgB5gLrOaaCFi/5GqE=; b=pSbXFDj5oyliFqeKLK5rUZTjkcxLYIGe8Q7CbGTaAiNomPb/LBD/DAW7nfH0uLKF+A 3vtn9ytjaBfPmfpMjowZYE3P+aOhdSDsq9YMCA/ZwPveRFnn8v3SoWbdpvJ22fyywEyg wHM0Fr75vgkTmzQEskHPy5CGLKMwy5tAz+FXwApiIOHYqMNAGjkLwjkMqAqSe7cKC1/T J64sHjvgwiT8FeuvMBfCNWwPoOYw0TQimWwOQylfikXeYvu/6EGx7zlSOT63SuBIQEUv utSXQqf7+Cw+KZxXQi/eb8OD2mJslLTnXNhxNTd7h6NesQ3g/dcWtA8mM1jFWagq68j4 X33A== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t70-20020a637849000000b003816043ee11si16629457pgc.6.2022.04.06.09.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 09:31:02 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F1A7C17C404; Wed, 6 Apr 2022 08:37:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236403AbiDFPjQ (ORCPT + 69 others); Wed, 6 Apr 2022 11:39:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236998AbiDFPi3 (ORCPT ); Wed, 6 Apr 2022 11:38:29 -0400 Received: from farmhouse.coelho.fi (paleale.coelho.fi [176.9.41.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A77E22E96F for ; Wed, 6 Apr 2022 05:53:01 -0700 (PDT) Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=kveik.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1nc4TY-000pov-2i; Wed, 06 Apr 2022 15:09:30 +0300 From: Luca Coelho To: johannes@sipsolutions.net, kvalo@kernel.org Cc: luca@coelho.fi, gregory.greenman@intel.com, linux-wireless@vger.kernel.org Date: Wed, 6 Apr 2022 15:09:18 +0300 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220406120924.979792-1-luca@coelho.fi> References: <20220406120924.979792-1-luca@coelho.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 Subject: [PATCH 1/7] nl80211: add RX and TX timestamp attributes Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Avraham Stern 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 Signed-off-by: Luca Coelho --- include/uapi/linux/nl80211.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 0568a79097b8..1554854c03e3 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -753,6 +753,9 @@ * %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 @@ -763,7 +766,9 @@ * 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. * @@ -2663,6 +2668,18 @@ enum nl80211_commands { * association request when used with NL80211_CMD_NEW_STATION). Can be set * only if %NL80211_STA_FLAG_WME is set. * + * @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 @@ -3175,6 +3192,9 @@ enum nl80211_attrs { NL80211_ATTR_EHT_CAPABILITY, + NL80211_ATTR_TX_HW_TIMESTAMP, + NL80211_ATTR_RX_HW_TIMESTAMP, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, @@ -6172,6 +6192,10 @@ enum nl80211_feature_flags { * @NL80211_EXT_FEATURE_RADAR_BACKGROUND: Device supports background radar/CAC * detection. * + * @NL80211_EXT_FEATURE_HW_TIMESTAMP: Device supports timestamping timing + * measurement and fine timing measurement action frames and their acks + * on TX and RX. + * * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. */ @@ -6239,6 +6263,7 @@ enum nl80211_ext_feature_index { NL80211_EXT_FEATURE_BSS_COLOR, NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD, NL80211_EXT_FEATURE_RADAR_BACKGROUND, + NL80211_EXT_FEATURE_HW_TIMESTAMP, /* add new features before the definition below */ NUM_NL80211_EXT_FEATURES, -- 2.35.1