diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-26 14:13:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-26 14:13:06 -0400 |
commit | bc2fd381d8f9dbeb181f82286cdca1567e3d0def (patch) | |
tree | e03b088a8bc1052d8f851764d201a13366cb97ce /drivers/ide/ide-atapi.c | |
parent | 928a726b0e12184729900c076e13dbf1c511c96c (diff) | |
parent | 2ebe1d9efed5f232afc8d00901d0959c9814bce3 (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: (53 commits)
ide: use try_to_identify() in ide_driveid_update()
ide: clear drive IRQ after re-enabling local IRQs in ide_driveid_update()
ide: sanitize SELECT_MASK() usage in ide_driveid_update()
ide: classify device type in do_probe()
ide: remove broken EXABYTENEST support
ide: shorten timeout value in ide_driveid_update()
ide: propagate AltStatus workarounds to ide_driveid_update()
ide: fix kmalloc() failure handling in ide_driveid_update()
mn10300: remove <asm/ide.h>
frv: remove <asm/ide.h>
ide: remove pciirq argument from ide_pci_setup_ports()
ide: fix ->init_chipset method to return 'int' value
ide: remove try_to_identify() wrapper
ide: remove no longer needed IRQ auto-probing from try_to_identify() (v2)
ide: remove no longer needed IRQ fallback code from hwif_init()
amd74xx: remove no longer needed ->init_hwif method
ide: remove no longer needed IDE_HFLAG[_FORCE]_LEGACY_IRQS
ide: use ide_pci_is_in_compatibility_mode() in ide_pci_init_{one,two}()
ide: use pci_get_legacy_ide_irq() in ide_pci_init_{one,two}()
ide: handle IDE_HFLAG[_FORCE]_LEGACY_IRQS in ide_pci_init_{one,two}()
...
Diffstat (limited to 'drivers/ide/ide-atapi.c')
-rw-r--r-- | drivers/ide/ide-atapi.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index e9d042dba0e0..6adc5b4a4406 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -149,7 +149,10 @@ static void ide_queue_pc_head(ide_drive_t *drive, struct gendisk *disk, | |||
149 | memcpy(rq->cmd, pc->c, 12); | 149 | memcpy(rq->cmd, pc->c, 12); |
150 | if (drive->media == ide_tape) | 150 | if (drive->media == ide_tape) |
151 | rq->cmd[13] = REQ_IDETAPE_PC1; | 151 | rq->cmd[13] = REQ_IDETAPE_PC1; |
152 | ide_do_drive_cmd(drive, rq); | 152 | |
153 | drive->hwif->rq = NULL; | ||
154 | |||
155 | elv_add_request(drive->queue, rq, ELEVATOR_INSERT_FRONT, 0); | ||
153 | } | 156 | } |
154 | 157 | ||
155 | /* | 158 | /* |
@@ -297,6 +300,21 @@ int ide_cd_get_xferlen(struct request *rq) | |||
297 | } | 300 | } |
298 | EXPORT_SYMBOL_GPL(ide_cd_get_xferlen); | 301 | EXPORT_SYMBOL_GPL(ide_cd_get_xferlen); |
299 | 302 | ||
303 | void ide_read_bcount_and_ireason(ide_drive_t *drive, u16 *bcount, u8 *ireason) | ||
304 | { | ||
305 | ide_task_t task; | ||
306 | |||
307 | memset(&task, 0, sizeof(task)); | ||
308 | task.tf_flags = IDE_TFLAG_IN_LBAH | IDE_TFLAG_IN_LBAM | | ||
309 | IDE_TFLAG_IN_NSECT; | ||
310 | |||
311 | drive->hwif->tp_ops->tf_read(drive, &task); | ||
312 | |||
313 | *bcount = (task.tf.lbah << 8) | task.tf.lbam; | ||
314 | *ireason = task.tf.nsect & 3; | ||
315 | } | ||
316 | EXPORT_SYMBOL_GPL(ide_read_bcount_and_ireason); | ||
317 | |||
300 | /* | 318 | /* |
301 | * This is the usual interrupt handler which will be called during a packet | 319 | * This is the usual interrupt handler which will be called during a packet |
302 | * command. We will transfer some of the data (as requested by the drive) | 320 | * command. We will transfer some of the data (as requested by the drive) |
@@ -456,6 +474,25 @@ next_irq: | |||
456 | return ide_started; | 474 | return ide_started; |
457 | } | 475 | } |
458 | 476 | ||
477 | static void ide_pktcmd_tf_load(ide_drive_t *drive, u32 tf_flags, u16 bcount) | ||
478 | { | ||
479 | ide_hwif_t *hwif = drive->hwif; | ||
480 | ide_task_t task; | ||
481 | u8 dma = drive->dma; | ||
482 | |||
483 | memset(&task, 0, sizeof(task)); | ||
484 | task.tf_flags = IDE_TFLAG_OUT_LBAH | IDE_TFLAG_OUT_LBAM | | ||
485 | IDE_TFLAG_OUT_FEATURE | tf_flags; | ||
486 | task.tf.feature = dma; /* Use PIO/DMA */ | ||
487 | task.tf.lbam = bcount & 0xff; | ||
488 | task.tf.lbah = (bcount >> 8) & 0xff; | ||
489 | |||
490 | ide_tf_dump(drive->name, &task.tf); | ||
491 | hwif->tp_ops->set_irq(hwif, 1); | ||
492 | SELECT_MASK(drive, 0); | ||
493 | hwif->tp_ops->tf_load(drive, &task); | ||
494 | } | ||
495 | |||
459 | static u8 ide_read_ireason(ide_drive_t *drive) | 496 | static u8 ide_read_ireason(ide_drive_t *drive) |
460 | { | 497 | { |
461 | ide_task_t task; | 498 | ide_task_t task; |
@@ -629,7 +666,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive) | |||
629 | : WAIT_TAPE_CMD; | 666 | : WAIT_TAPE_CMD; |
630 | } | 667 | } |
631 | 668 | ||
632 | ide_pktcmd_tf_load(drive, tf_flags, bcount, drive->dma); | 669 | ide_pktcmd_tf_load(drive, tf_flags, bcount); |
633 | 670 | ||
634 | /* Issue the packet command */ | 671 | /* Issue the packet command */ |
635 | if (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT) { | 672 | if (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT) { |