PS2SDK
PS2 Homebrew Libraries
|
#include <types.h>
#include <defs.h>
#include <irx.h>
#include <loadcore.h>
#include <thbase.h>
#include <thevent.h>
#include <stdio.h>
#include <sysclib.h>
#include <atad.h>
#include <atahw.h>
Go to the source code of this file.
Data Structures | |
struct | _ata_cmd_info |
struct | _ata_cmd_state |
union | _ata_cmd_state.__unnamed113__ |
Macros | |
#define | MODNAME "atad" |
#define | M_PRINTF(format, args...) |
#define | BANNER "ATA device driver %s - Copyright (c) 2003 Marcus R. Brown\n" |
#define | VERSION "v1.2" |
#define | ATA_XFER_MODE_PIO 0x08 |
#define | ATA_XFER_MODE_UDMA 0x40 |
#define | ATA_EV_TIMEOUT 1 |
#define | ATA_EV_COMPLETE 2 |
#define | ATA_CMD_TABLE_SIZE (sizeof ata_cmd_table / sizeof(ata_cmd_info_t)) |
#define | SEC_CTRL_CMD_TABLE_SIZE (sizeof sec_ctrl_cmd_table / sizeof(ata_cmd_info_t)) |
#define | SMART_CMD_TABLE_SIZE (sizeof smart_cmd_table / sizeof(ata_cmd_info_t)) |
#define | ATA_WAIT_BUSY 0x80 |
#define | ATA_WAIT_BUSBUSY 0x88 |
#define | ata_wait_busy() |
#define | ata_wait_bus_busy() |
Typedefs | |
typedef struct _ata_cmd_info | ata_cmd_info_t |
typedef struct _ata_cmd_state | ata_cmd_state_t |
Functions | |
IRX_ID (MODNAME, 2, 7) | |
static unsigned int | ata_alarm_cb (void *unused) |
static void | ata_shutdown_cb (void) |
int | ata_device_sector_io64 (int device, void *buf, u64 lba, u32 nsectors, int dir) |
static int | ata_create_event_flag (void) |
int | _start (int argc, char *argv[]) |
int | _exit (void) |
int | sceAtaGetError (void) |
static int | gen_ata_wait_busy (int bits) |
static int | ata_device_select (int device) |
int | sceAtaExecCmd (void *buf, u32 blkcount, u16 feature, u16 nsector, u16 sector, u16 lcyl, u16 hcyl, u16 select, u16 command) |
static int | ata_pio_transfer (ata_cmd_state_t *cmd_state) |
int | sceAtaWaitResult (void) |
static int | ata_bus_reset (void) |
int | sceAtaSoftReset (void) |
int | sceAtaFlushCache (int device) |
int | sceAtaIdle (int device, int period) |
static int | ata_device_identify (int device, void *info) |
static int | ata_device_pkt_identify (int device, void *info) |
int | sceAtaGetSceId (int device, void *data) |
static int | ata_device_smart_enable (int device) |
int | sceAtaSmartSaveAttr (int device) |
int | sceAtaSmartReturnStatus (int device) |
static int | ata_device_set_transfer_mode (int device, int type, int mode) |
int | sceAtaDmaTransfer (int device, void *buf, u32 lba, u32 nsectors, int dir) |
static void | ata_get_security_status (int device, ata_devinfo_t *devinfo, u16 *param) |
int | sceAtaSecuritySetPassword (int device, void *password) |
int | sceAtaSecurityUnLock (int device, void *password) |
int | sceAtaSecurityEraseUnit (int device) |
static void | ata_device_probe (ata_devinfo_t *devinfo) |
static int | ata_init_devices (ata_devinfo_t *devinfo) |
ata_devinfo_t * | sceAtaInit (int device) |
int | sceAtaIdleImmediate (int device) |
static int | ata_device_standby_immediate (int device) |
Variables | |
static int | ata_devinfo_init = 0 |
static int | ata_evflg = -1 |
static u8 | ata_dvrp_workaround = 0 |
static ata_devinfo_t | atad_devinfo [2] |
static u16 | ata_param [256] |
static const ata_cmd_info_t | ata_cmd_table [] |
static const ata_cmd_info_t | sec_ctrl_cmd_table [] |
static const ata_cmd_info_t | smart_cmd_table [] |
static ata_cmd_state_t | atad_cmd_state |
struct irx_export_table | _exp_atad |
ATA device driver. This module provides the low-level ATA support for hard disk drives, based on ATAD v2.7. It is 100% compatible with its proprietary counterpart called atad.irx.
This module also include support for 48-bit feature set (done by Clement). To avoid causing an "emergency park" for some HDDs, shutdown callback 15 of dev9 is used for issuing the STANDBY IMMEDIATE command prior to DEV9 getting shut down.
Definition in file ps2atad.c.
union _ata_cmd_state.__unnamed113__ |
#define M_PRINTF | ( | format, | |
args... ) |
#define BANNER "ATA device driver %s - Copyright (c) 2003 Marcus R. Brown\n" |
#define ATA_CMD_TABLE_SIZE (sizeof ata_cmd_table / sizeof(ata_cmd_info_t)) |
#define SEC_CTRL_CMD_TABLE_SIZE (sizeof sec_ctrl_cmd_table / sizeof(ata_cmd_info_t)) |
#define SMART_CMD_TABLE_SIZE (sizeof smart_cmd_table / sizeof(ata_cmd_info_t)) |
#define ata_wait_busy | ( | ) |
#define ata_wait_bus_busy | ( | ) |
int ata_device_sector_io64 | ( | int | device, |
void * | buf, | ||
u64 | lba, | ||
u32 | nsectors, | ||
int | dir ) |
int sceAtaExecCmd | ( | void * | buf, |
u32 | blkcount, | ||
u16 | feature, | ||
u16 | nsector, | ||
u16 | sector, | ||
u16 | lcyl, | ||
u16 | hcyl, | ||
u16 | select, | ||
u16 | command ) |
|
static |
|
static |
|
static |
|
static |
int sceAtaDmaTransfer | ( | int | device, |
void * | buf, | ||
u32 | lba, | ||
u32 | nsectors, | ||
int | dir ) |
|
static |
int sceAtaSecuritySetPassword | ( | int | device, |
void * | password ) |
|
static |
|
static |
ata_devinfo_t * sceAtaInit | ( | int | device | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |