* and wait for it to be serviced.
*/
int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk,
- struct ide_atapi_pc *pc)
+ struct ide_atapi_pc *pc, unsigned int bufflen)
{
struct request *rq;
int error;
rq->cmd_type = REQ_TYPE_SPECIAL;
rq->special = (char *)pc;
- if (pc->req_xfer) {
- error = blk_rq_map_kern(drive->queue, rq, pc->buf, pc->req_xfer,
+ if (bufflen) {
+ error = blk_rq_map_kern(drive->queue, rq, pc->buf, bufflen,
GFP_NOIO);
if (error)
goto put_req;
ide_init_pc(&pc);
pc.c[0] = TEST_UNIT_READY;
- return ide_queue_pc_tail(drive, disk, &pc);
+ return ide_queue_pc_tail(drive, disk, &pc, 0);
}
EXPORT_SYMBOL_GPL(ide_do_test_unit_ready);
if (drive->media == ide_tape)
pc.flags |= PC_FLAG_WAIT_FOR_DSC;
- return ide_queue_pc_tail(drive, disk, &pc);
+ return ide_queue_pc_tail(drive, disk, &pc, 0);
}
EXPORT_SYMBOL_GPL(ide_do_start_stop);
pc.c[0] = ALLOW_MEDIUM_REMOVAL;
pc.c[4] = on;
- return ide_queue_pc_tail(drive, disk, &pc);
+ return ide_queue_pc_tail(drive, disk, &pc, 0);
}
EXPORT_SYMBOL_GPL(ide_set_media_lock);
pc->buf = &pc_buf[0];
pc->buf_size = sizeof(pc_buf);
- if (ide_queue_pc_tail(drive, floppy->disk, pc)) {
+ if (ide_queue_pc_tail(drive, floppy->disk, pc, pc->req_xfer)) {
printk(KERN_ERR "ide-floppy: Can't get floppy parameters\n");
return -EIO;
}
ide_floppy_create_mode_sense_cmd(pc, IDEFLOPPY_CAPABILITIES_PAGE);
pc->flags |= PC_FLAG_SUPPRESS_ERROR;
- if (ide_queue_pc_tail(drive, floppy->disk, pc))
+ if (ide_queue_pc_tail(drive, floppy->disk, pc, pc->req_xfer))
return 1;
if (pc->buf[8 + 2] & 0x40)
ide_floppy_get_sfrp_bit(drive, pc);
ide_floppy_create_format_unit_cmd(pc, blocks, length, flags);
- if (ide_queue_pc_tail(drive, floppy->disk, pc))
+ if (ide_queue_pc_tail(drive, floppy->disk, pc, pc->req_xfer))
err = -EIO;
out:
if (drive->atapi_flags & IDE_AFLAG_SRFP) {
ide_create_request_sense_cmd(drive, pc);
- if (ide_queue_pc_tail(drive, floppy->disk, pc))
+ if (ide_queue_pc_tail(drive, floppy->disk, pc, pc->req_xfer))
return -EIO;
if (floppy->sense_key == 2 &&
int rc;
idetape_create_write_filemark_cmd(drive, &pc, 0);
- rc = ide_queue_pc_tail(drive, tape->disk, &pc);
+ rc = ide_queue_pc_tail(drive, tape->disk, &pc, pc.req_xfer);
if (rc)
return rc;
idetape_wait_ready(drive, 60 * 5 * HZ);
debug_log(DBG_PROCS, "Enter %s\n", __func__);
idetape_create_read_position_cmd(&pc);
- if (ide_queue_pc_tail(drive, tape->disk, &pc))
+ if (ide_queue_pc_tail(drive, tape->disk, &pc, pc.req_xfer))
return -1;
position = tape->first_frame;
return position;
__ide_tape_discard_merge_buffer(drive);
idetape_wait_ready(drive, 60 * 5 * HZ);
idetape_create_locate_cmd(drive, &pc, block, partition, skip);
- retval = ide_queue_pc_tail(drive, disk, &pc);
+ retval = ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
if (retval)
return (retval);
idetape_create_read_position_cmd(&pc);
- return ide_queue_pc_tail(drive, disk, &pc);
+ return ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
}
static void ide_tape_discard_merge_buffer(ide_drive_t *drive,
debug_log(DBG_SENSE, "Enter %s\n", __func__);
idetape_create_rewind_cmd(drive, &pc);
- retval = ide_queue_pc_tail(drive, disk, &pc);
+ retval = ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
if (retval)
return retval;
idetape_create_read_position_cmd(&pc);
- retval = ide_queue_pc_tail(drive, disk, &pc);
+ retval = ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
if (retval)
return retval;
return 0;
case MTBSF:
idetape_create_space_cmd(&pc, mt_count - count,
IDETAPE_SPACE_OVER_FILEMARK);
- return ide_queue_pc_tail(drive, disk, &pc);
+ return ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
case MTFSFM:
case MTBSFM:
if (!sprev)
/* Write a filemark */
idetape_create_write_filemark_cmd(drive, &pc, 1);
- if (ide_queue_pc_tail(drive, tape->disk, &pc)) {
+ if (ide_queue_pc_tail(drive, tape->disk, &pc, pc.req_xfer)) {
printk(KERN_ERR "ide-tape: Couldn't write a filemark\n");
return -EIO;
}
IDETAPE_LU_RETENSION_MASK | IDETAPE_LU_LOAD_MASK);
case MTEOM:
idetape_create_space_cmd(&pc, 0, IDETAPE_SPACE_TO_EOD);
- return ide_queue_pc_tail(drive, disk, &pc);
+ return ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
case MTERASE:
(void)idetape_rewind_tape(drive);
idetape_create_erase_cmd(&pc);
- return ide_queue_pc_tail(drive, disk, &pc);
+ return ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
case MTSETBLK:
if (mt_count) {
if (mt_count < tape->blk_size ||
struct ide_atapi_pc pc;
idetape_create_mode_sense_cmd(&pc, IDETAPE_BLOCK_DESCRIPTOR);
- if (ide_queue_pc_tail(drive, tape->disk, &pc)) {
+ if (ide_queue_pc_tail(drive, tape->disk, &pc, pc.req_xfer)) {
printk(KERN_ERR "ide-tape: Can't get block descriptor\n");
if (tape->blk_size == 0) {
printk(KERN_WARNING "ide-tape: Cannot deal with zero "
pc.buf = &pc_buf[0];
pc.buf_size = sizeof(pc_buf);
- if (ide_queue_pc_tail(drive, tape->disk, &pc)) {
+ if (ide_queue_pc_tail(drive, tape->disk, &pc, pc.req_xfer)) {
printk(KERN_ERR "ide-tape: %s: can't get INQUIRY results\n",
tape->name);
return;
u8 speed, max_speed;
idetape_create_mode_sense_cmd(&pc, IDETAPE_CAPABILITIES_PAGE);
- if (ide_queue_pc_tail(drive, tape->disk, &pc)) {
+ if (ide_queue_pc_tail(drive, tape->disk, &pc, pc.req_xfer)) {
printk(KERN_ERR "ide-tape: Can't get tape parameters - assuming"
" some default values\n");
tape->blk_size = 512;