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 | |
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')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 22 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 7 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw.h | 17 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 7 |
4 files changed, 25 insertions, 28 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 |
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 0a8269d6b130..4fb8eb0c84cf 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -1017,13 +1017,10 @@ lpfc_register_remote_port(struct lpfc_hba * phba, | |||
1017 | struct fc_rport *rport; | 1017 | struct fc_rport *rport; |
1018 | struct lpfc_rport_data *rdata; | 1018 | struct lpfc_rport_data *rdata; |
1019 | struct fc_rport_identifiers rport_ids; | 1019 | struct fc_rport_identifiers rport_ids; |
1020 | uint64_t wwn; | ||
1021 | 1020 | ||
1022 | /* Remote port has reappeared. Re-register w/ FC transport */ | 1021 | /* Remote port has reappeared. Re-register w/ FC transport */ |
1023 | memcpy(&wwn, &ndlp->nlp_nodename, sizeof(uint64_t)); | 1022 | rport_ids.node_name = wwn_to_u64(ndlp->nlp_nodename.wwn); |
1024 | rport_ids.node_name = be64_to_cpu(wwn); | 1023 | rport_ids.port_name = wwn_to_u64(ndlp->nlp_portname.wwn); |
1025 | memcpy(&wwn, &ndlp->nlp_portname, sizeof(uint64_t)); | ||
1026 | rport_ids.port_name = be64_to_cpu(wwn); | ||
1027 | rport_ids.port_id = ndlp->nlp_DID; | 1024 | rport_ids.port_id = ndlp->nlp_DID; |
1028 | rport_ids.roles = FC_RPORT_ROLE_UNKNOWN; | 1025 | rport_ids.roles = FC_RPORT_ROLE_UNKNOWN; |
1029 | if (ndlp->nlp_type & NLP_FCP_TARGET) | 1026 | if (ndlp->nlp_type & NLP_FCP_TARGET) |
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index 21591cb9f551..047a87c26cc0 100644 --- a/drivers/scsi/lpfc/lpfc_hw.h +++ b/drivers/scsi/lpfc/lpfc_hw.h | |||
@@ -262,12 +262,14 @@ struct lpfc_sli_ct_request { | |||
262 | #define FF_FRAME_SIZE 2048 | 262 | #define FF_FRAME_SIZE 2048 |
263 | 263 | ||
264 | struct lpfc_name { | 264 | struct lpfc_name { |
265 | union { | ||
266 | struct { | ||
265 | #ifdef __BIG_ENDIAN_BITFIELD | 267 | #ifdef __BIG_ENDIAN_BITFIELD |
266 | uint8_t nameType:4; /* FC Word 0, bit 28:31 */ | 268 | uint8_t nameType:4; /* FC Word 0, bit 28:31 */ |
267 | uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit 8:11 of IEEE ext */ | 269 | uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit 8:11 of IEEE ext */ |
268 | #else /* __LITTLE_ENDIAN_BITFIELD */ | 270 | #else /* __LITTLE_ENDIAN_BITFIELD */ |
269 | uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit 8:11 of IEEE ext */ | 271 | uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit 8:11 of IEEE ext */ |
270 | uint8_t nameType:4; /* FC Word 0, bit 28:31 */ | 272 | uint8_t nameType:4; /* FC Word 0, bit 28:31 */ |
271 | #endif | 273 | #endif |
272 | 274 | ||
273 | #define NAME_IEEE 0x1 /* IEEE name - nameType */ | 275 | #define NAME_IEEE 0x1 /* IEEE name - nameType */ |
@@ -276,8 +278,11 @@ struct lpfc_name { | |||
276 | #define NAME_IP_TYPE 0x4 /* IP address */ | 278 | #define NAME_IP_TYPE 0x4 /* IP address */ |
277 | #define NAME_CCITT_TYPE 0xC | 279 | #define NAME_CCITT_TYPE 0xC |
278 | #define NAME_CCITT_GR_TYPE 0xE | 280 | #define NAME_CCITT_GR_TYPE 0xE |
279 | uint8_t IEEEextLsb; /* FC Word 0, bit 16:23, IEEE extended Lsb */ | 281 | uint8_t IEEEextLsb; /* FC Word 0, bit 16:23, IEEE extended Lsb */ |
280 | uint8_t IEEE[6]; /* FC IEEE address */ | 282 | uint8_t IEEE[6]; /* FC IEEE address */ |
283 | }; | ||
284 | uint8_t wwn[8]; | ||
285 | }; | ||
281 | }; | 286 | }; |
282 | 287 | ||
283 | struct csp { | 288 | struct csp { |
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 6f3cb59bf9e0..454058f655db 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -1333,7 +1333,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1333 | unsigned long bar0map_len, bar2map_len; | 1333 | unsigned long bar0map_len, bar2map_len; |
1334 | int error = -ENODEV, retval; | 1334 | int error = -ENODEV, retval; |
1335 | int i; | 1335 | int i; |
1336 | u64 wwname; | ||
1337 | 1336 | ||
1338 | if (pci_enable_device(pdev)) | 1337 | if (pci_enable_device(pdev)) |
1339 | goto out; | 1338 | goto out; |
@@ -1524,10 +1523,8 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1524 | * Must done after lpfc_sli_hba_setup() | 1523 | * Must done after lpfc_sli_hba_setup() |
1525 | */ | 1524 | */ |
1526 | 1525 | ||
1527 | memcpy(&wwname, &phba->fc_nodename, sizeof(u64)); | 1526 | fc_host_node_name(host) = wwn_to_u64(phba->fc_nodename.wwn); |
1528 | fc_host_node_name(host) = be64_to_cpu(wwname); | 1527 | fc_host_port_name(host) = wwn_to_u64(phba->fc_portname.wwn); |
1529 | memcpy(&wwname, &phba->fc_portname, sizeof(u64)); | ||
1530 | fc_host_port_name(host) = be64_to_cpu(wwname); | ||
1531 | fc_host_supported_classes(host) = FC_COS_CLASS3; | 1528 | fc_host_supported_classes(host) = FC_COS_CLASS3; |
1532 | 1529 | ||
1533 | memset(fc_host_supported_fc4s(host), 0, | 1530 | memset(fc_host_supported_fc4s(host), 0, |