summaryrefslogtreecommitdiff
path: root/firmware/export/ata.h
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-11-01 16:14:28 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-11-01 16:14:28 +0000
commit2f8a0081c64534da23fc0fa9cc685eb7454fd9c9 (patch)
tree84dbdbd5326cb48f43d2ebd5a4c86e992c1d5288 /firmware/export/ata.h
parent646cac0bde7b11fa7bcb670d1d76eec78e360485 (diff)
downloadrockbox-2f8a0081c64534da23fc0fa9cc685eb7454fd9c9.tar.gz
rockbox-2f8a0081c64534da23fc0fa9cc685eb7454fd9c9.zip
Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do that, it also introduces sd_*, nand_*, and mmc_*.
This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/ata.h')
-rw-r--r--firmware/export/ata.h55
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. 28struct 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
41extern void ata_enable(bool on); 30void ata_enable(bool on);
42extern void ata_spindown(int seconds); 31void ata_spindown(int seconds);
43extern void ata_sleep(void); 32void ata_sleep(void);
44extern void ata_sleepnow(void); 33void 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 */
49extern bool ata_disk_is_active(void); 38bool ata_disk_is_active(void);
50extern int ata_hard_reset(void); 39int ata_hard_reset(void);
51extern int ata_soft_reset(void); 40int ata_soft_reset(void);
52extern int ata_init(void); 41int ata_init(void);
53extern void ata_close(void); 42void ata_close(void);
54extern int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf); 43int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf);
55extern int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf); 44int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf);
56extern void ata_spin(void); 45void ata_spin(void);
57#if (CONFIG_LED == LED_REAL) 46#if (CONFIG_LED == LED_REAL)
58extern void ata_set_led_enabled(bool enabled); 47void ata_set_led_enabled(bool enabled);
48#endif
49unsigned short* ata_get_identify(void);
50void ata_get_info(IF_MV2(int drive,) struct storage_info *info);
51#ifdef HAVE_HOTSWAP
52bool ata_removable(IF_MV_NONVOID(int drive));
53bool ata_present(IF_MV_NONVOID(int drive));
59#endif 54#endif
60extern unsigned short* ata_get_identify(void);
61 55
62extern long last_disk_activity; 56
63extern int ata_spinup_time; /* ticks */ 57
58long ata_last_disk_activity(void);
59int ata_spinup_time(void); /* ticks */
60
64 61
65#endif 62#endif