aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-atapi.c12
-rw-r--r--drivers/ide/ide-floppy.c4
-rw-r--r--drivers/ide/ide-floppy_ioctl.c8
-rw-r--r--drivers/ide/ide-tape.c26
4 files changed, 25 insertions, 25 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 1022e421abd8..0d4da2c1adc1 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -84,7 +84,7 @@ EXPORT_SYMBOL_GPL(ide_init_pc);
84 * and wait for it to be serviced. 84 * and wait for it to be serviced.
85 */ 85 */
86int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk, 86int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk,
87 struct ide_atapi_pc *pc) 87 struct ide_atapi_pc *pc, unsigned int bufflen)
88{ 88{
89 struct request *rq; 89 struct request *rq;
90 int error; 90 int error;
@@ -93,8 +93,8 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk,
93 rq->cmd_type = REQ_TYPE_SPECIAL; 93 rq->cmd_type = REQ_TYPE_SPECIAL;
94 rq->special = (char *)pc; 94 rq->special = (char *)pc;
95 95
96 if (pc->req_xfer) { 96 if (bufflen) {
97 error = blk_rq_map_kern(drive->queue, rq, pc->buf, pc->req_xfer, 97 error = blk_rq_map_kern(drive->queue, rq, pc->buf, bufflen,
98 GFP_NOIO); 98 GFP_NOIO);
99 if (error) 99 if (error)
100 goto put_req; 100 goto put_req;
@@ -117,7 +117,7 @@ int ide_do_test_unit_ready(ide_drive_t *drive, struct gendisk *disk)
117 ide_init_pc(&pc); 117 ide_init_pc(&pc);
118 pc.c[0] = TEST_UNIT_READY; 118 pc.c[0] = TEST_UNIT_READY;
119 119
120 return ide_queue_pc_tail(drive, disk, &pc); 120 return ide_queue_pc_tail(drive, disk, &pc, 0);
121} 121}
122EXPORT_SYMBOL_GPL(ide_do_test_unit_ready); 122EXPORT_SYMBOL_GPL(ide_do_test_unit_ready);
123 123
@@ -132,7 +132,7 @@ int ide_do_start_stop(ide_drive_t *drive, struct gendisk *disk, int start)
132 if (drive->media == ide_tape) 132 if (drive->media == ide_tape)
133 pc.flags |= PC_FLAG_WAIT_FOR_DSC; 133 pc.flags |= PC_FLAG_WAIT_FOR_DSC;
134 134
135 return ide_queue_pc_tail(drive, disk, &pc); 135 return ide_queue_pc_tail(drive, disk, &pc, 0);
136} 136}
137EXPORT_SYMBOL_GPL(ide_do_start_stop); 137EXPORT_SYMBOL_GPL(ide_do_start_stop);
138 138
@@ -147,7 +147,7 @@ int ide_set_media_lock(ide_drive_t *drive, struct gendisk *disk, int on)
147 pc.c[0] = ALLOW_MEDIUM_REMOVAL; 147 pc.c[0] = ALLOW_MEDIUM_REMOVAL;
148 pc.c[4] = on; 148 pc.c[4] = on;
149 149
150 return ide_queue_pc_tail(drive, disk, &pc); 150 return ide_queue_pc_tail(drive, disk, &pc, 0);
151} 151}
152EXPORT_SYMBOL_GPL(ide_set_media_lock); 152EXPORT_SYMBOL_GPL(ide_set_media_lock);
153 153
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index a1c55985d4ae..5df00d4ab8da 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -318,7 +318,7 @@ static int ide_floppy_get_flexible_disk_page(ide_drive_t *drive,
318 318
319 ide_floppy_create_mode_sense_cmd(pc, IDEFLOPPY_FLEXIBLE_DISK_PAGE); 319 ide_floppy_create_mode_sense_cmd(pc, IDEFLOPPY_FLEXIBLE_DISK_PAGE);
320 320
321 if (ide_queue_pc_tail(drive, disk, pc)) { 321 if (ide_queue_pc_tail(drive, disk, pc, pc->req_xfer)) {
322 printk(KERN_ERR PFX "Can't get flexible disk page params\n"); 322 printk(KERN_ERR PFX "Can't get flexible disk page params\n");
323 return 1; 323 return 1;
324 } 324 }
@@ -390,7 +390,7 @@ static int ide_floppy_get_capacity(ide_drive_t *drive)
390 pc.buf = &pc_buf[0]; 390 pc.buf = &pc_buf[0];
391 pc.buf_size = sizeof(pc_buf); 391 pc.buf_size = sizeof(pc_buf);
392 392
393 if (ide_queue_pc_tail(drive, disk, &pc)) { 393 if (ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer)) {
394 printk(KERN_ERR PFX "Can't get floppy parameters\n"); 394 printk(KERN_ERR PFX "Can't get floppy parameters\n");
395 return 1; 395 return 1;
396 } 396 }
diff --git a/drivers/ide/ide-floppy_ioctl.c b/drivers/ide/ide-floppy_ioctl.c
index cd8a42027ede..75f1d50276a4 100644
--- a/drivers/ide/ide-floppy_ioctl.c
+++ b/drivers/ide/ide-floppy_ioctl.c
@@ -50,7 +50,7 @@ static int ide_floppy_get_format_capacities(ide_drive_t *drive,
50 pc->buf = &pc_buf[0]; 50 pc->buf = &pc_buf[0];
51 pc->buf_size = sizeof(pc_buf); 51 pc->buf_size = sizeof(pc_buf);
52 52
53 if (ide_queue_pc_tail(drive, floppy->disk, pc)) { 53 if (ide_queue_pc_tail(drive, floppy->disk, pc, pc->req_xfer)) {
54 printk(KERN_ERR "ide-floppy: Can't get floppy parameters\n"); 54 printk(KERN_ERR "ide-floppy: Can't get floppy parameters\n");
55 return -EIO; 55 return -EIO;
56 } 56 }
@@ -124,7 +124,7 @@ static int ide_floppy_get_sfrp_bit(ide_drive_t *drive, struct ide_atapi_pc *pc)
124 ide_floppy_create_mode_sense_cmd(pc, IDEFLOPPY_CAPABILITIES_PAGE); 124 ide_floppy_create_mode_sense_cmd(pc, IDEFLOPPY_CAPABILITIES_PAGE);
125 pc->flags |= PC_FLAG_SUPPRESS_ERROR; 125 pc->flags |= PC_FLAG_SUPPRESS_ERROR;
126 126
127 if (ide_queue_pc_tail(drive, floppy->disk, pc)) 127 if (ide_queue_pc_tail(drive, floppy->disk, pc, pc->req_xfer))
128 return 1; 128 return 1;
129 129
130 if (pc->buf[8 + 2] & 0x40) 130 if (pc->buf[8 + 2] & 0x40)
@@ -172,7 +172,7 @@ static int ide_floppy_format_unit(ide_drive_t *drive, struct ide_atapi_pc *pc,
172 ide_floppy_get_sfrp_bit(drive, pc); 172 ide_floppy_get_sfrp_bit(drive, pc);
173 ide_floppy_create_format_unit_cmd(pc, blocks, length, flags); 173 ide_floppy_create_format_unit_cmd(pc, blocks, length, flags);
174 174
175 if (ide_queue_pc_tail(drive, floppy->disk, pc)) 175 if (ide_queue_pc_tail(drive, floppy->disk, pc, pc->req_xfer))
176 err = -EIO; 176 err = -EIO;
177 177
178out: 178out:
@@ -200,7 +200,7 @@ static int ide_floppy_get_format_progress(ide_drive_t *drive,
200 200
201 if (drive->atapi_flags & IDE_AFLAG_SRFP) { 201 if (drive->atapi_flags & IDE_AFLAG_SRFP) {
202 ide_create_request_sense_cmd(drive, pc); 202 ide_create_request_sense_cmd(drive, pc);
203 if (ide_queue_pc_tail(drive, floppy->disk, pc)) 203 if (ide_queue_pc_tail(drive, floppy->disk, pc, pc->req_xfer))
204 return -EIO; 204 return -EIO;
205 205
206 if (floppy->sense_key == 2 && 206 if (floppy->sense_key == 2 &&
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index c93370997972..f09a263b72f2 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -770,7 +770,7 @@ static int idetape_flush_tape_buffers(ide_drive_t *drive)
770 int rc; 770 int rc;
771 771
772 idetape_create_write_filemark_cmd(drive, &pc, 0); 772 idetape_create_write_filemark_cmd(drive, &pc, 0);
773 rc = ide_queue_pc_tail(drive, tape->disk, &pc); 773 rc = ide_queue_pc_tail(drive, tape->disk, &pc, pc.req_xfer);
774 if (rc) 774 if (rc)
775 return rc; 775 return rc;
776 idetape_wait_ready(drive, 60 * 5 * HZ); 776 idetape_wait_ready(drive, 60 * 5 * HZ);
@@ -793,7 +793,7 @@ static int idetape_read_position(ide_drive_t *drive)
793 debug_log(DBG_PROCS, "Enter %s\n", __func__); 793 debug_log(DBG_PROCS, "Enter %s\n", __func__);
794 794
795 idetape_create_read_position_cmd(&pc); 795 idetape_create_read_position_cmd(&pc);
796 if (ide_queue_pc_tail(drive, tape->disk, &pc)) 796 if (ide_queue_pc_tail(drive, tape->disk, &pc, pc.req_xfer))
797 return -1; 797 return -1;
798 position = tape->first_frame; 798 position = tape->first_frame;
799 return position; 799 return position;
@@ -846,12 +846,12 @@ static int idetape_position_tape(ide_drive_t *drive, unsigned int block,
846 __ide_tape_discard_merge_buffer(drive); 846 __ide_tape_discard_merge_buffer(drive);
847 idetape_wait_ready(drive, 60 * 5 * HZ); 847 idetape_wait_ready(drive, 60 * 5 * HZ);
848 idetape_create_locate_cmd(drive, &pc, block, partition, skip); 848 idetape_create_locate_cmd(drive, &pc, block, partition, skip);
849 retval = ide_queue_pc_tail(drive, disk, &pc); 849 retval = ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
850 if (retval) 850 if (retval)
851 return (retval); 851 return (retval);
852 852
853 idetape_create_read_position_cmd(&pc); 853 idetape_create_read_position_cmd(&pc);
854 return ide_queue_pc_tail(drive, disk, &pc); 854 return ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
855} 855}
856 856
857static void ide_tape_discard_merge_buffer(ide_drive_t *drive, 857static void ide_tape_discard_merge_buffer(ide_drive_t *drive,
@@ -1047,12 +1047,12 @@ static int idetape_rewind_tape(ide_drive_t *drive)
1047 debug_log(DBG_SENSE, "Enter %s\n", __func__); 1047 debug_log(DBG_SENSE, "Enter %s\n", __func__);
1048 1048
1049 idetape_create_rewind_cmd(drive, &pc); 1049 idetape_create_rewind_cmd(drive, &pc);
1050 retval = ide_queue_pc_tail(drive, disk, &pc); 1050 retval = ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
1051 if (retval) 1051 if (retval)
1052 return retval; 1052 return retval;
1053 1053
1054 idetape_create_read_position_cmd(&pc); 1054 idetape_create_read_position_cmd(&pc);
1055 retval = ide_queue_pc_tail(drive, disk, &pc); 1055 retval = ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
1056 if (retval) 1056 if (retval)
1057 return retval; 1057 return retval;
1058 return 0; 1058 return 0;
@@ -1120,7 +1120,7 @@ static int idetape_space_over_filemarks(ide_drive_t *drive, short mt_op,
1120 case MTBSF: 1120 case MTBSF:
1121 idetape_create_space_cmd(&pc, mt_count - count, 1121 idetape_create_space_cmd(&pc, mt_count - count,
1122 IDETAPE_SPACE_OVER_FILEMARK); 1122 IDETAPE_SPACE_OVER_FILEMARK);
1123 return ide_queue_pc_tail(drive, disk, &pc); 1123 return ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
1124 case MTFSFM: 1124 case MTFSFM:
1125 case MTBSFM: 1125 case MTBSFM:
1126 if (!sprev) 1126 if (!sprev)
@@ -1259,7 +1259,7 @@ static int idetape_write_filemark(ide_drive_t *drive)
1259 1259
1260 /* Write a filemark */ 1260 /* Write a filemark */
1261 idetape_create_write_filemark_cmd(drive, &pc, 1); 1261 idetape_create_write_filemark_cmd(drive, &pc, 1);
1262 if (ide_queue_pc_tail(drive, tape->disk, &pc)) { 1262 if (ide_queue_pc_tail(drive, tape->disk, &pc, pc.req_xfer)) {
1263 printk(KERN_ERR "ide-tape: Couldn't write a filemark\n"); 1263 printk(KERN_ERR "ide-tape: Couldn't write a filemark\n");
1264 return -EIO; 1264 return -EIO;
1265 } 1265 }
@@ -1344,11 +1344,11 @@ static int idetape_mtioctop(ide_drive_t *drive, short mt_op, int mt_count)
1344 IDETAPE_LU_RETENSION_MASK | IDETAPE_LU_LOAD_MASK); 1344 IDETAPE_LU_RETENSION_MASK | IDETAPE_LU_LOAD_MASK);
1345 case MTEOM: 1345 case MTEOM:
1346 idetape_create_space_cmd(&pc, 0, IDETAPE_SPACE_TO_EOD); 1346 idetape_create_space_cmd(&pc, 0, IDETAPE_SPACE_TO_EOD);
1347 return ide_queue_pc_tail(drive, disk, &pc); 1347 return ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
1348 case MTERASE: 1348 case MTERASE:
1349 (void)idetape_rewind_tape(drive); 1349 (void)idetape_rewind_tape(drive);
1350 idetape_create_erase_cmd(&pc); 1350 idetape_create_erase_cmd(&pc);
1351 return ide_queue_pc_tail(drive, disk, &pc); 1351 return ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer);
1352 case MTSETBLK: 1352 case MTSETBLK:
1353 if (mt_count) { 1353 if (mt_count) {
1354 if (mt_count < tape->blk_size || 1354 if (mt_count < tape->blk_size ||
@@ -1457,7 +1457,7 @@ static void ide_tape_get_bsize_from_bdesc(ide_drive_t *drive)
1457 struct ide_atapi_pc pc; 1457 struct ide_atapi_pc pc;
1458 1458
1459 idetape_create_mode_sense_cmd(&pc, IDETAPE_BLOCK_DESCRIPTOR); 1459 idetape_create_mode_sense_cmd(&pc, IDETAPE_BLOCK_DESCRIPTOR);
1460 if (ide_queue_pc_tail(drive, tape->disk, &pc)) { 1460 if (ide_queue_pc_tail(drive, tape->disk, &pc, pc.req_xfer)) {
1461 printk(KERN_ERR "ide-tape: Can't get block descriptor\n"); 1461 printk(KERN_ERR "ide-tape: Can't get block descriptor\n");
1462 if (tape->blk_size == 0) { 1462 if (tape->blk_size == 0) {
1463 printk(KERN_WARNING "ide-tape: Cannot deal with zero " 1463 printk(KERN_WARNING "ide-tape: Cannot deal with zero "
@@ -1613,7 +1613,7 @@ static void idetape_get_inquiry_results(ide_drive_t *drive)
1613 pc.buf = &pc_buf[0]; 1613 pc.buf = &pc_buf[0];
1614 pc.buf_size = sizeof(pc_buf); 1614 pc.buf_size = sizeof(pc_buf);
1615 1615
1616 if (ide_queue_pc_tail(drive, tape->disk, &pc)) { 1616 if (ide_queue_pc_tail(drive, tape->disk, &pc, pc.req_xfer)) {
1617 printk(KERN_ERR "ide-tape: %s: can't get INQUIRY results\n", 1617 printk(KERN_ERR "ide-tape: %s: can't get INQUIRY results\n",
1618 tape->name); 1618 tape->name);
1619 return; 1619 return;
@@ -1642,7 +1642,7 @@ static void idetape_get_mode_sense_results(ide_drive_t *drive)
1642 u8 speed, max_speed; 1642 u8 speed, max_speed;
1643 1643
1644 idetape_create_mode_sense_cmd(&pc, IDETAPE_CAPABILITIES_PAGE); 1644 idetape_create_mode_sense_cmd(&pc, IDETAPE_CAPABILITIES_PAGE);
1645 if (ide_queue_pc_tail(drive, tape->disk, &pc)) { 1645 if (ide_queue_pc_tail(drive, tape->disk, &pc, pc.req_xfer)) {
1646 printk(KERN_ERR "ide-tape: Can't get tape parameters - assuming" 1646 printk(KERN_ERR "ide-tape: Can't get tape parameters - assuming"
1647 " some default values\n"); 1647 " some default values\n");
1648 tape->blk_size = 512; 1648 tape->blk_size = 512;