patch-2.4.3 linux/drivers/net/bonding.c

Next file: linux/drivers/net/cs89x0.c
Previous file: linux/drivers/net/atp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/drivers/net/bonding.c linux/drivers/net/bonding.c
@@ -60,12 +60,6 @@
 
 static struct net_device *this_bond;
 
-static int bond_open(struct net_device *dev)
-{
-	MOD_INC_USE_COUNT;
-	return 0;
-}
-
 static void release_one_slave(struct net_device *master, slave_t *slave)
 {
 	bonding_t *bond = master->priv;
@@ -81,7 +75,6 @@
 
 	dev_put(slave->dev);
 	kfree(slave);
-	MOD_DEC_USE_COUNT;
 }
 
 static int bond_close(struct net_device *master)
@@ -92,21 +85,11 @@
 	while ((slave = bond->next) != (slave_t*)bond)
 		release_one_slave(master, slave);
 
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
 static void bond_set_multicast_list(struct net_device *master)
 {
-	bonding_t *bond = master->priv;
-	slave_t *slave;
-
-	for (slave = bond->next; slave != (slave_t*)bond; slave = slave->next) {
-		slave->dev->mc_list = master->mc_list;
-		slave->dev->mc_count = master->mc_count;
-		slave->dev->flags = master->flags;
-		slave->dev->set_multicast_list(slave->dev);
-	}
 }
 
 static int bond_enslave(struct net_device *master, struct net_device *dev)
@@ -142,7 +125,6 @@
 
 	spin_unlock_bh(&master->xmit_lock);
 
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
@@ -210,9 +192,7 @@
 }
 
 static struct notifier_block bond_netdev_notifier={
-	bond_event,
-	NULL,
-	0
+	notifier_call: bond_event 
 };
 
 static int __init bond_init(struct net_device *dev)
@@ -233,7 +213,6 @@
 	/* Initialize the device structure. */
 	dev->hard_start_xmit = bond_xmit;
 	dev->get_stats	= bond_get_stats;
-	dev->open = bond_open;
 	dev->stop = bond_close;
 	dev->set_multicast_list = bond_set_multicast_list;
 	dev->do_ioctl = bond_ioctl;
@@ -289,20 +268,20 @@
 	return &bond->stats;
 }
 
-static struct net_device dev_bond = {
-		"",
-		0, 0, 0, 0,
-	 	0x0, 0,
-	 	0, 0, 0, NULL, bond_init };
+static struct net_device dev_bond;
 
 static int __init bonding_init(void)
 {
 	/* Find a name for this unit */
-	int err=dev_alloc_name(&dev_bond,"bond%d");
+	int err;
+	
+	dev_bond.init = bond_init;
 
+	err = dev_alloc_name(&dev_bond,"bond%d");
 	if (err<0)
 		return err;
 
+	SET_MODULE_OWNER(&dev_bond);
 	if (register_netdev(&dev_bond) != 0)
 		return -EIO;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)