[SeaBIOS] [PATCH 04/16] usb-msc: support commands without payload

Paolo Bonzini pbonzini at redhat.com
Wed Nov 16 13:02:45 CET 2011


This lets the usb-msc driver send TEST UNIT READY commands.

Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
 src/usb-msc.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/usb-msc.c b/src/usb-msc.c
index 13ef93e..f74b8ec 100644
--- a/src/usb-msc.c
+++ b/src/usb-msc.c
@@ -79,9 +79,11 @@ usb_cmd_data(struct disk_op_s *op, void *cdbcmd, u16 blocksize)
         goto fail;
 
     // Transfer data from device.
-    ret = usb_send_bulk(bulkin, USB_DIR_IN, op->buf_fl, bytes);
-    if (ret)
-        goto fail;
+    if (bytes) {
+        ret = usb_send_bulk(bulkin, USB_DIR_IN, op->buf_fl, bytes);
+        if (ret)
+            goto fail;
+    }
 
     // Transfer csw info.
     struct csw_s csw;
-- 
1.7.7.1





More information about the SeaBIOS mailing list