summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJay Vosburgh <fubar@us.ibm.com>2008-06-14 03:12:04 +0200
committerJeff Garzik <jgarzik@redhat.com>2008-06-18 06:00:04 +0200
commitb8a9787eddb0e4665f31dd1d64584732b2b5d051 (patch)
tree08b7537e70b6a96bc04d231d31ccd644e1387e62 /net
parentbonding: Rework / fix multiple gratuitous ARP support (diff)
downloadlinux-b8a9787eddb0e4665f31dd1d64584732b2b5d051.tar.xz
linux-b8a9787eddb0e4665f31dd1d64584732b2b5d051.zip
bonding: Allow setting max_bonds to zero
Permit bonding to function rationally if max_bonds is set to zero. This will load the module, but create no master devices (which can be created via sysfs). Requires some change to bond_create_sysfs; currently, the netdev sysfs directory is determined from the first bonding device created, but this is no longer possible. Instead, an interface from net/core is created to create and destroy files in net_class. Based on a patch submitted by Phil Oester <kernel@linuxaces.com>. Modified by Jay Vosburgh to fix the sysfs issue mentioned above and to update the documentation. Signed-off-by: Phil Oester <kernel@linuxace.com> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/core/net-sysfs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index dccd737ea2e3..3f7941319217 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -468,6 +468,19 @@ int netdev_register_kobject(struct net_device *net)
return device_add(dev);
}
+int netdev_class_create_file(struct class_attribute *class_attr)
+{
+ return class_create_file(&net_class, class_attr);
+}
+
+void netdev_class_remove_file(struct class_attribute *class_attr)
+{
+ class_remove_file(&net_class, class_attr);
+}
+
+EXPORT_SYMBOL(netdev_class_create_file);
+EXPORT_SYMBOL(netdev_class_remove_file);
+
void netdev_initialize_kobject(struct net_device *net)
{
struct device *device = &(net->dev);