diff options
Diffstat (limited to 'firmware/export/ata.h')
-rw-r--r-- | firmware/export/ata.h | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/firmware/export/ata.h b/firmware/export/ata.h index 164261a40a..f09a4630d3 100644 --- a/firmware/export/ata.h +++ b/firmware/export/ata.h | |||
@@ -23,43 +23,40 @@ | |||
23 | 23 | ||
24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
25 | #include "config.h" /* for HAVE_MULTIVOLUME or not */ | 25 | #include "config.h" /* for HAVE_MULTIVOLUME or not */ |
26 | #include "mv.h" /* for IF_MV() and friends */ | ||
26 | 27 | ||
27 | /* FixMe: These macros are a bit nasty and perhaps misplaced here. | 28 | struct storage_info; |
28 | We'll get rid of them once decided on how to proceed with multivolume. */ | ||
29 | #ifdef HAVE_MULTIVOLUME | ||
30 | #define IF_MV(x) x /* optional volume/drive parameter */ | ||
31 | #define IF_MV2(x,y) x,y /* same, for a list of arguments */ | ||
32 | #define IF_MV_NONVOID(x) x /* for prototype with sole volume parameter */ | ||
33 | #define NUM_VOLUMES 2 | ||
34 | #else /* empty definitions if no multi-volume */ | ||
35 | #define IF_MV(x) | ||
36 | #define IF_MV2(x,y) | ||
37 | #define IF_MV_NONVOID(x) void | ||
38 | #define NUM_VOLUMES 1 | ||
39 | #endif | ||
40 | 29 | ||
41 | extern void ata_enable(bool on); | 30 | void ata_enable(bool on); |
42 | extern void ata_spindown(int seconds); | 31 | void ata_spindown(int seconds); |
43 | extern void ata_sleep(void); | 32 | void ata_sleep(void); |
44 | extern void ata_sleepnow(void); | 33 | void ata_sleepnow(void); |
45 | /* NOTE: DO NOT use this to poll for disk activity. | 34 | /* NOTE: DO NOT use this to poll for disk activity. |
46 | If you are waiting for the disk to become active before | 35 | If you are waiting for the disk to become active before |
47 | doing something use ata_idle_notify.h | 36 | doing something use ata_idle_notify.h |
48 | */ | 37 | */ |
49 | extern bool ata_disk_is_active(void); | 38 | bool ata_disk_is_active(void); |
50 | extern int ata_hard_reset(void); | 39 | int ata_hard_reset(void); |
51 | extern int ata_soft_reset(void); | 40 | int ata_soft_reset(void); |
52 | extern int ata_init(void); | 41 | int ata_init(void); |
53 | extern void ata_close(void); | 42 | void ata_close(void); |
54 | extern int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf); | 43 | int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf); |
55 | extern int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf); | 44 | int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf); |
56 | extern void ata_spin(void); | 45 | void ata_spin(void); |
57 | #if (CONFIG_LED == LED_REAL) | 46 | #if (CONFIG_LED == LED_REAL) |
58 | extern void ata_set_led_enabled(bool enabled); | 47 | void ata_set_led_enabled(bool enabled); |
48 | #endif | ||
49 | unsigned short* ata_get_identify(void); | ||
50 | void ata_get_info(IF_MV2(int drive,) struct storage_info *info); | ||
51 | #ifdef HAVE_HOTSWAP | ||
52 | bool ata_removable(IF_MV_NONVOID(int drive)); | ||
53 | bool ata_present(IF_MV_NONVOID(int drive)); | ||
59 | #endif | 54 | #endif |
60 | extern unsigned short* ata_get_identify(void); | ||
61 | 55 | ||
62 | extern long last_disk_activity; | 56 | |
63 | extern int ata_spinup_time; /* ticks */ | 57 | |
58 | long ata_last_disk_activity(void); | ||
59 | int ata_spinup_time(void); /* ticks */ | ||
60 | |||
64 | 61 | ||
65 | #endif | 62 | #endif |