Skip to content

Commit

Permalink
usb: usbtest: add pattern check on pipe in phase of unlink read
Browse files Browse the repository at this point in the history
TEST 11 unlinks the URB read request for N times. When host and gadget
both initialize pattern 1 (mod 63) data series to do IN transfer, the
host side function should check the data buffer if it is as mod 63
series, because the data packet which host receivced will follow
pattern 1. So this patch adds this checking action.

Signed-off-by: Huang Rui <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
huangrui authored and gregkh committed May 27, 2014
1 parent e4d58f5 commit a7683eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/usb/misc/usbtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,9 @@ static int unlink1(struct usbtest_dev *dev, int pipe, int size, int async)
while (!completion_done(&completion)) {
retval = usb_unlink_urb(urb);

if (retval == 0 && usb_pipein(urb->pipe))
retval = simple_check_buf(dev, urb);

switch (retval) {
case -EBUSY:
case -EIDRM:
Expand Down

0 comments on commit a7683eb

Please sign in to comment.