aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2010-09-15 17:52:31 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-10-07 18:09:42 -0400
commit0af5d708aae3aef1f98a1c689007b92db2c10277 (patch)
tree1e612e63740b59fcc9ab2fd21ace4844be2c3907 /drivers/scsi
parentd2b5f10e5b93633a40d9263383b914f06019f00b (diff)
[SCSI] lpfc: prep for fc host dev loss tmo support
This removes the driver's get_host_def_dev_loss_tmo callback and just has the driver set the dev loss using the fc class fc_host_dev_loss_tmo macro like is done for other fc params. It also adds compat support for the driver's existing dev loss and nodev sysfs and modparams. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c16
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c2
2 files changed, 8 insertions, 10 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 87c2b6b858f..f6efc6fe86d 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -2159,6 +2159,11 @@ lpfc_nodev_tmo_set(struct lpfc_vport *vport, int val)
2159 if (val >= LPFC_MIN_DEVLOSS_TMO && val <= LPFC_MAX_DEVLOSS_TMO) { 2159 if (val >= LPFC_MIN_DEVLOSS_TMO && val <= LPFC_MAX_DEVLOSS_TMO) {
2160 vport->cfg_nodev_tmo = val; 2160 vport->cfg_nodev_tmo = val;
2161 vport->cfg_devloss_tmo = val; 2161 vport->cfg_devloss_tmo = val;
2162 /*
2163 * For compat: set the fc_host dev loss so new rports
2164 * will get the value.
2165 */
2166 fc_host_dev_loss_tmo(lpfc_shost_from_vport(vport)) = val;
2162 lpfc_update_rport_devloss_tmo(vport); 2167 lpfc_update_rport_devloss_tmo(vport);
2163 return 0; 2168 return 0;
2164 } 2169 }
@@ -2208,6 +2213,7 @@ lpfc_devloss_tmo_set(struct lpfc_vport *vport, int val)
2208 vport->cfg_nodev_tmo = val; 2213 vport->cfg_nodev_tmo = val;
2209 vport->cfg_devloss_tmo = val; 2214 vport->cfg_devloss_tmo = val;
2210 vport->dev_loss_tmo_changed = 1; 2215 vport->dev_loss_tmo_changed = 1;
2216 fc_host_dev_loss_tmo(lpfc_shost_from_vport(vport)) = val;
2211 lpfc_update_rport_devloss_tmo(vport); 2217 lpfc_update_rport_devloss_tmo(vport);
2212 return 0; 2218 return 0;
2213 } 2219 }
@@ -4370,14 +4376,6 @@ lpfc_get_starget_port_name(struct scsi_target *starget)
4370 ndlp ? wwn_to_u64(ndlp->nlp_portname.u.wwn) : 0; 4376 ndlp ? wwn_to_u64(ndlp->nlp_portname.u.wwn) : 0;
4371} 4377}
4372 4378
4373static void
4374lpfc_get_host_def_loss_tmo(struct Scsi_Host *shost)
4375{
4376 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
4377
4378 fc_host_def_dev_loss_tmo(shost) = vport->cfg_devloss_tmo;
4379}
4380
4381/** 4379/**
4382 * lpfc_set_rport_loss_tmo - Set the rport dev loss tmo 4380 * lpfc_set_rport_loss_tmo - Set the rport dev loss tmo
4383 * @rport: fc rport address. 4381 * @rport: fc rport address.
@@ -4486,7 +4484,6 @@ struct fc_function_template lpfc_transport_functions = {
4486 .get_host_fabric_name = lpfc_get_host_fabric_name, 4484 .get_host_fabric_name = lpfc_get_host_fabric_name,
4487 .show_host_fabric_name = 1, 4485 .show_host_fabric_name = 1,
4488 4486
4489 .get_host_def_dev_loss_tmo = lpfc_get_host_def_loss_tmo,
4490 /* 4487 /*
4491 * The LPFC driver treats linkdown handling as target loss events 4488 * The LPFC driver treats linkdown handling as target loss events
4492 * so there are no sysfs handlers for link_down_tmo. 4489 * so there are no sysfs handlers for link_down_tmo.
@@ -4554,7 +4551,6 @@ struct fc_function_template lpfc_vport_transport_functions = {
4554 .get_host_fabric_name = lpfc_get_host_fabric_name, 4551 .get_host_fabric_name = lpfc_get_host_fabric_name,
4555 .show_host_fabric_name = 1, 4552 .show_host_fabric_name = 1,
4556 4553
4557 .get_host_def_dev_loss_tmo = lpfc_get_host_def_loss_tmo,
4558 /* 4554 /*
4559 * The LPFC driver treats linkdown handling as target loss events 4555 * The LPFC driver treats linkdown handling as target loss events
4560 * so there are no sysfs handlers for link_down_tmo. 4556 * so there are no sysfs handlers for link_down_tmo.
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index da9ba06ad58..87a4d09a664 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -2817,6 +2817,8 @@ void lpfc_host_attrib_init(struct Scsi_Host *shost)
2817 (((uint32_t) vport->fc_sparam.cmn.bbRcvSizeMsb & 0x0F) << 8) | 2817 (((uint32_t) vport->fc_sparam.cmn.bbRcvSizeMsb & 0x0F) << 8) |
2818 (uint32_t) vport->fc_sparam.cmn.bbRcvSizeLsb; 2818 (uint32_t) vport->fc_sparam.cmn.bbRcvSizeLsb;
2819 2819
2820 fc_host_dev_loss_tmo(shost) = vport->cfg_devloss_tmo;
2821
2820 /* This value is also unchanging */ 2822 /* This value is also unchanging */
2821 memset(fc_host_active_fc4s(shost), 0, 2823 memset(fc_host_active_fc4s(shost), 0,
2822 sizeof(fc_host_active_fc4s(shost))); 2824 sizeof(fc_host_active_fc4s(shost)));