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);

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.

If I understand correctly, it is (properly) protected not to allow
sending any control message to a device, if there is a driver registered.
-- 


-------------------------------------------------------
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

Reply via email to