diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/ata.h | 55 | ||||
-rw-r--r-- | firmware/export/ata_idle_notify.h | 24 | ||||
-rw-r--r-- | firmware/export/disk.h | 2 | ||||
-rw-r--r-- | firmware/export/fat.h | 2 | ||||
-rw-r--r-- | firmware/export/nand_id.h | 2 |
5 files changed, 41 insertions, 44 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 |
diff --git a/firmware/export/ata_idle_notify.h b/firmware/export/ata_idle_notify.h index aea2c92b06..ceba2eeda4 100644 --- a/firmware/export/ata_idle_notify.h +++ b/firmware/export/ata_idle_notify.h | |||
@@ -26,15 +26,15 @@ | |||
26 | #include "events.h" | 26 | #include "events.h" |
27 | 27 | ||
28 | /* | 28 | /* |
29 | NOTE: ata_idle_notify usage notes.. | 29 | NOTE: storage_idle_notify usage notes.. |
30 | 30 | ||
31 | 1) The callbacks are called in the ata thread, not main/your thread. | 31 | 1) The callbacks are called in the ata thread, not main/your thread. |
32 | 2) Asynchronous callbacks (like the buffer refill) should be avoided. | 32 | 2) Asynchronous callbacks (like the buffer refill) should be avoided. |
33 | If you must use an async callback, remember to check ata_is_active() before | 33 | If you must use an async callback, remember to check storage_is_active() before |
34 | accessing the disk, and do not call any functions between that check and the | 34 | accessing the disk, and do not call any functions between that check and the |
35 | disk access which may cause a yield (lcd_update() does this!). | 35 | disk access which may cause a yield (lcd_update() does this!). |
36 | 3) Do not call any yielding functions in the callback. | 36 | 3) Do not call any yielding functions in the callback. |
37 | 4) Do not call ata_sleep in the callbacks. | 37 | 4) Do not call storage_sleep in the callbacks. |
38 | 5) Don't Panic! | 38 | 5) Don't Panic! |
39 | 39 | ||
40 | */ | 40 | */ |
@@ -43,21 +43,21 @@ enum { | |||
43 | DISK_EVENT_SPINUP = (EVENT_CLASS_DISK|1), | 43 | DISK_EVENT_SPINUP = (EVENT_CLASS_DISK|1), |
44 | }; | 44 | }; |
45 | 45 | ||
46 | #define USING_ATA_CALLBACK !defined(SIMULATOR) \ | 46 | #define USING_STORAGE_CALLBACK !defined(SIMULATOR) \ |
47 | && ! ((CONFIG_STORAGE & STORAGE_NAND) \ | 47 | && ! ((CONFIG_STORAGE & STORAGE_NAND) \ |
48 | && (CONFIG_NAND & NAND_IFP7XX)) \ | 48 | && (CONFIG_NAND & NAND_IFP7XX)) \ |
49 | && !defined(BOOTLOADER) | 49 | && !defined(BOOTLOADER) |
50 | 50 | ||
51 | typedef bool (*ata_idle_notify)(void); | 51 | typedef bool (*storage_idle_notify)(void); |
52 | 52 | ||
53 | extern void register_ata_idle_func(ata_idle_notify function); | 53 | extern void register_storage_idle_func(storage_idle_notify function); |
54 | #if USING_ATA_CALLBACK | 54 | #if USING_STORAGE_CALLBACK |
55 | extern void unregister_ata_idle_func(ata_idle_notify function, bool run); | 55 | extern void unregister_storage_idle_func(storage_idle_notify function, bool run); |
56 | extern bool call_ata_idle_notifys(bool force); | 56 | extern bool call_storage_idle_notifys(bool force); |
57 | #else | 57 | #else |
58 | #define unregister_ata_idle_func(f,r) | 58 | #define unregister_storage_idle_func(f,r) |
59 | #define call_ata_idle_notifys(f) | 59 | #define call_storage_idle_notifys(f) |
60 | #define ata_idle_notify_init(s) | 60 | #define storage_idle_notify_init(s) |
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | #endif /* __ATACALLBACK_H__ */ | 63 | #endif /* __ATACALLBACK_H__ */ |
diff --git a/firmware/export/disk.h b/firmware/export/disk.h index 8d440befaf..cec9bfa3fc 100644 --- a/firmware/export/disk.h +++ b/firmware/export/disk.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #ifndef _DISK_H_ | 21 | #ifndef _DISK_H_ |
22 | #define _DISK_H_ | 22 | #define _DISK_H_ |
23 | 23 | ||
24 | #include "ata.h" /* for volume definitions */ | 24 | #include "mv.h" /* for volume definitions */ |
25 | 25 | ||
26 | struct partinfo { | 26 | struct partinfo { |
27 | unsigned long start; /* first sector (LBA) */ | 27 | unsigned long start; /* first sector (LBA) */ |
diff --git a/firmware/export/fat.h b/firmware/export/fat.h index 0e83ca8b4d..c99a1a75f8 100644 --- a/firmware/export/fat.h +++ b/firmware/export/fat.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #define FAT_H | 23 | #define FAT_H |
24 | 24 | ||
25 | #include <stdbool.h> | 25 | #include <stdbool.h> |
26 | #include "ata.h" /* for volume definitions */ | 26 | #include "mv.h" /* for volume definitions */ |
27 | #include "config.h" | 27 | #include "config.h" |
28 | 28 | ||
29 | #define SECTOR_SIZE 512 | 29 | #define SECTOR_SIZE 512 |
diff --git a/firmware/export/nand_id.h b/firmware/export/nand_id.h index a47a38eea2..188b6c161a 100644 --- a/firmware/export/nand_id.h +++ b/firmware/export/nand_id.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id: ata.h 17847 2008-06-28 18:10:04Z bagder $ | 8 | * $Id: $ |
9 | * | 9 | * |
10 | * Copyright (C) 2002 by Alan Korr | 10 | * Copyright (C) 2002 by Alan Korr |
11 | * | 11 | * |