All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Bruens <stefan.bruens@rwth-aachen.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/7] usb: increase USB descriptor buffer size
Date: Sun, 13 Dec 2015 19:35:19 +0100	[thread overview]
Message-ID: <2415535.ONnvDgm0Am@pebbles.site> (raw)
In-Reply-To: <201512130549.24439.marex@denx.de>

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 <stefan.bruens@rwth-aachen.de>
> 
> 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.

Kind regards,

Stefan

-- 
Stefan Br?ns  /  Bergstra?e 21  /  52062 Aachen
home: +49 241 53809034     mobile: +49 151 50412019
work: +49 2405 49936-424

  reply	other threads:[~2015-12-13 18:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-13  4:47 [U-Boot] [PATCH 1/7] usb: increase USB descriptor buffer size Stefan Brüns
2015-12-13  4:49 ` Marek Vasut
2015-12-13 18:35   ` Stefan Bruens [this message]
2015-12-13 18:49     ` Marek Vasut
2015-12-18  1:07       ` [U-Boot] [PATCH] usb: Alloc buffer for USB descriptor dynamically Stefan Brüns
2015-12-18 20:19         ` Marek Vasut
2015-12-18 22:41         ` Simon Glass
2015-12-19 15:23           ` Stefan Bruens
2015-12-19 20:29             ` Simon Glass
2015-12-19 21:23               ` Stefan Bruens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2415535.ONnvDgm0Am@pebbles.site \
    --to=stefan.bruens@rwth-aachen.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.