diff options
author | Mark Haverkamp <markh@osdl.org> | 2006-02-01 12:30:44 -0500 |
---|---|---|
committer | <jejb@mulgrave.il.steeleye.com> | 2006-02-04 17:16:14 -0500 |
commit | bb08f92ebd75704e07d69bb9d8ee234d1a500b98 (patch) | |
tree | 9756f6c6a18574264e889aa9af408ce60ca59fbb /drivers/scsi/aacraid/aachba.c | |
parent | bfb35aa85057da4336af56a7f26e08031f4e3468 (diff) |
[SCSI] aacraid: use no_uld_attach flag
Received From Mark Salyzyn.
In order to support user tools accessing the array components (SMART,
Mode Page information, Cache page adjustments, WWN determination,
Firmware updates etc), we take advantage of the no_uld_attach flag and
deprecate the code that filters Inquiries to block the requests to array
components. The quirk prevents the sd layer from attaching to the
components.
We also took the opportunity to balance the queue depths based on the
total adapter queue depth to the array devices to reduce the chances of
starvation.
Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aacraid/aachba.c')
-rw-r--r-- | drivers/scsi/aacraid/aachba.c | 53 |
1 files changed, 3 insertions, 50 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index b0f314e415c9..a16f8ded8f1d 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c | |||
@@ -1465,7 +1465,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) | |||
1465 | * itself. | 1465 | * itself. |
1466 | */ | 1466 | */ |
1467 | if (scmd_id(scsicmd) != host->this_id) { | 1467 | if (scmd_id(scsicmd) != host->this_id) { |
1468 | if ((scsicmd->device->channel == 0) ){ | 1468 | if ((scsicmd->device->channel == CONTAINER_CHANNEL)) { |
1469 | if( (scsicmd->device->id >= dev->maximum_num_containers) || (scsicmd->device->lun != 0)){ | 1469 | if( (scsicmd->device->id >= dev->maximum_num_containers) || (scsicmd->device->lun != 0)){ |
1470 | scsicmd->result = DID_NO_CONNECT << 16; | 1470 | scsicmd->result = DID_NO_CONNECT << 16; |
1471 | scsicmd->scsi_done(scsicmd); | 1471 | scsicmd->scsi_done(scsicmd); |
@@ -1935,33 +1935,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr) | |||
1935 | case SRB_STATUS_ERROR_RECOVERY: | 1935 | case SRB_STATUS_ERROR_RECOVERY: |
1936 | case SRB_STATUS_PENDING: | 1936 | case SRB_STATUS_PENDING: |
1937 | case SRB_STATUS_SUCCESS: | 1937 | case SRB_STATUS_SUCCESS: |
1938 | if(scsicmd->cmnd[0] == INQUIRY ){ | 1938 | scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8; |
1939 | u8 b; | ||
1940 | u8 b1; | ||
1941 | /* We can't expose disk devices because we can't tell whether they | ||
1942 | * are the raw container drives or stand alone drives. If they have | ||
1943 | * the removable bit set then we should expose them though. | ||
1944 | */ | ||
1945 | b = (*(u8*)scsicmd->buffer)&0x1f; | ||
1946 | b1 = ((u8*)scsicmd->buffer)[1]; | ||
1947 | if( b==TYPE_TAPE || b==TYPE_WORM || b==TYPE_ROM || b==TYPE_MOD|| b==TYPE_MEDIUM_CHANGER | ||
1948 | || (b==TYPE_DISK && (b1&0x80)) ){ | ||
1949 | scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8; | ||
1950 | /* | ||
1951 | * We will allow disk devices if in RAID/SCSI mode and | ||
1952 | * the channel is 2 | ||
1953 | */ | ||
1954 | } else if ((dev->raid_scsi_mode) && | ||
1955 | (scmd_channel(scsicmd) == 2)) { | ||
1956 | scsicmd->result = DID_OK << 16 | | ||
1957 | COMMAND_COMPLETE << 8; | ||
1958 | } else { | ||
1959 | scsicmd->result = DID_NO_CONNECT << 16 | | ||
1960 | COMMAND_COMPLETE << 8; | ||
1961 | } | ||
1962 | } else { | ||
1963 | scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8; | ||
1964 | } | ||
1965 | break; | 1939 | break; |
1966 | case SRB_STATUS_DATA_OVERRUN: | 1940 | case SRB_STATUS_DATA_OVERRUN: |
1967 | switch(scsicmd->cmnd[0]){ | 1941 | switch(scsicmd->cmnd[0]){ |
@@ -1981,28 +1955,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr) | |||
1981 | scsicmd->result = DID_ERROR << 16 | COMMAND_COMPLETE << 8; | 1955 | scsicmd->result = DID_ERROR << 16 | COMMAND_COMPLETE << 8; |
1982 | break; | 1956 | break; |
1983 | case INQUIRY: { | 1957 | case INQUIRY: { |
1984 | u8 b; | 1958 | scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8; |
1985 | u8 b1; | ||
1986 | /* We can't expose disk devices because we can't tell whether they | ||
1987 | * are the raw container drives or stand alone drives | ||
1988 | */ | ||
1989 | b = (*(u8*)scsicmd->buffer)&0x0f; | ||
1990 | b1 = ((u8*)scsicmd->buffer)[1]; | ||
1991 | if( b==TYPE_TAPE || b==TYPE_WORM || b==TYPE_ROM || b==TYPE_MOD|| b==TYPE_MEDIUM_CHANGER | ||
1992 | || (b==TYPE_DISK && (b1&0x80)) ){ | ||
1993 | scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8; | ||
1994 | /* | ||
1995 | * We will allow disk devices if in RAID/SCSI mode and | ||
1996 | * the channel is 2 | ||
1997 | */ | ||
1998 | } else if ((dev->raid_scsi_mode) && | ||
1999 | (scmd_channel(scsicmd) == 2)) { | ||
2000 | scsicmd->result = DID_OK << 16 | | ||
2001 | COMMAND_COMPLETE << 8; | ||
2002 | } else { | ||
2003 | scsicmd->result = DID_NO_CONNECT << 16 | | ||
2004 | COMMAND_COMPLETE << 8; | ||
2005 | } | ||
2006 | break; | 1959 | break; |
2007 | } | 1960 | } |
2008 | default: | 1961 | default: |