Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72313
b: refs/heads/master
c: 7a39ac3
h: refs/heads/master
i:
  72311: 43d11cf
v: v3
  • Loading branch information
James Bottomley authored and James Bottomley committed Oct 18, 2007
1 parent c65fa3f commit b29c814
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 645a0c6c48e0122f4212e3957e73bddc18788d99
refs/heads/master: 7a39ac3f25bef018862a991d754aff681c019127
6 changes: 6 additions & 0 deletions trunk/drivers/scsi/hosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,12 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
shost->active_mode = sht->supported_mode;
shost->use_sg_chaining = sht->use_sg_chaining;

if (sht->supported_mode == MODE_UNKNOWN)
/* means we didn't set it ... default to INITIATOR */
shost->active_mode = MODE_INITIATOR;
else
shost->active_mode = sht->supported_mode;

if (sht->max_host_blocked)
shost->max_host_blocked = sht->max_host_blocked;
else
Expand Down
10 changes: 6 additions & 4 deletions trunk/drivers/scsi/scsi_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,13 @@ show_shost_mode(unsigned int mode, char *buf)
static ssize_t show_shost_supported_mode(struct class_device *class_dev, char *buf)
{
struct Scsi_Host *shost = class_to_shost(class_dev);
unsigned int supported_mode = shost->hostt->supported_mode;

if (shost->hostt->supported_mode == MODE_UNKNOWN)
return snprintf(buf, 20, "unknown\n");
else
return show_shost_mode(shost->hostt->supported_mode, buf);
if (supported_mode == MODE_UNKNOWN)
/* by default this should be initiator */
supported_mode = MODE_INITIATOR;

return show_shost_mode(supported_mode, buf);
}

static CLASS_DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL);
Expand Down

0 comments on commit b29c814

Please sign in to comment.