Received: by 2002:a05:7208:2202:b0:86:316c:7444 with SMTP id s2csp2375787rbb; Tue, 4 Jun 2024 03:41:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1hHCFfmssTBBI59eC6kVRd1H9R3UYb1xxXLts+gFX7l5csYtV6OH8petWxNgDW+XDwDlVRAZlPRrGtoJP79iUaCPrFS+BEgwiuiX92A== X-Google-Smtp-Source: AGHT+IFhR3IsoHeI8262ChvLP7DMNHty9z5oOVuFeh2FPkS566ji5+acGy8wjx10sL7TzABNx7M6 X-Received: by 2002:a50:9fe6:0:b0:578:635d:67ba with SMTP id 4fb4d7f45d1cf-57a7a6f10aemr1820360a12.18.1717497684417; Tue, 04 Jun 2024 03:41:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717497684; cv=pass; d=google.com; s=arc-20160816; b=PBYrysV0Z17xOvL8zhjxGdt2RVZu7rwWjl8p1sa6p3qwyCblphXhxkK4X8P39YvIPN mBC/dR0dUiwWFU2Y0jWkfn0DMWE080JC4I2shXO5sawT+tui+uxHhUG+xm4n73/IxmdI 3XKAIdbU/wTbW1VIRo1UVsJ9gxS6NsXqJ+grdHxc0BonucH/yYCUSLWatYqQ+7L2cYfD DMFv8Ua3bNkTVF2gH9uJes4SCfhfeI2CFAQeAzhBmGO5srXiCPsoiImv/UtjqjTDkrI+ C/pAAsrn/KfgeURDJreoeSm1qJ9z5Uwnyo702oIootZ/nihir5EGK7LlUOeK35xDltZp Q7zQ== 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=eOA3B87nZU3YWkrcZJgl29h83OwNnPmt7CL+WT4CWUPyVdE/tAnV2mCew+vVAqnZ2S /Jvy9NQNtRDoQkHcB8+w6Xpc4UYXMboLJm3usBAcPCxjTrI9nXBviQuaw07sEJYzWvhg IVG5nIZVF2BcF/0BK8m5CWjKyJQOikXE4duahKLg6eytMOVDIZpKmV0uKCfrRW4y70Gd feh1yOZqh9kXJiUngcJm+LfChgLsoJ3ZjA3sdJYSRWCtYVFLI3hrraYWn1WeYn0yAw0g 5t4PwHAiqw1RV6XUCD5EU9nuxvuby2z8ud2m1+Y1KYELmdye0IW79fn+1MFcWBpzJUJE BgTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZJdpOSfa; 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-200436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200436-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 4fb4d7f45d1cf-57a31cc9497si4935974a12.634.2024.06.04.03.41.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 03:41:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200436-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=ZJdpOSfa; 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-200436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200436-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 2B9111F235C3 for ; Tue, 4 Jun 2024 10:41:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 067C1145B36; Tue, 4 Jun 2024 10:40:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="ZJdpOSfa" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (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 2EED7145A16; Tue, 4 Jun 2024 10:40:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717497606; cv=none; b=EYwJGtROYyixNF3bAXxIWNn4Tg+FAnlxdr73/ajzwduyK5GaclXAzwV71M3NSQ8nm74Kx3puZkjujjhwg5ojLHdGXZk+jRLrTs8LrwS3Jy7z5LofmUBQeSt4EfKZcFhWjPV3CYSVpf0dFcZr13DYLIaGTRrvnibbBMG4ulWLc6Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717497606; c=relaxed/simple; bh=gnOJv3IJnG4MxVBS3Rs8JRq/t9ZNB4Rqjtb6Bc5CGuo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ojxOzeiF8alQVMuR1RMMNW6nFknHmp5OGg4HDLwhfYmCCYgO6V4VuYsPlnkhAhnDX4h+lkjWahHdMrhCVQRO5lrnUmk7eqkjdHrvD5qGHDuz9MjuowK89QScYb/gCedWT8zXm55WIRavl458k6gdyVTBYNQnpL8z5lqOmNVg4Ek= 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=ZJdpOSfa; arc=none smtp.client-ip=217.70.183.201 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 7CF281BF208; Tue, 4 Jun 2024 10:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1717497602; 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=ZJdpOSfaOOQsTRGvNxcMI2i0S/42mRWoI3raqP8sFlPTDlfgxftpm03kNXrxQCstGfS7Pr FXBeqBMZkjAmp1WlIKCQQmDkbx7EQxZM8RFW4JwKG8Wf1ij7OM9ppa9Q6ZCh75YVqvtakv 3cN/ul3G8tKdmdxMwjKJpuqfyGVBIidFNgKa22qOJA2R6wVV4Y9Ifiik11AtW2wSUN143p Dm8E0QhZzBQQtx2b3lX3/9mAwpwYRNkFSxltlnDp5iUB+gk9BKA6ovxqDBAk6P/W0hTcCH kl1bqSkTbFWRNDq88H3+fGTcAiwSAvWMMhpheRJSThUbtQynxCYy+jKZkflGAg== From: Kory Maincent Date: Tue, 04 Jun 2024 12:39:39 +0200 Subject: [PATCH net-next v14 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: <20240604-feature_ptp_netnext-v14-4-77b6f6efea40@bootlin.com> References: <20240604-feature_ptp_netnext-v14-0-77b6f6efea40@bootlin.com> In-Reply-To: <20240604-feature_ptp_netnext-v14-0-77b6f6efea40@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