[PATCH 2/3] USB: usbtest - ensure correct isoc data length

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Check the data length of isochronous transfers is
as expected.

With this test #16 will now fail if the device side
sends no data.

Signed-off-by: Martin Fuzzey <mfuzzey@xxxxxxxxx>

---

 drivers/usb/misc/usbtest.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index bb078eb..a35b427 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -1371,6 +1371,8 @@ static void iso_callback(struct urb *urb)
 		ctx->errors += urb->error_count;
 	else if (urb->status != 0)
 		ctx->errors += urb->number_of_packets;
+	else if (urb->actual_length != urb->transfer_buffer_length)
+		ctx->errors++;
 
 	if (urb->status == 0 && ctx->count > (ctx->pending - 1)
 			&& !ctx->submit_error) {

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux