[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1342034621.1855.15.camel@schesaplana>
Date: Wed, 11 Jul 2012 21:23:41 +0200
From: Michael Riesch <michael@...sch.at>
To: Christian Riesch <christian.riesch@...cron.at>
Cc: Ben Hutchings <bhutchings@...arflare.com>, netdev@...r.kernel.org,
Oliver Neukum <oneukum@...e.de>,
Eric Dumazet <edumazet@...gle.com>,
Allan Chou <allan@...x.com.tw>,
Mark Lord <kernel@...savvy.com>,
Grant Grundler <grundler@...omium.org>,
Ming Lei <tom.leiming@...il.com>
Subject: Re: [PATCH 4/4] asix: Add a new driver for the AX88172A
On Wed, 2012-07-11 at 17:10 +0200, Christian Riesch wrote:
> Hi again,
[...]
> >>> Using the ifindex sounds good to me,
> >>>
> >>> snprintf(priv->mdio->id, MII_BUS_ID_SIZE, "asix-%d",
> >>> dev->net->ifindex);
> >>>
> >>> works on any system with less than 10^12 network interfaces.
> >>
> >> Ok, I'll change that to use ifindex.
> >
> > No, I won't.
> > At the time the mdio bus is registered, ifindex is not yet set, so the
> > snprintf would always result in "asix-0".
>
> What do you think about
> snprintf(priv->mdio->id, MII_BUS_ID_SIZE, "usb-%03d:%03d",
> dev->udev->bus->busnum, dev->udev->devnum);
> ??
>
> This would use the busnum/devnum identifier as reported by lsusb and
> would be short enough for an mdio bus name.
IMHO this would be a good solution - it is unique and there you can tell
which MDIO bus belongs to which USB device by the name (not sure if
someone will ever need to do that, but it is neat).
Regards, Michael
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists