tc35815: Use print_mac() helper

Use print_mac() and DECLARE_MAC_BUF().

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
Atsushi Nemoto 2008-04-11 00:24:24 +09:00 committed by Jeff Garzik
parent c201abd9a4
commit 958eb80bd2

View File

@ -664,6 +664,7 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
struct tc35815_local *lp; struct tc35815_local *lp;
int rc; int rc;
unsigned long mmio_start, mmio_end, mmio_flags, mmio_len; unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
DECLARE_MAC_BUF(mac);
static int printed_version; static int printed_version;
if (!printed_version++) { if (!printed_version++) {
@ -770,15 +771,11 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
goto err_out_unmap; goto err_out_unmap;
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
printk(KERN_INFO "%s: %s at 0x%lx, " printk(KERN_INFO "%s: %s at 0x%lx, %s, IRQ %d\n",
"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, "
"IRQ %d\n",
dev->name, dev->name,
board_info[ent->driver_data].name, board_info[ent->driver_data].name,
dev->base_addr, dev->base_addr,
dev->dev_addr[0], dev->dev_addr[1], print_mac(mac, dev->dev_addr),
dev->dev_addr[2], dev->dev_addr[3],
dev->dev_addr[4], dev->dev_addr[5],
dev->irq); dev->irq);
setup_timer(&lp->timer, tc35815_timer, (unsigned long) dev); setup_timer(&lp->timer, tc35815_timer, (unsigned long) dev);
@ -1127,17 +1124,14 @@ panic_queues(struct net_device *dev)
} }
#endif #endif
static void print_eth(char *add) static void print_eth(const u8 *add)
{ {
int i; DECLARE_MAC_BUF(mac);
printk("print_eth(%p)\n", add); printk(KERN_DEBUG "print_eth(%p)\n", add);
for (i = 0; i < 6; i++) printk(KERN_DEBUG " %s =>", print_mac(mac, add + 6));
printk(" %2.2X", (unsigned char) add[i + 6]); printk(KERN_CONT " %s : %02x%02x\n",
printk(" =>"); print_mac(mac, add), add[12], add[13]);
for (i = 0; i < 6; i++)
printk(" %2.2X", (unsigned char) add[i]);
printk(" : %2.2X%2.2X\n", (unsigned char) add[12], (unsigned char) add[13]);
} }
static int tc35815_tx_full(struct net_device *dev) static int tc35815_tx_full(struct net_device *dev)
@ -1992,15 +1986,13 @@ static void tc35815_set_cam_entry(struct net_device *dev, int index, unsigned ch
int cam_index = index * 6; int cam_index = index * 6;
u32 cam_data; u32 cam_data;
u32 saved_addr; u32 saved_addr;
DECLARE_MAC_BUF(mac);
saved_addr = tc_readl(&tr->CAM_Adr); saved_addr = tc_readl(&tr->CAM_Adr);
if (netif_msg_hw(lp)) { if (netif_msg_hw(lp))
int i; printk(KERN_DEBUG "%s: CAM %d: %s\n",
printk(KERN_DEBUG "%s: CAM %d:", dev->name, index); dev->name, index, print_mac(mac, addr));
for (i = 0; i < 6; i++)
printk(" %02x", addr[i]);
printk("\n");
}
if (index & 1) { if (index & 1) {
/* read modify write */ /* read modify write */
tc_writel(cam_index - 2, &tr->CAM_Adr); tc_writel(cam_index - 2, &tr->CAM_Adr);