Thread (14 messages) 14 messages, 4 authors, 2011-01-11

[PATCH 2/3] net/dummy: add device group parameter

flat view
STALE5758d SUPERSEDED

From: Vlad Dogaru <hidden>
Date: 2011-01-10 11:38:55
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Revision v1 of 3 in this series.

Revisions (3)
  1. v1 current
  2. v2 [diff vs current]
  3. v3 [diff vs current]
When inserting the dummy module, the user can specify the group of the
dummy devices. This avoids manually moving the newly created pseudo
devices to a different group.

Signed-off-by: Vlad Dogaru <redacted>
---
 drivers/net/dummy.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index ff2d29b..a974c05 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -39,6 +39,7 @@
 #include <linux/u64_stats_sync.h>
 
 static int numdummies = 1;
+static int ingroup;
 
 static int dummy_set_address(struct net_device *dev, void *p)
 {
@@ -158,6 +159,9 @@ static struct rtnl_link_ops dummy_link_ops __read_mostly = {
 /* Number of dummy devices to be set up by this module. */
 module_param(numdummies, int, 0);
 MODULE_PARM_DESC(numdummies, "Number of dummy pseudo devices");
+/* Group to add the dummy devices to. */
+module_param(ingroup, int, 0);
+MODULE_PARM_DESC(ingroup, "Group the dummy devices belong to");
 
 static int __init dummy_init_one(void)
 {
@@ -167,6 +171,7 @@ static int __init dummy_init_one(void)
 	dev_dummy = alloc_netdev(0, "dummy%d", dummy_setup);
 	if (!dev_dummy)
 		return -ENOMEM;
+	dev_set_group(dev_dummy, ingroup);
 
 	err = dev_alloc_name(dev_dummy, dev_dummy->name);
 	if (err < 0)
-- 
1.7.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help