From nobody Mon Nov 25 05:54:42 2024 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (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 34F3D2194B6; Wed, 30 Oct 2024 16:54:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730307247; cv=none; b=bnKgTbMwVOCRW245XrZVg+RkiTiqtvaCLrK9B6KPCtdJEP9lDHQliCWopFxDhIpCDS5T/zvg5Kws+gNZjkoFsIq9IC+hiOh0ZSk+6FnGDXPUQpxMbGlSUK9zraPudi/6jGv2KO7/C91mBAhnX43mA3mFkEGijmeO7j3GHvZOJrQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730307247; c=relaxed/simple; bh=qJBUkU3lnCPyJtAe5siX0vwXVqtlZrqUtYudqoaYZAU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pC5gk7grNWITDBL8mPhjfxx3A/dgpSe37L2G+/946VKgZEG0sIZtjYFrUU3Notgi/SPjGyFyMqLDXt3qfYeJPQ2JvT/njbM74uuU4XWDsd9BpuCRV1aht9QpB4PwKSxrlzPnaF6M7u+JEEltjWlGCQFQLHs9FUHkFLewRd3LNNQ= 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=SW7mrQCp; arc=none smtp.client-ip=217.70.183.198 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="SW7mrQCp" Received: by mail.gandi.net (Postfix) with ESMTPSA id 65166C000F; Wed, 30 Oct 2024 16:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1730307241; 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=G/Vy6U/BZ9R4PCxWYE8hyZM9z4zw6/kCUK4+VjKfrOk=; b=SW7mrQCppFLI9apW/NT2RNEklkyU13vHb1pVg4+QuxaRpxFoCLq89Io9Uo0I6TW+ls9U0u vf0rIJ9XeiY6XjPcZJ0AvOr1B0cirZijnZ+Y9YPixD5UnCUmrTgxbGwnvqLkC0ZNkgMqhD sithP+gQJlShGNd5D3UI8JV7pGPCc55VOQWkG71jSM2Z3jiPQ4eSVHdvhfgzY8cELzl3iv LnMaP5lz2cx7U/wyOchOiCXtGXpva3KU6UBdgYtfcFZ/coRxuRe1nlRQwMB6iCFBFgQXNP LpV2DLZcUEfF+x1+pl/jdsXr9rUa+iN18k85w6xkmxYJoXi8Nr2xsR8gQpAsRw== From: Kory Maincent Date: Wed, 30 Oct 2024 17:53:09 +0100 Subject: [PATCH RFC net-next v2 07/18] net: ethtool: Add support for ethnl_info_init_ntf helper function 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: quoted-printable Message-Id: <20241030-feature_poe_port_prio-v2-7-9559622ee47a@bootlin.com> References: <20241030-feature_poe_port_prio-v2-0-9559622ee47a@bootlin.com> In-Reply-To: <20241030-feature_poe_port_prio-v2-0-9559622ee47a@bootlin.com> To: Andrew Lunn , Oleksij Rempel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Donald Hunter , Rob Herring , Andrew Lunn , Simon Horman , Heiner Kallweit , Russell King , Liam Girdwood , Mark Brown Cc: Thomas Petazzoni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org, Kyle Swenson , Dent Project , kernel@pengutronix.de, Maxime Chevallier , Kory Maincent X-Mailer: b4 0.15-dev-8cb71 X-GND-Sasl: kory.maincent@bootlin.com From: Kory Maincent (Dent Project) Introduce support for the ethnl_info_init_ntf helper function to enable initialization of ethtool notifications outside of the netlink.c file. This change allows for more flexible notification handling. Signed-off-by: Kory Maincent --- changes in v2: - new patch. --- net/ethtool/netlink.c | 5 +++++ net/ethtool/netlink.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c index e3f0ef6b851b..808cc8096f93 100644 --- a/net/ethtool/netlink.c +++ b/net/ethtool/netlink.c @@ -805,6 +805,11 @@ static void ethnl_default_notify(struct net_device *de= v, unsigned int cmd, typedef void (*ethnl_notify_handler_t)(struct net_device *dev, unsigned in= t cmd, const void *data); =20 +void ethnl_info_init_ntf(struct genl_info *info, u8 cmd) +{ + genl_info_init_ntf(info, ðtool_genl_family, cmd); +} + static const ethnl_notify_handler_t ethnl_notify_handlers[] =3D { [ETHTOOL_MSG_LINKINFO_NTF] =3D ethnl_default_notify, [ETHTOOL_MSG_LINKMODES_NTF] =3D ethnl_default_notify, diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h index 203b08eb6c6f..d04a8e9d54db 100644 --- a/net/ethtool/netlink.h +++ b/net/ethtool/netlink.h @@ -322,6 +322,8 @@ struct ethnl_sock_priv { int ethnl_sock_priv_set(struct sk_buff *skb, struct net_device *dev, u32 p= ortid, enum ethnl_sock_type type); =20 +void ethnl_info_init_ntf(struct genl_info *info, u8 cmd); + /** * struct ethnl_request_ops - unified handling of GET and SET requests * @request_cmd: command id for request (GET) --=20 2.34.1