Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2129000lqa; Tue, 30 Apr 2024 08:50:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU7DBCERHUIE23mJfv+aJxRA56aVTA/uUoXxC/tT5vQl6sJcnvJpPxTxSH6Sx0HAFyda878z+6PFu6A3cCA0I3c+LZE2mMMJKLwckKtfA== X-Google-Smtp-Source: AGHT+IGVZ9xmUFOxY5XauVornXAU1wHMFbR2xOrWaOnLwQi8N1vsFd34vjWw6dgygOujk6eVq1y0 X-Received: by 2002:ad4:5764:0:b0:6a0:a00e:7583 with SMTP id r4-20020ad45764000000b006a0a00e7583mr17507161qvx.18.1714492258787; Tue, 30 Apr 2024 08:50:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714492258; cv=pass; d=google.com; s=arc-20160816; b=n2pUOntyb5L3Uk8wopSRrTdZMX2yCRU1ydg4sLztLZ9Ao+3P69ci0nPywp1aucsykM 35PFV4wHAwrClewFzJr6Lt8lJJTNPESTlp9/ldfEDJRXLCAeFtQdD1viILDXbOi2gE1s gZufe02zsNuULPk35c/rIXgAULjxNHwZzEwZsggGjzf1MOFT8PgzH4kpCJsDeIEhx8es 2gOEGZu00qvLjvzUKC0E424Jm9ijN6qj6n/wLUIej53DQR2HUYdNk34oDCEqlNrTxi1D p6m/cI2JvVh57uCLCJ7awo00XBW8MJQ89G1K42JHDuSU0AkyYvzYPMAwodFDeYEoytoi NWEg== 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=OvSPqbTravq+uXV8NX6wI95ClFv5FR4JYxaALnEYaFI=; fh=vtlcgQ30nO0QjQR7y1Wfn7g9c11A+T6SWcSZ6WixcJI=; b=coZ0YAGbMO5U81Su3Dtl+Dh+Z57mstuOFF5HJmlL7fJwwEQgXl88ZCl5d+fcRq88QD fVwRh7tpKotnshSs4pUhnuQynguxvh5hjH0XMImADyJ1TpB+b9b0CkRvuR77qIauLEYs 33OTHhn+wnbEGPT6wytGaOLYm5lvynoEOfGERBNZSGMkVacCN7CEPApbQQN6liCh9wBV DIeqLV/pjVI/OahQjAscwIt7h1QDaPnm6QTv8XUN6G/k4iVs5UqaisRjM24jXRcoPrIf wpfojZj4fO5xxo1yfuUDzRk84jALSzscPYBtTDQp31hsBndUfjowLl3E4V9dxB8iLrLo egwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cQv6DODq; 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-164307-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164307-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ey7-20020a0562140b6700b006a0ca6080desi6160315qvb.140.2024.04.30.08.50.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 08:50:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164307-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cQv6DODq; 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-164307-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164307-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 736601C22CAB for ; Tue, 30 Apr 2024 15:50:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4FE9117A906; Tue, 30 Apr 2024 15:50:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="cQv6DODq" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 1DFE6174EC8; Tue, 30 Apr 2024 15:50:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714492237; cv=none; b=fTgq8GwGWNbwS53OG770sdMICEkyH1jh/WPlL4HWJ+IEXN6pGcUgAPysEuFTCoWp1aUYwfLzozaAku+LVjcG65eC+P/dgyOk38JLE27S/4oZI//oX16mBggCGu/ya2cP6Pg0HOwO7lZL3Kt5SVEwkZwxTtqpQi5Czo3ZSpKSxGE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714492237; c=relaxed/simple; bh=+7AuBfrkVfvvlqBbnWwiB4WC75JvgZX/iPRvTxQaD3g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HyOT7wQgD15OC8rU6pkdG7dBorHohSmpG5/XfjOC5/Xdz9XSt/X0sOnfuYDKyqziVoez+5ZyPwQ0YCTvxdRPGsBB0dzNL1iEAm3rM3LjAGnqqFdlX3GqpdBW2T5KhjPayG10SZLT2I82si7fqB1HptPhUAZmaHpXpyWe2rp4XHk= 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=cQv6DODq; arc=none smtp.client-ip=217.70.183.200 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 1D26020012; Tue, 30 Apr 2024 15:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714492230; 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=OvSPqbTravq+uXV8NX6wI95ClFv5FR4JYxaALnEYaFI=; b=cQv6DODqcZWJwBTr/wY/weMptMLuiwSPto0Yd/hiCUCOq10cb/2SEcS7iiwOIFrxTWtANo 7yjtiAvM6mU36MV0dmHZFhEZCKEW4tXv3s5uB49XkBYlC0xcgGkVvo50Pzg51ya2yvxir3 ihoAaCUdBoR22qolgAQhGZcaJWyHiHdusceE9iJL6yC1aN1rwnl+p0NoqQQdliTQyldvNh SgVJoyeobp7Wm8GIqA0w5h6UJ0fhT3i1kRHJRtOJnMTIF+4plVBf4qxYB+CKMvpobfJ+wW 1xsUBxBPdfvGd1K/CtEHJywt0WtaOOXhwCLMcqBQUCDbb9o3nH4PMnruHrz6Ow== From: Kory Maincent Date: Tue, 30 Apr 2024 17:49:47 +0200 Subject: [PATCH net-next v12 04/13] net: Make net_hwtstamp_validate accessible Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240430-feature_ptp_netnext-v12-4-2c5f24b6a914@bootlin.com> References: <20240430-feature_ptp_netnext-v12-0-2c5f24b6a914@bootlin.com> In-Reply-To: <20240430-feature_ptp_netnext-v12-0-2c5f24b6a914@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.13.0 X-GND-Sasl: kory.maincent@bootlin.com Make the net_hwtstamp_validate function accessible in prevision to use it from ethtool to validate the hwtstamp configuration before setting it. Reviewed-by: Florian Fainelli Signed-off-by: Kory Maincent --- Change in v8: - New patch Change in v10: - Remove export symbol as ethtool can't be built as a module. - Move the declaration to net/core/dev.h instead of netdevice.h --- net/core/dev.h | 1 + net/core/dev_ioctl.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/net/core/dev.h b/net/core/dev.h index 2236b14b798f..44004f17b32b 100644 --- a/net/core/dev.h +++ b/net/core/dev.h @@ -172,5 +172,6 @@ int dev_set_hwtstamp_phylib(struct net_device *dev, struct netlink_ext_ack *extack); int dev_get_hwtstamp_phylib(struct net_device *dev, struct kernel_hwtstamp_config *cfg); +int net_hwtstamp_validate(const struct kernel_hwtstamp_config *cfg); #endif diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c index b8cf8c55fa2d..6aaa8326bf8f 100644 --- a/net/core/dev_ioctl.c +++ b/net/core/dev_ioctl.c @@ -184,7 +184,7 @@ static int dev_ifsioc_locked(struct net *net, struct ifreq *ifr, unsigned int cm return err; } -static int net_hwtstamp_validate(const struct kernel_hwtstamp_config *cfg) +int net_hwtstamp_validate(const struct kernel_hwtstamp_config *cfg) { enum hwtstamp_tx_types tx_type; enum hwtstamp_rx_filters rx_filter; -- 2.34.1