Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1842093lqe; Tue, 9 Apr 2024 01:49:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVNCXgPfGNQiItM8ToUO6Ef0V4yo0aw6AJnHPP31/y1GT8pPmmeAujvTrgIXKBwrokBOKnQ90s0cytCeku0oUC1O/qGmRw/QiCc23lntg== X-Google-Smtp-Source: AGHT+IGMvdDwewSl5coq/1XEu0y7uo2IgT9kWNO7E6+pB1Yofwu8C+xG9RcWJ7AF3UEzU0oATpIu X-Received: by 2002:a17:907:8686:b0:a4e:d5d:8fd6 with SMTP id qa6-20020a170907868600b00a4e0d5d8fd6mr8886408ejc.60.1712652560063; Tue, 09 Apr 2024 01:49:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712652560; cv=pass; d=google.com; s=arc-20160816; b=r5HtZcjmzlllDRwhQCBybb6/MueLqiSKw9viXjJYHf96Vig57amSK5wuwXDylKaXqQ +gWV5luMjwqQ+gS0Ia2A3F1m+vjm9oLu6PVU1UcfHT1/0jIk/Ug3hMqeyU50Plg6nOk9 OC2z9Poop3e4eYS6W5OQqrWl/ymXb1Il6D1aUjOb50kGmOuU2nSqMCci6XdUps0lIfsF ZUYAS65/wRrbMQBC36d9liiR/4sSrZiku9Be4skHnav49+3qyAUozk+7Yk/20wBgLRDK yGR8LwQhAvrJsUgWFAzBjwr1izto3ltbNkYPcgGk9WkfG09rf5Hgn9GvFeZIYjEKf1bu +nvQ== 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=iZQnkv1nCyPHMllsVzdbBhA9y3CC5GsoToW26T0GzKuy2AQ0fKN8AVXlsJSqsqcbyA EaQAvZxRm0Xmf8HoGACMdJ/sEGdncBqeHf7QpzuNH9MdltVIuL/k1eklXlk9GYC9/qJY i4HqsJ8pY6hAsfJ2VsnFVWhLEZEcxMIrhFjMYQ7ntQ5ll0OLIYpFoWMQRRo1rBL/dcw3 SWg8KKaMHawUa66PbKqgXARQliQyjqenKTo1tPLxlfj57UdfnaDgh284OhYkvyHgfQAd EdDyPJ+VaKZEOHYuXvHhQ+CsMhyLivaFu5bAE6VWH3vkZ8FjC8qNPxEBBLJipTIHbm1z m4Tw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MYfgoCBc; 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-136465-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136465-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id nc11-20020a1709071c0b00b00a51bd9703fdsi3262170ejc.626.2024.04.09.01.49.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 01:49:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136465-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MYfgoCBc; 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-136465-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136465-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 794101F267F1 for ; Tue, 9 Apr 2024 08:30:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7DC37129A7B; Tue, 9 Apr 2024 08:27:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="MYfgoCBc" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 51E4082D9C; Tue, 9 Apr 2024 08:27:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712651237; cv=none; b=GeWHU8bEDOTHEUON5r60XDOgvQfCEt8iOedhsPMkhdJRZigXZwjn+IakDvEhT0Buenar4xsjPpR1yxMP+/LEqhyA+1TsH0oOLBOjKLGdD+6XgKSGqdpnNdkN3Dp0jSuX51ZCQdlpZf3kEYJxQVqwQlaUZKMVy9SgWeMLq+gjVIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712651237; c=relaxed/simple; bh=+7AuBfrkVfvvlqBbnWwiB4WC75JvgZX/iPRvTxQaD3g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EIiySrdyn5QD/o+4evH6RasEzPJjwrBv9VAgSdEmrMMyDyvLv4XJlIYZwGi5a3ro/9INTakeA7zWOXA6vz6UWTS5GWJqsVJRaqOsmJXpMPNPjpn/GeYKjsVwJjMVBsb3IrVsFpSLwKKOZNk+wnLi0ZXL8hbkaRTJxQJPeOb6jzI= 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=MYfgoCBc; arc=none smtp.client-ip=217.70.183.199 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 23D32FF806; Tue, 9 Apr 2024 08:27:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1712651228; 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=MYfgoCBcxp5aHjwldcMjIz+rznCXTfmbtfjaER6D2Sp3uJZDyGHe7IHVRd5b1jRnXCWWi3 uggSNdPjhHFPLaaQo6cAm6ldlBfqLOyn1uVhK8uZrl2rfIAF/Jg7NvegCSrqpPH3TE1L+P oqZHuNf6kklcJ0Y30HqS1zSKLa75XVHXywbpmyboLDda4zMMxGGmXw6dCK858sFHmYzy+V 0799rCBQbcAuNmMTZ3VLe2H3Ib46od2gDmRGElm8cQsbR5eXAaYZSCdRc1lGc5dntS1mFr tt3R5dp47PF747G2g357lpkpLbWc+4LRdeC+WKsPmvhbIxzl7EsGpxh6bQgB9w== From: Kory Maincent Date: Tue, 09 Apr 2024 10:26:26 +0200 Subject: [PATCH net-next v10 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: <20240409-feature_ptp_netnext-v10-4-0fa2ea5c89a9@bootlin.com> References: <20240409-feature_ptp_netnext-v10-0-0fa2ea5c89a9@bootlin.com> In-Reply-To: <20240409-feature_ptp_netnext-v10-0-0fa2ea5c89a9@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