summaryrefslogtreecommitdiff
path: root/pc-bios/s390-ccw/virtio.c
diff options
context:
space:
mode:
authorEugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>2014-08-29 11:01:39 +0200
committerChristian Borntraeger <borntraeger@de.ibm.com>2014-09-01 09:23:02 +0200
commitf04db28b86654d1c7ff805b40eff27bba6b0f686 (patch)
tree752e37099f4a5149fc53a9df51cfdfa48e0833a7 /pc-bios/s390-ccw/virtio.c
parentb0885f7599739ed1d7002774f9be2ba1f8212cc7 (diff)
pc-bios/s390-ccw Really big EAV ECKD DASD handling
For EAV ECKD DASD, the cylinder count will have the magic value 0xfffeU. Therefore, use the block number to test for valid eckd addresses instead. Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'pc-bios/s390-ccw/virtio.c')
-rw-r--r--pc-bios/s390-ccw/virtio.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index 6ed3dc9cc2..c0540d1cd4 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -340,11 +340,6 @@ int virtio_get_block_size(void)
return blk_cfg.blk_size << blk_cfg.physical_block_exp;
}
-uint16_t virtio_get_cylinders(void)
-{
- return blk_cfg.geometry.cylinders;
-}
-
uint8_t virtio_get_heads(void)
{
return blk_cfg.geometry.heads;
@@ -355,6 +350,12 @@ uint8_t virtio_get_sectors(void)
return blk_cfg.geometry.sectors;
}
+uint64_t virtio_get_blocks(void)
+{
+ return blk_cfg.capacity /
+ (virtio_get_block_size() / VIRTIO_SECTOR_SIZE);
+}
+
void virtio_setup_block(struct subchannel_id schid)
{
struct vq_info_block info;