diff options
author | Brian King <brking@us.ibm.com> | 2006-03-29 10:37:22 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-04-13 11:13:28 -0400 |
commit | e4fbf44ed0618acce4a06010ed9fa9c02e06e36a (patch) | |
tree | fea3359ad2e1281781a6cefb75c270a0a9ed0bd7 /drivers | |
parent | 1121b794a384bc317fe36e967b82308b0e2c3852 (diff) |
[SCSI] ipr: Fixup device type check
Fixup a check used by the ipr driver to determine if a given
device is a SCSI disk. Due to the addition of support for
attaching SATA devices, this check needs to be more robust.
Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/ipr.c | 4 | ||||
-rw-r--r-- | drivers/scsi/ipr.h | 16 |
2 files changed, 18 insertions, 2 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 154b78c5baa8..20b6929cb4fe 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -3214,7 +3214,7 @@ static int ipr_slave_configure(struct scsi_device *sdev) | |||
3214 | sdev->timeout = IPR_VSET_RW_TIMEOUT; | 3214 | sdev->timeout = IPR_VSET_RW_TIMEOUT; |
3215 | blk_queue_max_sectors(sdev->request_queue, IPR_VSET_MAX_SECTORS); | 3215 | blk_queue_max_sectors(sdev->request_queue, IPR_VSET_MAX_SECTORS); |
3216 | } | 3216 | } |
3217 | if (IPR_IS_DASD_DEVICE(res->cfgte.std_inq_data)) | 3217 | if (ipr_is_vset_device(res) || ipr_is_scsi_disk(res)) |
3218 | sdev->allow_restart = 1; | 3218 | sdev->allow_restart = 1; |
3219 | scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun); | 3219 | scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun); |
3220 | } | 3220 | } |
@@ -4540,7 +4540,7 @@ static int ipr_set_supported_devs(struct ipr_cmnd *ipr_cmd) | |||
4540 | ipr_cmd->job_step = ipr_ioa_reset_done; | 4540 | ipr_cmd->job_step = ipr_ioa_reset_done; |
4541 | 4541 | ||
4542 | list_for_each_entry_continue(res, &ioa_cfg->used_res_q, queue) { | 4542 | list_for_each_entry_continue(res, &ioa_cfg->used_res_q, queue) { |
4543 | if (!IPR_IS_DASD_DEVICE(res->cfgte.std_inq_data)) | 4543 | if (!ipr_is_scsi_disk(res)) |
4544 | continue; | 4544 | continue; |
4545 | 4545 | ||
4546 | ipr_cmd->u.res = res; | 4546 | ipr_cmd->u.res = res; |
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index ee9169d817b1..c08bd2f238e3 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h | |||
@@ -1305,6 +1305,22 @@ static inline int ipr_is_gscsi(struct ipr_resource_entry *res) | |||
1305 | } | 1305 | } |
1306 | 1306 | ||
1307 | /** | 1307 | /** |
1308 | * ipr_is_scsi_disk - Determine if a resource is a SCSI disk | ||
1309 | * @res: resource entry struct | ||
1310 | * | ||
1311 | * Return value: | ||
1312 | * 1 if SCSI disk / 0 if not SCSI disk | ||
1313 | **/ | ||
1314 | static inline int ipr_is_scsi_disk(struct ipr_resource_entry *res) | ||
1315 | { | ||
1316 | if (ipr_is_af_dasd_device(res) || | ||
1317 | (ipr_is_gscsi(res) && IPR_IS_DASD_DEVICE(res->cfgte.std_inq_data))) | ||
1318 | return 1; | ||
1319 | else | ||
1320 | return 0; | ||
1321 | } | ||
1322 | |||
1323 | /** | ||
1308 | * ipr_is_naca_model - Determine if a resource is using NACA queueing model | 1324 | * ipr_is_naca_model - Determine if a resource is using NACA queueing model |
1309 | * @res: resource entry struct | 1325 | * @res: resource entry struct |
1310 | * | 1326 | * |