Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f631b4be authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley
Browse files

[SCSI] lpfc: use wwn_to_u64() transport helper

parent f8b02a85
Loading
Loading
Loading
Loading
+10 −12
Original line number Diff line number Diff line
@@ -966,21 +966,21 @@ static void
lpfc_get_host_fabric_name (struct Scsi_Host *shost)
{
	struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0];
	u64 nodename;
	u64 node_name;

	spin_lock_irq(shost->host_lock);

	if ((phba->fc_flag & FC_FABRIC) ||
	    ((phba->fc_topology == TOPOLOGY_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
		/* 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);

	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 lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0];
	uint64_t node_name = 0;
	u64 node_name = 0;
	struct lpfc_nodelist *ndlp = NULL;

	spin_lock_irq(shost->host_lock);
	/* Search the mapped list for this target ID */
	list_for_each_entry(ndlp, &phba->fc_nlpmap_list, nlp_listp) {
		if (starget->id == ndlp->nlp_sid) {
			memcpy(&node_name, &ndlp->nlp_nodename,
						sizeof(struct lpfc_name));
			node_name = wwn_to_u64(ndlp->nlp_nodename.wwn);
			break;
		}
	}
	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
@@ -1125,21 +1124,20 @@ lpfc_get_starget_port_name(struct scsi_target *starget)
{
	struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
	struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0];
	uint64_t port_name = 0;
	u64 port_name = 0;
	struct lpfc_nodelist *ndlp = NULL;

	spin_lock_irq(shost->host_lock);
	/* Search the mapped list for this target ID */
	list_for_each_entry(ndlp, &phba->fc_nlpmap_list, nlp_listp) {
		if (starget->id == ndlp->nlp_sid) {
			memcpy(&port_name, &ndlp->nlp_portname,
						sizeof(struct lpfc_name));
			port_name = wwn_to_u64(ndlp->nlp_portname.wwn);
			break;
		}
	}
	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
+2 −5
Original line number Diff line number Diff line
@@ -1017,13 +1017,10 @@ lpfc_register_remote_port(struct lpfc_hba * phba,
	struct fc_rport *rport;
	struct lpfc_rport_data *rdata;
	struct fc_rport_identifiers rport_ids;
	uint64_t wwn;

	/* Remote port has reappeared. Re-register w/ FC transport */
	memcpy(&wwn, &ndlp->nlp_nodename, sizeof(uint64_t));
	rport_ids.node_name = be64_to_cpu(wwn);
	memcpy(&wwn, &ndlp->nlp_portname, sizeof(uint64_t));
	rport_ids.port_name = be64_to_cpu(wwn);
	rport_ids.node_name = wwn_to_u64(ndlp->nlp_nodename.wwn);
	rport_ids.port_name = wwn_to_u64(ndlp->nlp_portname.wwn);
	rport_ids.port_id = ndlp->nlp_DID;
	rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
	if (ndlp->nlp_type & NLP_FCP_TARGET)
+11 −6
Original line number Diff line number Diff line
@@ -262,6 +262,8 @@ struct lpfc_sli_ct_request {
#define FF_FRAME_SIZE     2048

struct lpfc_name {
	union {
		struct {
#ifdef __BIG_ENDIAN_BITFIELD
			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 */
@@ -279,6 +281,9 @@ struct lpfc_name {
			uint8_t IEEEextLsb;	/* FC Word 0, bit 16:23, IEEE extended Lsb */
			uint8_t IEEE[6];	/* FC IEEE address */
		};
		uint8_t wwn[8];
	};
};

struct csp {
	uint8_t fcphHigh;	/* FC Word 0, byte 0 */
+2 −5
Original line number Diff line number Diff line
@@ -1333,7 +1333,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
	unsigned long bar0map_len, bar2map_len;
	int error = -ENODEV, retval;
	int i;
	u64 wwname;

	if (pci_enable_device(pdev))
		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()
	 */

	memcpy(&wwname, &phba->fc_nodename, sizeof(u64));
	fc_host_node_name(host) = be64_to_cpu(wwname);
	memcpy(&wwname, &phba->fc_portname, sizeof(u64));
	fc_host_port_name(host) = be64_to_cpu(wwname);
	fc_host_node_name(host) = wwn_to_u64(phba->fc_nodename.wwn);
	fc_host_port_name(host) = wwn_to_u64(phba->fc_portname.wwn);
	fc_host_supported_classes(host) = FC_COS_CLASS3;

	memset(fc_host_supported_fc4s(host), 0,