From 37d6c121d3a9cf32529e1b5d1f6f963b6c83bf58 Mon Sep 17 00:00:00 2001 From: Julian Uy Date: Wed, 13 Nov 2024 23:14:40 -0600 Subject: [PATCH] Revert "Merge pull request #625 from israpps/ioman-iomanx-notsup-generic-response" This reverts commit 79faa80b3bfa88b3edb725724382c20825374404, reversing changes made to 7ccee55346ae9e2b27e00438c24b478750be6b96. --- iop/arcade/accdvd/src/cddrv.c | 26 +++++++------ iop/cdvd/cdfs/src/main.c | 17 ++++++--- iop/cdvd/xesdrv/src/xesdrv.c | 48 +++++++++++++----------- iop/debug/iop_sbusdbg/src/sbus_tty.c | 22 ++++++----- iop/debug/ppctty/src/tty.c | 22 ++++++----- iop/dvrp/dvr/src/dvr.c | 50 ++++++++++++++----------- iop/dvrp/dvrav/src/dvrav.c | 50 ++++++++++++++----------- iop/dvrp/dvrdv/src/dvrdv.c | 51 ++++++++++++++------------ iop/dvrp/dvripl/src/dvripl.c | 50 ++++++++++++++----------- iop/dvrp/dvrmisc/src/dvrmisc.c | 51 ++++++++++++++------------ iop/fs/bdmfs_fatfs/src/fs_driver.c | 26 ++++++++----- iop/fs/devfs/src/devfs.c | 44 +++++++++++++--------- iop/fs/vfat/src/fs_driver.c | 35 +++++++++++------- iop/hdd/apa/src/hdd.c | 18 ++++----- iop/hdd/apa/src/hdd_fio.c | 7 ++++ iop/hdd/apa/src/hdd_fio.h | 6 ++- iop/hdd/hdck/src/hdck.c | 50 ++++++++++++++----------- iop/hdd/hdsk/src/hdsk.c | 55 +++++++++++++++------------- iop/kernel/include/ioman.h | 4 -- iop/kernel/include/iomanX.h | 4 -- iop/network/smbman/src/smb_fio.c | 25 ++++++++----- iop/network/udptty/src/udptty.c | 30 +++++++++------ iop/usb/keyboard/src/ps2kbd.c | 45 +++++++++++++---------- 23 files changed, 419 insertions(+), 317 deletions(-) diff --git a/iop/arcade/accdvd/src/cddrv.c b/iop/arcade/accdvd/src/cddrv.c index e6dcea82424..5e065fc3e91 100644 --- a/iop/arcade/accdvd/src/cddrv.c +++ b/iop/arcade/accdvd/src/cddrv.c @@ -18,27 +18,26 @@ static int cddrv_read(iop_file_t *io, void *buf, int cnt); static int cddrv_write(iop_file_t *io, void *buf, int cnt); static int cddrv_lseek(iop_file_t *io, int offset, int whence); static int cddrv_ioctl(iop_file_t *io, int cmd, void *arg); +static int cddrv_dummy(); - static iop_device_ops_t Cddrv_ops = { &cddrv_adddrv, &cddrv_deldrv, - NOT_SUPPORTED, + &cddrv_dummy, &cddrv_open, &cddrv_close, &cddrv_read, &cddrv_write, &cddrv_lseek, &cddrv_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED -}; + &cddrv_dummy, + &cddrv_dummy, + &cddrv_dummy, + &cddrv_dummy, + &cddrv_dummy, + &cddrv_dummy, + &cddrv_dummy, + &cddrv_dummy}; static iop_device_t Cddrv = {"cdrom", 16u, 0u, "ATAPI_C/DVD-ROM", &Cddrv_ops}; @@ -159,6 +158,11 @@ static int cddrv_ioctl(iop_file_t *io, int cmd, void *arg) return -EINVAL; } +static int cddrv_dummy() +{ + return -EINVAL; +} + int cddrv_module_start(int argc, char **argv) { int v2; diff --git a/iop/cdvd/cdfs/src/main.c b/iop/cdvd/cdfs/src/main.c index 3c436709a95..c867a7b1a43 100755 --- a/iop/cdvd/cdfs/src/main.c +++ b/iop/cdvd/cdfs/src/main.c @@ -418,24 +418,29 @@ static int fio_getstat(iop_file_t *fd, const char *name, io_stat_t *stat) return ret; } +static int cdfs_dummy() { + DPRINTF("CDFS: dummy function called\n\n"); + return -EIO; +} + static iop_device_ops_t fio_ops = { &fio_init, &fio_deinit, - NOT_SUPPORTED, + (void *)&cdfs_dummy, &fio_open, &fio_close, &fio_read, &fio_write, &fio_lseek, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&cdfs_dummy, + (void *)&cdfs_dummy, + (void *)&cdfs_dummy, + (void *)&cdfs_dummy, &fio_openDir, &fio_closeDir, &fio_dread, &fio_getstat, - NOT_SUPPORTED, + (void *)&cdfs_dummy, }; static iop_device_t fio_driver = { diff --git a/iop/cdvd/xesdrv/src/xesdrv.c b/iop/cdvd/xesdrv/src/xesdrv.c index 52595019d7a..d06313942a6 100644 --- a/iop/cdvd/xesdrv/src/xesdrv.c +++ b/iop/cdvd/xesdrv/src/xesdrv.c @@ -28,6 +28,7 @@ static int esdrv_df_devctl( iomanX_iop_file_t *f, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); static int esdrv_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); +static int esdrv_df_null(); static s64 esdrv_df_null_long(); static int esioctl2_func_1(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); @@ -222,30 +223,30 @@ struct DevctlCmdTbl_t static iomanX_iop_device_ops_t DvrFuncTbl = { &esdrv_df_init, &esdrv_df_exit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, &esdrv_df_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, (void *)&esdrv_df_null_long, &esdrv_df_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&esdrv_df_null, + (void *)&esdrv_df_null, &esdrv_df_ioctl2, }; static iomanX_iop_device_t ESDRV = { @@ -371,6 +372,11 @@ esdrv_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, v return -EINVAL; } +static int esdrv_df_null() +{ + return -EUNSUP; +} + static s64 esdrv_df_null_long() { return -EUNSUP; diff --git a/iop/debug/iop_sbusdbg/src/sbus_tty.c b/iop/debug/iop_sbusdbg/src/sbus_tty.c index df013939029..96fa2a75f9c 100644 --- a/iop/debug/iop_sbusdbg/src/sbus_tty.c +++ b/iop/debug/iop_sbusdbg/src/sbus_tty.c @@ -27,6 +27,8 @@ Of course this requires that the EE-side code accept this command and output the extern void sbus_tty_puts(const char *str); +static int ttyfs_error() { return -EPERM; } + static int ttyfs_init() { //DBG_puts("SIOTTY: FS Init()\n"); @@ -96,21 +98,21 @@ static iop_device_ops_t fsd_ops = { &ttyfs_init, &ttyfs_deinit, - NOT_SUPPORTED, + (void *)&ttyfs_error, &ttyfs_open, &ttyfs_close, - NOT_SUPPORTED, + (void *)&ttyfs_error, &ttyfs_write, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&ttyfs_error, + (void *)&ttyfs_error, + (void *)&ttyfs_error, + (void *)&ttyfs_error, + (void *)&ttyfs_error, &ttyfs_dopen, &ttyfs_close, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&ttyfs_error, + (void *)&ttyfs_error, + (void *)&ttyfs_error, }; static iop_device_t tty_fsd = diff --git a/iop/debug/ppctty/src/tty.c b/iop/debug/ppctty/src/tty.c index eeab37bc915..00179055d62 100644 --- a/iop/debug/ppctty/src/tty.c +++ b/iop/debug/ppctty/src/tty.c @@ -26,6 +26,8 @@ static int tty_sema = -1; extern void tty_puts(const char *str); +static int ttyfs_error() { return -EPERM; } + static int ttyfs_init() { DPRINTF("FS Init()\n"); @@ -103,21 +105,21 @@ static iop_device_ops_t fsd_ops = { &ttyfs_init, &ttyfs_deinit, - NOT_SUPPORTED, + (void *)&ttyfs_error, &ttyfs_open, &ttyfs_close, - NOT_SUPPORTED, + (void *)&ttyfs_error, &ttyfs_write, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&ttyfs_error, + (void *)&ttyfs_error, + (void *)&ttyfs_error, + (void *)&ttyfs_error, + (void *)&ttyfs_error, &ttyfs_dopen, &ttyfs_close, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&ttyfs_error, + (void *)&ttyfs_error, + (void *)&ttyfs_error, }; static iop_device_t tty_fsd = diff --git a/iop/dvrp/dvr/src/dvr.c b/iop/dvrp/dvr/src/dvr.c index 0885b361442..40bb2eab66f 100644 --- a/iop/dvrp/dvr/src/dvr.c +++ b/iop/dvrp/dvr/src/dvr.c @@ -33,6 +33,7 @@ extern int dvr_df_exit(iomanX_iop_device_t *dev); extern int dvr_df_ioctl(iomanX_iop_file_t *f, int cmd, void *param); extern int dvr_df_devctl(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvr_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); +extern int dvr_df_null(); extern s64 dvr_df_null_long(); extern int dvrioctl2_rec_start(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrioctl2_rec_pause(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); @@ -113,30 +114,30 @@ static iomanX_iop_device_ops_t DvrFuncTbl = { &dvr_df_init, &dvr_df_exit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, &dvr_df_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, + (void *)&dvr_df_null, (void *)&dvr_df_null_long, &dvr_df_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&dvr_df_null, + (void *)&dvr_df_null, &dvr_df_ioctl2, }; char TEVENT_BUF[6144]; @@ -285,9 +286,14 @@ int dvr_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, return -EINVAL; } +int dvr_df_null() +{ + return -EUNSUP; +} + s64 dvr_df_null_long() { - return -134LL; + return -EUNSUP; } int dvrioctl2_rec_start( diff --git a/iop/dvrp/dvrav/src/dvrav.c b/iop/dvrp/dvrav/src/dvrav.c index e0eb7b58ffe..3c31f7000c4 100644 --- a/iop/dvrp/dvrav/src/dvrav.c +++ b/iop/dvrp/dvrav/src/dvrav.c @@ -32,6 +32,7 @@ extern int dvrav_df_exit(iomanX_iop_device_t *dev); extern int dvrav_df_ioctl(iomanX_iop_file_t *f, int cmd, void *param); extern int dvrav_df_devctl(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrav_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); +extern int dvrav_df_null(); extern s64 dvrav_df_null_long(); extern int avioctl2_select_position(iomanX_iop_file_t *a1, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int avioctl2_get_position(iomanX_iop_file_t *a1, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); @@ -112,30 +113,30 @@ static iomanX_iop_device_ops_t DvrFuncTbl = { &dvrav_df_init, &dvrav_df_exit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, &dvrav_df_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, (void *)&dvrav_df_null_long, &dvrav_df_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&dvrav_df_null, + (void *)&dvrav_df_null, &dvrav_df_ioctl2, }; static iomanX_iop_device_t DVRAV = { @@ -283,9 +284,14 @@ int dvrav_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int argle return -EINVAL; } +int dvrav_df_null() +{ + return -EUNSUP; +} + s64 dvrav_df_null_long() { - return -134LL; + return -EUNSUP; } int avioctl2_get_tun_offset( diff --git a/iop/dvrp/dvrdv/src/dvrdv.c b/iop/dvrp/dvrdv/src/dvrdv.c index 8e179d8ea4a..27e019c0a88 100644 --- a/iop/dvrp/dvrdv/src/dvrdv.c +++ b/iop/dvrp/dvrdv/src/dvrdv.c @@ -32,6 +32,7 @@ extern int dvrdv_df_exit(iomanX_iop_device_t *dev); extern int dvrdv_df_ioctl(iomanX_iop_file_t *f, int cmd, void *param); extern int dvrdv_df_devctl(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrdv_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); +extern int dvrdv_df_null(); extern s64 dvrdv_df_null_long(); extern int dvrioctl2_dv_dubb_start(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrioctl2_dv_dubb_stop(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); @@ -53,35 +54,34 @@ struct DevctlCmdTbl_t {0x5607, &dvrioctl2_get_dvcam_info}, {0x5608, &dvrioctl2_get_dvcam_name}, }; - static iomanX_iop_device_ops_t DvrFuncTbl = { &dvrdv_df_init, &dvrdv_df_exit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, &dvrdv_df_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, (void *)&dvrdv_df_null_long, &dvrdv_df_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&dvrdv_df_null, + (void *)&dvrdv_df_null, &dvrdv_df_ioctl2, }; static iomanX_iop_device_t DVR = { @@ -233,9 +233,14 @@ int dvrdv_df_ioctl2( return -EINVAL; } +int dvrdv_df_null() +{ + return -EUNSUP; +} + s64 dvrdv_df_null_long() { - return -134LL; + return -EUNSUP; } int dvrioctl2_dv_dubb_start( diff --git a/iop/dvrp/dvripl/src/dvripl.c b/iop/dvrp/dvripl/src/dvripl.c index 0a518f0d967..31e6baa54dd 100644 --- a/iop/dvrp/dvripl/src/dvripl.c +++ b/iop/dvrp/dvripl/src/dvripl.c @@ -34,6 +34,7 @@ extern int dvripl_df_exit(iomanX_iop_device_t *dev); extern int dvripl_df_ioctl(iomanX_iop_file_t *f, int cmd, void *param); extern int dvripl_df_devctl(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvripl_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); +extern int dvripl_df_null(); extern s64 dvripl_df_null_long(); extern int iplioctl2_update(iomanX_iop_file_t *a1, int cmd, void *arg); extern void dvr_ready(int a1, void *a2); @@ -42,30 +43,30 @@ static iomanX_iop_device_ops_t DvrFuncTbl = { &dvripl_df_init, &dvripl_df_exit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, &dvripl_df_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, + &dvripl_df_null, &dvripl_df_null_long, &dvripl_df_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, + &dvripl_df_null, + &dvripl_df_null, &dvripl_df_ioctl2, }; s32 dvr_ready_flag; @@ -199,9 +200,14 @@ int dvripl_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int argl return -EINVAL; } +int dvripl_df_null() +{ + return -EUNSUP; +} + s64 dvripl_df_null_long() { - return -134LL; + return -EUNSUP; } int iplioctl2_update(iomanX_iop_file_t *a1, int cmd, void *arg) diff --git a/iop/dvrp/dvrmisc/src/dvrmisc.c b/iop/dvrp/dvrmisc/src/dvrmisc.c index b0d2cfd4625..305339c0f6c 100644 --- a/iop/dvrp/dvrmisc/src/dvrmisc.c +++ b/iop/dvrp/dvrmisc/src/dvrmisc.c @@ -33,6 +33,7 @@ extern int dvrmisc_df_exit(iomanX_iop_device_t *dev); extern int dvrmisc_df_ioctl(iomanX_iop_file_t *f, int cmd, void *param); extern int dvrmisc_df_devctl(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrmisc_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); +extern int dvrmisc_df_null(); extern s64 dvrmisc_df_null_long(); extern int dvrioctl2_nop(iomanX_iop_file_t *a1, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrioctl2_version(iomanX_iop_file_t *a1, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); @@ -92,35 +93,34 @@ struct DevctlCmdTbl_t {0x567B, &dvrioctl2_get_dv_nodeid}, {0x5682, &dvrioctl2_diag_test}, }; - static iomanX_iop_device_ops_t DvrFuncTbl = { &dvrmisc_df_init, &dvrmisc_df_exit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, &dvrmisc_df_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, + &dvrmisc_df_null, &dvrmisc_df_null_long, &dvrmisc_df_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, + &dvrmisc_df_null, + &dvrmisc_df_null, &dvrmisc_df_ioctl2, }; static iomanX_iop_device_t DVRMISC = { @@ -276,9 +276,14 @@ int dvrmisc_df_ioctl2( return -EINVAL; } +int dvrmisc_df_null() +{ + return -EUNSUP; +} + s64 dvrmisc_df_null_long() { - return -134LL; + return -EUNSUP; } int dvrioctl2_nop(iomanX_iop_file_t *a1, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen) diff --git a/iop/fs/bdmfs_fatfs/src/fs_driver.c b/iop/fs/bdmfs_fatfs/src/fs_driver.c index 5a9ed9b0517..e38d5441b41 100644 --- a/iop/fs/bdmfs_fatfs/src/fs_driver.c +++ b/iop/fs/bdmfs_fatfs/src/fs_driver.c @@ -260,6 +260,14 @@ static DIR *fs_find_free_dir_structure(void) return NULL; } +//--------------------------------------------------------------------------- +static int fs_dummy(void) +{ + M_DEBUG("%s\n", __func__); + + return -EIO; +} + //--------------------------------------------------------------------------- static int fs_init(iop_device_t *driver) { @@ -793,8 +801,8 @@ static int fs_devctl(iop_file_t *fd, const char *name, int cmd, void *arg, unsig static iop_device_ops_t fs_functarray = { &fs_init, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&fs_dummy, + (void *)&fs_dummy, &fs_open, &fs_close, &fs_read, @@ -808,16 +816,16 @@ static iop_device_ops_t fs_functarray = { &fs_dclose, &fs_dread, &fs_getstat, - NOT_SUPPORTED, + (void *)&fs_dummy, &fs_rename, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&fs_dummy, + (void *)&fs_dummy, + (void *)&fs_dummy, + (void *)&fs_dummy, &fs_lseek64, &fs_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&fs_dummy, + (void *)&fs_dummy, &fs_ioctl2, }; static iop_device_t fs_driver = { diff --git a/iop/fs/devfs/src/devfs.c b/iop/fs/devfs/src/devfs.c index eff67ab0cc7..ea68e0cd796 100644 --- a/iop/fs/devfs/src/devfs.c +++ b/iop/fs/devfs/src/devfs.c @@ -325,6 +325,16 @@ devfs_device_t *devfs_find_deviceid(HDEV hDev) return NULL; } +/** Dummy ioman handler + * @returns Always returns -1 + */ +int devfs_dummy(void) + +{ + printf("devfs_dummy\n"); + return -EPERM; +} + /** ioman init handler * @returns Always returns 0 */ @@ -998,34 +1008,34 @@ int devfs_getstat(iop_file_t *file, const char *name, iox_stat_t *stat) return 0; } - + static iop_device_ops_t devfs_ops = { &devfs_init, &devfs_deinit, - NOT_SUPPORTED, + (void *)&devfs_dummy, &devfs_open, &devfs_close, &devfs_read, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&devfs_dummy, + (void *)&devfs_dummy, &devfs_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&devfs_dummy, + (void *)&devfs_dummy, + (void *)&devfs_dummy, &devfs_dopen, &devfs_dclose, &devfs_dread, &devfs_getstat, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&devfs_dummy, + (void *)&devfs_dummy, + (void *)&devfs_dummy, + (void *)&devfs_dummy, + (void *)&devfs_dummy, + (void *)&devfs_dummy, + (void *)&devfs_dummy, + (void *)&devfs_dummy, + (void *)&devfs_dummy, + (void *)&devfs_dummy, &devfs_ioctl2, }; diff --git a/iop/fs/vfat/src/fs_driver.c b/iop/fs/vfat/src/fs_driver.c index fa19f8f7508..99ddb7ee530 100644 --- a/iop/fs/vfat/src/fs_driver.c +++ b/iop/fs/vfat/src/fs_driver.c @@ -228,7 +228,14 @@ static void fs_reset(void) static int fs_inited = 0; //--------------------------------------------------------------------------- +static int fs_dummy(void) +{ + M_DEBUG("%s\n", __func__); + return -EIO; +} + +//--------------------------------------------------------------------------- static int fs_init(iop_device_t *driver) { (void)driver; @@ -832,7 +839,7 @@ int fs_ioctl(iop_file_t *fd, int cmd, void *data) break; #endif default: - ret = -5; //EIO + ret = fs_dummy(); } _fs_unlock(); @@ -986,7 +993,7 @@ static int fs_ioctl2(iop_file_t *fd, int cmd, void *data, unsigned int datalen, break; } default: - ret = -5; // EIO + ret = fs_dummy(); } _fs_unlock(); @@ -997,8 +1004,8 @@ static int fs_ioctl2(iop_file_t *fd, int cmd, void *data, unsigned int datalen, #ifndef WIN32 static iop_device_ops_t fs_functarray = { &fs_init, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&fs_dummy, + (void *)&fs_dummy, &fs_open, &fs_close, &fs_read, @@ -1012,24 +1019,24 @@ static iop_device_ops_t fs_functarray = { &fs_dclose, &fs_dread, &fs_getstat, - NOT_SUPPORTED, + (void *)&fs_dummy, &fs_rename, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&fs_dummy, + (void *)&fs_dummy, + (void *)&fs_dummy, + (void *)&fs_dummy, + (void *)&fs_dummy, #ifndef BUILDING_IEEE1394_DISK &fs_devctl, #else - NOT_SUPPORTED, + (void *)&fs_dummy, #endif /* BUILDING_IEEE1394_DISK */ - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&fs_dummy, + (void *)&fs_dummy, #if !defined(BUILDING_IEEE1394_DISK) && !defined(BUILDING_USBHDFSD) &fs_ioctl2, #else - NOT_SUPPORTED, + (void *)&fs_dummy, #endif /* BUILDING_IEEE1394_DISK */ }; static iop_device_t fs_driver = { diff --git a/iop/hdd/apa/src/hdd.c b/iop/hdd/apa/src/hdd.c index 816abe84fa2..c640c3314f6 100644 --- a/iop/hdd/apa/src/hdd.c +++ b/iop/hdd/apa/src/hdd.c @@ -48,24 +48,24 @@ static iomanX_iop_device_ops_t hddOps={ &hddRead, &hddWrite, &hddLseek, - NOT_SUPPORTED, + (void*)&hddUnsupported, &hddRemove, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void*)&hddUnsupported, + (void*)&hddUnsupported, &hddDopen, &hddClose, &hddDread, &hddGetStat, - NOT_SUPPORTED, + (void*)&hddUnsupported, &hddReName, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void*)&hddUnsupported, + (void*)&hddUnsupported, hddMount, hddUmount, - NOT_SUPPORTED, + (void*)&hddUnsupported, &hddDevctl, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void*)&hddUnsupported, + (void*)&hddUnsupported, &hddIoctl2, }; static iomanX_iop_device_t hddFioDev={ diff --git a/iop/hdd/apa/src/hdd_fio.c b/iop/hdd/apa/src/hdd_fio.c index b1fb80b1aec..8676298807d 100644 --- a/iop/hdd/apa/src/hdd_fio.c +++ b/iop/hdd/apa/src/hdd_fio.c @@ -1172,3 +1172,10 @@ int hddUmount(iomanX_iop_file_t *f, const char *fsname) return rv; } #endif + +int hddUnsupported(iomanX_iop_file_t *f) +{ + (void)f; + + return -EPERM; +} diff --git a/iop/hdd/apa/src/hdd_fio.h b/iop/hdd/apa/src/hdd_fio.h index 5492d0158f9..c9865511db8 100644 --- a/iop/hdd/apa/src/hdd_fio.h +++ b/iop/hdd/apa/src/hdd_fio.h @@ -31,8 +31,10 @@ int hddDevctl(iomanX_iop_file_t *f, const char *devname, int cmd, void *arg, uns int hddMount(iomanX_iop_file_t *f, const char *fsname, const char *devname, int flag, void *arg, int arglen); int hddUmount(iomanX_iop_file_t *f, const char *fsname); #else -#define hddMount (NOT_SUPPORTED) -#define hddUmount (NOT_SUPPORTED) +#define hddMount ((void*)&hddUnsupported) +#define hddUmount ((void*)&hddUnsupported) #endif +int hddUnsupported(iomanX_iop_file_t *f); + #endif /* _HDD_FIO_H */ diff --git a/iop/hdd/hdck/src/hdck.c b/iop/hdd/hdck/src/hdck.c index e739a3588f5..63151249867 100644 --- a/iop/hdd/hdck/src/hdck.c +++ b/iop/hdd/hdck/src/hdck.c @@ -28,6 +28,7 @@ IRX_ID("hdck", APA_MODVER_MAJOR, APA_MODVER_MINOR); // Function prototypes static int HdckInit(iomanX_iop_device_t *device); +static int HdckUnsupported(void); static int HdckDevctl(iomanX_iop_file_t *fd, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); static u8 IOBuffer[128 * 512]; @@ -35,28 +36,28 @@ static u8 IOBuffer2[128 * 512]; static iomanX_iop_device_ops_t HdckDeviceOps = { &HdckInit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, + (void *)&HdckUnsupported, &HdckDevctl, NULL, NULL, @@ -97,6 +98,11 @@ static struct HdckPrivateData PrivateData = { 0, 0}; +static int HdckUnsupported(void) +{ + return -EPERM; +} + static int HdckInit(iomanX_iop_device_t *device) { (void)device; diff --git a/iop/hdd/hdsk/src/hdsk.c b/iop/hdd/hdsk/src/hdsk.c index 1b50344da57..7420b4dc8c6 100644 --- a/iop/hdd/hdsk/src/hdsk.c +++ b/iop/hdd/hdsk/src/hdsk.c @@ -593,6 +593,11 @@ static int HdskInit(iomanX_iop_device_t *device) return 0; } +static int HdskUnsupported(void) +{ + return -EPERM; +} + int BitmapUsed; u32 TotalCopied; struct hdskBitmap hdskBitmap[HDSK_BITMAP_SIZE]; @@ -726,32 +731,32 @@ static int HdskDevctl(iomanX_iop_file_t *fd, const char *name, int cmd, void *ar static iomanX_iop_device_ops_t HdskDeviceOps = { &HdskInit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, &HdskDevctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, + (void *)&HdskUnsupported, }; static iomanX_iop_device_t HdskDevice = { diff --git a/iop/kernel/include/ioman.h b/iop/kernel/include/ioman.h index c73562b3395..d97321c5fc5 100644 --- a/iop/kernel/include/ioman.h +++ b/iop/kernel/include/ioman.h @@ -16,7 +16,6 @@ #ifndef __IOMAN_H__ #define __IOMAN_H__ -#include #include #include #include @@ -71,9 +70,6 @@ typedef struct _iop_device { struct _iop_device_ops *ops; } iop_device_t; -static inline int not_supported_op (void) {return -ENOTSUP;} -#define NOT_SUPPORTED (void*)¬_supported_op - typedef struct _iop_device_ops { int (*init)(iop_device_t *); int (*deinit)(iop_device_t *); diff --git a/iop/kernel/include/iomanX.h b/iop/kernel/include/iomanX.h index 14bb5f82903..58f212e88cd 100644 --- a/iop/kernel/include/iomanX.h +++ b/iop/kernel/include/iomanX.h @@ -20,7 +20,6 @@ #ifdef _IOP #include #endif -#include #include #include #include @@ -88,9 +87,6 @@ typedef struct _iomanX_iop_device { struct _iomanX_iop_device_ops *ops; } iomanX_iop_device_t; -static inline int not_supported_op (void) {return -ENOTSUP;} -#define NOT_SUPPORTED (void*)¬_supported_op - typedef struct _iomanX_iop_device_ops { int (*init)(iomanX_iop_device_t *); int (*deinit)(iomanX_iop_device_t *); diff --git a/iop/network/smbman/src/smb_fio.c b/iop/network/smbman/src/smb_fio.c index aad39ab3c4b..82f81f74e31 100644 --- a/iop/network/smbman/src/smb_fio.c +++ b/iop/network/smbman/src/smb_fio.c @@ -28,13 +28,13 @@ int smbman_io_sema; static iop_device_ops_t smbman_ops = { &smb_init, &smb_deinit, - NOT_SUPPORTED, + (void *)&smb_dummy, &smb_open, &smb_close, &smb_read, &smb_write, &smb_lseek, - NOT_SUPPORTED, + (void *)&smb_dummy, &smb_remove, &smb_mkdir, &smb_rmdir, @@ -42,18 +42,17 @@ static iop_device_ops_t smbman_ops = { &smb_dclose, &smb_dread, &smb_getstat, - NOT_SUPPORTED, + (void *)&smb_dummy, &smb_rename, &smb_chdir, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)&smb_dummy, + (void *)&smb_dummy, + (void *)&smb_dummy, &smb_lseek64, &smb_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED -}; + (void *)&smb_dummy, + (void *)&smb_dummy, + (void *)&smb_dummy}; // driver descriptor static iop_device_t smbdev = { @@ -207,6 +206,12 @@ static void keepalive_thread(void *args) } } +//-------------------------------------------------------------- +int smb_dummy(void) +{ + return -EIO; +} + //-------------------------------------------------------------- int smb_init(iop_device_t *dev) { diff --git a/iop/network/udptty/src/udptty.c b/iop/network/udptty/src/udptty.c index 2deccb9492c..58e36c7a61b 100644 --- a/iop/network/udptty/src/udptty.c +++ b/iop/network/udptty/src/udptty.c @@ -41,26 +41,27 @@ static int tty_init(iop_device_t *device); static int tty_deinit(iop_device_t *device); static int tty_stdout_fd(void); static int tty_write(iop_file_t *file, void *buf, size_t size); +static int tty_error(void); /* device ops */ static iop_device_ops_t tty_ops = { tty_init, tty_deinit, - NOT_SUPPORTED, + (void *)tty_error, (void *)tty_stdout_fd, (void *)tty_stdout_fd, - NOT_SUPPORTED, + (void *)tty_error, (void *)tty_write, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + (void *)tty_error, + (void *)tty_error, + (void *)tty_error, + (void *)tty_error, + (void *)tty_error, + (void *)tty_error, + (void *)tty_error, + (void *)tty_error, + (void *)tty_error, + (void *)tty_error, }; /* device descriptor */ @@ -279,3 +280,8 @@ static int tty_write(iop_file_t *file, void *buf, size_t size) return res; } + +static int tty_error(void) +{ + return -EIO; +} diff --git a/iop/usb/keyboard/src/ps2kbd.c b/iop/usb/keyboard/src/ps2kbd.c index d6be352e41d..5fd38795887 100644 --- a/iop/usb/keyboard/src/ps2kbd.c +++ b/iop/usb/keyboard/src/ps2kbd.c @@ -974,10 +974,16 @@ void ps2kbd_ioctl_setblockmode(u32 blockmode) } void ps2kbd_ioctl_setrepeatrate(u32 rate) + { kbd_repeatrate = rate; } +int fio_dummy() +{ + //printf("fio_dummy()\n"); + return -EIO; +} int fio_init(iop_device_t *driver) { @@ -1111,25 +1117,26 @@ int fio_close(iop_file_t *f) } static iop_device_ops_t fio_ops = -{ - &fio_init, - NOT_SUPPORTED, - &fio_format, - &fio_open, - &fio_close, - &fio_read, - NOT_SUPPORTED, - NOT_SUPPORTED, - &fio_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, -}; + + { + &fio_init, + (void *)&fio_dummy, + &fio_format, + &fio_open, + &fio_close, + &fio_read, + (void *)&fio_dummy, + (void *)&fio_dummy, + &fio_ioctl, + (void *)&fio_dummy, + (void *)&fio_dummy, + (void *)&fio_dummy, + (void *)&fio_dummy, + (void *)&fio_dummy, + (void *)&fio_dummy, + (void *)&fio_dummy, + (void *)&fio_dummy, + }; static iop_device_t kbd_filedrv = { PS2KBD_FSNAME,