|
PS2SDK
PS2 Homebrew Libraries
|
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) |
| void | 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] |
| #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.
| 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.
Referenced by 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.
| int devscan_getdevlist | ( | char * | buffer | ) |
#include <iop/fs/netfs/src/devscan.c>
Get device list.
| buffer | Pointer to dest buffer |
|
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.
|
inlinestatic |
#include <iop/fs/netfs/src/ps2_fio.c>
Free file descriptor from client table.
| fd | client file descriptor. |
|
inlinestatic |
#include <iop/fs/netfs/src/ps2_fio.c>
changes mode from ioman to iomanx format
|
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.
| 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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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().
| void 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.
Definition at line 1963 of file ps2_fio.c.
References DEVSCAN_MASK, devscan_setup(), and fdh_setup().
| int ps2netfs_Init | ( | void | ) |
#include <iop/fs/netfs/src/ps2_fio.c>
Init ps2netfs.
This handles setting up the Thread, and starting it running.
| 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.
|
static |
#include <iop/fs/netfs/src/devscan.c>
Device type structure.