2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
10 # $Id: atad.h 629 2004-10-11 00:45:00Z mrbrown $
11 # ATA Device Driver definitions and imports.
20 /* These are used with the dir parameter of ata_device_dma_transfer(). */
21 #define ATA_DIR_READ 0
22 #define ATA_DIR_WRITE 1
24 typedef struct _ata_devinfo
{
25 int exists
; /* Was successfully probed. */
26 int has_packet
; /* Supports the PACKET command set. */
27 u32 total_sectors
; /* Total number of user sectors. */
28 u32 security_status
;/* Word 0x100 of the identify info. */
31 #define atad_IMPORTS_start DECLARE_IMPORT_TABLE(atad, 1, 2)
32 #define atad_IMPORTS_end END_IMPORT_TABLE
34 ata_devinfo_t
* ata_get_devinfo(int device
);
35 #define I_ata_get_devinfo DECLARE_IMPORT(4, ata_get_devinfo)
37 int ata_reset_devices(void);
38 #define I_ata_reset_devices DECLARE_IMPORT(5, ata_reset_devices)
40 int ata_io_start(void *buf
, u32 blkcount
, u16 feature
, u16 nsector
, u16 sector
,
41 u16 lcyl
, u16 hcyl
, u16 select
, u16 command
);
42 #define I_ata_io_start DECLARE_IMPORT(6, ata_io_start)
43 int ata_io_finish(void);
44 #define I_ata_io_finish DECLARE_IMPORT(7, ata_io_finish)
46 int ata_get_error(void);
47 #define I_ata_get_error DECLARE_IMPORT(8, ata_get_error)
49 int ata_device_dma_transfer(int device
, void *buf
, u32 lba
, u32 nsectors
, int dir
);
50 #define I_ata_device_dma_transfer DECLARE_IMPORT(9, ata_device_dma_transfer)
52 int ata_device_sec_set_password(int device
, void *password
);
53 #define I_ata_device_sec_set_password DECLARE_IMPORT(10, ata_device_sec_set_password)
54 int ata_device_sec_unlock(int device
, void *password
);
55 #define I_ata_device_sec_unlock DECLARE_IMPORT(11, ata_device_sec_unlock)
56 int ata_device_sec_erase(int device
, void *password
);
57 #define I_ata_device_sec_erase DECLARE_IMPORT(12, ata_device_sec_erase)
58 int ata_device_idle(int device
, int period
);
59 #define I_ata_device_idle DECLARE_IMPORT(13, ata_device_idle)
60 int ata_device_sce_security_init(int device
, void *data
);
61 #define I_ata_device_sce_security_init DECLARE_IMPORT(14, ata_device_sce_security_init)
62 int ata_device_smart_get_status(int device
);
63 #define I_ata_device_smart_get_status DECLARE_IMPORT(15, ata_device_smart_get_status)
64 int ata_device_smart_save_attr(int device
);
65 #define I_ata_device_smart_save_attr DECLARE_IMPORT(16, ata_device_smart_save_attr)
66 int ata_device_flush_cache(int device
);
67 #define I_ata_device_flush_cache DECLARE_IMPORT(17, ata_device_flush_cache)
68 int ata_device_is_sce(int device
);
69 #define I_ata_device_is_sce DECLARE_IMPORT(18, ata_device_is_sce)
70 int ata_device_is_48bit(int device
);
71 #define I_ata_device_is_48bit DECLARE_IMPORT(19, ata_device_is_48bit)
72 int ata_device_set_transfer_mode(int device
, int type
, int mode
);
73 #define I_ata_device_set_transfer_mode DECLARE_IMPORT(20, ata_device_set_transfer_mode)
75 #endif /* IOP_ATAD_H */