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: Kory Maincent X-Patchwork-Id: 13572110 X-Patchwork-Delegate: kuba@kernel.org 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="gkefMB6U" 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: netdev@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-Patchwork-Delegate: kuba@kernel.org 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) {