diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 22:21:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 22:21:56 -0500 |
commit | 7677ced48e2bbbb8d847d34f37e5d96d2b0e41e4 (patch) | |
tree | 0a859f403c02eb854d9ffa11bd17f77056891d07 /drivers/net/bonding | |
parent | 21d37bbc65e39a26856de6b14be371ff24e0d03f (diff) | |
parent | ac38dfc39e7684f55174742e5f0d6c5a0093bbf6 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (116 commits)
sk98lin: planned removal
AT91: MACB support
sky2: version 1.12
sky2: add new chip ids
sky2: Yukon Extreme support
sky2: safer transmit timeout
sky2: TSO support for EC_U
sky2: use dev_err for error reports
sky2: add Wake On Lan support
fix unaligned exception in /drivers/net/wireless/orinoco.c
Remove unused kernel config option DLCI_COUNT
z85230: spinlock logic
mips: declance: Driver model for the PMAD-A
Spidernet: Rework RX linked list
NET: turn local_save_flags() + local_irq_disable() into local_irq_save()
NET-3c59x: turn local_save_flags() + local_irq_disable() into local_irq_save()
hp100: convert pci_module_init() to pci_register_driver()
NetXen: Added ethtool support for user level tools.
NetXen: Firmware crb init changes.
maintainers: add atl1 maintainers
...
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 23 | ||||
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 15 | ||||
-rw-r--r-- | drivers/net/bonding/bonding.h | 9 |
3 files changed, 37 insertions, 10 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 6482aed4bb..d3801a00d3 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -4704,6 +4704,7 @@ static int bond_check_params(struct bond_params *params) | |||
4704 | static struct lock_class_key bonding_netdev_xmit_lock_key; | 4704 | static struct lock_class_key bonding_netdev_xmit_lock_key; |
4705 | 4705 | ||
4706 | /* Create a new bond based on the specified name and bonding parameters. | 4706 | /* Create a new bond based on the specified name and bonding parameters. |
4707 | * If name is NULL, obtain a suitable "bond%d" name for us. | ||
4707 | * Caller must NOT hold rtnl_lock; we need to release it here before we | 4708 | * Caller must NOT hold rtnl_lock; we need to release it here before we |
4708 | * set up our sysfs entries. | 4709 | * set up our sysfs entries. |
4709 | */ | 4710 | */ |
@@ -4713,7 +4714,8 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond | |||
4713 | int res; | 4714 | int res; |
4714 | 4715 | ||
4715 | rtnl_lock(); | 4716 | rtnl_lock(); |
4716 | bond_dev = alloc_netdev(sizeof(struct bonding), name, ether_setup); | 4717 | bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "", |
4718 | ether_setup); | ||
4717 | if (!bond_dev) { | 4719 | if (!bond_dev) { |
4718 | printk(KERN_ERR DRV_NAME | 4720 | printk(KERN_ERR DRV_NAME |
4719 | ": %s: eek! can't alloc netdev!\n", | 4721 | ": %s: eek! can't alloc netdev!\n", |
@@ -4722,6 +4724,12 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond | |||
4722 | goto out_rtnl; | 4724 | goto out_rtnl; |
4723 | } | 4725 | } |
4724 | 4726 | ||
4727 | if (!name) { | ||
4728 | res = dev_alloc_name(bond_dev, "bond%d"); | ||
4729 | if (res < 0) | ||
4730 | goto out_netdev; | ||
4731 | } | ||
4732 | |||
4725 | /* bond_init() must be called after dev_alloc_name() (for the | 4733 | /* bond_init() must be called after dev_alloc_name() (for the |
4726 | * /proc files), but before register_netdevice(), because we | 4734 | * /proc files), but before register_netdevice(), because we |
4727 | * need to set function pointers. | 4735 | * need to set function pointers. |
@@ -4748,14 +4756,19 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond | |||
4748 | 4756 | ||
4749 | rtnl_unlock(); /* allows sysfs registration of net device */ | 4757 | rtnl_unlock(); /* allows sysfs registration of net device */ |
4750 | res = bond_create_sysfs_entry(bond_dev->priv); | 4758 | res = bond_create_sysfs_entry(bond_dev->priv); |
4751 | goto done; | 4759 | if (res < 0) { |
4760 | rtnl_lock(); | ||
4761 | goto out_bond; | ||
4762 | } | ||
4763 | |||
4764 | return 0; | ||
4765 | |||
4752 | out_bond: | 4766 | out_bond: |
4753 | bond_deinit(bond_dev); | 4767 | bond_deinit(bond_dev); |
4754 | out_netdev: | 4768 | out_netdev: |
4755 | free_netdev(bond_dev); | 4769 | free_netdev(bond_dev); |
4756 | out_rtnl: | 4770 | out_rtnl: |
4757 | rtnl_unlock(); | 4771 | rtnl_unlock(); |
4758 | done: | ||
4759 | return res; | 4772 | return res; |
4760 | } | 4773 | } |
4761 | 4774 | ||
@@ -4763,7 +4776,6 @@ static int __init bonding_init(void) | |||
4763 | { | 4776 | { |
4764 | int i; | 4777 | int i; |
4765 | int res; | 4778 | int res; |
4766 | char new_bond_name[8]; /* Enough room for 999 bonds at init. */ | ||
4767 | 4779 | ||
4768 | printk(KERN_INFO "%s", version); | 4780 | printk(KERN_INFO "%s", version); |
4769 | 4781 | ||
@@ -4776,8 +4788,7 @@ static int __init bonding_init(void) | |||
4776 | bond_create_proc_dir(); | 4788 | bond_create_proc_dir(); |
4777 | #endif | 4789 | #endif |
4778 | for (i = 0; i < max_bonds; i++) { | 4790 | for (i = 0; i < max_bonds; i++) { |
4779 | sprintf(new_bond_name, "bond%d",i); | 4791 | res = bond_create(NULL, &bonding_defaults, NULL); |
4780 | res = bond_create(new_bond_name,&bonding_defaults, NULL); | ||
4781 | if (res) | 4792 | if (res) |
4782 | goto err; | 4793 | goto err; |
4783 | } | 4794 | } |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index ced9ed8f99..8e317e1155 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -1372,6 +1372,21 @@ int bond_create_sysfs(void) | |||
1372 | return -ENODEV; | 1372 | return -ENODEV; |
1373 | 1373 | ||
1374 | ret = class_create_file(netdev_class, &class_attr_bonding_masters); | 1374 | ret = class_create_file(netdev_class, &class_attr_bonding_masters); |
1375 | /* | ||
1376 | * Permit multiple loads of the module by ignoring failures to | ||
1377 | * create the bonding_masters sysfs file. Bonding devices | ||
1378 | * created by second or subsequent loads of the module will | ||
1379 | * not be listed in, or controllable by, bonding_masters, but | ||
1380 | * will have the usual "bonding" sysfs directory. | ||
1381 | * | ||
1382 | * This is done to preserve backwards compatibility for | ||
1383 | * initscripts/sysconfig, which load bonding multiple times to | ||
1384 | * configure multiple bonding devices. | ||
1385 | */ | ||
1386 | if (ret == -EEXIST) { | ||
1387 | netdev_class = NULL; | ||
1388 | return 0; | ||
1389 | } | ||
1375 | 1390 | ||
1376 | return ret; | 1391 | return ret; |
1377 | 1392 | ||
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 0978c9ac6d..41aa78bf1f 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -22,8 +22,8 @@ | |||
22 | #include "bond_3ad.h" | 22 | #include "bond_3ad.h" |
23 | #include "bond_alb.h" | 23 | #include "bond_alb.h" |
24 | 24 | ||
25 | #define DRV_VERSION "3.1.1" | 25 | #define DRV_VERSION "3.1.2" |
26 | #define DRV_RELDATE "September 26, 2006" | 26 | #define DRV_RELDATE "January 20, 2007" |
27 | #define DRV_NAME "bonding" | 27 | #define DRV_NAME "bonding" |
28 | #define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" | 28 | #define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" |
29 | 29 | ||
@@ -237,12 +237,13 @@ static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) | |||
237 | #define BOND_ARP_VALIDATE_ALL (BOND_ARP_VALIDATE_ACTIVE | \ | 237 | #define BOND_ARP_VALIDATE_ALL (BOND_ARP_VALIDATE_ACTIVE | \ |
238 | BOND_ARP_VALIDATE_BACKUP) | 238 | BOND_ARP_VALIDATE_BACKUP) |
239 | 239 | ||
240 | extern inline int slave_do_arp_validate(struct bonding *bond, struct slave *slave) | 240 | static inline int slave_do_arp_validate(struct bonding *bond, |
241 | struct slave *slave) | ||
241 | { | 242 | { |
242 | return bond->params.arp_validate & (1 << slave->state); | 243 | return bond->params.arp_validate & (1 << slave->state); |
243 | } | 244 | } |
244 | 245 | ||
245 | extern inline unsigned long slave_last_rx(struct bonding *bond, | 246 | static inline unsigned long slave_last_rx(struct bonding *bond, |
246 | struct slave *slave) | 247 | struct slave *slave) |
247 | { | 248 | { |
248 | if (slave_do_arp_validate(bond, slave)) | 249 | if (slave_do_arp_validate(bond, slave)) |