Re: Regarding USB error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 24 Jun 2009, Prabhu Chawandi wrote:

> HI alan,
> 
>   I am reading the descriptor and speed of the USB storage device, for
> that I wrote an ioctl locally,
> 
> Here is the code segment returning error ---
> 
> ret = usb_control_msg(pRootHub, usb_rcvctrlpipe(pRootHub, 0),
>                USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_PORT, 0,
>                port_num + 1, portsts, sizeof(struct usb_hub_status),
> 5000/* HZ */);
>          if (ret < 0) {
>             err("3 HUB_PORT: --> %s (%d) failed (err = %d)",
> __FUNCTION__, pRootHub->devnum, ret);
>          }
> 
> I am getting the above error:
> 
> Getting in depth, I am having two HCDs, How can I check which HCD is
> being used ?

Read the system log for bootup.  The log messages say which HCD is used
for each controller.

> As this IOCTL is working prefect for the rear port which is using the
> controller 0, with only one port.
> 
> While its giving the above error for front port, which is another
> controller 1  with one port.

What is the error code you get?  Are you sure that pRootHub is set 
correctly?

Have you looked at get_port_status() in drivers/usb/core/hub.c?  It 
does essentially the same thing as your code above, and it works 
perfectly.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux