diff options
author | adam radford <aradford@gmail.com> | 2011-07-26 18:42:52 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-07-27 07:44:47 -0400 |
commit | 4bcde509a8fe664f2e688647d8427b6aedaa89b7 (patch) | |
tree | f4c7b0a8fade19647bc1d9f3799678d861d88b90 /drivers/scsi/megaraid | |
parent | db21b6f41bf5a9ce335ced4b5feaa0ad04327003 (diff) |
[SCSI] megaraid_sas: Add .change_queue_depth support
Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_base.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 2d8cdce7b2f5..c71922040539 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c | |||
@@ -54,6 +54,7 @@ | |||
54 | #include <scsi/scsi_cmnd.h> | 54 | #include <scsi/scsi_cmnd.h> |
55 | #include <scsi/scsi_device.h> | 55 | #include <scsi/scsi_device.h> |
56 | #include <scsi/scsi_host.h> | 56 | #include <scsi/scsi_host.h> |
57 | #include <scsi/scsi_tcq.h> | ||
57 | #include "megaraid_sas_fusion.h" | 58 | #include "megaraid_sas_fusion.h" |
58 | #include "megaraid_sas.h" | 59 | #include "megaraid_sas.h" |
59 | 60 | ||
@@ -2057,6 +2058,20 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd) | |||
2057 | } | 2058 | } |
2058 | } | 2059 | } |
2059 | 2060 | ||
2061 | static int megasas_change_queue_depth(struct scsi_device *sdev, | ||
2062 | int queue_depth, int reason) | ||
2063 | { | ||
2064 | if (reason != SCSI_QDEPTH_DEFAULT) | ||
2065 | return -EOPNOTSUPP; | ||
2066 | |||
2067 | if (queue_depth > sdev->host->can_queue) | ||
2068 | queue_depth = sdev->host->can_queue; | ||
2069 | scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), | ||
2070 | queue_depth); | ||
2071 | |||
2072 | return queue_depth; | ||
2073 | } | ||
2074 | |||
2060 | /* | 2075 | /* |
2061 | * Scsi host template for megaraid_sas driver | 2076 | * Scsi host template for megaraid_sas driver |
2062 | */ | 2077 | */ |
@@ -2074,6 +2089,7 @@ static struct scsi_host_template megasas_template = { | |||
2074 | .eh_timed_out = megasas_reset_timer, | 2089 | .eh_timed_out = megasas_reset_timer, |
2075 | .bios_param = megasas_bios_param, | 2090 | .bios_param = megasas_bios_param, |
2076 | .use_clustering = ENABLE_CLUSTERING, | 2091 | .use_clustering = ENABLE_CLUSTERING, |
2092 | .change_queue_depth = megasas_change_queue_depth, | ||
2077 | }; | 2093 | }; |
2078 | 2094 | ||
2079 | /** | 2095 | /** |