]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: loopback: Fix looping back logic implementation
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Wed, 14 Oct 2015 20:49:40 +0000 (22:49 +0200)
committerFelipe Balbi <balbi@ti.com>
Thu, 15 Oct 2015 15:19:52 +0000 (10:19 -0500)
commit48e6e0ae29f7c35d05eb66d0cd1a3c40cc8c7c8d
treea90a3c3f10aa4b5d0d64e37da0d1acc6b5dc7827
parentb3e0a32b6849f9e8716a85eb6a3e48e2f4e26567
usb: gadget: loopback: Fix looping back logic implementation

Since commit ec59c3737b450cd7fc8350eeabe8039008172b76
("usb: gadget: loopback: don't queue requests to bogus endpoints")

Loopback function is not realy working as that commit removed
all looping back logic. After that commit ep-out works like
/dev/null and ep-in works like /dev/zero.

This commit fix this issue by allocating set of out requests
and set of in requests but each out req shares buffer with
one in req:

out_req->buf ---> buf <--- in_req.buf
out_req->context <---> in_req.context

The completion routine simply  enqueue the suitable req in
an oposite direction.

Cc: <stable@vger.kernel.org> # 3.18+
Fixes: ec59c3737b450cd7fc8350eeabe8039008172b76
("usb: gadget: loopback: don't queue requests to bogus endpoints")

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/f_loopback.c