aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hamradio
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/hamradio
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/hamradio')
-rw-r--r--drivers/net/hamradio/bpqether.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index df09210f7351..c05bc37df356 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -64,7 +64,7 @@
64#include <net/ax25.h> 64#include <net/ax25.h>
65#include <linux/inet.h> 65#include <linux/inet.h>
66#include <linux/netdevice.h> 66#include <linux/netdevice.h>
67#include <linux/if_ether.h> 67#include <linux/etherdevice.h>
68#include <linux/if_arp.h> 68#include <linux/if_arp.h>
69#include <linux/skbuff.h> 69#include <linux/skbuff.h>
70#include <net/sock.h> 70#include <net/sock.h>
@@ -95,7 +95,6 @@ static char bpq_eth_addr[6];
95 95
96static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); 96static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
97static int bpq_device_event(struct notifier_block *, unsigned long, void *); 97static int bpq_device_event(struct notifier_block *, unsigned long, void *);
98static const char *bpq_print_ethaddr(const unsigned char *);
99 98
100static struct packet_type bpq_packet_type = { 99static struct packet_type bpq_packet_type = {
101 .type = __constant_htons(ETH_P_BPQ), 100 .type = __constant_htons(ETH_P_BPQ),
@@ -383,16 +382,6 @@ static int bpq_close(struct net_device *dev)
383/* 382/*
384 * Proc filesystem 383 * Proc filesystem
385 */ 384 */
386static const char * bpq_print_ethaddr(const unsigned char *e)
387{
388 static char buf[18];
389
390 sprintf(buf, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
391 e[0], e[1], e[2], e[3], e[4], e[5]);
392
393 return buf;
394}
395
396static void *bpq_seq_start(struct seq_file *seq, loff_t *pos) 385static void *bpq_seq_start(struct seq_file *seq, loff_t *pos)
397{ 386{
398 int i = 1; 387 int i = 1;
@@ -438,14 +427,16 @@ static int bpq_seq_show(struct seq_file *seq, void *v)
438 "dev ether destination accept from\n"); 427 "dev ether destination accept from\n");
439 else { 428 else {
440 const struct bpqdev *bpqdev = v; 429 const struct bpqdev *bpqdev = v;
430 DECLARE_MAC_BUF(mac);
441 431
442 seq_printf(seq, "%-5s %-10s %s ", 432 seq_printf(seq, "%-5s %-10s %s ",
443 bpqdev->axdev->name, bpqdev->ethdev->name, 433 bpqdev->axdev->name, bpqdev->ethdev->name,
444 bpq_print_ethaddr(bpqdev->dest_addr)); 434 print_mac(mac, bpqdev->dest_addr));
445 435
446 seq_printf(seq, "%s\n", 436 if (is_multicast_ether_addr(bpqdev->acpt_addr))
447 (bpqdev->acpt_addr[0] & 0x01) ? "*" 437 seq_printf(seq, "*\n");
448 : bpq_print_ethaddr(bpqdev->acpt_addr)); 438 else
439 seq_printf(seq, "%s\n", print_mac(mac, bpqdev->acpt_addr));
449 440
450 } 441 }
451 return 0; 442 return 0;