ibmtr: fix tr%d in dmesg
Subsystems (2)
PATCH 1/1 ibmtr: fix tr%d in dmesg
ibmtr and ibmtr_cs show tr%d in dmesg after alloc_netdev() but before register_netdev(). Fix it like e100 does - put a different name into dev->name until the device gets registered. I/O port seems to be unique enough and is available for the time of printk messages. With the fix, dmesg shows
ibmtr@0a20: ISA P&P 16/4 Adapter/A (short) | 16/4 ISA-16 Adapter found ibmtr@0a20: using irq 3, PIOaddr a20, 64K shared RAM.
ibmtr@0a20: Hardware address : 00:40:aa:a9:03:98
ibmtr@0a20: Shared RAM paging disabled. ti->page_mask 0
ibmtr@0a20: Maximum Receive Internet Protocol MTU 16Mbps: 16344, 4Mbps: 6104
tr0: port 0xa20, irq 3, mmio 0xd4850000, sram 0xd0000, hwaddr=00:40:aa:a9:03:98
drivers/net/tokenring/ibmtr.c +2 -0
@@ -368,6 +368,7 @@ int __devinit ibmtr_probe_card(struct net_device *dev) {int err =ibmtr_probe (dev);if (!err) { +strcpy (dev->name,"tr%d" ); err =register_netdev (dev);if (err)ibmtr_cleanup_card (dev);
@@ -699,6 +700,7 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)printk (version); }#endif /* !PCMCIA */ +sprintf (dev->name,"ibmtr@%04x" , PIOaddr);DPRINTK ("%s %s found\n" , channel_def[cardpresent -1 ],adapter_def (ti->adapter_type)); DPRINTK("using irq %d, PIOaddr %hx, %dK shared RAM.\n",
Signature · 1 line
Meelis Roos ([email protected])
David Miller
maintainerFrom: Meelis Roos <[email protected]>
Date: Sat, 2 Oct 2010 21:35:15 +0300 (EEST)
Quoted 6 lines
ibmtr and
ibmtr_csshow tr%d in dmesg afteralloc_netdev()but beforeregister_netdev(). Fix it like e100 does - put a different name intodev->nameuntil the device gets registered. I/O port seems to be unique enough and is available for the time of printk messages. With the fix, dmesg shows
Quoted 8 lines
ibmtr@0a20: ISA P&P 16/4 Adapter/A (short) | 16/4 ISA-16 Adapter found ibmtr@0a20: using irq 3, PIOaddr a20, 64K shared RAM.
ibmtr@0a20: Hardware address : 00:40:aa:a9:03:98
ibmtr@0a20: Shared RAM paging disabled.ti->page_mask0
ibmtr@0a20: Maximum Receive Internet Protocol MTU 16Mbps: 16344, 4Mbps: 6104
tr0: port0xa20, irq 3, mmio0xd4850000, sram0xd0000, hwaddr=00:40:aa:a9:03:98Signed-off-by Meelis Roos <[email protected]>
That may be how e100 does it, but this is a very ugly hack and an abuse of netdev->name
Instead, the more correct way to fit this is to use dev_info(), dev_err(), and friends. It will both print the correct stuff, and also document the probing path messages that occur before the net device is registered.
So please correct the prolem that way, thank you.
Quoted 4 lines
Instead, the more correct way to fit this is to use
dev_info(),dev_err(), and friends. It will both print the correct stuff, and also document the probing path messages that occur before the net device is registered.
OK, fair enough.
I remember trying dev_info first and getting null from it. Retried, got
(null): ISA P&P 16/4 Adapter/A (short) | 16/4 ISA-16 Adapter found
So it seems dev_info does not know about 16-bit pcmcia devices or buses... dev_driver_string() finds neither dev->name, dev->bus->name nor dev->class->name. Will dig into this some other day.
Signature · 1 line
Meelis Roos ([email protected])