summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r--firmware/drivers/ata.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index adc720eaf8..3c37077fd3 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -307,7 +307,7 @@ static int _read_sectors(unsigned long start,
307 int incount, 307 int incount,
308 void* inbuf) 308 void* inbuf)
309#else 309#else
310int ata_read_sectors(IF_MV2(int drive,) 310int ata_read_sectors(IF_MD2(int drive,)
311 unsigned long start, 311 unsigned long start,
312 int incount, 312 int incount,
313 void* inbuf) 313 void* inbuf)
@@ -323,7 +323,7 @@ int ata_read_sectors(IF_MV2(int drive,)
323#endif 323#endif
324 324
325#ifndef MAX_PHYS_SECTOR_SIZE 325#ifndef MAX_PHYS_SECTOR_SIZE
326#ifdef HAVE_MULTIVOLUME 326#ifdef HAVE_MULTIDRIVE
327 (void)drive; /* unused for now */ 327 (void)drive; /* unused for now */
328#endif 328#endif
329 mutex_lock(&ata_mtx); 329 mutex_lock(&ata_mtx);
@@ -555,7 +555,7 @@ static int _write_sectors(unsigned long start,
555 int count, 555 int count,
556 const void* buf) 556 const void* buf)
557#else 557#else
558int ata_write_sectors(IF_MV2(int drive,) 558int ata_write_sectors(IF_MD2(int drive,)
559 unsigned long start, 559 unsigned long start,
560 int count, 560 int count,
561 const void* buf) 561 const void* buf)
@@ -569,7 +569,7 @@ int ata_write_sectors(IF_MV2(int drive,)
569#endif 569#endif
570 570
571#ifndef MAX_PHYS_SECTOR_SIZE 571#ifndef MAX_PHYS_SECTOR_SIZE
572#ifdef HAVE_MULTIVOLUME 572#ifdef HAVE_MULTIDRIVE
573 (void)drive; /* unused for now */ 573 (void)drive; /* unused for now */
574#endif 574#endif
575 mutex_lock(&ata_mtx); 575 mutex_lock(&ata_mtx);
@@ -728,7 +728,7 @@ static inline int flush_current_sector(void)
728 sector_cache.data); 728 sector_cache.data);
729} 729}
730 730
731int ata_read_sectors(IF_MV2(int drive,) 731int ata_read_sectors(IF_MD2(int drive,)
732 unsigned long start, 732 unsigned long start,
733 int incount, 733 int incount,
734 void* inbuf) 734 void* inbuf)
@@ -736,7 +736,7 @@ int ata_read_sectors(IF_MV2(int drive,)
736 int rc = 0; 736 int rc = 0;
737 int offset; 737 int offset;
738 738
739#ifdef HAVE_MULTIVOLUME 739#ifdef HAVE_MULTIDRIVE
740 (void)drive; /* unused for now */ 740 (void)drive; /* unused for now */
741#endif 741#endif
742 mutex_lock(&ata_mtx); 742 mutex_lock(&ata_mtx);
@@ -794,7 +794,7 @@ int ata_read_sectors(IF_MV2(int drive,)
794 return rc; 794 return rc;
795} 795}
796 796
797int ata_write_sectors(IF_MV2(int drive,) 797int ata_write_sectors(IF_MD2(int drive,)
798 unsigned long start, 798 unsigned long start,
799 int count, 799 int count,
800 const void* buf) 800 const void* buf)
@@ -802,7 +802,7 @@ int ata_write_sectors(IF_MV2(int drive,)
802 int rc = 0; 802 int rc = 0;
803 int offset; 803 int offset;
804 804
805#ifdef HAVE_MULTIVOLUME 805#ifdef HAVE_MULTIDRIVE
806 (void)drive; /* unused for now */ 806 (void)drive; /* unused for now */
807#endif 807#endif
808 mutex_lock(&ata_mtx); 808 mutex_lock(&ata_mtx);
@@ -1503,7 +1503,7 @@ int ata_init(void)
1503 create_thread(ata_thread, ata_stack, 1503 create_thread(ata_thread, ata_stack,
1504 sizeof(ata_stack), 0, ata_thread_name 1504 sizeof(ata_stack), 0, ata_thread_name
1505 IF_PRIO(, PRIORITY_USER_INTERFACE) 1505 IF_PRIO(, PRIORITY_USER_INTERFACE)
1506 IF_COP(, CPU)); 1506 IF_COP(, CPU));
1507 initialized = true; 1507 initialized = true;
1508 1508
1509 } 1509 }
@@ -1552,12 +1552,15 @@ int ata_spinup_time(void)
1552} 1552}
1553 1553
1554#ifdef STORAGE_GET_INFO 1554#ifdef STORAGE_GET_INFO
1555void ata_get_info(struct storage_info *info) 1555void ata_get_info(IF_MD2(int drive,)struct storage_info *info)
1556{ 1556{
1557 unsigned short *src,*dest; 1557 unsigned short *src,*dest;
1558 static char vendor[8]; 1558 static char vendor[8];
1559 static char product[16]; 1559 static char product[16];
1560 static char revision[4]; 1560 static char revision[4];
1561#ifdef HAVE_MULTIDRIVE
1562 (void)drive; /* unused for now */
1563#endif
1561 int i; 1564 int i;
1562 info->sector_size = SECTOR_SIZE; 1565 info->sector_size = SECTOR_SIZE;
1563 info->num_sectors= total_sectors; 1566 info->num_sectors= total_sectors;
@@ -1595,3 +1598,13 @@ void ata_keep_active(void)
1595 last_disk_activity = current_tick; 1598 last_disk_activity = current_tick;
1596} 1599}
1597#endif 1600#endif
1601
1602#ifdef CONFIG_STORAGE_MULTI
1603int ata_num_drives(int first_drive)
1604{
1605 /* We don't care which logical drive number(s) we have been assigned */
1606 (void)first_drive;
1607
1608 return 1;
1609}
1610#endif