aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_fc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_transport_fc.c')
-rw-r--r--drivers/scsi/scsi_transport_fc.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 685b997306cf..f2c9acf11bd0 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -295,6 +295,7 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev,
295 */ 295 */
296 fc_host_node_name(shost) = -1; 296 fc_host_node_name(shost) = -1;
297 fc_host_port_name(shost) = -1; 297 fc_host_port_name(shost) = -1;
298 fc_host_permanent_port_name(shost) = -1;
298 fc_host_supported_classes(shost) = FC_COS_UNSPECIFIED; 299 fc_host_supported_classes(shost) = FC_COS_UNSPECIFIED;
299 memset(fc_host_supported_fc4s(shost), 0, 300 memset(fc_host_supported_fc4s(shost), 0,
300 sizeof(fc_host_supported_fc4s(shost))); 301 sizeof(fc_host_supported_fc4s(shost)));
@@ -795,6 +796,8 @@ static FC_CLASS_DEVICE_ATTR(host, supported_speeds, S_IRUGO,
795 796
796fc_private_host_rd_attr_cast(node_name, "0x%llx\n", 20, unsigned long long); 797fc_private_host_rd_attr_cast(node_name, "0x%llx\n", 20, unsigned long long);
797fc_private_host_rd_attr_cast(port_name, "0x%llx\n", 20, unsigned long long); 798fc_private_host_rd_attr_cast(port_name, "0x%llx\n", 20, unsigned long long);
799fc_private_host_rd_attr_cast(permanent_port_name, "0x%llx\n", 20,
800 unsigned long long);
798fc_private_host_rd_attr(symbolic_name, "%s\n", (FC_SYMBOLIC_NAME_SIZE +1)); 801fc_private_host_rd_attr(symbolic_name, "%s\n", (FC_SYMBOLIC_NAME_SIZE +1));
799fc_private_host_rd_attr(maxframe_size, "%u bytes\n", 20); 802fc_private_host_rd_attr(maxframe_size, "%u bytes\n", 20);
800fc_private_host_rd_attr(serial_number, "%s\n", (FC_SERIAL_NUMBER_SIZE +1)); 803fc_private_host_rd_attr(serial_number, "%s\n", (FC_SERIAL_NUMBER_SIZE +1));
@@ -1090,17 +1093,23 @@ static int fc_rport_match(struct attribute_container *cont,
1090/* 1093/*
1091 * Must be called with shost->host_lock held 1094 * Must be called with shost->host_lock held
1092 */ 1095 */
1093static struct device *fc_target_parent(struct Scsi_Host *shost, 1096static int fc_user_scan(struct Scsi_Host *shost, uint channel,
1094 int channel, uint id) 1097 uint id, uint lun)
1095{ 1098{
1096 struct fc_rport *rport; 1099 struct fc_rport *rport;
1097 1100
1098 list_for_each_entry(rport, &fc_host_rports(shost), peers) 1101 list_for_each_entry(rport, &fc_host_rports(shost), peers) {
1099 if ((rport->channel == channel) && 1102 if (rport->scsi_target_id == -1)
1100 (rport->scsi_target_id == id)) 1103 continue;
1101 return &rport->dev;
1102 1104
1103 return NULL; 1105 if ((channel == SCAN_WILD_CARD || channel == rport->channel) &&
1106 (id == SCAN_WILD_CARD || id == rport->scsi_target_id)) {
1107 scsi_scan_target(&rport->dev, rport->channel,
1108 rport->scsi_target_id, lun, 1);
1109 }
1110 }
1111
1112 return 0;
1104} 1113}
1105 1114
1106struct scsi_transport_template * 1115struct scsi_transport_template *
@@ -1139,7 +1148,7 @@ fc_attach_transport(struct fc_function_template *ft)
1139 /* Transport uses the shost workq for scsi scanning */ 1148 /* Transport uses the shost workq for scsi scanning */
1140 i->t.create_work_queue = 1; 1149 i->t.create_work_queue = 1;
1141 1150
1142 i->t.target_parent = fc_target_parent; 1151 i->t.user_scan = fc_user_scan;
1143 1152
1144 /* 1153 /*
1145 * Setup SCSI Target Attributes. 1154 * Setup SCSI Target Attributes.
@@ -1160,6 +1169,7 @@ fc_attach_transport(struct fc_function_template *ft)
1160 count=0; 1169 count=0;
1161 SETUP_HOST_ATTRIBUTE_RD(node_name); 1170 SETUP_HOST_ATTRIBUTE_RD(node_name);
1162 SETUP_HOST_ATTRIBUTE_RD(port_name); 1171 SETUP_HOST_ATTRIBUTE_RD(port_name);
1172 SETUP_HOST_ATTRIBUTE_RD(permanent_port_name);
1163 SETUP_HOST_ATTRIBUTE_RD(supported_classes); 1173 SETUP_HOST_ATTRIBUTE_RD(supported_classes);
1164 SETUP_HOST_ATTRIBUTE_RD(supported_fc4s); 1174 SETUP_HOST_ATTRIBUTE_RD(supported_fc4s);
1165 SETUP_HOST_ATTRIBUTE_RD(symbolic_name); 1175 SETUP_HOST_ATTRIBUTE_RD(symbolic_name);