On Thu, 12 Jan 2006, NIIBE Yutaka wrote: > Alan Stern wrote: > > You have completely misunderstood David's point. You _don't_ need to > > modify the kernel at all. > > Ah, well. I should have explained what I did, I was so excited when I > succeeded to control port power. > > I think that we need some modification in the kernel. > > Here is my experiment and understanding. > > > Just use usbfs to send a single URB to the hub (USBDEVFS_CONTROL), > > containing a Clear-Port-Feature(PORT_POWER) request, or the equivalent to > > turn on the power or adjust the LED. > > I have tried USBDEVFS_CONTROL things, before touching the kernel. I > used libusb-0.1.10a. In libusb, there is a function (in linux.c), > which uses USBDEVFS_CONTROL: > > int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, > int value, int index, char *bytes, int size, int timeout) > > I had expected this worked. While I didn't claim the interface, the kernel > complained about it, at drivers/usb/core/devio.c: > > dev_warn(&ps->dev->dev, "usbfs: process %d (%s) did not claim interface > %u before use\n", > current->pid, current->comm, ifnum);
You must not have sent a Set-Port-Feature request. This warning gets invoked only when the recipient part of bRequestType is ENDPOINT or INTERFACE, and for Set-Port-Feature the recipient is OTHER. > When I claimed the interface to use, at the function > usb_driver_claim_interface in drivers/usb/core/usb.c: > > if (dev->driver) > return -EBUSY; > > it returned -EBUSY. That's because the hub_driver is registered. As it should. > If I understand correctly, it is (properly) protected not to allow > sending any control message to a device, if there is a driver registered. Not so. If that were true then the lsusb utility would not work. You are allowed to send control messages whose recipient is anything other than ENDPOINT or INTERFACE, and you are allowed to send those as well if the type is VENDOR. Alan Stern ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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