Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753855Ab3JCOUQ (ORCPT ); Thu, 3 Oct 2013 10:20:16 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:48142 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752477Ab3JCOUO (ORCPT ); Thu, 3 Oct 2013 10:20:14 -0400 Date: Thu, 3 Oct 2013 10:20:13 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Robert Baldyga cc: balbi@ti.com, , , , , , Subject: Re: [PATCH v4] USB: gadget: epautoconf: fix ep maxpacket check In-Reply-To: <524D48BA.9060800@samsung.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1397 Lines: 33 On Thu, 3 Oct 2013, Robert Baldyga wrote: > > This disagrees with the kerneldoc for usb_ep_autoconfig(). For bulk > > endpoints, wMaxPacket is always supposed to be set to the full-speed > > value, regardless of what the protocol driver specifies. > > Hmm, it looks like all gadgets calls usb_ep_autoconfig() for full speed > descriptors and after it they uses usb_assign_descriptors() function to > set descriptors proper for device speed. Also, the gadgets have the wMaxPacketSize value hard-coded for the HS and SS descriptors. > And it works until gadget sets > full speed descriptors. But what if gadget supports only high speed and > don't want to set full speed descriptors? If it will use > usb_ep_autoconfig() function for high speed descriptor, value of > wMaxPacketSize field will change to 64. Is there any good solution for > this problem or all gadgets have to support full speed? The gadget driver can change wMaxPacketSize back to the correct value after calling usb_ep_autoconfig(). Or you can change the definition of usb_ep_autoconfig(), and have the driver pass the speed value as an additional argument. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/