From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> This patch removes the original pci_get_drvdata() NPIV port scanning code in tcm_qla2xxx_npiv_make_lport(), and returns -ENOSYS for now until the rest of the NPIV pieces are finished up. This will eventually need to move into qla_target.c as well following qla_tgt_lport_register() Cc: Christoph Hellwig <hch@xxxxxx> Cc: Roland Dreier <roland@xxxxxxxxxxxxxxx> Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> --- drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c | 105 +-------------------- 1 files changed, 2 insertions(+), 103 deletions(-) diff --git a/drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c b/drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c index 3634b7f..7c9f4ec 100644 --- a/drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c +++ b/drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c @@ -997,109 +997,8 @@ static struct se_wwn *tcm_qla2xxx_npiv_make_lport( tcm_qla2xxx_npiv_format_wwn(&lport->lport_npiv_name[0], TCM_QLA2XXX_NAMELEN, npiv_wwpn, npiv_wwnn); - while ((dev = pci_get_device(PCI_VENDOR_ID_QLOGIC, PCI_ANY_ID, - dev)) != NULL) { - - vha = pci_get_drvdata(dev); - if (!vha) - continue; - ha = vha->hw; - if (!ha) - continue; - host = vha->host; - if (!host) - continue; - - if (!(host->hostt->supported_mode & MODE_TARGET)) - continue; - - spin_lock_irqsave(&ha->hardware_lock, flags); - if (host->active_mode & MODE_TARGET) { - pr_debug("MODE_TARGET already active on qla2xxx" - "(%d)\n", host->host_no); - spin_unlock_irqrestore(&ha->hardware_lock, flags); - continue; - } - spin_unlock_irqrestore(&ha->hardware_lock, flags); - - if (!scsi_host_get(host)) { - pr_err("Unable to scsi_host_get() for" - " qla2xxx scsi_host\n"); - ret = -EINVAL; - goto out; - } - - pr_debug("qla2xxx HW vha->node_name: "); - for (i = 0; i < 8; i++) - pr_debug("%02x ", vha->node_name[i]); - pr_debug("\n"); - - pr_debug("qla2xxx HW vha->port_name: "); - for (i = 0; i < 8; i++) - pr_debug("%02x ", vha->port_name[i]); - pr_debug("\n"); - - pr_debug("qla2xxx passed configfs NPIV WWPN: "); - put_unaligned_be64(npiv_wwpn, b); - for (i = 0; i < 8; i++) - pr_debug("%02x ", b[i]); - pr_debug("\n"); - - pr_debug("qla2xxx passed configfs NPIV WWNN: "); - put_unaligned_be64(npiv_wwnn, b2); - for (i = 0; i < 8; i++) - pr_debug("%02x ", b2[i]); - pr_debug("\n"); - - spin_lock_irqsave(&ha->vport_slock, flags); - list_for_each_entry(npiv_vp, &ha->vp_list, list) { - if (!npiv_vp->vp_idx) - continue; - - if (memcmp(npiv_vp->port_name, b, 8) || - memcmp(npiv_vp->node_name, b2, 8)) - continue; - -#warning FIXME: Need to add atomic_inc(&npiv_vp->vref_count) before dropping ha->vport_slock..? - spin_unlock_irqrestore(&ha->vport_slock, flags); - - pr_debug("qla2xxx_npiv: Found matching NPIV WWPN+WWNN: %s " - " for lport\n", name); - tcm_qla2xxx_init_lport(lport); - /* - * Setup fc_vport_identifiers for NPIV containing - * the passed WWPN and WWNN for the new libfc vport. - */ - memset(&vid, 0, sizeof(vid)); - vid.roles = FC_PORT_ROLE_FCP_INITIATOR; - vid.vport_type = FC_PORTTYPE_NPIV; - vid.port_name = npiv_wwpn; - vid.node_name = npiv_wwnn; - /* vid.symbolic_name is already zero/NULL's */ - vid.disable = false; /* always enabled */ - - /* we only allow support on Channel 0 !!! */ - vport = fc_vport_create(host, 0, &vid); - if (!vport) { - pr_err("fc_vport_create() failed for" - " NPIV tcm_qla2xxx\n"); - scsi_host_put(host); - ret = -EINVAL; - goto out; - } - lport->npiv_vport = vport; - ret = 0; - spin_lock_irqsave(&ha->vport_slock, flags); - break; - } - spin_unlock_irqrestore(&ha->vport_slock, flags); - - if (!ret) - break; - - scsi_host_put(host); - } - +#warning FIXME: tcm_qla2xxx_npiv_make_lport + ret = -ENOSYS; if (ret != 0) goto out; -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html