Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77102
b: refs/heads/master
c: 17eaace
h: refs/heads/master
v: v3
  • Loading branch information
Salyzyn, Mark authored and James Bottomley committed Jan 23, 2008
1 parent 61fd976 commit 54b7a08
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 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: 95e852e1ef165560e85d3012127068c8f08b19a1
refs/heads/master: 17eaaceef52b1ce5ca061d49a1ff9ae56ccce1e1
7 changes: 6 additions & 1 deletion trunk/drivers/scsi/aacraid/aachba.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,12 @@ static char *container_types[] = {
"Unknown"
};


char * get_container_type(unsigned tindex)
{
if (tindex >= ARRAY_SIZE(container_types))
tindex = ARRAY_SIZE(container_types) - 1;
return container_types[tindex];
}

/* Function: setinqstr
*
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/scsi/aacraid/aacraid.h
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,7 @@ int aac_probe_container(struct aac_dev *dev, int cid);
int _aac_rx_init(struct aac_dev *dev);
int aac_rx_select_comm(struct aac_dev *dev, int comm);
int aac_rx_deliver_producer(struct fib * fib);
char * get_container_type(unsigned type);
extern int numacb;
extern int acbsize;
extern char aac_driver_version[];
Expand Down
25 changes: 25 additions & 0 deletions trunk/drivers/scsi/aacraid/linit.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,30 @@ static int aac_change_queue_depth(struct scsi_device *sdev, int depth)
return sdev->queue_depth;
}

static ssize_t aac_show_raid_level(struct device *dev, struct device_attribute *attr, char *buf)
{
struct scsi_device * sdev = to_scsi_device(dev);
if (sdev_channel(sdev) != CONTAINER_CHANNEL)
return snprintf(buf, PAGE_SIZE, sdev->no_uld_attach
? "Hidden\n" : "JBOD");
return snprintf(buf, PAGE_SIZE, "%s\n",
get_container_type(((struct aac_dev *)(sdev->host->hostdata))
->fsa_dev[sdev_id(sdev)].type));
}

static struct device_attribute aac_raid_level_attr = {
.attr = {
.name = "level",
.mode = S_IRUGO,
},
.show = aac_show_raid_level
};

static struct device_attribute *aac_dev_attrs[] = {
&aac_raid_level_attr,
NULL,
};

static int aac_ioctl(struct scsi_device *sdev, int cmd, void __user * arg)
{
struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
Expand Down Expand Up @@ -941,6 +965,7 @@ static struct scsi_host_template aac_driver_template = {
.shost_attrs = aac_attrs,
.slave_configure = aac_slave_configure,
.change_queue_depth = aac_change_queue_depth,
.sdev_attrs = aac_dev_attrs,
.eh_abort_handler = aac_eh_abort,
.eh_host_reset_handler = aac_eh_reset,
.can_queue = AAC_NUM_IO_FIB,
Expand Down

0 comments on commit 54b7a08

Please sign in to comment.