From c0a5a67387c4eec3db3bad4da77ba5126faf03c4 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Fri, 17 Jul 2009 22:28:49 +0000 Subject: Commit FS#9545, storage cleanup and multi-driver support git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21933 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/ata-sd-pp.c | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'firmware/target/arm/ata-sd-pp.c') diff --git a/firmware/target/arm/ata-sd-pp.c b/firmware/target/arm/ata-sd-pp.c index 1a76eeeba2..77d3c3dc31 100644 --- a/firmware/target/arm/ata-sd-pp.c +++ b/firmware/target/arm/ata-sd-pp.c @@ -18,7 +18,7 @@ * KIND, either express or implied. * ****************************************************************************/ -#include "config.h" /* for HAVE_MULTIVOLUME */ +#include "config.h" /* for HAVE_MULTIDRIVE */ #include "fat.h" #include "hotswap.h" #ifdef HAVE_HOTSWAP @@ -166,10 +166,10 @@ struct sd_card_status int retry_max; }; -static struct sd_card_status sd_status[NUM_VOLUMES] = +static struct sd_card_status sd_status[NUM_DRIVES] = { { 0, 1 }, -#ifdef HAVE_MULTIVOLUME +#ifdef HAVE_MULTIDRIVE { 0, 10 } #endif }; @@ -839,10 +839,10 @@ static void sd_select_device(int card_no) /* API Functions */ -int sd_read_sectors(IF_MV2(int drive,) unsigned long start, int incount, +int sd_read_sectors(IF_MD2(int drive,) unsigned long start, int incount, void* inbuf) { -#ifndef HAVE_MULTIVOLUME +#ifndef HAVE_MULTIDRIVE const int drive = 0; #endif int ret; @@ -956,13 +956,13 @@ sd_read_error: } } -int sd_write_sectors(IF_MV2(int drive,) unsigned long start, int count, +int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* outbuf) { /* Write support is not finished yet */ /* TODO: The standard suggests using ACMD23 prior to writing multiple blocks to improve performance */ -#ifndef HAVE_MULTIVOLUME +#ifndef HAVE_MULTIDRIVE const int drive = 0; #endif int ret; @@ -1330,19 +1330,33 @@ long sd_last_disk_activity(void) } #ifdef HAVE_HOTSWAP -bool sd_removable(IF_MV_NONVOID(int drive)) +bool sd_removable(IF_MD_NONVOID(int drive)) { -#ifndef HAVE_MULTIVOLUME +#ifndef HAVE_MULTIDRIVE const int drive=0; #endif return (drive==1); } -bool sd_present(IF_MV_NONVOID(int drive)) +bool sd_present(IF_MD_NONVOID(int drive)) { -#ifndef HAVE_MULTIVOLUME +#ifndef HAVE_MULTIDRIVE const int drive=0; #endif return (card_info[drive].initialized && card_info[drive].numblocks > 0); } #endif + +#ifdef CONFIG_STORAGE_MULTI +int sd_num_drives(int first_drive) +{ + /* We don't care which logical drive number(s) we have been assigned */ + (void)first_drive; + +#ifdef HAVE_MULTIDRIVE + return 2; +#else + return 1; +#endif +} +#endif -- cgit v1.2.3