PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
acata.h
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
11#ifndef _ACATA_H
12#define _ACATA_H
13
14#include <accore.h>
15
16typedef struct ac_ata acAtaData;
17typedef acAtaData *acAtaT;
18
19typedef void (*acAtaDone)(acAtaT ata, void *arg, int ret);
20
21typedef struct ac_ata_ops *acAtaOpsT;
22
24{
25 acQueueChainData a_chain;
26 acAtaOpsT a_ops;
27 void *a_arg;
28 void *a_buf;
29 acUint32 a_size;
30 acUint32 a_tmout;
31 acUint16 a_state;
32 acUint16 a_flag;
33};
34
36{
37 int (*ao_command)(struct ac_ata_h *atah, int cmdpri, int pri);
38 void (*ao_done)(struct ac_ata_h *atah, int result);
39 int (*ao_error)(struct ac_ata_h *atah, int ret);
40};
41
42typedef acUint16 acAtaCommandData;
43typedef acAtaCommandData *acAtaCommandT;
44
45struct ac_ata
46{
47 struct ac_ata_h ac_h;
48 acAtaDone ac_done;
49 acAtaCommandData ac_command[6];
50};
51
52typedef struct ac_atapi acAtapiData;
53typedef acAtapiData *acAtapiT;
54
55typedef void (*acAtapiDone)(acAtapiT atapi, void *arg, int ret);
56
58{
59 acUint8 u_b[12];
60 acUint16 u_h[6];
61 acUint32 u_w[3];
62};
63
66
68{
69 struct ac_ata_h ap_h;
70 acAtapiDone ap_done;
71 acAtapiPacketData ap_packet;
72};
73
74typedef volatile acUint16 *acAtaReg;
75
76extern int acAtaModuleRestart(int argc, char **argv);
77extern int acAtaModuleStart(int argc, char **argv);
78extern int acAtaModuleStatus();
79extern int acAtaModuleStop();
80extern acAtaT acAtaSetup(acAtaData *ata, acAtaDone done, void *arg, unsigned int tmout);
81extern int acAtaRequest(acAtaT ata, int flag, acAtaCommandData *cmd, int item, void *buf, int size);
82extern int acAtaRequestI(acAtaT ata, int flag, acAtaCommandData *cmd, int item, void *buf, int size);
83extern acAtaCommandData *acAtaReply(acAtaT ata);
84extern int acAtaStatus(acAtaT ata);
85extern acAtapiT acAtapiSetup(acAtapiData *atapi, acAtapiDone done, void *arg, unsigned int tmout);
86extern int acAtapiRequest(acAtapiT atapi, int flag, acAtapiPacketData *pkt, void *buf, int size);
87extern int acAtapiRequestI(acAtapiT atapi, int flag, acAtapiPacketData *pkt, void *buf, int size);
88extern int acAtapiStatus(acAtapiT atapi);
89extern int ata_probe(acAtaReg atareg);
90
91#define acata_IMPORTS_start DECLARE_IMPORT_TABLE(acata, 1, 1)
92#define acata_IMPORTS_end END_IMPORT_TABLE
93
94#define I_acAtaModuleRestart DECLARE_IMPORT(4, acAtaModuleRestart)
95#define I_acAtaModuleStart DECLARE_IMPORT(5, acAtaModuleStart)
96#define I_acAtaModuleStatus DECLARE_IMPORT(6, acAtaModuleStatus)
97#define I_acAtaModuleStop DECLARE_IMPORT(7, acAtaModuleStop)
98#define I_acAtaSetup DECLARE_IMPORT(8, acAtaSetup)
99#define I_acAtaRequest DECLARE_IMPORT(9, acAtaRequest)
100#define I_acAtaRequestI DECLARE_IMPORT(10, acAtaRequestI)
101#define I_acAtaReply DECLARE_IMPORT(11, acAtaReply)
102#define I_acAtaStatus DECLARE_IMPORT(12, acAtaStatus)
103#define I_acAtapiSetup DECLARE_IMPORT(13, acAtapiSetup)
104#define I_acAtapiRequest DECLARE_IMPORT(14, acAtapiRequest)
105#define I_acAtapiRequestI DECLARE_IMPORT(15, acAtapiRequestI)
106#define I_acAtapiStatus DECLARE_IMPORT(16, acAtapiStatus)
107#define I_ata_probe DECLARE_IMPORT(17, ata_probe)
108
109#endif
Definition acata.h:46