* Re: USB hotplug: knowing which interface you are being called for
2003-02-26 15:39 USB hotplug: knowing which interface you are being called for Duncan Sands
@ 2003-02-26 17:04 ` Greg KH
2003-02-26 20:11 ` Duncan Sands
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2003-02-26 17:04 UTC (permalink / raw)
To: linux-hotplug
On Wed, Feb 26, 2003 at 04:39:36PM +0100, Duncan Sands wrote:
> Greetings hotpluggers: when a USB device is plugged in (2.5), the
> usb hotplugging scripts are called for each interface. I don't see a
> convenient way to work out the interface number from the info passed
> it, namely the path to the interface in sysfs. Any suggestions?
As discussed on #kernelnewbies irc channel:
basename $DEVPATH
will give the interface number. Hm, you might have to search that
result for a ":" and then use the number after that which is the
interface number.
And I'll go add endpoint info to the sysfs directory too, that should
make your life easier, right?
thanks,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: USB hotplug: knowing which interface you are being called for
2003-02-26 15:39 USB hotplug: knowing which interface you are being called for Duncan Sands
2003-02-26 17:04 ` Greg KH
@ 2003-02-26 20:11 ` Duncan Sands
2003-02-26 22:27 ` Greg KH
2003-02-27 7:49 ` Duncan Sands
3 siblings, 0 replies; 5+ messages in thread
From: Duncan Sands @ 2003-02-26 20:11 UTC (permalink / raw)
To: linux-hotplug
On Wednesday 26 February 2003 18:04, Greg KH wrote:
> On Wed, Feb 26, 2003 at 04:39:36PM +0100, Duncan Sands wrote:
> > Greetings hotpluggers: when a USB device is plugged in (2.5), the
> > usb hotplugging scripts are called for each interface. I don't see a
> > convenient way to work out the interface number from the info passed
> > it, namely the path to the interface in sysfs. Any suggestions?
>
> As discussed on #kernelnewbies irc channel:
> basename $DEVPATH
> will give the interface number. Hm, you might have to search that
> result for a ":" and then use the number after that which is the
> interface number.
>
> And I'll go add endpoint info to the sysfs directory too, that should
> make your life easier, right?
Hi Greg, thanks for looking into this. You are right about the ":" of course.
It would be nice to have all the info about the interface present in the sysfs
directory (yes, including the interface number!), i.e. the same info as in
struct usb_interface. This creates some kind of equality between probe
methods and hotplugging scripts - and why not supply the info if it exists?
For the endpoints, I guess you are going to have to deal with alternate
interface settings as well. I can see two methods: (1) a subdirectory for
each alt setting, containing endpoints, (2) endpoints indexed by alt setting
and endpoint number.
By the way, how are different configurations dealt with in the sysfs tree?
All the best,
Duncan.
-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: USB hotplug: knowing which interface you are being called for
2003-02-26 15:39 USB hotplug: knowing which interface you are being called for Duncan Sands
2003-02-26 17:04 ` Greg KH
2003-02-26 20:11 ` Duncan Sands
@ 2003-02-26 22:27 ` Greg KH
2003-02-27 7:49 ` Duncan Sands
3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2003-02-26 22:27 UTC (permalink / raw)
To: linux-hotplug
On Wed, Feb 26, 2003 at 09:11:46PM +0100, Duncan Sands wrote:
> On Wednesday 26 February 2003 18:04, Greg KH wrote:
> > On Wed, Feb 26, 2003 at 04:39:36PM +0100, Duncan Sands wrote:
> > > Greetings hotpluggers: when a USB device is plugged in (2.5), the
> > > usb hotplugging scripts are called for each interface. I don't see a
> > > convenient way to work out the interface number from the info passed
> > > it, namely the path to the interface in sysfs. Any suggestions?
> >
> > As discussed on #kernelnewbies irc channel:
> > basename $DEVPATH
> > will give the interface number. Hm, you might have to search that
> > result for a ":" and then use the number after that which is the
> > interface number.
> >
> > And I'll go add endpoint info to the sysfs directory too, that should
> > make your life easier, right?
>
> Hi Greg, thanks for looking into this. You are right about the ":" of course.
> It would be nice to have all the info about the interface present in the sysfs
> directory (yes, including the interface number!), i.e. the same info as in
> struct usb_interface. This creates some kind of equality between probe
> methods and hotplugging scripts - and why not supply the info if it exists?
Ok, I just did that:
http://linuxusb.bkbits.net:8080/usb-2.5/patch@1.1415
> For the endpoints, I guess you are going to have to deal with alternate
> interface settings as well. I can see two methods: (1) a subdirectory for
> each alt setting, containing endpoints, (2) endpoints indexed by alt setting
> and endpoint number.
Yeah, the endpoints aren't going to be as simple, I'll have to think
about them for a bit.
> By the way, how are different configurations dealt with in the sysfs tree?
They really aren't supported well at all, see Oliver's patch a while ago
on linux-usb-devel that added better support to the core first.
thanks,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: USB hotplug: knowing which interface you are being called for
2003-02-26 15:39 USB hotplug: knowing which interface you are being called for Duncan Sands
` (2 preceding siblings ...)
2003-02-26 22:27 ` Greg KH
@ 2003-02-27 7:49 ` Duncan Sands
3 siblings, 0 replies; 5+ messages in thread
From: Duncan Sands @ 2003-02-27 7:49 UTC (permalink / raw)
To: linux-hotplug
> > Hi Greg, thanks for looking into this. You are right about the ":" of
> > course. It would be nice to have all the info about the interface present
> > in the sysfs directory (yes, including the interface number!), i.e. the
> > same info as in struct usb_interface. This creates some kind of equality
> > between probe methods and hotplugging scripts - and why not supply the
> > info if it exists?
>
> Ok, I just did that:
> http://linuxusb.bkbits.net:8080/usb-2.5/patch@1.1415
Great! I will test.
> > For the endpoints, I guess you are going to have to deal with alternate
> > interface settings as well. I can see two methods: (1) a subdirectory
> > for each alt setting, containing endpoints, (2) endpoints indexed by alt
> > setting and endpoint number.
>
> Yeah, the endpoints aren't going to be as simple, I'll have to think
> about them for a bit.
>
> > By the way, how are different configurations dealt with in the sysfs
> > tree?
>
> They really aren't supported well at all, see Oliver's patch a while ago
> on linux-usb-devel that added better support to the core first.
I guess they could be added as independent devices, with the
USB code enforcing mutually exclusive access.
Anyway, thanks a lot,
Duncan.
-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 5+ messages in thread