On Fri, 14 Oct 2011, Fabian Godehardt wrote: > From: Christian Kellermann <ck@xxxxxxxxx> > > bMaxPacketSize specifies the maximum packet size for this endpoint in > bytes. According to usb spec valid values are 8, 16, 32, 64. > > Without the patch the g_printer driver will fail the USB consortium's > Chapter 9 conformity test suite. A value from the set above needs to > be set. Not true. Did you try it? > For the printer device choosing the maximum value has been choosen to > reduce overhead for data transfers. > > Signed-off-by: Christian Kellermann <ck@xxxxxxxxx> > Signed-off-by: Fabian Godehardt <fg@xxxxxxxxx> > --- > drivers/usb/gadget/printer.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c > index a341dde..9f6be75 100644 > --- a/drivers/usb/gadget/printer.c > +++ b/drivers/usb/gadget/printer.c > @@ -234,6 +234,7 @@ static struct usb_device_descriptor device_desc = { > .iManufacturer = STRING_MANUFACTURER, > .iProduct = STRING_PRODUCT, > .iSerialNumber = STRING_SERIALNUM, > + .bMaxPacketSize0 = 0x40, > .bNumConfigurations = 1 > }; This patch is completely unnecessary (and wrong). Evidently you didn't read the code that uses the device descriptor, in printer_setup(): case USB_DT_DEVICE: device_desc.bMaxPacketSize0 = gadget->ep0->maxpacket; value = min(wLength, (u16) sizeof device_desc); memcpy(req->buf, &device_desc, value); break; The bMaxPacketSize0 value is determined by the UDC driver, not the gadget driver. 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