On Wednesday 27 September 2006 07:17, Randy Dunlap wrote:
> On Tue, 26 Sep 2006 22:10:43 -0700 Joe Perches wrote:
>
> > On Tue, 2006-09-26 at 21:56 -0700, Randy Dunlap wrote:
> > > > Nope, that's part of the NIC's MAC address. It was split up.
> > >
> > > Sorry. In this case, it was via-rhine.c:
> > >
> > > for (i = 0; i < 5; i++)
> > > printk("%2.2x:", dev->dev_addr[i]);
> > > printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], pdev->irq);
> > >
> > > so it does break the printk()s up itself.
> >
> > Changing all of those MAC address printks to a single function
> > could prevent this.
> >
> > http://www.uwsg.iu.edu/hypermail/linux/net/0602.1/0002.html
>
> True enough. Thanks for the patch.
> However, in this case, the single-printed MAC address still needs
> a \n, with the IRQ on a separate line (wasting vertical screen space),
> or it needs a custom printk() that is all done at one time.
Custom print_mac worked very nice for me in acx driver.
In order to accomodate arbitrary text before/after mac addres,
I did it this way:
#define MACSTR "%02X:%02X:%02X:%02X:%02X:%02X"
#define MAC(bytevector) \
((unsigned char *)bytevector)[0], \
((unsigned char *)bytevector)[1], \
((unsigned char *)bytevector)[2], \
((unsigned char *)bytevector)[3], \
((unsigned char *)bytevector)[4], \
((unsigned char *)bytevector)[5]
void print_mac(const char *head, const unsigned char *mac, const char *tail)
{
printk("%s"MACSTR"%s", head, MAC(mac), tail);
}
Usage: print_mac("adev->bssid: ", adev->bssid, "\n");
--
vda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]