Re: [PATCH v2] usb: gadget: storage: add superspeed support

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

 



On Wed, 3 Aug 2011, Felipe Balbi wrote:

> this patch adds superspeed descriptors for the
> storage gadgets.
> 
> Signed-off-by: Felipe Balbi <balbi@xxxxxx>

...

> --- a/drivers/usb/gadget/storage_common.c
> +++ b/drivers/usb/gadget/storage_common.c
> @@ -493,12 +493,90 @@ static struct usb_descriptor_header *fsg_hs_function[] = {
>  	NULL,
>  };
>  
> +static struct usb_endpoint_descriptor
> +fsg_ss_bulk_in_desc = {
> +	.bLength =		USB_DT_ENDPOINT_SIZE,
> +	.bDescriptorType =	USB_DT_ENDPOINT,
> +
> +	/* bEndpointAddress copied from fs_bulk_in_desc during fsg_bind() */
> +	.bmAttributes =		USB_ENDPOINT_XFER_BULK,
> +	.wMaxPacketSize =	cpu_to_le16(1024),
> +};
> +
> +static struct usb_ss_ep_comp_descriptor fsg_ss_bulk_in_comp_desc = {
> +	.bLength =		sizeof(fsg_ss_bulk_in_comp_desc),
> +	.bDescriptorType =	USB_DT_SS_ENDPOINT_COMP,

Where does the bMaxBurst field get set up?

> +};
> +
> +static struct usb_endpoint_descriptor
> +fsg_ss_bulk_out_desc = {
> +	.bLength =		USB_DT_ENDPOINT_SIZE,
> +	.bDescriptorType =	USB_DT_ENDPOINT,
> +
> +	/* bEndpointAddress copied from fs_bulk_out_desc during fsg_bind() */
> +	.bmAttributes =		USB_ENDPOINT_XFER_BULK,
> +	.wMaxPacketSize =	cpu_to_le16(1024),
> +	.bInterval =		1,	/* NAK every 1 uframe */

This field must be left equal to 0, not set to 1.  bInterval is used 
with bulk endpoints only in high speed, not in SuperSpeed.

> +};
> +
> +static struct usb_ss_ep_comp_descriptor fsg_ss_bulk_out_comp_desc = {
> +	.bLength =		sizeof(fsg_ss_bulk_in_comp_desc),
> +	.bDescriptorType =	USB_DT_SS_ENDPOINT_COMP,
> +};
> +
> +#ifndef FSG_NO_INTR_EP
> +
> +static struct usb_endpoint_descriptor
> +fsg_ss_intr_in_desc = {
> +	.bLength =		USB_DT_ENDPOINT_SIZE,
> +	.bDescriptorType =	USB_DT_ENDPOINT,
> +
> +	/* bEndpointAddress copied from fs_intr_in_desc during fsg_bind() */
> +	.bmAttributes =		USB_ENDPOINT_XFER_INT,
> +	.wMaxPacketSize =	cpu_to_le16(2),
> +	.bInterval =		9,	/* 2**(9-1) = 256 uframes -> 32 ms */
> +};

It's kind of ridiculous to have a SuperSpeed implementation of the CB
or CBI transports, but we may as well be complete...

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