Commit 742d25b8 authored by Brian King's avatar Brian King Committed by James Bottomley

[SCSI] ibmvscsi: Changeable queue depth

Adds support for a changeable queue depth to ibmvscsi.
Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent d5587d5d
...@@ -1375,6 +1375,23 @@ static int ibmvscsi_slave_configure(struct scsi_device *sdev) ...@@ -1375,6 +1375,23 @@ static int ibmvscsi_slave_configure(struct scsi_device *sdev)
return 0; return 0;
} }
/**
* ibmvscsi_change_queue_depth - Change the device's queue depth
* @sdev: scsi device struct
* @qdepth: depth to set
*
* Return value:
* actual depth set
**/
static int ibmvscsi_change_queue_depth(struct scsi_device *sdev, int qdepth)
{
if (qdepth > IBMVSCSI_MAX_CMDS_PER_LUN)
qdepth = IBMVSCSI_MAX_CMDS_PER_LUN;
scsi_adjust_queue_depth(sdev, 0, qdepth);
return sdev->queue_depth;
}
/* ------------------------------------------------------------ /* ------------------------------------------------------------
* sysfs attributes * sysfs attributes
*/ */
...@@ -1521,6 +1538,7 @@ static struct scsi_host_template driver_template = { ...@@ -1521,6 +1538,7 @@ static struct scsi_host_template driver_template = {
.eh_abort_handler = ibmvscsi_eh_abort_handler, .eh_abort_handler = ibmvscsi_eh_abort_handler,
.eh_device_reset_handler = ibmvscsi_eh_device_reset_handler, .eh_device_reset_handler = ibmvscsi_eh_device_reset_handler,
.slave_configure = ibmvscsi_slave_configure, .slave_configure = ibmvscsi_slave_configure,
.change_queue_depth = ibmvscsi_change_queue_depth,
.cmd_per_lun = 16, .cmd_per_lun = 16,
.can_queue = IBMVSCSI_MAX_REQUESTS_DEFAULT, .can_queue = IBMVSCSI_MAX_REQUESTS_DEFAULT,
.this_id = -1, .this_id = -1,
......
...@@ -45,6 +45,7 @@ struct Scsi_Host; ...@@ -45,6 +45,7 @@ struct Scsi_Host;
#define MAX_INDIRECT_BUFS 10 #define MAX_INDIRECT_BUFS 10
#define IBMVSCSI_MAX_REQUESTS_DEFAULT 100 #define IBMVSCSI_MAX_REQUESTS_DEFAULT 100
#define IBMVSCSI_MAX_CMDS_PER_LUN 64
/* ------------------------------------------------------------ /* ------------------------------------------------------------
* Data Structures * Data Structures
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment