* dm9601 as ethX or usbX?
@ 2009-04-20 12:57 Marcin Juszkiewicz
2009-04-20 16:07 ` Peter Korsgaard
0 siblings, 1 reply; 2+ messages in thread
From: Marcin Juszkiewicz @ 2009-04-20 12:57 UTC (permalink / raw)
To: Peter Korsgaard; +Cc: netdev
Hi
I have two dm9601 based adapters. First one is recognized as 'ethX':
[269425.698235] usb 1-5.4.1: new full speed USB device using ehci_hcd and address 16
[269425.788125] usb 1-5.4.1: configuration #1 chosen from 1 choice
[269425.793478] eth1: register 'dm9601' at usb-0000:00:1a.7-5.4.1, Davicom DM9601 USB Ethernet, 00:60:6e:7f:0c:20
But second is 'usbX':
[269530.937166] usb 1-5.3: new full speed USB device using ehci_hcd and address 19
[269531.048917] usb 1-5.3: configuration #1 chosen from 1 choice
[269531.050188] dm9601: No valid MAC address in EEPROM, using 52:9f:f0:e8:44:36
[269531.054054] usb0: register 'dm9601' at usb-0000:00:1a.7-5.3, Davicom DM9601 USB Ethernet, 52:9f:f0:e8:44:36
Both has same vendor/product id:
Bus 001 Device 019: ID 0a46:9601 Davicom Semiconductor, Inc. DM9601 To Fast Ethernet Adapter
Bus 001 Device 018: ID 0a46:9601 Davicom Semiconductor, Inc. DM9601 To Fast Ethernet Adapter
but they differ in details - eth1 one has iManufacturer, iProduct, iSerial
fields filled, usb0 one has them empty:
iManufacturer 1 DM9601 USB NNC
iProduct 2 Davicom CO., LTD
iSerial 3 9601
Is this normal behaviour of those adapters that ones with empty eeprom
ends as usbX?
I would prefer to have both as ethX as I use them in devices where usbX
as usually usb-gadget (g_ether) and as such usb0 is configured in total
different scheme.
I know that one of options would be using udev and renaming of interface
but then I would have to remember to always copy that rule to each device.
Regards,
--
JID: hrw@jabber.org
Website: http://marcin.juszkiewicz.com.pl/
LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: dm9601 as ethX or usbX?
2009-04-20 12:57 dm9601 as ethX or usbX? Marcin Juszkiewicz
@ 2009-04-20 16:07 ` Peter Korsgaard
0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2009-04-20 16:07 UTC (permalink / raw)
To: Marcin Juszkiewicz; +Cc: netdev
>>>>> "Marcin" == Marcin Juszkiewicz <marcin@juszkiewicz.com.pl> writes:
Hi,
Marcin> Is this normal behaviour of those adapters that ones with empty eeprom
Marcin> ends as usbX?
Yes. The code in question is located in
drivers/net/usb/usbnet.c:usbnet_probe():
strcpy (net->name, "usb%d");
...
// heuristic: "usb%d" for links we know are two-host,
// else "eth%d" when there's reasonable doubt. userspace
// can rename the link if it knows better.
if ((dev->driver_info->flags & FLAG_ETHER) != 0
&& (net->dev_addr [0] & 0x02) == 0)
strcpy (net->name, "eth%d");
Bit 1 of the most significant byte of the MAC address specifies that
it's a locally generated (E.G. random) MAC address, which is what
dm9601.c will use if there's nothing specified in the EEPROM (or there
isn't any EEPROM connected).
Marcin> I would prefer to have both as ethX as I use them in devices
Marcin> where usbX as usually usb-gadget (g_ether) and as such usb0
Marcin> is configured in total different scheme.
Marcin> I know that one of options would be using udev and renaming
Marcin> of interface but then I would have to remember to always copy
Marcin> that rule to each device.
Sorry, other than that I don't know any other options (you could
ofcourse try to convince the usbnet maintainer to change the usbnet
logic, but it seems pretty sensible to me).
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-04-20 16:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-20 12:57 dm9601 as ethX or usbX? Marcin Juszkiewicz
2009-04-20 16:07 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).