On Sat, 15 Sep 2007 23:07:10 -0400
Jeff Garzik <[EMAIL PROTECTED]> wrote:
> FUJITA Tomonori wrote:
> > The majority of llds don't set supported_mode in scsi_host_template so
> > we get:
> >
> > luce:/sys/class/scsi_host/host0$ cat supported_mode
> > unknown
> >
> > It's harmless but it would be better to get:
> >
> > luce:/sys/class/scsi_host/host0$ cat supported_mode
> > Initiator
>
> Given that this is the /vast/ majority, just set it once as a default
> value, and let target drivers change the mode if different.
I thought that it's a bit hacky but it should work.
From: FUJITA Tomonori <[EMAIL PROTECTED]>
Subject: [PATCH] set supported_mode to MODE_INITIATOR by default
This sets supported_mode to MODE_INITIATOR if a lld doesn't set
supported_mode in scsi_host_template.
Signed-off-by: FUJITA Tomonori <[EMAIL PROTECTED]>
---
drivers/scsi/hosts.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index adc9559..694015d 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -342,6 +342,10 @@ struct Scsi_Host *scsi_host_alloc(struct
scsi_host_template *sht, int privsize)
shost->unchecked_isa_dma = sht->unchecked_isa_dma;
shost->use_clustering = sht->use_clustering;
shost->ordered_tag = sht->ordered_tag;
+
+ if (!sht->supported_mode)
+ sht->supported_mode = MODE_INITIATOR;
+
shost->active_mode = sht->supported_mode;
if (sht->max_host_blocked)
--
1.5.2.4
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html