RE: [PATCH] usb/composite: fix bMaxPacketSize for SuperSpeed

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

 



Hi Sebastian,

> 
> For bMaxPacketSize0 we usually take what is specified in ep0-
> >maxpacket.
> This is fine in most cases, however on SuperSpeed bMaxPacketSize0
> specifies the exponent instead of the actual size in bytes. The only
> valid value on SS is 9 which denotes 512 bytes.
> 

You're right but something in this patch still bothers me: according to your
patch it is possible that cdev->gadget->ep0->maxpacket (that is set by the
DCD) won't match the bMaxPacketSize0 we report to the host in the device
descriptor.
cdev->gadget->ep0->maxpacket should be determined by the DCD otherwise it
won't function correctly. So, you're right that it should be 9 for SS but it
seems to me that it should be the DCDs responsibility to set the correct
value.
In the current code the device descriptor is updated according to the value
of bMaxPacketSize0 set by the DCD:

	cdev->desc.bMaxPacketSize0 =	cdev->gadget->ep0->maxpacket;

I think this should remain as is. For If the DCD declared that it supports
SS but neglected to set cdev->gadget->ep0->maxpacket to the correct value it
doesn't seem right to me to update the device descriptor.
I would add a warning message (or even ERROR) if the speed is SS but
cdev->gadget->ep0->maxpacket != 9.


Thanks,
Tanya Brokhman
---
Sent by an consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.






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