summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_fc.c
diff options
context:
space:
mode:
authorCathy Avery <cavery@redhat.com>2017-04-17 14:37:45 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2017-04-19 19:13:52 -0400
commit0c3ae2664766ec892992a686e48ead94784ef54c (patch)
treee083c5c5dc8691617f312e36051bac5b284a714c /drivers/scsi/scsi_transport_fc.c
parent25d1d50e23275e141e3a3fe06c25a99f4c4bf4e0 (diff)
downloadlinux-0c3ae2664766ec892992a686e48ead94784ef54c.tar.gz
linux-0c3ae2664766ec892992a686e48ead94784ef54c.tar.bz2
linux-0c3ae2664766ec892992a686e48ead94784ef54c.zip
scsi: scsi_transport_fc: Add dummy initiator role to rport
This patch allows scsi drivers that expose virturalized fibre channel devices but that do not expose rports to successfully rescan the scsi bus via echo "- - -" > /sys/class/scsi_host/hostX/scan. Drivers can create a pseudo rport and indicate FC_PORT_ROLE_FCP_DUMMY_INITIATOR as the rport's role in fc_rport_identifiers. This insures that a valid scsi_target_id is assigned to the newly created rport and it can meet the requirements of fc_user_scan_tgt calling scsi_scan_target. Signed-off-by: Cathy Avery <cavery@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_fc.c')
-rw-r--r--drivers/scsi/scsi_transport_fc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 87b8f9d64d9b..d4cf32d55546 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -289,9 +289,10 @@ static const struct {
u32 value;
char *name;
} fc_port_role_names[] = {
- { FC_PORT_ROLE_FCP_TARGET, "FCP Target" },
- { FC_PORT_ROLE_FCP_INITIATOR, "FCP Initiator" },
- { FC_PORT_ROLE_IP_PORT, "IP Port" },
+ { FC_PORT_ROLE_FCP_TARGET, "FCP Target" },
+ { FC_PORT_ROLE_FCP_INITIATOR, "FCP Initiator" },
+ { FC_PORT_ROLE_IP_PORT, "IP Port" },
+ { FC_PORT_ROLE_FCP_DUMMY_INITIATOR, "FCP Dummy Initiator" },
};
fc_bitfield_name_search(port_roles, fc_port_role_names)
@@ -2628,7 +2629,8 @@ fc_remote_port_create(struct Scsi_Host *shost, int channel,
spin_lock_irqsave(shost->host_lock, flags);
rport->number = fc_host->next_rport_number++;
- if (rport->roles & FC_PORT_ROLE_FCP_TARGET)
+ if ((rport->roles & FC_PORT_ROLE_FCP_TARGET) ||
+ (rport->roles & FC_PORT_ROLE_FCP_DUMMY_INITIATOR))
rport->scsi_target_id = fc_host->next_target_id++;
else
rport->scsi_target_id = -1;