* [PATCH] dummy: add support for ethtool get_drvinfo
@ 2014-12-06 0:13 Flavio Leitner
2014-12-09 21:07 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Flavio Leitner @ 2014-12-06 0:13 UTC (permalink / raw)
To: netdev; +Cc: Flavio Leitner
The command 'ethtool -i' is useful to find details
about the interface like the device driver being used.
This was missing for dummy driver.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
---
drivers/net/dummy.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index ff435fb..413ca4f 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -38,6 +38,9 @@
#include <net/rtnetlink.h>
#include <linux/u64_stats_sync.h>
+#define DRV_NAME "dummy"
+#define DRV_VERSION "1.0"
+
static int numdummies = 1;
/* fake multicast ability */
@@ -120,12 +123,24 @@ static const struct net_device_ops dummy_netdev_ops = {
.ndo_change_carrier = dummy_change_carrier,
};
+static void dummy_get_drvinfo(struct net_device *dev,
+ struct ethtool_drvinfo *info)
+{
+ strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
+ strlcpy(info->version, DRV_VERSION, sizeof(info->version));
+}
+
+static const struct ethtool_ops dummy_ethtool_ops = {
+ .get_drvinfo = dummy_get_drvinfo,
+};
+
static void dummy_setup(struct net_device *dev)
{
ether_setup(dev);
/* Initialize the device structure. */
dev->netdev_ops = &dummy_netdev_ops;
+ dev->ethtool_ops = &dummy_ethtool_ops;
dev->destructor = free_netdev;
/* Fill in device structure with ethernet-generic values. */
@@ -150,7 +165,7 @@ static int dummy_validate(struct nlattr *tb[], struct nlattr *data[])
}
static struct rtnl_link_ops dummy_link_ops __read_mostly = {
- .kind = "dummy",
+ .kind = DRV_NAME,
.setup = dummy_setup,
.validate = dummy_validate,
};
@@ -209,4 +224,4 @@ static void __exit dummy_cleanup_module(void)
module_init(dummy_init_module);
module_exit(dummy_cleanup_module);
MODULE_LICENSE("GPL");
-MODULE_ALIAS_RTNL_LINK("dummy");
+MODULE_ALIAS_RTNL_LINK(DRV_NAME);
--
1.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] dummy: add support for ethtool get_drvinfo
2014-12-06 0:13 [PATCH] dummy: add support for ethtool get_drvinfo Flavio Leitner
@ 2014-12-09 21:07 ` David Miller
2014-12-10 0:44 ` Flavio Leitner
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2014-12-09 21:07 UTC (permalink / raw)
To: fbl; +Cc: netdev
From: Flavio Leitner <fbl@redhat.com>
Date: Fri, 5 Dec 2014 22:13:24 -0200
> The command 'ethtool -i' is useful to find details
> about the interface like the device driver being used.
> This was missing for dummy driver.
>
> Signed-off-by: Flavio Leitner <fbl@redhat.com>
Applied, thank you.
Consider adding a MODULE_VERSION instance since you've added an
explicit version.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dummy: add support for ethtool get_drvinfo
2014-12-09 21:07 ` David Miller
@ 2014-12-10 0:44 ` Flavio Leitner
0 siblings, 0 replies; 3+ messages in thread
From: Flavio Leitner @ 2014-12-10 0:44 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On Tue, Dec 09, 2014 at 04:07:26PM -0500, David Miller wrote:
> From: Flavio Leitner <fbl@redhat.com>
> Date: Fri, 5 Dec 2014 22:13:24 -0200
>
> > The command 'ethtool -i' is useful to find details
> > about the interface like the device driver being used.
> > This was missing for dummy driver.
> >
> > Signed-off-by: Flavio Leitner <fbl@redhat.com>
>
> Applied, thank you.
>
> Consider adding a MODULE_VERSION instance since you've added an
> explicit version.
Done, patch sent:
[net-next] dummy: use MODULE_VERSION
fbl
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-10 0:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-06 0:13 [PATCH] dummy: add support for ethtool get_drvinfo Flavio Leitner
2014-12-09 21:07 ` David Miller
2014-12-10 0:44 ` Flavio Leitner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox