ia64/xen-unstable

changeset 18395:03bdbb7e7add

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@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Aug 27 14:57:23 2008 +0100 (2008-08-27)
parents dade7f0bdc8d
children 7a28400271f7
files tools/ioemu/hw/ide.c
line diff
     1.1 --- a/tools/ioemu/hw/ide.c	Wed Aug 27 14:53:39 2008 +0100
     1.2 +++ b/tools/ioemu/hw/ide.c	Wed Aug 27 14:57:23 2008 +0100
     1.3 @@ -1108,14 +1108,14 @@ static void ide_flush_cb(void *opaque, i
     1.4  	return;
     1.5      }
     1.6      else
     1.7 -        s->status = READY_STAT;
     1.8 +        s->status = READY_STAT | SEEK_STAT;
     1.9      ide_set_irq(s);
    1.10  }
    1.11  
    1.12  static void ide_atapi_cmd_ok(IDEState *s)
    1.13  {
    1.14      s->error = 0;
    1.15 -    s->status = READY_STAT;
    1.16 +    s->status = READY_STAT | SEEK_STAT;
    1.17      s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO | ATAPI_INT_REASON_CD;
    1.18      ide_set_irq(s);
    1.19  }
    1.20 @@ -1229,7 +1229,7 @@ static void ide_atapi_cmd_reply_end(IDES
    1.21      if (s->packet_transfer_size <= 0) {
    1.22          /* end of transfer */
    1.23          ide_transfer_stop(s);
    1.24 -        s->status = READY_STAT;
    1.25 +        s->status = READY_STAT | SEEK_STAT;
    1.26          s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO | ATAPI_INT_REASON_CD;
    1.27          ide_set_irq(s);
    1.28  #ifdef DEBUG_IDE_ATAPI
    1.29 @@ -1307,10 +1307,10 @@ static void ide_atapi_cmd_reply(IDEState
    1.30      s->io_buffer_index = 0;
    1.31  
    1.32      if (s->atapi_dma) {
    1.33 -    	s->status = READY_STAT | DRQ_STAT;
    1.34 +    	s->status = READY_STAT | SEEK_STAT | DRQ_STAT;
    1.35  	ide_dma_start(s, ide_atapi_cmd_read_dma_cb);
    1.36      } else {
    1.37 -    	s->status = READY_STAT;
    1.38 +    	s->status = READY_STAT | SEEK_STAT;
    1.39      	ide_atapi_cmd_reply_end(s);
    1.40      }
    1.41  }
    1.42 @@ -1325,7 +1325,7 @@ static void ide_atapi_cmd_read_pio(IDESt
    1.43      s->io_buffer_index = sector_size;
    1.44      s->cd_sector_size = sector_size;
    1.45  
    1.46 -    s->status = READY_STAT;
    1.47 +    s->status = READY_STAT | SEEK_STAT;
    1.48      ide_atapi_cmd_reply_end(s);
    1.49  }
    1.50  
    1.51 @@ -1368,7 +1368,7 @@ static void ide_atapi_cmd_read_dma_cb(vo
    1.52      }
    1.53  
    1.54      if (s->packet_transfer_size <= 0) {
    1.55 -        s->status = READY_STAT;
    1.56 +        s->status = READY_STAT | SEEK_STAT;
    1.57          s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO | ATAPI_INT_REASON_CD;
    1.58          ide_set_irq(s);
    1.59      eot:
    1.60 @@ -1418,7 +1418,7 @@ static void ide_atapi_cmd_read_dma(IDESt
    1.61      s->cd_sector_size = sector_size;
    1.62  
    1.63      /* XXX: check if BUSY_STAT should be set */
    1.64 -    s->status = READY_STAT | DRQ_STAT | BUSY_STAT;
    1.65 +    s->status = READY_STAT | SEEK_STAT | DRQ_STAT | BUSY_STAT;
    1.66      ide_dma_start(s, ide_atapi_cmd_read_dma_cb);
    1.67  }
    1.68  
    1.69 @@ -1886,7 +1886,7 @@ static void ide_ioport_write(void *opaqu
    1.70                  ide_abort_command(s);
    1.71              } else {
    1.72                  s->mult_sectors = s->nsector;
    1.73 -                s->status = READY_STAT;
    1.74 +                s->status = READY_STAT | SEEK_STAT;
    1.75              }
    1.76              ide_set_irq(s);
    1.77              break;
    1.78 @@ -1896,7 +1896,7 @@ static void ide_ioport_write(void *opaqu
    1.79          case WIN_VERIFY_ONCE:
    1.80              /* do sector number check ? */
    1.81  	    ide_cmd_lba48_transform(s, lba48);
    1.82 -            s->status = READY_STAT;
    1.83 +            s->status = READY_STAT | SEEK_STAT;
    1.84              ide_set_irq(s);
    1.85              break;
    1.86  	case WIN_READ_EXT:
    1.87 @@ -1965,12 +1965,12 @@ static void ide_ioport_write(void *opaqu
    1.88          case WIN_READ_NATIVE_MAX:
    1.89  	    ide_cmd_lba48_transform(s, lba48);
    1.90              ide_set_sector(s, s->nb_sectors - 1);
    1.91 -            s->status = READY_STAT;
    1.92 +            s->status = READY_STAT | SEEK_STAT;
    1.93              ide_set_irq(s);
    1.94              break;
    1.95          case WIN_CHECKPOWERMODE1:
    1.96              s->nsector = 0xff; /* device active or idle */
    1.97 -            s->status = READY_STAT;
    1.98 +            s->status = READY_STAT | SEEK_STAT;
    1.99              ide_set_irq(s);
   1.100              break;
   1.101          case WIN_SETFEATURES:
   1.102 @@ -2070,7 +2070,7 @@ static void ide_ioport_write(void *opaqu
   1.103              /* overlapping commands not supported */
   1.104              if (s->feature & 0x02)
   1.105                  goto abort_cmd;
   1.106 -            s->status = READY_STAT;
   1.107 +            s->status = READY_STAT | SEEK_STAT;
   1.108              s->atapi_dma = s->feature & 1;
   1.109              s->nsector = 1;
   1.110              ide_transfer_start(s, s->io_buffer, ATAPI_PACKET_SIZE, 
   1.111 @@ -2289,7 +2289,7 @@ static void ide_reset(IDEState *s)
   1.112      s->mult_sectors = MAX_MULT_SECTORS;
   1.113      s->cur_drive = s;
   1.114      s->select = 0xa0;
   1.115 -    s->status = READY_STAT;
   1.116 +    s->status = READY_STAT | SEEK_STAT;
   1.117      ide_set_signature(s);
   1.118      /* init the transfer handler so that 0xffff is returned on data
   1.119         accesses */