diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2005-10-27 19:03:37 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-10-28 20:35:25 -0400 |
commit | 91ca7b01ecc916632202180569a7ddbfccfc3f05 (patch) | |
tree | d26c8af7ba9d06f6b04e85270dbce0dad0624668 /drivers/scsi/scsi_transport_fc.c | |
parent | f9a2d2e0c89f73f0203fa796101089c2bce31974 (diff) |
[SCSI] Add an 'Issue LIP' device attribute in fc_transport class
Ok, here's a patch to add such a common API for fc transport users.
Relevant LLD changes (lpfc and qla2xxx) also present.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_fc.c')
-rw-r--r-- | drivers/scsi/scsi_transport_fc.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 473a82d5e3e2..27702097b7fc 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c | |||
@@ -220,7 +220,7 @@ static void fc_rport_terminate(struct fc_rport *rport); | |||
220 | */ | 220 | */ |
221 | #define FC_STARGET_NUM_ATTRS 3 | 221 | #define FC_STARGET_NUM_ATTRS 3 |
222 | #define FC_RPORT_NUM_ATTRS 9 | 222 | #define FC_RPORT_NUM_ATTRS 9 |
223 | #define FC_HOST_NUM_ATTRS 15 | 223 | #define FC_HOST_NUM_ATTRS 16 |
224 | 224 | ||
225 | struct fc_internal { | 225 | struct fc_internal { |
226 | struct scsi_transport_template t; | 226 | struct scsi_transport_template t; |
@@ -713,9 +713,11 @@ static FC_CLASS_DEVICE_ATTR(host, field, S_IRUGO, \ | |||
713 | count++ | 713 | count++ |
714 | 714 | ||
715 | #define SETUP_PRIVATE_HOST_ATTRIBUTE_RW(field) \ | 715 | #define SETUP_PRIVATE_HOST_ATTRIBUTE_RW(field) \ |
716 | { \ | ||
716 | i->private_host_attrs[count] = class_device_attr_host_##field; \ | 717 | i->private_host_attrs[count] = class_device_attr_host_##field; \ |
717 | i->host_attrs[count] = &i->private_host_attrs[count]; \ | 718 | i->host_attrs[count] = &i->private_host_attrs[count]; \ |
718 | count++ | 719 | count++; \ |
720 | } | ||
719 | 721 | ||
720 | 722 | ||
721 | /* Fixed Host Attributes */ | 723 | /* Fixed Host Attributes */ |
@@ -853,6 +855,26 @@ static FC_CLASS_DEVICE_ATTR(host, tgtid_bind_type, S_IRUGO | S_IWUSR, | |||
853 | show_fc_private_host_tgtid_bind_type, | 855 | show_fc_private_host_tgtid_bind_type, |
854 | store_fc_private_host_tgtid_bind_type); | 856 | store_fc_private_host_tgtid_bind_type); |
855 | 857 | ||
858 | static ssize_t | ||
859 | store_fc_private_host_issue_lip(struct class_device *cdev, | ||
860 | const char *buf, size_t count) | ||
861 | { | ||
862 | struct Scsi_Host *shost = transport_class_to_shost(cdev); | ||
863 | struct fc_internal *i = to_fc_internal(shost->transportt); | ||
864 | int ret; | ||
865 | |||
866 | /* ignore any data value written to the attribute */ | ||
867 | if (i->f->issue_fc_host_lip) { | ||
868 | ret = i->f->issue_fc_host_lip(shost); | ||
869 | return ret ? ret: count; | ||
870 | } | ||
871 | |||
872 | return -ENOENT; | ||
873 | } | ||
874 | |||
875 | static FC_CLASS_DEVICE_ATTR(host, issue_lip, S_IWUSR, NULL, | ||
876 | store_fc_private_host_issue_lip); | ||
877 | |||
856 | /* | 878 | /* |
857 | * Host Statistics Management | 879 | * Host Statistics Management |
858 | */ | 880 | */ |
@@ -1119,6 +1141,8 @@ fc_attach_transport(struct fc_function_template *ft) | |||
1119 | 1141 | ||
1120 | /* Transport-managed attributes */ | 1142 | /* Transport-managed attributes */ |
1121 | SETUP_PRIVATE_HOST_ATTRIBUTE_RW(tgtid_bind_type); | 1143 | SETUP_PRIVATE_HOST_ATTRIBUTE_RW(tgtid_bind_type); |
1144 | if (ft->issue_fc_host_lip) | ||
1145 | SETUP_PRIVATE_HOST_ATTRIBUTE_RW(issue_lip); | ||
1122 | 1146 | ||
1123 | BUG_ON(count > FC_HOST_NUM_ATTRS); | 1147 | BUG_ON(count > FC_HOST_NUM_ATTRS); |
1124 | 1148 | ||