patch "usb: raw-gadget: fix handling of dual-direction-capable endpoints" added to usb-testing
Subsystems (3)
This is a note to let you know that I've just added the patch titled
usb: raw-gadget: fix handling of dual-direction-capable endpoints
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-testing branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will be merged to the usb-next branch sometime soon, after it passes testing, and the merge window is open.
If you have any questions about this process, please let me know.
From d2d1bfa1e422242c3a794007857b463c081f3d5f Mon Sep 17 00:00:00 2001
From: Jann Horn <[email protected]>
Date: Wed, 26 Jan 2022 21:52:14 +0100
Subject: 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.
--- drivers/usb/gadget/legacy/raw_gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/legacy/raw_gadget.c +1 -1
@@ -1004,7 +1004,7 @@ static int raw_process_ep_io(struct raw_dev *dev, struct usb_raw_ep_io *io, ret = -EBUSY ; goto out_unlock; } -if ((in && !ep->ep->caps.dir_in) || (!in && ep->ep->caps.dir_in)) { +if (in !=usb_endpoint_dir_in (ep->ep->desc)) {dev_dbg (&dev->gadget->dev,"fail, wrong direction\n" ); ret = -EINVAL ; goto out_unlock;
Signature · 1 line
2.35.1