aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-24 16:10:43 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-24 16:10:43 +0000
commit985a03b0ce38275c2ea355bf29b6d6b5779dbb56 (patch)
tree22eac188d157768555e44f33f2eca5be2508c10b /hw
parent1b0889958e875df85c7b2353498ed2cac16415ce (diff)
Real SCSI device passthrough (v4), by Laurent Vivier.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3851 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/esp.c4
-rw-r--r--hw/lsi53c895a.c8
-rw-r--r--hw/scsi-disk.h2
3 files changed, 12 insertions, 2 deletions
diff --git a/hw/esp.c b/hw/esp.c
index df7a5e1668..fa58c6e6bf 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -615,7 +615,9 @@ void esp_scsi_attach(void *opaque, BlockDriverState *bd, int id)
}
DPRINTF("Attaching block device %d\n", id);
/* Command queueing is not implemented. */
- s->scsi_dev[id] = scsi_disk_init(bd, 0, esp_command_complete, s);
+ s->scsi_dev[id] = scsi_generic_init(bd, 0, esp_command_complete, s);
+ if (s->scsi_dev[id] == NULL)
+ s->scsi_dev[id] = scsi_disk_init(bd, 0, esp_command_complete, s);
}
void *esp_init(target_phys_addr_t espaddr,
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 3a4ddf7f63..a08cfd9e3e 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -1236,6 +1236,8 @@ static uint8_t lsi_reg_readb(LSIState *s, int offset)
return s->sdid;
case 0x07: /* GPREG0 */
return 0x7f;
+ case 0x08: /* Revision ID */
+ return 0x00;
case 0xa: /* SSID */
return s->ssid;
case 0xb: /* SBCL */
@@ -1281,6 +1283,8 @@ static uint8_t lsi_reg_readb(LSIState *s, int offset)
return s->ctest4;
case 0x22: /* CTEST5 */
return s->ctest5;
+ case 0x23: /* CTEST6 */
+ return 0;
case 0x24: /* DBC[0:7] */
return s->dbc & 0xff;
case 0x25: /* DBC[8:15] */
@@ -1838,7 +1842,9 @@ void lsi_scsi_attach(void *opaque, BlockDriverState *bd, int id)
s->scsi_dev[id]->destroy(s->scsi_dev[id]);
}
DPRINTF("Attaching block device %d\n", id);
- s->scsi_dev[id] = scsi_disk_init(bd, 1, lsi_command_complete, s);
+ s->scsi_dev[id] = scsi_generic_init(bd, 1, lsi_command_complete, s);
+ if (s->scsi_dev[id] == NULL)
+ s->scsi_dev[id] = scsi_disk_init(bd, 1, lsi_command_complete, s);
}
void *lsi_scsi_init(PCIBus *bus, int devfn)
diff --git a/hw/scsi-disk.h b/hw/scsi-disk.h
index ffe894b767..f42212bc22 100644
--- a/hw/scsi-disk.h
+++ b/hw/scsi-disk.h
@@ -26,6 +26,8 @@ struct SCSIDevice
SCSIDevice *scsi_disk_init(BlockDriverState *bdrv, int tcq,
scsi_completionfn completion, void *opaque);
+SCSIDevice *scsi_generic_init(BlockDriverState *bdrv, int tcq,
+ scsi_completionfn completion, void *opaque);
/* cdrom.c */
int cdrom_read_toc(int nb_sectors, uint8_t *buf, int msf, int start_track);