On Thu, Jan 27, 2005, Hou Xiang ZHU <[EMAIL PROTECTED]> wrote: > I am using kernel 2.6.8.1 > I am trying to use libusb to talk to my usb stick. but can't claim interface. > (before I claim the interface, I can usb_set_configuration successfully!) > > here is some info: > ------------------------------------------------------------------------------------------------------------------------ > usb_os_init: Found USB VFS at /proc/bus/usb > usb_os_find_busses: Found 001 > usb_os_find_busses: Skipping non bus directory devices > usb_os_find_devices: Found 002 on 001 > usb_os_find_devices: Found 001 on 001 > Check that you have permissions to write to 001/002 and, if you don't, that > you set up hotplug (http://linux-hotplug.sourceforge.net/) correctly. > USB error: could not claim interface 0: Device or resource busy > -------------------------------------------------------------------- > and I checked the write permission of /proc/bus/usb,it seems it not the true > reason. > > ------------------------------------------------------------------------------ > [EMAIL PROTECTED] tests]# ls -al /proc/bus/usb/001 > total 0 > dr-xr-xr-x 2 root root 0 1 27 2005 . > drwxr-xr-x 3 root root 0 1 27 2005 .. > -rw-r--r-- 1 root root 43 1 27 2005 001 > -rw-r--r-- 1 root root 50 1 27 2005 002 > [EMAIL PROTECTED] tests]# ls -al /proc/bus/usb/001/00 > 001 002 > [EMAIL PROTECTED] tests]# ls -al /proc/bus/usb/001/001 > -rw-r--r-- 1 root root 43 1 27 2005 /proc/bus/usb/001/001 > [EMAIL PROTECTED] tests]# ls -al /proc/bus/usb/001/002 > -rw-r--r-- 1 root root 50 1 27 2005 /proc/bus/usb/001/002 > [EMAIL PROTECTED] tests]#
Are you running as root? > I found that the error returned by usb_driver_claim_interface() in > drivers/usb/core/usb.c where > > if(dev->driver) > return -EBUSY; > > I searched internet and it seems the driver is already claimed by usb core. > is that the cause? how to solve this problem? > because when the usb core detected the usb stick, it will bind the mass > storage driver to it.how to claim it again? You need to unbind the driver. Take a look at the usb_detach_kernel_driver_np() function: http://libusb.sourceforge.net/doc/function.usbdetachkerneldrivernp.html JE ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel