diff --git a/Source/Core/Core/IOS/Device.h b/Source/Core/Core/IOS/Device.h index 64d14adf3f..d393dcd239 100644 --- a/Source/Core/Core/IOS/Device.h +++ b/Source/Core/Core/IOS/Device.h @@ -29,6 +29,7 @@ enum ReturnCode : s32 IPC_EMAX = -5, // Too many file descriptors open IPC_ENOENT = -6, // File not found IPC_EQUEUEFULL = -8, // Queue full + IPC_UNKNOWN = -9, // Unknown IPC_EIO = -12, // ECC error IPC_ENOMEM = -22, // Alloc failed during request FS_EINVAL = -101, // Invalid path diff --git a/Source/Core/Core/IOS/STM/STM.cpp b/Source/Core/Core/IOS/STM/STM.cpp index 0b0e1bbbda..06571b4ae3 100644 --- a/Source/Core/Core/IOS/STM/STM.cpp +++ b/Source/Core/Core/IOS/STM/STM.cpp @@ -58,8 +58,20 @@ std::optional STMImmediateDevice::IOCtl(const IOCtlRequest& request) INFO_LOG_FMT(IOS_STM, " IOCTL_STM_LEDMODE"); break; + case IOCTL_STM_HOTRESET_FOR_PD: + case IOCTL_STM_WAKEUP: + case IOCTL_STM_GET_IDLEMODE: + case IOCTL_STM_READDDRREG: + case IOCTL_STM_READDDRREG2: + case IOCTL_STM_LEDFLASH: + case IOCTL_STM_READVER: + ERROR_LOG_FMT(IOS_STM, "{} - Unimplemented IOCtl: {}", GetDeviceName(), request.request); + break; + default: request.DumpUnknown(GetSystem(), GetDeviceName(), Common::Log::LogType::IOS_STM); + return_value = IPC_UNKNOWN; + break; } return IPCReply(return_value); @@ -73,7 +85,7 @@ STMEventHookDevice::~STMEventHookDevice() std::optional STMEventHookDevice::IOCtl(const IOCtlRequest& request) { if (request.request != IOCTL_STM_EVENTHOOK) - return IPCReply(IPC_EINVAL); + return IPCReply(IPC_UNKNOWN); if (s_event_hook_request) return IPCReply(IPC_EEXIST); diff --git a/Source/Core/Core/IOS/STM/STM.h b/Source/Core/Core/IOS/STM/STM.h index e5eb750cd8..ae2068b792 100644 --- a/Source/Core/Core/IOS/STM/STM.h +++ b/Source/Core/Core/IOS/STM/STM.h @@ -15,20 +15,23 @@ namespace IOS::HLE { enum { + // /dev/stm/eventhook IOCTL_STM_EVENTHOOK = 0x1000, - IOCTL_STM_GET_IDLEMODE = 0x3001, - IOCTL_STM_RELEASE_EH = 0x3002, + + // /dev/stm/immediate IOCTL_STM_HOTRESET = 0x2001, IOCTL_STM_HOTRESET_FOR_PD = 0x2002, IOCTL_STM_SHUTDOWN = 0x2003, IOCTL_STM_IDLE = 0x2004, IOCTL_STM_WAKEUP = 0x2005, + IOCTL_STM_GET_IDLEMODE = 0x3001, + IOCTL_STM_RELEASE_EH = 0x3002, + IOCTL_STM_READDDRREG = 0x4001, + IOCTL_STM_READDDRREG2 = 0x4002, IOCTL_STM_VIDIMMING = 0x5001, IOCTL_STM_LEDFLASH = 0x6001, IOCTL_STM_LEDMODE = 0x6002, IOCTL_STM_READVER = 0x7001, - IOCTL_STM_READDDRREG = 0x4001, - IOCTL_STM_READDDRREG2 = 0x4002, }; enum