From: Stephen H. W. <we...@gr...> - 2003-06-16 13:10:27
|
> From: Johannes Erdfelt <joh...@er...> > Cc: lib...@li... > Content-Disposition: inline > Sender: lib...@li... > X-Original-Date: Sun, 15 Jun 2003 14:49:16 -0400 > Date: Sun, 15 Jun 2003 14:49:16 -0400 > X-UIDL: 9G\d9Ffpd9&ha!!?%]d9 > > On Sun, Jun 15, 2003, Andreas Jellinghaus <aj...@du...> wrote: > > please add a function to open a usb device > > by device name. > > > > This issue was mentioned earlier by > > http://sourceforge.net/mailarchive/forum.php?thread_id=1949914&forum_id=5425 > > > > However it is not linux specific. > > on linux the kernel spawns /sbin/hotplug which is some shell > > magic and in the end it execs e.g. my helper app. > > On *bsd the usbd can do the same thing. > > > > Paths, environment and all such stuff might be different, > > but in the end some mechanism detects if there is a new > > usb device with the product and vendor id i can handle, > > and it calls my driver, and it can pass the name of the > > device I need to open. > > > > The current work around is to scan all busses and devices, > > and compare the filename to the one I already have. that > > is not useful. please add a direct function > > usb_dev_handle *usb_open_bypath(char *devpath); > > > > or something similar. accepting a file descriptor would > > be also ok, if you prefer that. > > > > In case some *bsd does not have an usbd: > > the fix is to write one / port usbd to that *bsd. > > That would be the best way to get my driver working > > on that unix. So if some *bsd does not have an usbd, > > please still create that function in libusb for all devices. > > > > Thank you! > > > > Regards, Andreas > > > > P.S. If you want me to put my feet where my mouth is, dig into > > the source, write the patch and submit it: I will do it. > > It might be very easy for anyone familiar with the source, > > but take me some time to get into the source... > > > > P.P.S. libusb might also be a good place to document some hints on > > how to configure hotplug and usbd, so not every author of some > > hotplugging usb driver app needs to know about it. > > You can already find a device by filename in 0.1. The information needed > is already available. Look at bus->dirname and dev->filename. > > For 1.0, I will probably add a Linux specific extension (but discourage > use for everything but integrating with Linux hotplug) to find a device > based on the usbfs file name. I concur with this. In Mac OS X, I dont' think there's a reasonable way to call a user-mode program from the hotplug process. One would have to write a kernel-mode driver, I think, to make this happen. And I don't think there's a Unix-style device name; just a multi-digit "location" code. -Stephen H. Westin Any information or opinions in this message are mine: they do not represent the position of Cornell University or any of its sponsors. |