aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 20:30:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 20:30:26 -0400
commit8ab68ab420d5fc084b8cdd76a72df72c5e1cdb5d (patch)
tree6aef86d06a5eda99f09ac00c1af4084c2d49d2ac /drivers/ide/ide-tape.c
parentf05c463be51898e745c4aa8245b05e25d73fa975 (diff)
parent7b255436df0543856faaae4704034fe83bc20717 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (35 commits) siimage: coding style cleanup (take 2) ide-cd: clean up cdrom_analyze_sense_data() ide-cd: fix test unsigned var < 0 ide: add TSSTcorp CDDVDW SH-S202H to ivb_list[] piix: add Asus Eee 701 controller to short cable list ARM: always select HAVE_IDE remove the broken ETRAX_IDE driver ide: remove ->dma_prdtable field from ide_hwif_t ide: remove ->dma_vendor{1,3} fields from ide_hwif_t scc_pata: add ->dma_host_set and ->dma_start methods ide: skip "VLB sync" if host uses MMIO ide: add ide_pad_transfer() helper ide: remove ->INW and ->OUTW methods ide: use IDE I/O helpers directly in ide_tf_{load,read}() ns87415: add ->tf_read method scc_pata: add ->tf_{load,read} methods ide-h8300: add ->tf_{load,read} methods ide-cris: add ->tf_{load,read} methods ide: add ->tf_load and ->tf_read methods ide: move ide_tf_{load,read} to ide-iops.c ...
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r--drivers/ide/ide-tape.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 29870c415110..54a43b044608 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -395,13 +395,13 @@ static void idetape_input_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc,
395 if (bh == NULL) { 395 if (bh == NULL) {
396 printk(KERN_ERR "ide-tape: bh == NULL in " 396 printk(KERN_ERR "ide-tape: bh == NULL in "
397 "idetape_input_buffers\n"); 397 "idetape_input_buffers\n");
398 ide_atapi_discard_data(drive, bcount); 398 ide_pad_transfer(drive, 0, bcount);
399 return; 399 return;
400 } 400 }
401 count = min( 401 count = min(
402 (unsigned int)(bh->b_size - atomic_read(&bh->b_count)), 402 (unsigned int)(bh->b_size - atomic_read(&bh->b_count)),
403 bcount); 403 bcount);
404 HWIF(drive)->atapi_input_bytes(drive, bh->b_data + 404 drive->hwif->input_data(drive, NULL, bh->b_data +
405 atomic_read(&bh->b_count), count); 405 atomic_read(&bh->b_count), count);
406 bcount -= count; 406 bcount -= count;
407 atomic_add(count, &bh->b_count); 407 atomic_add(count, &bh->b_count);
@@ -427,7 +427,7 @@ static void idetape_output_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc,
427 return; 427 return;
428 } 428 }
429 count = min((unsigned int)pc->b_count, (unsigned int)bcount); 429 count = min((unsigned int)pc->b_count, (unsigned int)bcount);
430 HWIF(drive)->atapi_output_bytes(drive, pc->b_data, count); 430 drive->hwif->output_data(drive, NULL, pc->b_data, count);
431 bcount -= count; 431 bcount -= count;
432 pc->b_data += count; 432 pc->b_data += count;
433 pc->b_count -= count; 433 pc->b_count -= count;
@@ -871,7 +871,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
871 printk(KERN_ERR "ide-tape: The tape wants to " 871 printk(KERN_ERR "ide-tape: The tape wants to "
872 "send us more data than expected " 872 "send us more data than expected "
873 "- discarding data\n"); 873 "- discarding data\n");
874 ide_atapi_discard_data(drive, bcount); 874 ide_pad_transfer(drive, 0, bcount);
875 ide_set_handler(drive, &idetape_pc_intr, 875 ide_set_handler(drive, &idetape_pc_intr,
876 IDETAPE_WAIT_CMD, NULL); 876 IDETAPE_WAIT_CMD, NULL);
877 return ide_started; 877 return ide_started;
@@ -880,16 +880,16 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
880 "data than expected - allowing transfer\n"); 880 "data than expected - allowing transfer\n");
881 } 881 }
882 iobuf = &idetape_input_buffers; 882 iobuf = &idetape_input_buffers;
883 xferfunc = hwif->atapi_input_bytes; 883 xferfunc = hwif->input_data;
884 } else { 884 } else {
885 iobuf = &idetape_output_buffers; 885 iobuf = &idetape_output_buffers;
886 xferfunc = hwif->atapi_output_bytes; 886 xferfunc = hwif->output_data;
887 } 887 }
888 888
889 if (pc->bh) 889 if (pc->bh)
890 iobuf(drive, pc, bcount); 890 iobuf(drive, pc, bcount);
891 else 891 else
892 xferfunc(drive, pc->cur_pos, bcount); 892 xferfunc(drive, NULL, pc->cur_pos, bcount);
893 893
894 /* Update the current position */ 894 /* Update the current position */
895 pc->xferred += bcount; 895 pc->xferred += bcount;
@@ -979,7 +979,8 @@ static ide_startstop_t idetape_transfer_pc(ide_drive_t *drive)
979 hwif->dma_ops->dma_start(drive); 979 hwif->dma_ops->dma_start(drive);
980#endif 980#endif
981 /* Send the actual packet */ 981 /* Send the actual packet */
982 HWIF(drive)->atapi_output_bytes(drive, pc->c, 12); 982 hwif->output_data(drive, NULL, pc->c, 12);
983
983 return ide_started; 984 return ide_started;
984} 985}
985 986
@@ -1055,7 +1056,7 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive,
1055 IDETAPE_WAIT_CMD, NULL); 1056 IDETAPE_WAIT_CMD, NULL);
1056 return ide_started; 1057 return ide_started;
1057 } else { 1058 } else {
1058 hwif->OUTB(WIN_PACKETCMD, hwif->io_ports.command_addr); 1059 ide_execute_pkt_cmd(drive);
1059 return idetape_transfer_pc(drive); 1060 return idetape_transfer_pc(drive);
1060 } 1061 }
1061} 1062}