diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:12 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:12 -0500 |
commit | 790d1239898d4f893112280decd344d90f43ee96 (patch) | |
tree | a8ed2d8fedc4d62b28249d84db4c2904f738cbb3 /drivers/ide/ide-tape.c | |
parent | e5f9f5a89a01abc2b9c09747452aeb9218d6bffd (diff) |
ide: remove ata_nsector_t, ata_data_t and atapi_bcount_t
Remove ata_nsector_t, ata_data_t (unused) and atapi_bcount_t.
While at it:
* replace 'HWIF(drive)' by 'hwif'
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r-- | drivers/ide/ide-tape.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 2c03f469f06e..4c24e185ccbf 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -1847,13 +1847,13 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t *drive) | |||
1847 | { | 1847 | { |
1848 | ide_hwif_t *hwif = drive->hwif; | 1848 | ide_hwif_t *hwif = drive->hwif; |
1849 | idetape_tape_t *tape = drive->driver_data; | 1849 | idetape_tape_t *tape = drive->driver_data; |
1850 | atapi_bcount_t bcount; | ||
1851 | atapi_ireason_t ireason; | 1850 | atapi_ireason_t ireason; |
1852 | idetape_pc_t *pc = tape->pc; | 1851 | idetape_pc_t *pc = tape->pc; |
1853 | unsigned int temp; | 1852 | unsigned int temp; |
1854 | #if SIMULATE_ERRORS | 1853 | #if SIMULATE_ERRORS |
1855 | static int error_sim_count = 0; | 1854 | static int error_sim_count = 0; |
1856 | #endif | 1855 | #endif |
1856 | u16 bcount; | ||
1857 | u8 stat; | 1857 | u8 stat; |
1858 | 1858 | ||
1859 | #if IDETAPE_DEBUG_LOG | 1859 | #if IDETAPE_DEBUG_LOG |
@@ -1962,8 +1962,8 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t *drive) | |||
1962 | return ide_do_reset(drive); | 1962 | return ide_do_reset(drive); |
1963 | } | 1963 | } |
1964 | /* Get the number of bytes to transfer on this interrupt. */ | 1964 | /* Get the number of bytes to transfer on this interrupt. */ |
1965 | bcount.b.high = hwif->INB(IDE_BCOUNTH_REG); | 1965 | bcount = (hwif->INB(IDE_BCOUNTH_REG) << 8) | |
1966 | bcount.b.low = hwif->INB(IDE_BCOUNTL_REG); | 1966 | hwif->INB(IDE_BCOUNTL_REG); |
1967 | 1967 | ||
1968 | ireason.all = hwif->INB(IDE_IREASON_REG); | 1968 | ireason.all = hwif->INB(IDE_IREASON_REG); |
1969 | 1969 | ||
@@ -1981,11 +1981,11 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t *drive) | |||
1981 | } | 1981 | } |
1982 | if (!test_bit(PC_WRITING, &pc->flags)) { | 1982 | if (!test_bit(PC_WRITING, &pc->flags)) { |
1983 | /* Reading - Check that we have enough space */ | 1983 | /* Reading - Check that we have enough space */ |
1984 | temp = pc->actually_transferred + bcount.all; | 1984 | temp = pc->actually_transferred + bcount; |
1985 | if (temp > pc->request_transfer) { | 1985 | if (temp > pc->request_transfer) { |
1986 | if (temp > pc->buffer_size) { | 1986 | if (temp > pc->buffer_size) { |
1987 | printk(KERN_ERR "ide-tape: The tape wants to send us more data than expected - discarding data\n"); | 1987 | printk(KERN_ERR "ide-tape: The tape wants to send us more data than expected - discarding data\n"); |
1988 | idetape_discard_data(drive, bcount.all); | 1988 | idetape_discard_data(drive, bcount); |
1989 | ide_set_handler(drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL); | 1989 | ide_set_handler(drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL); |
1990 | return ide_started; | 1990 | return ide_started; |
1991 | } | 1991 | } |
@@ -1997,23 +1997,26 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t *drive) | |||
1997 | } | 1997 | } |
1998 | if (test_bit(PC_WRITING, &pc->flags)) { | 1998 | if (test_bit(PC_WRITING, &pc->flags)) { |
1999 | if (pc->bh != NULL) | 1999 | if (pc->bh != NULL) |
2000 | idetape_output_buffers(drive, pc, bcount.all); | 2000 | idetape_output_buffers(drive, pc, bcount); |
2001 | else | 2001 | else |
2002 | /* Write the current buffer */ | 2002 | /* Write the current buffer */ |
2003 | HWIF(drive)->atapi_output_bytes(drive, pc->current_position, bcount.all); | 2003 | hwif->atapi_output_bytes(drive, pc->current_position, |
2004 | bcount); | ||
2004 | } else { | 2005 | } else { |
2005 | if (pc->bh != NULL) | 2006 | if (pc->bh != NULL) |
2006 | idetape_input_buffers(drive, pc, bcount.all); | 2007 | idetape_input_buffers(drive, pc, bcount); |
2007 | else | 2008 | else |
2008 | /* Read the current buffer */ | 2009 | /* Read the current buffer */ |
2009 | HWIF(drive)->atapi_input_bytes(drive, pc->current_position, bcount.all); | 2010 | hwif->atapi_input_bytes(drive, pc->current_position, |
2011 | bcount); | ||
2010 | } | 2012 | } |
2011 | /* Update the current position */ | 2013 | /* Update the current position */ |
2012 | pc->actually_transferred += bcount.all; | 2014 | pc->actually_transferred += bcount; |
2013 | pc->current_position += bcount.all; | 2015 | pc->current_position += bcount; |
2014 | #if IDETAPE_DEBUG_LOG | 2016 | #if IDETAPE_DEBUG_LOG |
2015 | if (tape->debug_level >= 2) | 2017 | if (tape->debug_level >= 2) |
2016 | printk(KERN_INFO "ide-tape: [cmd %x] transferred %d bytes on that interrupt\n", pc->c[0], bcount.all); | 2018 | printk(KERN_INFO "ide-tape: [cmd %x] transferred %d bytes " |
2019 | "on that interrupt\n", pc->c[0], bcount); | ||
2017 | #endif | 2020 | #endif |
2018 | /* And set the interrupt handler again */ | 2021 | /* And set the interrupt handler again */ |
2019 | ide_set_handler(drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL); | 2022 | ide_set_handler(drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL); |
@@ -2109,8 +2112,8 @@ static ide_startstop_t idetape_issue_packet_command (ide_drive_t *drive, idetape | |||
2109 | { | 2112 | { |
2110 | ide_hwif_t *hwif = drive->hwif; | 2113 | ide_hwif_t *hwif = drive->hwif; |
2111 | idetape_tape_t *tape = drive->driver_data; | 2114 | idetape_tape_t *tape = drive->driver_data; |
2112 | atapi_bcount_t bcount; | ||
2113 | int dma_ok = 0; | 2115 | int dma_ok = 0; |
2116 | u16 bcount; | ||
2114 | 2117 | ||
2115 | #if IDETAPE_DEBUG_BUGS | 2118 | #if IDETAPE_DEBUG_BUGS |
2116 | if (tape->pc->c[0] == IDETAPE_REQUEST_SENSE_CMD && | 2119 | if (tape->pc->c[0] == IDETAPE_REQUEST_SENSE_CMD && |
@@ -2159,7 +2162,7 @@ static ide_startstop_t idetape_issue_packet_command (ide_drive_t *drive, idetape | |||
2159 | pc->actually_transferred = 0; | 2162 | pc->actually_transferred = 0; |
2160 | pc->current_position = pc->buffer; | 2163 | pc->current_position = pc->buffer; |
2161 | /* Request to transfer the entire buffer at once */ | 2164 | /* Request to transfer the entire buffer at once */ |
2162 | bcount.all = pc->request_transfer; | 2165 | bcount = pc->request_transfer; |
2163 | 2166 | ||
2164 | if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags)) { | 2167 | if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags)) { |
2165 | printk(KERN_WARNING "ide-tape: DMA disabled, " | 2168 | printk(KERN_WARNING "ide-tape: DMA disabled, " |
@@ -2172,8 +2175,8 @@ static ide_startstop_t idetape_issue_packet_command (ide_drive_t *drive, idetape | |||
2172 | if (IDE_CONTROL_REG) | 2175 | if (IDE_CONTROL_REG) |
2173 | hwif->OUTB(drive->ctl, IDE_CONTROL_REG); | 2176 | hwif->OUTB(drive->ctl, IDE_CONTROL_REG); |
2174 | hwif->OUTB(dma_ok ? 1 : 0, IDE_FEATURE_REG); /* Use PIO/DMA */ | 2177 | hwif->OUTB(dma_ok ? 1 : 0, IDE_FEATURE_REG); /* Use PIO/DMA */ |
2175 | hwif->OUTB(bcount.b.high, IDE_BCOUNTH_REG); | 2178 | hwif->OUTB((bcount >> 8) & 0xff, IDE_BCOUNTH_REG); |
2176 | hwif->OUTB(bcount.b.low, IDE_BCOUNTL_REG); | 2179 | hwif->OUTB(bcount & 0xff, IDE_BCOUNTL_REG); |
2177 | hwif->OUTB(drive->select.all, IDE_SELECT_REG); | 2180 | hwif->OUTB(drive->select.all, IDE_SELECT_REG); |
2178 | if (dma_ok) /* Will begin DMA later */ | 2181 | if (dma_ok) /* Will begin DMA later */ |
2179 | set_bit(PC_DMA_IN_PROGRESS, &pc->flags); | 2182 | set_bit(PC_DMA_IN_PROGRESS, &pc->flags); |