1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 by Alan Korr
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
25 #include "config.h" /* for HAVE_MULTIVOLUME or not */
26 #include "mv.h" /* for IF_MV() and friends */
30 void ata_enable(bool on
);
31 void ata_spindown(int seconds
);
33 void ata_sleepnow(void);
34 /* NOTE: DO NOT use this to poll for disk activity.
35 If you are waiting for the disk to become active before
36 doing something use ata_idle_notify.h
38 bool ata_disk_is_active(void);
39 int ata_soft_reset(void);
42 int ata_read_sectors(IF_MD2(int drive
,) unsigned long start
, int count
, void* buf
);
43 int ata_write_sectors(IF_MD2(int drive
,) unsigned long start
, int count
, const void* buf
);
45 #if (CONFIG_LED == LED_REAL)
46 void ata_set_led_enabled(bool enabled
);
48 unsigned short* ata_get_identify(void);
50 #ifdef STORAGE_GET_INFO
51 void ata_get_info(IF_MD2(int drive
,) struct storage_info
*info
);
54 bool ata_removable(IF_MD_NONVOID(int drive
));
55 bool ata_present(IF_MD_NONVOID(int drive
));
59 #ifdef CONFIG_STORAGE_MULTI
60 int ata_num_drives(int first_drive
);
64 long ata_last_disk_activity(void);
65 int ata_spinup_time(void); /* ticks */
68 /* Needed to allow updating while waiting for DMA to complete */
69 void ata_keep_active(void);
70 /* Returns current DMA mode */
71 int ata_get_dma_mode(void);
72 /* Set DMA mode for ATA interface */
73 void ata_dma_set_mode(unsigned char mode
);
74 /* Sets up DMA transfer */
75 bool ata_dma_setup(void *addr
, unsigned long bytes
, bool write
);
76 /* Waits for DMA transfer completion */
77 bool ata_dma_finish(void);
78 #endif /* HAVE_ATA_DMA */
80 #endif /* __ATA_H__ */