diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:26 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:26 -0400 |
commit | 7616c0ad2087c7d244b8985390c63059a6223c45 (patch) | |
tree | c65d7e5dce8b6ec314b56ad2903c8760e2659753 /include | |
parent | 3ad6776cca21f2456b7288f44f224b344ac3c4d0 (diff) |
ide: add ide_atapi_{discard_data,write_zeros} inline helpers
Add ide_atapi_{discard_data,write_zeros} inline helpers to <linux/ide.h>
and use them instead of home-brewn helpers in ide-{floppy,tape,scsi}.
There should be no functional changes caused by this patch.
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ide.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index f4c7db572a16..2eb99cab4a3d 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1297,4 +1297,26 @@ static inline u8 ide_read_error(ide_drive_t *drive) | |||
1297 | return hwif->INB(hwif->io_ports[IDE_ERROR_OFFSET]); | 1297 | return hwif->INB(hwif->io_ports[IDE_ERROR_OFFSET]); |
1298 | } | 1298 | } |
1299 | 1299 | ||
1300 | /* | ||
1301 | * Too bad. The drive wants to send us data which we are not ready to accept. | ||
1302 | * Just throw it away. | ||
1303 | */ | ||
1304 | static inline void ide_atapi_discard_data(ide_drive_t *drive, unsigned bcount) | ||
1305 | { | ||
1306 | ide_hwif_t *hwif = drive->hwif; | ||
1307 | |||
1308 | /* FIXME: use ->atapi_input_bytes */ | ||
1309 | while (bcount--) | ||
1310 | (void)hwif->INB(hwif->io_ports[IDE_DATA_OFFSET]); | ||
1311 | } | ||
1312 | |||
1313 | static inline void ide_atapi_write_zeros(ide_drive_t *drive, unsigned bcount) | ||
1314 | { | ||
1315 | ide_hwif_t *hwif = drive->hwif; | ||
1316 | |||
1317 | /* FIXME: use ->atapi_output_bytes */ | ||
1318 | while (bcount--) | ||
1319 | hwif->OUTB(0, hwif->io_ports[IDE_DATA_OFFSET]); | ||
1320 | } | ||
1321 | |||
1300 | #endif /* _IDE_H */ | 1322 | #endif /* _IDE_H */ |