Skip to content

Commit

Permalink
Merge pull request #625 from israpps/ioman-iomanx-notsup-generic-resp…
Browse files Browse the repository at this point in the history
…onse

add generic stub for unsupported ops on ioman(X)
  • Loading branch information
fjtrujy authored Nov 6, 2024
2 parents 7ccee55 + ad47a39 commit 79faa80
Show file tree
Hide file tree
Showing 27 changed files with 399 additions and 516 deletions.
26 changes: 11 additions & 15 deletions iop/arcade/accdvd/src/cddrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -158,11 +159,6 @@ 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;
Expand Down
17 changes: 6 additions & 11 deletions iop/cdvd/cdfs/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,29 +418,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 -EIO;
}

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 = {
Expand Down
48 changes: 21 additions & 27 deletions iop/cdvd/xesdrv/src/xesdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 -EUNSUP;
}

static s64 esdrv_df_null_long()
{
return -EUNSUP;
Expand Down
22 changes: 10 additions & 12 deletions iop/debug/iop_sbusdbg/src/sbus_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,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 -EPERM; }

static int ttyfs_init()
{
//DBG_puts("SIOTTY: FS Init()\n");
Expand Down Expand Up @@ -98,21 +96,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 =
Expand Down
22 changes: 10 additions & 12 deletions iop/debug/ppctty/src/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ 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");
Expand Down Expand Up @@ -105,21 +103,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 =
Expand Down
57 changes: 26 additions & 31 deletions iop/dev9/dev9/src/ps2dev9.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 =
Expand Down
50 changes: 22 additions & 28 deletions iop/dvrp/dvr/src/dvr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -286,14 +285,9 @@ 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 -EUNSUP;
return -134LL;
}

int dvrioctl2_rec_start(
Expand Down
Loading

0 comments on commit 79faa80

Please sign in to comment.