summaryrefslogtreecommitdiffstats
path: root/qemu/roms/seabios/src/hw/lsi-scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu/roms/seabios/src/hw/lsi-scsi.c')
-rw-r--r--qemu/roms/seabios/src/hw/lsi-scsi.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/qemu/roms/seabios/src/hw/lsi-scsi.c b/qemu/roms/seabios/src/hw/lsi-scsi.c
index b1d6bbf4b..ad3352886 100644
--- a/qemu/roms/seabios/src/hw/lsi-scsi.c
+++ b/qemu/roms/seabios/src/hw/lsi-scsi.c
@@ -50,12 +50,21 @@ struct lsi_lun_s {
u8 lun;
};
-static int
-lsi_scsi_cmd(struct lsi_lun_s *llun_gf, struct disk_op_s *op,
- void *cdbcmd, u16 target, u16 lun, u16 blocksize)
+int
+lsi_scsi_process_op(struct disk_op_s *op)
{
+ if (!CONFIG_LSI_SCSI)
+ return DISK_RET_EBADTRACK;
+ struct lsi_lun_s *llun_gf =
+ container_of(op->drive_gf, struct lsi_lun_s, drive);
+ u16 target = GET_GLOBALFLAT(llun_gf->target);
+ u16 lun = GET_GLOBALFLAT(llun_gf->lun);
+ u8 cdbcmd[16];
+ int blocksize = scsi_fill_cmd(op, cdbcmd, sizeof(cdbcmd));
+ if (blocksize < 0)
+ return default_process_op(op);
u32 iobase = GET_GLOBALFLAT(llun_gf->iobase);
- u32 dma = ((cdb_is_read(cdbcmd, blocksize) ? 0x01000000 : 0x00000000) |
+ u32 dma = ((scsi_is_read(op) ? 0x01000000 : 0x00000000) |
(op->count * blocksize));
u8 msgout[] = {
0x80 | lun, // select lun
@@ -122,21 +131,6 @@ fail:
return DISK_RET_EBADTRACK;
}
-int
-lsi_scsi_cmd_data(struct disk_op_s *op, void *cdbcmd, u16 blocksize)
-{
- if (!CONFIG_LSI_SCSI)
- return DISK_RET_EBADTRACK;
-
- struct lsi_lun_s *llun_gf =
- container_of(op->drive_gf, struct lsi_lun_s, drive);
-
- return lsi_scsi_cmd(llun_gf, op, cdbcmd,
- GET_GLOBALFLAT(llun_gf->target),
- GET_GLOBALFLAT(llun_gf->lun),
- blocksize);
-}
-
static int
lsi_scsi_add_lun(struct pci_device *pci, u32 iobase, u8 target, u8 lun)
{