From patchwork Wed May 29 09:39:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kory Maincent X-Patchwork-Id: 13678551 X-Patchwork-Delegate: kuba@kernel.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (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 9205316A37A; Wed, 29 May 2024 09:41:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716975705; cv=none; b=PjObq8t6oJ//yqAkFo/sdONrameLUAs+72RfixHW4QOmfDDEGM1vz6muO24DQ9faIzVcLzJ/SegmIyaxAQW5YAPWafGM7otfSE9VAs6QTedEXh50Qf5da5+Pug7cr1s/UfcZoAxpBP/OrABZVPM2HnY7o+iAqO3ocVkrguIT7y4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716975705; c=relaxed/simple; bh=gnOJv3IJnG4MxVBS3Rs8JRq/t9ZNB4Rqjtb6Bc5CGuo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OujwfP3/4m24R7DVjyJQKgFW+BwhKOCGHBNnDkZ2cL/11z1FGdQtlbmlp6dxtzJXymk/zu0jIx2S54kk12OSIHG67TISQp+NPma96bE+NBv809UGFqegp/PInJ/pAKFIHJRplvKm/evJDzEgs2ZH2jhT2iNYn3ul1VnClRVWSTc= 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=PHxHKtPh; arc=none smtp.client-ip=217.70.183.195 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="PHxHKtPh" Received: by mail.gandi.net (Postfix) with ESMTPSA id B87FA6000B; Wed, 29 May 2024 09:41:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1716975701; 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=KUn20jBzGgQX3nN2BNPFK9rn+KLdbsza5Fx8uyTOtm8=; b=PHxHKtPhvyFheEhGJqYy80zSeICNjjbrij222ku3aAvpg30KFtiSlk3o6WlMR3U3vUWhi/ vmhfXFTzGxgTNFD4xe81LaRH4nL3yP5//gSjqvQoHhoLwyWHd3b/GKwbrx2+qKX1153J5R 66qJwHFRDZVALEF3+N+o4E+DySD5VvH4aP7lkAl+0jqdQH7BKcvIshMzZgfUich2D5EFtp N3flxV8BKOtIXRZKJGf7nySBIAreG8U69KqKTdKhGL9qF7RL3bzMwhMAiagpe0fDOxQSkN M5ay6V0Tx5vzqvo3nWfnqt3rCUrW4CChGBenYC6DXf/ZF0mjN/KD/S8H7PbMpA== From: Kory Maincent Date: Wed, 29 May 2024 11:39:36 +0200 Subject: [PATCH net-next v13 04/14] net: Make net_hwtstamp_validate accessible Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240529-feature_ptp_netnext-v13-4-6eda4d40fa4f@bootlin.com> References: <20240529-feature_ptp_netnext-v13-0-6eda4d40fa4f@bootlin.com> In-Reply-To: <20240529-feature_ptp_netnext-v13-0-6eda4d40fa4f@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 X-Patchwork-Delegate: kuba@kernel.org 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 75094405b569..7e2425326170 100644 --- a/net/core/dev.h +++ b/net/core/dev.h @@ -171,5 +171,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;