]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Include/IndustryStandard/VirtioBlk.h
OvmfPkg: IndustryStandard/VirtioBlk: introduce topology-related definitions
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / VirtioBlk.h
index a9f91e4673b922d0d6e338bad3a92ae1e8da1943..2ce528a12ef37bc31a8b999c08c406a518ebae48 100644 (file)
 // virtio-0.9.5, Appendix D: Block Device\r
 //\r
 #pragma pack(1)\r
+typedef struct {\r
+  UINT8  PhysicalBlockExp; // # of logical blocks per physical block (log2)\r
+  UINT8  AlignmentOffset;  // offset of first aligned logical block\r
+  UINT16 MinIoSize;        // suggested minimum I/O size in blocks\r
+  UINT32 OptIoSize;        // optimal (suggested maximum) I/O size in blocks\r
+} VIRTIO_BLK_TOPOLOGY;\r
+\r
 typedef struct {\r
   UINT64              Capacity;\r
   UINT32              SizeMax;\r
@@ -33,6 +40,7 @@ typedef struct {
   UINT8               Heads;\r
   UINT8               Sectors;\r
   UINT32              BlkSize;\r
+  VIRTIO_BLK_TOPOLOGY Topology;\r
 } VIRTIO_BLK_CONFIG;\r
 #pragma pack()\r
 \r
@@ -47,9 +55,11 @@ typedef struct {
 #define VIRTIO_BLK_F_BLK_SIZE BIT6  // treated as "logical block size" in\r
                                     // practice; actual host side\r
                                     // implementation negotiates "optimal"\r
-                                    // block size separately\r
+                                    // block size separately, via\r
+                                    // VIRTIO_BLK_F_TOPOLOGY\r
 #define VIRTIO_BLK_F_SCSI     BIT7\r
 #define VIRTIO_BLK_F_FLUSH    BIT9  // identical to "write cache enabled"\r
+#define VIRTIO_BLK_F_TOPOLOGY BIT10 // information on optimal I/O alignment\r
 \r
 //\r
 // We keep the status byte separate from the rest of the virtio-blk request\r