Skip to content

Commit e3cc268

Browse files
Rajashekhara, MaheshJames Bottomley
authored andcommitted
[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>
1 parent 5ca0559 commit e3cc268

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎drivers/scsi/aacraid/aachba.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,16 @@ int aac_get_config_status(struct aac_dev *dev, int commit_flag)
328328
return status;
329329
}
330330

331+
static void aac_expose_phy_device(struct scsi_cmnd *scsicmd)
332+
{
333+
char inq_data;
334+
scsi_sg_copy_to_buffer(scsicmd, &inq_data, sizeof(inq_data));
335+
if ((inq_data & 0x20) && (inq_data & 0x1f) == TYPE_DISK) {
336+
inq_data &= 0xdf;
337+
scsi_sg_copy_from_buffer(scsicmd, &inq_data, sizeof(inq_data));
338+
}
339+
}
340+
331341
/**
332342
* aac_get_containers - list containers
333343
* @common: adapter to probe
@@ -2573,6 +2583,11 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
25732583

25742584
scsi_dma_unmap(scsicmd);
25752585

2586+
/* expose physical device if expose_physicald flag is on */
2587+
if (scsicmd->cmnd[0] == INQUIRY && !(scsicmd->cmnd[1] & 0x01)
2588+
&& expose_physicals > 0)
2589+
aac_expose_phy_device(scsicmd);
2590+
25762591
/*
25772592
* First check the fib status
25782593
*/

0 commit comments

Comments
 (0)