From patchwork Mon Feb 26 13:39:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?K=C3=B6ry_Maincent?= X-Patchwork-Id: 206627 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2081727dyb; Mon, 26 Feb 2024 05:41:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVNjT9+B9riVBNmv8JjBmqLNmwSBTMZzCceWfpEtKtA0c3m47lavC/zOlX/UnWdk5M3cTlKF5KgNn7gPUmL71vhFMxKGQ== X-Google-Smtp-Source: AGHT+IFv4H+y2kvWCkp8bggSrq/zMExaO6utDGLDqMfdyDURMJkxpULmtqD1/5/8C3dud2xozene X-Received: by 2002:aa7:d958:0:b0:565:214d:8dd7 with SMTP id l24-20020aa7d958000000b00565214d8dd7mr5027439eds.35.1708954910667; Mon, 26 Feb 2024 05:41:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708954910; cv=pass; d=google.com; s=arc-20160816; b=H0HRvt3gFgrVJnb3yQv4LWggMadH+zEvKDVMJPqZFN+TH8aEMEBHqgAXiPkTh9DZMR MWGCHFIujzqIPAsFD7egfwcPIL9jzNDQMBdtg6mgQndT3nZSPkqn5k0XLxs8T1qKSER6 2FQBr+yhWRqpNO03Wl1eqJ/Rmf0YgnEx+yAN1pD24GgGpVTpJ9Rqg1LSKxfMEoPgoreU WG1Mvgc6U47UTy6L09ymTKNeHOWEMhhd/N54dJZ8rfnATH2daBYvtQRntwdW6icw8ViW 5BAgICAMECpAxjTVA6K6JJ0+3pkoB96dsBmbZk6jU4izZEtwdLoQjFzqEbGw5Wc7XOw9 T2dQ== 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=IpR0OX8g3mUdqmLj9Ra+ZNABQoZh/usOEdOlFuKrx/s=; fh=vtlcgQ30nO0QjQR7y1Wfn7g9c11A+T6SWcSZ6WixcJI=; b=VorEcWNWjCfxG9HQFKTk+Vj/PbDF4f5M9f6cXmVKyJH3pQt7QOaMEwRp5a/TFNKVuY 6bBkxPw8veDpxVh+tzWIo4oP+s+xslxbQG1CdNvsTfyiAfjpYub8LKrV5U9xf/6N9mK+ Lqe5ql93sp0LKNuHMHBOOXi0sIk+9HAl6nuOvFRv2c9+CLc2APPiHmARSSGvzv1zKp0N cQHXC25UTLJWYgdc3wmCW9ZZ/lJ1AVzd4vcJynhmQTTg87Uja5VS/+F+KkqmzTLecCdC cUa9zDOToMXh+c+lF/UFb7KEfjo2tU8YwFMZP4iH4+uKz4nvpeVhV2BY5azqY7IlFs2R z2+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="TD0Nn/oZ"; 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-81504-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81504-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m10-20020aa7d34a000000b00565864f1abcsi2030557edr.95.2024.02.26.05.41.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 05:41:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81504-ouuuleilei=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="TD0Nn/oZ"; 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-81504-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81504-ouuuleilei=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 19EDE1F21A51 for ; Mon, 26 Feb 2024 13:41:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E40B712BE89; Mon, 26 Feb 2024 13:40:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="TD0Nn/oZ" 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 E20B01292D6; Mon, 26 Feb 2024 13:40:16 +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=1708954819; cv=none; b=BhX3w9XCmHCsQFJiDVv1yqLei7xbNj7qg8h4jEG+cFb3QRpMZ16nj4hN+/T9e1wxZVIeX91rkjI6QRk4f3xghG9oxnpH9NRw6nypaaz7R9lT2lZjYpPpstDQ6FPARcEFgfgE3gdyEbotbOYnBMLkl7dey3JmDK/85y4kNOePf8I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708954819; c=relaxed/simple; bh=AIHy2PbWgD6DBaz3RhgM2aHcbFX0GQl90IKpo1PIZyI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AV12vJfnpYstyiOfgMITYFFb30PYxSYe4MiXHw3yhw6XctnXVSm9RU/3Bp3fOfRgS/6IOK3SMEpZFaD5D4bzEVOoZmwiCrNrPfCNoIs/Gr/uo6G+seEitRwvb7DVpZ06e1XdF3RyYF4IuOcXZqs9IaJY3hocQVPm/K67W+pcOgI= 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=TD0Nn/oZ; 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 Received: by mail.gandi.net (Postfix) with ESMTPSA id 0DADB40004; Mon, 26 Feb 2024 13:40:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708954815; 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=IpR0OX8g3mUdqmLj9Ra+ZNABQoZh/usOEdOlFuKrx/s=; b=TD0Nn/oZow2NuGpCEyoTL9e0Z5w3qYq7/vzO/Euqv2jAeCIeE5RDcTRoNdVO6VkbcPISrF nQuRyOllfmxM5uKXq311RJHx4TW8J0S8lYTpWHwAkO/AopQ7RbMWQ4DXifIAeDnRRybbje KWG5RvdFLwqZ8PEPS4KBHh2FAUTkJjyWPMfw5Txrcv2XRMFU9SJJdV9GpAEqfpzGcyL/Sl sNaTkZutASFwiv7aKYlPAXuP5zqSO0g9jUxEDK6MAvPOkBReahwdXI/+h3AvIAA6zNeLcG jhUS3Rv1xRI9G64B6xNcX/Wx4OXuHcx0mbi0MX3oXBnqmPf8KlqvSfg60l5J+Q== From: Kory Maincent Date: Mon, 26 Feb 2024 14:39:54 +0100 Subject: [PATCH net-next v9 03/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 Message-Id: <20240226-feature_ptp_netnext-v9-3-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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791969104074887464 X-GMAIL-MSGID: 1791969104074887464 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 --- include/linux/netdevice.h | 1 + net/core/dev_ioctl.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7f78aef73fe1..b67727c0dc58 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -4002,6 +4002,7 @@ int generic_hwtstamp_get_lower(struct net_device *dev, int generic_hwtstamp_set_lower(struct net_device *dev, struct kernel_hwtstamp_config *kernel_cfg, struct netlink_ext_ack *extack); +int net_hwtstamp_validate(const struct kernel_hwtstamp_config *cfg); int dev_set_hwtstamp_phylib(struct net_device *dev, struct kernel_hwtstamp_config *cfg, struct netlink_ext_ack *extack); diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c index 5d3b169d8f18..847254fd7f13 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; @@ -238,6 +238,7 @@ static int net_hwtstamp_validate(const struct kernel_hwtstamp_config *cfg) return 0; } +EXPORT_SYMBOL_GPL(net_hwtstamp_validate); static int dev_eth_ioctl(struct net_device *dev, struct ifreq *ifr, unsigned int cmd)