summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/ata.h55
-rw-r--r--firmware/export/ata_idle_notify.h24
-rw-r--r--firmware/export/disk.h2
-rw-r--r--firmware/export/fat.h2
-rw-r--r--firmware/export/nand_id.h2
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. 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
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
311) The callbacks are called in the ata thread, not main/your thread. 311) The callbacks are called in the ata thread, not main/your thread.
322) Asynchronous callbacks (like the buffer refill) should be avoided. 322) 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!).
363) Do not call any yielding functions in the callback. 363) Do not call any yielding functions in the callback.
374) Do not call ata_sleep in the callbacks. 374) Do not call storage_sleep in the callbacks.
385) Don't Panic! 385) 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
51typedef bool (*ata_idle_notify)(void); 51typedef bool (*storage_idle_notify)(void);
52 52
53extern void register_ata_idle_func(ata_idle_notify function); 53extern void register_storage_idle_func(storage_idle_notify function);
54#if USING_ATA_CALLBACK 54#if USING_STORAGE_CALLBACK
55extern void unregister_ata_idle_func(ata_idle_notify function, bool run); 55extern void unregister_storage_idle_func(storage_idle_notify function, bool run);
56extern bool call_ata_idle_notifys(bool force); 56extern 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
26struct partinfo { 26struct 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 *