Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1982977rdb; Mon, 9 Oct 2023 08:53:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERrn6dsAhrRlT9pY921tfl700M4DeE7JVmpNePQAOvsmXlZjiXojY367LNXFtHSWy3jSVG X-Received: by 2002:a05:6a20:6a23:b0:13e:9dba:ea52 with SMTP id p35-20020a056a206a2300b0013e9dbaea52mr16923626pzk.13.1696866819052; Mon, 09 Oct 2023 08:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696866819; cv=none; d=google.com; s=arc-20160816; b=dOKfdVuxq8nEsmcFAsXlkEkGJsfhQ7hilRpwm3Q+oFYmQN6y6CMtDvxm1SfjoylgNq bc0tevigIbP0ykeVF1ceUYbugYdyvM+1fgtg0T6GR7QybWW4LbzHgbLkBwsrDBYnRIxX K5NDfLPji6oEB48JdOYItGNAp63W42ihR9jY32hh6pxzBF+p92ZaF3skYZxOW6I3qXVv c9sM7h+hglBridySSyo/MxlSYclY4Jk2BzXb/TI2povDEO3Xq6CDxDlwkFQH4M4Dj44Z axP8gGwEK7jBwLWu7QcBAii1IbJFS684+OORZymWkj+fRRFqCyQJWoOOiwLTm0HZSBOm XTdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wPtxSHc5kpsl/meOkJ1+JSY5q157KHdOe13rw3OA8+0=; fh=G6KN1zqmJBGIhpPSq1AWsD4aWgSLDy1jBh7tZkBaukM=; b=ExH+U9SuEEVC0Ym9U5+9jf+uFcOx6NuXvVUrN0hOJ2l/GBEb1aQcZv0ZR6BgiFpF4C QSByPG72DGH7bhVg0BLJYMCtMqwD8rHZSBhJvm6+9dY9q42xaxTR49IcpoCT+52wHjaT cfkallKOHtXelGQ1kUlFVh0XUOnEQn9hJ7G5baPilRXwoE6JslibTzh5U1+aTyrkKkcy 9fpEokcx4FzB+ZZvGWZQAHKXpS+Mm9+xFshDUd9zxFk2tcTz4Ta5vN9u9p59Y0g3+3Ke L9rXLvEiAKCXV0hWKya2JAOstw988Qy3vdLClP8v6T/moGdZ0JqbVN9xQIa9+3BvQ07I M1hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=S9mkSIlo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id o66-20020a62cd45000000b0069018a768cesi7096457pfg.405.2023.10.09.08.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 08:53:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=S9mkSIlo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A6E5B801C1FA; Mon, 9 Oct 2023 08:53:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377077AbjJIPxF (ORCPT + 99 others); Mon, 9 Oct 2023 11:53:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377841AbjJIPwm (ORCPT ); Mon, 9 Oct 2023 11:52:42 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39ABD195; Mon, 9 Oct 2023 08:52:32 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 63CAF1C0015; Mon, 9 Oct 2023 15:52:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1696866750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wPtxSHc5kpsl/meOkJ1+JSY5q157KHdOe13rw3OA8+0=; b=S9mkSIlotahwxWU9oQA5FxOoPRbeOFzGDpQ38dPwB/Kk4+rqUW7rqapQjM2qXwIYTW4BOO FQszwaQs0qNkOYVscGZqPrf3NUgInpbJZiNNvj+8OykOuSSezkjuBp2Owri6C0bj3iMqO+ AWE194HSvw/YVU6A3Qu8D3Ll1dUiBUC1tZipz0/KVwjyJtGPZobnMXhikePrqH81wlJ9gj hPz8AruBd2izW/0D7IzEB3PfnAx8mKI9sczK84voEqoEv8uMiaxCeULSxFEFCehJhE9ZIs AGxYJF2c7zVn4mLzjrI1p59MHMwpTclEhgqbazwja9/jv7xbt6CT8czXUQb1IA== From: =?UTF-8?q?K=C3=B6ry=20Maincent?= To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: Thomas Petazzoni , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Jay Vosburgh , Andy Gospodarek , Nicolas Ferre , Claudiu Beznea , Horatiu Vultur , UNGLinuxDriver@microchip.com, Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , Richard Cochran , Radu Pirea , Willem de Bruijn , Vladimir Oltean , Michael Walle , Jacob Keller , Maxime Chevallier , Kory Maincent Subject: [PATCH net-next v5 12/16] net: Replace hwtstamp_source by timestamping layer Date: Mon, 9 Oct 2023 17:51:34 +0200 Message-Id: <20231009155138.86458-13-kory.maincent@bootlin.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231009155138.86458-1-kory.maincent@bootlin.com> References: <20231009155138.86458-1-kory.maincent@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 08:53:36 -0700 (PDT) X-Spam-Level: ** From: Kory Maincent Replace hwtstamp_source which is only used by the kernel_hwtstamp_config structure by the more widely use timestamp_layer structure. This is done to prepare the support of selectable timestamping source. Signed-off-by: Kory Maincent --- drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 6 +++--- include/linux/net_tstamp.h | 11 +++-------- net/core/dev_ioctl.c | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c index 8e4101628fbd..83c1177469e2 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c @@ -470,15 +470,15 @@ static int lan966x_port_hwtstamp_set(struct net_device *dev, struct lan966x_port *port = netdev_priv(dev); int err; - if (cfg->source != HWTSTAMP_SOURCE_NETDEV && - cfg->source != HWTSTAMP_SOURCE_PHYLIB) + if (cfg->source != NETDEV_TIMESTAMPING && + cfg->source != PHYLIB_TIMESTAMPING) return -EOPNOTSUPP; err = lan966x_ptp_setup_traps(port, cfg); if (err) return err; - if (cfg->source == HWTSTAMP_SOURCE_NETDEV) { + if (cfg->source == NETDEV_TIMESTAMPING) { if (!port->lan966x->ptp) return -EOPNOTSUPP; diff --git a/include/linux/net_tstamp.h b/include/linux/net_tstamp.h index eb01c37e71e0..2c1af19d5421 100644 --- a/include/linux/net_tstamp.h +++ b/include/linux/net_tstamp.h @@ -5,11 +5,6 @@ #include -enum hwtstamp_source { - HWTSTAMP_SOURCE_NETDEV, - HWTSTAMP_SOURCE_PHYLIB, -}; - /** * struct kernel_hwtstamp_config - Kernel copy of struct hwtstamp_config * @@ -20,8 +15,8 @@ enum hwtstamp_source { * a legacy implementation of a lower driver * @copied_to_user: request was passed to a legacy implementation which already * copied the ioctl request back to user space - * @source: indication whether timestamps should come from the netdev or from - * an attached phylib PHY + * @source: indication whether timestamps should come from software, the netdev + * or from an attached phylib PHY * * Prefer using this structure for in-kernel processing of hardware * timestamping configuration, over the inextensible struct hwtstamp_config @@ -33,7 +28,7 @@ struct kernel_hwtstamp_config { int rx_filter; struct ifreq *ifr; bool copied_to_user; - enum hwtstamp_source source; + u32 source; }; static inline void hwtstamp_config_to_kernel(struct kernel_hwtstamp_config *kernel_cfg, diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c index 342a667858ac..45cc1ea9b195 100644 --- a/net/core/dev_ioctl.c +++ b/net/core/dev_ioctl.c @@ -332,7 +332,7 @@ int dev_set_hwtstamp_phylib(struct net_device *dev, bool changed = false; int err; - cfg->source = phy_ts ? HWTSTAMP_SOURCE_PHYLIB : HWTSTAMP_SOURCE_NETDEV; + cfg->source = phy_ts ? PHYLIB_TIMESTAMPING : NETDEV_TIMESTAMPING; if (phy_ts && (dev->priv_flags & IFF_SEE_ALL_HWTSTAMP_REQUESTS)) { err = ops->ndo_hwtstamp_get(dev, &old_cfg); -- 2.25.1