[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RFC 06/11] ide: ATAPI-SCSI bridge can now forward re
From: |
Alexander Bezzubikov |
Subject: |
[Qemu-devel] [PATCH RFC 06/11] ide: ATAPI-SCSI bridge can now forward requests to SCSI |
Date: |
Tue, 18 Aug 2015 02:42:20 +0300 |
Signed-off-by: Alexander Bezzubikov <address@hidden>
---
hw/ide/atapi.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 79dd167..6e73910 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -1257,5 +1257,21 @@ void ide_atapi_cmd(IDEState *s)
return;
}
+ if (s->drive_kind == IDE_BRIDGE) {
+ IDEDevice *dev = s->bus->master;
+ SCSIDevice *scsi_dev = scsi_device_find(&dev->scsi_bus, 0, 0, 0);
+ s->cur_req = scsi_new_request_from_bridge(scsi_dev, 0, 0, buf, NULL);
+
+ /* Looks like a hack, but it's better than placing it at scsi_do_read
*/
+ if (buf[0] == READ_10) {
+ s->status |= BUSY_STAT;
+ }
+
+ if (scsi_req_enqueue(s->cur_req)) {
+ scsi_req_continue(s->cur_req);
+ }
+ return;
+ }
+
ide_atapi_cmd_error(s, ILLEGAL_REQUEST, ASC_ILLEGAL_OPCODE);
}
--
2.1.4
- [Qemu-devel] [PATCH RFC 00/11] QEMU ATAPI-SCSI bridge GSoC project, Alexander Bezzubikov, 2015/08/18
- [Qemu-devel] [PATCH RFC 05/11] ide: bridge 'transfer' and 'complete' functions added, Alexander Bezzubikov, 2015/08/17
- [Qemu-devel] [PATCH RFC 06/11] ide: ATAPI-SCSI bridge can now forward requests to SCSI,
Alexander Bezzubikov <=
- [Qemu-devel] [PATCH RFC 07/11] ide: Makefile corrected due to bridge creation, Alexander Bezzubikov, 2015/08/17
- [Qemu-devel] [PATCH RFC 08/11] scsi: SCSIDiskReq declaration moved to header, Alexander Bezzubikov, 2015/08/17
- [Qemu-devel] [PATCH RFC 01/11] ide: ATAPI-SCSI bridge TypeInfo and init function created, Alexander Bezzubikov, 2015/08/17
- [Qemu-devel] [PATCH RFC 10/11] ide: corrected ATAPI checks to be ignored by ATAPI-SCSI bridge, Alexander Bezzubikov, 2015/08/17