From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 13 Dec 2015 19:49:30 +0100 Subject: [U-Boot] [PATCH 1/7] usb: increase USB descriptor buffer size In-Reply-To: <2415535.ONnvDgm0Am@pebbles.site> References: <1449982038-20918-1-git-send-email-stefan.bruens@rwth-aachen.de> <201512130549.24439.marex@denx.de> <2415535.ONnvDgm0Am@pebbles.site> Message-ID: <201512131949.30977.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sunday, December 13, 2015 at 07:35:19 PM, Stefan Bruens wrote: > On Sunday 13 December 2015 05:49:24 Marek Vasut wrote: > > On Sunday, December 13, 2015 at 05:47:18 AM, Stefan Br?ns wrote: > > > The configuration descriptor includes all interface, endpoint and > > > auxiliary descriptors (e.g. report, union) so 512 may not be enough. > > > > > > Signed-off-by: Stefan Br?ns > > > > Can the size be determined in a dynamic manner instead of this ad-hoc > > random number ? > > Currently the buffer is allocated on the stack with > ALLOC_CACHE_ALIGN_BUFFER in usb_select_config(... The buffer is passed to > usb_get_configuration_no(...), but the buffer size is implicit. > > usb_get_configuration_no(...) already determines and checks the descriptor > size, but as it can not readjust the buffer it just bails out if it is > to small. > > The absolute maximum size for the descriptor is 64kB. > > So yes, this is possible, but needs a little bit more work. Do you feel like working on it ? Best regards, Marek Vasut