Commit 3e1398e7 authored by Brian King's avatar Brian King Committed by James Bottomley

[PATCH] ipr: Use change queue type API

Use new change_queue_type API.
Signed-off-by: default avatarBrian King <brking@us.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent fe60e694
...@@ -2686,6 +2686,47 @@ static int ipr_change_queue_depth(struct scsi_device *sdev, int qdepth) ...@@ -2686,6 +2686,47 @@ static int ipr_change_queue_depth(struct scsi_device *sdev, int qdepth)
return qdepth; return qdepth;
} }
/**
* ipr_change_queue_type - Change the device's queue type
* @dsev: scsi device struct
* @tag_type: type of tags to use
*
* Return value:
* actual queue type set
**/
static int ipr_change_queue_type(struct scsi_device *sdev, int tag_type)
{
struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)sdev->host->hostdata;
struct ipr_resource_entry *res;
unsigned long lock_flags = 0;
spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
res = (struct ipr_resource_entry *)sdev->hostdata;
if (res) {
if (ipr_is_gscsi(res) && sdev->tagged_supported) {
/*
* We don't bother quiescing the device here since the
* adapter firmware does it for us.
*/
scsi_set_tag_type(sdev, tag_type);
if (tag_type) {
res->tcq_active = 1;
scsi_activate_tcq(sdev, res->qdepth);
} else {
res->tcq_active = 0;
scsi_deactivate_tcq(sdev, res->qdepth);
}
} else
tag_type = 0;
} else
tag_type = 0;
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
return tag_type;
}
/** /**
* ipr_show_tcq_enable - Show if the device is enabled for tcqing * ipr_show_tcq_enable - Show if the device is enabled for tcqing
* @dev: device struct * @dev: device struct
...@@ -3997,6 +4038,7 @@ static struct scsi_host_template driver_template = { ...@@ -3997,6 +4038,7 @@ static struct scsi_host_template driver_template = {
.slave_configure = ipr_slave_configure, .slave_configure = ipr_slave_configure,
.slave_destroy = ipr_slave_destroy, .slave_destroy = ipr_slave_destroy,
.change_queue_depth = ipr_change_queue_depth, .change_queue_depth = ipr_change_queue_depth,
.change_queue_type = ipr_change_queue_type,
.bios_param = ipr_biosparam, .bios_param = ipr_biosparam,
.can_queue = IPR_MAX_COMMANDS, .can_queue = IPR_MAX_COMMANDS,
.this_id = -1, .this_id = -1,
......
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