Skip to content

Commit

Permalink
[SCSI] fc class: add fc host default default dev loss setting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike Christie authored and James Bottomley committed Sep 5, 2010
1 parent 2bfc96a commit b8ef320
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/scsi/scsi_transport_fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2525,7 +2525,11 @@ fc_rport_create(struct Scsi_Host *shost, int channel,

rport->maxframe_size = -1;
rport->supported_classes = FC_COS_UNSPECIFIED;
rport->dev_loss_tmo = fc_dev_loss_tmo;
if (fci->f->get_host_def_dev_loss_tmo) {
fci->f->get_host_def_dev_loss_tmo(shost);
rport->dev_loss_tmo = fc_host_def_dev_loss_tmo(shost);
} else
rport->dev_loss_tmo = fc_dev_loss_tmo;
memcpy(&rport->node_name, &ids->node_name, sizeof(rport->node_name));
memcpy(&rport->port_name, &ids->port_name, sizeof(rport->port_name));
rport->port_id = ids->port_id;
Expand Down
4 changes: 4 additions & 0 deletions include/scsi/scsi_transport_fc.h
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ struct fc_host_attrs {
u64 fabric_name;
char symbolic_name[FC_SYMBOLIC_NAME_SIZE];
char system_hostname[FC_SYMBOLIC_NAME_SIZE];
u32 def_dev_loss_tmo;

/* Private (Transport-managed) Attributes */
enum fc_tgtid_binding_type tgtid_bind_type;
Expand Down Expand Up @@ -580,6 +581,8 @@ struct fc_host_attrs {
(((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name)
#define fc_host_devloss_work_q(x) \
(((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q)
#define fc_host_def_dev_loss_tmo(x) \
(((struct fc_host_attrs *)(x)->shost_data)->def_dev_loss_tmo)


struct fc_bsg_buffer {
Expand Down Expand Up @@ -640,6 +643,7 @@ struct fc_function_template {
void (*get_host_fabric_name)(struct Scsi_Host *);
void (*get_host_symbolic_name)(struct Scsi_Host *);
void (*set_host_system_hostname)(struct Scsi_Host *);
void (*get_host_def_dev_loss_tmo)(struct Scsi_Host *);

struct fc_host_statistics * (*get_fc_host_stats)(struct Scsi_Host *);
void (*reset_fc_host_stats)(struct Scsi_Host *);
Expand Down

0 comments on commit b8ef320

Please sign in to comment.