OSDN Git Service

ide: add topology support
authorChristoph Hellwig <hch@lst.de>
Wed, 10 Feb 2010 22:37:51 +0000 (23:37 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 10 Feb 2010 22:53:54 +0000 (16:53 -0600)
Export the physical block size in the ATA IDENTIFY command.  The
other topology values are not supported in ATA so skip them.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/ide/core.c

index 4cfaf38..37a5151 100644 (file)
@@ -164,6 +164,8 @@ static void ide_identify(IDEState *s)
     put_le16(p + 101, s->nb_sectors >> 16);
     put_le16(p + 102, s->nb_sectors >> 32);
     put_le16(p + 103, s->nb_sectors >> 48);
+    if (s->conf && s->conf->physical_block_size)
+        put_le16(p + 106, 0x6000 | get_physical_block_exp(s->conf));
 
     memcpy(s->identify_data, p, sizeof(s->identify_data));
     s->identify_set = 1;