summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-11-01 17:33:21 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-11-01 17:33:21 +0000
commit19eb800f75db9746435868ff6837b7b3b506ac0a (patch)
treeb06b4eb017d0a38bdd9f742d44ff242215803341
parent94b6a0be993f83d50e0456dfa452c39926f2ae6c (diff)
downloadrockbox-19eb800f75db9746435868ff6837b7b3b506ac0a.tar.gz
rockbox-19eb800f75db9746435868ff6837b7b3b506ac0a.zip
conditionalise *_get_info() to get some binsize back
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18965 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/ata.c2
-rw-r--r--firmware/drivers/ata_flash.c2
-rw-r--r--firmware/drivers/ata_mmc.c2
-rw-r--r--firmware/export/ata.h3
-rw-r--r--firmware/export/config.h4
-rw-r--r--firmware/export/mmc.h2
-rw-r--r--firmware/export/nand.h2
-rw-r--r--firmware/export/sd.h2
-rw-r--r--firmware/export/storage.h4
-rw-r--r--firmware/target/arm/ata-nand-telechips.c2
-rw-r--r--firmware/target/arm/ata-sd-pp.c2
11 files changed, 27 insertions, 0 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index c2882a5b74..4a28ed3590 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -1403,6 +1403,7 @@ int ata_spinup_time(void)
1403 return spinup_time; 1403 return spinup_time;
1404} 1404}
1405 1405
1406#ifdef STORAGE_GET_INFO
1406void ata_get_info(struct storage_info *info) 1407void ata_get_info(struct storage_info *info)
1407{ 1408{
1408 unsigned short *src,*dest; 1409 unsigned short *src,*dest;
@@ -1432,3 +1433,4 @@ void ata_get_info(struct storage_info *info)
1432 dest[i] = htobe16(src[i]); 1433 dest[i] = htobe16(src[i]);
1433 info->revision=revision; 1434 info->revision=revision;
1434} 1435}
1436#endif
diff --git a/firmware/drivers/ata_flash.c b/firmware/drivers/ata_flash.c
index 9b1b64145d..ba96ea0f7d 100644
--- a/firmware/drivers/ata_flash.c
+++ b/firmware/drivers/ata_flash.c
@@ -450,6 +450,7 @@ long nand_last_disk_activity(void)
450 return last_disk_activity; 450 return last_disk_activity;
451} 451}
452 452
453#ifdef STORAGE_GET_INFO
453void nand_get_info(struct storage_info *info) 454void nand_get_info(struct storage_info *info)
454{ 455{
455 unsigned long blocks; 456 unsigned long blocks;
@@ -469,4 +470,5 @@ void nand_get_info(struct storage_info *info)
469 470
470 info->serial=0; 471 info->serial=0;
471} 472}
473#endif
472 474
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c
index 953bb90bbc..097d0a0dbd 100644
--- a/firmware/drivers/ata_mmc.c
+++ b/firmware/drivers/ata_mmc.c
@@ -963,6 +963,7 @@ long mmc_last_disk_activity(void)
963 return last_disk_activity; 963 return last_disk_activity;
964} 964}
965 965
966#ifdef STORAGE_GET_INFO
966void mmc_get_info(IF_MV2(int drive,) struct storage_info *info) 967void mmc_get_info(IF_MV2(int drive,) struct storage_info *info)
967{ 968{
968#ifndef HAVE_MULTIVOLUME 969#ifndef HAVE_MULTIVOLUME
@@ -981,6 +982,7 @@ void mmc_get_info(IF_MV2(int drive,) struct storage_info *info)
981 } 982 }
982 info->revision="0.00"; 983 info->revision="0.00";
983} 984}
985#endif
984 986
985#ifdef HAVE_HOTSWAP 987#ifdef HAVE_HOTSWAP
986bool mmc_removable(IF_MV_NONVOID(int drive)) 988bool mmc_removable(IF_MV_NONVOID(int drive))
diff --git a/firmware/export/ata.h b/firmware/export/ata.h
index f09a4630d3..a5c2f6292a 100644
--- a/firmware/export/ata.h
+++ b/firmware/export/ata.h
@@ -47,7 +47,10 @@ void ata_spin(void);
47void ata_set_led_enabled(bool enabled); 47void ata_set_led_enabled(bool enabled);
48#endif 48#endif
49unsigned short* ata_get_identify(void); 49unsigned short* ata_get_identify(void);
50
51#ifdef STORAGE_GET_INFO
50void ata_get_info(IF_MV2(int drive,) struct storage_info *info); 52void ata_get_info(IF_MV2(int drive,) struct storage_info *info);
53#endif
51#ifdef HAVE_HOTSWAP 54#ifdef HAVE_HOTSWAP
52bool ata_removable(IF_MV_NONVOID(int drive)); 55bool ata_removable(IF_MV_NONVOID(int drive));
53bool ata_present(IF_MV_NONVOID(int drive)); 56bool ata_present(IF_MV_NONVOID(int drive));
diff --git a/firmware/export/config.h b/firmware/export/config.h
index e04397b5bb..22a0bd2244 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -624,4 +624,8 @@
624#endif 624#endif
625#endif /* HAVE_HEADPHONE_DETECTION */ 625#endif /* HAVE_HEADPHONE_DETECTION */
626 626
627#if defined(HAVE_USBSTACK) || (CONFIG_STORAGE & STORAGE_NAND)
628#define STORAGE_GET_INFO
629#endif
630
627#endif /* __CONFIG_H__ */ 631#endif /* __CONFIG_H__ */
diff --git a/firmware/export/mmc.h b/firmware/export/mmc.h
index 2e7fb2441d..271d910763 100644
--- a/firmware/export/mmc.h
+++ b/firmware/export/mmc.h
@@ -44,7 +44,9 @@ void mmc_spin(void);
44void mmc_set_led_enabled(bool enabled); 44void mmc_set_led_enabled(bool enabled);
45#endif 45#endif
46 46
47#ifdef STORAGE_GET_INFO
47void mmc_get_info(IF_MV2(int drive,) struct storage_info *info); 48void mmc_get_info(IF_MV2(int drive,) struct storage_info *info);
49#endif
48#ifdef HAVE_HOTSWAP 50#ifdef HAVE_HOTSWAP
49bool mmc_removable(IF_MV_NONVOID(int drive)); 51bool mmc_removable(IF_MV_NONVOID(int drive));
50bool mmc_present(IF_MV_NONVOID(int drive)); 52bool mmc_present(IF_MV_NONVOID(int drive));
diff --git a/firmware/export/nand.h b/firmware/export/nand.h
index 3d4d1ce166..25aed46629 100644
--- a/firmware/export/nand.h
+++ b/firmware/export/nand.h
@@ -43,7 +43,9 @@ void nand_spin(void);
43void nand_set_led_enabled(bool enabled); 43void nand_set_led_enabled(bool enabled);
44#endif 44#endif
45 45
46#ifdef STORAGE_GET_INFO
46void nand_get_info(IF_MV2(int drive,) struct storage_info *info); 47void nand_get_info(IF_MV2(int drive,) struct storage_info *info);
48#endif
47 49
48long nand_last_disk_activity(void); 50long nand_last_disk_activity(void);
49 51
diff --git a/firmware/export/sd.h b/firmware/export/sd.h
index 8e1fa88ceb..fbb66cc9a9 100644
--- a/firmware/export/sd.h
+++ b/firmware/export/sd.h
@@ -43,7 +43,9 @@ void sd_spin(void);
43void sd_set_led_enabled(bool enabled); 43void sd_set_led_enabled(bool enabled);
44#endif 44#endif
45 45
46#ifdef STORAGE_GET_INFO
46void sd_get_info(IF_MV2(int drive,) struct storage_info *info); 47void sd_get_info(IF_MV2(int drive,) struct storage_info *info);
48#endif
47#ifdef HAVE_HOTSWAP 49#ifdef HAVE_HOTSWAP
48bool sd_removable(IF_MV_NONVOID(int drive)); 50bool sd_removable(IF_MV_NONVOID(int drive));
49bool sd_present(IF_MV_NONVOID(int drive)); 51bool sd_present(IF_MV_NONVOID(int drive));
diff --git a/firmware/export/storage.h b/firmware/export/storage.h
index 78d3360ba9..52c6f2bed1 100644
--- a/firmware/export/storage.h
+++ b/firmware/export/storage.h
@@ -197,6 +197,7 @@ static inline int storage_spinup_time(void)
197#endif 197#endif
198} 198}
199 199
200#ifdef STORAGE_GET_INFO
200static inline void storage_get_info(IF_MV2(int drive,) struct storage_info *info) 201static inline void storage_get_info(IF_MV2(int drive,) struct storage_info *info)
201{ 202{
202#if (CONFIG_STORAGE & STORAGE_ATA) 203#if (CONFIG_STORAGE & STORAGE_ATA)
@@ -211,6 +212,7 @@ static inline void storage_get_info(IF_MV2(int drive,) struct storage_info *info
211 #error No storage driver! 212 #error No storage driver!
212#endif 213#endif
213} 214}
215#endif
214 216
215#ifdef HAVE_HOTSWAP 217#ifdef HAVE_HOTSWAP
216static inline bool storage_removable(IF_MV_NONVOID(int drive)) 218static inline bool storage_removable(IF_MV_NONVOID(int drive))
@@ -310,11 +312,13 @@ static inline int storage_spinup_time(void)
310 return 0; 312 return 0;
311} 313}
312 314
315#ifdef STORAGE_GET_INFO
313static inline void storage_get_info(IF_MV2(int drive,) struct storage_info *info) 316static inline void storage_get_info(IF_MV2(int drive,) struct storage_info *info)
314{ 317{
315 IF_MV((void)drive;) 318 IF_MV((void)drive;)
316 (void)info; 319 (void)info;
317} 320}
321#endif
318 322
319#ifdef HAVE_HOTSWAP 323#ifdef HAVE_HOTSWAP
320static inline bool storage_removable(IF_MV_NONVOID(int drive)) 324static inline bool storage_removable(IF_MV_NONVOID(int drive))
diff --git a/firmware/target/arm/ata-nand-telechips.c b/firmware/target/arm/ata-nand-telechips.c
index 4276c10d64..a0c1bc9dfc 100644
--- a/firmware/target/arm/ata-nand-telechips.c
+++ b/firmware/target/arm/ata-nand-telechips.c
@@ -714,6 +714,7 @@ int nand_write_sectors(IF_MV2(int drive,) unsigned long start, int count,
714 return -1; 714 return -1;
715} 715}
716 716
717#ifdef STORAGE_GET_INFO
717void nand_get_info(struct storage_info *info) 718void nand_get_info(struct storage_info *info)
718{ 719{
719 /* firmware version */ 720 /* firmware version */
@@ -727,6 +728,7 @@ void nand_get_info(struct storage_info *info)
727 * page_size * total_banks; 728 * page_size * total_banks;
728 info->sector_size=SECTOR_SIZE; 729 info->sector_size=SECTOR_SIZE;
729} 730}
731#endif
730 732
731int nand_init(void) 733int nand_init(void)
732{ 734{
diff --git a/firmware/target/arm/ata-sd-pp.c b/firmware/target/arm/ata-sd-pp.c
index a12aafc718..f451a7fd8d 100644
--- a/firmware/target/arm/ata-sd-pp.c
+++ b/firmware/target/arm/ata-sd-pp.c
@@ -1300,6 +1300,7 @@ long sd_last_disk_activity(void)
1300 return last_disk_activity; 1300 return last_disk_activity;
1301} 1301}
1302 1302
1303#ifdef STORAGE_GET_INFO
1303void sd_get_info(IF_MV2(int drive,) struct storage_info *info) 1304void sd_get_info(IF_MV2(int drive,) struct storage_info *info)
1304{ 1305{
1305#ifndef HAVE_MULTIVOLUME 1306#ifndef HAVE_MULTIVOLUME
@@ -1318,6 +1319,7 @@ void sd_get_info(IF_MV2(int drive,) struct storage_info *info)
1318 } 1319 }
1319 info->revision="0.00"; 1320 info->revision="0.00";
1320} 1321}
1322#endif
1321 1323
1322#ifdef HAVE_HOTSWAP 1324#ifdef HAVE_HOTSWAP
1323bool sd_removable(IF_MV_NONVOID(int drive)) 1325bool sd_removable(IF_MV_NONVOID(int drive))