* [PATCH] add ability to deny binding to SPI transport class
@ 2005-08-14 19:34 James Bottomley
0 siblings, 0 replies; only message in thread
From: James Bottomley @ 2005-08-14 19:34 UTC (permalink / raw)
To: SCSI Mailing List
This patch is necessary if we begin exposing underlying physical disks
(which can attach to the SPI transport class) of the hardware RAID
cards, since we don't want any SPI parameters binding to the raid
devices.
James
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -1068,6 +1072,7 @@ static int spi_device_match(struct attri
{
struct scsi_device *sdev;
struct Scsi_Host *shost;
+ struct spi_internal *i;
if (!scsi_is_sdev_device(dev))
return 0;
@@ -1080,6 +1085,9 @@ static int spi_device_match(struct attri
/* Note: this class has no device attributes, so it has
* no per-HBA allocation and thus we don't need to distinguish
* the attribute containers for the device */
+ i = to_spi_internal(shost->transportt);
+ if (i->f->deny_binding && i->f->deny_binding(sdev->sdev_target))
+ return 0;
return 1;
}
@@ -1087,6 +1095,7 @@ static int spi_target_match(struct attri
struct device *dev)
{
struct Scsi_Host *shost;
+ struct scsi_target *starget;
struct spi_internal *i;
if (!scsi_is_target_device(dev))
@@ -1098,7 +1107,11 @@ static int spi_target_match(struct attri
return 0;
i = to_spi_internal(shost->transportt);
-
+ starget = to_scsi_target(dev);
+
+ if (i->f->deny_binding && i->f->deny_binding(starget))
+ return 0;
+
return &i->t.target_attrs.ac == cont;
}
diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h
--- a/include/scsi/scsi_transport_spi.h
+++ b/include/scsi/scsi_transport_spi.h
@@ -120,6 +120,7 @@ struct spi_function_template {
void (*set_hold_mcs)(struct scsi_target *, int);
void (*get_signalling)(struct Scsi_Host *);
void (*set_signalling)(struct Scsi_Host *, enum spi_signal_type);
+ int (*deny_binding)(struct scsi_target *);
/* The driver sets these to tell the transport class it
* wants the attributes displayed in sysfs. If the show_ flag
* is not set, the attribute will be private to the transport
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-08-14 19:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-14 19:34 [PATCH] add ability to deny binding to SPI transport class James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox