diff options
author | Christoph Hellwig <hch@lst.de> | 2014-10-02 08:39:55 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-12 05:19:39 -0500 |
commit | a62182f338b39a22035531c6afc0a8d2928b1df2 (patch) | |
tree | 57ca6cea82a09d2655daf5c161024c5015373646 /drivers/scsi/lpfc/lpfc_scsi.c | |
parent | 1d5203284d8acbdfdf9b478d434450b34f338f28 (diff) |
scsi: provide a generic change_queue_type method
Most drivers use exactly the same implementation, so provide it as a
library function.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_scsi.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index b99399fe2548..2896e52ac6cd 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -345,26 +345,6 @@ lpfc_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason) | |||
345 | } | 345 | } |
346 | 346 | ||
347 | /** | 347 | /** |
348 | * lpfc_change_queue_type() - Change a device's scsi tag queuing type | ||
349 | * @sdev: Pointer the scsi device whose queue depth is to change | ||
350 | * @tag_type: Identifier for queue tag type | ||
351 | */ | ||
352 | static int | ||
353 | lpfc_change_queue_type(struct scsi_device *sdev, int tag_type) | ||
354 | { | ||
355 | if (sdev->tagged_supported) { | ||
356 | scsi_set_tag_type(sdev, tag_type); | ||
357 | if (tag_type) | ||
358 | scsi_activate_tcq(sdev, sdev->queue_depth); | ||
359 | else | ||
360 | scsi_deactivate_tcq(sdev, sdev->queue_depth); | ||
361 | } else | ||
362 | tag_type = 0; | ||
363 | |||
364 | return tag_type; | ||
365 | } | ||
366 | |||
367 | /** | ||
368 | * lpfc_rampdown_queue_depth - Post RAMP_DOWN_QUEUE event to worker thread | 348 | * lpfc_rampdown_queue_depth - Post RAMP_DOWN_QUEUE event to worker thread |
369 | * @phba: The Hba for which this call is being executed. | 349 | * @phba: The Hba for which this call is being executed. |
370 | * | 350 | * |
@@ -6019,7 +5999,7 @@ struct scsi_host_template lpfc_template = { | |||
6019 | .max_sectors = 0xFFFF, | 5999 | .max_sectors = 0xFFFF, |
6020 | .vendor_id = LPFC_NL_VENDOR_ID, | 6000 | .vendor_id = LPFC_NL_VENDOR_ID, |
6021 | .change_queue_depth = lpfc_change_queue_depth, | 6001 | .change_queue_depth = lpfc_change_queue_depth, |
6022 | .change_queue_type = lpfc_change_queue_type, | 6002 | .change_queue_type = scsi_change_queue_type, |
6023 | }; | 6003 | }; |
6024 | 6004 | ||
6025 | struct scsi_host_template lpfc_vport_template = { | 6005 | struct scsi_host_template lpfc_vport_template = { |
@@ -6042,5 +6022,5 @@ struct scsi_host_template lpfc_vport_template = { | |||
6042 | .shost_attrs = lpfc_vport_attrs, | 6022 | .shost_attrs = lpfc_vport_attrs, |
6043 | .max_sectors = 0xFFFF, | 6023 | .max_sectors = 0xFFFF, |
6044 | .change_queue_depth = lpfc_change_queue_depth, | 6024 | .change_queue_depth = lpfc_change_queue_depth, |
6045 | .change_queue_type = lpfc_change_queue_type, | 6025 | .change_queue_type = scsi_change_queue_type, |
6046 | }; | 6026 | }; |