diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2005-08-31 18:23:12 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-09-10 12:11:48 -0400 |
commit | f631b4be76355dc3bf49563c706a9fb938993bde (patch) | |
tree | c3e1484cdb30546042eb525a237f0da85d5df919 /drivers/scsi/lpfc/lpfc_attr.c | |
parent | f8b02a85ebbf5eed63163ca9ed915bf8c47309c5 (diff) |
[SCSI] lpfc: use wwn_to_u64() transport helper
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Acked-by: Smart, James <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 0e089a42c03a..86eaf6d408d5 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -966,21 +966,21 @@ static void | |||
966 | lpfc_get_host_fabric_name (struct Scsi_Host *shost) | 966 | lpfc_get_host_fabric_name (struct Scsi_Host *shost) |
967 | { | 967 | { |
968 | struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0]; | 968 | struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0]; |
969 | u64 nodename; | 969 | u64 node_name; |
970 | 970 | ||
971 | spin_lock_irq(shost->host_lock); | 971 | spin_lock_irq(shost->host_lock); |
972 | 972 | ||
973 | if ((phba->fc_flag & FC_FABRIC) || | 973 | if ((phba->fc_flag & FC_FABRIC) || |
974 | ((phba->fc_topology == TOPOLOGY_LOOP) && | 974 | ((phba->fc_topology == TOPOLOGY_LOOP) && |
975 | (phba->fc_flag & FC_PUBLIC_LOOP))) | 975 | (phba->fc_flag & FC_PUBLIC_LOOP))) |
976 | memcpy(&nodename, &phba->fc_fabparam.nodeName, sizeof(u64)); | 976 | node_name = wwn_to_u64(phba->fc_fabparam.nodeName.wwn); |
977 | else | 977 | else |
978 | /* fabric is local port if there is no F/FL_Port */ | 978 | /* fabric is local port if there is no F/FL_Port */ |
979 | memcpy(&nodename, &phba->fc_nodename, sizeof(u64)); | 979 | node_name = wwn_to_u64(phba->fc_nodename.wwn); |
980 | 980 | ||
981 | spin_unlock_irq(shost->host_lock); | 981 | spin_unlock_irq(shost->host_lock); |
982 | 982 | ||
983 | fc_host_fabric_name(shost) = be64_to_cpu(nodename); | 983 | fc_host_fabric_name(shost) = node_name; |
984 | } | 984 | } |
985 | 985 | ||
986 | 986 | ||
@@ -1103,21 +1103,20 @@ lpfc_get_starget_node_name(struct scsi_target *starget) | |||
1103 | { | 1103 | { |
1104 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | 1104 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); |
1105 | struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0]; | 1105 | struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0]; |
1106 | uint64_t node_name = 0; | 1106 | u64 node_name = 0; |
1107 | struct lpfc_nodelist *ndlp = NULL; | 1107 | struct lpfc_nodelist *ndlp = NULL; |
1108 | 1108 | ||
1109 | spin_lock_irq(shost->host_lock); | 1109 | spin_lock_irq(shost->host_lock); |
1110 | /* Search the mapped list for this target ID */ | 1110 | /* Search the mapped list for this target ID */ |
1111 | list_for_each_entry(ndlp, &phba->fc_nlpmap_list, nlp_listp) { | 1111 | list_for_each_entry(ndlp, &phba->fc_nlpmap_list, nlp_listp) { |
1112 | if (starget->id == ndlp->nlp_sid) { | 1112 | if (starget->id == ndlp->nlp_sid) { |
1113 | memcpy(&node_name, &ndlp->nlp_nodename, | 1113 | node_name = wwn_to_u64(ndlp->nlp_nodename.wwn); |
1114 | sizeof(struct lpfc_name)); | ||
1115 | break; | 1114 | break; |
1116 | } | 1115 | } |
1117 | } | 1116 | } |
1118 | spin_unlock_irq(shost->host_lock); | 1117 | spin_unlock_irq(shost->host_lock); |
1119 | 1118 | ||
1120 | fc_starget_node_name(starget) = be64_to_cpu(node_name); | 1119 | fc_starget_node_name(starget) = node_name; |
1121 | } | 1120 | } |
1122 | 1121 | ||
1123 | static void | 1122 | static void |
@@ -1125,21 +1124,20 @@ lpfc_get_starget_port_name(struct scsi_target *starget) | |||
1125 | { | 1124 | { |
1126 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | 1125 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); |
1127 | struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0]; | 1126 | struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0]; |
1128 | uint64_t port_name = 0; | 1127 | u64 port_name = 0; |
1129 | struct lpfc_nodelist *ndlp = NULL; | 1128 | struct lpfc_nodelist *ndlp = NULL; |
1130 | 1129 | ||
1131 | spin_lock_irq(shost->host_lock); | 1130 | spin_lock_irq(shost->host_lock); |
1132 | /* Search the mapped list for this target ID */ | 1131 | /* Search the mapped list for this target ID */ |
1133 | list_for_each_entry(ndlp, &phba->fc_nlpmap_list, nlp_listp) { | 1132 | list_for_each_entry(ndlp, &phba->fc_nlpmap_list, nlp_listp) { |
1134 | if (starget->id == ndlp->nlp_sid) { | 1133 | if (starget->id == ndlp->nlp_sid) { |
1135 | memcpy(&port_name, &ndlp->nlp_portname, | 1134 | port_name = wwn_to_u64(ndlp->nlp_portname.wwn); |
1136 | sizeof(struct lpfc_name)); | ||
1137 | break; | 1135 | break; |
1138 | } | 1136 | } |
1139 | } | 1137 | } |
1140 | spin_unlock_irq(shost->host_lock); | 1138 | spin_unlock_irq(shost->host_lock); |
1141 | 1139 | ||
1142 | fc_starget_port_name(starget) = be64_to_cpu(port_name); | 1140 | fc_starget_port_name(starget) = port_name; |
1143 | } | 1141 | } |
1144 | 1142 | ||
1145 | static void | 1143 | static void |