PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
atad.h File Reference
#include <types.h>
#include <irx.h>
+ Include dependency graph for atad.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _ata_devinfo
 

Macros

#define ATA_DIR_READ   0
 
#define ATA_DIR_WRITE   1
 
#define ATA_RES_ERR_NOTREADY   -501
 
#define ATA_RES_ERR_TIMEOUT   -502
 
#define ATA_RES_ERR_IO   -503
 
#define ATA_RES_ERR_NODATA   -504
 
#define ATA_RES_ERR_NODEV   -505
 
#define ATA_RES_ERR_CMD   -506
 
#define ATA_RES_ERR_LOCKED   -509
 
#define ATA_RES_ERR_ICRC   -510
 
#define atad_IMPORTS_start   DECLARE_IMPORT_TABLE(atad, 1, 3)
 
#define atad_IMPORTS_end   END_IMPORT_TABLE
 
#define I_sceAtaInit   DECLARE_IMPORT(4, sceAtaInit)
 
#define I_sceAtaSoftReset   DECLARE_IMPORT(5, sceAtaSoftReset)
 
#define I_sceAtaExecCmd   DECLARE_IMPORT(6, sceAtaExecCmd)
 
#define I_sceAtaWaitResult   DECLARE_IMPORT(7, sceAtaWaitResult)
 
#define I_sceAtaGetError   DECLARE_IMPORT(8, sceAtaGetError)
 
#define I_sceAtaDmaTransfer   DECLARE_IMPORT(9, sceAtaDmaTransfer)
 
#define I_sceAtaSecuritySetPassword   DECLARE_IMPORT(10, sceAtaSecuritySetPassword)
 
#define I_sceAtaSecurityUnLock   DECLARE_IMPORT(11, sceAtaSecurityUnLock)
 
#define I_sceAtaSecurityEraseUnit   DECLARE_IMPORT(12, sceAtaSecurityEraseUnit)
 
#define I_sceAtaIdle   DECLARE_IMPORT(13, sceAtaIdle)
 
#define I_sceAtaGetSceId   DECLARE_IMPORT(14, sceAtaGetSceId)
 
#define I_sceAtaSmartReturnStatus   DECLARE_IMPORT(15, sceAtaSmartReturnStatus)
 
#define I_sceAtaSmartSaveAttr   DECLARE_IMPORT(16, sceAtaSmartSaveAttr)
 
#define I_sceAtaFlushCache   DECLARE_IMPORT(17, sceAtaFlushCache)
 
#define I_sceAtaIdleImmediate   DECLARE_IMPORT(18, sceAtaIdleImmediate)
 
#define I_ata_device_sector_io64   DECLARE_IMPORT(19, ata_device_sector_io64)
 
#define ata_get_devinfo   sceAtaInit
 
#define ata_reset_devices   sceAtaSoftReset
 
#define ata_io_start   sceAtaExecCmd
 
#define ata_io_finish   sceAtaWaitResult
 
#define ata_get_error   sceAtaGetError
 
#define ata_device_sector_io   sceAtaDmaTransfer
 
#define ata_device_sce_sec_set_password   sceAtaSecuritySetPassword
 
#define ata_device_sce_sec_unlock   sceAtaSecurityUnLock
 
#define ata_device_sce_sec_erase   sceAtaSecurityEraseUnit
 
#define ata_device_idle   sceAtaIdle
 
#define ata_device_sce_identify_drive   sceAtaGetSceId
 
#define ata_device_smart_get_status   sceAtaSmartReturnStatus
 
#define ata_device_smart_save_attr   sceAtaSmartSaveAttr
 
#define ata_device_flush_cache   sceAtaFlushCache
 
#define ata_device_idle_immediate   sceAtaIdleImmediate
 
#define ata_device_dma_transfer   sceAtaDmaTransfer
 
#define I_ata_get_devinfo   I_sceAtaInit
 
#define I_ata_reset_devices   I_sceAtaSoftReset
 
#define I_ata_io_start   I_sceAtaExecCmd
 
#define I_ata_io_finish   I_sceAtaWaitResult
 
#define I_ata_get_error   I_sceAtaGetError
 
#define I_ata_device_sector_io   I_sceAtaDmaTransfer
 
#define I_ata_device_sce_sec_set_password   I_sceAtaSecuritySetPassword
 
#define I_ata_device_sce_sec_unlock   I_sceAtaSecurityUnLock
 
#define I_ata_device_sce_sec_erase   I_sceAtaSecurityEraseUnit
 
#define I_ata_device_idle   I_sceAtaIdle
 
#define I_ata_device_sce_identify_drive   I_sceAtaGetSceId
 
#define I_ata_device_smart_get_status   I_sceAtaSmartReturnStatus
 
#define I_ata_device_smart_save_attr   I_sceAtaSmartSaveAttr
 
#define I_ata_device_flush_cache   I_sceAtaFlushCache
 
#define I_ata_device_idle_immediate   I_sceAtaIdleImmediate
 
#define I_ata_device_dma_transfer   I_sceAtaDmaTransfer
 

Typedefs

typedef struct _ata_devinfo ata_devinfo_t
 

Functions

ata_devinfo_tsceAtaInit (int device)
 
int sceAtaSoftReset (void)
 
int sceAtaExecCmd (void *buf, u32 blkcount, u16 feature, u16 nsector, u16 sector, u16 lcyl, u16 hcyl, u16 select, u16 command)
 
int sceAtaWaitResult (void)
 
int sceAtaGetError (void)
 
int sceAtaDmaTransfer (int device, void *buf, u32 lba, u32 nsectors, int dir)
 
int sceAtaSecuritySetPassword (int device, void *password)
 
int sceAtaSecurityUnLock (int device, void *password)
 
int sceAtaSecurityEraseUnit (int device)
 
int sceAtaIdle (int device, int period)
 
int sceAtaGetSceId (int device, void *data)
 
int sceAtaSmartReturnStatus (int device)
 
int sceAtaSmartSaveAttr (int device)
 
int sceAtaFlushCache (int device)
 
int sceAtaIdleImmediate (int device)
 
int ata_device_sector_io64 (int device, void *buf, u64 lba, u32 nsectors, int dir)
 

Detailed Description

ATA Device Driver definitions and imports.

Definition in file atad.h.


Data Structure Documentation

◆ _ata_devinfo

struct _ata_devinfo

Definition at line 26 of file atad.h.

Data Fields
s32 exists

Was successfully probed.

s32 has_packet

Supports the PACKET command set.

u32 total_sectors

Total number of user sectors.

u32 security_status

Word 0x100 of the identify info.

u32 lba48

Supports the 48-bit LBA command set (unofficial).

u32 total_sectors_lba48

Total number of 48-bit LBA user sectors (unofficial).

Macro Definition Documentation

◆ ATA_DIR_READ

#define ATA_DIR_READ   0

Definition at line 23 of file atad.h.

◆ ATA_DIR_WRITE

#define ATA_DIR_WRITE   1

Definition at line 24 of file atad.h.

◆ ATA_RES_ERR_NOTREADY

#define ATA_RES_ERR_NOTREADY   -501

Definition at line 43 of file atad.h.

◆ ATA_RES_ERR_TIMEOUT

#define ATA_RES_ERR_TIMEOUT   -502

Definition at line 44 of file atad.h.

◆ ATA_RES_ERR_IO

#define ATA_RES_ERR_IO   -503

Definition at line 45 of file atad.h.

◆ ATA_RES_ERR_NODATA

#define ATA_RES_ERR_NODATA   -504

Definition at line 46 of file atad.h.

◆ ATA_RES_ERR_NODEV

#define ATA_RES_ERR_NODEV   -505

Definition at line 47 of file atad.h.

◆ ATA_RES_ERR_CMD

#define ATA_RES_ERR_CMD   -506

Definition at line 48 of file atad.h.

◆ ATA_RES_ERR_LOCKED

#define ATA_RES_ERR_LOCKED   -509

Definition at line 49 of file atad.h.

◆ ATA_RES_ERR_ICRC

#define ATA_RES_ERR_ICRC   -510

Definition at line 50 of file atad.h.

◆ atad_IMPORTS_start

#define atad_IMPORTS_start   DECLARE_IMPORT_TABLE(atad, 1, 3)

Definition at line 77 of file atad.h.

◆ atad_IMPORTS_end

#define atad_IMPORTS_end   END_IMPORT_TABLE

Definition at line 78 of file atad.h.

◆ I_sceAtaInit

#define I_sceAtaInit   DECLARE_IMPORT(4, sceAtaInit)

Definition at line 80 of file atad.h.

◆ I_sceAtaSoftReset

#define I_sceAtaSoftReset   DECLARE_IMPORT(5, sceAtaSoftReset)

Definition at line 81 of file atad.h.

◆ I_sceAtaExecCmd

#define I_sceAtaExecCmd   DECLARE_IMPORT(6, sceAtaExecCmd)

Definition at line 82 of file atad.h.

◆ I_sceAtaWaitResult

#define I_sceAtaWaitResult   DECLARE_IMPORT(7, sceAtaWaitResult)

Definition at line 83 of file atad.h.

◆ I_sceAtaGetError

#define I_sceAtaGetError   DECLARE_IMPORT(8, sceAtaGetError)

Definition at line 84 of file atad.h.

◆ I_sceAtaDmaTransfer

#define I_sceAtaDmaTransfer   DECLARE_IMPORT(9, sceAtaDmaTransfer)

Definition at line 85 of file atad.h.

◆ I_sceAtaSecuritySetPassword

#define I_sceAtaSecuritySetPassword   DECLARE_IMPORT(10, sceAtaSecuritySetPassword)

Definition at line 86 of file atad.h.

◆ I_sceAtaSecurityUnLock

#define I_sceAtaSecurityUnLock   DECLARE_IMPORT(11, sceAtaSecurityUnLock)

Definition at line 87 of file atad.h.

◆ I_sceAtaSecurityEraseUnit

#define I_sceAtaSecurityEraseUnit   DECLARE_IMPORT(12, sceAtaSecurityEraseUnit)

Definition at line 88 of file atad.h.

◆ I_sceAtaIdle

#define I_sceAtaIdle   DECLARE_IMPORT(13, sceAtaIdle)

Definition at line 89 of file atad.h.

◆ I_sceAtaGetSceId

#define I_sceAtaGetSceId   DECLARE_IMPORT(14, sceAtaGetSceId)

Definition at line 90 of file atad.h.

◆ I_sceAtaSmartReturnStatus

#define I_sceAtaSmartReturnStatus   DECLARE_IMPORT(15, sceAtaSmartReturnStatus)

Definition at line 91 of file atad.h.

◆ I_sceAtaSmartSaveAttr

#define I_sceAtaSmartSaveAttr   DECLARE_IMPORT(16, sceAtaSmartSaveAttr)

Definition at line 92 of file atad.h.

◆ I_sceAtaFlushCache

#define I_sceAtaFlushCache   DECLARE_IMPORT(17, sceAtaFlushCache)

Definition at line 93 of file atad.h.

◆ I_sceAtaIdleImmediate

#define I_sceAtaIdleImmediate   DECLARE_IMPORT(18, sceAtaIdleImmediate)

Definition at line 94 of file atad.h.

◆ I_ata_device_sector_io64

#define I_ata_device_sector_io64   DECLARE_IMPORT(19, ata_device_sector_io64)

Definition at line 95 of file atad.h.

◆ ata_get_devinfo

#define ata_get_devinfo   sceAtaInit

Definition at line 98 of file atad.h.

◆ ata_reset_devices

#define ata_reset_devices   sceAtaSoftReset

Definition at line 99 of file atad.h.

◆ ata_io_start

#define ata_io_start   sceAtaExecCmd

Definition at line 100 of file atad.h.

◆ ata_io_finish

#define ata_io_finish   sceAtaWaitResult

Definition at line 101 of file atad.h.

◆ ata_get_error

#define ata_get_error   sceAtaGetError

Definition at line 102 of file atad.h.

◆ ata_device_sector_io

#define ata_device_sector_io   sceAtaDmaTransfer

Definition at line 103 of file atad.h.

◆ ata_device_sce_sec_set_password

#define ata_device_sce_sec_set_password   sceAtaSecuritySetPassword

Definition at line 104 of file atad.h.

◆ ata_device_sce_sec_unlock

#define ata_device_sce_sec_unlock   sceAtaSecurityUnLock

Definition at line 105 of file atad.h.

◆ ata_device_sce_sec_erase

#define ata_device_sce_sec_erase   sceAtaSecurityEraseUnit

Definition at line 106 of file atad.h.

◆ ata_device_idle

#define ata_device_idle   sceAtaIdle

Definition at line 107 of file atad.h.

◆ ata_device_sce_identify_drive

#define ata_device_sce_identify_drive   sceAtaGetSceId

Definition at line 108 of file atad.h.

◆ ata_device_smart_get_status

#define ata_device_smart_get_status   sceAtaSmartReturnStatus

Definition at line 109 of file atad.h.

◆ ata_device_smart_save_attr

#define ata_device_smart_save_attr   sceAtaSmartSaveAttr

Definition at line 110 of file atad.h.

◆ ata_device_flush_cache

#define ata_device_flush_cache   sceAtaFlushCache

Definition at line 111 of file atad.h.

◆ ata_device_idle_immediate

#define ata_device_idle_immediate   sceAtaIdleImmediate

Definition at line 112 of file atad.h.

◆ ata_device_dma_transfer

#define ata_device_dma_transfer   sceAtaDmaTransfer

Definition at line 113 of file atad.h.

◆ I_ata_get_devinfo

#define I_ata_get_devinfo   I_sceAtaInit

Definition at line 115 of file atad.h.

◆ I_ata_reset_devices

#define I_ata_reset_devices   I_sceAtaSoftReset

Definition at line 116 of file atad.h.

◆ I_ata_io_start

#define I_ata_io_start   I_sceAtaExecCmd

Definition at line 117 of file atad.h.

◆ I_ata_io_finish

#define I_ata_io_finish   I_sceAtaWaitResult

Definition at line 118 of file atad.h.

◆ I_ata_get_error

#define I_ata_get_error   I_sceAtaGetError

Definition at line 119 of file atad.h.

◆ I_ata_device_sector_io

#define I_ata_device_sector_io   I_sceAtaDmaTransfer

Definition at line 120 of file atad.h.

◆ I_ata_device_sce_sec_set_password

#define I_ata_device_sce_sec_set_password   I_sceAtaSecuritySetPassword

Definition at line 121 of file atad.h.

◆ I_ata_device_sce_sec_unlock

#define I_ata_device_sce_sec_unlock   I_sceAtaSecurityUnLock

Definition at line 122 of file atad.h.

◆ I_ata_device_sce_sec_erase

#define I_ata_device_sce_sec_erase   I_sceAtaSecurityEraseUnit

Definition at line 123 of file atad.h.

◆ I_ata_device_idle

#define I_ata_device_idle   I_sceAtaIdle

Definition at line 124 of file atad.h.

◆ I_ata_device_sce_identify_drive

#define I_ata_device_sce_identify_drive   I_sceAtaGetSceId

Definition at line 125 of file atad.h.

◆ I_ata_device_smart_get_status

#define I_ata_device_smart_get_status   I_sceAtaSmartReturnStatus

Definition at line 126 of file atad.h.

◆ I_ata_device_smart_save_attr

#define I_ata_device_smart_save_attr   I_sceAtaSmartSaveAttr

Definition at line 127 of file atad.h.

◆ I_ata_device_flush_cache

#define I_ata_device_flush_cache   I_sceAtaFlushCache

Definition at line 128 of file atad.h.

◆ I_ata_device_idle_immediate

#define I_ata_device_idle_immediate   I_sceAtaIdleImmediate

Definition at line 129 of file atad.h.

◆ I_ata_device_dma_transfer

#define I_ata_device_dma_transfer   I_sceAtaDmaTransfer

Definition at line 130 of file atad.h.

Function Documentation

◆ sceAtaInit()

ata_devinfo_t * sceAtaInit ( int device)
extern

Definition at line 200 of file acatad.c.

◆ sceAtaSoftReset()

int sceAtaSoftReset ( void )
extern

Definition at line 227 of file acatad.c.

◆ sceAtaExecCmd()

int sceAtaExecCmd ( void * buf,
u32 blkcount,
u16 feature,
u16 nsector,
u16 sector,
u16 lcyl,
u16 hcyl,
u16 select,
u16 command )
extern

Definition at line 234 of file acatad.c.

◆ sceAtaWaitResult()

int sceAtaWaitResult ( void )
extern

Definition at line 251 of file acatad.c.

◆ sceAtaGetError()

int sceAtaGetError ( void )
extern

Definition at line 258 of file acatad.c.

◆ sceAtaDmaTransfer()

int sceAtaDmaTransfer ( int device,
void * buf,
u32 lba,
u32 nsectors,
int dir )
extern

Definition at line 265 of file acatad.c.

◆ sceAtaSecuritySetPassword()

int sceAtaSecuritySetPassword ( int device,
void * password )
extern

Definition at line 282 of file acatad.c.

◆ sceAtaSecurityUnLock()

int sceAtaSecurityUnLock ( int device,
void * password )
extern

Definition at line 292 of file acatad.c.

◆ sceAtaSecurityEraseUnit()

int sceAtaSecurityEraseUnit ( int device)
extern

Definition at line 301 of file acatad.c.

◆ sceAtaIdle()

int sceAtaIdle ( int device,
int period )
extern

Definition at line 310 of file acatad.c.

◆ sceAtaGetSceId()

int sceAtaGetSceId ( int device,
void * data )
extern

Definition at line 320 of file acatad.c.

◆ sceAtaSmartReturnStatus()

int sceAtaSmartReturnStatus ( int device)
extern

Definition at line 330 of file acatad.c.

◆ sceAtaSmartSaveAttr()

int sceAtaSmartSaveAttr ( int device)
extern

Definition at line 339 of file acatad.c.

◆ sceAtaFlushCache()

int sceAtaFlushCache ( int device)
extern

Definition at line 348 of file acatad.c.

◆ sceAtaIdleImmediate()

int sceAtaIdleImmediate ( int device)
extern

Definition at line 354 of file acatad.c.

◆ ata_device_sector_io64()

int ata_device_sector_io64 ( int device,
void * buf,
u64 lba,
u32 nsectors,
int dir )
extern

Definition at line 1023 of file ps2atad.c.