Duncan Sands wrote:
> On a slightly different topic, if you have
> more than one modem, don't they end up being assigned interface numbers in a
> random order - how to deal with that?

Assuming each device has a unique ESI you should be able to tell them apart
bu reading /proc/net/atm/devices.

> > Thats why my patch changes ATM_ITF_ANY to just mean "the first interface on
> > the list"  That way ATM_ITF_ANY doesn't change behavior for the common case
> > where you have a single device.
> 
> But what does this change buy you?
[...]
> Or is the point that you can simplify the code a lot?

Exactly -- it means you don't have to fix it.

I think the fact that the kernel seems to crash if you actually try to use
it speaks to how useful people have found ATM_ITF_ANY in the past. :-)
Let's just get rid of it rather than dealing with the locking mess.

> In the common case of a single
> device, the behaviour would be the same.  

Exactly.  And if you have more than one device the behavior never made much
sense so my patch doesn't make it any worse.

> It's less clear to me that recycling interface numbers faster is the real
> solution -

I think that if you never have more than one device plugged in at a time
then you should only have "interface 0".  Anything else is needlessly
confusing.  If one day your (single) ethernet card got detected as "eth12"
wouldn't you find that a little odd?

> isn't that just papering over the problem that interface numbers are 
> meaningless,
> and get handed out rather randomly?  It would be better if devices could be
> specified by some sort of universally meaningful thing, like the MAC address 
> (do
> ATM cards have these - the speedtouch modems do, and store it in esi).

Yes, in general although not every driver grabs ESI correctly.

I think the situation is similar to ethernet -- the stack assigns the
"meaningless" interface numbers in order and for 99.9% of people that's
good enough.  For the corner cases where you do care (like you have multiple
usb-ethernet devices going to differnet networks that you're hotplugging)
you can do determinations based on MAC/ESI address

> Why is it the "correct interface number"?  If I have two USB modems (say
> interfaces 0 and 1) and I restart the hotplug subsystem, they will both
> be disconnected and reconnected.  Even with such an API as you suggest,
> there is nothing to stop them being assigned interface numbers 1 and 0
> on reconnection.  Is that wrong?

No, if you specifically do something to trigger a rescan of the bus then
you'd expect the order to possibly change, right?  Again, no different than
what happens with ethernet devices

-Mitch


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to