static int
srp_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
{
- struct Scsi_Host *shost = sdev->host;
- int max_depth;
-
- max_depth = shost->can_queue;
if (!sdev->tagged_supported)
- max_depth = 1;
- if (qdepth > max_depth)
- qdepth = max_depth;
+ qdepth = 1;
scsi_adjust_queue_depth(sdev, qdepth);
return sdev->queue_depth;
}
if (reason != SCSI_QDEPTH_DEFAULT)
return -EOPNOTSUPP;
- if (queue_depth > TW_Q_LENGTH-2)
- queue_depth = TW_Q_LENGTH-2;
scsi_adjust_queue_depth(sdev, queue_depth);
return queue_depth;
} /* End twa_change_queue_depth() */
if (reason != SCSI_QDEPTH_DEFAULT)
return -EOPNOTSUPP;
- if (queue_depth > TW_Q_LENGTH-2)
- queue_depth = TW_Q_LENGTH-2;
scsi_adjust_queue_depth(sdev, queue_depth);
return queue_depth;
} /* End twl_change_queue_depth() */
if (reason != SCSI_QDEPTH_DEFAULT)
return -EOPNOTSUPP;
- if (queue_depth > TW_Q_LENGTH-2)
- queue_depth = TW_Q_LENGTH-2;
scsi_adjust_queue_depth(sdev, queue_depth);
return queue_depth;
} /* End tw_change_queue_depth() */
if (reason != SCSI_QDEPTH_DEFAULT)
return -ENOTSUPP;
- if (qdepth < 1)
- qdepth = 1;
- else
- if (qdepth > h->nr_cmds)
- qdepth = h->nr_cmds;
scsi_adjust_queue_depth(sdev, qdepth);
return sdev->queue_depth;
}
if (reason != SCSI_QDEPTH_DEFAULT)
return -EOPNOTSUPP;
- if (qdepth > MBOX_MAX_SCSI_CMDS)
- qdepth = MBOX_MAX_SCSI_CMDS;
scsi_adjust_queue_depth(sdev, qdepth);
return sdev->queue_depth;
}
if (reason != SCSI_QDEPTH_DEFAULT)
return -EOPNOTSUPP;
- if (queue_depth > sdev->host->can_queue)
- queue_depth = sdev->host->can_queue;
scsi_adjust_queue_depth(sdev, queue_depth);
return queue_depth;
depth = simple_strtoul(buf, NULL, 0);
- if (depth < 1)
+ if (depth < 1 || depth > sht->can_queue)
return -EINVAL;
retval = sht->change_queue_depth(sdev, depth,
int qdepth,
int reason)
{
- int max_depth;
- struct Scsi_Host *shost = sdev->host;
-
if (reason != SCSI_QDEPTH_DEFAULT)
/*
* We support only changing default.
*/
return -EOPNOTSUPP;
- max_depth = shost->can_queue;
if (!sdev->tagged_supported)
- max_depth = 1;
- if (qdepth > max_depth)
- qdepth = max_depth;
+ qdepth = 1;
scsi_adjust_queue_depth(sdev, qdepth);
if (sdev->inquiry_len > 7)