netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Korsgaard <jacmet@sunsite.dk>
To: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Cc: netdev@vger.kernel.org
Subject: Re: dm9601 as ethX or usbX?
Date: Mon, 20 Apr 2009 18:07:58 +0200	[thread overview]
Message-ID: <873ac3wboh.fsf@macbook.be.48ers.dk> (raw)
In-Reply-To: <200904201457.37704.marcin@juszkiewicz.com.pl> (Marcin Juszkiewicz's message of "Mon\, 20 Apr 2009 14\:57\:36 +0200")

>>>>> "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

      reply	other threads:[~2009-04-20 16:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-20 12:57 dm9601 as ethX or usbX? Marcin Juszkiewicz
2009-04-20 16:07 ` Peter Korsgaard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873ac3wboh.fsf@macbook.be.48ers.dk \
    --to=jacmet@sunsite.dk \
    --cc=marcin@juszkiewicz.com.pl \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).