Skip to contentSkip to conversation

sunvdc: add cdrom and v1.1 protocol support

PATCH Applied Allen Pais 2 participants 3 messages Sep 19, 2014 – Sep 30, 2014

Subsystems (2)
lore
Share & tools
lore

Allen Pais

author
#0 lore raw

PATCH 1/1 sunvdc: add cdrom and v1.1 protocol support

Interpret the media type from v1.1 protocol to support CDROM/DVD.

For v1.0 protocol, a disk's size continues to be calculated from the geometry returned by the vdisk server. The geometry returned by the server can be less than the actual number of sectors available in the backing image/device due to the rounding in the division used to compute the geometry in the vdisk server.

In v1.1 protocol a disk's actual size in sectors is returned during the handshake. Use this size when v1.1 protocol is negotiated. Since this size will always be larger than the former geometry computed size, disks created under v1.0 will be forwards compatible to v1.1, but not vice versa.

---
 arch/sparc/include/asm/vio.h |   12 ++++-
 drivers/block/sunvdc.c       |  109 +++++++++++++++++++++++++++++++++++-------
 2 files changed, 101 insertions(+), 20 deletions(-)
arch/sparc/include/asm/vio.h +9 -3
index e0f6c39..76290c8 100644
@@ -118,12 +118,18 @@ struct vio_disk_attr_info {
 	u8			vdisk_type;
 #define VD_DISK_TYPE_SLICE	0x01 /* Slice in block device	*/
 #define VD_DISK_TYPE_DISK	0x02 /* Entire block device	*/
-	u16			resv1;
+	u8			vdisk_mtype;		/* v1.1 */
+#define VD_MEDIA_TYPE_FIXED	0x01 /* Fixed device */
+#define VD_MEDIA_TYPE_CD	0x02 /* CD Device    */
+#define VD_MEDIA_TYPE_DVD	0x03 /* DVD Device   */
+	u8			resv1;
 	u32			vdisk_block_size;
 	u64			operations;
-	u64			vdisk_size;
+	u64			vdisk_size;		/* v1.1 */
 	u64			max_xfer_size;
-	u64			resv2[2];
+	u32			phys_block_size;	/* v1.2 */
+	u32			resv2;
+	u64			resv3[1];
 };
 
 struct vio_disk_desc {
drivers/block/sunvdc.c +92 -17

179 lines not on this page · raw message

Signature · 1 line
1.7.1
maintainer
#1 lore raw

From: Allen Pais <[email protected]>
Date: Fri, 19 Sep 2014 09:42:14 -0400

drivers/block/sunvdc.c line 27

Quoted 2 lines
drivers/block/sunvdc.c +2 -0
+#define DRV_MODULE_VERSION	"1.1"
+#define DRV_MODULE_RELDATE	"February 13, 2013"

It really took you guys 7 months to post this change upstream? :-/

maintainer Applied
#2 lore raw
In reply to Allen Pais

From: Allen Pais <[email protected]>
Date: Fri, 19 Sep 2014 09:42:14 -0400

Quoted 8 lines

Interpret the media type from v1.1 protocol to support CDROM/DVD.

For v1.0 protocol, a disk's size continues to be calculated from the geometry returned by the vdisk server. The geometry returned by the server can be less than the actual number of sectors available in the backing image/device due to the rounding in the division used to compute the geometry in the vdisk server.

Quoted 6 lines

In v1.1 protocol a disk's actual size in sectors is returned during the handshake. Use this size when v1.1 protocol is negotiated. Since this size will always be larger than the former geometry computed size, disks created under v1.0 will be forwards compatible to v1.1, but not vice versa.

Applied.