From patchwork Fri Sep 18 19:11:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 1367212 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lunn.ch Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BtNjZ4Nbfz9sSC for ; Sat, 19 Sep 2020 05:11:30 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726174AbgIRTL2 (ORCPT ); Fri, 18 Sep 2020 15:11:28 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:44180 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726115AbgIRTL2 (ORCPT ); Fri, 18 Sep 2020 15:11:28 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kJLn1-00FH91-PY; Fri, 18 Sep 2020 21:11:23 +0200 From: Andrew Lunn To: David Miller Cc: netdev , Chris Healy , Florian Fainelli , Jiri Pirko , Vladimir Oltean , Andrew Lunn Subject: [PATCH net-next v4 1/9] net: devlink: regions: Add a priv member to the regions ops struct Date: Fri, 18 Sep 2020 21:11:01 +0200 Message-Id: <20200918191109.3640779-2-andrew@lunn.ch> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200918191109.3640779-1-andrew@lunn.ch> References: <20200918191109.3640779-1-andrew@lunn.ch> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The driver may have multiple regions which can be dumped using one function. However, for this to work, additional information is needed. Add a priv member to the ops structure for the driver to use however it likes. Reviewed-by: Florian Fainelli Signed-off-by: Andrew Lunn --- include/net/devlink.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/net/devlink.h b/include/net/devlink.h index 48b1c1ef1ebd..c83cb6ceff78 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -542,12 +542,14 @@ struct devlink_info_req; * the data variable must be updated to point to the snapshot data. * The function will be called while the devlink instance lock is * held. + * @priv: Pointer to driver private data for the region operation */ struct devlink_region_ops { const char *name; void (*destructor)(const void *data); int (*snapshot)(struct devlink *devlink, struct netlink_ext_ack *extack, u8 **data); + void *priv; }; struct devlink_fmsg;