aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2012-10-11 16:41:31 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-10-26 15:29:46 -0400
commitc046aa0f0f47719a38854fc6383216392b130704 (patch)
tree5f1bf556e5258f1fa5a050378ddd6cb63027e3ea /drivers/scsi
parent29c08cdabd323adf7fcc0d26077383d4daf7b09a (diff)
tcm_qla2xxx: Format VPD page 83h SCSI name string according to SPC
My draft of SPC-4 says the following about the SCSI name string in inquiry VPD page 83h: The SCSI NAME STRING field starts with either: a) the four UTF-8 characters 'eui.' concatenated with 16, 24, or 32 hexadecimal digits (i.e., the UTF-8 characters 0 through 9 and A through F) for an EUI-64 based identifier (see 7.8.6.5). The first hexadecimal digit shall be the most significant four bits of the first byte (i.e., most significant byte) of the EUI-64 based identifier; b) the four UTF-8 characters 'naa.' concatenated with 16 or 32 hexadecimal digits for an NAA identifier (see 7.8.6.6). The first hexadecimal digit shall be the most significant four bits of the first byte (i.e., most significant byte) of the NAA identifier; or c) the four UTF-8 characters 'iqn.' concatenated with an iSCSI Name for an iSCSI-name based identifier (see iSCSI). However, the .tpg_get_wwn method for tcm_qla2xxx formats the WWN so the SCSI name string looks like "52:4a:93:7d:24:5f:b2:12,t,0x0001". This patch corrects the code so that VPD 83h gives a SPC-compliant SCSI name string like "naa.524a937d245fb212,t,0x0001" while leavig other uses alone (so configfs will still work with ':' separated WWNs). Signed-off-by: Roland Dreier <roland@purestorage.com> Cc: Chad Dupuis <chad.dupuis@qlogic.com> Cc: Arun Easi <arun.easi@qlogic.com> Cc: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla2xxx/tcm_qla2xxx.c4
-rw-r--r--drivers/scsi/qla2xxx/tcm_qla2xxx.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
index 2358c16c4c8e..d8211ccc413a 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -237,7 +237,7 @@ static char *tcm_qla2xxx_get_fabric_wwn(struct se_portal_group *se_tpg)
237 struct tcm_qla2xxx_tpg, se_tpg); 237 struct tcm_qla2xxx_tpg, se_tpg);
238 struct tcm_qla2xxx_lport *lport = tpg->lport; 238 struct tcm_qla2xxx_lport *lport = tpg->lport;
239 239
240 return &lport->lport_name[0]; 240 return lport->lport_naa_name;
241} 241}
242 242
243static char *tcm_qla2xxx_npiv_get_fabric_wwn(struct se_portal_group *se_tpg) 243static char *tcm_qla2xxx_npiv_get_fabric_wwn(struct se_portal_group *se_tpg)
@@ -1534,6 +1534,7 @@ static struct se_wwn *tcm_qla2xxx_make_lport(
1534 lport->lport_wwpn = wwpn; 1534 lport->lport_wwpn = wwpn;
1535 tcm_qla2xxx_format_wwn(&lport->lport_name[0], TCM_QLA2XXX_NAMELEN, 1535 tcm_qla2xxx_format_wwn(&lport->lport_name[0], TCM_QLA2XXX_NAMELEN,
1536 wwpn); 1536 wwpn);
1537 sprintf(lport->lport_naa_name, "naa.%016llx", (unsigned long long) wwpn);
1537 1538
1538 ret = tcm_qla2xxx_init_lport(lport); 1539 ret = tcm_qla2xxx_init_lport(lport);
1539 if (ret != 0) 1540 if (ret != 0)
@@ -1601,6 +1602,7 @@ static struct se_wwn *tcm_qla2xxx_npiv_make_lport(
1601 lport->lport_npiv_wwnn = npiv_wwnn; 1602 lport->lport_npiv_wwnn = npiv_wwnn;
1602 tcm_qla2xxx_npiv_format_wwn(&lport->lport_npiv_name[0], 1603 tcm_qla2xxx_npiv_format_wwn(&lport->lport_npiv_name[0],
1603 TCM_QLA2XXX_NAMELEN, npiv_wwpn, npiv_wwnn); 1604 TCM_QLA2XXX_NAMELEN, npiv_wwpn, npiv_wwnn);
1605 sprintf(lport->lport_naa_name, "naa.%016llx", (unsigned long long) npiv_wwpn);
1604 1606
1605/* FIXME: tcm_qla2xxx_npiv_make_lport */ 1607/* FIXME: tcm_qla2xxx_npiv_make_lport */
1606 ret = -ENOSYS; 1608 ret = -ENOSYS;
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.h b/drivers/scsi/qla2xxx/tcm_qla2xxx.h
index 825498103352..9ba075fe9781 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.h
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.h
@@ -61,6 +61,8 @@ struct tcm_qla2xxx_lport {
61 u64 lport_npiv_wwnn; 61 u64 lport_npiv_wwnn;
62 /* ASCII formatted WWPN for FC Target Lport */ 62 /* ASCII formatted WWPN for FC Target Lport */
63 char lport_name[TCM_QLA2XXX_NAMELEN]; 63 char lport_name[TCM_QLA2XXX_NAMELEN];
64 /* ASCII formatted naa WWPN for VPD page 83 etc */
65 char lport_naa_name[TCM_QLA2XXX_NAMELEN];
64 /* ASCII formatted WWPN+WWNN for NPIV FC Target Lport */ 66 /* ASCII formatted WWPN+WWNN for NPIV FC Target Lport */
65 char lport_npiv_name[TCM_QLA2XXX_NPIV_NAMELEN]; 67 char lport_npiv_name[TCM_QLA2XXX_NPIV_NAMELEN];
66 /* map for fc_port pointers in 24-bit FC Port ID space */ 68 /* map for fc_port pointers in 24-bit FC Port ID space */