update atp870u driver to 0.78 from D-Link source
[linux-2.4.git] / drivers / ide / ide_modes.h
1 /*
2  *  linux/drivers/ide/ide_modes.h
3  *
4  *  Copyright (C) 1996  Linus Torvalds, Igor Abramov, and Mark Lord
5  */
6
7 #ifndef _IDE_MODES_H
8 #define _IDE_MODES_H
9
10 #include <linux/config.h>
11
12 /*
13  * Shared data/functions for determining best PIO mode for an IDE drive.
14  * Most of this stuff originally lived in cmd640.c, and changes to the
15  * ide_pio_blacklist[] table should be made with EXTREME CAUTION to avoid
16  * breaking the fragile cmd640.c support.
17  */
18
19 /*
20  * Standard (generic) timings for PIO modes, from ATA2 specification.
21  * These timings are for access to the IDE data port register *only*.
22  * Some drives may specify a mode, while also specifying a different
23  * value for cycle_time (from drive identification data).
24  */
25 typedef struct ide_pio_timings_s {
26         int     setup_time;     /* Address setup (ns) minimum */
27         int     active_time;    /* Active pulse (ns) minimum */
28         int     cycle_time;     /* Cycle time (ns) minimum = (setup + active + recovery) */
29 } ide_pio_timings_t;
30
31 typedef struct ide_pio_data_s {
32         u8 pio_mode;
33         u8 use_iordy;
34         u8 overridden;
35         u8 blacklisted;
36         unsigned int cycle_time;
37 } ide_pio_data_t;
38         
39 u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d);
40 extern const ide_pio_timings_t ide_pio_timings[6];
41 #endif /* _IDE_MODES_H */