Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37C4DC54E8A for ; Sun, 10 May 2020 19:13:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1458E20801 for ; Sun, 10 May 2020 19:13:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="r/qDylqB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729266AbgEJTM5 (ORCPT ); Sun, 10 May 2020 15:12:57 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:52334 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729113AbgEJTMz (ORCPT ); Sun, 10 May 2020 15:12:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7X/zTmclrXGGFPRHJ5D3x9qKOSu/UEgc104Mbnibgx4=; b=r/qDylqB/R7pTn4r7TbjPgE8w2 K55cFo4c8+gK4dnwiznY4DQMGTOW7jYS/HyqU4n28b8+Far35amiq6mdeooy1rfmuM/XlNyujWSOq gSnNym1eP9F+V5je7R7AfCFYr9BB4qLD5ShKewgZuYi8GEwCbXcyzIVpn8zRQJk5Cjac=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1jXrNc-001jdo-Kp; Sun, 10 May 2020 21:12:52 +0200 From: Andrew Lunn To: David Miller Cc: netdev , Florian Fainelli , Heiner Kallweit , Chris Healy , Michal Kubecek , Andrew Lunn Subject: [PATCH net-next v4 05/10] net: ethtool: Make helpers public Date: Sun, 10 May 2020 21:12:35 +0200 Message-Id: <20200510191240.413699-7-andrew@lunn.ch> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200510191240.413699-1-andrew@lunn.ch> References: <20200510191240.413699-1-andrew@lunn.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Make some helpers for building ethtool netlink messages available outside the compilation unit, so they can be used for building messages which are not simple get/set. Signed-off-by: Andrew Lunn Reviewed-by: Michal Kubecek --- net/ethtool/netlink.c | 4 ++-- net/ethtool/netlink.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c index b9c9ddf408fe..87bc02da74bc 100644 --- a/net/ethtool/netlink.c +++ b/net/ethtool/netlink.c @@ -181,13 +181,13 @@ struct sk_buff *ethnl_reply_init(size_t payload, struct net_device *dev, u8 cmd, return NULL; } -static void *ethnl_bcastmsg_put(struct sk_buff *skb, u8 cmd) +void *ethnl_bcastmsg_put(struct sk_buff *skb, u8 cmd) { return genlmsg_put(skb, 0, ++ethnl_bcast_seq, ðtool_genl_family, 0, cmd); } -static int ethnl_multicast(struct sk_buff *skb, struct net_device *dev) +int ethnl_multicast(struct sk_buff *skb, struct net_device *dev) { return genlmsg_multicast_netns(ðtool_genl_family, dev_net(dev), skb, 0, ETHNL_MCGRP_MONITOR, GFP_KERNEL); diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h index bd7df592db2f..b0eb5d920099 100644 --- a/net/ethtool/netlink.h +++ b/net/ethtool/netlink.h @@ -19,6 +19,8 @@ int ethnl_fill_reply_header(struct sk_buff *skb, struct net_device *dev, struct sk_buff *ethnl_reply_init(size_t payload, struct net_device *dev, u8 cmd, u16 hdr_attrtype, struct genl_info *info, void **ehdrp); +void *ethnl_bcastmsg_put(struct sk_buff *skb, u8 cmd); +int ethnl_multicast(struct sk_buff *skb, struct net_device *dev); /** * ethnl_strz_size() - calculate attribute length for fixed size string -- 2.26.2