aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2007-10-03 20:59:30 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:42 -0400
commit0795af5729b18218767fab27c44b1384f72dc9ad (patch)
tree67c16df84aa6ec219340b8ea1b5cfb0e8150a216 /drivers/net/bonding/bond_main.c
parent95ea36275f3c9a1d3d04c217b4b576c657c4e70e (diff)
[NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()
This is nicer than the MAC_FMT stuff. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index ea58144c220e..8f77db2112ce 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1604,6 +1604,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1604 struct slave *slave, *oldcurrent; 1604 struct slave *slave, *oldcurrent;
1605 struct sockaddr addr; 1605 struct sockaddr addr;
1606 int mac_addr_differ; 1606 int mac_addr_differ;
1607 DECLARE_MAC_BUF(mac);
1607 1608
1608 /* slave is not a slave or master is not master of this slave */ 1609 /* slave is not a slave or master is not master of this slave */
1609 if (!(slave_dev->flags & IFF_SLAVE) || 1610 if (!(slave_dev->flags & IFF_SLAVE) ||
@@ -1631,19 +1632,13 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1631 ETH_ALEN); 1632 ETH_ALEN);
1632 if (!mac_addr_differ && (bond->slave_cnt > 1)) { 1633 if (!mac_addr_differ && (bond->slave_cnt > 1)) {
1633 printk(KERN_WARNING DRV_NAME 1634 printk(KERN_WARNING DRV_NAME
1634 ": %s: Warning: the permanent HWaddr of %s " 1635 ": %s: Warning: the permanent HWaddr of %s - "
1635 "- %02X:%02X:%02X:%02X:%02X:%02X - is " 1636 "%s - is still in use by %s. "
1636 "still in use by %s. Set the HWaddr of " 1637 "Set the HWaddr of %s to a different address "
1637 "%s to a different address to avoid " 1638 "to avoid conflicts.\n",
1638 "conflicts.\n",
1639 bond_dev->name, 1639 bond_dev->name,
1640 slave_dev->name, 1640 slave_dev->name,
1641 slave->perm_hwaddr[0], 1641 print_mac(mac, slave->perm_hwaddr),
1642 slave->perm_hwaddr[1],
1643 slave->perm_hwaddr[2],
1644 slave->perm_hwaddr[3],
1645 slave->perm_hwaddr[4],
1646 slave->perm_hwaddr[5],
1647 bond_dev->name, 1642 bond_dev->name,
1648 slave_dev->name); 1643 slave_dev->name);
1649 } 1644 }
@@ -3006,6 +3001,7 @@ static void bond_info_show_master(struct seq_file *seq)
3006 3001
3007 if (bond->params.mode == BOND_MODE_8023AD) { 3002 if (bond->params.mode == BOND_MODE_8023AD) {
3008 struct ad_info ad_info; 3003 struct ad_info ad_info;
3004 DECLARE_MAC_BUF(mac);
3009 3005
3010 seq_puts(seq, "\n802.3ad info\n"); 3006 seq_puts(seq, "\n802.3ad info\n");
3011 seq_printf(seq, "LACP rate: %s\n", 3007 seq_printf(seq, "LACP rate: %s\n",
@@ -3025,13 +3021,8 @@ static void bond_info_show_master(struct seq_file *seq)
3025 ad_info.actor_key); 3021 ad_info.actor_key);
3026 seq_printf(seq, "\tPartner Key: %d\n", 3022 seq_printf(seq, "\tPartner Key: %d\n",
3027 ad_info.partner_key); 3023 ad_info.partner_key);
3028 seq_printf(seq, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n", 3024 seq_printf(seq, "\tPartner Mac Address: %s\n",
3029 ad_info.partner_system[0], 3025 print_mac(mac, ad_info.partner_system));
3030 ad_info.partner_system[1],
3031 ad_info.partner_system[2],
3032 ad_info.partner_system[3],
3033 ad_info.partner_system[4],
3034 ad_info.partner_system[5]);
3035 } 3026 }
3036 } 3027 }
3037} 3028}
@@ -3039,6 +3030,7 @@ static void bond_info_show_master(struct seq_file *seq)
3039static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave) 3030static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave)
3040{ 3031{
3041 struct bonding *bond = seq->private; 3032 struct bonding *bond = seq->private;
3033 DECLARE_MAC_BUF(mac);
3042 3034
3043 seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); 3035 seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
3044 seq_printf(seq, "MII Status: %s\n", 3036 seq_printf(seq, "MII Status: %s\n",
@@ -3047,10 +3039,8 @@ static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave
3047 slave->link_failure_count); 3039 slave->link_failure_count);
3048 3040
3049 seq_printf(seq, 3041 seq_printf(seq,
3050 "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n", 3042 "Permanent HW addr: %s\n",
3051 slave->perm_hwaddr[0], slave->perm_hwaddr[1], 3043 print_mac(mac, slave->perm_hwaddr));
3052 slave->perm_hwaddr[2], slave->perm_hwaddr[3],
3053 slave->perm_hwaddr[4], slave->perm_hwaddr[5]);
3054 3044
3055 if (bond->params.mode == BOND_MODE_8023AD) { 3045 if (bond->params.mode == BOND_MODE_8023AD) {
3056 const struct aggregator *agg 3046 const struct aggregator *agg