diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 20:30:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 20:30:26 -0400 |
commit | 8ab68ab420d5fc084b8cdd76a72df72c5e1cdb5d (patch) | |
tree | 6aef86d06a5eda99f09ac00c1af4084c2d49d2ac /drivers/ide/ide-floppy.c | |
parent | f05c463be51898e745c4aa8245b05e25d73fa975 (diff) | |
parent | 7b255436df0543856faaae4704034fe83bc20717 (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-floppy.c')
-rw-r--r-- | drivers/ide/ide-floppy.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 489079b8ed03..f05fbc2bd7a8 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -231,6 +231,7 @@ static int idefloppy_end_request(ide_drive_t *drive, int uptodate, int nsecs) | |||
231 | static void ide_floppy_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | 231 | static void ide_floppy_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, |
232 | unsigned int bcount, int direction) | 232 | unsigned int bcount, int direction) |
233 | { | 233 | { |
234 | ide_hwif_t *hwif = drive->hwif; | ||
234 | struct request *rq = pc->rq; | 235 | struct request *rq = pc->rq; |
235 | struct req_iterator iter; | 236 | struct req_iterator iter; |
236 | struct bio_vec *bvec; | 237 | struct bio_vec *bvec; |
@@ -246,9 +247,9 @@ static void ide_floppy_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
246 | 247 | ||
247 | data = bvec_kmap_irq(bvec, &flags); | 248 | data = bvec_kmap_irq(bvec, &flags); |
248 | if (direction) | 249 | if (direction) |
249 | drive->hwif->atapi_output_bytes(drive, data, count); | 250 | hwif->output_data(drive, NULL, data, count); |
250 | else | 251 | else |
251 | drive->hwif->atapi_input_bytes(drive, data, count); | 252 | hwif->input_data(drive, NULL, data, count); |
252 | bvec_kunmap_irq(data, &flags); | 253 | bvec_kunmap_irq(data, &flags); |
253 | 254 | ||
254 | bcount -= count; | 255 | bcount -= count; |
@@ -261,10 +262,7 @@ static void ide_floppy_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
261 | if (bcount) { | 262 | if (bcount) { |
262 | printk(KERN_ERR "%s: leftover data in %s, bcount == %d\n", | 263 | printk(KERN_ERR "%s: leftover data in %s, bcount == %d\n", |
263 | drive->name, __func__, bcount); | 264 | drive->name, __func__, bcount); |
264 | if (direction) | 265 | ide_pad_transfer(drive, direction, bcount); |
265 | ide_atapi_write_zeros(drive, bcount); | ||
266 | else | ||
267 | ide_atapi_discard_data(drive, bcount); | ||
268 | } | 266 | } |
269 | } | 267 | } |
270 | 268 | ||
@@ -490,7 +488,7 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive) | |||
490 | printk(KERN_ERR "ide-floppy: The floppy wants " | 488 | printk(KERN_ERR "ide-floppy: The floppy wants " |
491 | "to send us more data than expected " | 489 | "to send us more data than expected " |
492 | "- discarding data\n"); | 490 | "- discarding data\n"); |
493 | ide_atapi_discard_data(drive, bcount); | 491 | ide_pad_transfer(drive, 0, bcount); |
494 | 492 | ||
495 | ide_set_handler(drive, | 493 | ide_set_handler(drive, |
496 | &idefloppy_pc_intr, | 494 | &idefloppy_pc_intr, |
@@ -503,12 +501,12 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive) | |||
503 | } | 501 | } |
504 | } | 502 | } |
505 | if (pc->flags & PC_FLAG_WRITING) | 503 | if (pc->flags & PC_FLAG_WRITING) |
506 | xferfunc = hwif->atapi_output_bytes; | 504 | xferfunc = hwif->output_data; |
507 | else | 505 | else |
508 | xferfunc = hwif->atapi_input_bytes; | 506 | xferfunc = hwif->input_data; |
509 | 507 | ||
510 | if (pc->buf) | 508 | if (pc->buf) |
511 | xferfunc(drive, pc->cur_pos, bcount); | 509 | xferfunc(drive, NULL, pc->cur_pos, bcount); |
512 | else | 510 | else |
513 | ide_floppy_io_buffers(drive, pc, bcount, | 511 | ide_floppy_io_buffers(drive, pc, bcount, |
514 | !!(pc->flags & PC_FLAG_WRITING)); | 512 | !!(pc->flags & PC_FLAG_WRITING)); |
@@ -548,8 +546,10 @@ static ide_startstop_t idefloppy_transfer_pc(ide_drive_t *drive) | |||
548 | 546 | ||
549 | /* Set the interrupt routine */ | 547 | /* Set the interrupt routine */ |
550 | ide_set_handler(drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL); | 548 | ide_set_handler(drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL); |
549 | |||
551 | /* Send the actual packet */ | 550 | /* Send the actual packet */ |
552 | HWIF(drive)->atapi_output_bytes(drive, floppy->pc->c, 12); | 551 | hwif->output_data(drive, NULL, floppy->pc->c, 12); |
552 | |||
553 | return ide_started; | 553 | return ide_started; |
554 | } | 554 | } |
555 | 555 | ||
@@ -569,7 +569,8 @@ static int idefloppy_transfer_pc2(ide_drive_t *drive) | |||
569 | idefloppy_floppy_t *floppy = drive->driver_data; | 569 | idefloppy_floppy_t *floppy = drive->driver_data; |
570 | 570 | ||
571 | /* Send the actual packet */ | 571 | /* Send the actual packet */ |
572 | HWIF(drive)->atapi_output_bytes(drive, floppy->pc->c, 12); | 572 | drive->hwif->output_data(drive, NULL, floppy->pc->c, 12); |
573 | |||
573 | /* Timeout for the packet command */ | 574 | /* Timeout for the packet command */ |
574 | return IDEFLOPPY_WAIT_CMD; | 575 | return IDEFLOPPY_WAIT_CMD; |
575 | } | 576 | } |
@@ -692,7 +693,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive, | |||
692 | return ide_started; | 693 | return ide_started; |
693 | } else { | 694 | } else { |
694 | /* Issue the packet command */ | 695 | /* Issue the packet command */ |
695 | hwif->OUTB(WIN_PACKETCMD, hwif->io_ports.command_addr); | 696 | ide_execute_pkt_cmd(drive); |
696 | return (*pkt_xfer_routine) (drive); | 697 | return (*pkt_xfer_routine) (drive); |
697 | } | 698 | } |
698 | } | 699 | } |