Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20373
b: refs/heads/master
c: bb08f92
h: refs/heads/master
i:
  20371: ec09ade
v: v3
  • Loading branch information
Mark Haverkamp authored and unknown committed Feb 4, 2006
1 parent c680881 commit f68693a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 60 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: bfb35aa85057da4336af56a7f26e08031f4e3468
refs/heads/master: bb08f92ebd75704e07d69bb9d8ee234d1a500b98
53 changes: 3 additions & 50 deletions trunk/drivers/scsi/aacraid/aachba.c
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
* itself.
*/
if (scmd_id(scsicmd) != host->this_id) {
if ((scsicmd->device->channel == 0) ){
if ((scsicmd->device->channel == CONTAINER_CHANNEL)) {
if( (scsicmd->device->id >= dev->maximum_num_containers) || (scsicmd->device->lun != 0)){
scsicmd->result = DID_NO_CONNECT << 16;
scsicmd->scsi_done(scsicmd);
Expand Down Expand Up @@ -1935,33 +1935,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
case SRB_STATUS_ERROR_RECOVERY:
case SRB_STATUS_PENDING:
case SRB_STATUS_SUCCESS:
if(scsicmd->cmnd[0] == INQUIRY ){
u8 b;
u8 b1;
/* We can't expose disk devices because we can't tell whether they
* are the raw container drives or stand alone drives. If they have
* the removable bit set then we should expose them though.
*/
b = (*(u8*)scsicmd->buffer)&0x1f;
b1 = ((u8*)scsicmd->buffer)[1];
if( b==TYPE_TAPE || b==TYPE_WORM || b==TYPE_ROM || b==TYPE_MOD|| b==TYPE_MEDIUM_CHANGER
|| (b==TYPE_DISK && (b1&0x80)) ){
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
/*
* We will allow disk devices if in RAID/SCSI mode and
* the channel is 2
*/
} else if ((dev->raid_scsi_mode) &&
(scmd_channel(scsicmd) == 2)) {
scsicmd->result = DID_OK << 16 |
COMMAND_COMPLETE << 8;
} else {
scsicmd->result = DID_NO_CONNECT << 16 |
COMMAND_COMPLETE << 8;
}
} else {
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
}
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
break;
case SRB_STATUS_DATA_OVERRUN:
switch(scsicmd->cmnd[0]){
Expand All @@ -1981,28 +1955,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
scsicmd->result = DID_ERROR << 16 | COMMAND_COMPLETE << 8;
break;
case INQUIRY: {
u8 b;
u8 b1;
/* We can't expose disk devices because we can't tell whether they
* are the raw container drives or stand alone drives
*/
b = (*(u8*)scsicmd->buffer)&0x0f;
b1 = ((u8*)scsicmd->buffer)[1];
if( b==TYPE_TAPE || b==TYPE_WORM || b==TYPE_ROM || b==TYPE_MOD|| b==TYPE_MEDIUM_CHANGER
|| (b==TYPE_DISK && (b1&0x80)) ){
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
/*
* We will allow disk devices if in RAID/SCSI mode and
* the channel is 2
*/
} else if ((dev->raid_scsi_mode) &&
(scmd_channel(scsicmd) == 2)) {
scsicmd->result = DID_OK << 16 |
COMMAND_COMPLETE << 8;
} else {
scsicmd->result = DID_NO_CONNECT << 16 |
COMMAND_COMPLETE << 8;
}
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
break;
}
default:
Expand Down
42 changes: 33 additions & 9 deletions trunk/drivers/scsi/aacraid/linit.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,21 +385,45 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev,

static int aac_slave_configure(struct scsi_device *sdev)
{
struct Scsi_Host *host = sdev->host;
if (sdev_channel(sdev) == CONTAINER_CHANNEL) {
sdev->skip_ms_page_8 = 1;
sdev->skip_ms_page_3f = 1;
}
if ((sdev->type == TYPE_DISK) &&
(sdev_channel(sdev) != CONTAINER_CHANNEL)) {
struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata;
if (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2))
sdev->no_uld_attach = 1;
}
if (sdev->tagged_supported && (sdev->type == TYPE_DISK) &&
(sdev_channel(sdev) == CONTAINER_CHANNEL)) {
struct scsi_device * dev;
struct Scsi_Host *host = sdev->host;
unsigned num_lsu = 0;
unsigned num_one = 0;
unsigned depth;

if (sdev->tagged_supported)
scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, 128);
else
__shost_for_each_device(dev, host) {
if (dev->tagged_supported && (dev->type == TYPE_DISK) &&
(sdev_channel(dev) == CONTAINER_CHANNEL))
++num_lsu;
else
++num_one;
}
if (num_lsu == 0)
++num_lsu;
depth = (host->can_queue - num_one) / num_lsu;
if (depth > 256)
depth = 256;
else if (depth < 2)
depth = 2;
scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, depth);
if (!(((struct aac_dev *)host->hostdata)->adapter_info.options &
AAC_OPT_NEW_COMM))
blk_queue_max_segment_size(sdev->request_queue, 65536);
} else
scsi_adjust_queue_depth(sdev, 0, 1);

if (!(((struct aac_dev *)host->hostdata)->adapter_info.options
& AAC_OPT_NEW_COMM))
blk_queue_max_segment_size(sdev->request_queue, 65536);

return 0;
}

Expand Down Expand Up @@ -874,7 +898,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,

/*
* max channel will be the physical channels plus 1 virtual channel
* all containers are on the virtual channel 0
* all containers are on the virtual channel 0 (CONTAINER_CHANNEL)
* physical channels are address by their actual physical number+1
*/
if (aac->nondasd_support == 1)
Expand Down

0 comments on commit f68693a

Please sign in to comment.