[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>
This commit is contained in:
committed by
James Bottomley
parent
f8b02a85eb
commit
f631b4be76
@@ -966,21 +966,21 @@ static void
|
|||||||
lpfc_get_host_fabric_name (struct Scsi_Host *shost)
|
lpfc_get_host_fabric_name (struct Scsi_Host *shost)
|
||||||
{
|
{
|
||||||
struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0];
|
struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0];
|
||||||
u64 nodename;
|
u64 node_name;
|
||||||
|
|
||||||
spin_lock_irq(shost->host_lock);
|
spin_lock_irq(shost->host_lock);
|
||||||
|
|
||||||
if ((phba->fc_flag & FC_FABRIC) ||
|
if ((phba->fc_flag & FC_FABRIC) ||
|
||||||
((phba->fc_topology == TOPOLOGY_LOOP) &&
|
((phba->fc_topology == TOPOLOGY_LOOP) &&
|
||||||
(phba->fc_flag & FC_PUBLIC_LOOP)))
|
(phba->fc_flag & FC_PUBLIC_LOOP)))
|
||||||
memcpy(&nodename, &phba->fc_fabparam.nodeName, sizeof(u64));
|
node_name = wwn_to_u64(phba->fc_fabparam.nodeName.wwn);
|
||||||
else
|
else
|
||||||
/* fabric is local port if there is no F/FL_Port */
|
/* fabric is local port if there is no F/FL_Port */
|
||||||
memcpy(&nodename, &phba->fc_nodename, sizeof(u64));
|
node_name = wwn_to_u64(phba->fc_nodename.wwn);
|
||||||
|
|
||||||
spin_unlock_irq(shost->host_lock);
|
spin_unlock_irq(shost->host_lock);
|
||||||
|
|
||||||
fc_host_fabric_name(shost) = be64_to_cpu(nodename);
|
fc_host_fabric_name(shost) = node_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1103,21 +1103,20 @@ lpfc_get_starget_node_name(struct scsi_target *starget)
|
|||||||
{
|
{
|
||||||
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
|
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
|
||||||
struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0];
|
struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0];
|
||||||
uint64_t node_name = 0;
|
u64 node_name = 0;
|
||||||
struct lpfc_nodelist *ndlp = NULL;
|
struct lpfc_nodelist *ndlp = NULL;
|
||||||
|
|
||||||
spin_lock_irq(shost->host_lock);
|
spin_lock_irq(shost->host_lock);
|
||||||
/* Search the mapped list for this target ID */
|
/* Search the mapped list for this target ID */
|
||||||
list_for_each_entry(ndlp, &phba->fc_nlpmap_list, nlp_listp) {
|
list_for_each_entry(ndlp, &phba->fc_nlpmap_list, nlp_listp) {
|
||||||
if (starget->id == ndlp->nlp_sid) {
|
if (starget->id == ndlp->nlp_sid) {
|
||||||
memcpy(&node_name, &ndlp->nlp_nodename,
|
node_name = wwn_to_u64(ndlp->nlp_nodename.wwn);
|
||||||
sizeof(struct lpfc_name));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spin_unlock_irq(shost->host_lock);
|
spin_unlock_irq(shost->host_lock);
|
||||||
|
|
||||||
fc_starget_node_name(starget) = be64_to_cpu(node_name);
|
fc_starget_node_name(starget) = node_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1125,21 +1124,20 @@ lpfc_get_starget_port_name(struct scsi_target *starget)
|
|||||||
{
|
{
|
||||||
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
|
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
|
||||||
struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0];
|
struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0];
|
||||||
uint64_t port_name = 0;
|
u64 port_name = 0;
|
||||||
struct lpfc_nodelist *ndlp = NULL;
|
struct lpfc_nodelist *ndlp = NULL;
|
||||||
|
|
||||||
spin_lock_irq(shost->host_lock);
|
spin_lock_irq(shost->host_lock);
|
||||||
/* Search the mapped list for this target ID */
|
/* Search the mapped list for this target ID */
|
||||||
list_for_each_entry(ndlp, &phba->fc_nlpmap_list, nlp_listp) {
|
list_for_each_entry(ndlp, &phba->fc_nlpmap_list, nlp_listp) {
|
||||||
if (starget->id == ndlp->nlp_sid) {
|
if (starget->id == ndlp->nlp_sid) {
|
||||||
memcpy(&port_name, &ndlp->nlp_portname,
|
port_name = wwn_to_u64(ndlp->nlp_portname.wwn);
|
||||||
sizeof(struct lpfc_name));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spin_unlock_irq(shost->host_lock);
|
spin_unlock_irq(shost->host_lock);
|
||||||
|
|
||||||
fc_starget_port_name(starget) = be64_to_cpu(port_name);
|
fc_starget_port_name(starget) = port_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -1017,13 +1017,10 @@ lpfc_register_remote_port(struct lpfc_hba * phba,
|
|||||||
struct fc_rport *rport;
|
struct fc_rport *rport;
|
||||||
struct lpfc_rport_data *rdata;
|
struct lpfc_rport_data *rdata;
|
||||||
struct fc_rport_identifiers rport_ids;
|
struct fc_rport_identifiers rport_ids;
|
||||||
uint64_t wwn;
|
|
||||||
|
|
||||||
/* Remote port has reappeared. Re-register w/ FC transport */
|
/* Remote port has reappeared. Re-register w/ FC transport */
|
||||||
memcpy(&wwn, &ndlp->nlp_nodename, sizeof(uint64_t));
|
rport_ids.node_name = wwn_to_u64(ndlp->nlp_nodename.wwn);
|
||||||
rport_ids.node_name = be64_to_cpu(wwn);
|
rport_ids.port_name = wwn_to_u64(ndlp->nlp_portname.wwn);
|
||||||
memcpy(&wwn, &ndlp->nlp_portname, sizeof(uint64_t));
|
|
||||||
rport_ids.port_name = be64_to_cpu(wwn);
|
|
||||||
rport_ids.port_id = ndlp->nlp_DID;
|
rport_ids.port_id = ndlp->nlp_DID;
|
||||||
rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
|
rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
|
||||||
if (ndlp->nlp_type & NLP_FCP_TARGET)
|
if (ndlp->nlp_type & NLP_FCP_TARGET)
|
||||||
|
@@ -262,6 +262,8 @@ struct lpfc_sli_ct_request {
|
|||||||
#define FF_FRAME_SIZE 2048
|
#define FF_FRAME_SIZE 2048
|
||||||
|
|
||||||
struct lpfc_name {
|
struct lpfc_name {
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
#ifdef __BIG_ENDIAN_BITFIELD
|
#ifdef __BIG_ENDIAN_BITFIELD
|
||||||
uint8_t nameType:4; /* FC Word 0, bit 28:31 */
|
uint8_t nameType:4; /* FC Word 0, bit 28:31 */
|
||||||
uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit 8:11 of IEEE ext */
|
uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit 8:11 of IEEE ext */
|
||||||
@@ -278,6 +280,9 @@ struct lpfc_name {
|
|||||||
#define NAME_CCITT_GR_TYPE 0xE
|
#define NAME_CCITT_GR_TYPE 0xE
|
||||||
uint8_t IEEEextLsb; /* FC Word 0, bit 16:23, IEEE extended Lsb */
|
uint8_t IEEEextLsb; /* FC Word 0, bit 16:23, IEEE extended Lsb */
|
||||||
uint8_t IEEE[6]; /* FC IEEE address */
|
uint8_t IEEE[6]; /* FC IEEE address */
|
||||||
|
};
|
||||||
|
uint8_t wwn[8];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct csp {
|
struct csp {
|
||||||
|
@@ -1333,7 +1333,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
|
|||||||
unsigned long bar0map_len, bar2map_len;
|
unsigned long bar0map_len, bar2map_len;
|
||||||
int error = -ENODEV, retval;
|
int error = -ENODEV, retval;
|
||||||
int i;
|
int i;
|
||||||
u64 wwname;
|
|
||||||
|
|
||||||
if (pci_enable_device(pdev))
|
if (pci_enable_device(pdev))
|
||||||
goto out;
|
goto out;
|
||||||
@@ -1524,10 +1523,8 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
|
|||||||
* Must done after lpfc_sli_hba_setup()
|
* Must done after lpfc_sli_hba_setup()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
memcpy(&wwname, &phba->fc_nodename, sizeof(u64));
|
fc_host_node_name(host) = wwn_to_u64(phba->fc_nodename.wwn);
|
||||||
fc_host_node_name(host) = be64_to_cpu(wwname);
|
fc_host_port_name(host) = wwn_to_u64(phba->fc_portname.wwn);
|
||||||
memcpy(&wwname, &phba->fc_portname, sizeof(u64));
|
|
||||||
fc_host_port_name(host) = be64_to_cpu(wwname);
|
|
||||||
fc_host_supported_classes(host) = FC_COS_CLASS3;
|
fc_host_supported_classes(host) = FC_COS_CLASS3;
|
||||||
|
|
||||||
memset(fc_host_supported_fc4s(host), 0,
|
memset(fc_host_supported_fc4s(host), 0,
|
||||||
|
Reference in New Issue
Block a user