Duncan Sands | 26 Feb 2003 16:39
Picon
Picon
Favicon

USB hotplug: knowing which interface you are being called for

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?

Thanks,

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
Greg KH | 26 Feb 2003 18:04
Gravatar

Re: USB hotplug: knowing which interface you are being called for

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
Duncan Sands | 26 Feb 2003 21:11
Picon
Picon
Favicon

Re: USB hotplug: knowing which interface you are being called for

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,
(Continue reading)

Greg KH | 26 Feb 2003 23:27
Gravatar

Re: USB hotplug: knowing which interface you are being called for

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 <at> 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.
(Continue reading)

Duncan Sands | 27 Feb 2003 08:49
Picon
Picon
Favicon

Re: USB hotplug: knowing which interface you are being called for

> > 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 <at> 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,
(Continue reading)

Jeff Shearer | 25 Feb 2003 03:41

am i the only one who can't download hotplug-2002_08_26-1.noarch.rpm from source forge?

Here's the link I have been trying to get the file from:

http://sourceforge.net/project/showfiles.php?group_id=17679

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Randy.Dunlap | 25 Feb 2003 04:32

Re: am i the only one who can't download hotplug-2002_08_26-1.noarch.rpm from source forge?

On Mon, 24 Feb 2003 21:41:40 -0500
Jeff Shearer <jeff <at> shearer-family.org> wrote:

| Here's the link I have been trying to get the file from:
| 
| http://sourceforge.net/project/showfiles.php?group_id=17679

I didn't have any trouble downloading it.

--
~Randy

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Jeff Shearer | 25 Feb 2003 11:40

Re: am i the only one who can't download hotplug-2002_08_26-1.noarch.rpm from source forge?

Well, it worked this morning.  Thanks!

Randy.Dunlap wrote:
> On Mon, 24 Feb 2003 21:41:40 -0500
> Jeff Shearer <jeff <at> shearer-family.org> wrote:
> 
> | Here's the link I have been trying to get the file from:
> | 
> | http://sourceforge.net/project/showfiles.php?group_id=17679
> 
> I didn't have any trouble downloading it.
> 
> --
> ~Randy

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
pulleman | 9 Feb 2003 19:28
Picon

problems with digital camera as mass-storage

hi,

when i plug my camera via usb to the pc, the pc wont recognize it as
a mass-stroage device :

Feb  9 18:52:47 wizard kernel: hub.c: USB new device connect on bus1/1,
assigned device number 2
Feb  9 18:52:47 wizard kernel: usb.c: USB device 2 (vend/prod
0x54c/0x10) is not claimed by any active driver.
Feb  9 18:52:47 wizard /sbin/hotplug[1734]: /sbin/hotplug usb
Feb  9 18:52:47 wizard /sbin/hotplug[1734]: HOME=/
Feb  9 18:52:47 wizard /sbin/hotplug[1734]:
PATH=/bin:/sbin:/usr/sbin:/usr/bin
Feb  9 18:52:47 wizard /sbin/hotplug[1734]: ACTION=add
Feb  9 18:52:47 wizard /sbin/hotplug[1734]: INTERFACE=8/255/1
Feb  9 18:52:47 wizard /sbin/hotplug[1734]: DEVFS=/proc/bus/usb
Feb  9 18:52:47 wizard /sbin/hotplug[1734]: DEVICE=/proc/bus/usb/001/002
Feb  9 18:52:47 wizard /sbin/hotplug[1734]: PRODUCT=54c/10/430
Feb  9 18:52:47 wizard /sbin/hotplug[1734]: TYPE=0/0/0
Feb  9 18:52:47 wizard /sbin/hotplug[1734]: invoke
/etc/hotplug/usb.agent ()
Feb  9 18:52:50 wizard /etc/hotplug/usb.agent[1734]: ... no modules for
USB product 54c/10/430

so i tried to read through mail-lists, docs, without success. i dont
know how to tell the system that this is a mass storage device.

when i use an external card reader, everything works and i am able to
mount dev/sda

(Continue reading)

Hotplug List Emails | 6 Feb 2003 19:54

maturity of hotplug disk storage devices

Hi,

I am looking for some advice on the maturity of hotplug functions for 
Linux disk storage devices.  I looked into this two years ago and found 
that although insertion/removal appeared to often work, in particular 
with scsi, it was not really officially supported thru the entire 
protocol stack at the time.

Now, I find evidence in general, hotplug support has improved, 
presumeably positively influenced by subsequent USB and firewire 
development.  But disks are more complex than printers, scanners, etc so 
Im having a difficult time forming an opinion about how "official" this 
all is for disk storage.   Have the improvements gotten into disk 
storage related areas also?  Should I really consider relying on hotplug 
disk storage in a mission critical application?

Well, I would really be interested in any comments anyone had, privately 
or publicly, on the maturity of hotplug disk storage in Linux 2.4.  Does 
insertion/removal of existing/new devices work reliably on IDE, SCSI, 
Fibrechannel, USB, iee1394?  Is it "officially" supported?  Are you 
using it on a mission critical machine?  Do things like the MD driver 
and LVM handle hotplugged drives reliably well?

Of course I assume appropriate hardware doing the right things 
electrically and that any filesystem is unmounted.

Any help understanding the current state would be greatly appreciated!

Thanks,
Mark
(Continue reading)


Gmane