From: Wolfgang Denk Date: Thu, 10 Apr 2014 12:15:30 +0200 Subject: [U-Boot] [PATCH] Fix USB keyboard polling via control endpoint In-Reply-To: <201404101012.42527.marex@denx.de> References: <4526969.2646.1396715845133.JavaMail.adrian@Gurnard> <20140406111746.25D3538099A@gemini.denx.de> <201404101012.42527.marex@denx.de> Message-ID: <20140410101530.8FA16380CBC@gemini.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 Dear Marek, In message <201404101012.42527.marex@denx.de> you wrote: > On Sunday, April 06, 2014 at 01:17:46 PM, Wolfgang Denk wrote: > [...] > > > @@ -131,7 +133,9 @@ void usb_kbd_generic_poll(void) > > /* Submit a interrupt transfer request */ > > maxp = usb_maxpacket(usb_kbd_dev, pipe); > > usb_submit_int_msg(usb_kbd_dev, pipe, data->new, > > - maxp > 8 ? 8 : maxp, ep->bInterval); > > + maxp > USB_KBD_PDATA_SIZE ? > > + USB_KBD_PDATA_SIZE : maxp, > > + ep->bInterval); > > Can we use min(8, USB_KBD_PDATA_SIZE) here instead of this multi-line monster > call please ? Agreed. > Also, this USB_KBD_PDATA_SIZE should instead be called "USB_KBD_LS_REPORT_S> IZE" > according to USB HID spec v1.11 section 5.6 : Fine with me. > What worries me a bit is that 64-byte high-speed report, but I never saw a > device that would generate those. This section 5.6 is also the only place that > mentions the high-speed HID device report size limit. I'm not an USB expert; I cannot comment on this. > Other than that, I don't see a problem. So how should we proceed? Shall I prepare an updated patch - or Adrian, will you do that? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Remember that the best relationship is one in which your love for each other exceeds your need for each other. - Dalai Lama