RE: Linux USB file storage gadget with new UDC

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

 



On Wed, 2 Jan 2013, victor wrote:

> Happy new year 2013. 
> After a long Christmas break, the USB file storage gadget and UDC gadget
> code are able to work partially on USB enumeration (running on linux 3.4.4).
> 
> 1) host PC sends a GET_DESCRIPTOR request, the gadget replies with device
> descriptor.
> 2) host PC sends a SET_ADDRESS request
> 3) host PC sends a GET_DESCRIPTOR request, the gadget replies with the same
> device descriptor.
> 4) host PC sends a GET_DESCRIPTOR request, the gadget replies with
> configuration descriptor.
> 5) host PC sends a GET_DESCRIPTOR request, the gadget replies with string
> descriptor.
> 6) host PC sends a GET_DESCRIPTOR request, the gadget replies with string
> descriptor.
> 7) host PC sends a GET_DESCRIPTOR request, the gadget replies with device
> qualifier descriptor.
> 8) host PC sends a GET_DESCRIPTOR request, the gadget replies with the same
> device descriptor.
> 9) host PC sends a GET_DESCRIPTOR request, the gadget replies with
> configuration descriptor.
> 10) host PC sends SET_CONFIGURATION
> 11) host PC sends 0xfe bRequest

What does the gadget send in response to this request?

> Then host PC sends a few more GET_DESCRIPTOR request, and the enumeration
> stops. No SCSI_inquiry command is received by the gadget device. In host PC,
> the gadget device is identified as USB mass storage device with an
> exclamation mark. 

You can find out what g_file_storage is doing if you uncomment the two 
#define lines near the start of the file_storage.c file:

/* #define VERBOSE_DEBUG */
/* #define DUMP_MSGS */

> The gadget device uses "endpoint 1" for bulk in and bulk out. In fsg_bind()
> of file_storage.c, bulk out endpoint is 2.

No, it's not.  The driver does not use fixed addresses for its
endpoints.  fsg_bind() calls usb_ep_autoconfig() to set up the endpoint
addresses.

> How to fix the bulk out endpoint
> to 1? 

Fix your UDC driver.  If it uses the right names for the endpoints then 
usb_ep_autoconfig() will automatically do the right thing.

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