aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:11 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:11 -0500
commit22c525b976778cce5bb6f8fdcc70046168c54b1a (patch)
tree40ab6ef79aa8e059d55e8c55d19fdc4dfe7fdce3 /drivers/ide/ide-tape.c
parent6a2144146aa2e0eb60e48ba73ac0e1c51346edf6 (diff)
ide: remove ata_status_t and atapi_status_t
Remove ata_status_t (unused) and atapi_status_t. While at it: * replace 'HWIF(drive)' by 'drive->hwif' (or just 'hwif' where possible) 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.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 90e902d233c..c9103950543 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1848,15 +1848,14 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t *drive)
1848{ 1848{
1849 ide_hwif_t *hwif = drive->hwif; 1849 ide_hwif_t *hwif = drive->hwif;
1850 idetape_tape_t *tape = drive->driver_data; 1850 idetape_tape_t *tape = drive->driver_data;
1851 atapi_status_t status;
1852 atapi_bcount_t bcount; 1851 atapi_bcount_t bcount;
1853 atapi_ireason_t ireason; 1852 atapi_ireason_t ireason;
1854 idetape_pc_t *pc = tape->pc; 1853 idetape_pc_t *pc = tape->pc;
1855
1856 unsigned int temp; 1854 unsigned int temp;
1857#if SIMULATE_ERRORS 1855#if SIMULATE_ERRORS
1858 static int error_sim_count = 0; 1856 static int error_sim_count = 0;
1859#endif 1857#endif
1858 u8 stat;
1860 1859
1861#if IDETAPE_DEBUG_LOG 1860#if IDETAPE_DEBUG_LOG
1862 if (tape->debug_level >= 4) 1861 if (tape->debug_level >= 4)
@@ -1865,10 +1864,10 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t *drive)
1865#endif /* IDETAPE_DEBUG_LOG */ 1864#endif /* IDETAPE_DEBUG_LOG */
1866 1865
1867 /* Clear the interrupt */ 1866 /* Clear the interrupt */
1868 status.all = HWIF(drive)->INB(IDE_STATUS_REG); 1867 stat = hwif->INB(IDE_STATUS_REG);
1869 1868
1870 if (test_bit(PC_DMA_IN_PROGRESS, &pc->flags)) { 1869 if (test_bit(PC_DMA_IN_PROGRESS, &pc->flags)) {
1871 if (HWIF(drive)->ide_dma_end(drive) || status.b.check) { 1870 if (hwif->ide_dma_end(drive) || (stat & ERR_STAT)) {
1872 /* 1871 /*
1873 * A DMA error is sometimes expected. For example, 1872 * A DMA error is sometimes expected. For example,
1874 * if the tape is crossing a filemark during a 1873 * if the tape is crossing a filemark during a
@@ -1902,7 +1901,7 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t *drive)
1902 } 1901 }
1903 1902
1904 /* No more interrupts */ 1903 /* No more interrupts */
1905 if (!status.b.drq) { 1904 if ((stat & DRQ_STAT) == 0) {
1906#if IDETAPE_DEBUG_LOG 1905#if IDETAPE_DEBUG_LOG
1907 if (tape->debug_level >= 2) 1906 if (tape->debug_level >= 2)
1908 printk(KERN_INFO "ide-tape: Packet command completed, %d bytes transferred\n", pc->actually_transferred); 1907 printk(KERN_INFO "ide-tape: Packet command completed, %d bytes transferred\n", pc->actually_transferred);
@@ -1917,12 +1916,13 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t *drive)
1917 (++error_sim_count % 100) == 0) { 1916 (++error_sim_count % 100) == 0) {
1918 printk(KERN_INFO "ide-tape: %s: simulating error\n", 1917 printk(KERN_INFO "ide-tape: %s: simulating error\n",
1919 tape->name); 1918 tape->name);
1920 status.b.check = 1; 1919 stat |= ERR_STAT;
1921 } 1920 }
1922#endif 1921#endif
1923 if (status.b.check && pc->c[0] == IDETAPE_REQUEST_SENSE_CMD) 1922 if ((stat & ERR_STAT) && pc->c[0] == IDETAPE_REQUEST_SENSE_CMD)
1924 status.b.check = 0; 1923 stat &= ~ERR_STAT;
1925 if (status.b.check || test_bit(PC_DMA_ERROR, &pc->flags)) { /* Error detected */ 1924 if ((stat & ERR_STAT) || test_bit(PC_DMA_ERROR, &pc->flags)) {
1925 /* Error detected */
1926#if IDETAPE_DEBUG_LOG 1926#if IDETAPE_DEBUG_LOG
1927 if (tape->debug_level >= 1) 1927 if (tape->debug_level >= 1)
1928 printk(KERN_INFO "ide-tape: %s: I/O error\n", 1928 printk(KERN_INFO "ide-tape: %s: I/O error\n",
@@ -1941,7 +1941,7 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t *drive)
1941 } 1941 }
1942 pc->error = 0; 1942 pc->error = 0;
1943 if (test_bit(PC_WAIT_FOR_DSC, &pc->flags) && 1943 if (test_bit(PC_WAIT_FOR_DSC, &pc->flags) &&
1944 !status.b.dsc) { 1944 (stat & SEEK_STAT) == 0) {
1945 /* Media access command */ 1945 /* Media access command */
1946 tape->dsc_polling_start = jiffies; 1946 tape->dsc_polling_start = jiffies;
1947 tape->dsc_polling_frequency = IDETAPE_DSC_MA_FAST; 1947 tape->dsc_polling_frequency = IDETAPE_DSC_MA_FAST;
@@ -2285,11 +2285,11 @@ static ide_startstop_t idetape_media_access_finished (ide_drive_t *drive)
2285{ 2285{
2286 idetape_tape_t *tape = drive->driver_data; 2286 idetape_tape_t *tape = drive->driver_data;
2287 idetape_pc_t *pc = tape->pc; 2287 idetape_pc_t *pc = tape->pc;
2288 atapi_status_t status; 2288 u8 stat;
2289 2289
2290 status.all = HWIF(drive)->INB(IDE_STATUS_REG); 2290 stat = drive->hwif->INB(IDE_STATUS_REG);
2291 if (status.b.dsc) { 2291 if (stat & SEEK_STAT) {
2292 if (status.b.check) { 2292 if (stat & ERR_STAT) {
2293 /* Error detected */ 2293 /* Error detected */
2294 if (pc->c[0] != IDETAPE_TEST_UNIT_READY_CMD) 2294 if (pc->c[0] != IDETAPE_TEST_UNIT_READY_CMD)
2295 printk(KERN_ERR "ide-tape: %s: I/O error, ", 2295 printk(KERN_ERR "ide-tape: %s: I/O error, ",
@@ -2407,7 +2407,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
2407 idetape_tape_t *tape = drive->driver_data; 2407 idetape_tape_t *tape = drive->driver_data;
2408 idetape_pc_t *pc = NULL; 2408 idetape_pc_t *pc = NULL;
2409 struct request *postponed_rq = tape->postponed_rq; 2409 struct request *postponed_rq = tape->postponed_rq;
2410 atapi_status_t status; 2410 u8 stat;
2411 2411
2412#if IDETAPE_DEBUG_LOG 2412#if IDETAPE_DEBUG_LOG
2413#if 0 2413#if 0
@@ -2455,7 +2455,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
2455 * If the tape is still busy, postpone our request and service 2455 * If the tape is still busy, postpone our request and service
2456 * the other device meanwhile. 2456 * the other device meanwhile.
2457 */ 2457 */
2458 status.all = HWIF(drive)->INB(IDE_STATUS_REG); 2458 stat = drive->hwif->INB(IDE_STATUS_REG);
2459 2459
2460 if (!drive->dsc_overlap && !(rq->cmd[0] & REQ_IDETAPE_PC2)) 2460 if (!drive->dsc_overlap && !(rq->cmd[0] & REQ_IDETAPE_PC2))
2461 set_bit(IDETAPE_IGNORE_DSC, &tape->flags); 2461 set_bit(IDETAPE_IGNORE_DSC, &tape->flags);
@@ -2471,7 +2471,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
2471 tape->insert_speed = tape->insert_size / 1024 * HZ / (jiffies - tape->insert_time); 2471 tape->insert_speed = tape->insert_size / 1024 * HZ / (jiffies - tape->insert_time);
2472 calculate_speeds(drive); 2472 calculate_speeds(drive);
2473 if (!test_and_clear_bit(IDETAPE_IGNORE_DSC, &tape->flags) && 2473 if (!test_and_clear_bit(IDETAPE_IGNORE_DSC, &tape->flags) &&
2474 !status.b.dsc) { 2474 (stat & SEEK_STAT) == 0) {
2475 if (postponed_rq == NULL) { 2475 if (postponed_rq == NULL) {
2476 tape->dsc_polling_start = jiffies; 2476 tape->dsc_polling_start = jiffies;
2477 tape->dsc_polling_frequency = tape->best_dsc_rw_frequency; 2477 tape->dsc_polling_frequency = tape->best_dsc_rw_frequency;