summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorRajashekhara, Mahesh <Mahesh_Rajashekhara@adaptec.com>2010-05-10 13:12:28 +0200
committerJames Bottomley <James.Bottomley@suse.de>2010-05-17 04:35:54 +0200
commite3cc268fe4a0ad1cbefbc53cee35c80281e609b8 (patch)
tree2a01479de6fc10141975e14674060f43adec5e59 /drivers/scsi
parent[SCSI] aacraid: respond automatically to volumes added by config tool (diff)
downloadlinux-e3cc268fe4a0ad1cbefbc53cee35c80281e609b8.tar.xz
linux-e3cc268fe4a0ad1cbefbc53cee35c80281e609b8.zip
[SCSI] aacraid: expose physical devices for models with newer firmware
The default driver setting is "expose_physicals=0", which means raw physical drives are not exposed to OS. If the user wants to expose connected physical drives, enable "expose_physicals" module parameter. With the new JBOD firmware, physical drives are not available for "expose_physicals>0". In function "aac_expose_phy_device", modified to reset the appropriate bit in the first byte of inquiry data. This fix exposes the connected physical drives. Signed-off-by: Mahesh Rajashekhara <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/aacraid/aachba.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 7e26ebc26661..24b1ba06ece4 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -328,6 +328,16 @@ int aac_get_config_status(struct aac_dev *dev, int commit_flag)
return status;
}
+static void aac_expose_phy_device(struct scsi_cmnd *scsicmd)
+{
+ char inq_data;
+ scsi_sg_copy_to_buffer(scsicmd, &inq_data, sizeof(inq_data));
+ if ((inq_data & 0x20) && (inq_data & 0x1f) == TYPE_DISK) {
+ inq_data &= 0xdf;
+ scsi_sg_copy_from_buffer(scsicmd, &inq_data, sizeof(inq_data));
+ }
+}
+
/**
* aac_get_containers - list containers
* @common: adapter to probe
@@ -2573,6 +2583,11 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
scsi_dma_unmap(scsicmd);
+ /* expose physical device if expose_physicald flag is on */
+ if (scsicmd->cmnd[0] == INQUIRY && !(scsicmd->cmnd[1] & 0x01)
+ && expose_physicals > 0)
+ aac_expose_phy_device(scsicmd);
+
/*
* First check the fib status
*/