aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/scsi_transport_spi.c11
-rw-r--r--include/scsi/scsi_transport_spi.h1
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index e7b9570c818b..02134fce2174 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -1082,6 +1082,7 @@ static int spi_device_match(struct attribute_container *cont,
1082{ 1082{
1083 struct scsi_device *sdev; 1083 struct scsi_device *sdev;
1084 struct Scsi_Host *shost; 1084 struct Scsi_Host *shost;
1085 struct spi_internal *i;
1085 1086
1086 if (!scsi_is_sdev_device(dev)) 1087 if (!scsi_is_sdev_device(dev))
1087 return 0; 1088 return 0;
@@ -1094,6 +1095,9 @@ static int spi_device_match(struct attribute_container *cont,
1094 /* Note: this class has no device attributes, so it has 1095 /* Note: this class has no device attributes, so it has
1095 * no per-HBA allocation and thus we don't need to distinguish 1096 * no per-HBA allocation and thus we don't need to distinguish
1096 * the attribute containers for the device */ 1097 * the attribute containers for the device */
1098 i = to_spi_internal(shost->transportt);
1099 if (i->f->deny_binding && i->f->deny_binding(sdev->sdev_target))
1100 return 0;
1097 return 1; 1101 return 1;
1098} 1102}
1099 1103
@@ -1101,6 +1105,7 @@ static int spi_target_match(struct attribute_container *cont,
1101 struct device *dev) 1105 struct device *dev)
1102{ 1106{
1103 struct Scsi_Host *shost; 1107 struct Scsi_Host *shost;
1108 struct scsi_target *starget;
1104 struct spi_internal *i; 1109 struct spi_internal *i;
1105 1110
1106 if (!scsi_is_target_device(dev)) 1111 if (!scsi_is_target_device(dev))
@@ -1112,7 +1117,11 @@ static int spi_target_match(struct attribute_container *cont,
1112 return 0; 1117 return 0;
1113 1118
1114 i = to_spi_internal(shost->transportt); 1119 i = to_spi_internal(shost->transportt);
1115 1120 starget = to_scsi_target(dev);
1121
1122 if (i->f->deny_binding && i->f->deny_binding(starget))
1123 return 0;
1124
1116 return &i->t.target_attrs.ac == cont; 1125 return &i->t.target_attrs.ac == cont;
1117} 1126}
1118 1127
diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h
index d8ef86006e02..6bdc4afb2483 100644
--- a/include/scsi/scsi_transport_spi.h
+++ b/include/scsi/scsi_transport_spi.h
@@ -120,6 +120,7 @@ struct spi_function_template {
120 void (*set_hold_mcs)(struct scsi_target *, int); 120 void (*set_hold_mcs)(struct scsi_target *, int);
121 void (*get_signalling)(struct Scsi_Host *); 121 void (*get_signalling)(struct Scsi_Host *);
122 void (*set_signalling)(struct Scsi_Host *, enum spi_signal_type); 122 void (*set_signalling)(struct Scsi_Host *, enum spi_signal_type);
123 int (*deny_binding)(struct scsi_target *);
123 /* The driver sets these to tell the transport class it 124 /* The driver sets these to tell the transport class it
124 * wants the attributes displayed in sysfs. If the show_ flag 125 * wants the attributes displayed in sysfs. If the show_ flag
125 * is not set, the attribute will be private to the transport 126 * is not set, the attribute will be private to the transport