aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fnic/fnic_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/fnic/fnic_main.c')
-rw-r--r--drivers/scsi/fnic/fnic_main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index 9eb7a9ebccae..bb63f1a1f808 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -80,8 +80,6 @@ static struct libfc_function_template fnic_transport_template = {
80static int fnic_slave_alloc(struct scsi_device *sdev) 80static int fnic_slave_alloc(struct scsi_device *sdev)
81{ 81{
82 struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); 82 struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
83 struct fc_lport *lp = shost_priv(sdev->host);
84 struct fnic *fnic = lport_priv(lp);
85 83
86 sdev->tagged_supported = 1; 84 sdev->tagged_supported = 1;
87 85
@@ -89,8 +87,6 @@ static int fnic_slave_alloc(struct scsi_device *sdev)
89 return -ENXIO; 87 return -ENXIO;
90 88
91 scsi_activate_tcq(sdev, FNIC_DFLT_QUEUE_DEPTH); 89 scsi_activate_tcq(sdev, FNIC_DFLT_QUEUE_DEPTH);
92 rport->dev_loss_tmo = fnic->config.port_down_timeout / 1000;
93
94 return 0; 90 return 0;
95} 91}
96 92
@@ -113,6 +109,15 @@ static struct scsi_host_template fnic_host_template = {
113 .shost_attrs = fnic_attrs, 109 .shost_attrs = fnic_attrs,
114}; 110};
115 111
112static void
113fnic_set_rport_dev_loss_tmo(struct fc_rport *rport, u32 timeout)
114{
115 if (timeout)
116 rport->dev_loss_tmo = timeout;
117 else
118 rport->dev_loss_tmo = 1;
119}
120
116static void fnic_get_host_speed(struct Scsi_Host *shost); 121static void fnic_get_host_speed(struct Scsi_Host *shost);
117static struct scsi_transport_template *fnic_fc_transport; 122static struct scsi_transport_template *fnic_fc_transport;
118static struct fc_host_statistics *fnic_get_stats(struct Scsi_Host *); 123static struct fc_host_statistics *fnic_get_stats(struct Scsi_Host *);
@@ -140,6 +145,7 @@ static struct fc_function_template fnic_fc_functions = {
140 .show_starget_port_name = 1, 145 .show_starget_port_name = 1,
141 .show_starget_port_id = 1, 146 .show_starget_port_id = 1,
142 .show_rport_dev_loss_tmo = 1, 147 .show_rport_dev_loss_tmo = 1,
148 .set_rport_dev_loss_tmo = fnic_set_rport_dev_loss_tmo,
143 .issue_fc_host_lip = fnic_reset, 149 .issue_fc_host_lip = fnic_reset,
144 .get_fc_host_stats = fnic_get_stats, 150 .get_fc_host_stats = fnic_get_stats,
145 .dd_fcrport_size = sizeof(struct fc_rport_libfc_priv), 151 .dd_fcrport_size = sizeof(struct fc_rport_libfc_priv),
@@ -706,6 +712,7 @@ static int __devinit fnic_probe(struct pci_dev *pdev,
706 goto err_out_free_exch_mgr; 712 goto err_out_free_exch_mgr;
707 } 713 }
708 fc_host_maxframe_size(lp->host) = lp->mfs; 714 fc_host_maxframe_size(lp->host) = lp->mfs;
715 fc_host_dev_loss_tmo(lp->host) = fnic->config.port_down_timeout / 1000;
709 716
710 sprintf(fc_host_symbolic_name(lp->host), 717 sprintf(fc_host_symbolic_name(lp->host),
711 DRV_NAME " v" DRV_VERSION " over %s", fnic->name); 718 DRV_NAME " v" DRV_VERSION " over %s", fnic->name);