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
8 #define PKO_PORT 0x4711
9 #define PKO_CMD_PORT 0x4712
10 #define PKO_PRINTF_PORT 0x4712
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 #define PKO_REMOVE_CMD 0xbabe0191
29 #define PKO_REMOVE_RLY 0xbabe0192
30 #define PKO_MKDIR_CMD 0xbabe01a1
31 #define PKO_MKDIR_RLY 0xbabe01a2
32 #define PKO_RMDIR_CMD 0xbabe01b1
33 #define PKO_RMDIR_RLY 0xbabe01b2
35 #define PKO_RESET_CMD 0xbabe0201
36 #define PKO_EXECIOP_CMD 0xbabe0202
37 #define PKO_EXECEE_CMD 0xbabe0203
38 #define PKO_POWEROFF_CMD 0xbabe0204
39 #define PKO_SCRDUMP_CMD 0xbabe0205
40 #define PKO_NETDUMP_CMD 0xbabe0206
42 #define PKO_DUMP_MEM 0xbabe0207
43 #define PKO_START_VU 0xbabe0208
44 #define PKO_STOP_VU 0xbabe0209
45 #define PKO_DUMP_REG 0xbabe020a
46 #define PKO_GSEXEC_CMD 0xbabe020b
47 #define PKO_WRITE_MEM 0xbabe020c
48 #define PKO_IOPEXCEP_CMD 0xbabe020d
49 #define PKO_SCRSHOT_CMD 0xbabe020e
51 #define PKO_RPC_RESET 1
52 #define PKO_RPC_EXECEE 2
53 #define PKO_RPC_DUMMY 3
54 #define PKO_RPC_SCRDUMP 4
55 #define PKO_RPC_NETDUMP 5
56 #define PKO_RPC_STARTVU 6
57 #define PKO_RPC_STOPVU 7
58 #define PKO_RPC_DUMPMEM 8
59 #define PKO_RPC_DUMPREG 9
60 #define PKO_RPC_GSEXEC 10
61 #define PKO_RPC_WRITEMEM 11
62 #define PKO_RPC_IOPEXCEP 12
63 #define PKO_RPC_SCRSHOT 13
65 #define PKO_MAX_PATH 256
85 } __attribute__((packed
)) pko_pkt_hdr
;
92 } __attribute__((packed
)) pko_pkt_file_rly
;
99 char path
[PKO_MAX_PATH
];
100 } __attribute__((packed
)) pko_pkt_open_req
;
107 } __attribute__((packed
)) pko_pkt_close_req
;
115 } __attribute__((packed
)) pko_pkt_read_req
;
123 } __attribute__((packed
)) pko_pkt_read_rly
;
131 } __attribute__((packed
)) pko_pkt_write_req
;
140 } __attribute__((packed
)) pko_pkt_lseek_req
;
146 char name
[PKO_MAX_PATH
];
147 } __attribute__((packed
)) pko_pkt_remove_req
;
154 char name
[PKO_MAX_PATH
];
155 } __attribute__((packed
)) pko_pkt_mkdir_req
;
161 char name
[PKO_MAX_PATH
];
162 } __attribute__((packed
)) pko_pkt_rmdir_req
;
169 } __attribute__((packed
)) pko_pkt_dread_req
;
176 /* from io_common.h (fio_dirent_t) in ps2lib */
180 unsigned char ctime
[8];
181 unsigned char atime
[8];
182 unsigned char mtime
[8];
185 } __attribute__((packed
)) pko_pkt_dread_rly
;
193 } __attribute__((packed
)) pko_pkt_reset_req
;
200 char argv
[PKO_MAX_PATH
];
201 } __attribute__((packed
)) pko_pkt_execee_req
;
208 char argv
[PKO_MAX_PATH
];
209 } __attribute__((packed
)) pko_pkt_execiop_req
;
216 unsigned char file
[PKO_MAX_PATH
];
217 } __attribute__((packed
)) pko_pkt_gsexec_req
;
223 } __attribute__((packed
)) pko_pkt_poweroff_req
;
230 } __attribute__((packed
)) pko_pkt_start_vu
;
237 } __attribute__((packed
)) pko_pkt_stop_vu
;
245 char argv
[PKO_MAX_PATH
];
246 } __attribute__((packed
)) pko_pkt_mem_io
;
252 char argv
[PKO_MAX_PATH
];
253 } __attribute__((packed
)) pko_pkt_dump_regs
;
258 unsigned int regs
[79];
259 } __attribute__((packed
)) pko_pkt_send_regs
;
268 } __attribute__((packed
)) pko_pkt_screenshot
;
270 #define PKO_MAX_WRITE_SEGMENT (1460 - sizeof(pko_pkt_write_req))
271 #define PKO_MAX_READ_SEGMENT (1460 - sizeof(pko_pkt_read_rly))