linux/drivers/usb/gadget/legacy
Jann Horn 292d2c82b1 usb: raw-gadget: fix handling of dual-direction-capable endpoints
Under dummy_hcd, every available endpoint is *either* IN or OUT capable.
But with some real hardware, there are endpoints that support both IN and
OUT. In particular, the PLX 2380 has four available endpoints that each
support both IN and OUT.

raw-gadget currently gets confused and thinks that any endpoint that is
usable as an IN endpoint can never be used as an OUT endpoint.

Fix it by looking at the direction in the configured endpoint descriptor
instead of looking at the hardware capabilities.

With this change, I can use the PLX 2380 with raw-gadget.

Fixes: f2c2e71764 ("usb: gadget: add raw-gadget interface")
Cc: stable <stable@vger.kernel.org>
Tested-by: Andrey Konovalov <andreyknvl@gmail.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Signed-off-by: Jann Horn <jannh@google.com>
Link: https://lore.kernel.org/r/20220126205214.2149936-1-jannh@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31 14:22:49 +01:00
..
acm_ms.c USB: gadget: legacy: fix return error code in acm_ms_bind() 2020-12-28 15:45:50 +01:00
audio.c usb: gadget: audio: Fix a missing error return value in audio_bind() 2020-05-09 11:05:02 +03:00
cdc2.c usb: gadget: legacy: fix error return code in cdc_bind() 2020-05-09 11:05:08 +03:00
dbgp.c USB: gadget: bRequestType is a bitfield, not a enum 2021-12-15 18:40:48 +01:00
ether.c USB: gadget: legacy: fix an error code in eth_bind() 2021-01-31 13:53:39 +01:00
g_ffs.c usb: gadget: legacy: set max_speed to super-speed 2020-01-15 10:39:21 +01:00
gmidi.c usb: gadget: legacy: gmidi: remove useless cast for driver.name 2020-02-19 11:10:24 +01:00
hid.c usb: gadget: hid: fix error code in do_config() 2021-10-12 09:31:21 +02:00
inode.c headers/prep: usb: gadget: Fix namespace collision 2022-01-05 16:16:08 +01:00
Kconfig usb: gadget: uvc: add scatter gather support 2021-07-27 15:59:19 +02:00
Makefile usb: gadget: add raw-gadget interface 2020-03-15 11:34:48 +02:00
mass_storage.c usb: gadget: legacy: fix error return code of msg_bind() 2021-03-23 14:13:29 +01:00
multi.c USB: gadget: legacy: remove left-over __ref annotations 2021-03-23 12:57:10 +01:00
ncm.c usb: gadget: legacy: fix error return code in gncm_bind() 2020-05-09 11:05:08 +03:00
nokia.c usb: gadget: legacy: nokia: Remove unused static variable 'product_nokia' 2020-07-09 17:19:56 +02:00
printer.c usb: gadget: Add description for module parameter 2021-08-26 13:30:00 +02:00
raw_gadget.c usb: raw-gadget: fix handling of dual-direction-capable endpoints 2022-01-31 14:22:49 +01:00
serial.c usb: gadget: legacy/serial: allow dynamic removal 2019-10-22 10:27:15 +03:00
tcm_usb_gadget.c usb: gadget: tcm: fix spelling mistake: "Manufactor" -> "Manufacturer" 2018-07-26 13:35:29 +03:00
webcam.c usb: webcam: Invalid size of Processing Unit Descriptor 2021-03-18 09:02:27 +01:00
zero.c USB: Fix up terminology 2020-07-01 14:04:04 +02:00