Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp515704lqb; Wed, 29 May 2024 02:42:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVYai/KIFc7RJNZry9d1X+guIUrsnoGAfNsQedWAM+qEG6BWWQc7k9bI97xQtH91GKoiINcpkNvgmzIRaTaaLs/lGTb6/MDGh1mMuxfyA== X-Google-Smtp-Source: AGHT+IENXBTFA5VJVEk9rsSI6gG5ncwnJf0Zu/UFhNXfysCDH5Jo2A17yGGtseFv3w1gWNOsuPP1 X-Received: by 2002:a05:6512:ba6:b0:529:b569:9381 with SMTP id 2adb3069b0e04-529b5699470mr6079898e87.69.1716975723688; Wed, 29 May 2024 02:42:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716975723; cv=pass; d=google.com; s=arc-20160816; b=KkYlbGSBV6MsIdsm1wEUThXi3s6QyvVceCoSvHFEmZjhEKlM1ApcG3Fqwy5V5vbRp4 8Bsyqz8aAAE7sjk5o8aP+TwimJ82oyJqgWfWhD3n3kLFc535ucy9+GphVibG2Prjfw+S ANokqI2/VqA6xyNUBxO+F95vJlt76ULfYGF1GC1fllWDGopnN5kj4i/SkXYwEglWtgnx ++kh4SA4cb5+OaJ1kA4JgHC+c21Z7HZ3NqGwAxmnLcdN3UbySlD+Fg8cEMgmp6chG5Aq wyoyRCHesDY+4rIxiKk0dOp1CsQqKBLE2jE7TtUJcV1iOnlZez82UZ0Wbfoj+cYU5YZJ lruw== 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=KUn20jBzGgQX3nN2BNPFK9rn+KLdbsza5Fx8uyTOtm8=; fh=vtlcgQ30nO0QjQR7y1Wfn7g9c11A+T6SWcSZ6WixcJI=; b=HVtIGZ/DtuAyvGjds/oV/J9Zr2jVbqozEvIqn4v087LUR+RWmCP2fYjzNlOAunKIyP IFddh8sJsYUlaX20xph6T7dST3e1v7KV7lSO6VLq1Ds0ZnTP+jx+8XAl7C4OJ3XEVU2Z 96iIlVjyGpqoJq+mUxIsECr4czZAs/0OVyLP5AG4oKYwOpN/9ZEyaQ5Va4R748w0yS9r I/Qd6LwXApaXNEp+rpA4DUAumKbDP/XlioGpIX23yrHn5ybakX5C7SnVgFj2CULtP+ni /pgjqtyldeI64R5tP0lzWa+idxuvGwatBik++Jkk0tMYR7mLUxEqT/94jrHPyQ4MCJvE W9MQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PHxHKtPh; 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-193859-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193859-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cdd3795si582899066b.1024.2024.05.29.02.42.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 02:42:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193859-linux.lists.archive=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=PHxHKtPh; 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-193859-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193859-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 679C31F25DA8 for ; Wed, 29 May 2024 09:42:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99C1A16E886; Wed, 29 May 2024 09:41:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="PHxHKtPh" 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 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: 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: <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 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; -- 2.34.1