From patchwork Mon Feb 26 13:39:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?K=C3=B6ry_Maincent?= X-Patchwork-Id: 206626 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2081413dyb; Mon, 26 Feb 2024 05:41:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU0WqaCvhUWZY/yDNcMwj/M6mB6f84gJXJzJb+Xx+KYi0vo+DL1ahdayd8t8kxZrhWGm//CmdHVpvrP1IBVv5uVBH1akQ== X-Google-Smtp-Source: AGHT+IEzSCNokFPOx+ujRZBxxHnUY4tX9a40qDS0b0Qj4PPZzg+ybNVxv5Tv9W1ocp2JNETq3ys3 X-Received: by 2002:a05:6512:3d29:b0:512:fcab:f5c5 with SMTP id d41-20020a0565123d2900b00512fcabf5c5mr2977227lfv.4.1708954875863; Mon, 26 Feb 2024 05:41:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708954875; cv=pass; d=google.com; s=arc-20160816; b=R+j4T5l7hChlGRSYlKF8zoMrxXPU/TIla3cfjcCXjdoyc7y2kHauCF+7SnvqRhM9Ry 6aQMfVC6ApxZjnTnrg1+oISYIHReGJTZBfXPD9y0Wp7TAU2LsXuwBa2jWdMBlxr4ppUp KeIcLcyIrKPcol9FTbSp1UvvLRizeRVrJEsvvN0tnvOkz0raYr9iQJpm/wz86k1wHkUV Pxf8C/QCr2YwE4+4dMUQv4eXDpgWegJPWtHTThdBIpryr3FTpt7IVT2I4PRc0iJLXUnm jwcQ1G1IB+AhX7a8e9vcQ7kGdHp5epD5oDWuHM7jtJ0MB1vu1deyyszsCAgYT+aoaYio H7yw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=WcXA3dA0UEztBmkar7lC4WlQ+A4k8aE3ilayyVHI4Bk=; fh=vtlcgQ30nO0QjQR7y1Wfn7g9c11A+T6SWcSZ6WixcJI=; b=rw0nf/aUsVZz2EVthohv6C5C0aEEdAbWzebZdLqmVqJJVt0YWCLxI6Md7ndwjkEF3w UvyyU3CUra4o3SKU3VizAMnXDqdhRMtTOlYyxK/7f4X1udmJ1ZS9lDjWXaIeOFrsnbJe dLXSfbbC90U/jVofG/BdLI6ZpGEdrDZEhSzT++nlHqgQtmeDFXkhHmPSU8J5uopkP7cd SKcKdVfkz9V1jxZE8dSY4/F6J7uIFk/27r9uLSO4rozrx9G7TapiEvAxzwx4GNU5zvlZ 6kGeazCaEPxVmDvfY/6OjvoZ1/BIh4g6Yj6G9YHoSxSwtEytZop+9GTomMuMU4xyKqDO qBlg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=gkefMB6U; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-81503-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81503-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i21-20020a05640242d500b00565faf52393si766960edc.357.2024.02.26.05.41.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 05:41:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81503-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=gkefMB6U; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-81503-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81503-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 507601F2827C for ; Mon, 26 Feb 2024 13:41:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7397012B143; Mon, 26 Feb 2024 13:40:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="gkefMB6U" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6ABE5128386; Mon, 26 Feb 2024 13:40:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708954817; cv=none; b=J2EDtF85F+9iQrQTD1XvC9K4XmB7CdK4kXS8op6cfqAULspY8BiENAaCHkFZY2rffFH5MHoThVUCCws9K4YTy2V6p53UJMYerTkP2ChYSSJ0IolXMYsBV4OEkoHc++7ByrktaWyR5ITfbhRHHTFhtx6EzzO8AwuuB6YvcAxs6fM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708954817; c=relaxed/simple; bh=y7ldU4xeQKoAsm7jrQjkqta+dP7x+SkOyCbw3tGAJ9c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QJDDIRN3CXEewnMWXBsID1utSJQljW1xlR9Qxt/hnSzuIOZrrVcKIVzf9ijnOq8rxjsmN7hON2gvk3yBaCjJNZkzq2ZiMfl5WJvyV0Zk199KjK0jMgCJVbKdLwib4clT+sfPjzafuhI1ZAYfK+Ou2n1eYtNCQdTXcm2icaWbMMQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=gkefMB6U; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id A129840009; Mon, 26 Feb 2024 13:40:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708954813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WcXA3dA0UEztBmkar7lC4WlQ+A4k8aE3ilayyVHI4Bk=; b=gkefMB6U0NYMrV3CNhMuP2MRnrKGOjWUNMZcBBGhRKyoH3PNua8nKjndsImsLdJLMWkwjr qJp9kEojwv2DJm0A3kZoWNObn45ufI5qZMxA09GchLcO9FALSr6mPOS6E6KCWNUKE3qp9k +cLepBEosVu8FNf5MTSUJybkhPRGwpDp3NG0/El0N3GvUegktNkiA29goYI7Wk1ukNWd1S dRplmarBQmaxnV/xzPbYLLuMAqsUMWWQVl+b1OBP5exxzOIYFQJK/EcJl31oHTfgzeO3PJ 3vmjvYKoiiWeRkSBq1mG4QTcMU7Cq7fa7N3AKS32HlIK0klyhrEQXKGtIkl6iw== From: Kory Maincent Date: Mon, 26 Feb 2024 14:39:53 +0100 Subject: [PATCH net-next v9 02/13] net: Make dev_get_hwtstamp_phylib accessible Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240226-feature_ptp_netnext-v9-2-455611549f21@bootlin.com> References: <20240226-feature_ptp_netnext-v9-0-455611549f21@bootlin.com> In-Reply-To: <20240226-feature_ptp_netnext-v9-0-455611549f21@bootlin.com> To: Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Radu Pirea , Jay Vosburgh , Andy Gospodarek , Nicolas Ferre , Claudiu Beznea , Willem de Bruijn , Jonathan Corbet , Horatiu Vultur , UNGLinuxDriver@microchip.com, Simon Horman , Vladimir Oltean Cc: Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Maxime Chevallier , Rahul Rameshbabu , Kory Maincent X-Mailer: b4 0.12.4 X-GND-Sasl: kory.maincent@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791969067605892264 X-GMAIL-MSGID: 1791969067605892264 Make the dev_get_hwtstamp_phylib function accessible in prevision to use it from ethtool to read the hwtstamp current configuration. Reviewed-by: Florian Fainelli Signed-off-by: Kory Maincent --- Change in v8: - New patch --- include/linux/netdevice.h | 2 ++ net/core/dev_ioctl.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f07c8374f29c..7f78aef73fe1 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -4005,6 +4005,8 @@ int generic_hwtstamp_set_lower(struct net_device *dev, int dev_set_hwtstamp_phylib(struct net_device *dev, struct kernel_hwtstamp_config *cfg, struct netlink_ext_ack *extack); +int dev_get_hwtstamp_phylib(struct net_device *dev, + struct kernel_hwtstamp_config *cfg); int dev_ethtool(struct net *net, struct ifreq *ifr, void __user *userdata); unsigned int dev_get_flags(const struct net_device *); int __dev_change_flags(struct net_device *dev, unsigned int flags, diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c index 9a66cf5015f2..5d3b169d8f18 100644 --- a/net/core/dev_ioctl.c +++ b/net/core/dev_ioctl.c @@ -268,14 +268,15 @@ static int dev_eth_ioctl(struct net_device *dev, * -EOPNOTSUPP for phylib for now, which is still more accurate than letting * the netdev handle the GET request. */ -static int dev_get_hwtstamp_phylib(struct net_device *dev, - struct kernel_hwtstamp_config *cfg) +int dev_get_hwtstamp_phylib(struct net_device *dev, + struct kernel_hwtstamp_config *cfg) { if (phy_has_hwtstamp(dev->phydev)) return phy_hwtstamp_get(dev->phydev, cfg); return dev->netdev_ops->ndo_hwtstamp_get(dev, cfg); } +EXPORT_SYMBOL_GPL(dev_get_hwtstamp_phylib); static int dev_get_hwtstamp(struct net_device *dev, struct ifreq *ifr) {