1 | /*********************************************************************
|
---|
2 | * Copyright (C) 2003 Tord Lindstrom (pukko@home.se)
|
---|
3 | * This file is subject to the terms and conditions of the PS2Link License.
|
---|
4 | * See the file LICENSE in the main directory of this distribution for more
|
---|
5 | * details.
|
---|
6 | */
|
---|
7 |
|
---|
8 | #define PKO_PORT 0x4711
|
---|
9 | #define PKO_CMD_PORT 0x4712
|
---|
10 | #define PKO_PRINTF_PORT 0x4712
|
---|
11 |
|
---|
12 | #define PKO_OPEN_CMD 0xbabe0111
|
---|
13 | #define PKO_OPEN_RLY 0xbabe0112
|
---|
14 | #define PKO_CLOSE_CMD 0xbabe0121
|
---|
15 | #define PKO_CLOSE_RLY 0xbabe0122
|
---|
16 | #define PKO_READ_CMD 0xbabe0131
|
---|
17 | #define PKO_READ_RLY 0xbabe0132
|
---|
18 | #define PKO_WRITE_CMD 0xbabe0141
|
---|
19 | #define PKO_WRITE_RLY 0xbabe0142
|
---|
20 | #define PKO_LSEEK_CMD 0xbabe0151
|
---|
21 | #define PKO_LSEEK_RLY 0xbabe0152
|
---|
22 | #define PKO_OPENDIR_CMD 0xbabe0161
|
---|
23 | #define PKO_OPENDIR_RLY 0xbabe0162
|
---|
24 | #define PKO_CLOSEDIR_CMD 0xbabe0171
|
---|
25 | #define PKO_CLOSEDIR_RLY 0xbabe0172
|
---|
26 | #define PKO_READDIR_CMD 0xbabe0181
|
---|
27 | #define PKO_READDIR_RLY 0xbabe0182
|
---|
28 |
|
---|
29 | #define PKO_REMOVE_CMD 0xbabe0191
|
---|
30 | #define PKO_REMOVE_RLY 0xbabe0192
|
---|
31 | #define PKO_MKDIR_CMD 0xbabe01A1
|
---|
32 | #define PKO_MKDIR_RLY 0xbabe01A2
|
---|
33 | #define PKO_RMDIR_CMD 0xbabe01B1
|
---|
34 | #define PKO_RMDIR_RLY 0xbabe01B2
|
---|
35 |
|
---|
36 | #define PKO_IOCTL_CMD 0xbabe01C1 //dlanor: Added for Rename capability
|
---|
37 | #define PKO_IOCTL_RLY 0xbabe01C2 //dlanor: Added for Rename capability
|
---|
38 |
|
---|
39 | #define PKO_RESET_CMD 0xbabe0201
|
---|
40 | #define PKO_EXECIOP_CMD 0xbabe0202
|
---|
41 | #define PKO_EXECEE_CMD 0xbabe0203
|
---|
42 | #define PKO_POWEROFF_CMD 0xbabe0204
|
---|
43 | #define PKO_SCRDUMP_CMD 0xbabe0205
|
---|
44 | #define PKO_NETDUMP_CMD 0xbabe0206
|
---|
45 |
|
---|
46 | #define PKO_DUMP_MEM 0xbabe0207
|
---|
47 | #define PKO_START_VU 0xbabe0208
|
---|
48 | #define PKO_STOP_VU 0xbabe0209
|
---|
49 | #define PKO_DUMP_REG 0xbabe020a
|
---|
50 | #define PKO_GSEXEC_CMD 0xbabe020b
|
---|
51 | #define PKO_WRITE_MEM 0xbabe020c
|
---|
52 | #define PKO_IOPEXCEP_CMD 0xbabe020d
|
---|
53 |
|
---|
54 | #define PKO_RPC_RESET 1
|
---|
55 | #define PKO_RPC_EXECEE 2
|
---|
56 | #define PKO_RPC_DUMMY 3
|
---|
57 | #define PKO_RPC_SCRDUMP 4
|
---|
58 | #define PKO_RPC_NETDUMP 5
|
---|
59 | #define PKO_RPC_STARTVU 6
|
---|
60 | #define PKO_RPC_STOPVU 7
|
---|
61 | #define PKO_RPC_DUMPMEM 8
|
---|
62 | #define PKO_RPC_DUMPREG 9
|
---|
63 | #define PKO_RPC_GSEXEC 10
|
---|
64 |
|
---|
65 | #define PKO_MAX_PATH 256
|
---|
66 |
|
---|
67 | #define REGDMA 0
|
---|
68 | #define REGINTC 1
|
---|
69 | #define REGTIMER 2
|
---|
70 | #define REGGS 3
|
---|
71 | #define REGSIF 4
|
---|
72 | #define REGFIFO 5
|
---|
73 | #define REGGIF 6
|
---|
74 | #define REGVIF0 7
|
---|
75 | #define REGVIF1 8
|
---|
76 | #define REGIPU 9
|
---|
77 | #define REGALL 10
|
---|
78 | #define REGVU0 11
|
---|
79 | #define REGVU1 12
|
---|
80 |
|
---|
81 | typedef struct
|
---|
82 | {
|
---|
83 | unsigned int cmd;
|
---|
84 | unsigned short len;
|
---|
85 | } __attribute__((packed)) pko_pkt_hdr;
|
---|
86 |
|
---|
87 | typedef struct
|
---|
88 | {
|
---|
89 | unsigned int cmd;
|
---|
90 | unsigned short len;
|
---|
91 | unsigned int retval;
|
---|
92 | } __attribute__((packed)) pko_pkt_file_rly;
|
---|
93 |
|
---|
94 | typedef struct
|
---|
95 | {
|
---|
96 | unsigned int cmd;
|
---|
97 | unsigned short len;
|
---|
98 | int flags;
|
---|
99 | char path[PKO_MAX_PATH];
|
---|
100 | } __attribute__((packed)) pko_pkt_open_req;
|
---|
101 |
|
---|
102 | typedef struct
|
---|
103 | {
|
---|
104 | unsigned int cmd;
|
---|
105 | unsigned short len;
|
---|
106 | int fd;
|
---|
107 | } __attribute__((packed)) pko_pkt_close_req;
|
---|
108 |
|
---|
109 | typedef struct
|
---|
110 | {
|
---|
111 | unsigned int cmd;
|
---|
112 | unsigned short len;
|
---|
113 | int fd;
|
---|
114 | int nbytes;
|
---|
115 | } __attribute__((packed)) pko_pkt_read_req;
|
---|
116 |
|
---|
117 | typedef struct
|
---|
118 | {
|
---|
119 | unsigned int cmd;
|
---|
120 | unsigned short len;
|
---|
121 | int retval;
|
---|
122 | int nbytes;
|
---|
123 | } __attribute__((packed)) pko_pkt_read_rly;
|
---|
124 |
|
---|
125 | typedef struct
|
---|
126 | {
|
---|
127 | unsigned int cmd;
|
---|
128 | unsigned short len;
|
---|
129 | int fd;
|
---|
130 | int nbytes;
|
---|
131 | } __attribute__((packed)) pko_pkt_write_req;
|
---|
132 |
|
---|
133 | typedef struct
|
---|
134 | {
|
---|
135 | unsigned int cmd;
|
---|
136 | unsigned short len;
|
---|
137 | int fd;
|
---|
138 | int offset;
|
---|
139 | int whence;
|
---|
140 | } __attribute__((packed)) pko_pkt_lseek_req;
|
---|
141 |
|
---|
142 | typedef struct
|
---|
143 | {
|
---|
144 | unsigned int cmd;
|
---|
145 | unsigned short len;
|
---|
146 | char name[PKO_MAX_PATH];
|
---|
147 | } __attribute__((packed)) pko_pkt_remove_req;
|
---|
148 |
|
---|
149 | typedef struct
|
---|
150 | {
|
---|
151 | unsigned int cmd;
|
---|
152 | unsigned short len;
|
---|
153 | int fd;
|
---|
154 | int request;
|
---|
155 | char data[256];
|
---|
156 | } __attribute__((packed)) pko_pkt_ioctl_req;
|
---|
157 |
|
---|
158 | typedef struct
|
---|
159 | {
|
---|
160 | unsigned int cmd;
|
---|
161 | unsigned short len;
|
---|
162 | int mode;
|
---|
163 | char name[PKO_MAX_PATH];
|
---|
164 | } __attribute__((packed)) pko_pkt_mkdir_req;
|
---|
165 |
|
---|
166 | typedef struct
|
---|
167 | {
|
---|
168 | unsigned int cmd;
|
---|
169 | unsigned short len;
|
---|
170 | char name[PKO_MAX_PATH];
|
---|
171 | } __attribute__((packed)) pko_pkt_rmdir_req;
|
---|
172 |
|
---|
173 | typedef struct
|
---|
174 | {
|
---|
175 | unsigned int cmd;
|
---|
176 | unsigned short len;
|
---|
177 | int fd;
|
---|
178 | } __attribute__((packed)) pko_pkt_dread_req;
|
---|
179 |
|
---|
180 | typedef struct
|
---|
181 | {
|
---|
182 | unsigned int cmd;
|
---|
183 | unsigned short len;
|
---|
184 | int retval;
|
---|
185 | /* from io_common.h (fio_dirent_t) in ps2lib */
|
---|
186 | unsigned int mode;
|
---|
187 | unsigned int attr;
|
---|
188 | unsigned int size;
|
---|
189 | unsigned char ctime[8];
|
---|
190 | unsigned char atime[8];
|
---|
191 | unsigned char mtime[8];
|
---|
192 | unsigned int hisize;
|
---|
193 | char name[256];
|
---|
194 | } __attribute__((packed)) pko_pkt_dread_rly;
|
---|
195 |
|
---|
196 | ////
|
---|
197 |
|
---|
198 | typedef struct
|
---|
199 | {
|
---|
200 | unsigned int cmd;
|
---|
201 | unsigned short len;
|
---|
202 | } __attribute__((packed)) pko_pkt_reset_req;
|
---|
203 |
|
---|
204 | typedef struct
|
---|
205 | {
|
---|
206 | unsigned int cmd;
|
---|
207 | unsigned short len;
|
---|
208 | int argc;
|
---|
209 | char argv[PKO_MAX_PATH];
|
---|
210 | } __attribute__((packed)) pko_pkt_execee_req;
|
---|
211 |
|
---|
212 | typedef struct
|
---|
213 | {
|
---|
214 | unsigned int cmd;
|
---|
215 | unsigned short len;
|
---|
216 | int argc;
|
---|
217 | char argv[PKO_MAX_PATH];
|
---|
218 | } __attribute__((packed)) pko_pkt_execiop_req;
|
---|
219 |
|
---|
220 | typedef struct
|
---|
221 | {
|
---|
222 | unsigned int cmd;
|
---|
223 | unsigned short len;
|
---|
224 | unsigned short size;
|
---|
225 | unsigned char file[PKO_MAX_PATH];
|
---|
226 | } __attribute__((packed)) pko_pkt_gsexec_req;
|
---|
227 |
|
---|
228 | typedef struct
|
---|
229 | {
|
---|
230 | unsigned int cmd;
|
---|
231 | unsigned short len;
|
---|
232 | } __attribute__((packed)) pko_pkt_poweroff_req;
|
---|
233 |
|
---|
234 | typedef struct
|
---|
235 | {
|
---|
236 | unsigned int cmd;
|
---|
237 | unsigned short len;
|
---|
238 | int vpu;
|
---|
239 | } __attribute__((packed)) pko_pkt_start_vu;
|
---|
240 |
|
---|
241 | typedef struct
|
---|
242 | {
|
---|
243 | unsigned int cmd;
|
---|
244 | unsigned short len;
|
---|
245 | int vpu;
|
---|
246 | } __attribute__((packed)) pko_pkt_stop_vu;
|
---|
247 |
|
---|
248 | typedef struct
|
---|
249 | {
|
---|
250 | unsigned int cmd;
|
---|
251 | unsigned short len;
|
---|
252 | unsigned int offset;
|
---|
253 | unsigned int size;
|
---|
254 | char argv[PKO_MAX_PATH];
|
---|
255 | } __attribute__((packed)) pko_pkt_mem_io;
|
---|
256 |
|
---|
257 | typedef struct {
|
---|
258 | unsigned int cmd;
|
---|
259 | unsigned short len;
|
---|
260 | int regs;
|
---|
261 | char argv[PKO_MAX_PATH];
|
---|
262 | } __attribute__((packed)) pko_pkt_dump_regs;
|
---|
263 |
|
---|
264 | typedef struct {
|
---|
265 | unsigned int cmd;
|
---|
266 | unsigned short len;
|
---|
267 | unsigned int regs[79];
|
---|
268 | } __attribute__((packed)) pko_pkt_send_regs;
|
---|
269 |
|
---|
270 |
|
---|
271 | #define PKO_MAX_WRITE_SEGMENT (1460 - sizeof(pko_pkt_write_req))
|
---|
272 | #define PKO_MAX_READ_SEGMENT (1460 - sizeof(pko_pkt_read_rly))
|
---|