ioemu: Add SEEK_STAT in all non-error cases except sleep request, since
our seek times are virtually 0. Although this flag is deprecated by
newer ATA standards, Linux at least checks it for CD drives, and would
timeout in some cases if we do not set it.
Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
diff -r eb223ad9eee0 tools/ioemu/hw/ide.c
--- a/tools/ioemu/hw/ide.c Fri Aug 08 11:41:58 2008 +0100
+++ b/tools/ioemu/hw/ide.c Mon Aug 11 12:36:03 2008 +0100
@@ -1122,14 +1122,14 @@ static void ide_flush_cb(void *opaque, i
return;
}
else
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_set_irq(s);
}
static void ide_atapi_cmd_ok(IDEState *s)
{
s->error = 0;
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO | ATAPI_INT_REASON_CD;
ide_set_irq(s);
}
@@ -1243,7 +1243,7 @@ static void ide_atapi_cmd_reply_end(IDES
if (s->packet_transfer_size <= 0) {
/* end of transfer */
ide_transfer_stop(s);
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO |
ATAPI_INT_REASON_CD;
ide_set_irq(s);
#ifdef DEBUG_IDE_ATAPI
@@ -1321,10 +1321,10 @@ static void ide_atapi_cmd_reply(IDEState
s->io_buffer_index = 0;
if (s->atapi_dma) {
- s->status = READY_STAT | DRQ_STAT;
+ s->status = READY_STAT | SEEK_STAT | DRQ_STAT;
ide_dma_start(s, ide_atapi_cmd_read_dma_cb);
} else {
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_atapi_cmd_reply_end(s);
}
}
@@ -1339,7 +1339,7 @@ static void ide_atapi_cmd_read_pio(IDESt
s->io_buffer_index = sector_size;
s->cd_sector_size = sector_size;
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_atapi_cmd_reply_end(s);
}
@@ -1382,7 +1382,7 @@ static void ide_atapi_cmd_read_dma_cb(vo
}
if (s->packet_transfer_size <= 0) {
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO |
ATAPI_INT_REASON_CD;
ide_set_irq(s);
eot:
@@ -1432,7 +1432,7 @@ static void ide_atapi_cmd_read_dma(IDESt
s->cd_sector_size = sector_size;
/* XXX: check if BUSY_STAT should be set */
- s->status = READY_STAT | DRQ_STAT | BUSY_STAT;
+ s->status = READY_STAT | SEEK_STAT | DRQ_STAT | BUSY_STAT;
ide_dma_start(s, ide_atapi_cmd_read_dma_cb);
}
@@ -1900,7 +1900,7 @@ static void ide_ioport_write(void *opaqu
ide_abort_command(s);
} else {
s->mult_sectors = s->nsector;
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
}
ide_set_irq(s);
break;
@@ -1910,7 +1910,7 @@ static void ide_ioport_write(void *opaqu
case WIN_VERIFY_ONCE:
/* do sector number check ? */
ide_cmd_lba48_transform(s, lba48);
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_set_irq(s);
break;
case WIN_READ_EXT:
@@ -1979,12 +1979,12 @@ static void ide_ioport_write(void *opaqu
case WIN_READ_NATIVE_MAX:
ide_cmd_lba48_transform(s, lba48);
ide_set_sector(s, s->nb_sectors - 1);
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_set_irq(s);
break;
case WIN_CHECKPOWERMODE1:
s->nsector = 0xff; /* device active or idle */
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_set_irq(s);
break;
case WIN_SETFEATURES:
@@ -2084,7 +2084,7 @@ static void ide_ioport_write(void *opaqu
/* overlapping commands not supported */
if (s->feature & 0x02)
goto abort_cmd;
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
s->atapi_dma = s->feature & 1;
s->nsector = 1;
ide_transfer_start(s, s->io_buffer, ATAPI_PACKET_SIZE,
@@ -2303,7 +2303,7 @@ static void ide_reset(IDEState *s)
s->mult_sectors = MAX_MULT_SECTORS;
s->cur_drive = s;
s->select = 0xa0;
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_set_signature(s);
/* init the transfer handler so that 0xffff is returned on data
accesses */
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|