summaryrefslogtreecommitdiff
path: root/drivers/target
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@suse.de>2018-12-05 13:18:37 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2018-12-07 21:54:33 -0500
commit2d882847280e3ae1ddc95175d0fc2006e11bb63f (patch)
tree30a87ca5ca1cc54f5d0fbfa96f63e33616a9c9d7 /drivers/target
parent54a6f3f6a43cf5a5ad0421e4440a4c7095e7a223 (diff)
scsi: target: remove hardcoded T10 Vendor ID in INQUIRY response
Use the value stored in t10_wwn.vendor, which defaults to "LIO-ORG", but can be reconfigured via the vendor_id ConfigFS attribute. Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Bryant G. Ly <bly@catalogicsoftware.com> Reviewed-by: Lee Duncan <lduncan@suse.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_spc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
index 5d2993db345b..47094ae01c04 100644
--- a/drivers/target/target_core_spc.c
+++ b/drivers/target/target_core_spc.c
@@ -115,7 +115,8 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf)
*/
memset(&buf[8], 0x20,
INQUIRY_VENDOR_LEN + INQUIRY_MODEL_LEN + INQUIRY_REVISION_LEN);
- memcpy(&buf[8], "LIO-ORG", sizeof("LIO-ORG") - 1);
+ memcpy(&buf[8], dev->t10_wwn.vendor,
+ strnlen(dev->t10_wwn.vendor, INQUIRY_VENDOR_LEN));
memcpy(&buf[16], dev->t10_wwn.model,
strnlen(dev->t10_wwn.model, INQUIRY_MODEL_LEN));
memcpy(&buf[32], dev->t10_wwn.revision,
@@ -258,8 +259,9 @@ check_t10_vend_desc:
buf[off+1] = 0x1; /* T10 Vendor ID */
buf[off+2] = 0x0;
/* left align Vendor ID and pad with spaces */
- memset(&buf[off+4], 0x20, 8);
- memcpy(&buf[off+4], "LIO-ORG", sizeof("LIO-ORG") - 1);
+ memset(&buf[off+4], 0x20, INQUIRY_VENDOR_LEN);
+ memcpy(&buf[off+4], dev->t10_wwn.vendor,
+ strnlen(dev->t10_wwn.vendor, INQUIRY_VENDOR_LEN));
/* Extra Byte for NULL Terminator */
id_len++;
/* Identifier Length */