From a7d7262eaa7f94053fe65475fbc5045d36250eb8 Mon Sep 17 00:00:00 2001 From: israpps <57065102+israpps@users.noreply.github.com> Date: Thu, 30 May 2024 15:28:20 -0300 Subject: [PATCH] add generic stub for unsupported ops on ioman(x) - improves readability (IMO) - unified return value for unsupported ops (`-ENOTSUP`) making it clear from EE side that the operation that just failed is simply stubbed on the IOP --- 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/dev9/dev9/src/ps2dev9.c | 57 +++++++++++++--------------- iop/dvrp/dvr/src/dvr.c | 50 +++++++++++------------- iop/dvrp/dvrav/src/dvrav.c | 49 +++++++++++------------- 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/romdrv/src/romdrv.c | 29 ++++++-------- iop/fs/vfat/src/fs_driver.c | 36 +++++++----------- 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/fsck/src/fsck.c | 48 +++++++++++------------ iop/hdd/fssk/src/fssk.c | 45 ++++++++++------------ 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 ++++++++++------------ 27 files changed, 399 insertions(+), 516 deletions(-) diff --git a/iop/arcade/accdvd/src/cddrv.c b/iop/arcade/accdvd/src/cddrv.c index e32d52a8f9a..17730497c46 100644 --- a/iop/arcade/accdvd/src/cddrv.c +++ b/iop/arcade/accdvd/src/cddrv.c @@ -18,26 +18,27 @@ 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, - &cddrv_dummy, + NOT_SUPPORTED, &cddrv_open, &cddrv_close, &cddrv_read, &cddrv_write, &cddrv_lseek, &cddrv_ioctl, - &cddrv_dummy, - &cddrv_dummy, - &cddrv_dummy, - &cddrv_dummy, - &cddrv_dummy, - &cddrv_dummy, - &cddrv_dummy, - &cddrv_dummy}; + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED +}; static iop_device_t Cddrv = {"cdrom", 16u, 0u, "ATAPI_C/DVD-ROM", &Cddrv_ops}; @@ -158,11 +159,6 @@ static int cddrv_ioctl(iop_file_t *io, int cmd, void *arg) return -22; } -static int cddrv_dummy() -{ - return -22; -} - 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 a495df7c623..32381e4bdb5 100755 --- a/iop/cdvd/cdfs/src/main.c +++ b/iop/cdvd/cdfs/src/main.c @@ -417,29 +417,24 @@ 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 -5; -} - static iop_device_ops_t fio_ops = { &fio_init, &fio_deinit, - (void *)&cdfs_dummy, + NOT_SUPPORTED, &fio_open, &fio_close, &fio_read, &fio_write, &fio_lseek, - (void *)&cdfs_dummy, - (void *)&cdfs_dummy, - (void *)&cdfs_dummy, - (void *)&cdfs_dummy, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, &fio_openDir, &fio_closeDir, &fio_dread, &fio_getstat, - (void *)&cdfs_dummy, + NOT_SUPPORTED, }; static iop_device_t fio_driver = { diff --git a/iop/cdvd/xesdrv/src/xesdrv.c b/iop/cdvd/xesdrv/src/xesdrv.c index ddc5846599e..8f995b73cda 100644 --- a/iop/cdvd/xesdrv/src/xesdrv.c +++ b/iop/cdvd/xesdrv/src/xesdrv.c @@ -28,7 +28,6 @@ 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); @@ -223,30 +222,30 @@ struct DevctlCmdTbl_t static iomanX_iop_device_ops_t DvrFuncTbl = { &esdrv_df_init, &esdrv_df_exit, - (void *)&esdrv_df_null, - (void *)&esdrv_df_null, - (void *)&esdrv_df_null, - (void *)&esdrv_df_null, - (void *)&esdrv_df_null, - (void *)&esdrv_df_null, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, &esdrv_df_ioctl, - (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, + 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_long, &esdrv_df_devctl, - (void *)&esdrv_df_null, - (void *)&esdrv_df_null, + NOT_SUPPORTED, + NOT_SUPPORTED, &esdrv_df_ioctl2, }; static iomanX_iop_device_t ESDRV = { @@ -372,11 +371,6 @@ esdrv_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, v return -EINVAL; } -static int esdrv_df_null() -{ - return -48; -} - static s64 esdrv_df_null_long() { return -48; diff --git a/iop/debug/iop_sbusdbg/src/sbus_tty.c b/iop/debug/iop_sbusdbg/src/sbus_tty.c index 85606059941..0deafd5850e 100644 --- a/iop/debug/iop_sbusdbg/src/sbus_tty.c +++ b/iop/debug/iop_sbusdbg/src/sbus_tty.c @@ -26,8 +26,6 @@ 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 -1; } - static int ttyfs_init() { //DBG_puts("SIOTTY: FS Init()\n"); @@ -97,21 +95,21 @@ static iop_device_ops_t fsd_ops = { &ttyfs_init, &ttyfs_deinit, - (void *)&ttyfs_error, + NOT_SUPPORTED, &ttyfs_open, &ttyfs_close, - (void *)&ttyfs_error, + NOT_SUPPORTED, &ttyfs_write, - (void *)&ttyfs_error, - (void *)&ttyfs_error, - (void *)&ttyfs_error, - (void *)&ttyfs_error, - (void *)&ttyfs_error, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, &ttyfs_dopen, &ttyfs_close, - (void *)&ttyfs_error, - (void *)&ttyfs_error, - (void *)&ttyfs_error, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, }; static iop_device_t tty_fsd = diff --git a/iop/debug/ppctty/src/tty.c b/iop/debug/ppctty/src/tty.c index 2d25e0da1b2..96f01b48419 100644 --- a/iop/debug/ppctty/src/tty.c +++ b/iop/debug/ppctty/src/tty.c @@ -25,8 +25,6 @@ static int tty_sema = -1; extern void tty_puts(const char *str); -static int ttyfs_error() { return -1; } - static int ttyfs_init() { DPRINTF("FS Init()\n"); @@ -104,21 +102,21 @@ static iop_device_ops_t fsd_ops = { &ttyfs_init, &ttyfs_deinit, - (void *)&ttyfs_error, + NOT_SUPPORTED, &ttyfs_open, &ttyfs_close, - (void *)&ttyfs_error, + NOT_SUPPORTED, &ttyfs_write, - (void *)&ttyfs_error, - (void *)&ttyfs_error, - (void *)&ttyfs_error, - (void *)&ttyfs_error, - (void *)&ttyfs_error, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, &ttyfs_dopen, &ttyfs_close, - (void *)&ttyfs_error, - (void *)&ttyfs_error, - (void *)&ttyfs_error, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, }; static iop_device_t tty_fsd = diff --git a/iop/dev9/dev9/src/ps2dev9.c b/iop/dev9/dev9/src/ps2dev9.c index 816e752c14e..04ad1600e9b 100644 --- a/iop/dev9/dev9/src/ps2dev9.c +++ b/iop/dev9/dev9/src/ps2dev9.c @@ -122,11 +122,6 @@ static int expbay_init(int sema_attr); extern struct irx_export_table _exp_dev9; -static int dev9x_dummy(void) -{ - return 0; -} - static int dev9x_devctl(iop_file_t *f, const char *name, int cmd, void *args, unsigned int arglen, void *buf, unsigned int buflen) { (void)f; @@ -153,33 +148,33 @@ static int dev9x_devctl(iop_file_t *f, const char *name, int cmd, void *args, un static iop_device_ops_t dev9x_ops = { - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, + 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, + NOT_SUPPORTED, &dev9x_devctl, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, }; static iop_device_t dev9x_device = diff --git a/iop/dvrp/dvr/src/dvr.c b/iop/dvrp/dvr/src/dvr.c index f1500e5b603..26e50310a91 100644 --- a/iop/dvrp/dvr/src/dvr.c +++ b/iop/dvrp/dvr/src/dvr.c @@ -33,7 +33,6 @@ 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); @@ -114,30 +113,30 @@ static iomanX_iop_device_ops_t DvrFuncTbl = { &dvr_df_init, &dvr_df_exit, - (void *)&dvr_df_null, - (void *)&dvr_df_null, - (void *)&dvr_df_null, - (void *)&dvr_df_null, - (void *)&dvr_df_null, - (void *)&dvr_df_null, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, &dvr_df_ioctl, - (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, + 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_long, &dvr_df_devctl, - (void *)&dvr_df_null, - (void *)&dvr_df_null, + NOT_SUPPORTED, + NOT_SUPPORTED, &dvr_df_ioctl2, }; char TEVENT_BUF[6144]; @@ -286,14 +285,9 @@ int dvr_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, return -22; } -int dvr_df_null() -{ - return -48; -} - s64 dvr_df_null_long() { - return -48LL; + return -134LL; } int dvrioctl2_rec_start( diff --git a/iop/dvrp/dvrav/src/dvrav.c b/iop/dvrp/dvrav/src/dvrav.c index ee9e6b408b5..cfad4c71969 100644 --- a/iop/dvrp/dvrav/src/dvrav.c +++ b/iop/dvrp/dvrav/src/dvrav.c @@ -32,7 +32,6 @@ 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); @@ -113,30 +112,30 @@ static iomanX_iop_device_ops_t DvrFuncTbl = { &dvrav_df_init, &dvrav_df_exit, - (void *)&dvrav_df_null, - (void *)&dvrav_df_null, - (void *)&dvrav_df_null, - (void *)&dvrav_df_null, - (void *)&dvrav_df_null, - (void *)&dvrav_df_null, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, &dvrav_df_ioctl, - (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, + 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_long, &dvrav_df_devctl, - (void *)&dvrav_df_null, - (void *)&dvrav_df_null, + NOT_SUPPORTED, + NOT_SUPPORTED, &dvrav_df_ioctl2, }; static iomanX_iop_device_t DVRAV = { @@ -284,14 +283,10 @@ int dvrav_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int argle return -22; } -int dvrav_df_null() -{ - return -48; -} s64 dvrav_df_null_long() { - return -48LL; + return -134LL; } int avioctl2_get_tun_offset( diff --git a/iop/dvrp/dvrdv/src/dvrdv.c b/iop/dvrp/dvrdv/src/dvrdv.c index 0752dcc8a6b..62aef8f07d9 100644 --- a/iop/dvrp/dvrdv/src/dvrdv.c +++ b/iop/dvrp/dvrdv/src/dvrdv.c @@ -32,7 +32,6 @@ 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); @@ -54,34 +53,35 @@ 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, - (void *)&dvrdv_df_null, - (void *)&dvrdv_df_null, - (void *)&dvrdv_df_null, - (void *)&dvrdv_df_null, - (void *)&dvrdv_df_null, - (void *)&dvrdv_df_null, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, &dvrdv_df_ioctl, - (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, + 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_long, &dvrdv_df_devctl, - (void *)&dvrdv_df_null, - (void *)&dvrdv_df_null, + NOT_SUPPORTED, + NOT_SUPPORTED, &dvrdv_df_ioctl2, }; static iomanX_iop_device_t DVR = { @@ -233,14 +233,9 @@ int dvrdv_df_ioctl2( return -22; } -int dvrdv_df_null() -{ - return -48; -} - s64 dvrdv_df_null_long() { - return -48LL; + return -134LL; } int dvrioctl2_dv_dubb_start( diff --git a/iop/dvrp/dvripl/src/dvripl.c b/iop/dvrp/dvripl/src/dvripl.c index 12975e79205..dafdd7f269f 100644 --- a/iop/dvrp/dvripl/src/dvripl.c +++ b/iop/dvrp/dvripl/src/dvripl.c @@ -34,7 +34,6 @@ 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); @@ -43,30 +42,30 @@ static iomanX_iop_device_ops_t DvrFuncTbl = { &dvripl_df_init, &dvripl_df_exit, - &dvripl_df_null, - &dvripl_df_null, - &dvripl_df_null, - &dvripl_df_null, - &dvripl_df_null, - &dvripl_df_null, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, &dvripl_df_ioctl, - &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, + 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_long, &dvripl_df_devctl, - &dvripl_df_null, - &dvripl_df_null, + NOT_SUPPORTED, + NOT_SUPPORTED, &dvripl_df_ioctl2, }; s32 dvr_ready_flag; @@ -200,14 +199,9 @@ int dvripl_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int argl return -22; } -int dvripl_df_null() -{ - return -48; -} - s64 dvripl_df_null_long() { - return -48LL; + return -134LL; } 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 8d5aff0829c..e86f678b1c5 100644 --- a/iop/dvrp/dvrmisc/src/dvrmisc.c +++ b/iop/dvrp/dvrmisc/src/dvrmisc.c @@ -33,7 +33,6 @@ 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); @@ -93,34 +92,35 @@ 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, - &dvrmisc_df_null, - &dvrmisc_df_null, - &dvrmisc_df_null, - &dvrmisc_df_null, - &dvrmisc_df_null, - &dvrmisc_df_null, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, &dvrmisc_df_ioctl, - &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, + 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_long, &dvrmisc_df_devctl, - &dvrmisc_df_null, - &dvrmisc_df_null, + NOT_SUPPORTED, + NOT_SUPPORTED, &dvrmisc_df_ioctl2, }; static iomanX_iop_device_t DVRMISC = { @@ -276,14 +276,9 @@ int dvrmisc_df_ioctl2( return -22; } -int dvrmisc_df_null() -{ - return -48; -} - s64 dvrmisc_df_null_long() { - return -48LL; + return -134LL; } 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 2cc6f965920..5a9ed9b0517 100644 --- a/iop/fs/bdmfs_fatfs/src/fs_driver.c +++ b/iop/fs/bdmfs_fatfs/src/fs_driver.c @@ -260,14 +260,6 @@ static DIR *fs_find_free_dir_structure(void) return NULL; } -//--------------------------------------------------------------------------- -static int fs_dummy(void) -{ - M_DEBUG("%s\n", __func__); - - return -5; -} - //--------------------------------------------------------------------------- static int fs_init(iop_device_t *driver) { @@ -801,8 +793,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, - (void *)&fs_dummy, - (void *)&fs_dummy, + NOT_SUPPORTED, + NOT_SUPPORTED, &fs_open, &fs_close, &fs_read, @@ -816,16 +808,16 @@ static iop_device_ops_t fs_functarray = { &fs_dclose, &fs_dread, &fs_getstat, - (void *)&fs_dummy, + NOT_SUPPORTED, &fs_rename, - (void *)&fs_dummy, - (void *)&fs_dummy, - (void *)&fs_dummy, - (void *)&fs_dummy, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, &fs_lseek64, &fs_devctl, - (void *)&fs_dummy, - (void *)&fs_dummy, + NOT_SUPPORTED, + NOT_SUPPORTED, &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 60e9328cf6c..28884209577 100644 --- a/iop/fs/devfs/src/devfs.c +++ b/iop/fs/devfs/src/devfs.c @@ -324,16 +324,6 @@ 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 -1; -} - /** ioman init handler * @returns Always returns 0 */ @@ -1007,34 +997,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, - (void *)&devfs_dummy, + NOT_SUPPORTED, &devfs_open, &devfs_close, &devfs_read, - (void *)&devfs_dummy, - (void *)&devfs_dummy, + NOT_SUPPORTED, + NOT_SUPPORTED, &devfs_ioctl, - (void *)&devfs_dummy, - (void *)&devfs_dummy, - (void *)&devfs_dummy, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, &devfs_dopen, &devfs_dclose, &devfs_dread, &devfs_getstat, - (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, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, &devfs_ioctl2, }; diff --git a/iop/fs/romdrv/src/romdrv.c b/iop/fs/romdrv/src/romdrv.c index 1eb68bcc437..fc29ab89a77 100644 --- a/iop/fs/romdrv/src/romdrv.c +++ b/iop/fs/romdrv/src/romdrv.c @@ -42,7 +42,6 @@ static struct RomFileSlot fileSlots[ROMDRV_MAX_FILES]; /* Function prototypes */ static int init(void); -static int romUnsupported(void); static int romInit(iop_device_t *device); static int romOpen(iop_file_t *fd, const char *path, int mode); static int romClose(iop_file_t *); @@ -54,22 +53,23 @@ static struct RomdirFileStat *GetFileStatFromImage(const struct RomImg *ImageSta static iop_device_ops_t ops = { &romInit, - (void *)&romUnsupported, - (void *)&romUnsupported, + NOT_SUPPORTED, + NOT_SUPPORTED, &romOpen, &romClose, &romRead, &romWrite, &romLseek, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported}; + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED +}; static iop_device_t DeviceOps = { "rom", @@ -110,11 +110,6 @@ static int init(void) return 0; } -static int romUnsupported(void) -{ - return 0; -} - static int romInit(iop_device_t *device) { (void)device; diff --git a/iop/fs/vfat/src/fs_driver.c b/iop/fs/vfat/src/fs_driver.c index 02bbfe489e5..df2b181480a 100644 --- a/iop/fs/vfat/src/fs_driver.c +++ b/iop/fs/vfat/src/fs_driver.c @@ -227,14 +227,6 @@ static void fs_reset(void) //--------------------------------------------------------------------------- static int fs_inited = 0; -//--------------------------------------------------------------------------- -static int fs_dummy(void) -{ - M_DEBUG("%s\n", __func__); - - return -5; -} - //--------------------------------------------------------------------------- static int fs_init(iop_device_t *driver) { @@ -839,7 +831,7 @@ int fs_ioctl(iop_file_t *fd, int cmd, void *data) break; #endif default: - ret = fs_dummy(); + ret = -5; //EIO } _fs_unlock(); @@ -993,7 +985,7 @@ static int fs_ioctl2(iop_file_t *fd, int cmd, void *data, unsigned int datalen, break; } default: - ret = fs_dummy(); + ret = -5; // EIO } _fs_unlock(); @@ -1004,8 +996,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, - (void *)&fs_dummy, - (void *)&fs_dummy, + NOT_SUPPORTED, + NOT_SUPPORTED, &fs_open, &fs_close, &fs_read, @@ -1019,24 +1011,24 @@ static iop_device_ops_t fs_functarray = { &fs_dclose, &fs_dread, &fs_getstat, - (void *)&fs_dummy, + NOT_SUPPORTED, &fs_rename, - (void *)&fs_dummy, - (void *)&fs_dummy, - (void *)&fs_dummy, - (void *)&fs_dummy, - (void *)&fs_dummy, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, #ifndef BUILDING_IEEE1394_DISK &fs_devctl, #else - (void *)&fs_dummy, + NOT_SUPPORTED, #endif /* BUILDING_IEEE1394_DISK */ - (void *)&fs_dummy, - (void *)&fs_dummy, + NOT_SUPPORTED, + NOT_SUPPORTED, #if !defined(BUILDING_IEEE1394_DISK) && !defined(BUILDING_USBHDFSD) &fs_ioctl2, #else - (void *)&fs_dummy, + NOT_SUPPORTED, #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 c640c3314f6..816abe84fa2 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, - (void*)&hddUnsupported, + NOT_SUPPORTED, &hddRemove, - (void*)&hddUnsupported, - (void*)&hddUnsupported, + NOT_SUPPORTED, + NOT_SUPPORTED, &hddDopen, &hddClose, &hddDread, &hddGetStat, - (void*)&hddUnsupported, + NOT_SUPPORTED, &hddReName, - (void*)&hddUnsupported, - (void*)&hddUnsupported, + NOT_SUPPORTED, + NOT_SUPPORTED, hddMount, hddUmount, - (void*)&hddUnsupported, + NOT_SUPPORTED, &hddDevctl, - (void*)&hddUnsupported, - (void*)&hddUnsupported, + NOT_SUPPORTED, + NOT_SUPPORTED, &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 3f68d86967d..b1fb80b1aec 100644 --- a/iop/hdd/apa/src/hdd_fio.c +++ b/iop/hdd/apa/src/hdd_fio.c @@ -1172,10 +1172,3 @@ int hddUmount(iomanX_iop_file_t *f, const char *fsname) return rv; } #endif - -int hddUnsupported(iomanX_iop_file_t *f) -{ - (void)f; - - return -1; -} diff --git a/iop/hdd/apa/src/hdd_fio.h b/iop/hdd/apa/src/hdd_fio.h index c9865511db8..5492d0158f9 100644 --- a/iop/hdd/apa/src/hdd_fio.h +++ b/iop/hdd/apa/src/hdd_fio.h @@ -31,10 +31,8 @@ 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 ((void*)&hddUnsupported) -#define hddUmount ((void*)&hddUnsupported) +#define hddMount (NOT_SUPPORTED) +#define hddUmount (NOT_SUPPORTED) #endif -int hddUnsupported(iomanX_iop_file_t *f); - #endif /* _HDD_FIO_H */ diff --git a/iop/hdd/fsck/src/fsck.c b/iop/hdd/fsck/src/fsck.c index 17048ee0325..bb2e802f7fe 100644 --- a/iop/hdd/fsck/src/fsck.c +++ b/iop/hdd/fsck/src/fsck.c @@ -896,10 +896,10 @@ static void FsckThread(void *arg) } // 0x0000264c -static int FsckUnsupported(void) -{ - return 0; -} +//static int FsckUnsupported(void) +//{ +// return 0; +//} // 0x00000340 static int fsckCheckBitmap(pfs_mount_t *mount, void *buffer) @@ -1218,32 +1218,32 @@ static int FsckIoctl2(iomanX_iop_file_t *fd, int cmd, void *arg, unsigned int ar } static iomanX_iop_device_ops_t FsckDeviceOps = { - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, + NOT_SUPPORTED, + NOT_SUPPORTED, NULL, &FsckOpen, &FsckClose, NULL, NULL, NULL, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, + 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, &FsckIoctl2}; static iomanX_iop_device_t FsckDevice = { diff --git a/iop/hdd/fssk/src/fssk.c b/iop/hdd/fssk/src/fssk.c index 38de566320f..23846c887f6 100644 --- a/iop/hdd/fssk/src/fssk.c +++ b/iop/hdd/fssk/src/fssk.c @@ -563,11 +563,6 @@ static void FsskThread(pfs_mount_t *mount) SetEventFlag(fsskEventFlagID, 1); } -static int FsskUnsupported(void) -{ - return 0; -} - static int FsskOpen(iomanX_iop_file_t *fd, const char *name, int flags, int mode) { int blockfd, result; @@ -721,32 +716,32 @@ static int FsskIoctl2(iomanX_iop_file_t *fd, int cmd, void *arg, unsigned int ar } static iomanX_iop_device_ops_t FsskDeviceOps = { - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, + NOT_SUPPORTED, + NOT_SUPPORTED, NULL, &FsskOpen, &FsskClose, NULL, NULL, NULL, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, + 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, &FsskIoctl2}; static iomanX_iop_device_t FsskDevice = { diff --git a/iop/hdd/hdck/src/hdck.c b/iop/hdd/hdck/src/hdck.c index a3daf4bc3ab..e739a3588f5 100644 --- a/iop/hdd/hdck/src/hdck.c +++ b/iop/hdd/hdck/src/hdck.c @@ -28,7 +28,6 @@ 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]; @@ -36,28 +35,28 @@ static u8 IOBuffer2[128 * 512]; static iomanX_iop_device_ops_t HdckDeviceOps = { &HdckInit, - (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, + 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, &HdckDevctl, NULL, NULL, @@ -98,11 +97,6 @@ static struct HdckPrivateData PrivateData = { 0, 0}; -static int HdckUnsupported(void) -{ - return -1; -} - 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 acfe25de69f..1b50344da57 100644 --- a/iop/hdd/hdsk/src/hdsk.c +++ b/iop/hdd/hdsk/src/hdsk.c @@ -593,11 +593,6 @@ static int HdskInit(iomanX_iop_device_t *device) return 0; } -static int HdskUnsupported(void) -{ - return -1; -} - int BitmapUsed; u32 TotalCopied; struct hdskBitmap hdskBitmap[HDSK_BITMAP_SIZE]; @@ -731,32 +726,32 @@ static int HdskDevctl(iomanX_iop_file_t *fd, const char *name, int cmd, void *ar static iomanX_iop_device_ops_t HdskDeviceOps = { &HdskInit, - (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, + 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, &HdskDevctl, - (void *)&HdskUnsupported, - (void *)&HdskUnsupported, - (void *)&HdskUnsupported, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, }; static iomanX_iop_device_t HdskDevice = { diff --git a/iop/kernel/include/ioman.h b/iop/kernel/include/ioman.h index d97321c5fc5..c73562b3395 100644 --- a/iop/kernel/include/ioman.h +++ b/iop/kernel/include/ioman.h @@ -16,6 +16,7 @@ #ifndef __IOMAN_H__ #define __IOMAN_H__ +#include #include #include #include @@ -70,6 +71,9 @@ 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 58f212e88cd..14bb5f82903 100644 --- a/iop/kernel/include/iomanX.h +++ b/iop/kernel/include/iomanX.h @@ -20,6 +20,7 @@ #ifdef _IOP #include #endif +#include #include #include #include @@ -87,6 +88,9 @@ 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 82f81f74e31..aad39ab3c4b 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, - (void *)&smb_dummy, + NOT_SUPPORTED, &smb_open, &smb_close, &smb_read, &smb_write, &smb_lseek, - (void *)&smb_dummy, + NOT_SUPPORTED, &smb_remove, &smb_mkdir, &smb_rmdir, @@ -42,17 +42,18 @@ static iop_device_ops_t smbman_ops = { &smb_dclose, &smb_dread, &smb_getstat, - (void *)&smb_dummy, + NOT_SUPPORTED, &smb_rename, &smb_chdir, - (void *)&smb_dummy, - (void *)&smb_dummy, - (void *)&smb_dummy, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, &smb_lseek64, &smb_devctl, - (void *)&smb_dummy, - (void *)&smb_dummy, - (void *)&smb_dummy}; + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED +}; // driver descriptor static iop_device_t smbdev = { @@ -206,12 +207,6 @@ 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 58e36c7a61b..2deccb9492c 100644 --- a/iop/network/udptty/src/udptty.c +++ b/iop/network/udptty/src/udptty.c @@ -41,27 +41,26 @@ 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, - (void *)tty_error, + NOT_SUPPORTED, (void *)tty_stdout_fd, (void *)tty_stdout_fd, - (void *)tty_error, + NOT_SUPPORTED, (void *)tty_write, - (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, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, }; /* device descriptor */ @@ -280,8 +279,3 @@ 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 c6eaf30b2d7..df7cbbdaac8 100644 --- a/iop/usb/keyboard/src/ps2kbd.c +++ b/iop/usb/keyboard/src/ps2kbd.c @@ -973,16 +973,10 @@ void ps2kbd_ioctl_setblockmode(u32 blockmode) } void ps2kbd_ioctl_setrepeatrate(u32 rate) - { kbd_repeatrate = rate; } -int fio_dummy() -{ - //printf("fio_dummy()\n"); - return -5; -} int fio_init(iop_device_t *driver) { @@ -1116,26 +1110,25 @@ int fio_close(iop_file_t *f) } static iop_device_ops_t fio_ops = - - { - &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, - }; +{ + &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, +}; static iop_device_t kbd_filedrv = { PS2KBD_FSNAME,