aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-28 17:44:41 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-28 17:44:41 -0400
commit9f87abe892f899f19df8d472f937ee955cd6264b (patch)
treef42dda5a9c12c043e3190de7dd43b0cee8e00c8b /include/linux
parent7c0daf2681f140dd9f39cd95966f471b5c904d8a (diff)
ide: add ide_pad_transfer() helper
* Add ide_pad_transfer() helper (which uses ->{in,out}put_data methods internally so the transfer is also padded to drive+host requirements) and use it instead of ide_atapi_{write_zeros,discard_data}(). * Remove no longer needed ide_atapi_{write_zeros,discard_data}(). Cc: Borislav Petkov <petkovbb@gmail.com> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ide.h25
1 files changed, 2 insertions, 23 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 2053d7d86b1d..7a5da394b98f 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -827,6 +827,8 @@ void ide_execute_command(ide_drive_t *, u8, ide_handler_t *, unsigned int,
827 827
828void ide_execute_pkt_cmd(ide_drive_t *); 828void ide_execute_pkt_cmd(ide_drive_t *);
829 829
830void ide_pad_transfer(ide_drive_t *, int, int);
831
830ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8); 832ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8);
831 833
832ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); 834ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat);
@@ -1359,27 +1361,4 @@ static inline u8 ide_read_error(ide_drive_t *drive)
1359 1361
1360 return hwif->INB(hwif->io_ports.error_addr); 1362 return hwif->INB(hwif->io_ports.error_addr);
1361} 1363}
1362
1363/*
1364 * Too bad. The drive wants to send us data which we are not ready to accept.
1365 * Just throw it away.
1366 */
1367static inline void ide_atapi_discard_data(ide_drive_t *drive, unsigned bcount)
1368{
1369 ide_hwif_t *hwif = drive->hwif;
1370
1371 /* FIXME: use ->input_data */
1372 while (bcount--)
1373 (void)hwif->INB(hwif->io_ports.data_addr);
1374}
1375
1376static inline void ide_atapi_write_zeros(ide_drive_t *drive, unsigned bcount)
1377{
1378 ide_hwif_t *hwif = drive->hwif;
1379
1380 /* FIXME: use ->output_data */
1381 while (bcount--)
1382 hwif->OUTB(0, hwif->io_ports.data_addr);
1383}
1384
1385#endif /* _IDE_H */ 1364#endif /* _IDE_H */