PS2SDK
PS2 Homebrew Libraries
|
Data Structures | |
struct | dev_table_t |
struct | fd_table_t |
Macros | |
#define | DEVSCAN_MAX (DEVSCAN_IOMAX+DEVSCAN_IOXMAX+1) |
#define | DEVSCAN_MASK (IOP_DT_FS | IOP_DT_BLOCK) |
#define | PFS_ZONE_SIZE 8192 |
Functions | |
ModuleInfo_t * | devscan_getmodule (const char *name) |
int | devscan_setup (int devtype) |
int | devscan_gettype (char *name) |
int | devscan_getdevlist (char *buffer) |
static void | fdh_setup () |
static int | fdh_getfd (int devtype, int fd) |
static void | fdh_freefd (int fd) |
static int | convmode_to_iomanx (int stat) |
static int | convmode_from_iomanx (int stat) |
int | ps2netfs_close_socket (void) |
void | ps2netfs_close_fsys (void) |
static int | ps2netfs_op_info (char *buf, int len) |
static int | ps2netfs_op_fstype (char *buf, int len) |
static int | ps2netfs_op_devlist (char *buf, int len) |
static int | ps2netfs_op_open (char *buf, int len) |
static int | ps2netfs_op_close (char *buf, int len) |
static int | ps2netfs_op_read (char *buf, int len) |
static int | ps2netfs_op_write (char *buf, int len) |
static int | ps2netfs_op_lseek (char *buf, int len) |
static int | ps2netfs_op_ioctl (char *buf, int len) |
static int | ps2netfs_op_remove (char *buf, int len) |
static int | ps2netfs_op_mkdir (char *buf, int len) |
static int | ps2netfs_op_rmdir (char *buf, int len) |
static int | ps2netfs_op_dopen (char *buf, int len) |
static int | ps2netfs_op_dclose (char *buf, int len) |
static int | ps2netfs_op_dread (char *buf, int len) |
static int | ps2netfs_op_getstat (char *buf, int len) |
static int | ps2netfs_op_chstat (char *buf, int len) |
static int | ps2netfs_op_rename (char *buf, int len) |
static int | ps2netfs_op_chdir (char *buf, int len) |
static int | ps2netfs_op_sync (char *buf, int len) |
static int | ps2netfs_op_mount (char *buf, int len) |
static int | ps2netfs_op_umount (char *buf, int len) |
static int | ps2netfs_op_lseek64 (char *buf, int len) |
static int | ps2netfs_op_devctl (char *buf, int len) |
static int | ps2netfs_op_symlink (char *buf, int len) |
static int | ps2netfs_op_readlink (char *buf, int len) |
static int | ps2netfs_op_ioctl2 (char *buf, int len) |
static void | ps2netfs_Listener (int sock) |
int | ps2netfs_serv (void *argv) |
int | ps2netfs_Init (void) |
int | ps2fs_Destroy (void) |
int | _start (int argc, char *argv[]) |
Variables | |
static dev_table_t | dev_info_list [DEVSCAN_MAX+1] |
struct dev_table_t |
struct fd_table_t |
#define DEVSCAN_MAX (DEVSCAN_IOMAX+DEVSCAN_IOXMAX+1) |
#include <iop/fs/netfs/src/devscan.h>
Maximum number of devices handled.
#define DEVSCAN_MASK (IOP_DT_FS | IOP_DT_BLOCK) |
#define PFS_ZONE_SIZE 8192 |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_FORMAT_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
ModuleInfo_t * devscan_getmodule | ( | const char * | name | ) |
#include <iop/fs/netfs/src/devscan.c>
Get pointer to module structure for named module.
name | Stringname of module (eg "atad_driver"). |
return values: 0 if not found. pointer to module structure for loaded module if found.
Definition at line 47 of file devscan.c.
References tag_LC_internals::image_info.
Referenced by _start(), and devscan_setup().
int devscan_setup | ( | int | devtype | ) |
#include <iop/fs/netfs/src/devscan.c>
Initialise the devices table
devtype | Mask for device types to return (0x10 = FS drivers). |
This scans ioman and iomanx for devices, then adds them to the internal list, with basename and the handler type.
Also used to re-init the devices table
Definition at line 73 of file devscan.c.
References count, dev_info_list, devscan_getmodule(), and IOP_DT_FSEXT.
Referenced by devscan_getdevlist(), and ps2netfs_serv().
int devscan_gettype | ( | char * | name | ) |
#include <iop/fs/netfs/src/devscan.c>
Get device handler type for path.
name | Full pathname to check. |
return values: MODULE_RESIDENT_END if loaded and registered as library. MODULE_NO_RESIDENT_END if just exiting normally.
Definition at line 141 of file devscan.c.
References count, and dev_info_list.
Referenced by ps2netfs_op_chdir(), ps2netfs_op_dopen(), ps2netfs_op_fstype(), ps2netfs_op_mkdir(), ps2netfs_op_mount(), ps2netfs_op_open(), ps2netfs_op_readlink(), ps2netfs_op_remove(), ps2netfs_op_rename(), ps2netfs_op_rmdir(), ps2netfs_op_symlink(), ps2netfs_op_sync(), and ps2netfs_op_umount().
int devscan_getdevlist | ( | char * | buffer | ) |
#include <iop/fs/netfs/src/devscan.c>
Get device list.
buffer | Pointer to dest buffer |
Definition at line 162 of file devscan.c.
References count, dev_info_list, DEVSCAN_MASK, and devscan_setup().
Referenced by ps2netfs_op_devlist().
|
inlinestatic |
#include <iop/fs/netfs/src/ps2_fio.c>
Initialise the file descriptor table.
This initialises the file descriptor table that we use to translate to numbers passed to client, and to enable quick lookups on handler type.
Definition at line 79 of file ps2_fio.c.
Referenced by ps2netfs_serv().
|
inlinestatic |
#include <iop/fs/netfs/src/ps2_fio.c>
Get file descriptor for client.
devtype | Device Manager type. |
fd | PS2 file descriptor. |
return values: -1 if no space in list. FD if returning valid entry.
Definition at line 95 of file ps2_fio.c.
References count.
Referenced by ps2netfs_op_dopen(), and ps2netfs_op_open().
|
inlinestatic |
#include <iop/fs/netfs/src/ps2_fio.c>
Free file descriptor from client table.
fd | client file descriptor. |
Definition at line 117 of file ps2_fio.c.
Referenced by ps2netfs_op_close(), and ps2netfs_op_dclose().
|
inlinestatic |
#include <iop/fs/netfs/src/ps2_fio.c>
changes mode from ioman to iomanx format
Definition at line 140 of file ps2_fio.c.
References FIO_S_IFDIR, FIO_S_IFLNK, FIO_S_IFREG, FIO_S_IRGRP, FIO_S_IROTH, FIO_S_IRUSR, FIO_S_IWGRP, FIO_S_IWOTH, FIO_S_IWUSR, FIO_S_IXGRP, FIO_S_IXOTH, FIO_S_IXUSR, FIO_SO_IROTH, FIO_SO_IWOTH, and FIO_SO_IXOTH.
Referenced by ps2netfs_op_dread().
|
inlinestatic |
#include <iop/fs/netfs/src/ps2_fio.c>
changes mode from iomanx to ioman format
int ps2netfs_close_socket | ( | void | ) |
#include <iop/fs/netfs/src/ps2_fio.c>
Shortcut to close the socket and cleanup.
Definition at line 171 of file ps2_fio.c.
Referenced by ps2netfs_serv().
void ps2netfs_close_fsys | ( | void | ) |
#include <iop/fs/netfs/src/ps2_fio.c>
Shortcut to close the socket forcibly and set to exit (active=0).
This will close down the socket, and cause the server thread to exit.
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_INFO_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -1 if error. 0 if handled ok.
Definition at line 314 of file ps2_fio.c.
References count.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_FSTYPE_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -1 if error. 0 if handled ok.
Definition at line 367 of file ps2_fio.c.
References devscan_gettype().
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_DEVLIST_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -1 if error. 0 if handled ok.
Definition at line 416 of file ps2_fio.c.
References count, and devscan_getdevlist().
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_OPEN_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 484 of file ps2_fio.c.
References devscan_gettype(), ENODEV, and fdh_getfd().
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_CLOSE_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found >=0 if handled ok. -X if error.
Definition at line 545 of file ps2_fio.c.
References fdh_freefd(), and fdh_get.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_READ_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found >=0 if handled ok , bytes read. -X if error.
Definition at line 605 of file ps2_fio.c.
References fdh_get.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_WRITE_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found >=0 if handled ok , bytes written. -X if error.
Definition at line 677 of file ps2_fio.c.
References fdh_get, and ps2netfs_recv_bytes().
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_LSEEK_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found >=0 if handled ok , position. -X if error.
Definition at line 751 of file ps2_fio.c.
References ENODEV, and fdh_get.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_IOCTL_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found >=0 if handled ok. -X if error.
Definition at line 809 of file ps2_fio.c.
References ENODEV, and fdh_get.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_REMOVE_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found >=0 if handled ok. -X if error.
Definition at line 867 of file ps2_fio.c.
References devscan_gettype(), and ENODEV.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_MKDIR_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found >=0 if handled ok. -X if error.
Definition at line 926 of file ps2_fio.c.
References devscan_gettype().
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_RMDIR_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found >=0 if handled ok. -X if error.
Definition at line 985 of file ps2_fio.c.
References devscan_gettype(), and ENODEV.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_DOPEN_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 1044 of file ps2_fio.c.
References devscan_gettype(), ENODEV, and fdh_getfd().
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_DCLOSE_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found >=0 if handled ok. -X if error.
Definition at line 1105 of file ps2_fio.c.
References ENODEV, fdh_freefd(), and fdh_get.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_DREAD_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found >=0 if handled ok. -X if error.
Definition at line 1165 of file ps2_fio.c.
References convmode_to_iomanx(), ENODEV, and fdh_get.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_GETSTAT_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 1255 of file ps2_fio.c.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_CHSTAT_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 1279 of file ps2_fio.c.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_RENAME_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 1373 of file ps2_fio.c.
References devscan_gettype(), and ENODEV.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_CHDIR_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 1431 of file ps2_fio.c.
References devscan_gettype(), and ENODEV.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_SYNC_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 1485 of file ps2_fio.c.
References devscan_gettype(), and ENODEV.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_MOUNT_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 1539 of file ps2_fio.c.
References devscan_gettype(), and ENODEV.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_UMOUNT_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 1593 of file ps2_fio.c.
References devscan_gettype(), and ENODEV.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_LSEEK64_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 1647 of file ps2_fio.c.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_DEVCTL_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 1671 of file ps2_fio.c.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_SYMLINK_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 1695 of file ps2_fio.c.
References devscan_gettype(), and ENODEV.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_READLINK_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 1753 of file ps2_fio.c.
References devscan_gettype(), and ENODEV.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Handles a PS2NETFS_IOCTL2_CMD request.
buf | Pointer to packet data. |
len | Length of packet. |
status returns: 0 if all request and response handled ok. -X if error.
return values for client: -19 (ENODEV) if device not found +X if handled ok, valid FD returned. -X if error.
Definition at line 1808 of file ps2_fio.c.
Referenced by ps2netfs_Listener().
|
static |
#include <iop/fs/netfs/src/ps2_fio.c>
Listen for packets and handle them.
sock | Socket to receive on. |
This function listens on the given socket for command packets. It loops until a socket error, or protocol error is found, then exits to the calling function, which should clean the socket up.
Definition at line 1825 of file ps2_fio.c.
References ps2netfs_accept_pktunknown(), ps2netfs_op_chdir(), ps2netfs_op_chstat(), ps2netfs_op_close(), ps2netfs_op_dclose(), ps2netfs_op_devctl(), ps2netfs_op_devlist(), ps2netfs_op_dopen(), ps2netfs_op_dread(), ps2netfs_op_fstype(), ps2netfs_op_getstat(), ps2netfs_op_info(), ps2netfs_op_ioctl(), ps2netfs_op_ioctl2(), ps2netfs_op_lseek(), ps2netfs_op_lseek64(), ps2netfs_op_mkdir(), ps2netfs_op_mount(), ps2netfs_op_open(), ps2netfs_op_read(), ps2netfs_op_readlink(), ps2netfs_op_remove(), ps2netfs_op_rename(), ps2netfs_op_rmdir(), ps2netfs_op_symlink(), ps2netfs_op_sync(), ps2netfs_op_umount(), and ps2netfs_op_write().
Referenced by ps2netfs_serv().
int ps2netfs_serv | ( | void * | argv | ) |
#include <iop/fs/netfs/src/ps2_fio.c>
Main ps2netfs Thread.
argv | Parameters to thread. |
This is the main thread function for ps2netfs. It runs until 'ps2netfs_active' is set to 0. Handles accepting connections and passing them onto the listener function to handle them.
status returns: 0 if exiting and finished. -1 if error starting thread.
Definition at line 1968 of file ps2_fio.c.
References DEVSCAN_MASK, devscan_setup(), fdh_setup(), INADDR_ANY, ps2netfs_close_socket(), and ps2netfs_Listener().
Referenced by ps2netfs_Init().
int ps2netfs_Init | ( | void | ) |
#include <iop/fs/netfs/src/ps2_fio.c>
Init ps2netfs.
This handles setting up the Thread, and starting it running.
Definition at line 2070 of file ps2_fio.c.
References ps2netfs_serv().
Referenced by _start().
int ps2fs_Destroy | ( | void | ) |
#include <iop/fs/netfs/src/ps2_fio.c>
Shutdown ps2netfs.
This handles Stopping the thread and disconnecting. All shutdown for ps2netfs.
int _start | ( | int | argc, |
char * | argv[] | ||
) |
#include <iop/fs/netfs/src/ps2netfs.c>
Entry point for IRX.
argc and argv make no difference to runstate.
argc | Number of arguments. |
argv | Pointer to array of arguments. |
return values: MODULE_RESIDENT_END if loaded and registered as library. MODULE_NO_RESIDENT_END if just exiting normally.
Definition at line 47 of file ps2netfs.c.
References devscan_getmodule(), and ps2netfs_Init().
|
static |
#include <iop/fs/netfs/src/devscan.c>
Device type structure.
Definition at line 35 of file devscan.c.
Referenced by devscan_getdevlist(), devscan_gettype(), and devscan_setup().