Loading drivers/ide/ide-atapi.c +2 −4 Original line number Diff line number Diff line Loading @@ -107,11 +107,9 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, ide_dma_off(drive); return ide_do_reset(drive); } /* Get the number of bytes to transfer on this interrupt. */ bcount = (hwif->INB(hwif->io_ports.lbah_addr) << 8) | hwif->INB(hwif->io_ports.lbam_addr); ireason = hwif->INB(hwif->io_ports.nsect_addr); /* Get the number of bytes to transfer on this interrupt. */ ide_read_bcount_and_ireason(drive, &bcount, &ireason); if (ireason & CD) { printk(KERN_ERR "%s: CoD != 0 in %s\n", drive->name, __func__); Loading drivers/ide/ide-cd.c +4 −8 Original line number Diff line number Diff line Loading @@ -895,10 +895,11 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) struct request *rq = HWGROUP(drive)->rq; xfer_func_t *xferfunc; ide_expiry_t *expiry = NULL; int dma_error = 0, dma, stat, ireason, len, thislen, uptodate = 0; int dma_error = 0, dma, stat, thislen, uptodate = 0; int write = (rq_data_dir(rq) == WRITE) ? 1 : 0; unsigned int timeout; u8 lowcyl, highcyl; u16 len; u8 ireason; /* check for errors */ dma = info->dma; Loading Loading @@ -926,12 +927,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) goto end_request; } /* ok we fall to pio :/ */ ireason = hwif->INB(hwif->io_ports.nsect_addr) & 0x3; lowcyl = hwif->INB(hwif->io_ports.lbam_addr); highcyl = hwif->INB(hwif->io_ports.lbah_addr); len = lowcyl + (256 * highcyl); ide_read_bcount_and_ireason(drive, &len, &ireason); thislen = blk_fs_request(rq) ? len : rq->data_len; if (thislen > len) Loading drivers/ide/ide-iops.c +15 −0 Original line number Diff line number Diff line Loading @@ -405,6 +405,21 @@ u8 ide_read_error(ide_drive_t *drive) } EXPORT_SYMBOL_GPL(ide_read_error); void ide_read_bcount_and_ireason(ide_drive_t *drive, u16 *bcount, u8 *ireason) { ide_task_t task; memset(&task, 0, sizeof(task)); task.tf_flags = IDE_TFLAG_IN_LBAH | IDE_TFLAG_IN_LBAM | IDE_TFLAG_IN_NSECT; drive->hwif->tf_read(drive, &task); *bcount = (task.tf.lbah << 8) | task.tf.lbam; *ireason = task.tf.nsect & 3; } EXPORT_SYMBOL_GPL(ide_read_bcount_and_ireason); void ide_fix_driveid (struct hd_driveid *id) { #ifndef __LITTLE_ENDIAN Loading include/linux/ide.h +1 −0 Original line number Diff line number Diff line Loading @@ -958,6 +958,7 @@ extern void SELECT_DRIVE(ide_drive_t *); void SELECT_MASK(ide_drive_t *, int); u8 ide_read_error(ide_drive_t *); void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); extern int drive_is_ready(ide_drive_t *); Loading Loading
drivers/ide/ide-atapi.c +2 −4 Original line number Diff line number Diff line Loading @@ -107,11 +107,9 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, ide_dma_off(drive); return ide_do_reset(drive); } /* Get the number of bytes to transfer on this interrupt. */ bcount = (hwif->INB(hwif->io_ports.lbah_addr) << 8) | hwif->INB(hwif->io_ports.lbam_addr); ireason = hwif->INB(hwif->io_ports.nsect_addr); /* Get the number of bytes to transfer on this interrupt. */ ide_read_bcount_and_ireason(drive, &bcount, &ireason); if (ireason & CD) { printk(KERN_ERR "%s: CoD != 0 in %s\n", drive->name, __func__); Loading
drivers/ide/ide-cd.c +4 −8 Original line number Diff line number Diff line Loading @@ -895,10 +895,11 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) struct request *rq = HWGROUP(drive)->rq; xfer_func_t *xferfunc; ide_expiry_t *expiry = NULL; int dma_error = 0, dma, stat, ireason, len, thislen, uptodate = 0; int dma_error = 0, dma, stat, thislen, uptodate = 0; int write = (rq_data_dir(rq) == WRITE) ? 1 : 0; unsigned int timeout; u8 lowcyl, highcyl; u16 len; u8 ireason; /* check for errors */ dma = info->dma; Loading Loading @@ -926,12 +927,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) goto end_request; } /* ok we fall to pio :/ */ ireason = hwif->INB(hwif->io_ports.nsect_addr) & 0x3; lowcyl = hwif->INB(hwif->io_ports.lbam_addr); highcyl = hwif->INB(hwif->io_ports.lbah_addr); len = lowcyl + (256 * highcyl); ide_read_bcount_and_ireason(drive, &len, &ireason); thislen = blk_fs_request(rq) ? len : rq->data_len; if (thislen > len) Loading
drivers/ide/ide-iops.c +15 −0 Original line number Diff line number Diff line Loading @@ -405,6 +405,21 @@ u8 ide_read_error(ide_drive_t *drive) } EXPORT_SYMBOL_GPL(ide_read_error); void ide_read_bcount_and_ireason(ide_drive_t *drive, u16 *bcount, u8 *ireason) { ide_task_t task; memset(&task, 0, sizeof(task)); task.tf_flags = IDE_TFLAG_IN_LBAH | IDE_TFLAG_IN_LBAM | IDE_TFLAG_IN_NSECT; drive->hwif->tf_read(drive, &task); *bcount = (task.tf.lbah << 8) | task.tf.lbam; *ireason = task.tf.nsect & 3; } EXPORT_SYMBOL_GPL(ide_read_bcount_and_ireason); void ide_fix_driveid (struct hd_driveid *id) { #ifndef __LITTLE_ENDIAN Loading
include/linux/ide.h +1 −0 Original line number Diff line number Diff line Loading @@ -958,6 +958,7 @@ extern void SELECT_DRIVE(ide_drive_t *); void SELECT_MASK(ide_drive_t *, int); u8 ide_read_error(ide_drive_t *); void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); extern int drive_is_ready(ide_drive_t *); Loading