aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/myri_sbus.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/myri_sbus.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/myri_sbus.c')
-rw-r--r--drivers/net/myri_sbus.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c
index 35c4c598c8d2..d68ee51c095f 100644
--- a/drivers/net/myri_sbus.c
+++ b/drivers/net/myri_sbus.c
@@ -311,12 +311,12 @@ static void myri_is_not_so_happy(struct myri_eth *mp)
311#ifdef DEBUG_HEADER 311#ifdef DEBUG_HEADER
312static void dump_ehdr(struct ethhdr *ehdr) 312static void dump_ehdr(struct ethhdr *ehdr)
313{ 313{
314 printk("ehdr[h_dst(%02x:%02x:%02x:%02x:%02x:%02x)" 314 DECLARE_MAC_BUF(mac);
315 "h_source(%02x:%02x:%02x:%02x:%02x:%02x)h_proto(%04x)]\n", 315 DECLARE_MAC_BUF(mac2);
316 ehdr->h_dest[0], ehdr->h_dest[1], ehdr->h_dest[2], 316 printk("ehdr[h_dst(%s)"
317 ehdr->h_dest[3], ehdr->h_dest[4], ehdr->h_dest[4], 317 "h_source(%s)"
318 ehdr->h_source[0], ehdr->h_source[1], ehdr->h_source[2], 318 "h_proto(%04x)]\n",
319 ehdr->h_source[3], ehdr->h_source[4], ehdr->h_source[4], 319 print_mac(mac, ehdr->h_dest), print_mac(mac2, ehdr->h_source),
320 ehdr->h_proto); 320 ehdr->h_proto);
321} 321}
322 322
@@ -325,13 +325,7 @@ static void dump_ehdr_and_myripad(unsigned char *stuff)
325 struct ethhdr *ehdr = (struct ethhdr *) (stuff + 2); 325 struct ethhdr *ehdr = (struct ethhdr *) (stuff + 2);
326 326
327 printk("pad[%02x:%02x]", stuff[0], stuff[1]); 327 printk("pad[%02x:%02x]", stuff[0], stuff[1]);
328 printk("ehdr[h_dst(%02x:%02x:%02x:%02x:%02x:%02x)" 328 dump_ehdr(ehdr);
329 "h_source(%02x:%02x:%02x:%02x:%02x:%02x)h_proto(%04x)]\n",
330 ehdr->h_dest[0], ehdr->h_dest[1], ehdr->h_dest[2],
331 ehdr->h_dest[3], ehdr->h_dest[4], ehdr->h_dest[4],
332 ehdr->h_source[0], ehdr->h_source[1], ehdr->h_source[2],
333 ehdr->h_source[3], ehdr->h_source[4], ehdr->h_source[4],
334 ehdr->h_proto);
335} 329}
336#endif 330#endif
337 331
@@ -895,6 +889,7 @@ static int __devinit myri_ether_init(struct sbus_dev *sdev)
895 struct myri_eth *mp; 889 struct myri_eth *mp;
896 unsigned char prop_buf[32]; 890 unsigned char prop_buf[32];
897 int i; 891 int i;
892 DECLARE_MAC_BUF(mac);
898 893
899 DET(("myri_ether_init(%p,%d):\n", sdev, num)); 894 DET(("myri_ether_init(%p,%d):\n", sdev, num));
900 dev = alloc_etherdev(sizeof(struct myri_eth)); 895 dev = alloc_etherdev(sizeof(struct myri_eth));
@@ -1089,12 +1084,8 @@ static int __devinit myri_ether_init(struct sbus_dev *sdev)
1089 1084
1090 num++; 1085 num++;
1091 1086
1092 printk("%s: MyriCOM MyriNET Ethernet ", dev->name); 1087 printk("%s: MyriCOM MyriNET Ethernet %s\n",
1093 1088 dev->name, print_mac(mac, dev->dev_addr));
1094 for (i = 0; i < 6; i++)
1095 printk("%2.2x%c", dev->dev_addr[i],
1096 i == 5 ? ' ' : ':');
1097 printk("\n");
1098 1089
1099 return 0; 1090 return 0;
1100 1091