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. */
32 ata_devinfo_t
* ata_get_devinfo(int device
);
33 int ata_io_start(void *buf
, u32 blkcount
, u16 feature
, u16 nsector
, u16 sector
,
34 u16 lcyl
, u16 hcyl
, u16 select
, u16 command
);
35 int ata_io_finish(void);
36 int ata_get_error(void);
37 int ata_device_dma_transfer(int device
, void *buf
, u32 lba
, u32 nsectors
, int dir
);
40 #define APA_MAGIC 0x00415041 // 'APA\0'
42 #define APA_MAXSUB 64 // Maximum # of sub-partitions
44 #define APA_FLAG_SUB 0x0001
45 #define APA_MBR_VERSION 2
57 typedef struct // size = 1024
59 u32 checksum
; // HDL uses 0xdeadfeed magic here
69 u32 part_offset
; // in MB
70 u32 data_start
; // in sectors
71 u32 part_size
; // in KB
75 #endif /* IOP_ATAD_H */