summaryrefslogtreecommitdiffstats
path: root/firmware/export
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-17 16:57:51 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-17 18:38:49 -0400
commitd8d37ffdb8bed39df5d021afa9e09bf087b45d0d (patch)
treeeaea28432d9a76c98d69470c3c8a8bd0b4e17282 /firmware/export
parent0a4a920029bfb8194c37870b7e6d8e60cd7c8ef9 (diff)
downloadrockbox-d8d37ffdb8bed39df5d021afa9e09bf087b45d0d.tar.gz
rockbox-d8d37ffdb8bed39df5d021afa9e09bf087b45d0d.zip
Define a USB storage type, and hook it up for hosted targets
Change-Id: I56363c989139c7edf0b2c67b0aac9ef1adfacba2
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/config.h6
-rw-r--r--firmware/export/hostfs.h2
-rw-r--r--firmware/export/mv.h3
-rw-r--r--firmware/export/storage.h8
4 files changed, 17 insertions, 2 deletions
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 7e8d751090..547c359d8d 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -32,14 +32,16 @@
#define STORAGE_SD_NUM 2
#define STORAGE_NAND_NUM 3
#define STORAGE_RAMDISK_NUM 4
-#define STORAGE_HOSTFS_NUM 5
-#define STORAGE_NUM_TYPES 6
+#define STORAGE_USB_NUM 5
+#define STORAGE_HOSTFS_NUM 6
+#define STORAGE_NUM_TYPES 7
#define STORAGE_ATA (1 << STORAGE_ATA_NUM)
#define STORAGE_MMC (1 << STORAGE_MMC_NUM)
#define STORAGE_SD (1 << STORAGE_SD_NUM)
#define STORAGE_NAND (1 << STORAGE_NAND_NUM)
#define STORAGE_RAMDISK (1 << STORAGE_RAMDISK_NUM)
+#define STORAGE_USB (1 << STORAGE_USB_NUM)
/* meant for APPLICATION targets (implicit for SIMULATOR) */
#define STORAGE_HOSTFS (1 << STORAGE_HOSTFS_NUM)
diff --git a/firmware/export/hostfs.h b/firmware/export/hostfs.h
index fa916870f3..c0fe85236e 100644
--- a/firmware/export/hostfs.h
+++ b/firmware/export/hostfs.h
@@ -54,6 +54,8 @@ extern int hostfs_driver_type(int drive);
# define hostfs_driver_type(drive) (STORAGE_ATA_NUM)
# elif (CONFIG_STORAGE & STORAGE_SD)
# define hostfs_driver_type(drive) (STORAGE_SD_NUM)
+# elif (CONFIG_STORAGE & STORAGE_USB)
+# define hostfs_driver_type(drive) (STORAGE_USB_NUM)
# elif (CONFIG_STORAGE & STORAGE_MMC)
# define hostfs_driver_type(drive) (STORAGE_MMC_NUM)
# elif (CONFIG_STORAGE & STORAGE_NAND)
diff --git a/firmware/export/mv.h b/firmware/export/mv.h
index ec7b2efdbd..3657ef6c98 100644
--- a/firmware/export/mv.h
+++ b/firmware/export/mv.h
@@ -70,6 +70,9 @@
#if (CONFIG_STORAGE & STORAGE_RAMDISK)
#define RAMDISK_VOL_DEC "RAMDisk"
#endif
+#if (CONFIG_STORAGE & STORAGE_USB)
+#define USB_VOL_DEC "USB"
+#endif
#if (CONFIG_STORAGE & STORAGE_HOSTFS)
#ifndef HOSTFS_VOL_DEC /* overridable */
#define HOSTFS_VOL_DEC DEFAULT_VOL_DEC
diff --git a/firmware/export/storage.h b/firmware/export/storage.h
index e6424f7b03..ee1423c93a 100644
--- a/firmware/export/storage.h
+++ b/firmware/export/storage.h
@@ -34,6 +34,9 @@
#if (CONFIG_STORAGE & STORAGE_SD)
#include "sd.h"
#endif
+#if (CONFIG_STORAGE & STORAGE_USB)
+// TODO: Doesn't matter until we're native
+#endif
#if (CONFIG_STORAGE & STORAGE_MMC)
#include "mmc.h"
#endif
@@ -97,6 +100,9 @@ int nand_event(long id, intptr_t data);
#if (CONFIG_STORAGE & STORAGE_RAMDISK)
int ramdisk_event(long id, intptr_t data);
#endif
+#if (CONFIG_STORAGE & STORAGE_USB)
+// int usb_event(long id, intptr_t data); // TODO: Implement
+#endif
struct storage_info
{
@@ -278,6 +284,8 @@ static inline void storage_sleep(void) {};
#define storage_present(drive) ramdisk_present(IF_MD(drive))
#endif
#define storage_driver_type(drive) (STORAGE_RAMDISK_NUM)
+ #elif (CONFIG_STORAGE & STORAGE_USB)
+ // TODO: Eventually fix me
#else
//#error No storage driver!
#endif