diff options
| author | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-01-30 12:52:21 -0500 |
|---|---|---|
| committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-02-20 16:01:17 -0500 |
| commit | 84197a36e9d78213da17b96fb838afcca4e150ea (patch) | |
| tree | ac86f4fb52f82daa6b93ec8613cdaa459a01732c /drivers | |
| parent | 7474f52a82d51da2e6110e91bba8b000cb9cf803 (diff) | |
tcm_qla2xxx: Fix NAA formatted name for NPIV WWPNs
This patch fixes the NAA formatted name used by EVPD=0x83
device identifer to reflect the proper NPIV enabled WWPN.
Cc: Sawan Chandak <sawan.chandak@qlogic.com>
Cc: Quinn Tran <quinn.tran@qlogic.com>
Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/scsi/qla2xxx/tcm_qla2xxx.c | 27 | ||||
| -rw-r--r-- | drivers/scsi/qla2xxx/tcm_qla2xxx.h | 4 |
2 files changed, 1 insertions, 30 deletions
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 5bdc44035981..788c4fe2b0c9 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c | |||
| @@ -182,20 +182,6 @@ static int tcm_qla2xxx_npiv_parse_wwn( | |||
| 182 | return 0; | 182 | return 0; |
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | static ssize_t tcm_qla2xxx_npiv_format_wwn(char *buf, size_t len, | ||
| 186 | u64 wwpn, u64 wwnn) | ||
| 187 | { | ||
| 188 | u8 b[8], b2[8]; | ||
| 189 | |||
| 190 | put_unaligned_be64(wwpn, b); | ||
| 191 | put_unaligned_be64(wwnn, b2); | ||
| 192 | return snprintf(buf, len, | ||
| 193 | "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x," | ||
| 194 | "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x", | ||
| 195 | b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], | ||
| 196 | b2[0], b2[1], b2[2], b2[3], b2[4], b2[5], b2[6], b2[7]); | ||
| 197 | } | ||
| 198 | |||
| 199 | static char *tcm_qla2xxx_npiv_get_fabric_name(void) | 185 | static char *tcm_qla2xxx_npiv_get_fabric_name(void) |
| 200 | { | 186 | { |
| 201 | return "qla2xxx_npiv"; | 187 | return "qla2xxx_npiv"; |
| @@ -227,15 +213,6 @@ static char *tcm_qla2xxx_get_fabric_wwn(struct se_portal_group *se_tpg) | |||
| 227 | return lport->lport_naa_name; | 213 | return lport->lport_naa_name; |
| 228 | } | 214 | } |
| 229 | 215 | ||
| 230 | static char *tcm_qla2xxx_npiv_get_fabric_wwn(struct se_portal_group *se_tpg) | ||
| 231 | { | ||
| 232 | struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, | ||
| 233 | struct tcm_qla2xxx_tpg, se_tpg); | ||
| 234 | struct tcm_qla2xxx_lport *lport = tpg->lport; | ||
| 235 | |||
| 236 | return &lport->lport_npiv_name[0]; | ||
| 237 | } | ||
| 238 | |||
| 239 | static u16 tcm_qla2xxx_get_tag(struct se_portal_group *se_tpg) | 216 | static u16 tcm_qla2xxx_get_tag(struct se_portal_group *se_tpg) |
| 240 | { | 217 | { |
| 241 | struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, | 218 | struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, |
| @@ -1811,8 +1788,6 @@ static struct se_wwn *tcm_qla2xxx_npiv_make_lport( | |||
| 1811 | } | 1788 | } |
| 1812 | lport->lport_npiv_wwpn = npiv_wwpn; | 1789 | lport->lport_npiv_wwpn = npiv_wwpn; |
| 1813 | lport->lport_npiv_wwnn = npiv_wwnn; | 1790 | lport->lport_npiv_wwnn = npiv_wwnn; |
| 1814 | tcm_qla2xxx_npiv_format_wwn(&lport->lport_npiv_name[0], | ||
| 1815 | TCM_QLA2XXX_NAMELEN, npiv_wwpn, npiv_wwnn); | ||
| 1816 | sprintf(lport->lport_naa_name, "naa.%016llx", (unsigned long long) npiv_wwpn); | 1791 | sprintf(lport->lport_naa_name, "naa.%016llx", (unsigned long long) npiv_wwpn); |
| 1817 | 1792 | ||
| 1818 | ret = tcm_qla2xxx_init_lport(lport); | 1793 | ret = tcm_qla2xxx_init_lport(lport); |
| @@ -1921,7 +1896,7 @@ static struct target_core_fabric_ops tcm_qla2xxx_ops = { | |||
| 1921 | static struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = { | 1896 | static struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = { |
| 1922 | .get_fabric_name = tcm_qla2xxx_npiv_get_fabric_name, | 1897 | .get_fabric_name = tcm_qla2xxx_npiv_get_fabric_name, |
| 1923 | .get_fabric_proto_ident = tcm_qla2xxx_get_fabric_proto_ident, | 1898 | .get_fabric_proto_ident = tcm_qla2xxx_get_fabric_proto_ident, |
| 1924 | .tpg_get_wwn = tcm_qla2xxx_npiv_get_fabric_wwn, | 1899 | .tpg_get_wwn = tcm_qla2xxx_get_fabric_wwn, |
| 1925 | .tpg_get_tag = tcm_qla2xxx_get_tag, | 1900 | .tpg_get_tag = tcm_qla2xxx_get_tag, |
| 1926 | .tpg_get_default_depth = tcm_qla2xxx_get_default_depth, | 1901 | .tpg_get_default_depth = tcm_qla2xxx_get_default_depth, |
| 1927 | .tpg_get_pr_transport_id = tcm_qla2xxx_get_pr_transport_id, | 1902 | .tpg_get_pr_transport_id = tcm_qla2xxx_get_pr_transport_id, |
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.h b/drivers/scsi/qla2xxx/tcm_qla2xxx.h index a90966d3c0d6..33aaac8c7d59 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.h +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.h | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | #define TCM_QLA2XXX_VERSION "v0.1" | 4 | #define TCM_QLA2XXX_VERSION "v0.1" |
| 5 | /* length of ASCII WWPNs including pad */ | 5 | /* length of ASCII WWPNs including pad */ |
| 6 | #define TCM_QLA2XXX_NAMELEN 32 | 6 | #define TCM_QLA2XXX_NAMELEN 32 |
| 7 | /* lenth of ASCII NPIV 'WWPN+WWNN' including pad */ | ||
| 8 | #define TCM_QLA2XXX_NPIV_NAMELEN 66 | ||
| 9 | 7 | ||
| 10 | #include "qla_target.h" | 8 | #include "qla_target.h" |
| 11 | 9 | ||
| @@ -65,8 +63,6 @@ struct tcm_qla2xxx_lport { | |||
| 65 | char lport_name[TCM_QLA2XXX_NAMELEN]; | 63 | char lport_name[TCM_QLA2XXX_NAMELEN]; |
| 66 | /* ASCII formatted naa WWPN for VPD page 83 etc */ | 64 | /* ASCII formatted naa WWPN for VPD page 83 etc */ |
| 67 | char lport_naa_name[TCM_QLA2XXX_NAMELEN]; | 65 | char lport_naa_name[TCM_QLA2XXX_NAMELEN]; |
| 68 | /* ASCII formatted WWPN+WWNN for NPIV FC Target Lport */ | ||
| 69 | char lport_npiv_name[TCM_QLA2XXX_NPIV_NAMELEN]; | ||
| 70 | /* map for fc_port pointers in 24-bit FC Port ID space */ | 66 | /* map for fc_port pointers in 24-bit FC Port ID space */ |
| 71 | struct btree_head32 lport_fcport_map; | 67 | struct btree_head32 lport_fcport_map; |
| 72 | /* vmalloc-ed memory for fc_port pointers for 16-bit FC loop ID */ | 68 | /* vmalloc-ed memory for fc_port pointers for 16-bit FC loop ID */ |
