diff options
author | Joe Perches <joe@perches.com> | 2007-10-03 20:59:30 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:42 -0400 |
commit | 0795af5729b18218767fab27c44b1384f72dc9ad (patch) | |
tree | 67c16df84aa6ec219340b8ea1b5cfb0e8150a216 /drivers/net/tokenring/madgemc.c | |
parent | 95ea36275f3c9a1d3d04c217b4b576c657c4e70e (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/tokenring/madgemc.c')
-rw-r--r-- | drivers/net/tokenring/madgemc.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c index d0ce2ce675d5..5a4151362fc0 100644 --- a/drivers/net/tokenring/madgemc.c +++ b/drivers/net/tokenring/madgemc.c | |||
@@ -151,7 +151,8 @@ static int __devinit madgemc_probe(struct device *device) | |||
151 | struct net_local *tp; | 151 | struct net_local *tp; |
152 | struct card_info *card; | 152 | struct card_info *card; |
153 | struct mca_device *mdev = to_mca_device(device); | 153 | struct mca_device *mdev = to_mca_device(device); |
154 | int ret = 0, i = 0; | 154 | int ret = 0; |
155 | DECLARE_MAC_BUF(mac); | ||
155 | 156 | ||
156 | if (versionprinted++ == 0) | 157 | if (versionprinted++ == 0) |
157 | printk("%s", version); | 158 | printk("%s", version); |
@@ -322,11 +323,8 @@ static int __devinit madgemc_probe(struct device *device) | |||
322 | mca_device_set_name(mdev, (card->cardtype == 0x08)?MADGEMC16_CARDNAME:MADGEMC32_CARDNAME); | 323 | mca_device_set_name(mdev, (card->cardtype == 0x08)?MADGEMC16_CARDNAME:MADGEMC32_CARDNAME); |
323 | mca_set_adapter_procfn(mdev->slot, madgemc_mcaproc, dev); | 324 | mca_set_adapter_procfn(mdev->slot, madgemc_mcaproc, dev); |
324 | 325 | ||
325 | printk("%s: Ring Station Address: ", dev->name); | 326 | printk("%s: Ring Station Address: %s\n", |
326 | printk("%2.2x", dev->dev_addr[0]); | 327 | dev->name, print_mac(mac, dev->dev_addr)); |
327 | for (i = 1; i < 6; i++) | ||
328 | printk(":%2.2x", dev->dev_addr[i]); | ||
329 | printk("\n"); | ||
330 | 328 | ||
331 | if (tmsdev_init(dev, device)) { | 329 | if (tmsdev_init(dev, device)) { |
332 | printk("%s: unable to get memory for dev->priv.\n", | 330 | printk("%s: unable to get memory for dev->priv.\n", |
@@ -692,11 +690,11 @@ static int madgemc_mcaproc(char *buf, int slot, void *d) | |||
692 | struct net_local *tp = netdev_priv(dev); | 690 | struct net_local *tp = netdev_priv(dev); |
693 | struct card_info *curcard = tp->tmspriv; | 691 | struct card_info *curcard = tp->tmspriv; |
694 | int len = 0; | 692 | int len = 0; |
693 | DECLARE_MAC_BUF(mac); | ||
695 | 694 | ||
696 | len += sprintf(buf+len, "-------\n"); | 695 | len += sprintf(buf+len, "-------\n"); |
697 | if (curcard) { | 696 | if (curcard) { |
698 | struct net_local *tp = netdev_priv(dev); | 697 | struct net_local *tp = netdev_priv(dev); |
699 | int i; | ||
700 | 698 | ||
701 | len += sprintf(buf+len, "Card Revision: %d\n", curcard->cardrev); | 699 | len += sprintf(buf+len, "Card Revision: %d\n", curcard->cardrev); |
702 | len += sprintf(buf+len, "RAM Size: %dkb\n", curcard->ramsize); | 700 | len += sprintf(buf+len, "RAM Size: %dkb\n", curcard->ramsize); |
@@ -716,11 +714,8 @@ static int madgemc_mcaproc(char *buf, int slot, void *d) | |||
716 | } | 714 | } |
717 | len += sprintf(buf+len, " (%s)\n", (curcard->fairness)?"Unfair":"Fair"); | 715 | len += sprintf(buf+len, " (%s)\n", (curcard->fairness)?"Unfair":"Fair"); |
718 | 716 | ||
719 | len += sprintf(buf+len, "Ring Station Address: "); | 717 | len += sprintf(buf+len, "Ring Station Address: %s\n", |
720 | len += sprintf(buf+len, "%2.2x", dev->dev_addr[0]); | 718 | print_mac(mac, dev->dev_addr)); |
721 | for (i = 1; i < 6; i++) | ||
722 | len += sprintf(buf+len, " %2.2x", dev->dev_addr[i]); | ||
723 | len += sprintf(buf+len, "\n"); | ||
724 | } else | 719 | } else |
725 | len += sprintf(buf+len, "Card not configured\n"); | 720 | len += sprintf(buf+len, "Card not configured\n"); |
726 | 721 | ||