From patchwork Wed Jan 30 09:43:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Burman X-Patchwork-Id: 216800 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B6ED92C008E for ; Wed, 30 Jan 2013 20:43:20 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754241Ab3A3JnR (ORCPT ); Wed, 30 Jan 2013 04:43:17 -0500 Received: from eu1sys200aog120.obsmtp.com ([207.126.144.149]:56291 "HELO eu1sys200aog120.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754183Ab3A3JnP (ORCPT ); Wed, 30 Jan 2013 04:43:15 -0500 Received: from mtlsws123.lab.mtl.com ([82.166.227.17]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKUQjrL65+NFvzh760wU+Fivnn62aARbC4@postini.com; Wed, 30 Jan 2013 09:43:14 UTC Received: from r-vnc09.mtr.labs.mlnx (r-vnc09.mtr.labs.mlnx [10.208.0.120]) by mtlsws123.lab.mtl.com (8.13.8/8.13.8) with ESMTP id r0U9i7eV029515; Wed, 30 Jan 2013 11:44:07 +0200 From: Yan Burman To: netdev@vger.kernel.org, shemminger@vyatta.com Cc: Yan Burman Subject: [PATCH net-next] net/vxlan: Add ethtool drvinfo Date: Wed, 30 Jan 2013 11:43:07 +0200 Message-Id: <1359538987-17659-1-git-send-email-yanb@mellanox.com> X-Mailer: git-send-email 1.7.10.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Implement ethtool get_drvinfo. Signed-off-by: Yan Burman --- drivers/net/vxlan.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 656230e..72485b9 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -1271,6 +1272,18 @@ static int vxlan_validate(struct nlattr *tb[], struct nlattr *data[]) return 0; } +static void vxlan_get_drvinfo(struct net_device *netdev, + struct ethtool_drvinfo *drvinfo) +{ + strlcpy(drvinfo->version, VXLAN_VERSION, sizeof(drvinfo->version)); + strlcpy(drvinfo->driver, "vxlan", sizeof(drvinfo->driver)); +} + +static const struct ethtool_ops vxlan_ethtool_ops = { + .get_drvinfo = vxlan_get_drvinfo, + .get_link = ethtool_op_get_link, +}; + static int vxlan_newlink(struct net *net, struct net_device *dev, struct nlattr *tb[], struct nlattr *data[]) { @@ -1348,6 +1361,8 @@ static int vxlan_newlink(struct net *net, struct net_device *dev, vxlan->port_max = ntohs(p->high); } + SET_ETHTOOL_OPS(dev, &vxlan_ethtool_ops); + err = register_netdevice(dev); if (!err) hlist_add_head_rcu(&vxlan->hlist, vni_head(net, vxlan->vni));