diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2016-08-15 05:19:35 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2016-08-15 05:19:35 +0200 |
commit | 0417bfe395f23ce9472ee5a2848bc31bc788cb1c (patch) | |
tree | 5f67e0eede434717e32a090e369de77021af99f4 | |
parent | 7f0f7a9b08de56ba7312f94a0706da1cd4348e61 (diff) |
Fix some SCSI commands.
-rw-r--r-- | main.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -175,12 +175,17 @@ struct CSW { } __attribute__((packed)); uint32_t nullbuf[16]; +uint32_t fcapbuf[] = { + 0x08000000, + 0x00010000, + 0x00020002 +}; uint32_t capbuf[] = { 0x00010000, 0x00020000 }; uint32_t inquirybuf[] = { - 0x02068020, + 0x02048000, 32, 0x20202020, 0x20202020, @@ -412,6 +417,9 @@ class USB_MSC_BBB : public USB_class_driver { // INQUIRY case 0x12: + if(cmd[2] != 0) { + return false; + } usb.write(1, inquirybuf, cbw.dCBWDataTransferLength); while(!usb.ep_ready(1)); return true; @@ -422,6 +430,12 @@ class USB_MSC_BBB : public USB_class_driver { while(!usb.ep_ready(1)); return true; + // READ FORMAT CAPACITIES + case 0x23: + usb.write(1, fcapbuf, sizeof(fcapbuf)); + while(!usb.ep_ready(1)); + return true; + // READ CAPACITY case 0x25: usb.write(1, capbuf, cbw.dCBWDataTransferLength); |