[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>
This commit is contained in:
Joe Perches 2007-10-03 17:59:30 -07:00 committed by David S. Miller
parent 95ea36275f
commit 0795af5729
228 changed files with 1876 additions and 1953 deletions

View File

@ -177,6 +177,7 @@ el2_probe1(struct net_device *dev, int ioaddr)
int i, iobase_reg, membase_reg, saved_406, wordlength, retval; int i, iobase_reg, membase_reg, saved_406, wordlength, retval;
static unsigned version_printed; static unsigned version_printed;
unsigned long vendor_id; unsigned long vendor_id;
DECLARE_MAC_BUF(mac);
if (!request_region(ioaddr, EL2_IO_EXTENT, DRV_NAME)) if (!request_region(ioaddr, EL2_IO_EXTENT, DRV_NAME))
return -EBUSY; return -EBUSY;
@ -226,7 +227,8 @@ el2_probe1(struct net_device *dev, int ioaddr)
/* Retrieve and print the ethernet address. */ /* Retrieve and print the ethernet address. */
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
printk(" %2.2x", dev->dev_addr[i] = inb(ioaddr + i)); dev->dev_addr[i] = inb(ioaddr + i);
printk("%s", print_mac(mac, dev->dev_addr));
/* Map the 8390 back into the window. */ /* Map the 8390 back into the window. */
outb(ECNTRL_THIN, ioaddr + 0x406); outb(ECNTRL_THIN, ioaddr + 0x406);

View File

@ -1386,6 +1386,7 @@ static int __init elplus_setup(struct net_device *dev)
unsigned long timeout; unsigned long timeout;
unsigned long cookie = 0; unsigned long cookie = 0;
int err = -ENODEV; int err = -ENODEV;
DECLARE_MAC_BUF(mac);
/* /*
* setup adapter structure * setup adapter structure
@ -1521,11 +1522,10 @@ static int __init elplus_setup(struct net_device *dev)
/* /*
* print remainder of startup message * print remainder of startup message
*/ */
printk(KERN_INFO "%s: 3c505 at %#lx, irq %d, dma %d, ", printk(KERN_INFO "%s: 3c505 at %#lx, irq %d, dma %d, "
dev->name, dev->base_addr, dev->irq, dev->dma); "addr %s, ",
printk("addr %02x:%02x:%02x:%02x:%02x:%02x, ", dev->name, dev->base_addr, dev->irq, dev->dma,
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], print_mac(mac, dev->dev_addr));
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
/* /*
* read more information from the adapter * read more information from the adapter

View File

@ -357,6 +357,7 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr)
static unsigned char init_ID_done, version_printed; static unsigned char init_ID_done, version_printed;
int i, irq, irqval, retval; int i, irq, irqval, retval;
struct net_local *lp; struct net_local *lp;
DECLARE_MAC_BUF(mac);
if (init_ID_done == 0) { if (init_ID_done == 0) {
ushort lrs_state = 0xff; ushort lrs_state = 0xff;
@ -402,10 +403,9 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr)
dev->base_addr = ioaddr; dev->base_addr = ioaddr;
outb(0x01, ioaddr + MISC_CTRL); outb(0x01, ioaddr + MISC_CTRL);
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++)
dev->dev_addr[i] = inb(ioaddr + i); dev->dev_addr[i] = inb(ioaddr + i);
printk(" %02x", dev->dev_addr[i]); printk(" %s", print_mac(mac, dev->dev_addr));
}
if (mem_start) if (mem_start)
net_debug = mem_start & 7; net_debug = mem_start & 7;

View File

@ -313,8 +313,9 @@ static int nopnp;
static int __init el3_common_init(struct net_device *dev) static int __init el3_common_init(struct net_device *dev)
{ {
struct el3_private *lp = netdev_priv(dev); struct el3_private *lp = netdev_priv(dev);
short i;
int err; int err;
DECLARE_MAC_BUF(mac);
const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"};
spin_lock_init(&lp->lock); spin_lock_init(&lp->lock);
@ -346,17 +347,10 @@ static int __init el3_common_init(struct net_device *dev)
return err; return err;
} }
{ printk(KERN_INFO "%s: 3c5x9 found at %#3.3lx, %s port, "
const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"}; "address %s, IRQ %d.\n",
printk("%s: 3c5x9 found at %#3.3lx, %s port, address ", dev->name, dev->base_addr, if_names[(dev->if_port & 0x03)],
dev->name, dev->base_addr, print_mac(mac, dev->dev_addr), dev->irq);
if_names[(dev->if_port & 0x03)]);
}
/* Read in the station address. */
for (i = 0; i < 6; i++)
printk(" %2.2x", dev->dev_addr[i]);
printk(", IRQ %d.\n", dev->irq);
if (el3_debug > 0) if (el3_debug > 0)
printk(KERN_INFO "%s", version); printk(KERN_INFO "%s", version);

View File

@ -569,6 +569,7 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
unsigned int eeprom[0x40], checksum = 0; /* EEPROM contents */ unsigned int eeprom[0x40], checksum = 0; /* EEPROM contents */
int i; int i;
int irq; int irq;
DECLARE_MAC_BUF(mac);
if (idev) { if (idev) {
irq = pnp_irq(idev, 0); irq = pnp_irq(idev, 0);
@ -630,8 +631,7 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
checksum = (checksum ^ (checksum >> 8)) & 0xff; checksum = (checksum ^ (checksum >> 8)) & 0xff;
if (checksum != 0x00) if (checksum != 0x00)
printk(" ***INVALID CHECKSUM %4.4x*** ", checksum); printk(" ***INVALID CHECKSUM %4.4x*** ", checksum);
for (i = 0; i < 6; i++) printk(" %s", print_mac(mac, dev->dev_addr));
printk("%c%2.2x", i ? ':' : ' ', dev->dev_addr[i]);
if (eeprom[16] == 0x11c7) { /* Corkscrew */ if (eeprom[16] == 0x11c7) { /* Corkscrew */
if (request_dma(dev->dma, "3c515")) { if (request_dma(dev->dma, "3c515")) {
printk(", DMA %d allocation failed", dev->dma); printk(", DMA %d allocation failed", dev->dma);

View File

@ -383,8 +383,8 @@ void alloc586(struct net_device *dev)
static int elmc_getinfo(char *buf, int slot, void *d) static int elmc_getinfo(char *buf, int slot, void *d)
{ {
int len = 0; int len = 0;
struct net_device *dev = (struct net_device *) d; struct net_device *dev = d;
int i; DECLARE_MAC_BUF(mac);
if (dev == NULL) if (dev == NULL)
return len; return len;
@ -399,12 +399,8 @@ static int elmc_getinfo(char *buf, int slot, void *d)
len += sprintf(buf + len, "Transceiver: %s\n", dev->if_port ? len += sprintf(buf + len, "Transceiver: %s\n", dev->if_port ?
"External" : "Internal"); "External" : "Internal");
len += sprintf(buf + len, "Device: %s\n", dev->name); len += sprintf(buf + len, "Device: %s\n", dev->name);
len += sprintf(buf + len, "Hardware Address:"); len += sprintf(buf + len, "Hardware Address: %s\n",
for (i = 0; i < 6; i++) { print_mac(mac, dev->dev_addr));
len += sprintf(buf + len, " %02x", dev->dev_addr[i]);
}
buf[len++] = '\n';
buf[len] = 0;
return len; return len;
} /* elmc_getinfo() */ } /* elmc_getinfo() */
@ -422,6 +418,7 @@ static int __init do_elmc_probe(struct net_device *dev)
unsigned int size = 0; unsigned int size = 0;
int retval; int retval;
struct priv *pr = dev->priv; struct priv *pr = dev->priv;
DECLARE_MAC_BUF(mac);
if (MCA_bus == 0) { if (MCA_bus == 0) {
return -ENODEV; return -ENODEV;
@ -544,12 +541,11 @@ static int __init do_elmc_probe(struct net_device *dev)
/* The hardware address for the 3c523 is stored in the first six /* The hardware address for the 3c523 is stored in the first six
bytes of the IO address. */ bytes of the IO address. */
printk(KERN_INFO "%s: hardware address ", dev->name); for (i = 0; i < 6; i++)
for (i = 0; i < 6; i++) {
dev->dev_addr[i] = inb(dev->base_addr + i); dev->dev_addr[i] = inb(dev->base_addr + i);
printk(" %02x", dev->dev_addr[i]);
} printk(KERN_INFO "%s: hardware address %s\n",
printk("\n"); dev->name, print_mac(mac, dev->dev_addr));
dev->open = &elmc_open; dev->open = &elmc_open;
dev->stop = &elmc_close; dev->stop = &elmc_close;

View File

@ -336,6 +336,7 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
"82586 initialisation failure", "82586 initialisation failure",
"Adapter list configuration error" "Adapter list configuration error"
}; };
DECLARE_MAC_BUF(mac);
/* Time to play MCA games */ /* Time to play MCA games */
@ -396,17 +397,17 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
* Go PROM browsing * Go PROM browsing
*/ */
printk("%s: Address ", dev->name);
/* Retrieve and print the ethernet address. */ /* Retrieve and print the ethernet address. */
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
{ {
mca_write_pos(slot, 6, i+12); mca_write_pos(slot, 6, i+12);
mca_write_pos(slot, 7, 0); mca_write_pos(slot, 7, 0);
printk(" %2.2x", dev->dev_addr[i] = mca_read_pos(slot,3)); dev->dev_addr[i] = mca_read_pos(slot,3);
} }
printk("%s: Address %s", dev->name, print_mac(mac, dev->dev_addr));
mca_write_pos(slot, 6, 0); mca_write_pos(slot, 6, 0);
mca_write_pos(slot, 7, 0); mca_write_pos(slot, 7, 0);

View File

@ -1014,6 +1014,7 @@ static int __devinit vortex_probe1(struct device *gendev,
char *print_name = "3c59x"; char *print_name = "3c59x";
struct pci_dev *pdev = NULL; struct pci_dev *pdev = NULL;
struct eisa_device *edev = NULL; struct eisa_device *edev = NULL;
DECLARE_MAC_BUF(mac);
if (!printed_version) { if (!printed_version) {
printk (version); printk (version);
@ -1205,10 +1206,8 @@ static int __devinit vortex_probe1(struct device *gendev,
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
((u16 *)dev->dev_addr)[i] = htons(eeprom[i + 10]); ((u16 *)dev->dev_addr)[i] = htons(eeprom[i + 10]);
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
if (print_info) { if (print_info)
for (i = 0; i < 6; i++) printk(" %s", print_mac(mac, dev->dev_addr));
printk("%c%2.2x", i ? ':' : ' ', dev->dev_addr[i]);
}
/* Unfortunately an all zero eeprom passes the checksum and this /* Unfortunately an all zero eeprom passes the checksum and this
gets found in the wild in failure cases. Crypto is hard 8) */ gets found in the wild in failure cases. Crypto is hard 8) */
if (!is_valid_ether_addr(dev->dev_addr)) { if (!is_valid_ether_addr(dev->dev_addr)) {

View File

@ -1823,6 +1823,7 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
void __iomem *regs; void __iomem *regs;
resource_size_t pciaddr; resource_size_t pciaddr;
unsigned int addr_len, i, pci_using_dac; unsigned int addr_len, i, pci_using_dac;
DECLARE_MAC_BUF(mac);
#ifndef MODULE #ifndef MODULE
static int version_printed; static int version_printed;
@ -1964,13 +1965,10 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_iomap; goto err_out_iomap;
printk (KERN_INFO "%s: RTL-8139C+ at 0x%lx, " printk (KERN_INFO "%s: RTL-8139C+ at 0x%lx, "
"%02x:%02x:%02x:%02x:%02x:%02x, " "%s, IRQ %d\n",
"IRQ %d\n",
dev->name, dev->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);
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);

View File

@ -926,6 +926,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
int i, addr_len, option; int i, addr_len, option;
void __iomem *ioaddr; void __iomem *ioaddr;
static int board_idx = -1; static int board_idx = -1;
DECLARE_MAC_BUF(mac);
assert (pdev != NULL); assert (pdev != NULL);
assert (ent != NULL); assert (ent != NULL);
@ -1017,14 +1018,11 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
pci_set_drvdata (pdev, dev); pci_set_drvdata (pdev, dev);
printk (KERN_INFO "%s: %s at 0x%lx, " printk (KERN_INFO "%s: %s at 0x%lx, "
"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, " "%s, IRQ %d\n",
"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);
printk (KERN_DEBUG "%s: Identified 8139 chip type '%s'\n", printk (KERN_DEBUG "%s: Identified 8139 chip type '%s'\n",

View File

@ -1116,15 +1116,12 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
static void print_eth(unsigned char *add, char *str) static void print_eth(unsigned char *add, char *str)
{ {
int i; DECLARE_MAC_BUF(mac);
DECLARE_MAC_BUF(mac2);
printk(KERN_DEBUG "i596 0x%p, ", add); printk(KERN_DEBUG "i596 0x%p, %s --> %s %02X%02X, %s\n",
for (i = 0; i < 6; i++) add, print_mac(mac, add + 6), print_mac(mac2, add),
printk(" %02X", add[i + 6]); add[12], add[13], str);
printk(" -->");
for (i = 0; i < 6; i++)
printk(" %02X", add[i]);
printk(" %02X%02X, %s\n", add[12], add[13], str);
} }
static int io = 0x300; static int io = 0x300;
@ -1539,6 +1536,7 @@ static void set_multicast_list(struct net_device *dev)
struct dev_mc_list *dmi; struct dev_mc_list *dmi;
unsigned char *cp; unsigned char *cp;
struct mc_cmd *cmd; struct mc_cmd *cmd;
DECLARE_MAC_BUF(mac);
if (wait_cfg(dev, &lp->mc_cmd.cmd, 1000, "multicast list change request timed out")) if (wait_cfg(dev, &lp->mc_cmd.cmd, 1000, "multicast list change request timed out"))
return; return;
@ -1549,8 +1547,8 @@ static void set_multicast_list(struct net_device *dev)
for (dmi = dev->mc_list; cnt && dmi != NULL; dmi = dmi->next, cnt--, cp += 6) { for (dmi = dev->mc_list; cnt && dmi != NULL; dmi = dmi->next, cnt--, cp += 6) {
memcpy(cp, dmi->dmi_addr, 6); memcpy(cp, dmi->dmi_addr, 6);
if (i596_debug > 1) if (i596_debug > 1)
DEB(DEB_MULTI,printk(KERN_INFO "%s: Adding address %02x:%02x:%02x:%02x:%02x:%02x\n", DEB(DEB_MULTI,printk(KERN_INFO "%s: Adding address %s\n",
dev->name, cp[0],cp[1],cp[2],cp[3],cp[4],cp[5])); dev->name, print_mac(mac, cp)));
} }
i596_add_cmd(dev, &cmd->cmd); i596_add_cmd(dev, &cmd->cmd);
} }

View File

@ -716,6 +716,7 @@ static int __devinit a2065_init_one(struct zorro_dev *z,
unsigned long board, base_addr, mem_start; unsigned long board, base_addr, mem_start;
struct resource *r1, *r2; struct resource *r1, *r2;
int err; int err;
DECLARE_MAC_BUF(mac);
board = z->resource.start; board = z->resource.start;
base_addr = board+A2065_LANCE; base_addr = board+A2065_LANCE;
@ -792,9 +793,8 @@ static int __devinit a2065_init_one(struct zorro_dev *z,
zorro_set_drvdata(z, dev); zorro_set_drvdata(z, dev);
printk(KERN_INFO "%s: A2065 at 0x%08lx, Ethernet Address " printk(KERN_INFO "%s: A2065 at 0x%08lx, Ethernet Address "
"%02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, board, "%s\n", dev->name, board,
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], print_mac(mac, dev->dev_addr));
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
return 0; return 0;
} }

View File

@ -146,6 +146,7 @@ out:
static int __init ac_probe1(int ioaddr, struct net_device *dev) static int __init ac_probe1(int ioaddr, struct net_device *dev)
{ {
int i, retval; int i, retval;
DECLARE_MAC_BUF(mac);
if (!request_region(ioaddr, AC_IO_EXTENT, DRV_NAME)) if (!request_region(ioaddr, AC_IO_EXTENT, DRV_NAME))
return -EBUSY; return -EBUSY;
@ -167,10 +168,11 @@ static int __init ac_probe1(int ioaddr, struct net_device *dev)
inb(ioaddr + AC_ID_PORT + 2), inb(ioaddr + AC_ID_PORT + 3)); inb(ioaddr + AC_ID_PORT + 2), inb(ioaddr + AC_ID_PORT + 3));
#endif #endif
printk("AC3200 in EISA slot %d, node", ioaddr/0x1000); for (i = 0; i < 6; i++)
for(i = 0; i < 6; i++) dev->dev_addr[i] = inb(ioaddr + AC_SA_PROM + i);
printk(" %02x", dev->dev_addr[i] = inb(ioaddr + AC_SA_PROM + i));
printk(KERN_DEBUG "AC3200 in EISA slot %d, node %s",
ioaddr/0x1000, print_mac(mac, dev->dev_addr));
#if 0 #if 0
/* Check the vendor ID/prefix. Redundant after checking the EISA ID */ /* Check the vendor ID/prefix. Redundant after checking the EISA ID */
if (inb(ioaddr + AC_SA_PROM + 0) != AC_ADDR0 if (inb(ioaddr + AC_SA_PROM + 0) != AC_ADDR0

View File

@ -893,6 +893,7 @@ static int __devinit ace_init(struct net_device *dev)
int board_idx, ecode = 0; int board_idx, ecode = 0;
short i; short i;
unsigned char cache_size; unsigned char cache_size;
DECLARE_MAC_BUF(mac);
ap = netdev_priv(dev); ap = netdev_priv(dev);
regs = ap->regs; regs = ap->regs;
@ -1012,10 +1013,6 @@ static int __devinit ace_init(struct net_device *dev)
writel(mac1, &regs->MacAddrHi); writel(mac1, &regs->MacAddrHi);
writel(mac2, &regs->MacAddrLo); writel(mac2, &regs->MacAddrLo);
printk("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
(mac1 >> 8) & 0xff, mac1 & 0xff, (mac2 >> 24) &0xff,
(mac2 >> 16) & 0xff, (mac2 >> 8) & 0xff, mac2 & 0xff);
dev->dev_addr[0] = (mac1 >> 8) & 0xff; dev->dev_addr[0] = (mac1 >> 8) & 0xff;
dev->dev_addr[1] = mac1 & 0xff; dev->dev_addr[1] = mac1 & 0xff;
dev->dev_addr[2] = (mac2 >> 24) & 0xff; dev->dev_addr[2] = (mac2 >> 24) & 0xff;
@ -1023,6 +1020,8 @@ static int __devinit ace_init(struct net_device *dev)
dev->dev_addr[4] = (mac2 >> 8) & 0xff; dev->dev_addr[4] = (mac2 >> 8) & 0xff;
dev->dev_addr[5] = mac2 & 0xff; dev->dev_addr[5] = mac2 & 0xff;
printk("MAC: %s\n", print_mac(mac, dev->dev_addr));
/* /*
* Looks like this is necessary to deal with on all architectures, * Looks like this is necessary to deal with on all architectures,
* even this %$#%$# N440BX Intel based thing doesn't get it right. * even this %$#%$# N440BX Intel based thing doesn't get it right.

View File

@ -1934,6 +1934,7 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
unsigned long reg_addr,reg_len; unsigned long reg_addr,reg_len;
struct amd8111e_priv* lp; struct amd8111e_priv* lp;
struct net_device* dev; struct net_device* dev;
DECLARE_MAC_BUF(mac);
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if(err){ if(err){
@ -2006,7 +2007,7 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
/* Initializing MAC address */ /* Initializing MAC address */
for(i = 0; i < ETH_ADDR_LEN; i++) for(i = 0; i < ETH_ADDR_LEN; i++)
dev->dev_addr[i] =readb(lp->mmio + PADR + i); dev->dev_addr[i] = readb(lp->mmio + PADR + i);
/* Setting user defined parametrs */ /* Setting user defined parametrs */
lp->ext_phy_option = speed_duplex[card_idx]; lp->ext_phy_option = speed_duplex[card_idx];
@ -2075,11 +2076,10 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
/* display driver and device information */ /* display driver and device information */
chip_version = (readl(lp->mmio + CHIPID) & 0xf0000000)>>28; chip_version = (readl(lp->mmio + CHIPID) & 0xf0000000)>>28;
printk(KERN_INFO "%s: AMD-8111e Driver Version: %s\n", dev->name,MODULE_VERS); printk(KERN_INFO "%s: AMD-8111e Driver Version: %s\n",
printk(KERN_INFO "%s: [ Rev %x ] PCI 10/100BaseT Ethernet ", dev->name, chip_version); dev->name,MODULE_VERS);
for (i = 0; i < 6; i++) printk(KERN_INFO "%s: [ Rev %x ] PCI 10/100BaseT Ethernet %s\n",
printk("%2.2x%c",dev->dev_addr[i],i == 5 ? ' ' : ':'); dev->name, chip_version, print_mac(mac, dev->dev_addr));
printk( "\n");
if (lp->ext_phy_id) if (lp->ext_phy_id)
printk(KERN_INFO "%s: Found MII PHY ID 0x%08x at address 0x%02x\n", printk(KERN_INFO "%s: Found MII PHY ID 0x%08x at address 0x%02x\n",
dev->name, lp->ext_phy_id, lp->ext_phy_addr); dev->name, lp->ext_phy_id, lp->ext_phy_addr);

View File

@ -204,6 +204,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
int neX000, ctron; int neX000, ctron;
#endif #endif
static unsigned version_printed; static unsigned version_printed;
DECLARE_MAC_BUF(mac);
if (ei_debug && version_printed++ == 0) if (ei_debug && version_printed++ == 0)
printk(version); printk(version);
@ -316,12 +317,12 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
i = request_irq(dev->irq, apne_interrupt, IRQF_SHARED, DRV_NAME, dev); i = request_irq(dev->irq, apne_interrupt, IRQF_SHARED, DRV_NAME, dev);
if (i) return i; if (i) return i;
for(i = 0; i < ETHER_ADDR_LEN; i++) { for(i = 0; i < ETHER_ADDR_LEN; i++)
printk(" %2.2x", SA_prom[i]);
dev->dev_addr[i] = SA_prom[i]; dev->dev_addr[i] = SA_prom[i];
}
printk("\n%s: %s found.\n", dev->name, name); printk(" %s\n", print_mac(mac, dev->dev_addr));
printk("%s: %s found.\n", dev->name, name);
ei_status.name = name; ei_status.name = name;
ei_status.tx_start_page = start_page; ei_status.tx_start_page = start_page;

View File

@ -166,6 +166,7 @@ static int __devinit ariadne_init_one(struct zorro_dev *z,
struct net_device *dev; struct net_device *dev;
struct ariadne_private *priv; struct ariadne_private *priv;
int err; int err;
DECLARE_MAC_BUF(mac);
r1 = request_mem_region(base_addr, sizeof(struct Am79C960), "Am79C960"); r1 = request_mem_region(base_addr, sizeof(struct Am79C960), "Am79C960");
if (!r1) if (!r1)
@ -216,9 +217,8 @@ static int __devinit ariadne_init_one(struct zorro_dev *z,
zorro_set_drvdata(z, dev); zorro_set_drvdata(z, dev);
printk(KERN_INFO "%s: Ariadne at 0x%08lx, Ethernet Address " printk(KERN_INFO "%s: Ariadne at 0x%08lx, Ethernet Address "
"%02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, board, "%s\n", dev->name, board,
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], print_mac(mac, dev->dev_addr));
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
return 0; return 0;
} }
@ -614,21 +614,17 @@ static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Fill in a Tx ring entry */ /* Fill in a Tx ring entry */
#if 0 #if 0
printk(KERN_DEBUG "TX pkt type 0x%04x from ", ((u_short *)skb->data)[6]); {
{ DECLARE_MAC_BUF(mac);
int i; DECLARE_MAC_BUF(mac2);
u_char *ptr = &((u_char *)skb->data)[6];
for (i = 0; i < 6; i++) printk(KERN_DEBUG "TX pkt type 0x%04x from %s to %s "
printk("%02x", ptr[i]); " data 0x%08x len %d\n",
} ((u_short *)skb->data)[6],
printk(" to "); print_mac(mac, ((const u8 *)skb->data)+6),
{ print_mac(mac, (const u8 *)skb->data),
int i; (int)skb->data, (int)skb->len);
u_char *ptr = (u_char *)skb->data; }
for (i = 0; i < 6; i++)
printk("%02x", ptr[i]);
}
printk(" data 0x%08x len %d\n", (int)skb->data, (int)skb->len);
#endif #endif
local_irq_save(flags); local_irq_save(flags);
@ -748,22 +744,22 @@ static int ariadne_rx(struct net_device *dev)
skb_copy_to_linear_data(skb, (char *)priv->rx_buff[entry], pkt_len); skb_copy_to_linear_data(skb, (char *)priv->rx_buff[entry], pkt_len);
skb->protocol=eth_type_trans(skb,dev); skb->protocol=eth_type_trans(skb,dev);
#if 0 #if 0
{
DECLARE_MAC_BUF(mac);
printk(KERN_DEBUG "RX pkt type 0x%04x from ", printk(KERN_DEBUG "RX pkt type 0x%04x from ",
((u_short *)skb->data)[6]); ((u_short *)skb->data)[6]);
{ {
int i;
u_char *ptr = &((u_char *)skb->data)[6]; u_char *ptr = &((u_char *)skb->data)[6];
for (i = 0; i < 6; i++) printk("%s", print_mac(mac, ptr));
printk("%02x", ptr[i]);
} }
printk(" to "); printk(" to ");
{ {
int i;
u_char *ptr = (u_char *)skb->data; u_char *ptr = (u_char *)skb->data;
for (i = 0; i < 6; i++) printk("%s", print_mac(mac, ptr));
printk("%02x", ptr[i]);
} }
printk(" data 0x%08x len %d\n", (int)skb->data, (int)skb->len); printk(" data 0x%08x len %d\n", (int)skb->data, (int)skb->len);
}
#endif #endif
netif_rx(skb); netif_rx(skb);

View File

@ -741,12 +741,10 @@ static int __init am79c961_probe(struct platform_device *pdev)
ret = register_netdev(dev); ret = register_netdev(dev);
if (ret == 0) { if (ret == 0) {
printk(KERN_INFO "%s: ether address ", dev->name); DECLARE_MAC_BUF(mac);
/* Retrive and print the ethernet address. */
for (i = 0; i < 6; i++)
printk (i == 5 ? "%02x\n" : "%02x:", dev->dev_addr[i]);
printk(KERN_INFO "%s: ether address %s\n",
dev->name, print_mac(mac, dev->dev_addr));
return 0; return 0;
} }

View File

@ -485,6 +485,7 @@ static void update_mac_address(struct net_device *dev)
static int set_mac_address(struct net_device *dev, void* addr) static int set_mac_address(struct net_device *dev, void* addr)
{ {
struct sockaddr *address = addr; struct sockaddr *address = addr;
DECLARE_MAC_BUF(mac);
if (!is_valid_ether_addr(address->sa_data)) if (!is_valid_ether_addr(address->sa_data))
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
@ -492,9 +493,8 @@ static int set_mac_address(struct net_device *dev, void* addr)
memcpy(dev->dev_addr, address->sa_data, dev->addr_len); memcpy(dev->dev_addr, address->sa_data, dev->addr_len);
update_mac_address(dev); update_mac_address(dev);
printk("%s: Setting MAC address to %02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, printk("%s: Setting MAC address to %s\n", dev->name,
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], print_mac(mac, dev->dev_addr));
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
return 0; return 0;
} }
@ -979,6 +979,7 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add
struct at91_private *lp; struct at91_private *lp;
unsigned int val; unsigned int val;
int res; int res;
DECLARE_MAC_BUF(mac);
dev = alloc_etherdev(sizeof(struct at91_private)); dev = alloc_etherdev(sizeof(struct at91_private));
if (!dev) if (!dev)
@ -1081,12 +1082,11 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add
} }
/* Display ethernet banner */ /* Display ethernet banner */
printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%02x:%02x:%02x:%02x:%02x:%02x)\n", printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n",
dev->name, (uint) dev->base_addr, dev->irq, dev->name, (uint) dev->base_addr, dev->irq,
at91_emac_read(AT91_EMAC_CFG) & AT91_EMAC_SPD ? "100-" : "10-", at91_emac_read(AT91_EMAC_CFG) & AT91_EMAC_SPD ? "100-" : "10-",
at91_emac_read(AT91_EMAC_CFG) & AT91_EMAC_FD ? "FullDuplex" : "HalfDuplex", at91_emac_read(AT91_EMAC_CFG) & AT91_EMAC_FD ? "FullDuplex" : "HalfDuplex",
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], print_mac(mac, dev->dev_addr));
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
if ((phy_type == MII_DM9161_ID) || (lp->phy_type == MII_DM9161A_ID)) if ((phy_type == MII_DM9161_ID) || (lp->phy_type == MII_DM9161A_ID))
printk(KERN_INFO "%s: Davicom 9161 PHY %s\n", dev->name, (lp->phy_media == PORT_FIBRE) ? "(Fiber)" : "(Copper)"); printk(KERN_INFO "%s: Davicom 9161 PHY %s\n", dev->name, (lp->phy_media == PORT_FIBRE) ? "(Fiber)" : "(Copper)");
else if (phy_type == MII_LXT971A_ID) else if (phy_type == MII_LXT971A_ID)

View File

@ -996,6 +996,7 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
{ {
struct net_device *dev; struct net_device *dev;
int i, ret = 0; int i, ret = 0;
DECLARE_MAC_BUF(mac);
ether1_banner(); ether1_banner();
@ -1043,12 +1044,9 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
if (ret) if (ret)
goto free; goto free;
printk(KERN_INFO "%s: ether1 in slot %d, ", printk(KERN_INFO "%s: ether1 in slot %d, %s\n",
dev->name, ec->slot_no); dev->name, ec->slot_no, print_mac(mac, dev->dev_addr));
for (i = 0; i < 6; i++)
printk ("%2.2x%c", dev->dev_addr[i], i == 5 ? '\n' : ':');
ecard_set_drvdata(ec, dev); ecard_set_drvdata(ec, dev);
return 0; return 0;

View File

@ -775,7 +775,8 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
{ {
const struct ether3_data *data = id->data; const struct ether3_data *data = id->data;
struct net_device *dev; struct net_device *dev;
int i, bus_type, ret; int bus_type, ret;
DECLARE_MAC_BUF(mac);
ether3_banner(); ether3_banner();
@ -858,9 +859,8 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
if (ret) if (ret)
goto free; goto free;
printk("%s: %s in slot %d, ", dev->name, data->name, ec->slot_no); printk("%s: %s in slot %d, %s\n",
for (i = 0; i < 6; i++) dev->name, data->name, ec->slot_no, print_mac(mac, dev->dev_addr));
printk("%2.2x%c", dev->dev_addr[i], i == 5 ? '\n' : ':');
ecard_set_drvdata(ec, dev); ecard_set_drvdata(ec, dev);
return 0; return 0;

View File

@ -648,6 +648,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
struct net_device *dev; struct net_device *dev;
struct etherh_priv *eh; struct etherh_priv *eh;
int i, ret; int i, ret;
DECLARE_MAC_BUF(mac);
etherh_banner(); etherh_banner();
@ -745,11 +746,8 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
if (ret) if (ret)
goto free; goto free;
printk(KERN_INFO "%s: %s in slot %d, ", printk(KERN_INFO "%s: %s in slot %d, %s\n",
dev->name, data->name, ec->slot_no); dev->name, data->name, ec->slot_no, print_mac(mac, dev->dev_addr));
for (i = 0; i < 6; i++)
printk("%2.2x%c", dev->dev_addr[i], i == 5 ? '\n' : ':');
ecard_set_drvdata(ec, dev); ecard_set_drvdata(ec, dev);

View File

@ -265,6 +265,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
unsigned int i, irq, is_fmv18x = 0, is_at1700 = 0; unsigned int i, irq, is_fmv18x = 0, is_at1700 = 0;
int slot, ret = -ENODEV; int slot, ret = -ENODEV;
struct net_local *lp = netdev_priv(dev); struct net_local *lp = netdev_priv(dev);
DECLARE_MAC_BUF(mac);
if (!request_region(ioaddr, AT1700_IO_EXTENT, DRV_NAME)) if (!request_region(ioaddr, AT1700_IO_EXTENT, DRV_NAME))
return -EBUSY; return -EBUSY;
@ -388,16 +389,15 @@ found:
if (is_at1700) { if (is_at1700) {
for(i = 0; i < 3; i++) { for(i = 0; i < 3; i++) {
unsigned short eeprom_val = read_eeprom(ioaddr, 4+i); unsigned short eeprom_val = read_eeprom(ioaddr, 4+i);
printk("%04x", eeprom_val);
((unsigned short *)dev->dev_addr)[i] = ntohs(eeprom_val); ((unsigned short *)dev->dev_addr)[i] = ntohs(eeprom_val);
} }
} else { } else {
for(i = 0; i < 6; i++) { for(i = 0; i < 6; i++) {
unsigned char val = inb(ioaddr + SAPROM + i); unsigned char val = inb(ioaddr + SAPROM + i);
printk("%02x", val);
dev->dev_addr[i] = val; dev->dev_addr[i] = val;
} }
} }
printk("%s", print_mac(mac, dev->dev_addr));
/* The EEPROM word 12 bit 0x0400 means use regular 100 ohm 10baseT signals, /* The EEPROM word 12 bit 0x0400 means use regular 100 ohm 10baseT signals,
rather than 150 ohm shielded twisted pair compensation. rather than 150 ohm shielded twisted pair compensation.

View File

@ -467,6 +467,7 @@ static unsigned long __init lance_probe1( struct net_device *dev,
int i; int i;
static int did_version; static int did_version;
unsigned short save1, save2; unsigned short save1, save2;
DECLARE_MAC_BUF(mac);
PROBE_PRINT(( "Probing for Lance card at mem %#lx io %#lx\n", PROBE_PRINT(( "Probing for Lance card at mem %#lx io %#lx\n",
(long)memaddr, (long)ioaddr )); (long)memaddr, (long)ioaddr ));
@ -595,8 +596,7 @@ static unsigned long __init lance_probe1( struct net_device *dev,
i = IO->mem; i = IO->mem;
break; break;
} }
for( i = 0; i < 6; ++i ) printk("%s\n", print_mac(mac, dev->dev_addr));
printk( "%02x%s", dev->dev_addr[i], (i < 5) ? ":" : "\n" );
if (lp->cardtype == OLD_RIEBL) { if (lp->cardtype == OLD_RIEBL) {
printk( "%s: Warning: This is a default ethernet address!\n", printk( "%s: Warning: This is a default ethernet address!\n",
dev->name ); dev->name );
@ -779,6 +779,8 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
int entry, len; int entry, len;
struct lance_tx_head *head; struct lance_tx_head *head;
unsigned long flags; unsigned long flags;
DECLARE_MAC_BUF(mac);
DECLARE_MAC_BUF(mac2);
DPRINTK( 2, ( "%s: lance_start_xmit() called, csr0 %4.4x.\n", DPRINTK( 2, ( "%s: lance_start_xmit() called, csr0 %4.4x.\n",
dev->name, DREG )); dev->name, DREG ));
@ -801,17 +803,13 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
/* Fill in a Tx ring entry */ /* Fill in a Tx ring entry */
if (lance_debug >= 3) { if (lance_debug >= 3) {
u_char *p; printk( "%s: TX pkt type 0x%04x from "
int i; "%s to %s"
printk( "%s: TX pkt type 0x%04x from ", dev->name, " data at 0x%08x len %d\n",
((u_short *)skb->data)[6]); dev->name, ((u_short *)skb->data)[6],
for( p = &((u_char *)skb->data)[6], i = 0; i < 6; i++ ) print_mac(mac, &skb->data[6]),
printk("%02x%s", *p++, i != 5 ? ":" : "" ); print_mac(mac2, skb->data),
printk(" to "); (int)skb->data, (int)skb->len );
for( p = (u_char *)skb->data, i = 0; i < 6; i++ )
printk("%02x%s", *p++, i != 5 ? ":" : "" );
printk(" data at 0x%08x len %d\n", (int)skb->data,
(int)skb->len );
} }
/* We're not prepared for the int until the last flags are set/reset. And /* We're not prepared for the int until the last flags are set/reset. And
@ -1021,19 +1019,18 @@ static int lance_rx( struct net_device *dev )
} }
if (lance_debug >= 3) { if (lance_debug >= 3) {
u_char *data = PKTBUF_ADDR(head), *p; u_char *data = PKTBUF_ADDR(head);
printk( "%s: RX pkt type 0x%04x from ", dev->name, DECLARE_MAC_BUF(mac);
((u_short *)data)[6]); DECLARE_MAC_BUF(mac2);
for( p = &data[6], i = 0; i < 6; i++ )
printk("%02x%s", *p++, i != 5 ? ":" : "" ); printk(KERN_DEBUG "%s: RX pkt type 0x%04x from %s to %s ",
printk(" to "); "data %02x %02x %02x %02x %02x %02x %02x %02x "
for( p = data, i = 0; i < 6; i++ )
printk("%02x%s", *p++, i != 5 ? ":" : "" );
printk(" data %02x %02x %02x %02x %02x %02x %02x %02x "
"len %d\n", "len %d\n",
dev->name, ((u_short *)data)[6],
print_mac(mac, &data[6]), print_mac(mac2, data),
data[15], data[16], data[17], data[18], data[15], data[16], data[17], data[18],
data[19], data[20], data[21], data[22], data[19], data[20], data[21], data[22],
pkt_len ); pkt_len);
} }
skb_reserve( skb, 2 ); /* 16 byte align */ skb_reserve( skb, 2 ); /* 16 byte align */

View File

@ -248,6 +248,7 @@ static int __init atp_probe1(long ioaddr)
struct net_local *lp; struct net_local *lp;
int saved_ctrl_reg, status, i; int saved_ctrl_reg, status, i;
int res; int res;
DECLARE_MAC_BUF(mac);
outb(0xff, ioaddr + PAR_DATA); outb(0xff, ioaddr + PAR_DATA);
/* Save the original value of the Control register, in case we guessed /* Save the original value of the Control register, in case we guessed
@ -322,10 +323,9 @@ static int __init atp_probe1(long ioaddr)
printk(KERN_INFO "%s", version); printk(KERN_INFO "%s", version);
#endif #endif
printk(KERN_NOTICE "%s: Pocket adapter found at %#3lx, IRQ %d, SAPROM " printk(KERN_NOTICE "%s: Pocket adapter found at %#3lx, IRQ %d, "
"%02X:%02X:%02X:%02X:%02X:%02X.\n", dev->name, dev->base_addr, "SAPROM %s.\n",
dev->irq, dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], dev->name, dev->base_addr, dev->irq, print_mac(mac, dev->dev_addr));
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
/* Reset the ethernet hardware and activate the printer pass-through. */ /* Reset the ethernet hardware and activate the printer pass-through. */
write_reg_high(ioaddr, CMR1, CMR1h_RESET | CMR1h_MUX); write_reg_high(ioaddr, CMR1, CMR1h_RESET | CMR1h_MUX);

View File

@ -2100,7 +2100,8 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
unsigned long b44reg_base, b44reg_len; unsigned long b44reg_base, b44reg_len;
struct net_device *dev; struct net_device *dev;
struct b44 *bp; struct b44 *bp;
int err, i; int err;
DECLARE_MAC_BUF(mac);
if (b44_version_printed++ == 0) if (b44_version_printed++ == 0)
printk(KERN_INFO "%s", version); printk(KERN_INFO "%s", version);
@ -2229,10 +2230,8 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
*/ */
b44_chip_reset(bp); b44_chip_reset(bp);
printk(KERN_INFO "%s: Broadcom 4400 10/100BaseT Ethernet ", dev->name); printk(KERN_INFO "%s: Broadcom 4400 10/100BaseT Ethernet %s\n",
for (i = 0; i < 6; i++) dev->name, print_mac(mac, dev->dev_addr));
printk("%2.2x%c", dev->dev_addr[i],
i == 5 ? '\n' : ':');
return 0; return 0;

View File

@ -1258,6 +1258,7 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
unsigned char addr[6]; unsigned char addr[6];
struct net_device *dev; struct net_device *dev;
int is_bmac_plus = ((int)match->data) != 0; int is_bmac_plus = ((int)match->data) != 0;
DECLARE_MAC_BUF(mac);
if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) { if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) {
printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n"); printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n");
@ -1367,9 +1368,8 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
goto err_out_irq2; goto err_out_irq2;
} }
printk(KERN_INFO "%s: BMAC%s at", dev->name, (is_bmac_plus? "+": "")); printk(KERN_INFO "%s: BMAC%s at %s",
for (j = 0; j < 6; ++j) dev->name, (is_bmac_plus ? "+" : ""), print_mac(mac, dev->dev_addr));
printk("%c%.2x", (j? ':': ' '), dev->dev_addr[j]);
XXDEBUG((", base_addr=%#0lx", dev->base_addr)); XXDEBUG((", base_addr=%#0lx", dev->base_addr));
printk("\n"); printk("\n");

View File

@ -6821,8 +6821,9 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
static int version_printed = 0; static int version_printed = 0;
struct net_device *dev = NULL; struct net_device *dev = NULL;
struct bnx2 *bp; struct bnx2 *bp;
int rc, i; int rc;
char str[40]; char str[40];
DECLARE_MAC_BUF(mac);
if (version_printed++ == 0) if (version_printed++ == 0)
printk(KERN_INFO "%s", version); printk(KERN_INFO "%s", version);
@ -6890,19 +6891,14 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
} }
printk(KERN_INFO "%s: %s (%c%d) %s found at mem %lx, " printk(KERN_INFO "%s: %s (%c%d) %s found at mem %lx, "
"IRQ %d, ", "IRQ %d, node addr %s\n",
dev->name, dev->name,
bp->name, bp->name,
((CHIP_ID(bp) & 0xf000) >> 12) + 'A', ((CHIP_ID(bp) & 0xf000) >> 12) + 'A',
((CHIP_ID(bp) & 0x0ff0) >> 4), ((CHIP_ID(bp) & 0x0ff0) >> 4),
bnx2_bus_string(bp, str), bnx2_bus_string(bp, str),
dev->base_addr, dev->base_addr,
bp->pdev->irq); bp->pdev->irq, print_mac(mac, dev->dev_addr));
printk("node addr ");
for (i = 0; i < 6; i++)
printk("%2.2x", dev->dev_addr[i]);
printk("\n");
return 0; return 0;
} }

View File

@ -1604,6 +1604,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
struct slave *slave, *oldcurrent; struct slave *slave, *oldcurrent;
struct sockaddr addr; struct sockaddr addr;
int mac_addr_differ; int mac_addr_differ;
DECLARE_MAC_BUF(mac);
/* slave is not a slave or master is not master of this slave */ /* slave is not a slave or master is not master of this slave */
if (!(slave_dev->flags & IFF_SLAVE) || if (!(slave_dev->flags & IFF_SLAVE) ||
@ -1631,19 +1632,13 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
ETH_ALEN); ETH_ALEN);
if (!mac_addr_differ && (bond->slave_cnt > 1)) { if (!mac_addr_differ && (bond->slave_cnt > 1)) {
printk(KERN_WARNING DRV_NAME printk(KERN_WARNING DRV_NAME
": %s: Warning: the permanent HWaddr of %s " ": %s: Warning: the permanent HWaddr of %s - "
"- %02X:%02X:%02X:%02X:%02X:%02X - is " "%s - is still in use by %s. "
"still in use by %s. Set the HWaddr of " "Set the HWaddr of %s to a different address "
"%s to a different address to avoid " "to avoid conflicts.\n",
"conflicts.\n",
bond_dev->name, bond_dev->name,
slave_dev->name, slave_dev->name,
slave->perm_hwaddr[0], print_mac(mac, slave->perm_hwaddr),
slave->perm_hwaddr[1],
slave->perm_hwaddr[2],
slave->perm_hwaddr[3],
slave->perm_hwaddr[4],
slave->perm_hwaddr[5],
bond_dev->name, bond_dev->name,
slave_dev->name); slave_dev->name);
} }
@ -3006,6 +3001,7 @@ static void bond_info_show_master(struct seq_file *seq)
if (bond->params.mode == BOND_MODE_8023AD) { if (bond->params.mode == BOND_MODE_8023AD) {
struct ad_info ad_info; struct ad_info ad_info;
DECLARE_MAC_BUF(mac);
seq_puts(seq, "\n802.3ad info\n"); seq_puts(seq, "\n802.3ad info\n");
seq_printf(seq, "LACP rate: %s\n", seq_printf(seq, "LACP rate: %s\n",
@ -3025,13 +3021,8 @@ static void bond_info_show_master(struct seq_file *seq)
ad_info.actor_key); ad_info.actor_key);
seq_printf(seq, "\tPartner Key: %d\n", seq_printf(seq, "\tPartner Key: %d\n",
ad_info.partner_key); ad_info.partner_key);
seq_printf(seq, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n", seq_printf(seq, "\tPartner Mac Address: %s\n",
ad_info.partner_system[0], print_mac(mac, ad_info.partner_system));
ad_info.partner_system[1],
ad_info.partner_system[2],
ad_info.partner_system[3],
ad_info.partner_system[4],
ad_info.partner_system[5]);
} }
} }
} }
@ -3039,6 +3030,7 @@ static void bond_info_show_master(struct seq_file *seq)
static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave) static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave)
{ {
struct bonding *bond = seq->private; struct bonding *bond = seq->private;
DECLARE_MAC_BUF(mac);
seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
seq_printf(seq, "MII Status: %s\n", 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
slave->link_failure_count); slave->link_failure_count);
seq_printf(seq, seq_printf(seq,
"Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n", "Permanent HW addr: %s\n",
slave->perm_hwaddr[0], slave->perm_hwaddr[1], print_mac(mac, slave->perm_hwaddr));
slave->perm_hwaddr[2], slave->perm_hwaddr[3],
slave->perm_hwaddr[4], slave->perm_hwaddr[5]);
if (bond->params.mode == BOND_MODE_8023AD) { if (bond->params.mode == BOND_MODE_8023AD) {
const struct aggregator *agg const struct aggregator *agg

View File

@ -1361,17 +1361,14 @@ static ssize_t bonding_show_ad_partner_mac(struct device *d,
{ {
int count = 0; int count = 0;
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
DECLARE_MAC_BUF(mac);
if (bond->params.mode == BOND_MODE_8023AD) { if (bond->params.mode == BOND_MODE_8023AD) {
struct ad_info ad_info; struct ad_info ad_info;
if (!bond_3ad_get_active_agg_info(bond, &ad_info)) { if (!bond_3ad_get_active_agg_info(bond, &ad_info)) {
count = sprintf(buf,"%02x:%02x:%02x:%02x:%02x:%02x\n", count = sprintf(buf,"%s\n",
ad_info.partner_system[0], print_mac(mac, ad_info.partner_system))
ad_info.partner_system[1], + 1;
ad_info.partner_system[2],
ad_info.partner_system[3],
ad_info.partner_system[4],
ad_info.partner_system[5]) + 1;
} }
} }
else else

View File

@ -4877,6 +4877,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
int i, err, pci_using_dac; int i, err, pci_using_dac;
u16 pci_cmd; u16 pci_cmd;
u8 orig_cacheline_size = 0, cas_cacheline_size = 0; u8 orig_cacheline_size = 0, cas_cacheline_size = 0;
DECLARE_MAC_BUF(mac);
if (cas_version_printed++ == 0) if (cas_version_printed++ == 0)
printk(KERN_INFO "%s", version); printk(KERN_INFO "%s", version);
@ -5084,16 +5085,12 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
i = readl(cp->regs + REG_BIM_CFG); i = readl(cp->regs + REG_BIM_CFG);
printk(KERN_INFO "%s: Sun Cassini%s (%sbit/%sMHz PCI/%s) " printk(KERN_INFO "%s: Sun Cassini%s (%sbit/%sMHz PCI/%s) "
"Ethernet[%d] ", dev->name, "Ethernet[%d] %s\n", dev->name,
(cp->cas_flags & CAS_FLAG_REG_PLUS) ? "+" : "", (cp->cas_flags & CAS_FLAG_REG_PLUS) ? "+" : "",
(i & BIM_CFG_32BIT) ? "32" : "64", (i & BIM_CFG_32BIT) ? "32" : "64",
(i & BIM_CFG_66MHZ) ? "66" : "33", (i & BIM_CFG_66MHZ) ? "66" : "33",
(cp->phy_type == CAS_PHY_SERDES) ? "Fi" : "Cu", pdev->irq); (cp->phy_type == CAS_PHY_SERDES) ? "Fi" : "Cu", pdev->irq,
print_mac(mac, dev->dev_addr));
for (i = 0; i < 6; i++)
printk("%2.2x%c", dev->dev_addr[i],
i == 5 ? ' ' : ':');
printk("\n");
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
cp->hw_running = 1; cp->hw_running = 1;

View File

@ -618,12 +618,8 @@ e100_set_mac_address(struct net_device *dev, void *p)
/* show it in the log as well */ /* show it in the log as well */
printk(KERN_INFO "%s: changed MAC to ", dev->name); printk(KERN_INFO "%s: changed MAC to %s\n",
dev->name, print_mac(mac, dev->dev_addr));
for (i = 0; i < 5; i++)
printk("%02X:", dev->dev_addr[i]);
printk("%02X\n", dev->dev_addr[i]);
spin_unlock(&np->lock); spin_unlock(&np->lock);

View File

@ -516,6 +516,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
unsigned rev_type = 0; unsigned rev_type = 0;
int eeprom_buff[CHKSUM_LEN]; int eeprom_buff[CHKSUM_LEN];
int retval; int retval;
DECLARE_MAC_BUF(mac);
/* Initialize the device structure. */ /* Initialize the device structure. */
if (!modular) { if (!modular) {
@ -840,11 +841,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
} }
/* print the ethernet address. */ /* print the ethernet address. */
printk(", MAC"); printk(", MAC %s", print_mac(mac, dev->dev_addr));
for (i = 0; i < ETH_ALEN; i++)
{
printk("%c%02x", i ? ':' : ' ', dev->dev_addr[i]);
}
dev->open = net_open; dev->open = net_open;
dev->stop = net_close; dev->stop = net_close;
@ -1806,17 +1803,15 @@ static int set_mac_address(struct net_device *dev, void *p)
int i; int i;
struct sockaddr *addr = p; struct sockaddr *addr = p;
if (netif_running(dev)) if (netif_running(dev))
return -EBUSY; return -EBUSY;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
if (net_debug) { if (net_debug) {
printk("%s: Setting MAC address to ", dev->name); DECLARE_MAC_BUF(mac);
for (i = 0; i < dev->addr_len; i++) printk("%s: Setting MAC address to %s.\n",
printk(" %2.2x", dev->dev_addr[i]); dev->name, print_mac(mac, dev->dev_addr));
printk(".\n");
} }
/* set the Ethernet address */ /* set the Ethernet address */
for (i=0; i < ETH_ALEN/2; i++) for (i=0; i < ETH_ALEN/2; i++)

View File

@ -384,6 +384,7 @@ static struct net_device * __init de600_probe(void)
int i; int i;
struct net_device *dev; struct net_device *dev;
int err; int err;
DECLARE_MAC_BUF(mac);
dev = alloc_etherdev(0); dev = alloc_etherdev(0);
if (!dev) if (!dev)
@ -438,10 +439,7 @@ static struct net_device * __init de600_probe(void)
goto out1; goto out1;
} }
printk(", Ethernet Address: %02X", dev->dev_addr[0]); printk(", Ethernet Address: %s\n", print_mac(mac, dev->dev_addr));
for (i = 1; i < ETH_ALEN; i++)
printk(":%02X",dev->dev_addr[i]);
printk("\n");
dev->open = de600_open; dev->open = de600_open;
dev->stop = de600_close; dev->stop = de600_close;

View File

@ -807,6 +807,7 @@ struct net_device * __init de620_probe(int unit)
struct net_device *dev; struct net_device *dev;
int err = -ENOMEM; int err = -ENOMEM;
int i; int i;
DECLARE_MAC_BUF(mac);
dev = alloc_etherdev(0); dev = alloc_etherdev(0);
if (!dev) if (!dev)
@ -853,13 +854,14 @@ struct net_device * __init de620_probe(int unit)
} }
/* else, got it! */ /* else, got it! */
printk(", Ethernet Address: %2.2X", dev->dev_addr[0] = nic_data.NodeID[0];
dev->dev_addr[0] = nic_data.NodeID[0]);
for (i = 1; i < ETH_ALEN; i++) { for (i = 1; i < ETH_ALEN; i++) {
printk(":%2.2X", dev->dev_addr[i] = nic_data.NodeID[i]); dev->dev_addr[i] = nic_data.NodeID[i];
dev->broadcast[i] = 0xff; dev->broadcast[i] = 0xff;
} }
printk(", Ethernet Address: %s", print_mac(mac, dev->dev_addr));
printk(" (%dk RAM,", printk(" (%dk RAM,",
(nic_data.RAM_Size) ? (nic_data.RAM_Size >> 2) : 64); (nic_data.RAM_Size) ? (nic_data.RAM_Size >> 2) : 64);

View File

@ -1027,6 +1027,7 @@ static int __init dec_lance_probe(struct device *bdev, const int type)
int i, ret; int i, ret;
unsigned long esar_base; unsigned long esar_base;
unsigned char *esar; unsigned char *esar;
DECLARE_MAC_BUF(mac);
if (dec_lance_debug && version_printed++ == 0) if (dec_lance_debug && version_printed++ == 0)
printk(version); printk(version);
@ -1214,21 +1215,20 @@ static int __init dec_lance_probe(struct device *bdev, const int type)
*/ */
switch (type) { switch (type) {
case ASIC_LANCE: case ASIC_LANCE:
printk("%s: IOASIC onboard LANCE, addr = ", name); printk("%s: IOASIC onboard LANCE", name);
break; break;
case PMAD_LANCE: case PMAD_LANCE:
printk("%s: PMAD-AA, addr = ", name); printk("%s: PMAD-AA", name);
break; break;
case PMAX_LANCE: case PMAX_LANCE:
printk("%s: PMAX onboard LANCE, addr = ", name); printk("%s: PMAX onboard LANCE", name);
break; break;
} }
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++)
dev->dev_addr[i] = esar[i * 4]; dev->dev_addr[i] = esar[i * 4];
printk("%2.2x%c", dev->dev_addr[i], i == 5 ? ',' : ':');
}
printk(" irq = %d\n", dev->irq); printk(", addr = %s, irq = %d\n",
print_mac(mac, dev->dev_addr), dev->irq);
dev->open = &lance_open; dev->open = &lance_open;
dev->stop = &lance_close; dev->stop = &lance_close;

View File

@ -573,6 +573,7 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
s16 nicsr; s16 nicsr;
u_long ioaddr; u_long ioaddr;
u_long mem_start; u_long mem_start;
DECLARE_MAC_BUF(mac);
/* /*
* We are now supposed to enter this function with the * We are now supposed to enter this function with the
@ -632,14 +633,11 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
printk(", h/w address "); printk(", h/w address ");
status = get_hw_addr(dev); status = get_hw_addr(dev);
printk("%s", print_mac(mac, dev->dev_addr));
if (status != 0) { if (status != 0) {
printk(" which has an Ethernet PROM CRC error.\n"); printk(" which has an Ethernet PROM CRC error.\n");
return -ENXIO; return -ENXIO;
} }
for (i = 0; i < ETH_ALEN - 1; i++) { /* get the ethernet address */
printk("%2.2x:", dev->dev_addr[i]);
}
printk("%2.2x", dev->dev_addr[i]);
/* Set up the maximum amount of network RAM(kB) */ /* Set up the maximum amount of network RAM(kB) */
netRAM = ((lp->adapter != DEPCA) ? 64 : 48); netRAM = ((lp->adapter != DEPCA) ? 64 : 48);
@ -1843,6 +1841,7 @@ static void depca_dbg_open(struct net_device *dev)
u_long ioaddr = dev->base_addr; u_long ioaddr = dev->base_addr;
struct depca_init *p = &lp->init_block; struct depca_init *p = &lp->init_block;
int i; int i;
DECLARE_MAC_BUF(mac);
if (depca_debug > 1) { if (depca_debug > 1) {
/* Do not copy the shadow init block into shared memory */ /* Do not copy the shadow init block into shared memory */
@ -1881,11 +1880,7 @@ static void depca_dbg_open(struct net_device *dev)
printk("...0x%8.8x\n", readl(&lp->tx_ring[i].base)); printk("...0x%8.8x\n", readl(&lp->tx_ring[i].base));
printk("Initialisation block at 0x%8.8lx(Phys)\n", lp->mem_start); printk("Initialisation block at 0x%8.8lx(Phys)\n", lp->mem_start);
printk(" mode: 0x%4.4x\n", p->mode); printk(" mode: 0x%4.4x\n", p->mode);
printk(" physical address: "); printk(" physical address: %s\n", print_mac(mac, p->phys_addr));
for (i = 0; i < ETH_ALEN - 1; i++) {
printk("%2.2x:", p->phys_addr[i]);
}
printk("%2.2x\n", p->phys_addr[i]);
printk(" multicast hash table: "); printk(" multicast hash table: ");
for (i = 0; i < (HASH_TABLE_LEN >> 3) - 1; i++) { for (i = 0; i < (HASH_TABLE_LEN >> 3) - 1; i++) {
printk("%2.2x:", p->mcast_table[i]); printk("%2.2x:", p->mcast_table[i]);

View File

@ -1139,6 +1139,7 @@ dgrs_probe1(struct net_device *dev)
DGRS_PRIV *priv = (DGRS_PRIV *) dev->priv; DGRS_PRIV *priv = (DGRS_PRIV *) dev->priv;
unsigned long i; unsigned long i;
int rc; int rc;
DECLARE_MAC_BUF(mac);
printk("%s: Digi RightSwitch io=%lx mem=%lx irq=%d plx=%lx dma=%lx\n", printk("%s: Digi RightSwitch io=%lx mem=%lx irq=%d plx=%lx dma=%lx\n",
dev->name, dev->base_addr, dev->mem_start, dev->irq, dev->name, dev->base_addr, dev->mem_start, dev->irq,
@ -1154,11 +1155,9 @@ dgrs_probe1(struct net_device *dev)
/* /*
* Get ether address of board * Get ether address of board
*/ */
printk("%s: Ethernet address", dev->name);
memcpy(dev->dev_addr, priv->port->ethaddr, 6); memcpy(dev->dev_addr, priv->port->ethaddr, 6);
for (i = 0; i < 6; ++i) printk("%s: Ethernet address %s\n",
printk("%c%2.2x", i ? ':' : ' ', dev->dev_addr[i]); dev->name, print_mac(mac, dev->dev_addr));
printk("\n");
if (dev->dev_addr[0] & 1) if (dev->dev_addr[0] & 1)
{ {
@ -1214,15 +1213,12 @@ static int __init
dgrs_initclone(struct net_device *dev) dgrs_initclone(struct net_device *dev)
{ {
DGRS_PRIV *priv = (DGRS_PRIV *) dev->priv; DGRS_PRIV *priv = (DGRS_PRIV *) dev->priv;
int i; DECLARE_MAC_BUF(mac);
printk("%s: Digi RightSwitch port %d ", printk("%s: Digi RightSwitch port %d %s\n",
dev->name, priv->chan); dev->name, priv->chan, print_mac(mac, dev->dev_addr));
for (i = 0; i < 6; ++i)
printk("%c%2.2x", i ? ':' : ' ', dev->dev_addr[i]);
printk("\n");
return (0); return 0;
} }
static struct net_device * __init static struct net_device * __init

View File

@ -97,6 +97,7 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
static int version_printed; static int version_printed;
void *ring_space; void *ring_space;
dma_addr_t ring_dma; dma_addr_t ring_dma;
DECLARE_MAC_BUF(mac);
if (!version_printed++) if (!version_printed++)
printk ("%s", version); printk ("%s", version);
@ -256,10 +257,8 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
card_idx++; card_idx++;
printk (KERN_INFO "%s: %s, %02x:%02x:%02x:%02x:%02x:%02x, IRQ %d\n", printk (KERN_INFO "%s: %s, %s, IRQ %d\n",
dev->name, np->name, dev->name, np->name, print_mac(mac, dev->dev_addr), irq);
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5], irq);
if (tx_coalesce > 1) if (tx_coalesce > 1)
printk(KERN_INFO "tx_coalesce:\t%d packets\n", printk(KERN_INFO "tx_coalesce:\t%d packets\n",
tx_coalesce); tx_coalesce);

View File

@ -595,11 +595,10 @@ dm9000_probe(struct platform_device *pdev)
ret = register_netdev(ndev); ret = register_netdev(ndev);
if (ret == 0) { if (ret == 0) {
printk("%s: dm9000 at %p,%p IRQ %d MAC: ", DECLARE_MAC_BUF(mac);
ndev->name, db->io_addr, db->io_data, ndev->irq); printk("%s: dm9000 at %p,%p IRQ %d MAC: %s\n",
for (i = 0; i < 5; i++) ndev->name, db->io_addr, db->io_data, ndev->irq,
printk("%02x:", ndev->dev_addr[i]); print_mac(mac, ndev->dev_addr));
printk("%02x\n", ndev->dev_addr[5]);
} }
return 0; return 0;

View File

@ -2548,6 +2548,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
struct net_device *netdev; struct net_device *netdev;
struct nic *nic; struct nic *nic;
int err; int err;
DECLARE_MAC_BUF(mac);
if(!(netdev = alloc_etherdev(sizeof(struct nic)))) { if(!(netdev = alloc_etherdev(sizeof(struct nic)))) {
if(((1 << debug) - 1) & NETIF_MSG_PROBE) if(((1 << debug) - 1) & NETIF_MSG_PROBE)
@ -2679,11 +2680,9 @@ static int __devinit e100_probe(struct pci_dev *pdev,
goto err_out_free; goto err_out_free;
} }
DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, " DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %s\n",
"MAC addr %02X:%02X:%02X:%02X:%02X:%02X\n", (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0),
(unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0), pdev->irq, pdev->irq, print_mac(mac, netdev->dev_addr));
netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2],
netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]);
return 0; return 0;

View File

@ -872,6 +872,8 @@ e1000_probe(struct pci_dev *pdev,
int i, err, pci_using_dac; int i, err, pci_using_dac;
uint16_t eeprom_data = 0; uint16_t eeprom_data = 0;
uint16_t eeprom_apme_mask = E1000_EEPROM_APME; uint16_t eeprom_apme_mask = E1000_EEPROM_APME;
DECLARE_MAC_BUF(mac);
if ((err = pci_enable_device(pdev))) if ((err = pci_enable_device(pdev)))
return err; return err;
@ -1132,8 +1134,7 @@ e1000_probe(struct pci_dev *pdev,
"32-bit")); "32-bit"));
} }
for (i = 0; i < 6; i++) printk("%s\n", print_mac(mac, netdev->dev_addr));
printk("%2.2x%c", netdev->dev_addr[i], i == 5 ? '\n' : ':');
/* reset the hardware with the new settings */ /* reset the hardware with the new settings */
e1000_reset(adapter); e1000_reset(adapter);

View File

@ -690,6 +690,7 @@ static void __init eepro_print_info (struct net_device *dev)
struct eepro_local * lp = netdev_priv(dev); struct eepro_local * lp = netdev_priv(dev);
int i; int i;
const char * ifmap[] = {"AUI", "10Base2", "10BaseT"}; const char * ifmap[] = {"AUI", "10Base2", "10BaseT"};
DECLARE_MAC_BUF(mac);
i = inb(dev->base_addr + ID_REG); i = inb(dev->base_addr + ID_REG);
printk(KERN_DEBUG " id: %#x ",i); printk(KERN_DEBUG " id: %#x ",i);
@ -711,10 +712,10 @@ static void __init eepro_print_info (struct net_device *dev)
case LAN595: case LAN595:
printk("%s: Intel 82595-based lan card at %#x,", printk("%s: Intel 82595-based lan card at %#x,",
dev->name, (unsigned)dev->base_addr); dev->name, (unsigned)dev->base_addr);
break;
} }
for (i=0; i < 6; i++) printk(" %s", print_mac(mac, dev->dev_addr));
printk("%c%02x", i ? ':' : ' ', dev->dev_addr[i]);
if (net_debug > 3) if (net_debug > 3)
printk(KERN_DEBUG ", %dK RCV buffer", printk(KERN_DEBUG ", %dK RCV buffer",

View File

@ -622,6 +622,7 @@ static int __devinit speedo_found1(struct pci_dev *pdev,
int size; int size;
void *tx_ring_space; void *tx_ring_space;
dma_addr_t tx_ring_dma; dma_addr_t tx_ring_dma;
DECLARE_MAC_BUF(mac);
size = TX_RING_SIZE * sizeof(struct TxFD) + sizeof(struct speedo_stats); size = TX_RING_SIZE * sizeof(struct TxFD) + sizeof(struct speedo_stats);
tx_ring_space = pci_alloc_consistent(pdev, size, &tx_ring_dma); tx_ring_space = pci_alloc_consistent(pdev, size, &tx_ring_dma);
@ -705,12 +706,8 @@ static int __devinit speedo_found1(struct pci_dev *pdev,
else else
product = pci_name(pdev); product = pci_name(pdev);
printk(KERN_INFO "%s: %s, ", dev->name, product); printk(KERN_INFO "%s: %s, %s, IRQ %d.\n", dev->name, product,
print_mac(mac, dev->dev_addr), pdev->irq);
for (i = 0; i < 5; i++)
printk("%2.2X:", dev->dev_addr[i]);
printk("%2.2X, ", dev->dev_addr[i]);
printk("IRQ %d.\n", pdev->irq);
sp = netdev_priv(dev); sp = netdev_priv(dev);

View File

@ -317,6 +317,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
int i, ret, option = 0, duplex = 0; int i, ret, option = 0, duplex = 0;
void *ring_space; void *ring_space;
dma_addr_t ring_dma; dma_addr_t ring_dma;
DECLARE_MAC_BUF(mac);
/* when built into the kernel, we only print version if device is found */ /* when built into the kernel, we only print version if device is found */
#ifndef MODULE #ifndef MODULE
@ -493,11 +494,9 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
if (ret < 0) if (ret < 0)
goto err_out_unmap_rx; goto err_out_unmap_rx;
printk(KERN_INFO "%s: %s at %#lx, IRQ %d, ", printk(KERN_INFO "%s: %s at %#lx, IRQ %d, %s\n",
dev->name, pci_id_tbl[chip_idx].name, ioaddr, dev->irq); dev->name, pci_id_tbl[chip_idx].name, ioaddr, dev->irq,
for (i = 0; i < 5; i++) print_mac(mac, dev->dev_addr));
printk("%2.2x:", dev->dev_addr[i]);
printk("%2.2x.\n", dev->dev_addr[i]);
out: out:
return ret; return ret;

View File

@ -179,6 +179,7 @@ static int __init es_probe1(struct net_device *dev, int ioaddr)
{ {
int i, retval; int i, retval;
unsigned long eisa_id; unsigned long eisa_id;
DECLARE_MAC_BUF(mac);
if (!request_region(ioaddr + ES_SA_PROM, ES_IO_EXTENT, "es3210")) if (!request_region(ioaddr + ES_SA_PROM, ES_IO_EXTENT, "es3210"))
return -ENODEV; return -ENODEV;
@ -190,7 +191,6 @@ static int __init es_probe1(struct net_device *dev, int ioaddr)
inb(ioaddr + ES_CFG4), inb(ioaddr + ES_CFG5), inb(ioaddr + ES_CFG6)); inb(ioaddr + ES_CFG4), inb(ioaddr + ES_CFG5), inb(ioaddr + ES_CFG6));
#endif #endif
/* Check the EISA ID of the card. */ /* Check the EISA ID of the card. */
eisa_id = inl(ioaddr + ES_ID_PORT); eisa_id = inl(ioaddr + ES_ID_PORT);
if ((eisa_id != ES_EISA_ID1) && (eisa_id != ES_EISA_ID2)) { if ((eisa_id != ES_EISA_ID1) && (eisa_id != ES_EISA_ID2)) {
@ -198,21 +198,21 @@ static int __init es_probe1(struct net_device *dev, int ioaddr)
goto out; goto out;
} }
for (i = 0; i < ETHER_ADDR_LEN ; i++)
dev->dev_addr[i] = inb(ioaddr + ES_SA_PROM + i);
/* Check the Racal vendor ID as well. */ /* Check the Racal vendor ID as well. */
if (inb(ioaddr + ES_SA_PROM + 0) != ES_ADDR0 if (dev->dev_addr[0] != ES_ADDR0 ||
|| inb(ioaddr + ES_SA_PROM + 1) != ES_ADDR1 dev->dev_addr[1] != ES_ADDR1 ||
|| inb(ioaddr + ES_SA_PROM + 2) != ES_ADDR2 ) { dev->dev_addr[2] != ES_ADDR2) {
printk("es3210.c: card not found"); printk("es3210.c: card not found %s (invalid_prefix).\n",
for(i = 0; i < ETHER_ADDR_LEN; i++) print_mac(mac, dev->dev_addr));
printk(" %02x", inb(ioaddr + ES_SA_PROM + i));
printk(" (invalid prefix).\n");
retval = -ENODEV; retval = -ENODEV;
goto out; goto out;
} }
printk("es3210.c: ES3210 rev. %ld at %#x, node", eisa_id>>24, ioaddr); printk("es3210.c: ES3210 rev. %ld at %#x, node %s",
for(i = 0; i < ETHER_ADDR_LEN; i++) eisa_id>>24, ioaddr, print_mac(mac, dev->dev_addr));
printk(" %02x", (dev->dev_addr[i] = inb(ioaddr + ES_SA_PROM + i)));
/* Snarf the interrupt now. */ /* Snarf the interrupt now. */
if (dev->irq == 0) { if (dev->irq == 0) {

View File

@ -396,6 +396,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
u_long mem_start, shmem_length; u_long mem_start, shmem_length;
u_char cr, cmr, icr, nicsr, lemac, hard_strapped = 0; u_char cr, cmr, icr, nicsr, lemac, hard_strapped = 0;
u_char eeprom_image[EEPROM_MAX], chksum, eisa_cr = 0; u_char eeprom_image[EEPROM_MAX], chksum, eisa_cr = 0;
DECLARE_MAC_BUF(mac);
/* /*
** Stop the EWRK3. Enable the DBR ROM. Disable interrupts and remote boot. ** Stop the EWRK3. Enable the DBR ROM. Disable interrupts and remote boot.
@ -460,10 +461,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
if (lemac != LeMAC2) if (lemac != LeMAC2)
DevicePresent(iobase); /* need after EWRK3_INIT */ DevicePresent(iobase); /* need after EWRK3_INIT */
status = get_hw_addr(dev, eeprom_image, lemac); status = get_hw_addr(dev, eeprom_image, lemac);
for (i = 0; i < ETH_ALEN - 1; i++) { /* get the ethernet addr. */ printk("%s\n", print_mac(mac, dev->dev_addr));
printk("%2.2x:", dev->dev_addr[i]);
}
printk("%2.2x,\n", dev->dev_addr[i]);
if (status) { if (status) {
printk(" which has an EEPROM CRC error.\n"); printk(" which has an EEPROM CRC error.\n");
@ -628,7 +626,7 @@ static int ewrk3_open(struct net_device *dev)
{ {
struct ewrk3_private *lp = netdev_priv(dev); struct ewrk3_private *lp = netdev_priv(dev);
u_long iobase = dev->base_addr; u_long iobase = dev->base_addr;
int i, status = 0; int status = 0;
u_char icr, csr; u_char icr, csr;
/* /*
@ -648,12 +646,10 @@ static int ewrk3_open(struct net_device *dev)
ewrk3_init(dev); ewrk3_init(dev);
if (ewrk3_debug > 1) { if (ewrk3_debug > 1) {
DECLARE_MAC_BUF(mac);
printk("%s: ewrk3 open with irq %d\n", dev->name, dev->irq); printk("%s: ewrk3 open with irq %d\n", dev->name, dev->irq);
printk(" physical address: "); printk(" physical address: %s\n",
for (i = 0; i < 5; i++) { print_mac(mac, dev->dev_addr));
printk("%2.2x:", (u_char) dev->dev_addr[i]);
}
printk("%2.2x\n", (u_char) dev->dev_addr[i]);
if (lp->shmem_length == 0) { if (lp->shmem_length == 0) {
printk(" no shared memory, I/O only mode\n"); printk(" no shared memory, I/O only mode\n");
} else { } else {

View File

@ -486,6 +486,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
#else #else
int bar = 1; int bar = 1;
#endif #endif
DECLARE_MAC_BUF(mac);
/* when built into the kernel, we only print version if device is found */ /* when built into the kernel, we only print version if device is found */
#ifndef MODULE #ifndef MODULE
@ -664,11 +665,9 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
if (err) if (err)
goto err_out_free_tx; goto err_out_free_tx;
printk(KERN_INFO "%s: %s at %p, ", printk(KERN_INFO "%s: %s at %p, %s, IRQ %d.\n",
dev->name, skel_netdrv_tbl[chip_id].chip_name, ioaddr); dev->name, skel_netdrv_tbl[chip_id].chip_name, ioaddr,
for (i = 0; i < 5; i++) print_mac(mac, dev->dev_addr), irq);
printk("%2.2x:", dev->dev_addr[i]);
printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq);
return 0; return 0;

View File

@ -2635,6 +2635,7 @@ static int __init fec_enet_module_init(void)
{ {
struct net_device *dev; struct net_device *dev;
int i, j, err; int i, j, err;
DECLARE_MAC_BUF(mac);
printk("FEC ENET Version 0.2\n"); printk("FEC ENET Version 0.2\n");
@ -2653,10 +2654,8 @@ static int __init fec_enet_module_init(void)
return -EIO; return -EIO;
} }
printk("%s: ethernet ", dev->name); printk("%s: ethernet %s\n",
for (j = 0; (j < 5); j++) dev->name, print_mac(mac, dev->dev_addr));
printk("%02x:", dev->dev_addr[j]);
printk("%02x\n", dev->dev_addr[5]);
} }
return 0; return 0;
} }

View File

@ -4991,6 +4991,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
u32 powerstate, txreg; u32 powerstate, txreg;
u32 phystate_orig = 0, phystate; u32 phystate_orig = 0, phystate;
int phyinitialized = 0; int phyinitialized = 0;
DECLARE_MAC_BUF(mac);
dev = alloc_etherdev(sizeof(struct fe_priv)); dev = alloc_etherdev(sizeof(struct fe_priv));
err = -ENOMEM; err = -ENOMEM;
@ -5205,10 +5206,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
* Bad mac address. At least one bios sets the mac address * Bad mac address. At least one bios sets the mac address
* to 01:23:45:67:89:ab * to 01:23:45:67:89:ab
*/ */
printk(KERN_ERR "%s: Invalid Mac address detected: %02x:%02x:%02x:%02x:%02x:%02x\n", printk(KERN_ERR "%s: Invalid Mac address detected: %s\n",
pci_name(pci_dev), pci_name(pci_dev), print_mac(mac, dev->dev_addr));
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
printk(KERN_ERR "Please complain to your hardware vendor. Switching to a random MAC.\n"); printk(KERN_ERR "Please complain to your hardware vendor. Switching to a random MAC.\n");
dev->dev_addr[0] = 0x00; dev->dev_addr[0] = 0x00;
dev->dev_addr[1] = 0x00; dev->dev_addr[1] = 0x00;
@ -5216,9 +5215,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
get_random_bytes(&dev->dev_addr[3], 3); get_random_bytes(&dev->dev_addr[3], 3);
} }
dprintk(KERN_DEBUG "%s: MAC Address %02x:%02x:%02x:%02x:%02x:%02x\n", pci_name(pci_dev), dprintk(KERN_DEBUG "%s: MAC Address %s\n",
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], pci_name(pci_dev), print_mac(mac, dev->dev_addr));
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
/* set mac address */ /* set mac address */
nv_copy_mac_to_hw(dev); nv_copy_mac_to_hw(dev);

View File

@ -170,6 +170,7 @@ static int gfar_probe(struct platform_device *pdev)
struct resource *r; struct resource *r;
int idx; int idx;
int err = 0; int err = 0;
DECLARE_MAC_BUF(mac);
einfo = (struct gianfar_platform_data *) pdev->dev.platform_data; einfo = (struct gianfar_platform_data *) pdev->dev.platform_data;
@ -356,10 +357,8 @@ static int gfar_probe(struct platform_device *pdev)
gfar_init_sysfs(dev); gfar_init_sysfs(dev);
/* Print out the device info */ /* Print out the device info */
printk(KERN_INFO DEVICE_NAME, dev->name); printk(KERN_INFO DEVICE_NAME "%s\n",
for (idx = 0; idx < 6; idx++) dev->name, print_mac(mac, dev->dev_addr));
printk("%2.2x%c", dev->dev_addr[idx], idx == 5 ? ' ' : ':');
printk("\n");
/* Even more device info helps when determining which kernel */ /* Even more device info helps when determining which kernel */
/* provided which set of benchmarks. */ /* provided which set of benchmarks. */

View File

@ -580,6 +580,7 @@ static int __devinit hamachi_init_one (struct pci_dev *pdev,
void *ring_space; void *ring_space;
dma_addr_t ring_dma; dma_addr_t ring_dma;
int ret = -ENOMEM; int ret = -ENOMEM;
DECLARE_MAC_BUF(mac);
/* when built into the kernel, we only print version if device is found */ /* when built into the kernel, we only print version if device is found */
#ifndef MODULE #ifndef MODULE
@ -741,12 +742,9 @@ static int __devinit hamachi_init_one (struct pci_dev *pdev,
goto err_out_unmap_rx; goto err_out_unmap_rx;
} }
printk(KERN_INFO "%s: %s type %x at %p, ", printk(KERN_INFO "%s: %s type %x at %p, %s, IRQ %d.\n",
dev->name, chip_tbl[chip_id].name, readl(ioaddr + ChipRev), dev->name, chip_tbl[chip_id].name, readl(ioaddr + ChipRev),
ioaddr); ioaddr, print_mac(mac, dev->dev_addr), irq);
for (i = 0; i < 5; i++)
printk("%2.2x:", dev->dev_addr[i]);
printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq);
i = readb(ioaddr + PCIClkMeas); i = readb(ioaddr + PCIClkMeas);
printk(KERN_INFO "%s: %d-bit %d Mhz PCI bus (%d), Virtual Jumpers " printk(KERN_INFO "%s: %d-bit %d Mhz PCI bus (%d), Virtual Jumpers "
"%2.2x, LPA %4.4x.\n", "%2.2x, LPA %4.4x.\n",

View File

@ -64,7 +64,7 @@
#include <net/ax25.h> #include <net/ax25.h>
#include <linux/inet.h> #include <linux/inet.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/if_ether.h> #include <linux/etherdevice.h>
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <net/sock.h> #include <net/sock.h>
@ -95,7 +95,6 @@ static char bpq_eth_addr[6];
static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
static int bpq_device_event(struct notifier_block *, unsigned long, void *); static int bpq_device_event(struct notifier_block *, unsigned long, void *);
static const char *bpq_print_ethaddr(const unsigned char *);
static struct packet_type bpq_packet_type = { static struct packet_type bpq_packet_type = {
.type = __constant_htons(ETH_P_BPQ), .type = __constant_htons(ETH_P_BPQ),
@ -383,16 +382,6 @@ static int bpq_close(struct net_device *dev)
/* /*
* Proc filesystem * Proc filesystem
*/ */
static const char * bpq_print_ethaddr(const unsigned char *e)
{
static char buf[18];
sprintf(buf, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
e[0], e[1], e[2], e[3], e[4], e[5]);
return buf;
}
static void *bpq_seq_start(struct seq_file *seq, loff_t *pos) static void *bpq_seq_start(struct seq_file *seq, loff_t *pos)
{ {
int i = 1; int i = 1;
@ -438,14 +427,16 @@ static int bpq_seq_show(struct seq_file *seq, void *v)
"dev ether destination accept from\n"); "dev ether destination accept from\n");
else { else {
const struct bpqdev *bpqdev = v; const struct bpqdev *bpqdev = v;
DECLARE_MAC_BUF(mac);
seq_printf(seq, "%-5s %-10s %s ", seq_printf(seq, "%-5s %-10s %s ",
bpqdev->axdev->name, bpqdev->ethdev->name, bpqdev->axdev->name, bpqdev->ethdev->name,
bpq_print_ethaddr(bpqdev->dest_addr)); print_mac(mac, bpqdev->dest_addr));
seq_printf(seq, "%s\n", if (is_multicast_ether_addr(bpqdev->acpt_addr))
(bpqdev->acpt_addr[0] & 0x01) ? "*" seq_printf(seq, "*\n");
: bpq_print_ethaddr(bpqdev->acpt_addr)); else
seq_printf(seq, "%s\n", print_mac(mac, bpqdev->acpt_addr));
} }
return 0; return 0;

View File

@ -166,6 +166,7 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
const char name[] = "HP-PC-LAN+"; const char name[] = "HP-PC-LAN+";
int mem_start; int mem_start;
static unsigned version_printed; static unsigned version_printed;
DECLARE_MAC_BUF(mac);
if (!request_region(ioaddr, HP_IO_EXTENT, DRV_NAME)) if (!request_region(ioaddr, HP_IO_EXTENT, DRV_NAME))
return -EBUSY; return -EBUSY;
@ -180,7 +181,7 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
if (ei_debug && version_printed++ == 0) if (ei_debug && version_printed++ == 0)
printk(version); printk(version);
printk("%s: %s at %#3x,", dev->name, name, ioaddr); printk("%s: %s at %#3x, ", dev->name, name, ioaddr);
/* Retrieve and checksum the station address. */ /* Retrieve and checksum the station address. */
outw(MAC_Page, ioaddr + HP_PAGING); outw(MAC_Page, ioaddr + HP_PAGING);
@ -189,10 +190,11 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
unsigned char inval = inb(ioaddr + 8 + i); unsigned char inval = inb(ioaddr + 8 + i);
dev->dev_addr[i] = inval; dev->dev_addr[i] = inval;
checksum += inval; checksum += inval;
printk(" %2.2x", inval);
} }
checksum += inb(ioaddr + 14); checksum += inb(ioaddr + 14);
printk("%s", print_mac(mac, dev->dev_addr));
if (checksum != 0xff) { if (checksum != 0xff) {
printk(" bad checksum %2.2x.\n", checksum); printk(" bad checksum %2.2x.\n", checksum);
retval = -ENODEV; retval = -ENODEV;

View File

@ -127,6 +127,7 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
int i, retval, board_id, wordmode; int i, retval, board_id, wordmode;
const char *name; const char *name;
static unsigned version_printed; static unsigned version_printed;
DECLARE_MAC_BUF(mac);
if (!request_region(ioaddr, HP_IO_EXTENT, DRV_NAME)) if (!request_region(ioaddr, HP_IO_EXTENT, DRV_NAME))
return -EBUSY; return -EBUSY;
@ -158,7 +159,9 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
printk("%s: %s (ID %02x) at %#3x,", dev->name, name, board_id, ioaddr); printk("%s: %s (ID %02x) at %#3x,", dev->name, name, board_id, ioaddr);
for(i = 0; i < ETHER_ADDR_LEN; i++) for(i = 0; i < ETHER_ADDR_LEN; i++)
printk(" %2.2x", dev->dev_addr[i] = inb(ioaddr + i)); dev->dev_addr[i] = inb(ioaddr + i);
printk(" %s", print_mac(mac, dev->dev_addr));
/* Snarf the interrupt now. Someday this could be moved to open(). */ /* Snarf the interrupt now. Someday this could be moved to open(). */
if (dev->irq < 2) { if (dev->irq < 2) {

View File

@ -2093,9 +2093,9 @@ static void hp100_set_multicast_list(struct net_device *dev)
addrs = dmi->dmi_addr; addrs = dmi->dmi_addr;
if ((*addrs & 0x01) == 0x01) { /* multicast address? */ if ((*addrs & 0x01) == 0x01) { /* multicast address? */
#ifdef HP100_DEBUG #ifdef HP100_DEBUG
printk("hp100: %s: multicast = %02x:%02x:%02x:%02x:%02x:%02x, ", DECLARE_MAC_BUF(mac);
dev->name, addrs[0], addrs[1], addrs[2], printk("hp100: %s: multicast = %s, ",
addrs[3], addrs[4], addrs[5]); dev->name, print_mac(mac, addrs));
#endif #endif
for (j = idx = 0; j < 6; j++) { for (j = idx = 0; j < 6; j++) {
idx ^= *addrs++ & 0x3f; idx ^= *addrs++ & 0x3f;

View File

@ -103,6 +103,7 @@ static int __devinit hydra_init(struct zorro_dev *z)
int start_page, stop_page; int start_page, stop_page;
int j; int j;
int err; int err;
DECLARE_MAC_BUF(mac);
static u32 hydra_offsets[16] = { static u32 hydra_offsets[16] = {
0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e,
@ -162,10 +163,8 @@ static int __devinit hydra_init(struct zorro_dev *z)
zorro_set_drvdata(z, dev); zorro_set_drvdata(z, dev);
printk(KERN_INFO "%s: Hydra at 0x%08lx, address " printk(KERN_INFO "%s: Hydra at 0x%08lx, address "
"%02x:%02x:%02x:%02x:%02x:%02x (hydra.c " HYDRA_VERSION ")\n", "%s (hydra.c " HYDRA_VERSION ")\n",
dev->name, z->resource.start, dev->dev_addr[0], dev->dev_addr[1], dev->name, z->resource.start, print_mac(mac, dev->dev_addr));
dev->dev_addr[2], dev->dev_addr[3], dev->dev_addr[4],
dev->dev_addr[5]);
return 0; return 0;
} }

View File

@ -353,10 +353,9 @@ static void emac_hash_mc(struct ocp_enet_private *dev)
for (dmi = dev->ndev->mc_list; dmi; dmi = dmi->next) { for (dmi = dev->ndev->mc_list; dmi; dmi = dmi->next) {
int bit; int bit;
DBG2("%d: mc %02x:%02x:%02x:%02x:%02x:%02x" NL, DECLARE_MAC_BUF(mac);
dev->def->index, DBG2("%d: mc %s" NL,
dmi->dmi_addr[0], dmi->dmi_addr[1], dmi->dmi_addr[2], dev->def->index, print_mac(mac, dmi->dmi_addr));
dmi->dmi_addr[3], dmi->dmi_addr[4], dmi->dmi_addr[5]);
bit = 63 - (ether_crc(ETH_ALEN, dmi->dmi_addr) >> 26); bit = 63 - (ether_crc(ETH_ALEN, dmi->dmi_addr) >> 26);
gaht[bit >> 4] |= 0x8000 >> (bit & 0x0f); gaht[bit >> 4] |= 0x8000 >> (bit & 0x0f);
@ -1940,6 +1939,7 @@ static int __init emac_probe(struct ocp_device *ocpdev)
struct ocp_device *maldev; struct ocp_device *maldev;
struct ocp_enet_private *dev; struct ocp_enet_private *dev;
int err, i; int err, i;
DECLARE_MAC_BUF(mac);
DBG("%d: probe" NL, ocpdev->def->index); DBG("%d: probe" NL, ocpdev->def->index);
@ -2188,10 +2188,8 @@ static int __init emac_probe(struct ocp_device *ocpdev)
ocp_set_drvdata(ocpdev, dev); ocp_set_drvdata(ocpdev, dev);
printk("%s: emac%d, MAC %02x:%02x:%02x:%02x:%02x:%02x\n", printk("%s: emac%d, MAC %s\n",
ndev->name, dev->def->index, ndev->name, dev->def->index, print_mac(mac, ndev->dev_addr));
ndev->dev_addr[0], ndev->dev_addr[1], ndev->dev_addr[2],
ndev->dev_addr[3], ndev->dev_addr[4], ndev->dev_addr[5]);
if (dev->phy.address >= 0) if (dev->phy.address >= 0)
printk("%s: found %s PHY (0x%02x)\n", ndev->name, printk("%s: found %s PHY (0x%02x)\n", ndev->name,

View File

@ -898,6 +898,7 @@ static int ibmlana_probe(struct net_device *dev)
int base = 0, irq = 0, iobase = 0, memlen = 0; int base = 0, irq = 0, iobase = 0, memlen = 0;
ibmlana_priv *priv; ibmlana_priv *priv;
ibmlana_medium medium; ibmlana_medium medium;
DECLARE_MAC_BUF(mac);
/* can't work without an MCA bus ;-) */ /* can't work without an MCA bus ;-) */
if (MCA_bus == 0) if (MCA_bus == 0)
@ -981,11 +982,10 @@ static int ibmlana_probe(struct net_device *dev)
/* print config */ /* print config */
printk(KERN_INFO "%s: IRQ %d, I/O %#lx, memory %#lx-%#lx, " printk(KERN_INFO "%s: IRQ %d, I/O %#lx, memory %#lx-%#lx, "
"MAC address %02x:%02x:%02x:%02x:%02x:%02x.\n", "MAC address %s.\n",
dev->name, priv->realirq, dev->base_addr, dev->name, priv->realirq, dev->base_addr,
dev->mem_start, dev->mem_end - 1, dev->mem_start, dev->mem_end - 1,
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], print_mac(mac, dev->dev_addr));
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
printk(KERN_INFO "%s: %s medium\n", dev->name, MediaNames[priv->medium]); printk(KERN_INFO "%s: %s medium\n", dev->name, MediaNames[priv->medium]);
/* reset board */ /* reset board */

View File

@ -1276,16 +1276,13 @@ static int ibmveth_seq_show(struct seq_file *seq, void *v)
struct ibmveth_adapter *adapter = seq->private; struct ibmveth_adapter *adapter = seq->private;
char *current_mac = ((char*) &adapter->netdev->dev_addr); char *current_mac = ((char*) &adapter->netdev->dev_addr);
char *firmware_mac = ((char*) &adapter->mac_addr) ; char *firmware_mac = ((char*) &adapter->mac_addr) ;
DECLARE_MAC_BUF(mac);
seq_printf(seq, "%s %s\n\n", ibmveth_driver_string, ibmveth_driver_version); seq_printf(seq, "%s %s\n\n", ibmveth_driver_string, ibmveth_driver_version);
seq_printf(seq, "Unit Address: 0x%x\n", adapter->vdev->unit_address); seq_printf(seq, "Unit Address: 0x%x\n", adapter->vdev->unit_address);
seq_printf(seq, "Current MAC: %02X:%02X:%02X:%02X:%02X:%02X\n", seq_printf(seq, "Current MAC: %s\n", print_mac(mac, current_mac));
current_mac[0], current_mac[1], current_mac[2], seq_printf(seq, "Firmware MAC: %s\n", print_mac(mac, firmware_mac));
current_mac[3], current_mac[4], current_mac[5]);
seq_printf(seq, "Firmware MAC: %02X:%02X:%02X:%02X:%02X:%02X\n",
firmware_mac[0], firmware_mac[1], firmware_mac[2],
firmware_mac[3], firmware_mac[4], firmware_mac[5]);
seq_printf(seq, "\nAdapter Statistics:\n"); seq_printf(seq, "\nAdapter Statistics:\n");
seq_printf(seq, " TX: vio_map_single failres: %ld\n", adapter->tx_map_failed); seq_printf(seq, " TX: vio_map_single failres: %ld\n", adapter->tx_map_failed);

View File

@ -443,18 +443,12 @@ static void ioc3_get_eaddr_nic(struct ioc3_private *ip)
*/ */
static void ioc3_get_eaddr(struct ioc3_private *ip) static void ioc3_get_eaddr(struct ioc3_private *ip)
{ {
int i; DECLARE_MAC_BUF(mac);
ioc3_get_eaddr_nic(ip); ioc3_get_eaddr_nic(ip);
printk("Ethernet address is "); printk("Ethernet address is %s.\n",
for (i = 0; i < 6; i++) { print_mac(mac, priv_netdev(ip)->dev_addr));
printk("%02x", priv_netdev(ip)->dev_addr[i]);
if (i < 5)
printk(":");
}
printk(".\n");
} }
static void __ioc3_set_mac_address(struct net_device *dev) static void __ioc3_set_mac_address(struct net_device *dev)

View File

@ -192,6 +192,7 @@ static int __init netcard_probe1(struct net_device *dev, int ioaddr)
static unsigned version_printed; static unsigned version_printed;
int i; int i;
int err = -ENODEV; int err = -ENODEV;
DECLARE_MAC_BUF(mac);
/* Grab the region so that no one else tries to probe our ioports. */ /* Grab the region so that no one else tries to probe our ioports. */
if (!request_region(ioaddr, NETCARD_IO_EXTENT, cardname)) if (!request_region(ioaddr, NETCARD_IO_EXTENT, cardname))
@ -217,7 +218,9 @@ static int __init netcard_probe1(struct net_device *dev, int ioaddr)
/* Retrieve and print the ethernet address. */ /* Retrieve and print the ethernet address. */
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
printk(" %2.2x", dev->dev_addr[i] = inb(ioaddr + i)); dev->dev_addr[i] = inb(ioaddr + i);
printk("%s", print_mac(mac, dev->dev_addr));
err = -EAGAIN; err = -EAGAIN;
#ifdef jumpered_interrupts #ifdef jumpered_interrupts

View File

@ -209,6 +209,7 @@ static int __init jazz_sonic_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
int err = 0; int err = 0;
int i; int i;
DECLARE_MAC_BUF(mac);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) if (!res)
@ -233,13 +234,8 @@ static int __init jazz_sonic_probe(struct platform_device *pdev)
if (err) if (err)
goto out1; goto out1;
printk("%s: MAC ", dev->name); printk("%s: MAC %s IRQ %d\n",
for (i = 0; i < 6; i++) { dev->name, print_mac(mac, dev->dev_addr), dev->irq);
printk("%2.2x", dev->dev_addr[i]);
if (i < 5)
printk(":");
}
printk(" IRQ %d\n", dev->irq);
return 0; return 0;

View File

@ -466,6 +466,7 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
unsigned long flags; unsigned long flags;
int err = -ENOMEM; int err = -ENOMEM;
void __iomem *bios; void __iomem *bios;
DECLARE_MAC_BUF(mac);
/* First we look for special cases. /* First we look for special cases.
Check for HP's on-board ethernet by looking for 'HP' in the BIOS. Check for HP's on-board ethernet by looking for 'HP' in the BIOS.
@ -522,12 +523,13 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
/* We can't allocate dev->priv from alloc_etherdev() because it must /* We can't allocate dev->priv from alloc_etherdev() because it must
a ISA DMA-able region. */ a ISA DMA-able region. */
chipname = chip_table[lance_version].name; chipname = chip_table[lance_version].name;
printk("%s: %s at %#3x,", dev->name, chipname, ioaddr); printk("%s: %s at %#3x, ", dev->name, chipname, ioaddr);
/* There is a 16 byte station address PROM at the base address. /* There is a 16 byte station address PROM at the base address.
The first six bytes are the station address. */ The first six bytes are the station address. */
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
printk(" %2.2x", dev->dev_addr[i] = inb(ioaddr + i)); dev->dev_addr[i] = inb(ioaddr + i);
printk("%s", print_mac(mac, dev->dev_addr));
dev->base_addr = ioaddr; dev->base_addr = ioaddr;
/* Make certain the data structures used by the LANCE are aligned and DMAble. */ /* Make certain the data structures used by the LANCE are aligned and DMAble. */

View File

@ -235,9 +235,9 @@ static int lguestnet_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct lguestnet_info *info = netdev_priv(dev); struct lguestnet_info *info = netdev_priv(dev);
/* Extract the destination ethernet address from the packet. */ /* Extract the destination ethernet address from the packet. */
const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest; const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
DECLARE_MAC_BUF(mac);
pr_debug("%s: xmit %02x:%02x:%02x:%02x:%02x:%02x\n", pr_debug("%s: xmit %s\n", dev->name, print_mac(mac, dest));
dev->name, dest[0],dest[1],dest[2],dest[3],dest[4],dest[5]);
/* If it's a multicast packet, we broadcast to everyone. That's not /* If it's a multicast packet, we broadcast to everyone. That's not
* very efficient, but there are very few applications which actually * very efficient, but there are very few applications which actually

View File

@ -1034,15 +1034,12 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
static void print_eth(unsigned char *add, char *str) static void print_eth(unsigned char *add, char *str)
{ {
int i; DECLARE_MAC_BUF(mac);
DECLARE_MAC_BUF(mac2);
printk(KERN_DEBUG "i596 0x%p, ", add); printk(KERN_DEBUG "i596 0x%p, %s --> %s %02X%02X, %s\n",
for (i = 0; i < 6; i++) add, print_mac(mac, add + 6), print_mac(mac2, add),
printk(" %02X", add[i + 6]); add[12], add[13], str);
printk(" -->");
for (i = 0; i < 6; i++)
printk(" %02X", add[i]);
printk(" %02X%02X, %s\n", add[12], add[13], str);
} }
static int __devinit i82596_probe(struct net_device *dev) static int __devinit i82596_probe(struct net_device *dev)
@ -1352,6 +1349,7 @@ static void set_multicast_list(struct net_device *dev)
struct i596_private *lp = netdev_priv(dev); struct i596_private *lp = netdev_priv(dev);
struct i596_dma *dma = lp->dma; struct i596_dma *dma = lp->dma;
int config = 0, cnt; int config = 0, cnt;
DECLARE_MAC_BUF(mac);
DEB(DEB_MULTI, DEB(DEB_MULTI,
printk(KERN_DEBUG printk(KERN_DEBUG
@ -1415,8 +1413,8 @@ static void set_multicast_list(struct net_device *dev)
if (i596_debug > 1) if (i596_debug > 1)
DEB(DEB_MULTI, DEB(DEB_MULTI,
printk(KERN_DEBUG printk(KERN_DEBUG
"%s: Adding address %02x:%02x:%02x:%02x:%02x:%02x\n", "%s: Adding address %s\n",
dev->name, cp[0], cp[1], cp[2], cp[3], cp[4], cp[5])); dev->name, print_mac(mac, cp)));
} }
DMA_WBACK_INV(dev, &dma->mc_cmd, sizeof(struct mc_cmd)); DMA_WBACK_INV(dev, &dma->mc_cmd, sizeof(struct mc_cmd));
i596_add_cmd(dev, &cmd->cmd); i596_add_cmd(dev, &cmd->cmd);

View File

@ -169,6 +169,7 @@ static int __init lne390_probe1(struct net_device *dev, int ioaddr)
{ {
int i, revision, ret; int i, revision, ret;
unsigned long eisa_id; unsigned long eisa_id;
DECLARE_MAC_BUF(mac);
if (inb_p(ioaddr + LNE390_ID_PORT) == 0xff) return -ENODEV; if (inb_p(ioaddr + LNE390_ID_PORT) == 0xff) return -ENODEV;
@ -200,10 +201,12 @@ static int __init lne390_probe1(struct net_device *dev, int ioaddr)
} }
#endif #endif
printk("lne390.c: LNE390%X in EISA slot %d, address", 0xa+revision, ioaddr/0x1000);
for(i = 0; i < ETHER_ADDR_LEN; i++) for(i = 0; i < ETHER_ADDR_LEN; i++)
printk(" %02x", (dev->dev_addr[i] = inb(ioaddr + LNE390_SA_PROM + i))); dev->dev_addr[i] = inb(ioaddr + LNE390_SA_PROM + i);
printk(".\nlne390.c: "); printk("lne390.c: LNE390%X in EISA slot %d, address %s.\n",
0xa+revision, ioaddr/0x1000, print_mac(mac, dev->dev_addr));
printk("lne390.c: ");
/* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */ /* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */
if (dev->irq == 0) { if (dev->irq == 0) {

View File

@ -181,6 +181,7 @@ struct net_device * __init mac89x0_probe(int unit)
unsigned long ioaddr; unsigned long ioaddr;
unsigned short sig; unsigned short sig;
int err = -ENODEV; int err = -ENODEV;
DECLARE_MAC_BUF(mac);
dev = alloc_etherdev(sizeof(struct net_local)); dev = alloc_etherdev(sizeof(struct net_local));
if (!dev) if (!dev)
@ -272,13 +273,11 @@ struct net_device * __init mac89x0_probe(int unit)
} }
dev->irq = SLOT2IRQ(slot); dev->irq = SLOT2IRQ(slot);
printk(" IRQ %d ADDR ", dev->irq);
/* print the ethernet address. */ /* print the IRQ and ethernet address. */
for (i = 0; i < ETH_ALEN; i++)
printk("%2.2x%s", dev->dev_addr[i], printk(" IRQ %d ADDR %s\n",
((i < ETH_ALEN-1) ? ":" : "")); dev->irq, print_mac(mac, dev->dev_addr));
printk("\n");
dev->open = net_open; dev->open = net_open;
dev->stop = net_close; dev->stop = net_close;

View File

@ -1071,6 +1071,7 @@ static int __devinit macb_probe(struct platform_device *pdev)
unsigned long pclk_hz; unsigned long pclk_hz;
u32 config; u32 config;
int err = -ENXIO; int err = -ENXIO;
DECLARE_MAC_BUF(mac);
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs) { if (!regs) {
@ -1190,10 +1191,9 @@ static int __devinit macb_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, dev); platform_set_drvdata(pdev, dev);
printk(KERN_INFO "%s: Atmel MACB at 0x%08lx irq %d " printk(KERN_INFO "%s: Atmel MACB at 0x%08lx irq %d "
"(%02x:%02x:%02x:%02x:%02x:%02x)\n", "(%s)\n",
dev->name, dev->base_addr, dev->irq, dev->name, dev->base_addr, dev->irq,
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], print_mac(mac, dev->dev_addr));
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
phydev = bp->phy_dev; phydev = bp->phy_dev;
printk(KERN_INFO "%s: attached PHY driver [%s] " printk(KERN_INFO "%s: attached PHY driver [%s] "

View File

@ -101,6 +101,7 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
struct mace_data *mp; struct mace_data *mp;
const unsigned char *addr; const unsigned char *addr;
int j, rev, rc = -EBUSY; int j, rev, rc = -EBUSY;
DECLARE_MAC_BUF(mac);
if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) { if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) {
printk(KERN_ERR "can't use MACE %s: need 3 addrs and 3 irqs\n", printk(KERN_ERR "can't use MACE %s: need 3 addrs and 3 irqs\n",
@ -240,11 +241,9 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
goto err_free_rx_irq; goto err_free_rx_irq;
} }
printk(KERN_INFO "%s: MACE at", dev->name); printk(KERN_INFO "%s: MACE at %s, chip revision %d.%d\n",
for (j = 0; j < 6; ++j) { dev->name, print_mac(mac, dev->dev_addr),
printk("%c%.2x", (j? ':': ' '), dev->dev_addr[j]); mp->chipid >> 8, mp->chipid & 0xff);
}
printk(", chip revision %d.%d\n", mp->chipid >> 8, mp->chipid & 0xff);
return 0; return 0;

View File

@ -194,6 +194,7 @@ static int __devinit mace_probe(struct platform_device *pdev)
unsigned char checksum = 0; unsigned char checksum = 0;
static int found = 0; static int found = 0;
int err; int err;
DECLARE_MAC_BUF(mac);
if (found || macintosh_config->ether_type != MAC_ETHER_MACE) if (found || macintosh_config->ether_type != MAC_ETHER_MACE)
return -ENODEV; return -ENODEV;
@ -248,9 +249,8 @@ static int __devinit mace_probe(struct platform_device *pdev)
dev->set_multicast_list = mace_set_multicast; dev->set_multicast_list = mace_set_multicast;
dev->set_mac_address = mace_set_address; dev->set_mac_address = mace_set_address;
printk(KERN_INFO "%s: 68K MACE, hardware address %.2X", dev->name, dev->dev_addr[0]); printk(KERN_INFO "%s: 68K MACE, hardware address %s\n",
for (j = 1 ; j < 6 ; j++) printk(":%.2X", dev->dev_addr[j]); dev->name, print_mac(mac, dev->dev_addr));
printk("\n");
err = register_netdev(dev); err = register_netdev(dev);
if (!err) if (!err)

View File

@ -223,6 +223,7 @@ int __init mac_onboard_sonic_ethernet_addr(struct net_device* dev)
struct sonic_local *lp = netdev_priv(dev); struct sonic_local *lp = netdev_priv(dev);
const int prom_addr = ONBOARD_SONIC_PROM_BASE; const int prom_addr = ONBOARD_SONIC_PROM_BASE;
int i; int i;
DECLARE_MAC_BUF(mac);
/* On NuBus boards we can sometimes look in the ROM resources. /* On NuBus boards we can sometimes look in the ROM resources.
No such luck for comm-slot/onboard. */ No such luck for comm-slot/onboard. */
@ -266,13 +267,8 @@ int __init mac_onboard_sonic_ethernet_addr(struct net_device* dev)
dev->dev_addr[1] = val >> 8; dev->dev_addr[1] = val >> 8;
dev->dev_addr[0] = val & 0xff; dev->dev_addr[0] = val & 0xff;
printk(KERN_INFO "HW Address from CAM 15: "); printk(KERN_INFO "HW Address from CAM 15: %s\n",
for (i = 0; i < 6; i++) { print_mac(mac, dev->dev_addr));
printk("%2.2x", dev->dev_addr[i]);
if (i < 5)
printk(":");
}
printk("\n");
} else return 0; } else return 0;
if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) && if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) &&
@ -567,7 +563,7 @@ static int __init mac_sonic_probe(struct platform_device *pdev)
struct net_device *dev; struct net_device *dev;
struct sonic_local *lp; struct sonic_local *lp;
int err; int err;
int i; DECLARE_MAC_BUF(mac);
dev = alloc_etherdev(sizeof(struct sonic_local)); dev = alloc_etherdev(sizeof(struct sonic_local));
if (!dev) if (!dev)
@ -591,13 +587,8 @@ found:
if (err) if (err)
goto out; goto out;
printk("%s: MAC ", dev->name); printk("%s: MAC %s IRQ %d\n",
for (i = 0; i < 6; i++) { dev->name, print_mac(mac, dev->dev_addr), dev->irq);
printk("%2.2x", dev->dev_addr[i]);
if (i < 5)
printk(":");
}
printk(" IRQ %d\n", dev->irq);
return 0; return 0;

View File

@ -95,11 +95,11 @@ char o2meth_eaddr[8]={0,0,0,0,0,0,0,0};
static inline void load_eaddr(struct net_device *dev) static inline void load_eaddr(struct net_device *dev)
{ {
int i; int i;
DPRINTK("Loading MAC Address: %02x:%02x:%02x:%02x:%02x:%02x\n", DECLARE_MAC_BUF(mac);
(int)o2meth_eaddr[0]&0xFF,(int)o2meth_eaddr[1]&0xFF,(int)o2meth_eaddr[2]&0xFF,
(int)o2meth_eaddr[3]&0xFF,(int)o2meth_eaddr[4]&0xFF,(int)o2meth_eaddr[5]&0xFF);
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
dev->dev_addr[i] = o2meth_eaddr[i]; dev->dev_addr[i] = o2meth_eaddr[i];
DPRINTK("Loading MAC Address: %s\n", print_mac(mac, dev->dev_addr));
mace->eth.mac_addr = (*(unsigned long*)o2meth_eaddr) >> 16; mace->eth.mac_addr = (*(unsigned long*)o2meth_eaddr) >> 16;
} }

View File

@ -784,6 +784,7 @@ static int mv643xx_eth_open(struct net_device *dev)
unsigned int port_num = mp->port_num; unsigned int port_num = mp->port_num;
unsigned int size; unsigned int size;
int err; int err;
DECLARE_MAC_BUF(mac);
/* Clear any pending ethernet port interrupts */ /* Clear any pending ethernet port interrupts */
mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0); mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0);
@ -1413,8 +1414,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
p = dev->dev_addr; p = dev->dev_addr;
printk(KERN_NOTICE printk(KERN_NOTICE
"%s: port %d with MAC address %02x:%02x:%02x:%02x:%02x:%02x\n", "%s: port %d with MAC address %s\n",
dev->name, port_num, p[0], p[1], p[2], p[3], p[4], p[5]); dev->name, port_num, print_mac(mac, p));
if (dev->features & NETIF_F_SG) if (dev->features & NETIF_F_SG)
printk(KERN_NOTICE "%s: Scatter Gather Enabled\n", dev->name); printk(KERN_NOTICE "%s: Scatter Gather Enabled\n", dev->name);

View File

@ -67,6 +67,7 @@ struct net_device * __init mvme147lance_probe(int unit)
u_long *addr; u_long *addr;
u_long address; u_long address;
int err; int err;
DECLARE_MAC_BUF(mac);
if (!MACH_IS_MVME147 || called) if (!MACH_IS_MVME147 || called)
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
@ -101,12 +102,10 @@ struct net_device * __init mvme147lance_probe(int unit)
address=address>>8; address=address>>8;
dev->dev_addr[3]=address&0xff; dev->dev_addr[3]=address&0xff;
printk("%s: MVME147 at 0x%08lx, irq %d, Hardware Address %02x:%02x:%02x:%02x:%02x:%02x\n", printk("%s: MVME147 at 0x%08lx, irq %d, "
dev->name, dev->base_addr, MVME147_LANCE_IRQ, "Hardware Address %s\n",
dev->dev_addr[0], dev->name, dev->base_addr, MVME147_LANCE_IRQ,
dev->dev_addr[1], dev->dev_addr[2], print_mac(mac, dev->dev_addr));
dev->dev_addr[3], dev->dev_addr[4],
dev->dev_addr[5]);
lp = (struct m147lance_private *)dev->priv; lp = (struct m147lance_private *)dev->priv;
lp->ram = __get_dma_pages(GFP_ATOMIC, 3); /* 16K */ lp->ram = __get_dma_pages(GFP_ATOMIC, 3); /* 16K */

View File

@ -2395,6 +2395,7 @@ static void myri10ge_set_multicast_list(struct net_device *dev)
struct dev_mc_list *mc_list; struct dev_mc_list *mc_list;
__be32 data[2] = { 0, 0 }; __be32 data[2] = { 0, 0 };
int err; int err;
DECLARE_MAC_BUF(mac);
mgp = netdev_priv(dev); mgp = netdev_priv(dev);
/* can be called from atomic contexts, /* can be called from atomic contexts,
@ -2442,14 +2443,8 @@ static void myri10ge_set_multicast_list(struct net_device *dev)
printk(KERN_ERR "myri10ge: %s: Failed " printk(KERN_ERR "myri10ge: %s: Failed "
"MXGEFW_JOIN_MULTICAST_GROUP, error status:" "MXGEFW_JOIN_MULTICAST_GROUP, error status:"
"%d\t", dev->name, err); "%d\t", dev->name, err);
printk(KERN_ERR "MAC %02x:%02x:%02x:%02x:%02x:%02x\n", printk(KERN_ERR "MAC %s\n",
((unsigned char *)&mc_list->dmi_addr)[0], print_mac(mac, mc_list->dmi_addr));
((unsigned char *)&mc_list->dmi_addr)[1],
((unsigned char *)&mc_list->dmi_addr)[2],
((unsigned char *)&mc_list->dmi_addr)[3],
((unsigned char *)&mc_list->dmi_addr)[4],
((unsigned char *)&mc_list->dmi_addr)[5]
);
goto abort; goto abort;
} }
} }

View File

@ -311,12 +311,12 @@ static void myri_is_not_so_happy(struct myri_eth *mp)
#ifdef DEBUG_HEADER #ifdef DEBUG_HEADER
static void dump_ehdr(struct ethhdr *ehdr) static void dump_ehdr(struct ethhdr *ehdr)
{ {
printk("ehdr[h_dst(%02x:%02x:%02x:%02x:%02x:%02x)" DECLARE_MAC_BUF(mac);
"h_source(%02x:%02x:%02x:%02x:%02x:%02x)h_proto(%04x)]\n", DECLARE_MAC_BUF(mac2);
ehdr->h_dest[0], ehdr->h_dest[1], ehdr->h_dest[2], printk("ehdr[h_dst(%s)"
ehdr->h_dest[3], ehdr->h_dest[4], ehdr->h_dest[4], "h_source(%s)"
ehdr->h_source[0], ehdr->h_source[1], ehdr->h_source[2], "h_proto(%04x)]\n",
ehdr->h_source[3], ehdr->h_source[4], ehdr->h_source[4], print_mac(mac, ehdr->h_dest), print_mac(mac2, ehdr->h_source),
ehdr->h_proto); ehdr->h_proto);
} }
@ -325,13 +325,7 @@ static void dump_ehdr_and_myripad(unsigned char *stuff)
struct ethhdr *ehdr = (struct ethhdr *) (stuff + 2); struct ethhdr *ehdr = (struct ethhdr *) (stuff + 2);
printk("pad[%02x:%02x]", stuff[0], stuff[1]); printk("pad[%02x:%02x]", stuff[0], stuff[1]);
printk("ehdr[h_dst(%02x:%02x:%02x:%02x:%02x:%02x)" dump_ehdr(ehdr);
"h_source(%02x:%02x:%02x:%02x:%02x:%02x)h_proto(%04x)]\n",
ehdr->h_dest[0], ehdr->h_dest[1], ehdr->h_dest[2],
ehdr->h_dest[3], ehdr->h_dest[4], ehdr->h_dest[4],
ehdr->h_source[0], ehdr->h_source[1], ehdr->h_source[2],
ehdr->h_source[3], ehdr->h_source[4], ehdr->h_source[4],
ehdr->h_proto);
} }
#endif #endif
@ -895,6 +889,7 @@ static int __devinit myri_ether_init(struct sbus_dev *sdev)
struct myri_eth *mp; struct myri_eth *mp;
unsigned char prop_buf[32]; unsigned char prop_buf[32];
int i; int i;
DECLARE_MAC_BUF(mac);
DET(("myri_ether_init(%p,%d):\n", sdev, num)); DET(("myri_ether_init(%p,%d):\n", sdev, num));
dev = alloc_etherdev(sizeof(struct myri_eth)); dev = alloc_etherdev(sizeof(struct myri_eth));
@ -1089,12 +1084,8 @@ static int __devinit myri_ether_init(struct sbus_dev *sdev)
num++; num++;
printk("%s: MyriCOM MyriNET Ethernet ", dev->name); printk("%s: MyriCOM MyriNET Ethernet %s\n",
dev->name, print_mac(mac, dev->dev_addr));
for (i = 0; i < 6; i++)
printk("%2.2x%c", dev->dev_addr[i],
i == 5 ? ' ' : ':');
printk("\n");
return 0; return 0;

View File

@ -805,6 +805,7 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
const int pcibar = 1; /* PCI base address register */ const int pcibar = 1; /* PCI base address register */
int prev_eedata; int prev_eedata;
u32 tmp; u32 tmp;
DECLARE_MAC_BUF(mac);
/* when built into the kernel, we only print version if device is found */ /* when built into the kernel, we only print version if device is found */
#ifndef MODULE #ifndef MODULE
@ -958,12 +959,10 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
goto err_create_file; goto err_create_file;
if (netif_msg_drv(np)) { if (netif_msg_drv(np)) {
printk(KERN_INFO "natsemi %s: %s at %#08lx (%s), ", printk(KERN_INFO "natsemi %s: %s at %#08lx "
dev->name, natsemi_pci_info[chip_idx].name, iostart, "(%s), %s, IRQ %d",
pci_name(np->pci_dev)); dev->name, natsemi_pci_info[chip_idx].name, iostart,
for (i = 0; i < ETH_ALEN-1; i++) pci_name(np->pci_dev), print_mac(mac, dev->dev_addr), irq);
printk("%02x:", dev->dev_addr[i]);
printk("%02x, IRQ %d", dev->dev_addr[i], irq);
if (dev->if_port == PORT_TP) if (dev->if_port == PORT_TP)
printk(", port TP.\n"); printk(", port TP.\n");
else if (np->ignore_phy) else if (np->ignore_phy)

View File

@ -204,6 +204,7 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
static unsigned version_printed; static unsigned version_printed;
struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
unsigned char bus_width; unsigned char bus_width;
DECLARE_MAC_BUF(mac);
if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME)) if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME))
return -EBUSY; return -EBUSY;
@ -296,12 +297,11 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
dev->base_addr = ioaddr; dev->base_addr = ioaddr;
for(i = 0; i < ETHER_ADDR_LEN; i++) { for(i = 0; i < ETHER_ADDR_LEN; i++)
printk(" %2.2x", SA_prom[i]);
dev->dev_addr[i] = SA_prom[i]; dev->dev_addr[i] = SA_prom[i];
} printk(" %s\n", print_mac(mac, dev->dev_addr));
printk("\n%s: %s found at %#x, using IRQ %d.\n", printk("%s: %s found at %#x, using IRQ %d.\n",
dev->name, name, ioaddr, dev->irq); dev->name, name, ioaddr, dev->irq);
ei_status.name = name; ei_status.name = name;

View File

@ -291,6 +291,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
int neX000, ctron, copam, bad_card; int neX000, ctron, copam, bad_card;
int reg0, ret; int reg0, ret;
static unsigned version_printed; static unsigned version_printed;
DECLARE_MAC_BUF(mac);
if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME)) if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME))
return -EBUSY; return -EBUSY;
@ -503,16 +504,14 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
for (i = 0 ; i < ETHER_ADDR_LEN ; i++) { for (i = 0 ; i < ETHER_ADDR_LEN ; i++) {
dev->dev_addr[i] = SA_prom[i] dev->dev_addr[i] = SA_prom[i]
= inb_p(ioaddr + EN1_PHYS_SHIFT(i)); = inb_p(ioaddr + EN1_PHYS_SHIFT(i));
printk(" %2.2x", SA_prom[i]);
} }
#else #else
for(i = 0; i < ETHER_ADDR_LEN; i++) { for(i = 0; i < ETHER_ADDR_LEN; i++) {
printk(" %2.2x", SA_prom[i]);
dev->dev_addr[i] = SA_prom[i]; dev->dev_addr[i] = SA_prom[i];
} }
#endif #endif
printk("\n"); printk("%s\n", print_mac(mac, dev->dev_addr));
ei_status.name = name; ei_status.name = name;
ei_status.tx_start_page = start_page; ei_status.tx_start_page = start_page;

View File

@ -302,6 +302,7 @@ out:
static int ne2_procinfo(char *buf, int slot, struct net_device *dev) static int ne2_procinfo(char *buf, int slot, struct net_device *dev)
{ {
int len=0; int len=0;
DECLARE_MAC_BUF(mac);
len += sprintf(buf+len, "The NE/2 Ethernet Adapter\n" ); len += sprintf(buf+len, "The NE/2 Ethernet Adapter\n" );
len += sprintf(buf+len, "Driver written by Wim Dumon "); len += sprintf(buf+len, "Driver written by Wim Dumon ");
@ -312,12 +313,7 @@ static int ne2_procinfo(char *buf, int slot, struct net_device *dev)
len += sprintf(buf+len, "Based on the original NE2000 drivers\n" ); len += sprintf(buf+len, "Based on the original NE2000 drivers\n" );
len += sprintf(buf+len, "Base IO: %#x\n", (unsigned int)dev->base_addr); len += sprintf(buf+len, "Base IO: %#x\n", (unsigned int)dev->base_addr);
len += sprintf(buf+len, "IRQ : %d\n", dev->irq); len += sprintf(buf+len, "IRQ : %d\n", dev->irq);
len += sprintf(buf+len, "HW addr : %s\n", print_mac(mac, dev->dev_addr));
#define HW_ADDR(i) dev->dev_addr[i]
len += sprintf(buf+len, "HW addr : %x:%x:%x:%x:%x:%x\n",
HW_ADDR(0), HW_ADDR(1), HW_ADDR(2),
HW_ADDR(3), HW_ADDR(4), HW_ADDR(5) );
#undef HW_ADDR
return len; return len;
} }
@ -330,6 +326,7 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
const char *name = "NE/2"; const char *name = "NE/2";
int start_page, stop_page; int start_page, stop_page;
static unsigned version_printed; static unsigned version_printed;
DECLARE_MAC_BUF(mac);
if (ei_debug && version_printed++ == 0) if (ei_debug && version_printed++ == 0)
printk(version); printk(version);
@ -469,12 +466,12 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
dev->base_addr = base_addr; dev->base_addr = base_addr;
for(i = 0; i < ETHER_ADDR_LEN; i++) { for(i = 0; i < ETHER_ADDR_LEN; i++)
printk(" %2.2x", SA_prom[i]);
dev->dev_addr[i] = SA_prom[i]; dev->dev_addr[i] = SA_prom[i];
}
printk("\n%s: %s found at %#x, using IRQ %d.\n", printk(" %s\n", print_mac(mac, dev->dev_addr));
printk("%s: %s found at %#x, using IRQ %d.\n",
dev->name, name, base_addr, dev->irq); dev->name, name, base_addr, dev->irq);
mca_set_adapter_procfn(slot, (MCA_ProcFn) ne2_procinfo, dev); mca_set_adapter_procfn(slot, (MCA_ProcFn) ne2_procinfo, dev);

View File

@ -212,6 +212,7 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
static unsigned int fnd_cnt; static unsigned int fnd_cnt;
long ioaddr; long ioaddr;
int flags = pci_clone_list[chip_idx].flags; int flags = pci_clone_list[chip_idx].flags;
DECLARE_MAC_BUF(mac);
/* when built into the kernel, we only print version if device is found */ /* when built into the kernel, we only print version if device is found */
#ifndef MODULE #ifndef MODULE
@ -365,12 +366,12 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
if (i) if (i)
goto err_out_free_netdev; goto err_out_free_netdev;
printk("%s: %s found at %#lx, IRQ %d, ", for(i = 0; i < 6; i++)
dev->name, pci_clone_list[chip_idx].name, ioaddr, dev->irq);
for(i = 0; i < 6; i++) {
printk("%2.2X%s", SA_prom[i], i == 5 ? ".\n": ":");
dev->dev_addr[i] = SA_prom[i]; dev->dev_addr[i] = SA_prom[i];
} printk("%s: %s found at %#lx, IRQ %d, %s.\n",
dev->name, pci_clone_list[chip_idx].name, ioaddr, dev->irq,
print_mac(mac, dev->dev_addr));
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
return 0; return 0;

View File

@ -99,6 +99,7 @@ static int __init ne3210_eisa_probe (struct device *device)
int i, retval, port_index; int i, retval, port_index;
struct eisa_device *edev = to_eisa_device (device); struct eisa_device *edev = to_eisa_device (device);
struct net_device *dev; struct net_device *dev;
DECLARE_MAC_BUF(mac);
/* Allocate dev->priv and fill in 8390 specific dev fields. */ /* Allocate dev->priv and fill in 8390 specific dev fields. */
if (!(dev = alloc_ei_netdev ())) { if (!(dev = alloc_ei_netdev ())) {
@ -127,17 +128,15 @@ static int __init ne3210_eisa_probe (struct device *device)
inb(ioaddr + NE3210_CFG1), inb(ioaddr + NE3210_CFG2)); inb(ioaddr + NE3210_CFG1), inb(ioaddr + NE3210_CFG2));
#endif #endif
port_index = inb(ioaddr + NE3210_CFG2) >> 6; port_index = inb(ioaddr + NE3210_CFG2) >> 6;
printk("ne3210.c: NE3210 in EISA slot %d, media: %s, addr:",
edev->slot, ifmap[port_index]);
for(i = 0; i < ETHER_ADDR_LEN; i++) for(i = 0; i < ETHER_ADDR_LEN; i++)
printk(" %02x", (dev->dev_addr[i] = inb(ioaddr + NE3210_SA_PROM + i))); dev->dev_addr[i] = inb(ioaddr + NE3210_SA_PROM + i);
printk("ne3210.c: NE3210 in EISA slot %d, media: %s, addr: %s.\n",
edev->slot, ifmap[port_index], print_mac(mac, dev->dev_addr));
/* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */ /* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */
dev->irq = irq_map[(inb(ioaddr + NE3210_CFG2) >> 3) & 0x07]; dev->irq = irq_map[(inb(ioaddr + NE3210_CFG2) >> 3) & 0x07];
printk(".\nne3210.c: using IRQ %d, ", dev->irq); printk("ne3210.c: using IRQ %d, ", dev->irq);
retval = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev); retval = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev);
if (retval) { if (retval) {

View File

@ -306,18 +306,16 @@ static ssize_t show_remote_ip(struct netconsole_target *nt, char *buf)
static ssize_t show_local_mac(struct netconsole_target *nt, char *buf) static ssize_t show_local_mac(struct netconsole_target *nt, char *buf)
{ {
return snprintf(buf, PAGE_SIZE, "%02x:%02x:%02x:%02x:%02x:%02x\n", DECLARE_MAC_BUF(mac);
nt->np.local_mac[0], nt->np.local_mac[1], return snprintf(buf, PAGE_SIZE, "%s\n",
nt->np.local_mac[2], nt->np.local_mac[3], print_mac(mac, nt->np.local_mac));
nt->np.local_mac[4], nt->np.local_mac[5]);
} }
static ssize_t show_remote_mac(struct netconsole_target *nt, char *buf) static ssize_t show_remote_mac(struct netconsole_target *nt, char *buf)
{ {
return snprintf(buf, PAGE_SIZE, "%02x:%02x:%02x:%02x:%02x:%02x\n", DECLARE_MAC_BUF(mac);
nt->np.remote_mac[0], nt->np.remote_mac[1], return snprintf(buf, PAGE_SIZE, "%s\n",
nt->np.remote_mac[2], nt->np.remote_mac[3], print_mac(mac, nt->np.remote_mac));
nt->np.remote_mac[4], nt->np.remote_mac[5]);
} }
/* /*

View File

@ -285,6 +285,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
int valid_mac = 0; int valid_mac = 0;
u32 val; u32 val;
int pci_func_id = PCI_FUNC(pdev->devfn); int pci_func_id = PCI_FUNC(pdev->devfn);
DECLARE_MAC_BUF(mac);
printk(KERN_INFO "%s \n", netxen_nic_driver_string); printk(KERN_INFO "%s \n", netxen_nic_driver_string);
@ -573,15 +574,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
memcpy(netdev->perm_addr, netdev->dev_addr, memcpy(netdev->perm_addr, netdev->dev_addr,
netdev->addr_len); netdev->addr_len);
if (!is_valid_ether_addr(netdev->perm_addr)) { if (!is_valid_ether_addr(netdev->perm_addr)) {
printk(KERN_ERR "%s: Bad MAC address " printk(KERN_ERR "%s: Bad MAC address %s.\n",
"%02x:%02x:%02x:%02x:%02x:%02x.\n", netxen_nic_driver_name,
netxen_nic_driver_name, print_mac(mac, netdev->dev_addr));
netdev->dev_addr[0],
netdev->dev_addr[1],
netdev->dev_addr[2],
netdev->dev_addr[3],
netdev->dev_addr[4],
netdev->dev_addr[5]);
} else { } else {
if (adapter->macaddr_set) if (adapter->macaddr_set)
adapter->macaddr_set(adapter, adapter->macaddr_set(adapter,

View File

@ -603,6 +603,7 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter,
int phy = physical_port[adapter->portnum]; int phy = physical_port[adapter->portnum];
unsigned char mac_addr[6]; unsigned char mac_addr[6];
int i; int i;
DECLARE_MAC_BUF(mac);
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
temp[0] = temp[1] = 0; temp[0] = temp[1] = 0;
@ -627,15 +628,10 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter,
if (i == 10) { if (i == 10) {
printk(KERN_ERR "%s: cannot set Mac addr for %s\n", printk(KERN_ERR "%s: cannot set Mac addr for %s\n",
netxen_nic_driver_name, adapter->netdev->name); netxen_nic_driver_name, adapter->netdev->name);
printk(KERN_ERR "MAC address set: " printk(KERN_ERR "MAC address set: %s.\n",
"%02x:%02x:%02x:%02x:%02x:%02x.\n", print_mac(mac, addr));
addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); printk(KERN_ERR "MAC address get: %s.\n",
print_mac(mac, mac_addr));
printk(KERN_ERR "MAC address get: "
"%02x:%02x:%02x:%02x:%02x:%02x.\n",
mac_addr[0],
mac_addr[1],
mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
} }
return 0; return 0;
} }

View File

@ -203,6 +203,7 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
unsigned int data = 0; unsigned int data = 0;
int boguscount = 40; int boguscount = 40;
int err = -ENODEV; int err = -ENODEV;
DECLARE_MAC_BUF(mac);
dev->base_addr = ioaddr; dev->base_addr = ioaddr;
dev->irq = irq; dev->irq = irq;
@ -268,8 +269,9 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
for (i=0; i<6; i++) { for (i=0; i<6; i++) {
outw(i, IE_GP); outw(i, IE_GP);
printk("%2.2x ", dev->dev_addr[i] = inb(IE_SAPROM)); dev->dev_addr[i] = inb(IE_SAPROM);
} }
printk("%s ", print_mac(mac, dev->dev_addr));
PRINTK2((KERN_DEBUG "%s: I/O #4 passed!\n", dev->name)); PRINTK2((KERN_DEBUG "%s: I/O #4 passed!\n", dev->name));

View File

@ -1962,6 +1962,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
long addr; long addr;
int err; int err;
int using_dac = 0; int using_dac = 0;
DECLARE_MAC_BUF(mac);
/* See if we can set the dma mask early on; failure is fatal. */ /* See if we can set the dma mask early on; failure is fatal. */
if (sizeof(dma_addr_t) == 8 && if (sizeof(dma_addr_t) == 8 &&
@ -2226,13 +2227,11 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
ndev->features |= NETIF_F_HIGHDMA; ndev->features |= NETIF_F_HIGHDMA;
} }
printk(KERN_INFO "%s: ns83820 v" VERSION ": DP83820 v%u.%u: %02x:%02x:%02x:%02x:%02x:%02x io=0x%08lx irq=%d f=%s\n", printk(KERN_INFO "%s: ns83820 v" VERSION ": DP83820 v%u.%u: %s io=0x%08lx irq=%d f=%s\n",
ndev->name, ndev->name,
(unsigned)readl(dev->base + SRR) >> 8, (unsigned)readl(dev->base + SRR) >> 8,
(unsigned)readl(dev->base + SRR) & 0xff, (unsigned)readl(dev->base + SRR) & 0xff,
ndev->dev_addr[0], ndev->dev_addr[1], print_mac(mac, ndev->dev_addr),
ndev->dev_addr[2], ndev->dev_addr[3],
ndev->dev_addr[4], ndev->dev_addr[5],
addr, pci_dev->irq, addr, pci_dev->irq,
(ndev->features & NETIF_F_HIGHDMA) ? "h,sg" : "sg" (ndev->features & NETIF_F_HIGHDMA) ? "h,sg" : "sg"
); );

View File

@ -1155,6 +1155,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct net_device *dev; struct net_device *dev;
struct pasemi_mac *mac; struct pasemi_mac *mac;
int err; int err;
DECLARE_MAC_BUF(mac_buf);
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) if (err)
@ -1237,11 +1238,10 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto out; goto out;
} else } else
printk(KERN_INFO "%s: PA Semi %s: intf %d, txch %d, rxch %d, " printk(KERN_INFO "%s: PA Semi %s: intf %d, txch %d, rxch %d, "
"hw addr %02x:%02x:%02x:%02x:%02x:%02x\n", "hw addr %s\n",
dev->name, mac->type == MAC_TYPE_GMAC ? "GMAC" : "XAUI", dev->name, mac->type == MAC_TYPE_GMAC ? "GMAC" : "XAUI",
mac->dma_if, mac->dma_txch, mac->dma_rxch, mac->dma_if, mac->dma_txch, mac->dma_rxch,
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], print_mac(mac_buf, dev->dev_addr));
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
return err; return err;

View File

@ -737,6 +737,7 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
int i, addr_len, option; int i, addr_len, option;
void *ioaddr = NULL; void *ioaddr = NULL;
static int board_idx = -1; static int board_idx = -1;
DECLARE_MAC_BUF(mac);
/* when built into the kernel, we only print version if device is found */ /* when built into the kernel, we only print version if device is found */
#ifndef MODULE #ifndef MODULE
@ -796,15 +797,11 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
tp->phys[0] = 32; tp->phys[0] = 32;
printk (KERN_INFO "%s: %s at 0x%lx, " printk (KERN_INFO "%s: %s at 0x%lx, %sIRQ %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);
printk (KERN_DEBUG "%s: Identified 8139 chip type '%s'\n", printk (KERN_DEBUG "%s: Identified 8139 chip type '%s'\n",

View File

@ -343,6 +343,7 @@ static int tc574_config(struct pcmcia_device *link)
u16 *phys_addr; u16 *phys_addr;
char *cardname; char *cardname;
union wn3_config config; union wn3_config config;
DECLARE_MAC_BUF(mac);
phys_addr = (u16 *)dev->dev_addr; phys_addr = (u16 *)dev->dev_addr;
@ -458,10 +459,10 @@ static int tc574_config(struct pcmcia_device *link)
strcpy(lp->node.dev_name, dev->name); strcpy(lp->node.dev_name, dev->name);
printk(KERN_INFO "%s: %s at io %#3lx, irq %d, hw_addr ", printk(KERN_INFO "%s: %s at io %#3lx, irq %d, "
dev->name, cardname, dev->base_addr, dev->irq); "hw_addr %s.\n",
for (i = 0; i < 6; i++) dev->name, cardname, dev->base_addr, dev->irq,
printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : ".\n")); print_mac(mac, dev->dev_addr));
printk(" %dK FIFO split %s Rx:Tx, %sMII interface.\n", printk(" %dK FIFO split %s Rx:Tx, %sMII interface.\n",
8 << config.u.ram_size, ram_split[config.u.ram_split], 8 << config.u.ram_size, ram_split[config.u.ram_split],
config.u.autoselect ? "autoselect " : ""); config.u.autoselect ? "autoselect " : "");

View File

@ -255,6 +255,7 @@ static int tc589_config(struct pcmcia_device *link)
int last_fn, last_ret, i, j, multi = 0, fifo; int last_fn, last_ret, i, j, multi = 0, fifo;
kio_addr_t ioaddr; kio_addr_t ioaddr;
char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"};
DECLARE_MAC_BUF(mac);
DEBUG(0, "3c589_config(0x%p)\n", link); DEBUG(0, "3c589_config(0x%p)\n", link);
@ -330,11 +331,10 @@ static int tc589_config(struct pcmcia_device *link)
strcpy(lp->node.dev_name, dev->name); strcpy(lp->node.dev_name, dev->name);
printk(KERN_INFO "%s: 3Com 3c%s, io %#3lx, irq %d, hw_addr ", printk(KERN_INFO "%s: 3Com 3c%s, io %#3lx, irq %d, "
dev->name, (multi ? "562" : "589"), dev->base_addr, "hw_addr %s\n",
dev->irq); dev->name, (multi ? "562" : "589"), dev->base_addr, dev->irq,
for (i = 0; i < 6; i++) print_mac(mac, dev->dev_addr));
printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n"));
printk(KERN_INFO " %dK FIFO split %s Rx:Tx, %s xcvr\n", printk(KERN_INFO " %dK FIFO split %s Rx:Tx, %s xcvr\n",
(fifo & 7) ? 32 : 8, ram_split[(fifo >> 16) & 3], (fifo & 7) ? 32 : 8, ram_split[(fifo >> 16) & 3],
if_names[dev->if_port]); if_names[dev->if_port]);

View File

@ -292,6 +292,7 @@ static int axnet_config(struct pcmcia_device *link)
cisparse_t parse; cisparse_t parse;
int i, j, last_ret, last_fn; int i, j, last_ret, last_fn;
u_short buf[64]; u_short buf[64];
DECLARE_MAC_BUF(mac);
DEBUG(0, "axnet_config(0x%p)\n", link); DEBUG(0, "axnet_config(0x%p)\n", link);
@ -403,11 +404,11 @@ static int axnet_config(struct pcmcia_device *link)
strcpy(info->node.dev_name, dev->name); strcpy(info->node.dev_name, dev->name);
printk(KERN_INFO "%s: Asix AX88%d90: io %#3lx, irq %d, hw_addr ", printk(KERN_INFO "%s: Asix AX88%d90: io %#3lx, irq %d, "
"hw_addr %s\n",
dev->name, ((info->flags & IS_AX88790) ? 7 : 1), dev->name, ((info->flags & IS_AX88790) ? 7 : 1),
dev->base_addr, dev->irq); dev->base_addr, dev->irq,
for (i = 0; i < 6; i++) print_mac(mac, dev->dev_addr));
printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n"));
if (info->phy_id != -1) { if (info->phy_id != -1) {
DEBUG(0, " MII transceiver at index %d, status %x.\n", info->phy_id, j); DEBUG(0, " MII transceiver at index %d, status %x.\n", info->phy_id, j);
} else { } else {

View File

@ -346,6 +346,7 @@ static int fmvj18x_config(struct pcmcia_device *link)
cardtype_t cardtype; cardtype_t cardtype;
char *card_name = "unknown"; char *card_name = "unknown";
u_char *node_id; u_char *node_id;
DECLARE_MAC_BUF(mac);
DEBUG(0, "fmvj18x_config(0x%p)\n", link); DEBUG(0, "fmvj18x_config(0x%p)\n", link);
@ -533,11 +534,10 @@ static int fmvj18x_config(struct pcmcia_device *link)
strcpy(lp->node.dev_name, dev->name); strcpy(lp->node.dev_name, dev->name);
/* print current configuration */ /* print current configuration */
printk(KERN_INFO "%s: %s, sram %s, port %#3lx, irq %d, hw_addr ", printk(KERN_INFO "%s: %s, sram %s, port %#3lx, irq %d, "
"hw_addr %s\n",
dev->name, card_name, sram_config == 0 ? "4K TX*2" : "8K TX*2", dev->name, card_name, sram_config == 0 ? "4K TX*2" : "8K TX*2",
dev->base_addr, dev->irq); dev->base_addr, dev->irq, print_mac(mac, dev->dev_addr));
for (i = 0; i < 6; i++)
printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n"));
return 0; return 0;

View File

@ -658,6 +658,7 @@ static int nmclan_config(struct pcmcia_device *link)
u_char buf[64]; u_char buf[64];
int i, last_ret, last_fn; int i, last_ret, last_fn;
kio_addr_t ioaddr; kio_addr_t ioaddr;
DECLARE_MAC_BUF(mac);
DEBUG(0, "nmclan_config(0x%p)\n", link); DEBUG(0, "nmclan_config(0x%p)\n", link);
@ -716,10 +717,10 @@ static int nmclan_config(struct pcmcia_device *link)
strcpy(lp->node.dev_name, dev->name); strcpy(lp->node.dev_name, dev->name);
printk(KERN_INFO "%s: nmclan: port %#3lx, irq %d, %s port, hw_addr ", printk(KERN_INFO "%s: nmclan: port %#3lx, irq %d, %s port,"
dev->name, dev->base_addr, dev->irq, if_names[dev->if_port]); " hw_addr %s\n",
for (i = 0; i < 6; i++) dev->name, dev->base_addr, dev->irq, if_names[dev->if_port],
printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); print_mac(mac, dev->dev_addr));
return 0; return 0;
cs_failed: cs_failed:

View File

@ -38,7 +38,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <../drivers/net/8390.h> #include "../8390.h"
#include <pcmcia/cs_types.h> #include <pcmcia/cs_types.h>
#include <pcmcia/cs.h> #include <pcmcia/cs.h>
@ -521,6 +521,7 @@ static int pcnet_config(struct pcmcia_device *link)
int has_shmem = 0; int has_shmem = 0;
u_short buf[64]; u_short buf[64];
hw_info_t *hw_info; hw_info_t *hw_info;
DECLARE_MAC_BUF(mac);
DEBUG(0, "pcnet_config(0x%p)\n", link); DEBUG(0, "pcnet_config(0x%p)\n", link);
@ -670,9 +671,7 @@ static int pcnet_config(struct pcmcia_device *link)
printk (" mem %#5lx,", dev->mem_start); printk (" mem %#5lx,", dev->mem_start);
if (info->flags & HAS_MISC_REG) if (info->flags & HAS_MISC_REG)
printk(" %s xcvr,", if_names[dev->if_port]); printk(" %s xcvr,", if_names[dev->if_port]);
printk(" hw_addr "); printk(" hw_addr %s\n", print_mac(mac, dev->dev_addr));
for (i = 0; i < 6; i++)
printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n"));
return 0; return 0;
cs_failed: cs_failed:

View File

@ -962,6 +962,7 @@ static int smc91c92_config(struct pcmcia_device *link)
int i, j, rev; int i, j, rev;
kio_addr_t ioaddr; kio_addr_t ioaddr;
u_long mir; u_long mir;
DECLARE_MAC_BUF(mac);
DEBUG(0, "smc91c92_config(0x%p)\n", link); DEBUG(0, "smc91c92_config(0x%p)\n", link);
@ -1074,10 +1075,9 @@ static int smc91c92_config(struct pcmcia_device *link)
strcpy(smc->node.dev_name, dev->name); strcpy(smc->node.dev_name, dev->name);
printk(KERN_INFO "%s: smc91c%s rev %d: io %#3lx, irq %d, " printk(KERN_INFO "%s: smc91c%s rev %d: io %#3lx, irq %d, "
"hw_addr ", dev->name, name, (rev & 0x0f), dev->base_addr, "hw_addr %s\n",
dev->irq); dev->name, name, (rev & 0x0f), dev->base_addr, dev->irq,
for (i = 0; i < 6; i++) print_mac(mac, dev->dev_addr));
printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n"));
if (rev > 0) { if (rev > 0) {
if (mir & 0x3ff) if (mir & 0x3ff)

View File

@ -731,6 +731,7 @@ xirc2ps_config(struct pcmcia_device * link)
u_char buf[64]; u_char buf[64];
cistpl_lan_node_id_t *node_id = (cistpl_lan_node_id_t*)parse.funce.data; cistpl_lan_node_id_t *node_id = (cistpl_lan_node_id_t*)parse.funce.data;
cistpl_cftable_entry_t *cf = &parse.cftable_entry; cistpl_cftable_entry_t *cf = &parse.cftable_entry;
DECLARE_MAC_BUF(mac);
local->dingo_ccr = NULL; local->dingo_ccr = NULL;
@ -1032,11 +1033,9 @@ xirc2ps_config(struct pcmcia_device * link)
strcpy(local->node.dev_name, dev->name); strcpy(local->node.dev_name, dev->name);
/* give some infos about the hardware */ /* give some infos about the hardware */
printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr", printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr %s\n",
dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq); dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq,
for (i = 0; i < 6; i++) print_mac(mac, dev->dev_addr));
printk("%c%02X", i?':':' ', dev->dev_addr[i]);
printk("\n");
return 0; return 0;

View File

@ -955,6 +955,7 @@ static int pppoe_seq_show(struct seq_file *seq, void *v)
{ {
struct pppox_sock *po; struct pppox_sock *po;
char *dev_name; char *dev_name;
DECLARE_MAC_BUF(mac);
if (v == SEQ_START_TOKEN) { if (v == SEQ_START_TOKEN) {
seq_puts(seq, "Id Address Device\n"); seq_puts(seq, "Id Address Device\n");
@ -964,11 +965,8 @@ static int pppoe_seq_show(struct seq_file *seq, void *v)
po = v; po = v;
dev_name = po->pppoe_pa.dev; dev_name = po->pppoe_pa.dev;
seq_printf(seq, "%08X %02X:%02X:%02X:%02X:%02X:%02X %8s\n", seq_printf(seq, "%08X %s %8s\n",
po->pppoe_pa.sid, po->pppoe_pa.sid, print_mac(mac, po->pppoe_pa.remote), dev_name);
po->pppoe_pa.remote[0], po->pppoe_pa.remote[1],
po->pppoe_pa.remote[2], po->pppoe_pa.remote[3],
po->pppoe_pa.remote[4], po->pppoe_pa.remote[5], dev_name);
out: out:
return 0; return 0;
} }

View File

@ -1348,6 +1348,7 @@ static int gelic_net_setup_netdev(struct gelic_net_card *card)
unsigned int i; unsigned int i;
int status; int status;
u64 v1, v2; u64 v1, v2;
DECLARE_MAC_BUF(mac);
SET_NETDEV_DEV(netdev, &card->dev->core); SET_NETDEV_DEV(netdev, &card->dev->core);
spin_lock_init(&card->tx_dma_lock); spin_lock_init(&card->tx_dma_lock);
@ -1373,10 +1374,8 @@ static int gelic_net_setup_netdev(struct gelic_net_card *card)
v1 <<= 16; v1 <<= 16;
memcpy(addr.sa_data, &v1, ETH_ALEN); memcpy(addr.sa_data, &v1, ETH_ALEN);
memcpy(netdev->dev_addr, addr.sa_data, ETH_ALEN); memcpy(netdev->dev_addr, addr.sa_data, ETH_ALEN);
dev_info(ctodev(card), "MAC addr %02x:%02x:%02x:%02x:%02x:%02x\n", dev_info(ctodev(card), "MAC addr %s\n",
netdev->dev_addr[0], netdev->dev_addr[1], print_mac(mac, netdev->dev_addr));
netdev->dev_addr[2], netdev->dev_addr[3],
netdev->dev_addr[4], netdev->dev_addr[5]);
card->vlan_index = -1; /* no vlan */ card->vlan_index = -1; /* no vlan */
for (i = 0; i < GELIC_NET_VLAN_MAX; i++) { for (i = 0; i < GELIC_NET_VLAN_MAX; i++) {

Some files were not shown because too many files have changed in this diff Show More