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

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

 



Hi,

On Wed, Aug 03, 2011 at 10:16:36AM -0400, Alan Stern wrote:
> 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?

well, it doesn't. It's not mandatory, right, to use Bursts here and,
while it would be really nice to use it for command queueing, we don't
know how windows will behave with a e.g. USB3-capable Bulk-only MSC
device.

Has anyone tested this with some off-the-shelf device ? Do they use
bursts ?

> > +};
> > +
> > +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.

good point ;-)

> > +};
> > +
> > +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...

that's open to discussion, I'll leave it for sake of completeness if you
don't mind too much.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux