PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
ps2fs.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright 2001-2004, 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
18#ifndef _PS2FS_H_
19#define _PS2FS_H_
20
21#define PS2NETFS_LISTEN_PORT 0x4713
22
23//from iomanx, all operations
24// open
25#define PS2NETFS_OPEN_CMD 0xbeef8011
26#define PS2NETFS_OPEN_RLY 0xbeef8012
27// close
28#define PS2NETFS_CLOSE_CMD 0xbeef8021
29#define PS2NETFS_CLOSE_RLY 0xbeef8022
30// read
31#define PS2NETFS_READ_CMD 0xbeef8031
32#define PS2NETFS_READ_RLY 0xbeef8032
33// write
34#define PS2NETFS_WRITE_CMD 0xbeef8041
35#define PS2NETFS_WRITE_RLY 0xbeef8042
36// lseek
37#define PS2NETFS_LSEEK_CMD 0xbeef8051
38#define PS2NETFS_LSEEK_RLY 0xbeef8052
39// ioctl
40#define PS2NETFS_IOCTL_CMD 0xbeef8061
41#define PS2NETFS_IOCTL_RLY 0xbeef8062
42// remove
43#define PS2NETFS_REMOVE_CMD 0xbeef8071
44#define PS2NETFS_REMOVE_RLY 0xbeef8072
45// mkdir
46#define PS2NETFS_MKDIR_CMD 0xbeef8081
47#define PS2NETFS_MKDIR_RLY 0xbeef8082
48// rmdir
49#define PS2NETFS_RMDIR_CMD 0xbeef8091
50#define PS2NETFS_RMDIR_RLY 0xbeef8092
51// dopen
52#define PS2NETFS_DOPEN_CMD 0xbeef80A1
53#define PS2NETFS_DOPEN_RLY 0xbeef80A2
54// dclose
55#define PS2NETFS_DCLOSE_CMD 0xbeef80B1
56#define PS2NETFS_DCLOSE_RLY 0xbeef80B2
57// dread
58#define PS2NETFS_DREAD_CMD 0xbeef80C1
59#define PS2NETFS_DREAD_RLY 0xbeef80C2
60// getstat
61#define PS2NETFS_GETSTAT_CMD 0xbeef80D1
62#define PS2NETFS_GETSTAT_RLY 0xbeef80D2
63// chstat
64#define PS2NETFS_CHSTAT_CMD 0xbeef80E1
65#define PS2NETFS_CHSTAT_RLY 0xbeef80E2
66// format
67#define PS2NETFS_FORMAT_CMD 0xbeef80F1
68#define PS2NETFS_FORMAT_RLY 0xbeef80F2
69// extended commands
70// rename
71#define PS2NETFS_RENAME_CMD 0xbeef8111
72#define PS2NETFS_RENAME_RLY 0xbeef8112
73// chdir
74#define PS2NETFS_CHDIR_CMD 0xbeef8121
75#define PS2NETFS_CHDIR_RLY 0xbeef8122
76// sync
77#define PS2NETFS_SYNC_CMD 0xbeef8131
78#define PS2NETFS_SYNC_RLY 0xbeef8132
79// mount
80#define PS2NETFS_MOUNT_CMD 0xbeef8141
81#define PS2NETFS_MOUNT_RLY 0xbeef8142
82// umount
83#define PS2NETFS_UMOUNT_CMD 0xbeef8151
84#define PS2NETFS_UMOUNT_RLY 0xbeef8152
85// lseek64
86#define PS2NETFS_LSEEK64_CMD 0xbeef8161
87#define PS2NETFS_LSEEK64_RLY 0xbeef8162
88// devctl
89#define PS2NETFS_DEVCTL_CMD 0xbeef8171
90#define PS2NETFS_DEVCTL_RLY 0xbeef8172
91// symlink
92#define PS2NETFS_SYMLINK_CMD 0xbeef8181
93#define PS2NETFS_SYMLINK_RLY 0xbeef8182
94// readlink
95#define PS2NETFS_READLINK_CMD 0xbeef8191
96#define PS2NETFS_READLINK_RLY 0xbeef8192
97// ioctl2
98#define PS2NETFS_IOCTL2_CMD 0xbeef81A1
99#define PS2NETFS_IOCTL2_RLY 0xbeef81A2
100// added on
101// info/status
102#define PS2NETFS_INFO_CMD 0xbeef8F01
103#define PS2NETFS_INFO_RLY 0xbeef8F02
104// fstype
105#define PS2NETFS_FSTYPE_CMD 0xbeef8F11
106#define PS2NETFS_FSTYPE_RLY 0xbeef8F12
107// devlist
108#define PS2NETFS_DEVLIST_CMD 0xbeef8F21
109#define PS2NETFS_DEVLIST_RLY 0xbeef8F22
110
111#define PS2NETFS_MAX_PATH 256
112
113typedef struct
114{
115 unsigned int cmd;
116 unsigned short len;
117} __attribute__((packed)) ps2netfs_pkt_hdr;
118
119typedef struct
120{
121 unsigned int cmd;
122 unsigned short len;
123 unsigned int retval;
124} __attribute__((packed)) ps2netfs_pkt_file_rly;
125
126typedef struct
127{
128 unsigned int cmd;
129 unsigned short len;
130 int flags;
131 char path[PS2NETFS_MAX_PATH];
132} __attribute__((packed)) ps2netfs_pkt_open_req;
133
134typedef struct
135{
136 unsigned int cmd;
137 unsigned short len;
138 int fd;
139} __attribute__((packed)) ps2netfs_pkt_close_req;
140
141typedef struct
142{
143 unsigned int cmd;
144 unsigned short len;
145 int fd;
146 int nbytes;
147} __attribute__((packed)) ps2netfs_pkt_read_req;
148
149typedef struct
150{
151 unsigned int cmd;
152 unsigned short len;
153 int retval;
154 int nbytes;
155} __attribute__((packed)) ps2netfs_pkt_read_rly;
156
157typedef struct
158{
159 unsigned int cmd;
160 unsigned short len;
161 int fd;
162 int nbytes;
163} __attribute__((packed)) ps2netfs_pkt_write_req;
164
165typedef struct
166{
167 unsigned int cmd;
168 unsigned short len;
169 int fd;
170 int offset;
171 int whence;
172} __attribute__((packed)) ps2netfs_pkt_lseek_req;
173
174typedef struct
175{
176 unsigned int cmd;
177 unsigned short len;
178 int fd;
179 int command;
180} __attribute__((packed)) ps2netfs_pkt_ioctl_req;
181
182typedef struct
183{
184 unsigned int cmd;
185 unsigned short len;
186 int retval;
187 char buf[PS2NETFS_MAX_PATH];
188} __attribute__((packed)) ps2netfs_pkt_ioctl_rly;
189
190typedef struct
191{
192 unsigned int cmd;
193 unsigned short len;
194 int fd;
195} __attribute__((packed)) ps2netfs_pkt_dread_req;
196
197typedef struct
198{
199 unsigned int cmd;
200 unsigned short len;
201 int retval;
202 unsigned int mode;
203 unsigned int attr;
204 unsigned int size;
205 unsigned char ctime[8];
206 unsigned char atime[8];
207 unsigned char mtime[8];
208 unsigned int hisize;
209 char name[PS2NETFS_MAX_PATH];
210} __attribute__((packed)) ps2netfs_pkt_dread_rly;
211
212typedef struct
213{
214 unsigned int cmd;
215 unsigned short len;
216 int retval;
217 int count;
218 char list[PS2NETFS_MAX_PATH];
219} __attribute__((packed)) ps2netfs_pkt_info_rly;
220
221typedef struct
222{
223 unsigned int cmd;
224 unsigned short len;
225 int retval;
226 int count;
227 char list[PS2NETFS_MAX_PATH];
228} __attribute__((packed)) ps2netfs_pkt_devlist_rly;
229
230typedef struct
231{
232 unsigned int cmd;
233 unsigned short len;
234 char fsname[PS2NETFS_MAX_PATH];
235 char devname[PS2NETFS_MAX_PATH];
236 int flag;
237 char arg[PS2NETFS_MAX_PATH];
238 int arglen;
239} __attribute__((packed)) ps2netfs_pkt_mount_req;
240
241typedef struct
242{
243 unsigned int cmd;
244 unsigned short len;
245 int arglen;
246 char dev[PS2NETFS_MAX_PATH];
247 char blockdev[PS2NETFS_MAX_PATH];
248 char arg[PS2NETFS_MAX_PATH];
249} __attribute__((packed)) ps2netfs_pkt_format_req;
250
251typedef struct
252{
253 unsigned int cmd;
254 unsigned short len;
255 int flags;
256 char oldpath[PS2NETFS_MAX_PATH];
257 char newpath[PS2NETFS_MAX_PATH];
258} __attribute__((packed)) ps2netfs_pkt_symlink_req;
259
260typedef struct
261{
262 unsigned int cmd;
263 unsigned short len;
264 int retval;
265 char path[PS2NETFS_MAX_PATH];
266} __attribute__((packed)) ps2netfs_pkt_readlink_rly;
267
268#endif
u32 count
start sector of fragmented bd/file