]> git.sur5r.net Git - u-boot/commit
fix USB devices with multiple configurations
authorHarald Welte <laforge@gnumonks.org>
Sun, 6 Jul 2008 16:58:05 +0000 (00:58 +0800)
committerWolfgang Denk <wd@denx.de>
Thu, 10 Jul 2008 09:51:52 +0000 (11:51 +0200)
commite73b5212e0463a3db0af0a5c95c75bfb762ca973
tree01011b40e467bcc71a1573b556e5b73c187d7aab
parentc4b81f3238d77a4df343bd70ddfb7ebd29ca1dda
fix USB devices with multiple configurations

This patch fixes bugs in usbdcore*.c related to the use of devices
with multiple configurations.

The original code made mistakes about the meaning of configuration value and
configuration index, and the resulting off-by-one errors resulted in:

* SET_CONFIGURATION always selected the first configuration, no matter what
  wValue is being passed.
* GET_DESCRIPTOR/CONFIGURATION always returned the descriptor for the first
  configuration (index 0).

Signed-off-by: Harald Welte <laforge@openmoko.org>
Acked-by: Markus Klotzbuecher <mk@denx.de>
drivers/usb/usbdcore.c
drivers/usb/usbdcore_ep0.c