scst_vdisk: Make vdisk_sup_vpd() easier to extend

This patch doesn't change any functionality.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5729 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2014-08-26 03:21:07 +00:00
parent 7061a6ee8d
commit c6e5553797

View File

@@ -3259,20 +3259,21 @@ out:
static int vdisk_sup_vpd(uint8_t *buf, struct scst_cmd *cmd,
struct scst_vdisk_dev *virt_dev)
{
buf[3] = 4;
buf[4] = 0x0; /* this page */
buf[5] = 0x80; /* unit serial number */
buf[6] = 0x83; /* device identification */
buf[7] = 0x86; /* extended inquiry */
char *page_list = &buf[4], *p = page_list;
*p++ = 0x0; /* this page */
*p++ = 0x80; /* unit serial number */
*p++ = 0x83; /* device identification */
*p++ = 0x86; /* extended inquiry */
if (cmd->dev->type == TYPE_DISK) {
buf[3] += 2;
buf[8] = 0xB0; /* block limits */
buf[9] = 0xB1; /* block device charachteristics */
*p++ = 0xB0; /* block limits */
*p++ = 0xB1; /* block device charachteristics */
if (virt_dev->thin_provisioned) {
buf[3] += 1;
buf[10] = 0xB2; /* thin provisioning */
*p++ = 0xB2; /* thin provisioning */
}
}
buf[3] = p - page_list; /* page length */
return buf[3] + 4;
}