diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2010-08-06 04:02:37 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-09-05 12:45:23 -0400 |
commit | b8ef3204f460912a46659cdc74d237adbe705053 (patch) | |
tree | b1c25834067f9899f4ff0a003b403e646e86acc8 | |
parent | 2bfc96a127bc1cc94d26bfaa40159966064f9c8c (diff) |
[SCSI] fc class: add fc host default default dev loss setting
This patch adds a fc_host setting to store the
default dev_loss_tmo. It is used if the driver
has a callack to get the value from the LLD. If
the callback is not set, then we use the fc class
module default value.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/scsi_transport_fc.c | 6 | ||||
-rw-r--r-- | include/scsi/scsi_transport_fc.h | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index d7e470a06180..9f0f7d9c7422 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c | |||
@@ -2525,7 +2525,11 @@ fc_rport_create(struct Scsi_Host *shost, int channel, | |||
2525 | 2525 | ||
2526 | rport->maxframe_size = -1; | 2526 | rport->maxframe_size = -1; |
2527 | rport->supported_classes = FC_COS_UNSPECIFIED; | 2527 | rport->supported_classes = FC_COS_UNSPECIFIED; |
2528 | rport->dev_loss_tmo = fc_dev_loss_tmo; | 2528 | if (fci->f->get_host_def_dev_loss_tmo) { |
2529 | fci->f->get_host_def_dev_loss_tmo(shost); | ||
2530 | rport->dev_loss_tmo = fc_host_def_dev_loss_tmo(shost); | ||
2531 | } else | ||
2532 | rport->dev_loss_tmo = fc_dev_loss_tmo; | ||
2529 | memcpy(&rport->node_name, &ids->node_name, sizeof(rport->node_name)); | 2533 | memcpy(&rport->node_name, &ids->node_name, sizeof(rport->node_name)); |
2530 | memcpy(&rport->port_name, &ids->port_name, sizeof(rport->port_name)); | 2534 | memcpy(&rport->port_name, &ids->port_name, sizeof(rport->port_name)); |
2531 | rport->port_id = ids->port_id; | 2535 | rport->port_id = ids->port_id; |
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 87d81b3ce564..9f98fca9b763 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
@@ -496,6 +496,7 @@ struct fc_host_attrs { | |||
496 | u64 fabric_name; | 496 | u64 fabric_name; |
497 | char symbolic_name[FC_SYMBOLIC_NAME_SIZE]; | 497 | char symbolic_name[FC_SYMBOLIC_NAME_SIZE]; |
498 | char system_hostname[FC_SYMBOLIC_NAME_SIZE]; | 498 | char system_hostname[FC_SYMBOLIC_NAME_SIZE]; |
499 | u32 def_dev_loss_tmo; | ||
499 | 500 | ||
500 | /* Private (Transport-managed) Attributes */ | 501 | /* Private (Transport-managed) Attributes */ |
501 | enum fc_tgtid_binding_type tgtid_bind_type; | 502 | enum fc_tgtid_binding_type tgtid_bind_type; |
@@ -580,6 +581,8 @@ struct fc_host_attrs { | |||
580 | (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name) | 581 | (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name) |
581 | #define fc_host_devloss_work_q(x) \ | 582 | #define fc_host_devloss_work_q(x) \ |
582 | (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q) | 583 | (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q) |
584 | #define fc_host_def_dev_loss_tmo(x) \ | ||
585 | (((struct fc_host_attrs *)(x)->shost_data)->def_dev_loss_tmo) | ||
583 | 586 | ||
584 | 587 | ||
585 | struct fc_bsg_buffer { | 588 | struct fc_bsg_buffer { |
@@ -640,6 +643,7 @@ struct fc_function_template { | |||
640 | void (*get_host_fabric_name)(struct Scsi_Host *); | 643 | void (*get_host_fabric_name)(struct Scsi_Host *); |
641 | void (*get_host_symbolic_name)(struct Scsi_Host *); | 644 | void (*get_host_symbolic_name)(struct Scsi_Host *); |
642 | void (*set_host_system_hostname)(struct Scsi_Host *); | 645 | void (*set_host_system_hostname)(struct Scsi_Host *); |
646 | void (*get_host_def_dev_loss_tmo)(struct Scsi_Host *); | ||
643 | 647 | ||
644 | struct fc_host_statistics * (*get_fc_host_stats)(struct Scsi_Host *); | 648 | struct fc_host_statistics * (*get_fc_host_stats)(struct Scsi_Host *); |
645 | void (*reset_fc_host_stats)(struct Scsi_Host *); | 649 | void (*reset_fc_host_stats)(struct Scsi_Host *); |