From ef5a855b8e92836e172b49f34d113cfe287fbe46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Wed, 18 Jan 2017 20:38:44 +0100 Subject: [PATCH] Update log types names from IPC_HLE to IOS For consistency with the other changes. WII_IPC_DVD was changed to IOS_DI, as this describes what the log type is used for in a more specific way. --- Source/Core/Common/Logging/Log.h | 22 +- Source/Core/Common/Logging/LogManager.cpp | 22 +- Source/Core/Core/HW/DVDInterface.cpp | 4 +- Source/Core/Core/HW/DVDInterface.h | 2 +- Source/Core/Core/HW/WiimoteEmu/Speaker.cpp | 2 +- Source/Core/Core/IOS/DI/DI.cpp | 11 +- Source/Core/Core/IOS/Device.cpp | 2 +- Source/Core/Core/IOS/Device.h | 10 +- Source/Core/Core/IOS/DeviceStub.cpp | 8 +- Source/Core/Core/IOS/ES/ES.cpp | 227 +++++---- Source/Core/Core/IOS/FS/FS.cpp | 113 +++-- Source/Core/Core/IOS/FS/FileIO.cpp | 33 +- Source/Core/Core/IOS/IPC.cpp | 16 +- Source/Core/Core/IOS/Network/Config.cpp | 2 +- Source/Core/Core/IOS/Network/NWC24Config.cpp | 12 +- Source/Core/Core/IOS/Network/Net.cpp | 152 +++--- Source/Core/Core/IOS/Network/Net.h | 2 +- Source/Core/Core/IOS/Network/SSL.cpp | 106 ++--- Source/Core/Core/IOS/Network/Socket.cpp | 36 +- Source/Core/Core/IOS/Network/Socket.h | 4 +- Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp | 58 +-- Source/Core/Core/IOS/STM/STM.cpp | 16 +- Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp | 8 +- Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp | 446 +++++++++--------- Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp | 18 +- .../Core/IOS/USB/Bluetooth/WiimoteDevice.cpp | 157 +++--- .../Core/IOS/USB/Bluetooth/WiimoteHIDAttr.cpp | 2 +- Source/Core/Core/IOS/USB/USB_HIDv4.cpp | 47 +- Source/Core/Core/IOS/USB/USB_KBD.cpp | 2 +- Source/Core/Core/IOS/WFS/WFSI.cpp | 32 +- Source/Core/Core/IOS/WFS/WFSSRV.cpp | 30 +- Source/Core/Core/WiiRoot.cpp | 4 +- Source/Core/Core/ec_wii.cpp | 9 +- 33 files changed, 796 insertions(+), 819 deletions(-) diff --git a/Source/Core/Common/Logging/Log.h b/Source/Core/Common/Logging/Log.h index 165699ff1b..b225fe8dbd 100644 --- a/Source/Core/Common/Logging/Log.h +++ b/Source/Core/Common/Logging/Log.h @@ -27,6 +27,17 @@ enum LOG_TYPE GDB_STUB, GPFIFO, HOST_GPU, + IOS, + IOS_DI, + IOS_ES, + IOS_FILEIO, + IOS_HID, + IOS_NET, + IOS_SD, + IOS_SSL, + IOS_STM, + IOS_WC24, + IOS_WIIMOTE, MASTER_LOG, MEMMAP, MEMCARD_MANAGER, @@ -42,17 +53,6 @@ enum LOG_TYPE VIDEO, VIDEOINTERFACE, WII_IPC, - WII_IPC_DVD, - WII_IPC_ES, - WII_IPC_FILEIO, - WII_IPC_HID, - WII_IPC_HLE, - WII_IPC_NET, - WII_IPC_SD, - WII_IPC_SSL, - WII_IPC_STM, - WII_IPC_WC24, - WII_IPC_WIIMOTE, WIIMOTE, NUMBER_OF_LOGS // Must be last diff --git a/Source/Core/Common/Logging/LogManager.cpp b/Source/Core/Common/Logging/LogManager.cpp index 5d15998398..1d3281ff63 100644 --- a/Source/Core/Common/Logging/LogManager.cpp +++ b/Source/Core/Common/Logging/LogManager.cpp @@ -61,6 +61,17 @@ LogManager::LogManager() m_Log[LogTypes::GDB_STUB] = new LogContainer("GDB_STUB", "GDB Stub"); m_Log[LogTypes::GPFIFO] = new LogContainer("GP", "GPFifo"); m_Log[LogTypes::HOST_GPU] = new LogContainer("Host GPU", "Host GPU"); + m_Log[LogTypes::IOS] = new LogContainer("IOS", "IOS"); + m_Log[LogTypes::IOS_DI] = new LogContainer("IOS_DI", "IOS - Drive Interface"); + m_Log[LogTypes::IOS_ES] = new LogContainer("IOS_ES", "IOS - ETicket Services"); + m_Log[LogTypes::IOS_FILEIO] = new LogContainer("IOS_FILEIO", "IOS - FileIO"); + m_Log[LogTypes::IOS_HID] = new LogContainer("IOS_HID", "IOS - USB_HID"); + m_Log[LogTypes::IOS_SD] = new LogContainer("IOS_SD", "IOS - SDIO"); + m_Log[LogTypes::IOS_SSL] = new LogContainer("IOS_SSL", "IOS - SSL"); + m_Log[LogTypes::IOS_STM] = new LogContainer("IOS_STM", "IOS - State Transition Manager"); + m_Log[LogTypes::IOS_NET] = new LogContainer("IOS_NET", "IOS - Network"); + m_Log[LogTypes::IOS_WC24] = new LogContainer("IOS_WC24", "IOS - WiiConnect24"); + m_Log[LogTypes::IOS_WIIMOTE] = new LogContainer("IOS_WIIMOTE", "IOS - Wii Remote"); m_Log[LogTypes::MASTER_LOG] = new LogContainer("*", "Master Log"); m_Log[LogTypes::MEMCARD_MANAGER] = new LogContainer("MemCard Manager", "MemCard Manager"); m_Log[LogTypes::MEMMAP] = new LogContainer("MI", "MI & memmap"); @@ -77,17 +88,6 @@ LogManager::LogManager() m_Log[LogTypes::VIDEOINTERFACE] = new LogContainer("VI", "Video Interface (VI)"); m_Log[LogTypes::WIIMOTE] = new LogContainer("Wiimote", "Wiimote"); m_Log[LogTypes::WII_IPC] = new LogContainer("WII_IPC", "WII IPC"); - m_Log[LogTypes::WII_IPC_DVD] = new LogContainer("WII_IPC_DVD", "WII IPC DVD"); - m_Log[LogTypes::WII_IPC_ES] = new LogContainer("WII_IPC_ES", "WII IPC ES"); - m_Log[LogTypes::WII_IPC_FILEIO] = new LogContainer("WII_IPC_FILEIO", "WII IPC FILEIO"); - m_Log[LogTypes::WII_IPC_HID] = new LogContainer("WII_IPC_HID", "WII IPC HID"); - m_Log[LogTypes::WII_IPC_HLE] = new LogContainer("WII_IPC_HLE", "WII IPC HLE"); - m_Log[LogTypes::WII_IPC_SD] = new LogContainer("WII_IPC_SD", "WII IPC SD"); - m_Log[LogTypes::WII_IPC_SSL] = new LogContainer("WII_IPC_SSL", "WII IPC SSL"); - m_Log[LogTypes::WII_IPC_STM] = new LogContainer("WII_IPC_STM", "WII IPC STM"); - m_Log[LogTypes::WII_IPC_NET] = new LogContainer("WII_IPC_NET", "WII IPC NET"); - m_Log[LogTypes::WII_IPC_WC24] = new LogContainer("WII_IPC_WC24", "WII IPC WC24"); - m_Log[LogTypes::WII_IPC_WIIMOTE] = new LogContainer("WII_IPC_WIIMOTE", "WII IPC WIIMOTE"); RegisterListener(LogListener::FILE_LISTENER, new FileLogListener(File::GetUserPath(F_MAINLOG_IDX))); diff --git a/Source/Core/Core/HW/DVDInterface.cpp b/Source/Core/Core/HW/DVDInterface.cpp index c8fb97d8e1..c7fe1e4a6d 100644 --- a/Source/Core/Core/HW/DVDInterface.cpp +++ b/Source/Core/Core/HW/DVDInterface.cpp @@ -729,7 +729,7 @@ bool ExecuteReadCommand(u64 DVD_offset, u32 output_address, u32 DVD_length, u32 void ExecuteCommand(u32 command_0, u32 command_1, u32 command_2, u32 output_address, u32 output_length, bool reply_to_ios) { - ReplyType reply_type = reply_to_ios ? ReplyType::IOS_HLE : ReplyType::Interrupt; + ReplyType reply_type = reply_to_ios ? ReplyType::IOS : ReplyType::Interrupt; DIInterruptType interrupt_type = INT_TCINT; s64 ticks_until_completion = SystemTimers::GetTicksPerSecond() / 15000; bool command_handled_by_thread = false; @@ -1153,7 +1153,7 @@ void FinishExecutingCommand(ReplyType reply_type, DIInterruptType interrupt_type break; } - case ReplyType::IOS_HLE: + case ReplyType::IOS: { auto di = IOS::HLE::GetDeviceByName("/dev/di"); if (di) diff --git a/Source/Core/Core/HW/DVDInterface.h b/Source/Core/Core/HW/DVDInterface.h index 279dc15d92..110a24c2ae 100644 --- a/Source/Core/Core/HW/DVDInterface.h +++ b/Source/Core/Core/HW/DVDInterface.h @@ -96,7 +96,7 @@ enum DIInterruptType : int enum class ReplyType : u32 { Interrupt, - IOS_HLE, + IOS, DTK }; diff --git a/Source/Core/Core/HW/WiimoteEmu/Speaker.cpp b/Source/Core/Core/HW/WiimoteEmu/Speaker.cpp index 2100d23779..c5bec3fba8 100644 --- a/Source/Core/Core/HW/WiimoteEmu/Speaker.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/Speaker.cpp @@ -110,7 +110,7 @@ void Wiimote::SpeakerData(wm_speaker_data* sd) } else { - ERROR_LOG(WII_IPC_WIIMOTE, "Unknown speaker format %x", m_reg_speaker.format); + ERROR_LOG(IOS_WIIMOTE, "Unknown speaker format %x", m_reg_speaker.format); return; } diff --git a/Source/Core/Core/IOS/DI/DI.cpp b/Source/Core/Core/IOS/DI/DI.cpp index a13c7a6dea..6092007d19 100644 --- a/Source/Core/Core/IOS/DI/DI.cpp +++ b/Source/Core/Core/IOS/DI/DI.cpp @@ -36,7 +36,7 @@ void DI::DoState(PointerWrap& p) IPCCommandResult DI::IOCtl(const IOSIOCtlRequest& request) { // DI IOCtls are handled in a special way by Dolphin - // compared to other WII_IPC_HLE functions. + // compared to other IOS functions. // This is a wrapper around DVDInterface's ExecuteCommand, // which will execute commands more or less asynchronously. // Only one command can be executed at a time, so commands @@ -95,15 +95,14 @@ IPCCommandResult DI::IOCtlV(const IOSIOCtlVRequest& request) { case DVDInterface::DVDLowOpenPartition: { - _dbg_assert_msg_(WII_IPC_DVD, request.in_vectors[1].address == 0, - "DVDLowOpenPartition with ticket"); - _dbg_assert_msg_(WII_IPC_DVD, request.in_vectors[2].address == 0, + _dbg_assert_msg_(IOS_DI, request.in_vectors[1].address == 0, "DVDLowOpenPartition with ticket"); + _dbg_assert_msg_(IOS_DI, request.in_vectors[2].address == 0, "DVDLowOpenPartition with cert chain"); u64 const partition_offset = ((u64)Memory::Read_U32(request.in_vectors[0].address + 4) << 2); DVDInterface::ChangePartition(partition_offset); - INFO_LOG(WII_IPC_DVD, "DVDLowOpenPartition: partition_offset 0x%016" PRIx64, partition_offset); + INFO_LOG(IOS_DI, "DVDLowOpenPartition: partition_offset 0x%016" PRIx64, partition_offset); // Read TMD to the buffer std::vector tmd_buffer = DVDInterface::GetVolume().GetTMD(); @@ -114,7 +113,7 @@ IPCCommandResult DI::IOCtlV(const IOSIOCtlVRequest& request) break; } default: - request.DumpUnknown(GetDeviceName(), LogTypes::WII_IPC_DVD); + request.DumpUnknown(GetDeviceName(), LogTypes::IOS_DI); } return GetDefaultReply(return_value); } diff --git a/Source/Core/Core/IOS/Device.cpp b/Source/Core/Core/IOS/Device.cpp index f8b87ef7fd..e52e1278bc 100644 --- a/Source/Core/Core/IOS/Device.cpp +++ b/Source/Core/Core/IOS/Device.cpp @@ -160,7 +160,7 @@ IPCCommandResult Device::Unsupported(const IOSRequest& request) {IPC_CMD_SEEK, "Seek"}, {IPC_CMD_IOCTL, "IOCtl"}, {IPC_CMD_IOCTLV, "IOCtlV"}}}; - WARN_LOG(WII_IPC_HLE, "%s does not support %s()", m_name.c_str(), names[request.command].c_str()); + WARN_LOG(IOS, "%s does not support %s()", m_name.c_str(), names[request.command].c_str()); return GetDefaultReply(IPC_EINVAL); } diff --git a/Source/Core/Core/IOS/Device.h b/Source/Core/Core/IOS/Device.h index 7765da1a7e..df139a30af 100644 --- a/Source/Core/Core/IOS/Device.h +++ b/Source/Core/Core/IOS/Device.h @@ -96,11 +96,11 @@ struct IOSIOCtlRequest final : IOSRequest u32 buffer_out = 0; u32 buffer_out_size = 0; explicit IOSIOCtlRequest(u32 address); - void Log(const std::string& description, LogTypes::LOG_TYPE type = LogTypes::WII_IPC_HLE, + void Log(const std::string& description, LogTypes::LOG_TYPE type = LogTypes::IOS, LogTypes::LOG_LEVELS level = LogTypes::LINFO) const; - void Dump(const std::string& description, LogTypes::LOG_TYPE type = LogTypes::WII_IPC_HLE, + void Dump(const std::string& description, LogTypes::LOG_TYPE type = LogTypes::IOS, LogTypes::LOG_LEVELS level = LogTypes::LINFO) const; - void DumpUnknown(const std::string& description, LogTypes::LOG_TYPE type = LogTypes::WII_IPC_HLE, + void DumpUnknown(const std::string& description, LogTypes::LOG_TYPE type = LogTypes::IOS, LogTypes::LOG_LEVELS level = LogTypes::LERROR) const; }; @@ -122,9 +122,9 @@ struct IOSIOCtlVRequest final : IOSRequest std::vector io_vectors; explicit IOSIOCtlVRequest(u32 address); bool HasInputVectorWithAddress(u32 vector_address) const; - void Dump(const std::string& description, LogTypes::LOG_TYPE type = LogTypes::WII_IPC_HLE, + void Dump(const std::string& description, LogTypes::LOG_TYPE type = LogTypes::IOS, LogTypes::LOG_LEVELS level = LogTypes::LINFO) const; - void DumpUnknown(const std::string& description, LogTypes::LOG_TYPE type = LogTypes::WII_IPC_HLE, + void DumpUnknown(const std::string& description, LogTypes::LOG_TYPE type = LogTypes::IOS, LogTypes::LOG_LEVELS level = LogTypes::LERROR) const; }; diff --git a/Source/Core/Core/IOS/DeviceStub.cpp b/Source/Core/Core/IOS/DeviceStub.cpp index 5fb763553d..3fdc25409d 100644 --- a/Source/Core/Core/IOS/DeviceStub.cpp +++ b/Source/Core/Core/IOS/DeviceStub.cpp @@ -17,26 +17,26 @@ Stub::Stub(u32 device_id, const std::string& device_name) : Device(device_id, de IOSReturnCode Stub::Open(const IOSOpenRequest& request) { - WARN_LOG(WII_IPC_HLE, "%s faking Open()", m_name.c_str()); + WARN_LOG(IOS, "%s faking Open()", m_name.c_str()); m_is_active = true; return IPC_SUCCESS; } void Stub::Close() { - WARN_LOG(WII_IPC_HLE, "%s faking Close()", m_name.c_str()); + WARN_LOG(IOS, "%s faking Close()", m_name.c_str()); m_is_active = false; } IPCCommandResult Stub::IOCtl(const IOSIOCtlRequest& request) { - WARN_LOG(WII_IPC_HLE, "%s faking IOCtl()", m_name.c_str()); + WARN_LOG(IOS, "%s faking IOCtl()", m_name.c_str()); return GetDefaultReply(IPC_SUCCESS); } IPCCommandResult Stub::IOCtlV(const IOSIOCtlVRequest& request) { - WARN_LOG(WII_IPC_HLE, "%s faking IOCtlV()", m_name.c_str()); + WARN_LOG(IOS, "%s faking IOCtlV()", m_name.c_str()); return GetDefaultReply(IPC_SUCCESS); } } // namespace Device diff --git a/Source/Core/Core/IOS/ES/ES.cpp b/Source/Core/Core/IOS/ES/ES.cpp index 4c6db1f154..ff8ff7e655 100644 --- a/Source/Core/Core/IOS/ES/ES.cpp +++ b/Source/Core/Core/IOS/ES/ES.cpp @@ -141,7 +141,7 @@ void ES::OpenInternal() m_TitleID = ((u64)0x00010000 << 32) | 0xF00DBEEF; } - INFO_LOG(WII_IPC_ES, "Set default title to %08x/%08x", (u32)(m_TitleID >> 32), (u32)m_TitleID); + INFO_LOG(IOS_ES, "Set default title to %08x/%08x", (u32)(m_TitleID >> 32), (u32)m_TitleID); } void ES::DoState(PointerWrap& p) @@ -200,7 +200,7 @@ IOSReturnCode ES::Open(const IOSOpenRequest& request) OpenInternal(); if (m_is_active) - INFO_LOG(WII_IPC_ES, "Device was re-opened."); + INFO_LOG(IOS_ES, "Device was re-opened."); return Device::Open(request); } @@ -211,7 +211,7 @@ void ES::Close() m_TitleID = -1; m_AccessIdentID = 0x6000000; - INFO_LOG(WII_IPC_ES, "ES: Close"); + INFO_LOG(IOS_ES, "ES: Close"); m_is_active = false; // clear the NAND content cache to make sure nothing remains open. DiscIO::CNANDContentManager::Access().ClearCache(); @@ -223,7 +223,7 @@ u32 ES::OpenTitleContent(u32 CFD, u64 TitleID, u16 Index) if (!Loader.IsValid()) { - WARN_LOG(WII_IPC_ES, "ES: loader not valid for %" PRIx64, TitleID); + WARN_LOG(IOS_ES, "ES: loader not valid for %" PRIx64, TitleID); return 0xffffffff; } @@ -248,7 +248,7 @@ u32 ES::OpenTitleContent(u32 CFD, u64 TitleID, u16 Index) IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) { - DEBUG_LOG(WII_IPC_ES, "%s (0x%x)", GetDeviceName().c_str(), request.request); + DEBUG_LOG(IOS_ES, "%s (0x%x)", GetDeviceName().c_str(), request.request); // Clear the IO buffers. Note that this is unsafe for other ioctlvs. for (const auto& io_vector : request.io_vectors) { @@ -259,10 +259,10 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) { case IOCTL_ES_ADDTICKET: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 3, + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 3, "IOCTL_ES_ADDTICKET wrong number of inputs"); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_ADDTICKET"); + INFO_LOG(IOS_ES, "IOCTL_ES_ADDTICKET"); std::vector ticket(request.in_vectors[0].size); Memory::CopyFromEmu(ticket.data(), request.in_vectors[0].address, request.in_vectors[0].size); DiscIO::AddTicket(ticket); @@ -271,17 +271,17 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_ADDTITLESTART: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 4, + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 4, "IOCTL_ES_ADDTITLESTART wrong number of inputs"); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_ADDTITLESTART"); + INFO_LOG(IOS_ES, "IOCTL_ES_ADDTITLESTART"); std::vector tmd(request.in_vectors[0].size); Memory::CopyFromEmu(tmd.data(), request.in_vectors[0].address, request.in_vectors[0].size); m_addtitle_tmd.SetBytes(tmd); if (!m_addtitle_tmd.IsValid()) { - ERROR_LOG(WII_IPC_ES, "Invalid TMD while adding title (size = %zd)", tmd.size()); + ERROR_LOG(IOS_ES, "Invalid TMD while adding title (size = %zd)", tmd.size()); return GetDefaultReply(ES_INVALID_TMD); } @@ -297,7 +297,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_ADDCONTENTSTART: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 2, + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 2, "IOCTL_ES_ADDCONTENTSTART wrong number of inputs"); u64 title_id = Memory::Read_U64(request.in_vectors[0].address); @@ -305,22 +305,22 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) if (m_addtitle_content_id != 0xFFFFFFFF) { - ERROR_LOG(WII_IPC_ES, "Trying to add content when we haven't finished adding " - "another content. Unsupported."); + ERROR_LOG(IOS_ES, "Trying to add content when we haven't finished adding " + "another content. Unsupported."); return GetDefaultReply(ES_WRITE_FAILURE); } m_addtitle_content_id = content_id; m_addtitle_content_buffer.clear(); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_ADDCONTENTSTART: title id %016" PRIx64 ", " - "content id %08x", + INFO_LOG(IOS_ES, "IOCTL_ES_ADDCONTENTSTART: title id %016" PRIx64 ", " + "content id %08x", title_id, m_addtitle_content_id); if (title_id != m_addtitle_tmd.GetTitleId()) { - ERROR_LOG(WII_IPC_ES, "IOCTL_ES_ADDCONTENTSTART: title id %016" PRIx64 " != " - "TMD title id %016lx, ignoring", + ERROR_LOG(IOS_ES, "IOCTL_ES_ADDCONTENTSTART: title id %016" PRIx64 " != " + "TMD title id %016lx, ignoring", title_id, m_addtitle_tmd.GetTitleId()); } @@ -334,12 +334,12 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_ADDCONTENTDATA: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 2, + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 2, "IOCTL_ES_ADDCONTENTDATA wrong number of inputs"); u32 content_fd = Memory::Read_U32(request.in_vectors[0].address); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_ADDCONTENTDATA: content fd %08x, " - "size %d", + INFO_LOG(IOS_ES, "IOCTL_ES_ADDCONTENTDATA: content fd %08x, " + "size %d", content_fd, request.in_vectors[1].size); u8* data_start = Memory::GetPointer(request.in_vectors[1].address); @@ -350,11 +350,11 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_ADDCONTENTFINISH: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 1, + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 1, "IOCTL_ES_ADDCONTENTFINISH wrong number of inputs"); u32 content_fd = Memory::Read_U32(request.in_vectors[0].address); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_ADDCONTENTFINISH: content fd %08x", content_fd); + INFO_LOG(IOS_ES, "IOCTL_ES_ADDCONTENTFINISH: content fd %08x", content_fd); // Try to find the title key from a pre-installed ticket. std::vector ticket = DiscIO::FindSignedTicket(m_addtitle_tmd.GetTitleId()); @@ -394,25 +394,24 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_ADDTITLEFINISH: { - INFO_LOG(WII_IPC_ES, "IOCTL_ES_ADDTITLEFINISH"); + INFO_LOG(IOS_ES, "IOCTL_ES_ADDTITLEFINISH"); break; } case IOCTL_ES_GETDEVICEID: { - _dbg_assert_msg_(WII_IPC_ES, request.io_vectors.size() == 1, - "IOCTL_ES_GETDEVICEID no io vectors"); + _dbg_assert_msg_(IOS_ES, request.io_vectors.size() == 1, "IOCTL_ES_GETDEVICEID no io vectors"); EcWii& ec = EcWii::GetInstance(); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETDEVICEID %08X", ec.getNgId()); + INFO_LOG(IOS_ES, "IOCTL_ES_GETDEVICEID %08X", ec.getNgId()); Memory::Write_U32(ec.getNgId(), request.io_vectors[0].address); return GetDefaultReply(IPC_SUCCESS); } case IOCTL_ES_GETTITLECONTENTSCNT: { - _dbg_assert_(WII_IPC_ES, request.in_vectors.size() == 1); - _dbg_assert_(WII_IPC_ES, request.io_vectors.size() == 1); + _dbg_assert_(IOS_ES, request.in_vectors.size() == 1); + _dbg_assert_(IOS_ES, request.io_vectors.size() == 1); u64 TitleID = Memory::Read_U64(request.in_vectors[0].address); @@ -433,7 +432,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) return_value = static_cast(rNANDContent.GetContentSize()); } - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLECONTENTSCNT: TitleID: %08x/%08x content count %i", + INFO_LOG(IOS_ES, "IOCTL_ES_GETTITLECONTENTSCNT: TitleID: %08x/%08x content count %i", (u32)(TitleID >> 32), (u32)TitleID, rNANDContent.IsValid() ? NumberOfPrivateContent : (u32)rNANDContent.GetContentSize()); @@ -443,9 +442,9 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_GETTITLECONTENTS: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 2, + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 2, "IOCTL_ES_GETTITLECONTENTS bad in buffer"); - _dbg_assert_msg_(WII_IPC_ES, request.io_vectors.size() == 1, + _dbg_assert_msg_(IOS_ES, request.io_vectors.size() == 1, "IOCTL_ES_GETTITLECONTENTS bad out buffer"); u64 TitleID = Memory::Read_U64(request.in_vectors[0].address); @@ -458,14 +457,14 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) { Memory::Write_U32(rNANDContent.GetContentByIndex(i)->m_ContentID, request.io_vectors[0].address + i * 4); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLECONTENTS: Index %d: %08x", i, + INFO_LOG(IOS_ES, "IOCTL_ES_GETTITLECONTENTS: Index %d: %08x", i, rNANDContent.GetContentByIndex(i)->m_ContentID); } } else { return_value = static_cast(rNANDContent.GetContentSize()); - ERROR_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLECONTENTS: Unable to open content %zu", + ERROR_LOG(IOS_ES, "IOCTL_ES_GETTITLECONTENTS: Unable to open content %zu", rNANDContent.GetContentSize()); } @@ -475,15 +474,15 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_OPENTITLECONTENT: { - _dbg_assert_(WII_IPC_ES, request.in_vectors.size() == 3); - _dbg_assert_(WII_IPC_ES, request.io_vectors.size() == 0); + _dbg_assert_(IOS_ES, request.in_vectors.size() == 3); + _dbg_assert_(IOS_ES, request.io_vectors.size() == 0); u64 TitleID = Memory::Read_U64(request.in_vectors[0].address); u32 Index = Memory::Read_U32(request.in_vectors[2].address); s32 CFD = OpenTitleContent(m_AccessIdentID++, TitleID, Index); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_OPENTITLECONTENT: TitleID: %08x/%08x Index %i -> got CFD %x", + INFO_LOG(IOS_ES, "IOCTL_ES_OPENTITLECONTENT: TitleID: %08x/%08x Index %i -> got CFD %x", (u32)(TitleID >> 32), (u32)TitleID, Index, CFD); return GetDefaultReply(CFD); @@ -492,12 +491,12 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_OPENCONTENT: { - _dbg_assert_(WII_IPC_ES, request.in_vectors.size() == 1); - _dbg_assert_(WII_IPC_ES, request.io_vectors.size() == 0); + _dbg_assert_(IOS_ES, request.in_vectors.size() == 1); + _dbg_assert_(IOS_ES, request.io_vectors.size() == 0); u32 Index = Memory::Read_U32(request.in_vectors[0].address); s32 CFD = OpenTitleContent(m_AccessIdentID++, m_TitleID, Index); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_OPENCONTENT: Index %i -> got CFD %x", Index, CFD); + INFO_LOG(IOS_ES, "IOCTL_ES_OPENCONTENT: Index %i -> got CFD %x", Index, CFD); return GetDefaultReply(CFD); } @@ -505,8 +504,8 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_READCONTENT: { - _dbg_assert_(WII_IPC_ES, request.in_vectors.size() == 1); - _dbg_assert_(WII_IPC_ES, request.io_vectors.size() == 1); + _dbg_assert_(IOS_ES, request.in_vectors.size() == 1); + _dbg_assert_(IOS_ES, request.io_vectors.size() == 1); u32 CFD = Memory::Read_U32(request.in_vectors[0].address); u32 Size = request.io_vectors[0].size; @@ -536,8 +535,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) { const DiscIO::SNANDContent* pContent = ContentLoader.GetContentByIndex(rContent.m_Index); if (!pContent->m_Data->GetRange(rContent.m_Position, Size, pDest)) - ERROR_LOG(WII_IPC_ES, "ES: failed to read %u bytes from %u!", Size, - rContent.m_Position); + ERROR_LOG(IOS_ES, "ES: failed to read %u bytes from %u!", Size, rContent.m_Position); } rContent.m_Position += Size; @@ -548,7 +546,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) } } - DEBUG_LOG(WII_IPC_ES, + DEBUG_LOG(IOS_ES, "IOCTL_ES_READCONTENT: CFD %x, Address 0x%x, Size %i -> stream pos %i (Index %i)", CFD, Addr, Size, rContent.m_Position, rContent.m_Index); @@ -558,12 +556,12 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_CLOSECONTENT: { - _dbg_assert_(WII_IPC_ES, request.in_vectors.size() == 1); - _dbg_assert_(WII_IPC_ES, request.io_vectors.size() == 0); + _dbg_assert_(IOS_ES, request.in_vectors.size() == 1); + _dbg_assert_(IOS_ES, request.io_vectors.size() == 0); u32 CFD = Memory::Read_U32(request.in_vectors[0].address); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_CLOSECONTENT: CFD %x", CFD); + INFO_LOG(IOS_ES, "IOCTL_ES_CLOSECONTENT: CFD %x", CFD); auto itr = m_ContentAccessMap.find(CFD); if (itr == m_ContentAccessMap.end()) @@ -587,8 +585,8 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_SEEKCONTENT: { - _dbg_assert_(WII_IPC_ES, request.in_vectors.size() == 3); - _dbg_assert_(WII_IPC_ES, request.io_vectors.size() == 0); + _dbg_assert_(IOS_ES, request.in_vectors.size() == 3); + _dbg_assert_(IOS_ES, request.io_vectors.size() == 0); u32 CFD = Memory::Read_U32(request.in_vectors[0].address); u32 Addr = Memory::Read_U32(request.in_vectors[1].address); @@ -616,8 +614,8 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) break; } - DEBUG_LOG(WII_IPC_ES, "IOCTL_ES_SEEKCONTENT: CFD %x, Address 0x%x, Mode %i -> Pos %i", CFD, - Addr, Mode, rContent.m_Position); + DEBUG_LOG(IOS_ES, "IOCTL_ES_SEEKCONTENT: CFD %x, Address 0x%x, Mode %i -> Pos %i", CFD, Addr, + Mode, rContent.m_Position); return GetDefaultReply(rContent.m_Position); } @@ -625,52 +623,51 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_GETTITLEDIR: { - _dbg_assert_(WII_IPC_ES, request.in_vectors.size() == 1); - _dbg_assert_(WII_IPC_ES, request.io_vectors.size() == 1); + _dbg_assert_(IOS_ES, request.in_vectors.size() == 1); + _dbg_assert_(IOS_ES, request.io_vectors.size() == 1); u64 TitleID = Memory::Read_U64(request.in_vectors[0].address); char* Path = (char*)Memory::GetPointer(request.io_vectors[0].address); sprintf(Path, "/title/%08x/%08x/data", (u32)(TitleID >> 32), (u32)TitleID); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLEDIR: %s", Path); + INFO_LOG(IOS_ES, "IOCTL_ES_GETTITLEDIR: %s", Path); } break; case IOCTL_ES_GETTITLEID: { - _dbg_assert_(WII_IPC_ES, request.in_vectors.size() == 0); - _dbg_assert_msg_(WII_IPC_ES, request.io_vectors.size() == 1, - "IOCTL_ES_GETTITLEID no out buffer"); + _dbg_assert_(IOS_ES, request.in_vectors.size() == 0); + _dbg_assert_msg_(IOS_ES, request.io_vectors.size() == 1, "IOCTL_ES_GETTITLEID no out buffer"); Memory::Write_U64(m_TitleID, request.io_vectors[0].address); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLEID: %08x/%08x", (u32)(m_TitleID >> 32), (u32)m_TitleID); + INFO_LOG(IOS_ES, "IOCTL_ES_GETTITLEID: %08x/%08x", (u32)(m_TitleID >> 32), (u32)m_TitleID); } break; case IOCTL_ES_SETUID: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 1, "IOCTL_ES_SETUID no in buffer"); - _dbg_assert_msg_(WII_IPC_ES, request.io_vectors.size() == 0, + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 1, "IOCTL_ES_SETUID no in buffer"); + _dbg_assert_msg_(IOS_ES, request.io_vectors.size() == 0, "IOCTL_ES_SETUID has a payload, it shouldn't"); // TODO: fs permissions based on this u64 TitleID = Memory::Read_U64(request.in_vectors[0].address); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_SETUID titleID: %08x/%08x", (u32)(TitleID >> 32), (u32)TitleID); + INFO_LOG(IOS_ES, "IOCTL_ES_SETUID titleID: %08x/%08x", (u32)(TitleID >> 32), (u32)TitleID); } break; case IOCTL_ES_GETTITLECNT: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 0, + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 0, "IOCTL_ES_GETTITLECNT has an in buffer"); - _dbg_assert_msg_(WII_IPC_ES, request.io_vectors.size() == 1, + _dbg_assert_msg_(IOS_ES, request.io_vectors.size() == 1, "IOCTL_ES_GETTITLECNT has no out buffer"); - _dbg_assert_msg_(WII_IPC_ES, request.io_vectors[0].size == 4, + _dbg_assert_msg_(IOS_ES, request.io_vectors[0].size == 4, "IOCTL_ES_GETTITLECNT payload[0].size != 4"); Memory::Write_U32((u32)m_TitleIDs.size(), request.io_vectors[0].address); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLECNT: Number of Titles %zu", m_TitleIDs.size()); + INFO_LOG(IOS_ES, "IOCTL_ES_GETTITLECNT: Number of Titles %zu", m_TitleIDs.size()); return GetDefaultReply(IPC_SUCCESS); } @@ -678,9 +675,8 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_GETTITLES: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 1, - "IOCTL_ES_GETTITLES has an in buffer"); - _dbg_assert_msg_(WII_IPC_ES, request.io_vectors.size() == 1, + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 1, "IOCTL_ES_GETTITLES has an in buffer"); + _dbg_assert_msg_(IOS_ES, request.io_vectors.size() == 1, "IOCTL_ES_GETTITLES has no out buffer"); u32 MaxCount = Memory::Read_U32(request.in_vectors[0].address); @@ -688,24 +684,22 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) for (int i = 0; i < (int)m_TitleIDs.size(); i++) { Memory::Write_U64(m_TitleIDs[i], request.io_vectors[0].address + i * 8); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLES: %08x/%08x", (u32)(m_TitleIDs[i] >> 32), + INFO_LOG(IOS_ES, "IOCTL_ES_GETTITLES: %08x/%08x", (u32)(m_TitleIDs[i] >> 32), (u32)m_TitleIDs[i]); Count++; if (Count >= MaxCount) break; } - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLES: Number of titles returned %i", Count); + INFO_LOG(IOS_ES, "IOCTL_ES_GETTITLES: Number of titles returned %i", Count); return GetDefaultReply(IPC_SUCCESS); } break; case IOCTL_ES_GETVIEWCNT: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 1, - "IOCTL_ES_GETVIEWCNT no in buffer"); - _dbg_assert_msg_(WII_IPC_ES, request.io_vectors.size() == 1, - "IOCTL_ES_GETVIEWCNT no out buffer"); + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 1, "IOCTL_ES_GETVIEWCNT no in buffer"); + _dbg_assert_msg_(IOS_ES, request.io_vectors.size() == 1, "IOCTL_ES_GETVIEWCNT no out buffer"); u64 TitleID = Memory::Read_U64(request.in_vectors[0].address); @@ -720,11 +714,11 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) if (File::Exists(TicketFilename)) { u32 FileSize = (u32)File::GetSize(TicketFilename); - _dbg_assert_msg_(WII_IPC_ES, (FileSize % DiscIO::CNANDContentLoader::TICKET_SIZE) == 0, + _dbg_assert_msg_(IOS_ES, (FileSize % DiscIO::CNANDContentLoader::TICKET_SIZE) == 0, "IOCTL_ES_GETVIEWCNT ticket file size seems to be wrong"); ViewCount = FileSize / DiscIO::CNANDContentLoader::TICKET_SIZE; - _dbg_assert_msg_(WII_IPC_ES, (ViewCount > 0) && (ViewCount <= 4), + _dbg_assert_msg_(IOS_ES, (ViewCount > 0) && (ViewCount <= 4), "IOCTL_ES_GETVIEWCNT ticket count seems to be wrong"); } else if (TitleID >> 32 == 0x00000001) @@ -744,7 +738,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) } } - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETVIEWCNT for titleID: %08x/%08x (View Count = %i)", + INFO_LOG(IOS_ES, "IOCTL_ES_GETVIEWCNT for titleID: %08x/%08x (View Count = %i)", (u32)(TitleID >> 32), (u32)TitleID, ViewCount); Memory::Write_U32(ViewCount, request.io_vectors[0].address); @@ -754,8 +748,8 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_GETVIEWS: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 2, "IOCTL_ES_GETVIEWS no in buffer"); - _dbg_assert_msg_(WII_IPC_ES, request.io_vectors.size() == 1, "IOCTL_ES_GETVIEWS no out buffer"); + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 2, "IOCTL_ES_GETVIEWS no in buffer"); + _dbg_assert_msg_(IOS_ES, request.io_vectors.size() == 1, "IOCTL_ES_GETVIEWS no out buffer"); u64 TitleID = Memory::Read_U64(request.in_vectors[0].address); u32 maxViews = Memory::Read_U32(request.in_vectors[1].address); @@ -817,7 +811,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) } } - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETVIEWS for titleID: %08x/%08x (MaxViews = %i)", + INFO_LOG(IOS_ES, "IOCTL_ES_GETVIEWS for titleID: %08x/%08x (MaxViews = %i)", (u32)(TitleID >> 32), (u32)TitleID, maxViews); return GetDefaultReply(retVal); @@ -826,9 +820,8 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_GETTMDVIEWCNT: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 1, - "IOCTL_ES_GETTMDVIEWCNT no in buffer"); - _dbg_assert_msg_(WII_IPC_ES, request.io_vectors.size() == 1, + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 1, "IOCTL_ES_GETTMDVIEWCNT no in buffer"); + _dbg_assert_msg_(IOS_ES, request.io_vectors.size() == 1, "IOCTL_ES_GETTMDVIEWCNT no out buffer"); u64 TitleID = Memory::Read_U64(request.in_vectors[0].address); @@ -846,7 +839,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) } Memory::Write_U32(TMDViewCnt, request.io_vectors[0].address); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETTMDVIEWCNT: title: %08x/%08x (view size %i)", + INFO_LOG(IOS_ES, "IOCTL_ES_GETTMDVIEWCNT: title: %08x/%08x (view size %i)", (u32)(TitleID >> 32), (u32)TitleID, TMDViewCnt); return GetDefaultReply(IPC_SUCCESS); } @@ -854,9 +847,8 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_GETTMDVIEWS: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 2, - "IOCTL_ES_GETTMDVIEWCNT no in buffer"); - _dbg_assert_msg_(WII_IPC_ES, request.io_vectors.size() == 1, + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 2, "IOCTL_ES_GETTMDVIEWCNT no in buffer"); + _dbg_assert_msg_(IOS_ES, request.io_vectors.size() == 1, "IOCTL_ES_GETTMDVIEWCNT no out buffer"); u64 TitleID = Memory::Read_U64(request.in_vectors[0].address); @@ -864,7 +856,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) const DiscIO::CNANDContentLoader& Loader = AccessContentDevice(TitleID); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETTMDVIEWCNT: title: %08x/%08x buffer size: %i", + INFO_LOG(IOS_ES, "IOCTL_ES_GETTMDVIEWCNT: title: %08x/%08x buffer size: %i", (u32)(TitleID >> 32), (u32)TitleID, MaxCount); if (Loader.IsValid()) @@ -892,11 +884,10 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) Address += 8; } - _dbg_assert_(WII_IPC_ES, - (Address - request.io_vectors[0].address) == request.io_vectors[0].size); + _dbg_assert_(IOS_ES, (Address - request.io_vectors[0].address) == request.io_vectors[0].size); } - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETTMDVIEWS: title: %08x/%08x (buffer size: %i)", + INFO_LOG(IOS_ES, "IOCTL_ES_GETTMDVIEWS: title: %08x/%08x (buffer size: %i)", (u32)(TitleID >> 32), (u32)TitleID, MaxCount); return GetDefaultReply(IPC_SUCCESS); } @@ -904,14 +895,13 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_GETCONSUMPTION: // This is at least what crediar's ES module does Memory::Write_U32(0, request.io_vectors[1].address); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETCONSUMPTION"); + INFO_LOG(IOS_ES, "IOCTL_ES_GETCONSUMPTION"); return GetDefaultReply(IPC_SUCCESS); case IOCTL_ES_DELETETICKET: { u64 TitleID = Memory::Read_U64(request.in_vectors[0].address); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_DELETETICKET: title: %08x/%08x", (u32)(TitleID >> 32), - (u32)TitleID); + INFO_LOG(IOS_ES, "IOCTL_ES_DELETETICKET: title: %08x/%08x", (u32)(TitleID >> 32), (u32)TitleID); // Presumably return -1017 when delete fails if (!File::Delete(Common::GetTicketFileName(TitleID, Common::FROM_SESSION_ROOT))) return GetDefaultReply(ES_PARAMETER_SIZE_OR_ALIGNMENT); @@ -921,7 +911,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_DELETETITLECONTENT: { u64 TitleID = Memory::Read_U64(request.in_vectors[0].address); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_DELETETITLECONTENT: title: %08x/%08x", (u32)(TitleID >> 32), + INFO_LOG(IOS_ES, "IOCTL_ES_DELETETITLECONTENT: title: %08x/%08x", (u32)(TitleID >> 32), (u32)TitleID); // Presumably return -1017 when title not installed TODO verify if (!DiscIO::CNANDContentManager::Access().RemoveTitle(TitleID, Common::FROM_SESSION_ROOT)) @@ -931,15 +921,15 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_GETSTOREDTMDSIZE: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() == 1, + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() == 1, "IOCTL_ES_GETSTOREDTMDSIZE no in buffer"); - // _dbg_assert_msg_(WII_IPC_ES, request.io_vectors.size() == 1, "IOCTL_ES_ES_GETSTOREDTMDSIZE + // _dbg_assert_msg_(IOS_ES, request.io_vectors.size() == 1, "IOCTL_ES_ES_GETSTOREDTMDSIZE // no out buffer"); u64 TitleID = Memory::Read_U64(request.in_vectors[0].address); const DiscIO::CNANDContentLoader& Loader = AccessContentDevice(TitleID); - _dbg_assert_(WII_IPC_ES, Loader.IsValid()); + _dbg_assert_(IOS_ES, Loader.IsValid()); u32 TMDCnt = 0; if (Loader.IsValid()) { @@ -949,19 +939,18 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) if (request.io_vectors.size()) Memory::Write_U32(TMDCnt, request.io_vectors[0].address); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETSTOREDTMDSIZE: title: %08x/%08x (view size %i)", + INFO_LOG(IOS_ES, "IOCTL_ES_GETSTOREDTMDSIZE: title: %08x/%08x (view size %i)", (u32)(TitleID >> 32), (u32)TitleID, TMDCnt); return GetDefaultReply(IPC_SUCCESS); } break; case IOCTL_ES_GETSTOREDTMD: { - _dbg_assert_msg_(WII_IPC_ES, request.in_vectors.size() > 0, - "IOCTL_ES_GETSTOREDTMD no in buffer"); + _dbg_assert_msg_(IOS_ES, request.in_vectors.size() > 0, "IOCTL_ES_GETSTOREDTMD no in buffer"); // requires 1 inbuffer and no outbuffer, presumably outbuffer required when second inbuffer is // used for maxcount (allocated mem?) // called with 1 inbuffer after deleting a titleid - //_dbg_assert_msg_(WII_IPC_ES, request.io_vectors.size() == 1, "IOCTL_ES_GETSTOREDTMD no out + //_dbg_assert_msg_(IOS_ES, request.io_vectors.size() == 1, "IOCTL_ES_GETSTOREDTMD no out // buffer"); u64 TitleID = Memory::Read_U64(request.in_vectors[0].address); @@ -973,7 +962,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) } const DiscIO::CNANDContentLoader& Loader = AccessContentDevice(TitleID); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETSTOREDTMD: title: %08x/%08x buffer size: %i", + INFO_LOG(IOS_ES, "IOCTL_ES_GETSTOREDTMD: title: %08x/%08x buffer size: %i", (u32)(TitleID >> 32), (u32)TitleID, MaxCount); if (Loader.IsValid() && request.io_vectors.size()) @@ -992,11 +981,10 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) Address += DiscIO::CNANDContentLoader::CONTENT_HEADER_SIZE; } - _dbg_assert_(WII_IPC_ES, - (Address - request.io_vectors[0].address) == request.io_vectors[0].size); + _dbg_assert_(IOS_ES, (Address - request.io_vectors[0].address) == request.io_vectors[0].size); } - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETSTOREDTMD: title: %08x/%08x (buffer size: %i)", + INFO_LOG(IOS_ES, "IOCTL_ES_GETSTOREDTMD: title: %08x/%08x (buffer size: %i)", (u32)(TitleID >> 32), (u32)TitleID, MaxCount); return GetDefaultReply(IPC_SUCCESS); } @@ -1016,7 +1004,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) memcpy(newIV, IV, 16); mbedtls_aes_crypt_cbc(&AES_ctx, MBEDTLS_AES_ENCRYPT, size, newIV, source, destination); - _dbg_assert_msg_(WII_IPC_ES, keyIndex == 6, + _dbg_assert_msg_(IOS_ES, keyIndex == 6, "IOCTL_ES_ENCRYPT: Key type is not SD, data will be crap"); } break; @@ -1032,14 +1020,14 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) DecryptContent(keyIndex, IV, source, size, newIV, destination); - _dbg_assert_msg_(WII_IPC_ES, keyIndex == 6, + _dbg_assert_msg_(IOS_ES, keyIndex == 6, "IOCTL_ES_DECRYPT: Key type is not SD, data will be crap"); } break; case IOCTL_ES_LAUNCH: { - _dbg_assert_(WII_IPC_ES, request.in_vectors.size() == 2); + _dbg_assert_(IOS_ES, request.in_vectors.size() == 2); bool bSuccess = false; bool bReset = false; u16 IOSv = 0xffff; @@ -1153,8 +1141,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) // Note: If we just reset the PPC, don't write anything to the command buffer. This // could clobber the DOL we just loaded. - ERROR_LOG(WII_IPC_ES, - "IOCTL_ES_LAUNCH %016" PRIx64 " %08x %016" PRIx64 " %08x %016" PRIx64 " %04x", + ERROR_LOG(IOS_ES, "IOCTL_ES_LAUNCH %016" PRIx64 " %08x %016" PRIx64 " %08x %016" PRIx64 " %04x", TitleID, view, ticketid, devicetype, titleid, access); // IOCTL_ES_LAUNCH 0001000248414341 00000001 0001c0fef3df2cfa 00000000 // 0001000248414341 ffff @@ -1181,13 +1168,13 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) // IOS70 has this to let system menu 4.2 check if the console is region changed. it returns // -1017 // if the IOS didn't find the Korean keys and 0 if it does. 0 leads to a error 003 - INFO_LOG(WII_IPC_ES, "IOCTL_ES_CHECKKOREAREGION: Title checked for Korean keys."); + INFO_LOG(IOS_ES, "IOCTL_ES_CHECKKOREAREGION: Title checked for Korean keys."); return GetDefaultReply(ES_PARAMETER_SIZE_OR_ALIGNMENT); case IOCTL_ES_GETDEVICECERT: // (Input: none, Output: 384 bytes) { - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETDEVICECERT"); - _dbg_assert_(WII_IPC_ES, request.io_vectors.size() == 1); + INFO_LOG(IOS_ES, "IOCTL_ES_GETDEVICECERT"); + _dbg_assert_(IOS_ES, request.io_vectors.size() == 1); u8* destination = Memory::GetPointer(request.io_vectors[0].address); EcWii& ec = EcWii::GetInstance(); @@ -1197,7 +1184,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_SIGN: { - INFO_LOG(WII_IPC_ES, "IOCTL_ES_SIGN"); + INFO_LOG(IOS_ES, "IOCTL_ES_SIGN"); u8* ap_cert_out = Memory::GetPointer(request.io_vectors[1].address); u8* data = Memory::GetPointer(request.in_vectors[0].address); u32 data_size = request.in_vectors[0].size; @@ -1211,7 +1198,7 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) case IOCTL_ES_GETBOOT2VERSION: { - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETBOOT2VERSION"); + INFO_LOG(IOS_ES, "IOCTL_ES_GETBOOT2VERSION"); Memory::Write_U32( 4, request.io_vectors[0].address); // as of 26/02/2012, this was latest bootmii version @@ -1222,16 +1209,16 @@ IPCCommandResult ES::IOCtlV(const IOSIOCtlVRequest& request) // unsupported functions // =============================================================================================== case IOCTL_ES_DIGETTICKETVIEW: // (Input: none, Output: 216 bytes) bug crediar :D - WARN_LOG(WII_IPC_ES, "IOCTL_ES_DIGETTICKETVIEW: this looks really wrong..."); + WARN_LOG(IOS_ES, "IOCTL_ES_DIGETTICKETVIEW: this looks really wrong..."); break; case IOCTL_ES_GETOWNEDTITLECNT: - INFO_LOG(WII_IPC_ES, "IOCTL_ES_GETOWNEDTITLECNT"); + INFO_LOG(IOS_ES, "IOCTL_ES_GETOWNEDTITLECNT"); Memory::Write_U32(0, request.io_vectors[0].address); break; default: - request.DumpUnknown(GetDeviceName(), LogTypes::WII_IPC_HLE); + request.DumpUnknown(GetDeviceName(), LogTypes::IOS); } return GetDefaultReply(IPC_SUCCESS); @@ -1315,7 +1302,7 @@ u32 ES::ES_DIVerify(const std::vector& tmd) { File::IOFile tmd_file(tmd_path, "wb"); if (!tmd_file.WriteBytes(tmd.data(), tmd.size())) - ERROR_LOG(WII_IPC_ES, "DIVerify failed to write disc TMD to NAND."); + ERROR_LOG(IOS_ES, "DIVerify failed to write disc TMD to NAND."); } DiscIO::cUIDsys::AccessInstance().AddTitle(tmd_title_id); // DI_VERIFY writes to title.tmd, which is read and cached inside the NAND Content Manager. diff --git a/Source/Core/Core/IOS/FS/FS.cpp b/Source/Core/Core/IOS/FS/FS.cpp index 4027e7a005..1c8d4a3343 100644 --- a/Source/Core/Core/IOS/FS/FS.cpp +++ b/Source/Core/Core/IOS/FS/FS.cpp @@ -84,7 +84,7 @@ IPCCommandResult FS::IOCtlV(const IOSIOCtlVRequest& request) if (!IsValidWiiPath(relative_path)) { - WARN_LOG(WII_IPC_FILEIO, "Not a valid path: %s", relative_path.c_str()); + WARN_LOG(IOS_FILEIO, "Not a valid path: %s", relative_path.c_str()); return_value = FS_EINVAL; break; } @@ -92,11 +92,11 @@ IPCCommandResult FS::IOCtlV(const IOSIOCtlVRequest& request) // the Wii uses this function to define the type (dir or file) std::string DirName(HLE_IPC_BuildFilename(relative_path)); - INFO_LOG(WII_IPC_FILEIO, "FS: IOCTL_READ_DIR %s", DirName.c_str()); + INFO_LOG(IOS_FILEIO, "FS: IOCTL_READ_DIR %s", DirName.c_str()); if (!File::Exists(DirName)) { - WARN_LOG(WII_IPC_FILEIO, "FS: Search not found: %s", DirName.c_str()); + WARN_LOG(IOS_FILEIO, "FS: Search not found: %s", DirName.c_str()); return_value = FS_ENOENT; break; } @@ -105,7 +105,7 @@ IPCCommandResult FS::IOCtlV(const IOSIOCtlVRequest& request) // It's not a directory, so error. // Games don't usually seem to care WHICH error they get, as long as it's < // Well the system menu CARES! - WARN_LOG(WII_IPC_FILEIO, "\tNot a directory - return FS_EINVAL"); + WARN_LOG(IOS_FILEIO, "\tNot a directory - return FS_EINVAL"); return_value = FS_EINVAL; break; } @@ -116,7 +116,7 @@ IPCCommandResult FS::IOCtlV(const IOSIOCtlVRequest& request) if ((request.in_vectors.size() == 1) && (request.io_vectors.size() == 1)) { size_t numFile = entry.children.size(); - INFO_LOG(WII_IPC_FILEIO, "\t%zu files found", numFile); + INFO_LOG(IOS_FILEIO, "\t%zu files found", numFile); Memory::Write_U32((u32)numFile, request.io_vectors[0].address); } @@ -150,7 +150,7 @@ IPCCommandResult FS::IOCtlV(const IOSIOCtlVRequest& request) *pFilename++ = 0x00; // termination numFiles++; - INFO_LOG(WII_IPC_FILEIO, "\tFound: %s", FileName.c_str()); + INFO_LOG(IOS_FILEIO, "\tFound: %s", FileName.c_str()); } Memory::Write_U32((u32)numFiles, request.io_vectors[1].address); @@ -162,9 +162,9 @@ IPCCommandResult FS::IOCtlV(const IOSIOCtlVRequest& request) case IOCTLV_GETUSAGE: { - _dbg_assert_(WII_IPC_FILEIO, request.io_vectors.size() == 2); - _dbg_assert_(WII_IPC_FILEIO, request.io_vectors[0].size == 4); - _dbg_assert_(WII_IPC_FILEIO, request.io_vectors[1].size == 4); + _dbg_assert_(IOS_FILEIO, request.io_vectors.size() == 2); + _dbg_assert_(IOS_FILEIO, request.io_vectors[0].size == 4); + _dbg_assert_(IOS_FILEIO, request.io_vectors[1].size == 4); // this command sucks because it asks of the number of used // fsBlocks and inodes @@ -174,7 +174,7 @@ IPCCommandResult FS::IOCtlV(const IOSIOCtlVRequest& request) if (!IsValidWiiPath(relativepath)) { - WARN_LOG(WII_IPC_FILEIO, "Not a valid path: %s", relativepath.c_str()); + WARN_LOG(IOS_FILEIO, "Not a valid path: %s", relativepath.c_str()); return_value = FS_EINVAL; break; } @@ -183,7 +183,7 @@ IPCCommandResult FS::IOCtlV(const IOSIOCtlVRequest& request) u32 fsBlocks = 0; u32 iNodes = 0; - INFO_LOG(WII_IPC_FILEIO, "IOCTL_GETUSAGE %s", path.c_str()); + INFO_LOG(IOS_FILEIO, "IOCTL_GETUSAGE %s", path.c_str()); if (File::IsDirectory(path)) { // LPFaint99: After I found that setting the number of inodes to the number of children + 1 @@ -209,14 +209,14 @@ IPCCommandResult FS::IOCtlV(const IOSIOCtlVRequest& request) } return_value = IPC_SUCCESS; - INFO_LOG(WII_IPC_FILEIO, "FS: fsBlock: %i, iNodes: %i", fsBlocks, iNodes); + INFO_LOG(IOS_FILEIO, "FS: fsBlock: %i, iNodes: %i", fsBlocks, iNodes); } else { fsBlocks = 0; iNodes = 0; return_value = IPC_SUCCESS; - WARN_LOG(WII_IPC_FILEIO, "FS: fsBlock failed, cannot find directory: %s", path.c_str()); + WARN_LOG(IOS_FILEIO, "FS: fsBlock failed, cannot find directory: %s", path.c_str()); } Memory::Write_U32(fsBlocks, request.io_vectors[0].address); @@ -225,7 +225,7 @@ IPCCommandResult FS::IOCtlV(const IOSIOCtlVRequest& request) break; default: - request.DumpUnknown(GetDeviceName(), LogTypes::WII_IPC_FILEIO); + request.DumpUnknown(GetDeviceName(), LogTypes::IOS_FILEIO); break; } @@ -248,7 +248,7 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) if (request.buffer_out_size < 0x1c) return -1017; - WARN_LOG(WII_IPC_FILEIO, "FS: GET STATS - returning static values for now"); + WARN_LOG(IOS_FILEIO, "FS: GET STATS - returning static values for now"); NANDStat fs; @@ -269,7 +269,7 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) case IOCTL_CREATE_DIR: { - _dbg_assert_(WII_IPC_FILEIO, request.buffer_out_size == 0); + _dbg_assert_(IOS_FILEIO, request.buffer_out_size == 0); u32 Addr = request.buffer_in; u32 OwnerID = Memory::Read_U32(Addr); @@ -279,7 +279,7 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) const std::string wii_path = Memory::GetString(Addr, 64); if (!IsValidWiiPath(wii_path)) { - WARN_LOG(WII_IPC_FILEIO, "Not a valid path: %s", wii_path.c_str()); + WARN_LOG(IOS_FILEIO, "Not a valid path: %s", wii_path.c_str()); return FS_EINVAL; } std::string DirName(HLE_IPC_BuildFilename(wii_path)); @@ -287,12 +287,12 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) Addr += 9; // owner attribs, permission u8 Attribs = Memory::Read_U8(Addr); - INFO_LOG(WII_IPC_FILEIO, "FS: CREATE_DIR %s, OwnerID %#x, GroupID %#x, Attributes %#x", + INFO_LOG(IOS_FILEIO, "FS: CREATE_DIR %s, OwnerID %#x, GroupID %#x, Attributes %#x", DirName.c_str(), OwnerID, GroupID, Attribs); DirName += DIR_SEP; File::CreateFullPath(DirName); - _dbg_assert_msg_(WII_IPC_FILEIO, File::IsDirectory(DirName), "FS: CREATE_DIR %s failed", + _dbg_assert_msg_(IOS_FILEIO, File::IsDirectory(DirName), "FS: CREATE_DIR %s failed", DirName.c_str()); return IPC_SUCCESS; @@ -310,7 +310,7 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) const std::string wii_path = Memory::GetString(Addr, 64); if (!IsValidWiiPath(wii_path)) { - WARN_LOG(WII_IPC_FILEIO, "Not a valid path: %s", wii_path.c_str()); + WARN_LOG(IOS_FILEIO, "Not a valid path: %s", wii_path.c_str()); return FS_EINVAL; } std::string Filename = HLE_IPC_BuildFilename(wii_path); @@ -324,13 +324,13 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) u8 Attributes = Memory::Read_U8(Addr); Addr += 1; - INFO_LOG(WII_IPC_FILEIO, "FS: SetAttrib %s", Filename.c_str()); - DEBUG_LOG(WII_IPC_FILEIO, " OwnerID: 0x%08x", OwnerID); - DEBUG_LOG(WII_IPC_FILEIO, " GroupID: 0x%04x", GroupID); - DEBUG_LOG(WII_IPC_FILEIO, " OwnerPerm: 0x%02x", OwnerPerm); - DEBUG_LOG(WII_IPC_FILEIO, " GroupPerm: 0x%02x", GroupPerm); - DEBUG_LOG(WII_IPC_FILEIO, " OtherPerm: 0x%02x", OtherPerm); - DEBUG_LOG(WII_IPC_FILEIO, " Attributes: 0x%02x", Attributes); + INFO_LOG(IOS_FILEIO, "FS: SetAttrib %s", Filename.c_str()); + DEBUG_LOG(IOS_FILEIO, " OwnerID: 0x%08x", OwnerID); + DEBUG_LOG(IOS_FILEIO, " GroupID: 0x%04x", GroupID); + DEBUG_LOG(IOS_FILEIO, " OwnerPerm: 0x%02x", OwnerPerm); + DEBUG_LOG(IOS_FILEIO, " GroupPerm: 0x%02x", GroupPerm); + DEBUG_LOG(IOS_FILEIO, " OtherPerm: 0x%02x", OtherPerm); + DEBUG_LOG(IOS_FILEIO, " Attributes: 0x%02x", Attributes); return IPC_SUCCESS; } @@ -338,7 +338,7 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) case IOCTL_GET_ATTR: { - _dbg_assert_msg_(WII_IPC_FILEIO, request.buffer_out_size == 76, + _dbg_assert_msg_(IOS_FILEIO, request.buffer_out_size == 76, " GET_ATTR needs an 76 bytes large output buffer but it is %i bytes large", request.buffer_out_size); @@ -348,7 +348,7 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) const std::string wii_path = Memory::GetString(request.buffer_in, 64); if (!IsValidWiiPath(wii_path)) { - WARN_LOG(WII_IPC_FILEIO, "Not a valid path: %s", wii_path.c_str()); + WARN_LOG(IOS_FILEIO, "Not a valid path: %s", wii_path.c_str()); return FS_EINVAL; } std::string Filename = HLE_IPC_BuildFilename(wii_path); @@ -358,19 +358,18 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) u8 Attributes = 0x00; // no attributes if (File::IsDirectory(Filename)) { - INFO_LOG(WII_IPC_FILEIO, "FS: GET_ATTR Directory %s - all permission flags are set", + INFO_LOG(IOS_FILEIO, "FS: GET_ATTR Directory %s - all permission flags are set", Filename.c_str()); } else { if (File::Exists(Filename)) { - INFO_LOG(WII_IPC_FILEIO, "FS: GET_ATTR %s - all permission flags are set", - Filename.c_str()); + INFO_LOG(IOS_FILEIO, "FS: GET_ATTR %s - all permission flags are set", Filename.c_str()); } else { - INFO_LOG(WII_IPC_FILEIO, "FS: GET_ATTR unknown %s", Filename.c_str()); + INFO_LOG(IOS_FILEIO, "FS: GET_ATTR unknown %s", Filename.c_str()); return FS_ENOENT; } } @@ -401,28 +400,28 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) case IOCTL_DELETE_FILE: { - _dbg_assert_(WII_IPC_FILEIO, request.buffer_out_size == 0); + _dbg_assert_(IOS_FILEIO, request.buffer_out_size == 0); int Offset = 0; const std::string wii_path = Memory::GetString(request.buffer_in + Offset, 64); if (!IsValidWiiPath(wii_path)) { - WARN_LOG(WII_IPC_FILEIO, "Not a valid path: %s", wii_path.c_str()); + WARN_LOG(IOS_FILEIO, "Not a valid path: %s", wii_path.c_str()); return FS_EINVAL; } std::string Filename = HLE_IPC_BuildFilename(wii_path); Offset += 64; if (File::Delete(Filename)) { - INFO_LOG(WII_IPC_FILEIO, "FS: DeleteFile %s", Filename.c_str()); + INFO_LOG(IOS_FILEIO, "FS: DeleteFile %s", Filename.c_str()); } else if (File::DeleteDir(Filename)) { - INFO_LOG(WII_IPC_FILEIO, "FS: DeleteDir %s", Filename.c_str()); + INFO_LOG(IOS_FILEIO, "FS: DeleteDir %s", Filename.c_str()); } else { - WARN_LOG(WII_IPC_FILEIO, "FS: DeleteFile %s - failed!!!", Filename.c_str()); + WARN_LOG(IOS_FILEIO, "FS: DeleteFile %s - failed!!!", Filename.c_str()); } return IPC_SUCCESS; @@ -431,13 +430,13 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) case IOCTL_RENAME_FILE: { - _dbg_assert_(WII_IPC_FILEIO, request.buffer_out_size == 0); + _dbg_assert_(IOS_FILEIO, request.buffer_out_size == 0); int Offset = 0; const std::string wii_path = Memory::GetString(request.buffer_in + Offset, 64); if (!IsValidWiiPath(wii_path)) { - WARN_LOG(WII_IPC_FILEIO, "Not a valid path: %s", wii_path.c_str()); + WARN_LOG(IOS_FILEIO, "Not a valid path: %s", wii_path.c_str()); return FS_EINVAL; } std::string Filename = HLE_IPC_BuildFilename(wii_path); @@ -446,7 +445,7 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) const std::string wii_path_rename = Memory::GetString(request.buffer_in + Offset, 64); if (!IsValidWiiPath(wii_path_rename)) { - WARN_LOG(WII_IPC_FILEIO, "Not a valid path: %s", wii_path_rename.c_str()); + WARN_LOG(IOS_FILEIO, "Not a valid path: %s", wii_path_rename.c_str()); return FS_EINVAL; } std::string FilenameRename = HLE_IPC_BuildFilename(wii_path_rename); @@ -464,11 +463,11 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) // finally try to rename the file if (File::Rename(Filename, FilenameRename)) { - INFO_LOG(WII_IPC_FILEIO, "FS: Rename %s to %s", Filename.c_str(), FilenameRename.c_str()); + INFO_LOG(IOS_FILEIO, "FS: Rename %s to %s", Filename.c_str(), FilenameRename.c_str()); } else { - ERROR_LOG(WII_IPC_FILEIO, "FS: Rename %s to %s - failed", Filename.c_str(), + ERROR_LOG(IOS_FILEIO, "FS: Rename %s to %s - failed", Filename.c_str(), FilenameRename.c_str()); return FS_ENOENT; } @@ -479,7 +478,7 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) case IOCTL_CREATE_FILE: { - _dbg_assert_(WII_IPC_FILEIO, request.buffer_out_size == 0); + _dbg_assert_(IOS_FILEIO, request.buffer_out_size == 0); u32 Addr = request.buffer_in; u32 OwnerID = Memory::Read_U32(Addr); @@ -489,7 +488,7 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) const std::string wii_path = Memory::GetString(Addr, 64); if (!IsValidWiiPath(wii_path)) { - WARN_LOG(WII_IPC_FILEIO, "Not a valid path: %s", wii_path.c_str()); + WARN_LOG(IOS_FILEIO, "Not a valid path: %s", wii_path.c_str()); return FS_EINVAL; } std::string Filename(HLE_IPC_BuildFilename(wii_path)); @@ -503,18 +502,18 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) u8 Attributes = Memory::Read_U8(Addr); Addr++; - INFO_LOG(WII_IPC_FILEIO, "FS: CreateFile %s", Filename.c_str()); - DEBUG_LOG(WII_IPC_FILEIO, " OwnerID: 0x%08x", OwnerID); - DEBUG_LOG(WII_IPC_FILEIO, " GroupID: 0x%04x", GroupID); - DEBUG_LOG(WII_IPC_FILEIO, " OwnerPerm: 0x%02x", OwnerPerm); - DEBUG_LOG(WII_IPC_FILEIO, " GroupPerm: 0x%02x", GroupPerm); - DEBUG_LOG(WII_IPC_FILEIO, " OtherPerm: 0x%02x", OtherPerm); - DEBUG_LOG(WII_IPC_FILEIO, " Attributes: 0x%02x", Attributes); + INFO_LOG(IOS_FILEIO, "FS: CreateFile %s", Filename.c_str()); + DEBUG_LOG(IOS_FILEIO, " OwnerID: 0x%08x", OwnerID); + DEBUG_LOG(IOS_FILEIO, " GroupID: 0x%04x", GroupID); + DEBUG_LOG(IOS_FILEIO, " OwnerPerm: 0x%02x", OwnerPerm); + DEBUG_LOG(IOS_FILEIO, " GroupPerm: 0x%02x", GroupPerm); + DEBUG_LOG(IOS_FILEIO, " OtherPerm: 0x%02x", OtherPerm); + DEBUG_LOG(IOS_FILEIO, " Attributes: 0x%02x", Attributes); // check if the file already exist if (File::Exists(Filename)) { - INFO_LOG(WII_IPC_FILEIO, "\tresult = FS_EEXIST"); + INFO_LOG(IOS_FILEIO, "\tresult = FS_EEXIST"); return FS_EEXIST; } @@ -523,23 +522,23 @@ s32 FS::ExecuteCommand(const IOSIOCtlRequest& request) bool Result = File::CreateEmptyFile(Filename); if (!Result) { - ERROR_LOG(WII_IPC_FILEIO, "FS: couldn't create new file"); + ERROR_LOG(IOS_FILEIO, "FS: couldn't create new file"); PanicAlert("FS: couldn't create new file"); return FS_EINVAL; } - INFO_LOG(WII_IPC_FILEIO, "\tresult = IPC_SUCCESS"); + INFO_LOG(IOS_FILEIO, "\tresult = IPC_SUCCESS"); return IPC_SUCCESS; } break; case IOCTL_SHUTDOWN: { - INFO_LOG(WII_IPC_FILEIO, "Wii called Shutdown()"); + INFO_LOG(IOS_FILEIO, "Wii called Shutdown()"); // TODO: stop emulation } break; default: - request.DumpUnknown(GetDeviceName(), LogTypes::WII_IPC_FILEIO); + request.DumpUnknown(GetDeviceName(), LogTypes::IOS_FILEIO); } return FS_EINVAL; diff --git a/Source/Core/Core/IOS/FS/FileIO.cpp b/Source/Core/Core/IOS/FS/FileIO.cpp index 6956c1a3e7..941dcce8b4 100644 --- a/Source/Core/Core/IOS/FS/FileIO.cpp +++ b/Source/Core/Core/IOS/FS/FileIO.cpp @@ -78,7 +78,7 @@ FileIO::FileIO(u32 device_id, const std::string& device_name) void FileIO::Close() { - INFO_LOG(WII_IPC_FILEIO, "FileIO: Close %s (DeviceID=%08x)", m_name.c_str(), m_device_id); + INFO_LOG(IOS_FILEIO, "FileIO: Close %s (DeviceID=%08x)", m_name.c_str(), m_device_id); m_Mode = 0; // Let go of our pointer to the file, it will automatically close if we are the last handle @@ -100,12 +100,12 @@ IOSReturnCode FileIO::Open(const IOSOpenRequest& request) // It should be created by ISFS_CreateFile, not here if (!File::Exists(m_filepath) || File::IsDirectory(m_filepath)) { - WARN_LOG(WII_IPC_FILEIO, "FileIO: Open (%s) failed - File doesn't exist %s", Modes[m_Mode], + WARN_LOG(IOS_FILEIO, "FileIO: Open (%s) failed - File doesn't exist %s", Modes[m_Mode], m_filepath.c_str()); return FS_ENOENT; } - INFO_LOG(WII_IPC_FILEIO, "FileIO: Open %s (%s == %08X)", m_name.c_str(), Modes[m_Mode], m_Mode); + INFO_LOG(IOS_FILEIO, "FileIO: Open %s (%s == %08X)", m_name.c_str(), Modes[m_Mode], m_Mode); OpenFile(); m_is_active = true; @@ -163,8 +163,8 @@ IPCCommandResult FileIO::Seek(const IOSSeekRequest& request) if (m_file->IsOpen()) { const u32 file_size = static_cast(m_file->GetSize()); - DEBUG_LOG(WII_IPC_FILEIO, "FileIO: Seek Pos: 0x%08x, Mode: %i (%s, Length=0x%08x)", - request.offset, request.mode, m_name.c_str(), file_size); + DEBUG_LOG(IOS_FILEIO, "FileIO: Seek Pos: 0x%08x, Mode: %i (%s, Length=0x%08x)", request.offset, + request.mode, m_name.c_str(), file_size); switch (request.mode) { @@ -222,13 +222,12 @@ IPCCommandResult FileIO::Read(const IOSReadWriteRequest& request) { if (m_Mode == IOS_OPEN_WRITE) { - WARN_LOG(WII_IPC_FILEIO, - "FileIO: Attempted to read 0x%x bytes to 0x%08x on a write-only file %s", + WARN_LOG(IOS_FILEIO, "FileIO: Attempted to read 0x%x bytes to 0x%08x on a write-only file %s", request.size, request.buffer, m_name.c_str()); } else { - DEBUG_LOG(WII_IPC_FILEIO, "FileIO: Read 0x%x bytes to 0x%08x from %s", request.size, + DEBUG_LOG(IOS_FILEIO, "FileIO: Read 0x%x bytes to 0x%08x from %s", request.size, request.buffer, m_name.c_str()); m_file->Seek(m_SeekPos, SEEK_SET); // File might be opened twice, need to seek before we read return_value = static_cast( @@ -245,8 +244,8 @@ IPCCommandResult FileIO::Read(const IOSReadWriteRequest& request) } else { - ERROR_LOG(WII_IPC_FILEIO, "FileIO: Failed to read from %s (Addr=0x%08x Size=0x%x) - file could " - "not be opened or does not exist", + ERROR_LOG(IOS_FILEIO, "FileIO: Failed to read from %s (Addr=0x%08x Size=0x%x) - file could " + "not be opened or does not exist", m_name.c_str(), request.buffer, request.size); return_value = FS_ENOENT; } @@ -261,13 +260,13 @@ IPCCommandResult FileIO::Write(const IOSReadWriteRequest& request) { if (m_Mode == IOS_OPEN_READ) { - WARN_LOG(WII_IPC_FILEIO, + WARN_LOG(IOS_FILEIO, "FileIO: Attempted to write 0x%x bytes from 0x%08x to a read-only file %s", request.size, request.buffer, m_name.c_str()); } else { - DEBUG_LOG(WII_IPC_FILEIO, "FileIO: Write 0x%04x bytes from 0x%08x to %s", request.size, + DEBUG_LOG(IOS_FILEIO, "FileIO: Write 0x%04x bytes from 0x%08x to %s", request.size, request.buffer, m_name.c_str()); m_file->Seek(m_SeekPos, SEEK_SET); // File might be opened twice, need to seek before we write @@ -280,8 +279,8 @@ IPCCommandResult FileIO::Write(const IOSReadWriteRequest& request) } else { - ERROR_LOG(WII_IPC_FILEIO, "FileIO: Failed to read from %s (Addr=0x%08x Size=0x%x) - file could " - "not be opened or does not exist", + ERROR_LOG(IOS_FILEIO, "FileIO: Failed to read from %s (Addr=0x%08x Size=0x%x) - file could " + "not be opened or does not exist", m_name.c_str(), request.buffer, request.size); return_value = FS_ENOENT; } @@ -291,7 +290,7 @@ IPCCommandResult FileIO::Write(const IOSReadWriteRequest& request) IPCCommandResult FileIO::IOCtl(const IOSIOCtlRequest& request) { - DEBUG_LOG(WII_IPC_FILEIO, "FileIO: IOCtl (Device=%s)", m_name.c_str()); + DEBUG_LOG(IOS_FILEIO, "FileIO: IOCtl (Device=%s)", m_name.c_str()); s32 return_value = IPC_SUCCESS; switch (request.request) @@ -300,7 +299,7 @@ IPCCommandResult FileIO::IOCtl(const IOSIOCtlRequest& request) { if (m_file->IsOpen()) { - DEBUG_LOG(WII_IPC_FILEIO, "File: %s, Length: %" PRIu64 ", Pos: %i", m_name.c_str(), + DEBUG_LOG(IOS_FILEIO, "File: %s, Length: %" PRIu64 ", Pos: %i", m_name.c_str(), m_file->GetSize(), m_SeekPos); Memory::Write_U32(static_cast(m_file->GetSize()), request.buffer_out); Memory::Write_U32(m_SeekPos, request.buffer_out + 4); @@ -313,7 +312,7 @@ IPCCommandResult FileIO::IOCtl(const IOSIOCtlRequest& request) break; default: - request.Log(GetDeviceName(), LogTypes::WII_IPC_FILEIO, LogTypes::LERROR); + request.Log(GetDeviceName(), LogTypes::IOS_FILEIO, LogTypes::LERROR); } return GetDefaultReply(return_value); diff --git a/Source/Core/Core/IOS/IPC.cpp b/Source/Core/Core/IOS/IPC.cpp index 3396d5f094..5cfa99b896 100644 --- a/Source/Core/Core/IOS/IPC.cpp +++ b/Source/Core/Core/IOS/IPC.cpp @@ -124,7 +124,7 @@ std::shared_ptr AddDevice(const char* device_name) void Reinit() { std::lock_guard lock(s_device_map_mutex); - _assert_msg_(WII_IPC_HLE, s_device_map.empty(), "Reinit called while already initialized"); + _assert_msg_(IOS, s_device_map.empty(), "Reinit called while already initialized"); Device::ES::m_ContentFile = ""; num_devices = 0; @@ -352,10 +352,10 @@ static std::shared_ptr GetUnusedESDevice() static s32 OpenDevice(const IOSOpenRequest& request) { const s32 new_fd = GetFreeDeviceID(); - INFO_LOG(WII_IPC_HLE, "Opening %s (mode %d, fd %d)", request.path.c_str(), request.flags, new_fd); + INFO_LOG(IOS, "Opening %s (mode %d, fd %d)", request.path.c_str(), request.flags, new_fd); if (new_fd < 0 || new_fd >= IPC_MAX_FDS) { - ERROR_LOG(WII_IPC_HLE, "Couldn't get a free fd, too many open files"); + ERROR_LOG(IOS, "Couldn't get a free fd, too many open files"); return FS_EFDEXHAUSTED; } @@ -377,7 +377,7 @@ static s32 OpenDevice(const IOSOpenRequest& request) if (!device) { - ERROR_LOG(WII_IPC_HLE, "Unknown device: %s", request.path.c_str()); + ERROR_LOG(IOS, "Unknown device: %s", request.path.c_str()); return IPC_ENOENT; } @@ -418,7 +418,7 @@ static IPCCommandResult HandleCommand(const IOSRequest& request) case IPC_CMD_IOCTLV: return device->IOCtlV(IOSIOCtlVRequest{request.address}); default: - _assert_msg_(WII_IPC_HLE, false, "Unexpected command: %x", request.command); + _assert_msg_(IOS, false, "Unexpected command: %x", request.command); return Device::Device::GetDefaultReply(IPC_EINVAL); } } @@ -472,7 +472,7 @@ void Update() if (s_request_queue.size()) { GenerateAck(s_request_queue.front()); - DEBUG_LOG(WII_IPC_HLE, "||-- Acknowledge IPC Request @ 0x%08x", s_request_queue.front()); + DEBUG_LOG(IOS, "||-- Acknowledge IPC Request @ 0x%08x", s_request_queue.front()); u32 command = s_request_queue.front(); s_request_queue.pop_front(); ExecuteCommand(command); @@ -482,7 +482,7 @@ void Update() if (s_reply_queue.size()) { GenerateReply(s_reply_queue.front()); - DEBUG_LOG(WII_IPC_HLE, "<<-- Reply to IPC Request @ 0x%08x", s_reply_queue.front()); + DEBUG_LOG(IOS, "<<-- Reply to IPC Request @ 0x%08x", s_reply_queue.front()); s_reply_queue.pop_front(); return; } @@ -490,7 +490,7 @@ void Update() if (s_ack_queue.size()) { GenerateAck(s_ack_queue.front()); - WARN_LOG(WII_IPC_HLE, "<<-- Double-ack to IPC Request @ 0x%08x", s_ack_queue.front()); + WARN_LOG(IOS, "<<-- Double-ack to IPC Request @ 0x%08x", s_ack_queue.front()); s_ack_queue.pop_front(); return; } diff --git a/Source/Core/Core/IOS/Network/Config.cpp b/Source/Core/Core/IOS/Network/Config.cpp index 86dd3d05d1..162d44e92b 100644 --- a/Source/Core/Core/IOS/Network/Config.cpp +++ b/Source/Core/Core/IOS/Network/Config.cpp @@ -44,7 +44,7 @@ void WiiNetConfig::WriteConfig() const if (!File::CreateFullPath(File::GetUserPath(D_SESSION_WIIROOT_IDX) + "/" WII_SYSCONF_DIR "/net/02/")) { - ERROR_LOG(WII_IPC_NET, "Failed to create directory for network config file"); + ERROR_LOG(IOS_NET, "Failed to create directory for network config file"); } } diff --git a/Source/Core/Core/IOS/Network/NWC24Config.cpp b/Source/Core/Core/IOS/Network/NWC24Config.cpp index e0de924b77..6cfb374898 100644 --- a/Source/Core/Core/IOS/Network/NWC24Config.cpp +++ b/Source/Core/Core/IOS/Network/NWC24Config.cpp @@ -36,7 +36,7 @@ void NWC24Config::ReadConfig() { const s32 config_error = CheckNwc24Config(); if (config_error) - ERROR_LOG(WII_IPC_WC24, "There is an error in the config for for WC24: %d", config_error); + ERROR_LOG(IOS_WC24, "There is an error in the config for for WC24: %d", config_error); } } else @@ -51,7 +51,7 @@ void NWC24Config::WriteConfig() const { if (!File::CreateFullPath(File::GetUserPath(D_SESSION_WIIROOT_IDX) + "/" WII_WC24CONF_DIR)) { - ERROR_LOG(WII_IPC_WC24, "Failed to create directory for WC24"); + ERROR_LOG(IOS_WC24, "Failed to create directory for WC24"); } } @@ -105,21 +105,21 @@ s32 NWC24Config::CheckNwc24Config() const // 'WcCf' magic if (Magic() != 0x57634366) { - ERROR_LOG(WII_IPC_WC24, "Magic mismatch"); + ERROR_LOG(IOS_WC24, "Magic mismatch"); return -14; } const u32 checksum = CalculateNwc24ConfigChecksum(); - DEBUG_LOG(WII_IPC_WC24, "Checksum: %X", checksum); + DEBUG_LOG(IOS_WC24, "Checksum: %X", checksum); if (Checksum() != checksum) { - ERROR_LOG(WII_IPC_WC24, "Checksum mismatch expected %X and got %X", checksum, Checksum()); + ERROR_LOG(IOS_WC24, "Checksum mismatch expected %X and got %X", checksum, Checksum()); return -14; } if (IdGen() > 0x1F) { - ERROR_LOG(WII_IPC_WC24, "Id gen error"); + ERROR_LOG(IOS_WC24, "Id gen error"); return -14; } diff --git a/Source/Core/Core/IOS/Network/Net.cpp b/Source/Core/Core/IOS/Network/Net.cpp index 8eff10edee..a48ee40735 100644 --- a/Source/Core/Core/IOS/Network/Net.cpp +++ b/Source/Core/Core/IOS/Network/Net.cpp @@ -84,16 +84,16 @@ IPCCommandResult NetKDRequest::IOCtl(const IOSIOCtlRequest& request) { case IOCTL_NWC24_SUSPEND_SCHEDULAR: // NWC24iResumeForCloseLib from NWC24SuspendScheduler (Input: none, Output: 32 bytes) - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: IOCTL_NWC24_SUSPEND_SCHEDULAR - NI"); + INFO_LOG(IOS_WC24, "NET_KD_REQ: IOCTL_NWC24_SUSPEND_SCHEDULAR - NI"); Memory::Write_U32(0, request.buffer_out); // no error break; case IOCTL_NWC24_EXEC_TRY_SUSPEND_SCHEDULAR: // NWC24iResumeForCloseLib - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: IOCTL_NWC24_EXEC_TRY_SUSPEND_SCHEDULAR - NI"); + INFO_LOG(IOS_WC24, "NET_KD_REQ: IOCTL_NWC24_EXEC_TRY_SUSPEND_SCHEDULAR - NI"); break; case IOCTL_NWC24_EXEC_RESUME_SCHEDULAR: // NWC24iResumeForCloseLib - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: IOCTL_NWC24_EXEC_RESUME_SCHEDULAR - NI"); + INFO_LOG(IOS_WC24, "NET_KD_REQ: IOCTL_NWC24_EXEC_RESUME_SCHEDULAR - NI"); Memory::Write_U32(0, request.buffer_out); // no error break; @@ -101,29 +101,29 @@ IPCCommandResult NetKDRequest::IOCtl(const IOSIOCtlRequest& request) Memory::Write_U32(0, request.buffer_out); Memory::Write_U32(0, request.buffer_out + 4); return_value = 0; - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: IOCTL_NWC24_STARTUP_SOCKET - NI"); + INFO_LOG(IOS_WC24, "NET_KD_REQ: IOCTL_NWC24_STARTUP_SOCKET - NI"); break; case IOCTL_NWC24_CLEANUP_SOCKET: - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: IOCTL_NWC24_CLEANUP_SOCKET - NI"); + INFO_LOG(IOS_WC24, "NET_KD_REQ: IOCTL_NWC24_CLEANUP_SOCKET - NI"); break; case IOCTL_NWC24_LOCK_SOCKET: // WiiMenu - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: IOCTL_NWC24_LOCK_SOCKET - NI"); + INFO_LOG(IOS_WC24, "NET_KD_REQ: IOCTL_NWC24_LOCK_SOCKET - NI"); break; case IOCTL_NWC24_UNLOCK_SOCKET: - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: IOCTL_NWC24_UNLOCK_SOCKET - NI"); + INFO_LOG(IOS_WC24, "NET_KD_REQ: IOCTL_NWC24_UNLOCK_SOCKET - NI"); break; case IOCTL_NWC24_REQUEST_REGISTER_USER_ID: - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: IOCTL_NWC24_REQUEST_REGISTER_USER_ID"); + INFO_LOG(IOS_WC24, "NET_KD_REQ: IOCTL_NWC24_REQUEST_REGISTER_USER_ID"); Memory::Write_U32(0, request.buffer_out); Memory::Write_U32(0, request.buffer_out + 4); break; case IOCTL_NWC24_REQUEST_GENERATED_USER_ID: // (Input: none, Output: 32 bytes) - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: IOCTL_NWC24_REQUEST_GENERATED_USER_ID"); + INFO_LOG(IOS_WC24, "NET_KD_REQ: IOCTL_NWC24_REQUEST_GENERATED_USER_ID"); if (config.CreationStage() == NWC24::NWC24Config::NWC24_IDCS_INITIAL) { std::string settings_Filename( @@ -179,20 +179,20 @@ IPCCommandResult NetKDRequest::IOCtl(const IOSIOCtlRequest& request) break; case IOCTL_NWC24_GET_SCHEDULAR_STAT: - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: IOCTL_NWC24_GET_SCHEDULAR_STAT - NI"); + INFO_LOG(IOS_WC24, "NET_KD_REQ: IOCTL_NWC24_GET_SCHEDULAR_STAT - NI"); break; case IOCTL_NWC24_SAVE_MAIL_NOW: - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: IOCTL_NWC24_SAVE_MAIL_NOW - NI"); + INFO_LOG(IOS_WC24, "NET_KD_REQ: IOCTL_NWC24_SAVE_MAIL_NOW - NI"); break; case IOCTL_NWC24_REQUEST_SHUTDOWN: // if ya set the IOS version to a very high value this happens ... - INFO_LOG(WII_IPC_WC24, "NET_KD_REQ: IOCTL_NWC24_REQUEST_SHUTDOWN - NI"); + INFO_LOG(IOS_WC24, "NET_KD_REQ: IOCTL_NWC24_REQUEST_SHUTDOWN - NI"); break; default: - request.Log(GetDeviceName(), LogTypes::WII_IPC_WC24); + request.Log(GetDeviceName(), LogTypes::IOS_WC24); } return GetDefaultReply(return_value); @@ -311,12 +311,12 @@ static void GetMacAddress(u8* mac) SaveMacAddress(mac); if (!wireless_mac.empty()) { - ERROR_LOG(WII_IPC_NET, "The MAC provided (%s) is invalid. We have " - "generated another one for you.", + ERROR_LOG(IOS_NET, "The MAC provided (%s) is invalid. We have " + "generated another one for you.", Common::MacAddressToString(mac).c_str()); } } - INFO_LOG(WII_IPC_NET, "Using MAC address: %s", Common::MacAddressToString(mac).c_str()); + INFO_LOG(IOS_NET, "Using MAC address: %s", Common::MacAddressToString(mac).c_str()); } // ********************************************************************************** @@ -342,37 +342,37 @@ IPCCommandResult NetNCDManage::IOCtlV(const IOSIOCtlVRequest& request) break; case IOCTLV_NCD_GETCONFIG: - INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE: IOCTLV_NCD_GETCONFIG"); + INFO_LOG(IOS_NET, "NET_NCD_MANAGE: IOCTLV_NCD_GETCONFIG"); config.WriteToMem(request.io_vectors.at(0).address); common_vector = 1; break; case IOCTLV_NCD_SETCONFIG: - INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE: IOCTLV_NCD_SETCONFIG"); + INFO_LOG(IOS_NET, "NET_NCD_MANAGE: IOCTLV_NCD_SETCONFIG"); config.ReadFromMem(request.in_vectors.at(0).address); break; case IOCTLV_NCD_READCONFIG: - INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE: IOCTLV_NCD_READCONFIG"); + INFO_LOG(IOS_NET, "NET_NCD_MANAGE: IOCTLV_NCD_READCONFIG"); config.ReadConfig(); config.WriteToMem(request.io_vectors.at(0).address); common_vector = 1; break; case IOCTLV_NCD_WRITECONFIG: - INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE: IOCTLV_NCD_WRITECONFIG"); + INFO_LOG(IOS_NET, "NET_NCD_MANAGE: IOCTLV_NCD_WRITECONFIG"); config.ReadFromMem(request.in_vectors.at(0).address); config.WriteConfig(); break; case IOCTLV_NCD_GETLINKSTATUS: - INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE: IOCTLV_NCD_GETLINKSTATUS"); + INFO_LOG(IOS_NET, "NET_NCD_MANAGE: IOCTLV_NCD_GETLINKSTATUS"); // Always connected Memory::Write_U32(Net::ConnectionSettings::LINK_WIRED, request.io_vectors.at(0).address + 4); break; case IOCTLV_NCD_GETWIRELESSMACADDRESS: - INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE: IOCTLV_NCD_GETWIRELESSMACADDRESS"); + INFO_LOG(IOS_NET, "NET_NCD_MANAGE: IOCTLV_NCD_GETWIRELESSMACADDRESS"); u8 address[Common::MAC_ADDRESS_SIZE]; GetMacAddress(address); @@ -380,7 +380,7 @@ IPCCommandResult NetNCDManage::IOCtlV(const IOSIOCtlVRequest& request) break; default: - INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE IOCtlV: %#x", request.request); + INFO_LOG(IOS_NET, "NET_NCD_MANAGE IOCtlV: %#x", request.request); break; } @@ -466,7 +466,7 @@ IPCCommandResult NetWDCommand::IOCtlV(const IOSIOCtlVRequest& request) case IOCTLV_WD_RECV_FRAME: case IOCTLV_WD_RECV_NOTIFICATION: default: - request.Dump(GetDeviceName(), LogTypes::WII_IPC_NET, LogTypes::LINFO); + request.Dump(GetDeviceName(), LogTypes::IOS_NET, LogTypes::LINFO); } return GetDefaultReply(return_value); @@ -478,7 +478,7 @@ NetIPTop::NetIPTop(u32 device_id, const std::string& device_name) : Device(devic { #ifdef _WIN32 int ret = WSAStartup(MAKEWORD(2, 2), &InitData); - INFO_LOG(WII_IPC_NET, "WSAStartup: %d", ret); + INFO_LOG(IOS_NET, "WSAStartup: %d", ret); #endif } @@ -551,7 +551,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) { case IOCTL_SO_STARTUP: { - request.Log(GetDeviceName(), LogTypes::WII_IPC_WC24); + request.Log(GetDeviceName(), LogTypes::IOS_WC24); break; } case IOCTL_SO_SOCKET: @@ -562,8 +562,8 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) WiiSockMan& sm = WiiSockMan::GetInstance(); return_value = sm.NewSocket(af, type, prot); - INFO_LOG(WII_IPC_NET, "IOCTL_SO_SOCKET " - "Socket: %08x (%d,%d,%d), BufferIn: (%08x, %i), BufferOut: (%08x, %i)", + INFO_LOG(IOS_NET, "IOCTL_SO_SOCKET " + "Socket: %08x (%d,%d,%d), BufferIn: (%08x, %i), BufferOut: (%08x, %i)", return_value, af, type, prot, request.buffer_in, request.buffer_in_size, request.buffer_out, request.buffer_out_size); break; @@ -574,7 +574,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) WiiSockMan& sm = WiiSockMan::GetInstance(); return_value = sm.NewSocket(pf, SOCK_RAW, IPPROTO_ICMP); - INFO_LOG(WII_IPC_NET, "IOCTL_SO_ICMPSOCKET(%x) %d", pf, return_value); + INFO_LOG(IOS_NET, "IOCTL_SO_ICMPSOCKET(%x) %d", pf, return_value); break; } case IOCTL_SO_CLOSE: @@ -583,7 +583,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) u32 fd = Memory::Read_U32(request.buffer_in); WiiSockMan& sm = WiiSockMan::GetInstance(); return_value = sm.DeleteSocket(fd); - INFO_LOG(WII_IPC_NET, "%s(%x) %x", + INFO_LOG(IOS_NET, "%s(%x) %x", request.request == IOCTL_SO_ICMPCLOSE ? "IOCTL_SO_ICMPCLOSE" : "IOCTL_SO_CLOSE", fd, return_value); break; @@ -603,7 +603,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) ///////////////////////////////////////////////////////////// case IOCTL_SO_SHUTDOWN: { - request.Log(GetDeviceName(), LogTypes::WII_IPC_WC24); + request.Log(GetDeviceName(), LogTypes::IOS_WC24); u32 fd = Memory::Read_U32(request.buffer_in); u32 how = Memory::Read_U32(request.buffer_in + 4); @@ -617,7 +617,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) u32 BACKLOG = Memory::Read_U32(request.buffer_in + 0x04); u32 ret = listen(fd, BACKLOG); return_value = WiiSockMan::GetNetErrorCode(ret, "SO_LISTEN", false); - request.Log(GetDeviceName(), LogTypes::WII_IPC_WC24); + request.Log(GetDeviceName(), LogTypes::IOS_WC24); break; } case IOCTL_SO_GETSOCKOPT: @@ -626,7 +626,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) u32 level = Memory::Read_U32(request.buffer_out + 4); u32 optname = Memory::Read_U32(request.buffer_out + 8); - request.Log(GetDeviceName(), LogTypes::WII_IPC_WC24); + request.Log(GetDeviceName(), LogTypes::IOS_WC24); // Do the level/optname translation int nat_level = -1, nat_optname = -1; @@ -668,10 +668,10 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) optlen = std::min(optlen, (u32)sizeof(optval)); Memory::CopyFromEmu(optval, request.buffer_in + 0x10, optlen); - INFO_LOG(WII_IPC_NET, "IOCTL_SO_SETSOCKOPT(%08x, %08x, %08x, %08x) " - "BufferIn: (%08x, %i), BufferOut: (%08x, %i)" - "%02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx " - "%02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx", + INFO_LOG(IOS_NET, "IOCTL_SO_SETSOCKOPT(%08x, %08x, %08x, %08x) " + "BufferIn: (%08x, %i), BufferOut: (%08x, %i)" + "%02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx " + "%02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx", fd, level, optname, optlen, request.buffer_in, request.buffer_in_size, request.buffer_out, request.buffer_out_size, optval[0], optval[1], optval[2], optval[3], optval[4], optval[5], optval[6], optval[7], optval[8], optval[9], @@ -699,7 +699,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) if (nat_level == -1 || nat_optname == -1) { - INFO_LOG(WII_IPC_NET, "SO_SETSOCKOPT: unknown level %d or optname %d", level, optname); + INFO_LOG(IOS_NET, "SO_SETSOCKOPT: unknown level %d or optname %d", level, optname); // Default to the given level/optname. They match on Windows... nat_level = level; @@ -714,7 +714,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) { u32 fd = Memory::Read_U32(request.buffer_in); - request.Log(GetDeviceName(), LogTypes::WII_IPC_WC24); + request.Log(GetDeviceName(), LogTypes::IOS_WC24); sockaddr sa; socklen_t sa_len; @@ -722,7 +722,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) int ret = getsockname(fd, &sa, &sa_len); if (request.buffer_out_size < 2 + sizeof(sa.sa_data)) - WARN_LOG(WII_IPC_NET, "IOCTL_SO_GETSOCKNAME output buffer is too small. Truncating"); + WARN_LOG(IOS_NET, "IOCTL_SO_GETSOCKNAME output buffer is too small. Truncating"); if (request.buffer_out_size > 0) Memory::Write_U8(request.buffer_out_size, request.buffer_out); @@ -745,7 +745,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) int ret = getpeername(fd, &sa, &sa_len); if (request.buffer_out_size < 2 + sizeof(sa.sa_data)) - WARN_LOG(WII_IPC_NET, "IOCTL_SO_GETPEERNAME output buffer is too small. Truncating"); + WARN_LOG(IOS_NET, "IOCTL_SO_GETPEERNAME output buffer is too small. Truncating"); if (request.buffer_out_size > 0) Memory::Write_U8(request.buffer_out_size, request.buffer_out); @@ -755,7 +755,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) Memory::CopyToEmu(request.buffer_out + 2, &sa.sa_data, std::min(sizeof(sa.sa_data), request.buffer_out_size - 2)); - INFO_LOG(WII_IPC_NET, "IOCTL_SO_GETPEERNAME(%x)", fd); + INFO_LOG(IOS_NET, "IOCTL_SO_GETPEERNAME(%x)", fd); return_value = ret; break; @@ -763,7 +763,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) case IOCTL_SO_GETHOSTID: { - request.Log(GetDeviceName(), LogTypes::WII_IPC_WC24); + request.Log(GetDeviceName(), LogTypes::IOS_WC24); #ifdef _WIN32 DWORD forwardTableSize, ipTableSize, result; @@ -831,8 +831,8 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) if (remoteHost == nullptr || remoteHost->h_addr_list == nullptr || remoteHost->h_addr_list[0] == nullptr) { - INFO_LOG(WII_IPC_NET, "IOCTL_SO_INETATON = -1 " - "%s, BufferIn: (%08x, %i), BufferOut: (%08x, %i), IP Found: None", + INFO_LOG(IOS_NET, "IOCTL_SO_INETATON = -1 " + "%s, BufferIn: (%08x, %i), BufferOut: (%08x, %i), IP Found: None", hostname.c_str(), request.buffer_in, request.buffer_in_size, request.buffer_out, request.buffer_out_size); return_value = 0; @@ -840,8 +840,8 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) else { Memory::Write_U32(Common::swap32(*(u32*)remoteHost->h_addr_list[0]), request.buffer_out); - INFO_LOG(WII_IPC_NET, "IOCTL_SO_INETATON = 0 " - "%s, BufferIn: (%08x, %i), BufferOut: (%08x, %i), IP Found: %08X", + INFO_LOG(IOS_NET, "IOCTL_SO_INETATON = 0 " + "%s, BufferIn: (%08x, %i), BufferOut: (%08x, %i), IP Found: %08X", hostname.c_str(), request.buffer_in, request.buffer_in_size, request.buffer_out, request.buffer_out_size, Common::swap32(*(u32*)remoteHost->h_addr_list[0])); return_value = 1; @@ -852,8 +852,8 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) case IOCTL_SO_INETPTON: { std::string address = Memory::GetString(request.buffer_in); - INFO_LOG(WII_IPC_NET, "IOCTL_SO_INETPTON " - "(Translating: %s)", + INFO_LOG(IOS_NET, "IOCTL_SO_INETPTON " + "(Translating: %s)", address.c_str()); return_value = inet_pton(address.c_str(), Memory::GetPointer(request.buffer_out + 4)); break; @@ -868,7 +868,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) sprintf(ip_s, "%i.%i.%i.%i", Memory::Read_U8(request.buffer_in + 8), Memory::Read_U8(request.buffer_in + 8 + 1), Memory::Read_U8(request.buffer_in + 8 + 2), Memory::Read_U8(request.buffer_in + 8 + 3)); - INFO_LOG(WII_IPC_NET, "IOCTL_SO_INETNTOP %s", ip_s); + INFO_LOG(IOS_NET, "IOCTL_SO_INETNTOP %s", ip_s); Memory::CopyToEmu(request.buffer_out, (u8*)ip_s, strlen(ip_s)); break; } @@ -890,7 +890,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) int nfds = request.buffer_out_size / 0xc; if (nfds == 0) - ERROR_LOG(WII_IPC_NET, "Hidden POLL"); + ERROR_LOG(IOS_NET, "Hidden POLL"); std::vector ufds(nfds); @@ -909,16 +909,16 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) ufds[i].events |= map.native; unhandled_events &= ~map.wii; } - DEBUG_LOG(WII_IPC_NET, "IOCTL_SO_POLL(%d) " - "Sock: %08x, Unknown: %08x, Events: %08x, " - "NativeEvents: %08x", + DEBUG_LOG(IOS_NET, "IOCTL_SO_POLL(%d) " + "Sock: %08x, Unknown: %08x, Events: %08x, " + "NativeEvents: %08x", i, ufds[i].fd, unknown, events, ufds[i].events); // Do not pass return-only events to the native poll ufds[i].events &= ~(POLLERR | POLLHUP | POLLNVAL | UNSUPPORTED_WSAPOLL); if (unhandled_events) - ERROR_LOG(WII_IPC_NET, "SO_POLL: unhandled Wii event types: %04x", unhandled_events); + ERROR_LOG(IOS_NET, "SO_POLL: unhandled Wii event types: %04x", unhandled_events); } int ret = poll(ufds.data(), nfds, timeout); @@ -939,7 +939,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) // Memory::Write_U32(events, request.buffer_out + 0xc*i + 4); //events Memory::Write_U32(revents, request.buffer_out + 0xc * i + 8); // revents - DEBUG_LOG(WII_IPC_NET, "IOCTL_SO_POLL socket %d wevents %08X events %08X revents %08X", i, + DEBUG_LOG(IOS_NET, "IOCTL_SO_POLL socket %d wevents %08X events %08X revents %08X", i, revents, ufds[i].events, ufds[i].revents); } @@ -951,7 +951,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) { if (request.buffer_out_size != 0x460) { - ERROR_LOG(WII_IPC_NET, "Bad buffer size for IOCTL_SO_GETHOSTBYNAME"); + ERROR_LOG(IOS_NET, "Bad buffer size for IOCTL_SO_GETHOSTBYNAME"); return_value = -1; break; } @@ -959,8 +959,8 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) std::string hostname = Memory::GetString(request.buffer_in); hostent* remoteHost = gethostbyname(hostname.c_str()); - INFO_LOG(WII_IPC_NET, "IOCTL_SO_GETHOSTBYNAME " - "Address: %s, BufferIn: (%08x, %i), BufferOut: (%08x, %i)", + INFO_LOG(IOS_NET, "IOCTL_SO_GETHOSTBYNAME " + "Address: %s, BufferIn: (%08x, %i), BufferOut: (%08x, %i)", hostname.c_str(), request.buffer_in, request.buffer_in_size, request.buffer_out, request.buffer_out_size); @@ -968,7 +968,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) { for (int i = 0; remoteHost->h_aliases[i]; ++i) { - DEBUG_LOG(WII_IPC_NET, "alias%i:%s", i, remoteHost->h_aliases[i]); + DEBUG_LOG(IOS_NET, "alias%i:%s", i, remoteHost->h_aliases[i]); } for (int i = 0; remoteHost->h_addr_list[i]; ++i) @@ -976,7 +976,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) u32 ip = Common::swap32(*(u32*)(remoteHost->h_addr_list[i])); std::string ip_s = StringFromFormat("%i.%i.%i.%i", ip >> 24, (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); - DEBUG_LOG(WII_IPC_NET, "addr%i:%s", i, ip_s.c_str()); + DEBUG_LOG(IOS_NET, "addr%i:%s", i, ip_s.c_str()); } // Host name; located immediately after struct @@ -986,7 +986,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) u32 name_length = (u32)strlen(remoteHost->h_name) + 1; if (name_length > (GETHOSTBYNAME_IP_LIST_OFFSET - GETHOSTBYNAME_STRUCT_SIZE)) { - ERROR_LOG(WII_IPC_NET, "Hostname too long in IOCTL_SO_GETHOSTBYNAME"); + ERROR_LOG(IOS_NET, "Hostname too long in IOCTL_SO_GETHOSTBYNAME"); return_value = -1; break; } @@ -1026,7 +1026,7 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) request.buffer_out + 4); // Returned struct must be ipv4. - _assert_msg_(WII_IPC_NET, + _assert_msg_(IOS_NET, remoteHost->h_addrtype == AF_INET && remoteHost->h_length == sizeof(u32), "returned host info is not IPv4"); Memory::Write_U16(AF_INET, request.buffer_out + 8); @@ -1043,10 +1043,10 @@ IPCCommandResult NetIPTop::IOCtl(const IOSIOCtlRequest& request) } case IOCTL_SO_ICMPCANCEL: - ERROR_LOG(WII_IPC_NET, "IOCTL_SO_ICMPCANCEL"); + ERROR_LOG(IOS_NET, "IOCTL_SO_ICMPCANCEL"); default: - request.DumpUnknown(GetDeviceName(), LogTypes::WII_IPC_NET); + request.DumpUnknown(GetDeviceName(), LogTypes::IOS_NET); } return GetDefaultReply(return_value); @@ -1070,8 +1070,8 @@ IPCCommandResult NetIPTop::IOCtlV(const IOSIOCtlVRequest& request) param5 = Memory::Read_U32(request.io_vectors[0].address + 4); } - INFO_LOG(WII_IPC_NET, "IOCTLV_SO_GETINTERFACEOPT(%08X, %08X, %X, %X, %X) " - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i) ", + INFO_LOG(IOS_NET, "IOCTLV_SO_GETINTERFACEOPT(%08X, %08X, %X, %X, %X) " + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i) ", param, param2, param3, param4, param5, request.in_vectors[0].address, request.in_vectors[0].size, request.in_vectors.size() > 1 ? request.in_vectors[1].address : 0, @@ -1122,8 +1122,8 @@ IPCCommandResult NetIPTop::IOCtlV(const IOSIOCtlVRequest& request) if (AdapterList->IfIndex == dwBestIfIndex && AdapterList->FirstDnsServerAddress && AdapterList->OperStatus == IfOperStatusUp) { - INFO_LOG(WII_IPC_NET, "Name of valid interface: %S", AdapterList->FriendlyName); - INFO_LOG(WII_IPC_NET, "DNS: %u.%u.%u.%u", + INFO_LOG(IOS_NET, "Name of valid interface: %S", AdapterList->FriendlyName); + INFO_LOG(IOS_NET, "DNS: %u.%u.%u.%u", (unsigned char) AdapterList->FirstDnsServerAddress->Address.lpSockaddr->sa_data[2], (unsigned char) @@ -1179,7 +1179,7 @@ IPCCommandResult NetIPTop::IOCtlV(const IOSIOCtlVRequest& request) break; default: - ERROR_LOG(WII_IPC_NET, "Unknown param2: %08X", param2); + ERROR_LOG(IOS_NET, "Unknown param2: %08X", param2); break; } break; @@ -1288,7 +1288,7 @@ IPCCommandResult NetIPTop::IOCtlV(const IOSIOCtlVRequest& request) ret = -305; } - request.Dump(GetDeviceName(), LogTypes::WII_IPC_NET, LogTypes::LINFO); + request.Dump(GetDeviceName(), LogTypes::IOS_NET, LogTypes::LINFO); return_value = ret; break; } @@ -1308,7 +1308,7 @@ IPCCommandResult NetIPTop::IOCtlV(const IOSIOCtlVRequest& request) if (num_ip != 1) { - INFO_LOG(WII_IPC_NET, "IOCTLV_SO_ICMPPING %i IPs", num_ip); + INFO_LOG(IOS_NET, "IOCTLV_SO_ICMPPING %i IPs", num_ip); } ip_info.length = Memory::Read_U8(request.in_vectors[0].address + 16); @@ -1318,12 +1318,12 @@ IPCCommandResult NetIPTop::IOCtlV(const IOSIOCtlVRequest& request) if (ip_info.length != 8 || ip_info.addr_family != AF_INET) { - INFO_LOG(WII_IPC_NET, "IOCTLV_SO_ICMPPING strange IPInfo:\n" - "length %x addr_family %x", + INFO_LOG(IOS_NET, "IOCTLV_SO_ICMPPING strange IPInfo:\n" + "length %x addr_family %x", ip_info.length, ip_info.addr_family); } - INFO_LOG(WII_IPC_NET, "IOCTLV_SO_ICMPPING %x", ip_info.ip); + INFO_LOG(IOS_NET, "IOCTLV_SO_ICMPPING %x", ip_info.ip); sockaddr_in addr; addr.sin_family = AF_INET; @@ -1356,7 +1356,7 @@ IPCCommandResult NetIPTop::IOCtlV(const IOSIOCtlVRequest& request) break; } default: - request.DumpUnknown(GetDeviceName(), LogTypes::WII_IPC_NET); + request.DumpUnknown(GetDeviceName(), LogTypes::IOS_NET); } return GetDefaultReply(return_value); diff --git a/Source/Core/Core/IOS/Network/Net.h b/Source/Core/Core/IOS/Network/Net.h index 22fccd91ae..29e9080f8e 100644 --- a/Source/Core/Core/IOS/Network/Net.h +++ b/Source/Core/Core/IOS/Network/Net.h @@ -164,7 +164,7 @@ public: break; default: - ERROR_LOG(WII_IPC_NET, "%s - unknown IOCtl: %x", GetDeviceName().c_str(), request.request); + ERROR_LOG(IOS_NET, "%s - unknown IOCtl: %x", GetDeviceName().c_str(), request.request); break; } diff --git a/Source/Core/Core/IOS/Network/SSL.cpp b/Source/Core/Core/IOS/Network/SSL.cpp index 3eb7d4501e..6c044cfcfe 100644 --- a/Source/Core/Core/IOS/Network/SSL.cpp +++ b/Source/Core/Core/IOS/Network/SSL.cpp @@ -81,7 +81,7 @@ int NetSSL::GetSSLFreeID() const IPCCommandResult NetSSL::IOCtl(const IOSIOCtlRequest& request) { - request.Log(GetDeviceName(), LogTypes::WII_IPC_SSL, LogTypes::LINFO); + request.Log(GetDeviceName(), LogTypes::IOS_SSL, LogTypes::LINFO); return GetDefaultReply(IPC_SUCCESS); } @@ -185,10 +185,10 @@ IPCCommandResult NetSSL::IOCtlV(const IOSIOCtlVRequest& request) Memory::Write_U32(SSL_ERR_FAILED, BufferIn); } - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_NEW (%d, %s) " - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " - "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " - "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_NEW (%d, %s) " + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " + "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " + "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", verifyOption, hostname.c_str(), BufferIn, BufferInSize, BufferIn2, BufferInSize2, BufferIn3, BufferInSize3, BufferOut, BufferOutSize, BufferOut2, BufferOutSize2, BufferOut3, BufferOutSize3); @@ -222,20 +222,20 @@ IPCCommandResult NetSSL::IOCtlV(const IOSIOCtlVRequest& request) { Memory::Write_U32(SSL_ERR_ID, BufferIn); } - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_SHUTDOWN " - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " - "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " - "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_SHUTDOWN " + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " + "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " + "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", BufferIn, BufferInSize, BufferIn2, BufferInSize2, BufferIn3, BufferInSize3, BufferOut, BufferOutSize, BufferOut2, BufferOutSize2, BufferOut3, BufferOutSize3); break; } case IOCTLV_NET_SSL_SETROOTCA: { - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_SETROOTCA " - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " - "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " - "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_SETROOTCA " + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " + "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " + "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", BufferIn, BufferInSize, BufferIn2, BufferInSize2, BufferIn3, BufferInSize3, BufferOut, BufferOutSize, BufferOut2, BufferOutSize2, BufferOut3, BufferOutSize3); @@ -262,7 +262,7 @@ IPCCommandResult NetSSL::IOCtlV(const IOSIOCtlVRequest& request) Memory::Write_U32(SSL_OK, BufferIn); } - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_SETROOTCA = %d", ret); + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_SETROOTCA = %d", ret); } else { @@ -272,10 +272,10 @@ IPCCommandResult NetSSL::IOCtlV(const IOSIOCtlVRequest& request) } case IOCTLV_NET_SSL_SETBUILTINCLIENTCERT: { - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_SETBUILTINCLIENTCERT " - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " - "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " - "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_SETBUILTINCLIENTCERT " + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " + "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " + "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", BufferIn, BufferInSize, BufferIn2, BufferInSize2, BufferIn3, BufferInSize3, BufferOut, BufferOutSize, BufferOut2, BufferOutSize2, BufferOut3, BufferOutSize3); @@ -300,21 +300,21 @@ IPCCommandResult NetSSL::IOCtlV(const IOSIOCtlVRequest& request) Memory::Write_U32(SSL_OK, BufferIn); } - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_SETBUILTINCLIENTCERT = (%d, %d)", ret, pk_ret); + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_SETBUILTINCLIENTCERT = (%d, %d)", ret, pk_ret); } else { Memory::Write_U32(SSL_ERR_ID, BufferIn); - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_SETBUILTINCLIENTCERT invalid sslID = %d", sslID); + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_SETBUILTINCLIENTCERT invalid sslID = %d", sslID); } break; } case IOCTLV_NET_SSL_REMOVECLIENTCERT: { - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_REMOVECLIENTCERT " - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " - "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " - "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_REMOVECLIENTCERT " + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " + "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " + "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", BufferIn, BufferInSize, BufferIn2, BufferInSize2, BufferIn3, BufferInSize3, BufferOut, BufferOutSize, BufferOut2, BufferOutSize2, BufferOut3, BufferOutSize3); @@ -331,7 +331,7 @@ IPCCommandResult NetSSL::IOCtlV(const IOSIOCtlVRequest& request) else { Memory::Write_U32(SSL_ERR_ID, BufferIn); - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_SETBUILTINCLIENTCERT invalid sslID = %d", sslID); + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_SETBUILTINCLIENTCERT invalid sslID = %d", sslID); } break; } @@ -354,16 +354,16 @@ IPCCommandResult NetSSL::IOCtlV(const IOSIOCtlVRequest& request) mbedtls_ssl_conf_ca_chain(&ssl->config, &ssl->cacert, nullptr); Memory::Write_U32(SSL_OK, BufferIn); } - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_SETBUILTINROOTCA = %d", ret); + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_SETBUILTINROOTCA = %d", ret); } else { Memory::Write_U32(SSL_ERR_ID, BufferIn); } - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_SETBUILTINROOTCA " - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " - "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " - "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_SETBUILTINROOTCA " + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " + "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " + "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", BufferIn, BufferInSize, BufferIn2, BufferInSize2, BufferIn3, BufferInSize3, BufferOut, BufferOutSize, BufferOut2, BufferOutSize2, BufferOut3, BufferOutSize3); break; @@ -376,7 +376,7 @@ IPCCommandResult NetSSL::IOCtlV(const IOSIOCtlVRequest& request) WII_SSL* ssl = &_SSL[sslID]; mbedtls_ssl_setup(&ssl->ctx, &ssl->config); ssl->sockfd = Memory::Read_U32(BufferOut2); - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_CONNECT socket = %d", ssl->sockfd); + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_CONNECT socket = %d", ssl->sockfd); mbedtls_ssl_set_bio(&ssl->ctx, &ssl->sockfd, mbedtls_net_send, mbedtls_net_recv, nullptr); Memory::Write_U32(SSL_OK, BufferIn); } @@ -384,10 +384,10 @@ IPCCommandResult NetSSL::IOCtlV(const IOSIOCtlVRequest& request) { Memory::Write_U32(SSL_ERR_ID, BufferIn); } - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_CONNECT " - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " - "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " - "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_CONNECT " + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " + "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " + "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", BufferIn, BufferInSize, BufferIn2, BufferInSize2, BufferIn3, BufferInSize3, BufferOut, BufferOutSize, BufferOut2, BufferOutSize2, BufferOut3, BufferOutSize3); break; @@ -420,13 +420,13 @@ IPCCommandResult NetSSL::IOCtlV(const IOSIOCtlVRequest& request) { Memory::Write_U32(SSL_ERR_ID, BufferIn); } - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_WRITE " - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " - "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " - "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_WRITE " + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " + "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " + "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", BufferIn, BufferInSize, BufferIn2, BufferInSize2, BufferIn3, BufferInSize3, BufferOut, BufferOutSize, BufferOut2, BufferOutSize2, BufferOut3, BufferOutSize3); - INFO_LOG(WII_IPC_SSL, "%s", Memory::GetString(BufferOut2).c_str()); + INFO_LOG(IOS_SSL, "%s", Memory::GetString(BufferOut2).c_str()); break; } case IOCTLV_NET_SSL_READ: @@ -444,10 +444,10 @@ IPCCommandResult NetSSL::IOCtlV(const IOSIOCtlVRequest& request) Memory::Write_U32(SSL_ERR_ID, BufferIn); } - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_READ(%d)" - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " - "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " - "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_READ(%d)" + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " + "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " + "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", ret, BufferIn, BufferInSize, BufferIn2, BufferInSize2, BufferIn3, BufferInSize3, BufferOut, BufferOutSize, BufferOut2, BufferOutSize2, BufferOut3, BufferOutSize3); break; @@ -463,20 +463,20 @@ IPCCommandResult NetSSL::IOCtlV(const IOSIOCtlVRequest& request) { Memory::Write_U32(SSL_ERR_ID, BufferIn); } - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_SETROOTCADEFAULT " - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " - "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " - "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_SETROOTCADEFAULT " + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " + "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " + "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", BufferIn, BufferInSize, BufferIn2, BufferInSize2, BufferIn3, BufferInSize3, BufferOut, BufferOutSize, BufferOut2, BufferOutSize2, BufferOut3, BufferOutSize3); break; } case IOCTLV_NET_SSL_SETCLIENTCERTDEFAULT: { - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_SETCLIENTCERTDEFAULT " - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " - "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " - "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_SETCLIENTCERTDEFAULT " + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " + "BufferIn3: (%08x, %i), BufferOut: (%08x, %i), " + "BufferOut2: (%08x, %i), BufferOut3: (%08x, %i)", BufferIn, BufferInSize, BufferIn2, BufferInSize2, BufferIn3, BufferInSize3, BufferOut, BufferOutSize, BufferOut2, BufferOutSize2, BufferOut3, BufferOutSize3); @@ -492,7 +492,7 @@ IPCCommandResult NetSSL::IOCtlV(const IOSIOCtlVRequest& request) break; } default: - request.DumpUnknown(GetDeviceName(), LogTypes::WII_IPC_SSL); + request.DumpUnknown(GetDeviceName(), LogTypes::IOS_SSL); } // SSL return codes are written to BufferIn diff --git a/Source/Core/Core/IOS/Network/Socket.cpp b/Source/Core/Core/IOS/Network/Socket.cpp index 4b3404d90b..3b6598d577 100644 --- a/Source/Core/Core/IOS/Network/Socket.cpp +++ b/Source/Core/Core/IOS/Network/Socket.cpp @@ -50,7 +50,7 @@ static s32 TranslateErrorCode(s32 native_error, bool isRW) switch (native_error) { case ERRORCODE(EMSGSIZE): - ERROR_LOG(WII_IPC_NET, "Find out why this happened, looks like PEEK failure?"); + ERROR_LOG(IOS_NET, "Find out why this happened, looks like PEEK failure?"); return -1; // Should be -SO_EMSGSIZE case EITHER(WSAENOTSOCK, EBADF): return -SO_EBADF; @@ -103,7 +103,7 @@ s32 WiiSockMan::GetNetErrorCode(s32 ret, const char* caller, bool isRW) return ret; } - ERROR_LOG(WII_IPC_NET, "%s failed with error %d: %s, ret= %d", caller, errorCode, + ERROR_LOG(IOS_NET, "%s failed with error %d: %s, ret= %d", caller, errorCode, DecodeError(errorCode), ret); s32 ReturnValue = TranslateErrorCode(errorCode, isRW); @@ -176,10 +176,10 @@ s32 WiiSocket::FCntl(u32 cmd, u32 arg) } else { - ERROR_LOG(WII_IPC_NET, "SO_FCNTL unknown command"); + ERROR_LOG(IOS_NET, "SO_FCNTL unknown command"); } - INFO_LOG(WII_IPC_NET, "IOCTL_SO_FCNTL(%08x, %08X, %08X)", fd, cmd, arg); + INFO_LOG(IOS_NET, "IOCTL_SO_FCNTL(%08x, %08X, %08X)", fd, cmd, arg); return ret; } @@ -213,8 +213,8 @@ void WiiSocket::Update(bool read, bool write, bool except) int ret = bind(fd, (sockaddr*)&local_name, sizeof(local_name)); ReturnValue = WiiSockMan::GetNetErrorCode(ret, "SO_BIND", false); - INFO_LOG(WII_IPC_NET, "IOCTL_SO_BIND (%08X %s:%d) = %d ", fd, - inet_ntoa(local_name.sin_addr), Common::swap16(local_name.sin_port), ret); + INFO_LOG(IOS_NET, "IOCTL_SO_BIND (%08X %s:%d) = %d ", fd, inet_ntoa(local_name.sin_addr), + Common::swap16(local_name.sin_port), ret); break; } case IOCTL_SO_CONNECT: @@ -226,7 +226,7 @@ void WiiSocket::Update(bool read, bool write, bool except) int ret = connect(fd, (sockaddr*)&local_name, sizeof(local_name)); ReturnValue = WiiSockMan::GetNetErrorCode(ret, "SO_CONNECT", false); - INFO_LOG(WII_IPC_NET, "IOCTL_SO_CONNECT (%08x, %s:%d)", fd, inet_ntoa(local_name.sin_addr), + INFO_LOG(IOS_NET, "IOCTL_SO_CONNECT (%08x, %s:%d)", fd, inet_ntoa(local_name.sin_addr), Common::swap16(local_name.sin_port)); break; } @@ -252,7 +252,7 @@ void WiiSocket::Update(bool read, bool write, bool except) WiiSockMan::GetInstance().AddSocket(ReturnValue); - ioctl.Log("IOCTL_SO_ACCEPT", LogTypes::WII_IPC_NET); + ioctl.Log("IOCTL_SO_ACCEPT", LogTypes::IOS_NET); break; } default: @@ -315,7 +315,7 @@ void WiiSocket::Update(bool read, bool write, bool except) { char error_buffer[256] = ""; mbedtls_strerror(ret, error_buffer, sizeof(error_buffer)); - ERROR_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_DOHANDSHAKE: %s", error_buffer); + ERROR_LOG(IOS_SSL, "IOCTLV_NET_SSL_DOHANDSHAKE: %s", error_buffer); } switch (ret) { @@ -337,7 +337,7 @@ void WiiSocket::Update(bool read, bool write, bool except) char error_buffer[256] = ""; int res = mbedtls_ssl_get_verify_result(ctx); mbedtls_x509_crt_verify_info(error_buffer, sizeof(error_buffer), "", res); - ERROR_LOG(WII_IPC_SSL, "MBEDTLS_ERR_X509_CERT_VERIFY_FAILED (verify_result = %d): %s", + ERROR_LOG(IOS_SSL, "MBEDTLS_ERR_X509_CERT_VERIFY_FAILED (verify_result = %d): %s", res, error_buffer); if (res & MBEDTLS_X509_BADCERT_CN_MISMATCH) @@ -375,9 +375,9 @@ void WiiSocket::Update(bool read, bool write, bool except) } } - INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_DOHANDSHAKE = (%d) " - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " - "BufferOut: (%08x, %i), BufferOut2: (%08x, %i)", + INFO_LOG(IOS_SSL, "IOCTLV_NET_SSL_DOHANDSHAKE = (%d) " + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " + "BufferOut: (%08x, %i), BufferOut2: (%08x, %i)", ret, BufferIn, BufferInSize, BufferIn2, BufferInSize2, BufferOut, BufferOutSize, BufferOut2, BufferOutSize2); break; @@ -497,7 +497,7 @@ void WiiSocket::Update(bool read, bool write, bool except) ReturnValue = WiiSockMan::GetNetErrorCode(ret, "SO_SENDTO", true); DEBUG_LOG( - WII_IPC_NET, + IOS_NET, "%s = %d Socket: %08x, BufferIn: (%08x, %i), BufferIn2: (%08x, %i), %u.%u.%u.%u", has_destaddr ? "IOCTLV_SO_SENDTO " : "IOCTLV_SO_SEND ", ReturnValue, fd, BufferIn, BufferInSize, BufferIn2, BufferInSize2, local_name.sin_addr.s_addr & 0xFF, @@ -542,9 +542,9 @@ void WiiSocket::Update(bool read, bool write, bool except) ReturnValue = WiiSockMan::GetNetErrorCode(ret, BufferOutSize2 ? "SO_RECVFROM" : "SO_RECV", true); - INFO_LOG(WII_IPC_NET, "%s(%d, %p) Socket: %08X, Flags: %08X, " - "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " - "BufferOut: (%08x, %i), BufferOut2: (%08x, %i)", + INFO_LOG(IOS_NET, "%s(%d, %p) Socket: %08X, Flags: %08X, " + "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " + "BufferOut: (%08x, %i), BufferOut2: (%08x, %i)", BufferOutSize2 ? "IOCTLV_SO_RECVFROM " : "IOCTLV_SO_RECV ", ReturnValue, data, fd, flags, BufferIn, BufferInSize, BufferIn2, BufferInSize2, BufferOut, BufferOutSize, BufferOut2, BufferOutSize2); @@ -567,7 +567,7 @@ void WiiSocket::Update(bool read, bool write, bool except) ReturnValue != -SO_EALREADY) || (it->is_ssl && ReturnValue != SSL_ERR_WAGAIN && ReturnValue != SSL_ERR_RAGAIN)) { - DEBUG_LOG(WII_IPC_NET, + DEBUG_LOG(IOS_NET, "IOCTL(V) Sock: %08x ioctl/v: %d returned: %d nonBlock: %d forceNonBlock: %d", fd, it->is_ssl ? (int)it->ssl_type : (int)it->net_type, ReturnValue, nonBlock, forceNonBlock); diff --git a/Source/Core/Core/IOS/Network/Socket.h b/Source/Core/Core/IOS/Network/Socket.h index 0de19a59d9..b0db89bc3c 100644 --- a/Source/Core/Core/IOS/Network/Socket.h +++ b/Source/Core/Core/IOS/Network/Socket.h @@ -232,8 +232,8 @@ public: auto socket_entry = WiiSockets.find(sock); if (socket_entry == WiiSockets.end()) { - ERROR_LOG(WII_IPC_NET, "DoSock: Error, fd not found (%08x, %08X, %08X)", sock, - request.address, type); + ERROR_LOG(IOS_NET, "DoSock: Error, fd not found (%08x, %08X, %08X)", sock, request.address, + type); EnqueueReply(request, -SO_EBADF); } else diff --git a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp index 90ed9d632a..4d324795bc 100644 --- a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp +++ b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp @@ -60,16 +60,16 @@ void SDIOSlot0::OpenInternal() m_Card.Open(filename, "r+b"); if (!m_Card) { - WARN_LOG(WII_IPC_SD, "Failed to open SD Card image, trying to create a new 128MB image..."); + WARN_LOG(IOS_SD, "Failed to open SD Card image, trying to create a new 128MB image..."); if (SDCardCreate(128, filename)) { - INFO_LOG(WII_IPC_SD, "Successfully created %s", filename.c_str()); + INFO_LOG(IOS_SD, "Successfully created %s", filename.c_str()); m_Card.Open(filename, "r+b"); } if (!m_Card) { - ERROR_LOG(WII_IPC_SD, "Could not open SD Card image or create a new one, are you running " - "from a read-only directory?"); + ERROR_LOG(IOS_SD, "Could not open SD Card image or create a new one, are you running " + "from a read-only directory?"); } } } @@ -104,11 +104,11 @@ IPCCommandResult SDIOSlot0::IOCtl(const IOSIOCtlRequest& request) u32 reg = Memory::Read_U32(request.buffer_in); u32 val = Memory::Read_U32(request.buffer_in + 16); - INFO_LOG(WII_IPC_SD, "IOCTL_WRITEHCR 0x%08x - 0x%08x", reg, val); + INFO_LOG(IOS_SD, "IOCTL_WRITEHCR 0x%08x - 0x%08x", reg, val); if (reg >= m_registers.size()) { - WARN_LOG(WII_IPC_SD, "IOCTL_WRITEHCR out of range"); + WARN_LOG(IOS_SD, "IOCTL_WRITEHCR out of range"); break; } @@ -136,12 +136,12 @@ IPCCommandResult SDIOSlot0::IOCtl(const IOSIOCtlRequest& request) if (reg >= m_registers.size()) { - WARN_LOG(WII_IPC_SD, "IOCTL_READHCR out of range"); + WARN_LOG(IOS_SD, "IOCTL_READHCR out of range"); break; } u32 val = m_registers[reg]; - INFO_LOG(WII_IPC_SD, "IOCTL_READHCR 0x%08x - 0x%08x", reg, val); + INFO_LOG(IOS_SD, "IOCTL_READHCR 0x%08x - 0x%08x", reg, val); // Just reading the register Memory::Write_U32(val, request.buffer_out); @@ -149,7 +149,7 @@ IPCCommandResult SDIOSlot0::IOCtl(const IOSIOCtlRequest& request) break; case IOCTL_RESETCARD: - INFO_LOG(WII_IPC_SD, "IOCTL_RESETCARD"); + INFO_LOG(IOS_SD, "IOCTL_RESETCARD"); if (m_Card) m_Status |= CARD_INITIALIZED; // Returns 16bit RCA and 16bit 0s (meaning success) @@ -158,17 +158,17 @@ IPCCommandResult SDIOSlot0::IOCtl(const IOSIOCtlRequest& request) case IOCTL_SETCLK: { - INFO_LOG(WII_IPC_SD, "IOCTL_SETCLK"); + INFO_LOG(IOS_SD, "IOCTL_SETCLK"); // libogc only sets it to 1 and makes sure the return isn't negative... // one half of the sdclk divisor: a power of two or zero. u32 clock = Memory::Read_U32(request.buffer_in); if (clock != 1) - INFO_LOG(WII_IPC_SD, "Setting to %i, interesting", clock); + INFO_LOG(IOS_SD, "Setting to %i, interesting", clock); } break; case IOCTL_SENDCMD: - INFO_LOG(WII_IPC_SD, "IOCTL_SENDCMD %x IPC:%08x", Memory::Read_U32(request.buffer_in), + INFO_LOG(IOS_SD, "IOCTL_SENDCMD %x IPC:%08x", Memory::Read_U32(request.buffer_in), request.address); return_value = ExecuteCommand(request, request.buffer_in, request.buffer_in_size, 0, 0, request.buffer_out, request.buffer_out_size); @@ -179,19 +179,19 @@ IPCCommandResult SDIOSlot0::IOCtl(const IOSIOCtlRequest& request) m_Status |= CARD_INSERTED; else m_Status = CARD_NOT_EXIST; - INFO_LOG(WII_IPC_SD, "IOCTL_GETSTATUS. Replying that SD card is %s%s", + INFO_LOG(IOS_SD, "IOCTL_GETSTATUS. Replying that SD card is %s%s", (m_Status & CARD_INSERTED) ? "inserted" : "not present", (m_Status & CARD_INITIALIZED) ? " and initialized" : ""); Memory::Write_U32(m_Status, request.buffer_out); break; case IOCTL_GETOCR: - INFO_LOG(WII_IPC_SD, "IOCTL_GETOCR"); + INFO_LOG(IOS_SD, "IOCTL_GETOCR"); Memory::Write_U32(0x80ff8000, request.buffer_out); break; default: - ERROR_LOG(WII_IPC_SD, "Unknown SD IOCtl command (0x%08x)", request.request); + ERROR_LOG(IOS_SD, "Unknown SD IOCtl command (0x%08x)", request.request); break; } @@ -210,7 +210,7 @@ IPCCommandResult SDIOSlot0::IOCtlV(const IOSIOCtlVRequest& request) switch (request.request) { case IOCTLV_SENDCMD: - DEBUG_LOG(WII_IPC_SD, "IOCTLV_SENDCMD 0x%08x", Memory::Read_U32(request.in_vectors[0].address)); + DEBUG_LOG(IOS_SD, "IOCTLV_SENDCMD 0x%08x", Memory::Read_U32(request.in_vectors[0].address)); Memory::Memset(request.io_vectors[0].address, 0, request.io_vectors[0].size); return_value = ExecuteCommand(request, request.in_vectors[0].address, request.in_vectors[0].size, @@ -219,7 +219,7 @@ IPCCommandResult SDIOSlot0::IOCtlV(const IOSIOCtlVRequest& request) break; default: - ERROR_LOG(WII_IPC_SD, "Unknown SD IOCtlV command 0x%08x", request.request); + ERROR_LOG(IOS_SD, "Unknown SD IOCtlV command 0x%08x", request.request); } return GetDefaultReply(return_value); @@ -282,7 +282,7 @@ u32 SDIOSlot0::ExecuteCommand(const IOSRequest& request, u32 _BufferIn, u32 _Buf break; case SEND_CSD: - INFO_LOG(WII_IPC_SD, "SEND_CSD"); + INFO_LOG(IOS_SD, "SEND_CSD"); // shuffle2_, OCR: 0x80ff8000 CID: 0x38a00000 0x480032d5 0x3c608030 0x8803d420 // CSD: 0xff928040 0xc93efbcf 0x325f5a83 0x00002600 @@ -295,7 +295,7 @@ u32 SDIOSlot0::ExecuteCommand(const IOSRequest& request, u32 _BufferIn, u32 _Buf case ALL_SEND_CID: case SEND_CID: - INFO_LOG(WII_IPC_SD, "(ALL_)SEND_CID"); + INFO_LOG(IOS_SD, "(ALL_)SEND_CID"); Memory::Write_U32(0x80114d1c, _BufferOut); Memory::Write_U32(0x80080000, _BufferOut + 4); Memory::Write_U32(0x8007b520, _BufferOut + 8); @@ -328,7 +328,7 @@ u32 SDIOSlot0::ExecuteCommand(const IOSRequest& request, u32 _BufferIn, u32 _Buf { // Data address (req.arg) is in byte units in a Standard Capacity SD Memory Card // and in block (512 Byte) units in a High Capacity SD Memory Card. - INFO_LOG(WII_IPC_SD, "%sRead %i Block(s) from 0x%08x bsize %i into 0x%08x!", + INFO_LOG(IOS_SD, "%sRead %i Block(s) from 0x%08x bsize %i into 0x%08x!", req.isDMA ? "DMA " : "", req.blocks, req.arg, req.bsize, req.addr); if (m_Card) @@ -336,15 +336,15 @@ u32 SDIOSlot0::ExecuteCommand(const IOSRequest& request, u32 _BufferIn, u32 _Buf u32 size = req.bsize * req.blocks; if (!m_Card.Seek(req.arg, SEEK_SET)) - ERROR_LOG(WII_IPC_SD, "Seek failed WTF"); + ERROR_LOG(IOS_SD, "Seek failed WTF"); if (m_Card.ReadBytes(Memory::GetPointer(req.addr), size)) { - DEBUG_LOG(WII_IPC_SD, "Outbuffer size %i got %i", _rwBufferSize, size); + DEBUG_LOG(IOS_SD, "Outbuffer size %i got %i", _rwBufferSize, size); } else { - ERROR_LOG(WII_IPC_SD, "Read Failed - error: %i, eof: %i", ferror(m_Card.GetHandle()), + ERROR_LOG(IOS_SD, "Read Failed - error: %i, eof: %i", ferror(m_Card.GetHandle()), feof(m_Card.GetHandle())); ret = RET_FAIL; } @@ -357,7 +357,7 @@ u32 SDIOSlot0::ExecuteCommand(const IOSRequest& request, u32 _BufferIn, u32 _Buf { // Data address (req.arg) is in byte units in a Standard Capacity SD Memory Card // and in block (512 Byte) units in a High Capacity SD Memory Card. - INFO_LOG(WII_IPC_SD, "%sWrite %i Block(s) from 0x%08x bsize %i to offset 0x%08x!", + INFO_LOG(IOS_SD, "%sWrite %i Block(s) from 0x%08x bsize %i to offset 0x%08x!", req.isDMA ? "DMA " : "", req.blocks, req.addr, req.bsize, req.arg); if (m_Card && SConfig::GetInstance().bEnableMemcardSdWriting) @@ -365,11 +365,11 @@ u32 SDIOSlot0::ExecuteCommand(const IOSRequest& request, u32 _BufferIn, u32 _Buf u32 size = req.bsize * req.blocks; if (!m_Card.Seek(req.arg, SEEK_SET)) - ERROR_LOG(WII_IPC_SD, "fseeko failed WTF"); + ERROR_LOG(IOS_SD, "fseeko failed WTF"); if (!m_Card.WriteBytes(Memory::GetPointer(req.addr), size)) { - ERROR_LOG(WII_IPC_SD, "Write Failed - error: %i, eof: %i", ferror(m_Card.GetHandle()), + ERROR_LOG(IOS_SD, "Write Failed - error: %i, eof: %i", ferror(m_Card.GetHandle()), feof(m_Card.GetHandle())); ret = RET_FAIL; } @@ -379,7 +379,7 @@ u32 SDIOSlot0::ExecuteCommand(const IOSRequest& request, u32 _BufferIn, u32 _Buf break; case EVENT_REGISTER: // async - INFO_LOG(WII_IPC_SD, "Register event %x", req.arg); + INFO_LOG(IOS_SD, "Register event %x", req.arg); m_event = std::make_unique(static_cast(req.arg), request); ret = RET_EVENT_REGISTER; break; @@ -387,7 +387,7 @@ u32 SDIOSlot0::ExecuteCommand(const IOSRequest& request, u32 _BufferIn, u32 _Buf // Used to cancel an event that was already registered. case EVENT_UNREGISTER: { - INFO_LOG(WII_IPC_SD, "Unregister event %x", req.arg); + INFO_LOG(IOS_SD, "Unregister event %x", req.arg); if (!m_event) return IPC_EINVAL; // release returns 0 @@ -399,7 +399,7 @@ u32 SDIOSlot0::ExecuteCommand(const IOSRequest& request, u32 _BufferIn, u32 _Buf } default: - ERROR_LOG(WII_IPC_SD, "Unknown SD command 0x%08x", req.command); + ERROR_LOG(IOS_SD, "Unknown SD command 0x%08x", req.command); break; } diff --git a/Source/Core/Core/IOS/STM/STM.cpp b/Source/Core/Core/IOS/STM/STM.cpp index a74c0b9c57..abd2387366 100644 --- a/Source/Core/Core/IOS/STM/STM.cpp +++ b/Source/Core/Core/IOS/STM/STM.cpp @@ -32,7 +32,7 @@ IPCCommandResult STMImmediate::IOCtl(const IOSIOCtlRequest& request) { case IOCTL_STM_IDLE: case IOCTL_STM_SHUTDOWN: - NOTICE_LOG(WII_IPC_STM, "IOCTL_STM_IDLE or IOCTL_STM_SHUTDOWN received, shutting down"); + NOTICE_LOG(IOS_STM, "IOCTL_STM_IDLE or IOCTL_STM_SHUTDOWN received, shutting down"); Core::QueueHostJob(&Core::Stop, false); break; @@ -48,24 +48,24 @@ IPCCommandResult STMImmediate::IOCtl(const IOSIOCtlRequest& request) break; case IOCTL_STM_HOTRESET: - INFO_LOG(WII_IPC_STM, "%s - IOCtl:", GetDeviceName().c_str()); - INFO_LOG(WII_IPC_STM, " IOCTL_STM_HOTRESET"); + INFO_LOG(IOS_STM, "%s - IOCtl:", GetDeviceName().c_str()); + INFO_LOG(IOS_STM, " IOCTL_STM_HOTRESET"); break; case IOCTL_STM_VIDIMMING: // (Input: 20 bytes, Output: 20 bytes) - INFO_LOG(WII_IPC_STM, "%s - IOCtl:", GetDeviceName().c_str()); - INFO_LOG(WII_IPC_STM, " IOCTL_STM_VIDIMMING"); + INFO_LOG(IOS_STM, "%s - IOCtl:", GetDeviceName().c_str()); + INFO_LOG(IOS_STM, " IOCTL_STM_VIDIMMING"); // Memory::Write_U32(1, buffer_out); // return_value = 1; break; case IOCTL_STM_LEDMODE: // (Input: 20 bytes, Output: 20 bytes) - INFO_LOG(WII_IPC_STM, "%s - IOCtl:", GetDeviceName().c_str()); - INFO_LOG(WII_IPC_STM, " IOCTL_STM_LEDMODE"); + INFO_LOG(IOS_STM, "%s - IOCtl:", GetDeviceName().c_str()); + INFO_LOG(IOS_STM, " IOCTL_STM_LEDMODE"); break; default: - request.DumpUnknown(GetDeviceName(), LogTypes::WII_IPC_STM); + request.DumpUnknown(GetDeviceName(), LogTypes::IOS_STM); } return GetDefaultReply(return_value); diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp b/Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp index fb7d7566d1..ede3685820 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp @@ -31,11 +31,11 @@ void BackUpBTInfoSection(SysConf* sysconf) std::vector section(BT_INFO_SECTION_LENGTH); if (!sysconf->GetArrayData("BT.DINF", section.data(), static_cast(section.size()))) { - ERROR_LOG(WII_IPC_WIIMOTE, "Failed to read source BT.DINF section"); + ERROR_LOG(IOS_WIIMOTE, "Failed to read source BT.DINF section"); return; } if (!backup.WriteBytes(section.data(), section.size())) - ERROR_LOG(WII_IPC_WIIMOTE, "Failed to back up BT.DINF section"); + ERROR_LOG(IOS_WIIMOTE, "Failed to back up BT.DINF section"); } void RestoreBTInfoSection(SysConf* sysconf) @@ -47,7 +47,7 @@ void RestoreBTInfoSection(SysConf* sysconf) std::vector section(BT_INFO_SECTION_LENGTH); if (!backup.ReadBytes(section.data(), section.size())) { - ERROR_LOG(WII_IPC_WIIMOTE, "Failed to read backed up BT.DINF section"); + ERROR_LOG(IOS_WIIMOTE, "Failed to read backed up BT.DINF section"); return; } sysconf->SetArrayData("BT.DINF", section.data(), static_cast(section.size())); @@ -75,7 +75,7 @@ BluetoothBase::CtrlBuffer::CtrlBuffer(const IOSIOCtlVRequest& ioctlv) : ios_requ void BluetoothBase::CtrlBuffer::FillBuffer(const u8* src, const size_t size) const { - _assert_msg_(WII_IPC_WIIMOTE, size <= m_length, "FillBuffer: size %li > payload length %i", size, + _assert_msg_(IOS_WIIMOTE, size <= m_length, "FillBuffer: size %li > payload length %i", size, m_length); Memory::CopyToEmu(m_payload_addr, src, size); } diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp b/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp index 5e6b7a845d..cb1b2945a4 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp @@ -77,7 +77,7 @@ BluetoothEmu::BluetoothEmu(u32 device_id, const std::string& device_name) memcpy(BT_DINF.registered[i].name, wmName, 20); memcpy(BT_DINF.active[i].name, wmName, 20); - DEBUG_LOG(WII_IPC_WIIMOTE, "Wii Remote %d BT ID %x,%x,%x,%x,%x,%x", i, tmpBD.b[0], tmpBD.b[1], + DEBUG_LOG(IOS_WIIMOTE, "Wii Remote %d BT ID %x,%x,%x,%x,%x,%x", i, tmpBD.b[0], tmpBD.b[1], tmpBD.b[2], tmpBD.b[3], tmpBD.b[4], tmpBD.b[5]); m_WiiMotes.emplace_back(this, i, tmpBD, false); i++; @@ -188,8 +188,8 @@ IPCCommandResult BluetoothEmu::IOCtlV(const IOSIOCtlVRequest& request) const auto* acl_header = reinterpret_cast(Memory::GetPointer(ctrl.m_payload_addr)); - _dbg_assert_(WII_IPC_WIIMOTE, HCI_BC_FLAG(acl_header->con_handle) == HCI_POINT2POINT); - _dbg_assert_(WII_IPC_WIIMOTE, HCI_PB_FLAG(acl_header->con_handle) == HCI_PACKET_START); + _dbg_assert_(IOS_WIIMOTE, HCI_BC_FLAG(acl_header->con_handle) == HCI_POINT2POINT); + _dbg_assert_(IOS_WIIMOTE, HCI_PB_FLAG(acl_header->con_handle) == HCI_PACKET_START); SendToDevice(HCI_CON_HANDLE(acl_header->con_handle), Memory::GetPointer(ctrl.m_payload_addr + sizeof(hci_acldata_hdr_t)), @@ -199,12 +199,12 @@ IPCCommandResult BluetoothEmu::IOCtlV(const IOSIOCtlVRequest& request) case ACL_DATA_IN: // We are given an ACL buffer to fill { m_ACLEndpoint = std::make_unique(request); - DEBUG_LOG(WII_IPC_WIIMOTE, "ACL_DATA_IN: 0x%08x ", request.address); + DEBUG_LOG(IOS_WIIMOTE, "ACL_DATA_IN: 0x%08x ", request.address); send_reply = false; break; } default: - _dbg_assert_msg_(WII_IPC_WIIMOTE, 0, "Unknown USBV0_IOCTL_BLKMSG: %x", ctrl.m_endpoint); + _dbg_assert_msg_(IOS_WIIMOTE, 0, "Unknown USBV0_IOCTL_BLKMSG: %x", ctrl.m_endpoint); } break; } @@ -215,18 +215,18 @@ IPCCommandResult BluetoothEmu::IOCtlV(const IOSIOCtlVRequest& request) if (ctrl.m_endpoint == HCI_EVENT) // We are given a HCI buffer to fill { m_HCIEndpoint = std::make_unique(request); - DEBUG_LOG(WII_IPC_WIIMOTE, "HCI_EVENT: 0x%08x ", request.address); + DEBUG_LOG(IOS_WIIMOTE, "HCI_EVENT: 0x%08x ", request.address); send_reply = false; } else { - _dbg_assert_msg_(WII_IPC_WIIMOTE, 0, "Unknown USBV0_IOCTL_INTRMSG: %x", ctrl.m_endpoint); + _dbg_assert_msg_(IOS_WIIMOTE, 0, "Unknown USBV0_IOCTL_INTRMSG: %x", ctrl.m_endpoint); } break; } default: - request.DumpUnknown(GetDeviceName(), LogTypes::WII_IPC_WIIMOTE); + request.DumpUnknown(GetDeviceName(), LogTypes::IOS_WIIMOTE); } return send_reply ? GetDefaultReply(IPC_SUCCESS) : GetNoReply(); @@ -239,7 +239,7 @@ void BluetoothEmu::SendToDevice(u16 _ConnectionHandle, u8* _pData, u32 _Size) if (pWiiMote == nullptr) return; - DEBUG_LOG(WII_IPC_WIIMOTE, "Send ACL Packet to ConnectionHandle 0x%04x", _ConnectionHandle); + DEBUG_LOG(IOS_WIIMOTE, "Send ACL Packet to ConnectionHandle 0x%04x", _ConnectionHandle); IncDataPacket(_ConnectionHandle); pWiiMote->ExecuteL2capCmd(_pData, _Size); } @@ -253,11 +253,11 @@ void BluetoothEmu::IncDataPacket(u16 _ConnectionHandle) // The header is for example 07 00 41 00 which means size 0x0007 and channel 0x0041. void BluetoothEmu::SendACLPacket(u16 connection_handle, const u8* data, u32 size) { - DEBUG_LOG(WII_IPC_WIIMOTE, "ACL packet from %x ready to send to stack...", connection_handle); + DEBUG_LOG(IOS_WIIMOTE, "ACL packet from %x ready to send to stack...", connection_handle); if (m_ACLEndpoint && !m_HCIEndpoint && m_EventQueue.empty()) { - DEBUG_LOG(WII_IPC_WIIMOTE, "ACL endpoint valid, sending packet to %08x", + DEBUG_LOG(IOS_WIIMOTE, "ACL endpoint valid, sending packet to %08x", m_ACLEndpoint->ios_request.address); hci_acldata_hdr_t* header = @@ -273,7 +273,7 @@ void BluetoothEmu::SendACLPacket(u16 connection_handle, const u8* data, u32 size } else { - DEBUG_LOG(WII_IPC_WIIMOTE, "ACL endpoint not currently valid, queuing..."); + DEBUG_LOG(IOS_WIIMOTE, "ACL endpoint not currently valid, queuing..."); m_acl_pool.Store(data, size, connection_handle); } } @@ -281,18 +281,17 @@ void BluetoothEmu::SendACLPacket(u16 connection_handle, const u8* data, u32 size // These messages are sent from the Wii Remote to the game, for example RequestConnection() // or ConnectionComplete(). // -// Our WII_IPC_HLE is so efficient that we could fill the buffer immediately +// Our IOS is so efficient that we could fill the buffer immediately // rather than enqueue it to some other memory and this will do good for StateSave void BluetoothEmu::AddEventToQueue(const SQueuedEvent& _event) { - DEBUG_LOG(WII_IPC_WIIMOTE, "HCI event %x completed...", - ((hci_event_hdr_t*)_event.m_buffer)->event); + DEBUG_LOG(IOS_WIIMOTE, "HCI event %x completed...", ((hci_event_hdr_t*)_event.m_buffer)->event); if (m_HCIEndpoint) { if (m_EventQueue.empty()) // fast path :) { - DEBUG_LOG(WII_IPC_WIIMOTE, "HCI endpoint valid, sending packet to %08x", + DEBUG_LOG(IOS_WIIMOTE, "HCI endpoint valid, sending packet to %08x", m_HCIEndpoint->ios_request.address); m_HCIEndpoint->FillBuffer(_event.m_buffer, _event.m_size); @@ -302,12 +301,12 @@ void BluetoothEmu::AddEventToQueue(const SQueuedEvent& _event) } else // push new one, pop oldest { - DEBUG_LOG(WII_IPC_WIIMOTE, "HCI endpoint not currently valid, queueing (%zu)...", + DEBUG_LOG(IOS_WIIMOTE, "HCI endpoint not currently valid, queueing (%zu)...", m_EventQueue.size()); m_EventQueue.push_back(_event); const SQueuedEvent& event = m_EventQueue.front(); - DEBUG_LOG(WII_IPC_WIIMOTE, "HCI event %x " - "being written from queue (%zu) to %08x...", + DEBUG_LOG(IOS_WIIMOTE, "HCI event %x " + "being written from queue (%zu) to %08x...", ((hci_event_hdr_t*)event.m_buffer)->event, m_EventQueue.size() - 1, m_HCIEndpoint->ios_request.address); m_HCIEndpoint->FillBuffer(event.m_buffer, event.m_size); @@ -320,7 +319,7 @@ void BluetoothEmu::AddEventToQueue(const SQueuedEvent& _event) } else { - DEBUG_LOG(WII_IPC_WIIMOTE, "HCI endpoint not currently valid, queuing (%zu)...", + DEBUG_LOG(IOS_WIIMOTE, "HCI endpoint not currently valid, queuing (%zu)...", m_EventQueue.size()); m_EventQueue.push_back(_event); } @@ -333,7 +332,7 @@ void BluetoothEmu::Update() { // an endpoint has become available, and we have a stored response. const SQueuedEvent& event = m_EventQueue.front(); - DEBUG_LOG(WII_IPC_WIIMOTE, "HCI event %x being written from queue (%zu) to %08x...", + DEBUG_LOG(IOS_WIIMOTE, "HCI event %x being written from queue (%zu) to %08x...", ((hci_event_hdr_t*)event.m_buffer)->event, m_EventQueue.size() - 1, m_HCIEndpoint->ios_request.address); m_HCIEndpoint->FillBuffer(event.m_buffer, event.m_size); @@ -399,11 +398,11 @@ void BluetoothEmu::ACLPool::Store(const u8* data, const u16 size, const u16 conn if (m_queue.size() >= 100) { // Many simultaneous exchanges of ACL packets tend to cause the queue to fill up. - ERROR_LOG(WII_IPC_WIIMOTE, "ACL queue size reached 100 - current packet will be dropped!"); + ERROR_LOG(IOS_WIIMOTE, "ACL queue size reached 100 - current packet will be dropped!"); return; } - _dbg_assert_msg_(WII_IPC_WIIMOTE, size < ACL_PKT_SIZE, "ACL packet too large for pool"); + _dbg_assert_msg_(IOS_WIIMOTE, size < ACL_PKT_SIZE, "ACL packet too large for pool"); m_queue.push_back(Packet()); auto& packet = m_queue.back(); @@ -421,8 +420,8 @@ void BluetoothEmu::ACLPool::WriteToEndpoint(CtrlBuffer& endpoint) const u16 size = packet.size; const u16 conn_handle = packet.conn_handle; - DEBUG_LOG(WII_IPC_WIIMOTE, "ACL packet being written from " - "queue to %08x", + DEBUG_LOG(IOS_WIIMOTE, "ACL packet being written from " + "queue to %08x", endpoint.ios_request.address); hci_acldata_hdr_t* pHeader = (hci_acldata_hdr_t*)Memory::GetPointer(endpoint.m_payload_addr); @@ -448,7 +447,7 @@ bool BluetoothEmu::SendEventInquiryComplete() AddEventToQueue(Event); - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: Inquiry complete"); + DEBUG_LOG(IOS_WIIMOTE, "Event: Inquiry complete"); return true; } @@ -458,9 +457,9 @@ bool BluetoothEmu::SendEventInquiryResponse() if (m_WiiMotes.empty()) return false; - _dbg_assert_(WII_IPC_WIIMOTE, sizeof(SHCIEventInquiryResult) - 2 + - (m_WiiMotes.size() * sizeof(hci_inquiry_response)) < - 256); + _dbg_assert_(IOS_WIIMOTE, sizeof(SHCIEventInquiryResult) - 2 + + (m_WiiMotes.size() * sizeof(hci_inquiry_response)) < + 256); SQueuedEvent Event(static_cast(sizeof(SHCIEventInquiryResult) + m_WiiMotes.size() * sizeof(hci_inquiry_response)), @@ -492,8 +491,8 @@ bool BluetoothEmu::SendEventInquiryResponse() pResponse->page_scan_mode = 0; pResponse->clock_offset = 0x3818; - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: Send Fake Inquiry of one controller"); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", pResponse->bdaddr.b[0], + DEBUG_LOG(IOS_WIIMOTE, "Event: Send Fake Inquiry of one controller"); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", pResponse->bdaddr.b[0], pResponse->bdaddr.b[1], pResponse->bdaddr.b[2], pResponse->bdaddr.b[3], pResponse->bdaddr.b[4], pResponse->bdaddr.b[5]); } @@ -533,14 +532,14 @@ bool BluetoothEmu::SendEventConnectionComplete(const bdaddr_t& _bd) {"HCI_LINK_eSCO 0x02 - eSCO"}, }; - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventConnectionComplete"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pConnectionComplete->Connection_Handle); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", - pConnectionComplete->bdaddr.b[0], pConnectionComplete->bdaddr.b[1], - pConnectionComplete->bdaddr.b[2], pConnectionComplete->bdaddr.b[3], - pConnectionComplete->bdaddr.b[4], pConnectionComplete->bdaddr.b[5]); - DEBUG_LOG(WII_IPC_WIIMOTE, " LinkType: %s", s_szLinkType[pConnectionComplete->LinkType]); - DEBUG_LOG(WII_IPC_WIIMOTE, " EncryptionEnabled: %i", pConnectionComplete->EncryptionEnabled); + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventConnectionComplete"); + DEBUG_LOG(IOS_WIIMOTE, " Connection_Handle: 0x%04x", pConnectionComplete->Connection_Handle); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", pConnectionComplete->bdaddr.b[0], + pConnectionComplete->bdaddr.b[1], pConnectionComplete->bdaddr.b[2], + pConnectionComplete->bdaddr.b[3], pConnectionComplete->bdaddr.b[4], + pConnectionComplete->bdaddr.b[5]); + DEBUG_LOG(IOS_WIIMOTE, " LinkType: %s", s_szLinkType[pConnectionComplete->LinkType]); + DEBUG_LOG(IOS_WIIMOTE, " EncryptionEnabled: %i", pConnectionComplete->EncryptionEnabled); return true; } @@ -568,15 +567,15 @@ bool BluetoothEmu::SendEventRequestConnection(WiimoteDevice& _rWiiMote) {"HCI_LINK_eSCO 0x02 - eSCO"}, }; - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventRequestConnection"); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventRequestConnection"); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", pEventRequestConnection->bdaddr.b[0], pEventRequestConnection->bdaddr.b[1], pEventRequestConnection->bdaddr.b[2], pEventRequestConnection->bdaddr.b[3], pEventRequestConnection->bdaddr.b[4], pEventRequestConnection->bdaddr.b[5]); - DEBUG_LOG(WII_IPC_WIIMOTE, " COD[0]: 0x%02x", pEventRequestConnection->uclass[0]); - DEBUG_LOG(WII_IPC_WIIMOTE, " COD[1]: 0x%02x", pEventRequestConnection->uclass[1]); - DEBUG_LOG(WII_IPC_WIIMOTE, " COD[2]: 0x%02x", pEventRequestConnection->uclass[2]); - DEBUG_LOG(WII_IPC_WIIMOTE, " LinkType: %s", LinkType[pEventRequestConnection->LinkType]); + DEBUG_LOG(IOS_WIIMOTE, " COD[0]: 0x%02x", pEventRequestConnection->uclass[0]); + DEBUG_LOG(IOS_WIIMOTE, " COD[1]: 0x%02x", pEventRequestConnection->uclass[1]); + DEBUG_LOG(IOS_WIIMOTE, " COD[2]: 0x%02x", pEventRequestConnection->uclass[2]); + DEBUG_LOG(IOS_WIIMOTE, " LinkType: %s", LinkType[pEventRequestConnection->LinkType]); return true; } @@ -598,9 +597,9 @@ bool BluetoothEmu::SendEventDisconnect(u16 _connectionHandle, u8 _Reason) AddEventToQueue(Event); - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventDisconnect"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pDisconnect->Connection_Handle); - DEBUG_LOG(WII_IPC_WIIMOTE, " Reason: 0x%02x", pDisconnect->Reason); + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventDisconnect"); + DEBUG_LOG(IOS_WIIMOTE, " Connection_Handle: 0x%04x", pDisconnect->Connection_Handle); + DEBUG_LOG(IOS_WIIMOTE, " Reason: 0x%02x", pDisconnect->Reason); return true; } @@ -620,8 +619,8 @@ bool BluetoothEmu::SendEventAuthenticationCompleted(u16 _connectionHandle) pEventAuthenticationCompleted->EventStatus = 0; pEventAuthenticationCompleted->Connection_Handle = _connectionHandle; - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventAuthenticationCompleted"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventAuthenticationCompleted"); + DEBUG_LOG(IOS_WIIMOTE, " Connection_Handle: 0x%04x", pEventAuthenticationCompleted->Connection_Handle); AddEventToQueue(Event); @@ -645,11 +644,11 @@ bool BluetoothEmu::SendEventRemoteNameReq(const bdaddr_t& _bd) pRemoteNameReq->bdaddr = _bd; strcpy((char*)pRemoteNameReq->RemoteName, pWiiMote->GetName()); - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventRemoteNameReq"); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", pRemoteNameReq->bdaddr.b[0], + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventRemoteNameReq"); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", pRemoteNameReq->bdaddr.b[0], pRemoteNameReq->bdaddr.b[1], pRemoteNameReq->bdaddr.b[2], pRemoteNameReq->bdaddr.b[3], pRemoteNameReq->bdaddr.b[4], pRemoteNameReq->bdaddr.b[5]); - DEBUG_LOG(WII_IPC_WIIMOTE, " RemoteName: %s", pRemoteNameReq->RemoteName); + DEBUG_LOG(IOS_WIIMOTE, " RemoteName: %s", pRemoteNameReq->RemoteName); AddEventToQueue(Event); @@ -679,9 +678,9 @@ bool BluetoothEmu::SendEventReadRemoteFeatures(u16 _connectionHandle) pReadRemoteFeatures->features[6] = pWiiMote->GetFeatures()[6]; pReadRemoteFeatures->features[7] = pWiiMote->GetFeatures()[7]; - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventReadRemoteFeatures"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pReadRemoteFeatures->ConnectionHandle); - DEBUG_LOG(WII_IPC_WIIMOTE, " features: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventReadRemoteFeatures"); + DEBUG_LOG(IOS_WIIMOTE, " Connection_Handle: 0x%04x", pReadRemoteFeatures->ConnectionHandle); + DEBUG_LOG(IOS_WIIMOTE, " features: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", pReadRemoteFeatures->features[0], pReadRemoteFeatures->features[1], pReadRemoteFeatures->features[2], pReadRemoteFeatures->features[3], pReadRemoteFeatures->features[4], pReadRemoteFeatures->features[5], @@ -709,11 +708,11 @@ bool BluetoothEmu::SendEventReadRemoteVerInfo(u16 _connectionHandle) pReadRemoteVerInfo->manufacturer = pWiiMote->GetManufactorID(); pReadRemoteVerInfo->lmp_subversion = pWiiMote->GetLMPSubVersion(); - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventReadRemoteVerInfo"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pReadRemoteVerInfo->ConnectionHandle); - DEBUG_LOG(WII_IPC_WIIMOTE, " lmp_version: 0x%02x", pReadRemoteVerInfo->lmp_version); - DEBUG_LOG(WII_IPC_WIIMOTE, " manufacturer: 0x%04x", pReadRemoteVerInfo->manufacturer); - DEBUG_LOG(WII_IPC_WIIMOTE, " lmp_subversion: 0x%04x", pReadRemoteVerInfo->lmp_subversion); + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventReadRemoteVerInfo"); + DEBUG_LOG(IOS_WIIMOTE, " Connection_Handle: 0x%04x", pReadRemoteVerInfo->ConnectionHandle); + DEBUG_LOG(IOS_WIIMOTE, " lmp_version: 0x%02x", pReadRemoteVerInfo->lmp_version); + DEBUG_LOG(IOS_WIIMOTE, " manufacturer: 0x%04x", pReadRemoteVerInfo->manufacturer); + DEBUG_LOG(IOS_WIIMOTE, " lmp_subversion: 0x%04x", pReadRemoteVerInfo->lmp_subversion); AddEventToQueue(Event); @@ -722,7 +721,7 @@ bool BluetoothEmu::SendEventReadRemoteVerInfo(u16 _connectionHandle) void BluetoothEmu::SendEventCommandComplete(u16 opcode, const void* data, u32 data_size) { - _dbg_assert_(WII_IPC_WIIMOTE, (sizeof(SHCIEventCommand) - 2 + data_size) < 256); + _dbg_assert_(IOS_WIIMOTE, (sizeof(SHCIEventCommand) - 2 + data_size) < 256); SQueuedEvent event(sizeof(SHCIEventCommand) + data_size, 0); @@ -739,7 +738,7 @@ void BluetoothEmu::SendEventCommandComplete(u16 opcode, const void* data, u32 da memcpy(payload, data, data_size); } - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: Command Complete (Opcode: 0x%04x)", hci_event->Opcode); + DEBUG_LOG(IOS_WIIMOTE, "Event: Command Complete (Opcode: 0x%04x)", hci_event->Opcode); AddEventToQueue(event); } @@ -755,7 +754,7 @@ bool BluetoothEmu::SendEventCommandStatus(u16 _Opcode) pHCIEvent->PacketIndicator = 0x01; pHCIEvent->Opcode = _Opcode; - INFO_LOG(WII_IPC_WIIMOTE, "Event: Command Status (Opcode: 0x%04x)", pHCIEvent->Opcode); + INFO_LOG(IOS_WIIMOTE, "Event: Command Status (Opcode: 0x%04x)", pHCIEvent->Opcode); AddEventToQueue(Event); @@ -780,11 +779,11 @@ bool BluetoothEmu::SendEventRoleChange(bdaddr_t _bd, bool _master) AddEventToQueue(Event); - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventRoleChange"); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", pRoleChange->bdaddr.b[0], + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventRoleChange"); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", pRoleChange->bdaddr.b[0], pRoleChange->bdaddr.b[1], pRoleChange->bdaddr.b[2], pRoleChange->bdaddr.b[3], pRoleChange->bdaddr.b[4], pRoleChange->bdaddr.b[5]); - DEBUG_LOG(WII_IPC_WIIMOTE, " NewRole: %i", pRoleChange->NewRole); + DEBUG_LOG(IOS_WIIMOTE, " NewRole: %i", pRoleChange->NewRole); return true; } @@ -795,7 +794,7 @@ bool BluetoothEmu::SendEventNumberOfCompletedPackets() (sizeof(hci_num_compl_pkts_info) * m_WiiMotes.size())), 0); - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventNumberOfCompletedPackets"); + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventNumberOfCompletedPackets"); hci_event_hdr_t* event_hdr = (hci_event_hdr_t*)Event.m_buffer; hci_num_compl_pkts_ep* event = (hci_num_compl_pkts_ep*)((u8*)event_hdr + sizeof(hci_event_hdr_t)); @@ -815,8 +814,8 @@ bool BluetoothEmu::SendEventNumberOfCompletedPackets() info->compl_pkts = m_PacketCount[i]; info->con_handle = m_WiiMotes[i].GetConnectionHandle(); - DEBUG_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", info->con_handle); - DEBUG_LOG(WII_IPC_WIIMOTE, " Number_Of_Completed_Packets: %i", info->compl_pkts); + DEBUG_LOG(IOS_WIIMOTE, " Connection_Handle: 0x%04x", info->con_handle); + DEBUG_LOG(IOS_WIIMOTE, " Number_Of_Completed_Packets: %i", info->compl_pkts); acc += info->compl_pkts; m_PacketCount[i] = 0; @@ -829,7 +828,7 @@ bool BluetoothEmu::SendEventNumberOfCompletedPackets() } else { - DEBUG_LOG(WII_IPC_WIIMOTE, "SendEventNumberOfCompletedPackets: no packets; no event"); + DEBUG_LOG(IOS_WIIMOTE, "SendEventNumberOfCompletedPackets: no packets; no event"); } return true; @@ -851,9 +850,9 @@ bool BluetoothEmu::SendEventModeChange(u16 _connectionHandle, u8 _mode, u16 _val pModeChange->CurrentMode = _mode; pModeChange->Value = _value; - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventModeChange"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pModeChange->Connection_Handle); - DEBUG_LOG(WII_IPC_WIIMOTE, " Current Mode: 0x%02x", pModeChange->CurrentMode = _mode); + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventModeChange"); + DEBUG_LOG(IOS_WIIMOTE, " Connection_Handle: 0x%04x", pModeChange->Connection_Handle); + DEBUG_LOG(IOS_WIIMOTE, " Current Mode: 0x%02x", pModeChange->CurrentMode = _mode); AddEventToQueue(Event); @@ -866,7 +865,7 @@ bool BluetoothEmu::SendEventLinkKeyNotification(const u8 num_to_send) SQueuedEvent Event(2 + payload_length, 0); SHCIEventLinkKeyNotification* pEventLinkKey = (SHCIEventLinkKeyNotification*)Event.m_buffer; - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventLinkKeyNotification"); + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventLinkKeyNotification"); // event header pEventLinkKey->EventType = HCI_EVENT_RETURN_LINK_KEYS; @@ -883,7 +882,7 @@ bool BluetoothEmu::SendEventLinkKeyNotification(const u8 num_to_send) link_key_info->bdaddr = m_WiiMotes[i].GetBD(); memcpy(link_key_info->key, m_WiiMotes[i].GetLinkKey(), HCI_KEY_SIZE); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", link_key_info->bdaddr.b[0], + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", link_key_info->bdaddr.b[0], link_key_info->bdaddr.b[1], link_key_info->bdaddr.b[2], link_key_info->bdaddr.b[3], link_key_info->bdaddr.b[4], link_key_info->bdaddr.b[5]); } @@ -903,11 +902,11 @@ bool BluetoothEmu::SendEventRequestLinkKey(const bdaddr_t& _bd) pEventRequestLinkKey->PayloadLength = sizeof(SHCIEventRequestLinkKey) - 2; pEventRequestLinkKey->bdaddr = _bd; - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventRequestLinkKey"); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", - pEventRequestLinkKey->bdaddr.b[0], pEventRequestLinkKey->bdaddr.b[1], - pEventRequestLinkKey->bdaddr.b[2], pEventRequestLinkKey->bdaddr.b[3], - pEventRequestLinkKey->bdaddr.b[4], pEventRequestLinkKey->bdaddr.b[5]); + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventRequestLinkKey"); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", pEventRequestLinkKey->bdaddr.b[0], + pEventRequestLinkKey->bdaddr.b[1], pEventRequestLinkKey->bdaddr.b[2], + pEventRequestLinkKey->bdaddr.b[3], pEventRequestLinkKey->bdaddr.b[4], + pEventRequestLinkKey->bdaddr.b[5]); AddEventToQueue(Event); @@ -930,10 +929,9 @@ bool BluetoothEmu::SendEventReadClockOffsetComplete(u16 _connectionHandle) pReadClockOffsetComplete->ConnectionHandle = _connectionHandle; pReadClockOffsetComplete->ClockOffset = 0x3818; - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventReadClockOffsetComplete"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", - pReadClockOffsetComplete->ConnectionHandle); - DEBUG_LOG(WII_IPC_WIIMOTE, " ClockOffset: 0x%04x", pReadClockOffsetComplete->ClockOffset); + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventReadClockOffsetComplete"); + DEBUG_LOG(IOS_WIIMOTE, " Connection_Handle: 0x%04x", pReadClockOffsetComplete->ConnectionHandle); + DEBUG_LOG(IOS_WIIMOTE, " ClockOffset: 0x%04x", pReadClockOffsetComplete->ClockOffset); AddEventToQueue(Event); @@ -956,9 +954,9 @@ bool BluetoothEmu::SendEventConPacketTypeChange(u16 _connectionHandle, u16 _pack pChangeConPacketType->ConnectionHandle = _connectionHandle; pChangeConPacketType->PacketType = _packetType; - DEBUG_LOG(WII_IPC_WIIMOTE, "Event: SendEventConPacketTypeChange"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pChangeConPacketType->ConnectionHandle); - DEBUG_LOG(WII_IPC_WIIMOTE, " PacketType: 0x%04x", pChangeConPacketType->PacketType); + DEBUG_LOG(IOS_WIIMOTE, "Event: SendEventConPacketTypeChange"); + DEBUG_LOG(IOS_WIIMOTE, " Connection_Handle: 0x%04x", pChangeConPacketType->ConnectionHandle); + DEBUG_LOG(IOS_WIIMOTE, " PacketType: 0x%04x", pChangeConPacketType->PacketType); AddEventToQueue(Event); @@ -975,8 +973,8 @@ void BluetoothEmu::ExecuteHCICommandMessage(const CtrlMessage& ctrl_message) u16 ocf = HCI_OCF(pMsg->Opcode); u16 ogf = HCI_OGF(pMsg->Opcode); - DEBUG_LOG(WII_IPC_WIIMOTE, "**************************************************"); - DEBUG_LOG(WII_IPC_WIIMOTE, "Execute HCI Command: 0x%04x (ocf: 0x%02x, ogf: 0x%02x)", pMsg->Opcode, + DEBUG_LOG(IOS_WIIMOTE, "**************************************************"); + DEBUG_LOG(IOS_WIIMOTE, "Execute HCI Command: 0x%04x (ocf: 0x%02x, ogf: 0x%02x)", pMsg->Opcode, ocf, ogf); switch (pMsg->Opcode) @@ -1131,17 +1129,16 @@ void BluetoothEmu::ExecuteHCICommandMessage(const CtrlMessage& ctrl_message) if (ogf == HCI_OGF_VENDOR) { - ERROR_LOG(WII_IPC_WIIMOTE, "Command: vendor specific: 0x%04X (ocf: 0x%x)", pMsg->Opcode, ocf); + ERROR_LOG(IOS_WIIMOTE, "Command: vendor specific: 0x%04X (ocf: 0x%x)", pMsg->Opcode, ocf); for (int i = 0; i < pMsg->len; i++) { - ERROR_LOG(WII_IPC_WIIMOTE, " 0x02%x", pInput[i]); + ERROR_LOG(IOS_WIIMOTE, " 0x02%x", pInput[i]); } } else { - _dbg_assert_msg_(WII_IPC_WIIMOTE, 0, - "Unknown USB_IOCTL_CTRLMSG: 0x%04X (ocf: 0x%x ogf 0x%x)", pMsg->Opcode, ocf, - ogf); + _dbg_assert_msg_(IOS_WIIMOTE, 0, "Unknown USB_IOCTL_CTRLMSG: 0x%04X (ocf: 0x%x ogf 0x%x)", + pMsg->Opcode, ocf, ogf); } break; } @@ -1160,13 +1157,13 @@ void BluetoothEmu::CommandInquiry(const u8* input) // Inquiry should not be called normally const hci_inquiry_cp* inquiry = reinterpret_cast(input); - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_INQUIRY:"); - DEBUG_LOG(WII_IPC_WIIMOTE, "write:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " LAP[0]: 0x%02x", inquiry->lap[0]); - DEBUG_LOG(WII_IPC_WIIMOTE, " LAP[1]: 0x%02x", inquiry->lap[1]); - DEBUG_LOG(WII_IPC_WIIMOTE, " LAP[2]: 0x%02x", inquiry->lap[2]); - DEBUG_LOG(WII_IPC_WIIMOTE, " inquiry_length: %i (N x 1.28) sec", inquiry->inquiry_length); - DEBUG_LOG(WII_IPC_WIIMOTE, " num_responses: %i (N x 1.28) sec", inquiry->num_responses); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_INQUIRY:"); + DEBUG_LOG(IOS_WIIMOTE, "write:"); + DEBUG_LOG(IOS_WIIMOTE, " LAP[0]: 0x%02x", inquiry->lap[0]); + DEBUG_LOG(IOS_WIIMOTE, " LAP[1]: 0x%02x", inquiry->lap[1]); + DEBUG_LOG(IOS_WIIMOTE, " LAP[2]: 0x%02x", inquiry->lap[2]); + DEBUG_LOG(IOS_WIIMOTE, " inquiry_length: %i (N x 1.28) sec", inquiry->inquiry_length); + DEBUG_LOG(IOS_WIIMOTE, " num_responses: %i (N x 1.28) sec", inquiry->num_responses); SendEventCommandStatus(HCI_CMD_INQUIRY); SendEventInquiryResponse(); @@ -1178,7 +1175,7 @@ void BluetoothEmu::CommandInquiryCancel(const u8* input) hci_inquiry_cancel_rp reply; reply.status = 0x00; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_INQUIRY_CANCEL"); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_INQUIRY_CANCEL"); SendEventCommandComplete(HCI_CMD_INQUIRY_CANCEL, &reply, sizeof(hci_inquiry_cancel_rp)); } @@ -1187,18 +1184,18 @@ void BluetoothEmu::CommandCreateCon(const u8* input) { const hci_create_con_cp* create_connection = reinterpret_cast(input); - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_CREATE_CON"); - DEBUG_LOG(WII_IPC_WIIMOTE, "Input:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", create_connection->bdaddr.b[0], + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_CREATE_CON"); + DEBUG_LOG(IOS_WIIMOTE, "Input:"); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", create_connection->bdaddr.b[0], create_connection->bdaddr.b[1], create_connection->bdaddr.b[2], create_connection->bdaddr.b[3], create_connection->bdaddr.b[4], create_connection->bdaddr.b[5]); - DEBUG_LOG(WII_IPC_WIIMOTE, " pkt_type: %i", create_connection->pkt_type); - DEBUG_LOG(WII_IPC_WIIMOTE, " page_scan_rep_mode: %i", create_connection->page_scan_rep_mode); - DEBUG_LOG(WII_IPC_WIIMOTE, " page_scan_mode: %i", create_connection->page_scan_mode); - DEBUG_LOG(WII_IPC_WIIMOTE, " clock_offset: %i", create_connection->clock_offset); - DEBUG_LOG(WII_IPC_WIIMOTE, " accept_role_switch: %i", create_connection->accept_role_switch); + DEBUG_LOG(IOS_WIIMOTE, " pkt_type: %i", create_connection->pkt_type); + DEBUG_LOG(IOS_WIIMOTE, " page_scan_rep_mode: %i", create_connection->page_scan_rep_mode); + DEBUG_LOG(IOS_WIIMOTE, " page_scan_mode: %i", create_connection->page_scan_mode); + DEBUG_LOG(IOS_WIIMOTE, " clock_offset: %i", create_connection->clock_offset); + DEBUG_LOG(IOS_WIIMOTE, " accept_role_switch: %i", create_connection->accept_role_switch); SendEventCommandStatus(HCI_CMD_CREATE_CON); SendEventConnectionComplete(create_connection->bdaddr); @@ -1208,9 +1205,9 @@ void BluetoothEmu::CommandDisconnect(const u8* input) { const hci_discon_cp* disconnect = reinterpret_cast(input); - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_DISCONNECT"); - DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", disconnect->con_handle); - DEBUG_LOG(WII_IPC_WIIMOTE, " Reason: 0x%02x", disconnect->reason); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_DISCONNECT"); + DEBUG_LOG(IOS_WIIMOTE, " ConnectionHandle: 0x%04x", disconnect->con_handle); + DEBUG_LOG(IOS_WIIMOTE, " Reason: 0x%02x", disconnect->reason); Host_SetWiiMoteConnectionState(0); DisplayDisconnectMessage((disconnect->con_handle & 0xFF) + 1, disconnect->reason); @@ -1231,12 +1228,12 @@ void BluetoothEmu::CommandAcceptCon(const u8* input) {"Master (0x00)"}, {"Slave (0x01)"}, }; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_ACCEPT_CON"); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", accept_connection->bdaddr.b[0], + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_ACCEPT_CON"); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", accept_connection->bdaddr.b[0], accept_connection->bdaddr.b[1], accept_connection->bdaddr.b[2], accept_connection->bdaddr.b[3], accept_connection->bdaddr.b[4], accept_connection->bdaddr.b[5]); - DEBUG_LOG(WII_IPC_WIIMOTE, " role: %s", roles[accept_connection->role]); + DEBUG_LOG(IOS_WIIMOTE, " role: %s", roles[accept_connection->role]); SendEventCommandStatus(HCI_CMD_ACCEPT_CON); @@ -1253,8 +1250,8 @@ void BluetoothEmu::CommandLinkKeyRep(const u8* input) { const hci_link_key_rep_cp* key_rep = reinterpret_cast(input); - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_LINK_KEY_REP"); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", key_rep->bdaddr.b[0], + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_LINK_KEY_REP"); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", key_rep->bdaddr.b[0], key_rep->bdaddr.b[1], key_rep->bdaddr.b[2], key_rep->bdaddr.b[3], key_rep->bdaddr.b[4], key_rep->bdaddr.b[5]); @@ -1269,8 +1266,8 @@ void BluetoothEmu::CommandLinkKeyNegRep(const u8* input) { const hci_link_key_neg_rep_cp* key_neg = reinterpret_cast(input); - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_LINK_KEY_NEG_REP"); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", key_neg->bdaddr.b[0], + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_LINK_KEY_NEG_REP"); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", key_neg->bdaddr.b[0], key_neg->bdaddr.b[1], key_neg->bdaddr.b[2], key_neg->bdaddr.b[3], key_neg->bdaddr.b[4], key_neg->bdaddr.b[5]); @@ -1289,9 +1286,9 @@ void BluetoothEmu::CommandChangeConPacketType(const u8* input) // ntd stack sets packet type 0xcc18, which is HCI_PKT_DH5 | HCI_PKT_DM5 | HCI_PKT_DH1 | // HCI_PKT_DM1 // dunno what to do...run awayyyyyy! - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_CHANGE_CON_PACKET_TYPE"); - DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", change_packet_type->con_handle); - DEBUG_LOG(WII_IPC_WIIMOTE, " PacketType: 0x%04x", change_packet_type->pkt_type); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_CHANGE_CON_PACKET_TYPE"); + DEBUG_LOG(IOS_WIIMOTE, " ConnectionHandle: 0x%04x", change_packet_type->con_handle); + DEBUG_LOG(IOS_WIIMOTE, " PacketType: 0x%04x", change_packet_type->pkt_type); SendEventCommandStatus(HCI_CMD_CHANGE_CON_PACKET_TYPE); SendEventConPacketTypeChange(change_packet_type->con_handle, change_packet_type->pkt_type); @@ -1301,8 +1298,8 @@ void BluetoothEmu::CommandAuthenticationRequested(const u8* input) { const hci_auth_req_cp* auth_req = reinterpret_cast(input); - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_AUTH_REQ"); - DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", auth_req->con_handle); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_AUTH_REQ"); + DEBUG_LOG(IOS_WIIMOTE, " ConnectionHandle: 0x%04x", auth_req->con_handle); SendEventCommandStatus(HCI_CMD_AUTH_REQ); SendEventAuthenticationCompleted(auth_req->con_handle); @@ -1313,14 +1310,14 @@ void BluetoothEmu::CommandRemoteNameReq(const u8* input) const hci_remote_name_req_cp* remote_name_req = reinterpret_cast(input); - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_REMOTE_NAME_REQ"); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", remote_name_req->bdaddr.b[0], + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_REMOTE_NAME_REQ"); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", remote_name_req->bdaddr.b[0], remote_name_req->bdaddr.b[1], remote_name_req->bdaddr.b[2], remote_name_req->bdaddr.b[3], remote_name_req->bdaddr.b[4], remote_name_req->bdaddr.b[5]); - DEBUG_LOG(WII_IPC_WIIMOTE, " page_scan_rep_mode: %i", remote_name_req->page_scan_rep_mode); - DEBUG_LOG(WII_IPC_WIIMOTE, " page_scan_mode: %i", remote_name_req->page_scan_mode); - DEBUG_LOG(WII_IPC_WIIMOTE, " clock_offset: %i", remote_name_req->clock_offset); + DEBUG_LOG(IOS_WIIMOTE, " page_scan_rep_mode: %i", remote_name_req->page_scan_rep_mode); + DEBUG_LOG(IOS_WIIMOTE, " page_scan_mode: %i", remote_name_req->page_scan_mode); + DEBUG_LOG(IOS_WIIMOTE, " clock_offset: %i", remote_name_req->clock_offset); SendEventCommandStatus(HCI_CMD_REMOTE_NAME_REQ); SendEventRemoteNameReq(remote_name_req->bdaddr); @@ -1331,8 +1328,8 @@ void BluetoothEmu::CommandReadRemoteFeatures(const u8* input) const hci_read_remote_features_cp* read_remote_features = reinterpret_cast(input); - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_REMOTE_FEATURES"); - DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", read_remote_features->con_handle); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_READ_REMOTE_FEATURES"); + DEBUG_LOG(IOS_WIIMOTE, " ConnectionHandle: 0x%04x", read_remote_features->con_handle); SendEventCommandStatus(HCI_CMD_READ_REMOTE_FEATURES); SendEventReadRemoteFeatures(read_remote_features->con_handle); @@ -1343,8 +1340,8 @@ void BluetoothEmu::CommandReadRemoteVerInfo(const u8* input) const hci_read_remote_ver_info_cp* read_remote_ver_info = reinterpret_cast(input); - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_REMOTE_VER_INFO"); - DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%02x", read_remote_ver_info->con_handle); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_READ_REMOTE_VER_INFO"); + DEBUG_LOG(IOS_WIIMOTE, " ConnectionHandle: 0x%02x", read_remote_ver_info->con_handle); SendEventCommandStatus(HCI_CMD_READ_REMOTE_VER_INFO); SendEventReadRemoteVerInfo(read_remote_ver_info->con_handle); @@ -1355,8 +1352,8 @@ void BluetoothEmu::CommandReadClockOffset(const u8* input) const hci_read_clock_offset_cp* read_clock_offset = reinterpret_cast(input); - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_CLOCK_OFFSET"); - DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%02x", read_clock_offset->con_handle); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_READ_CLOCK_OFFSET"); + DEBUG_LOG(IOS_WIIMOTE, " ConnectionHandle: 0x%02x", read_clock_offset->con_handle); SendEventCommandStatus(HCI_CMD_READ_CLOCK_OFFSET); SendEventReadClockOffsetComplete(read_clock_offset->con_handle); @@ -1366,12 +1363,12 @@ void BluetoothEmu::CommandSniffMode(const u8* input) { const hci_sniff_mode_cp* sniff_mode = reinterpret_cast(input); - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_SNIFF_MODE"); - DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", sniff_mode->con_handle); - DEBUG_LOG(WII_IPC_WIIMOTE, " max_interval: %f msec", sniff_mode->max_interval * .625); - DEBUG_LOG(WII_IPC_WIIMOTE, " min_interval: %f msec", sniff_mode->min_interval * .625); - DEBUG_LOG(WII_IPC_WIIMOTE, " attempt: %f msec", sniff_mode->attempt * 1.25); - DEBUG_LOG(WII_IPC_WIIMOTE, " timeout: %f msec", sniff_mode->timeout * 1.25); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_SNIFF_MODE"); + DEBUG_LOG(IOS_WIIMOTE, " ConnectionHandle: 0x%04x", sniff_mode->con_handle); + DEBUG_LOG(IOS_WIIMOTE, " max_interval: %f msec", sniff_mode->max_interval * .625); + DEBUG_LOG(IOS_WIIMOTE, " min_interval: %f msec", sniff_mode->min_interval * .625); + DEBUG_LOG(IOS_WIIMOTE, " attempt: %f msec", sniff_mode->attempt * 1.25); + DEBUG_LOG(IOS_WIIMOTE, " timeout: %f msec", sniff_mode->timeout * 1.25); SendEventCommandStatus(HCI_CMD_SNIFF_MODE); SendEventModeChange(sniff_mode->con_handle, 0x02, sniff_mode->max_interval); // 0x02 - sniff mode @@ -1382,9 +1379,9 @@ void BluetoothEmu::CommandWriteLinkPolicy(const u8* input) const hci_write_link_policy_settings_cp* link_policy = reinterpret_cast(input); - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_LINK_POLICY_SETTINGS"); - DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", link_policy->con_handle); - DEBUG_LOG(WII_IPC_WIIMOTE, " Policy: 0x%04x", link_policy->settings); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_WRITE_LINK_POLICY_SETTINGS"); + DEBUG_LOG(IOS_WIIMOTE, " ConnectionHandle: 0x%04x", link_policy->con_handle); + DEBUG_LOG(IOS_WIIMOTE, " Policy: 0x%04x", link_policy->settings); SendEventCommandStatus(HCI_CMD_WRITE_LINK_POLICY_SETTINGS); } @@ -1394,7 +1391,7 @@ void BluetoothEmu::CommandReset(const u8* input) hci_status_rp reply; reply.status = 0x00; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_RESET"); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_RESET"); SendEventCommandComplete(HCI_CMD_RESET, &reply, sizeof(hci_status_rp)); } @@ -1407,10 +1404,9 @@ void BluetoothEmu::CommandSetEventFilter(const u8* input) hci_set_event_filter_rp reply; reply.status = 0x00; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_SET_EVENT_FILTER:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " filter_type: %i", set_event_filter->filter_type); - DEBUG_LOG(WII_IPC_WIIMOTE, " filter_condition_type: %i", - set_event_filter->filter_condition_type); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_SET_EVENT_FILTER:"); + DEBUG_LOG(IOS_WIIMOTE, " filter_type: %i", set_event_filter->filter_type); + DEBUG_LOG(IOS_WIIMOTE, " filter_condition_type: %i", set_event_filter->filter_condition_type); SendEventCommandComplete(HCI_CMD_SET_EVENT_FILTER, &reply, sizeof(hci_set_event_filter_rp)); } @@ -1423,8 +1419,8 @@ void BluetoothEmu::CommandWritePinType(const u8* input) hci_write_pin_type_rp reply; reply.status = 0x00; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_PIN_TYPE:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " pin_type: %x", write_pin_type->pin_type); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_WRITE_PIN_TYPE:"); + DEBUG_LOG(IOS_WIIMOTE, " pin_type: %x", write_pin_type->pin_type); SendEventCommandComplete(HCI_CMD_WRITE_PIN_TYPE, &reply, sizeof(hci_write_pin_type_rp)); } @@ -1445,19 +1441,19 @@ void BluetoothEmu::CommandReadStoredLinkKey(const u8* input) } else { - ERROR_LOG(WII_IPC_WIIMOTE, "CommandReadStoredLinkKey isn't looking for all devices"); + ERROR_LOG(IOS_WIIMOTE, "CommandReadStoredLinkKey isn't looking for all devices"); } - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_STORED_LINK_KEY:"); - DEBUG_LOG(WII_IPC_WIIMOTE, "input:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", - read_stored_link_key->bdaddr.b[0], read_stored_link_key->bdaddr.b[1], - read_stored_link_key->bdaddr.b[2], read_stored_link_key->bdaddr.b[3], - read_stored_link_key->bdaddr.b[4], read_stored_link_key->bdaddr.b[5]); - DEBUG_LOG(WII_IPC_WIIMOTE, " read_all: %i", read_stored_link_key->read_all); - DEBUG_LOG(WII_IPC_WIIMOTE, "return:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " max_num_keys: %i", reply.max_num_keys); - DEBUG_LOG(WII_IPC_WIIMOTE, " num_keys_read: %i", reply.num_keys_read); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_READ_STORED_LINK_KEY:"); + DEBUG_LOG(IOS_WIIMOTE, "input:"); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", read_stored_link_key->bdaddr.b[0], + read_stored_link_key->bdaddr.b[1], read_stored_link_key->bdaddr.b[2], + read_stored_link_key->bdaddr.b[3], read_stored_link_key->bdaddr.b[4], + read_stored_link_key->bdaddr.b[5]); + DEBUG_LOG(IOS_WIIMOTE, " read_all: %i", read_stored_link_key->read_all); + DEBUG_LOG(IOS_WIIMOTE, "return:"); + DEBUG_LOG(IOS_WIIMOTE, " max_num_keys: %i", reply.max_num_keys); + DEBUG_LOG(IOS_WIIMOTE, " num_keys_read: %i", reply.num_keys_read); SendEventLinkKeyNotification((u8)reply.num_keys_read); SendEventCommandComplete(HCI_CMD_READ_STORED_LINK_KEY, &reply, @@ -1469,12 +1465,12 @@ void BluetoothEmu::CommandDeleteStoredLinkKey(const u8* input) const hci_delete_stored_link_key_cp* delete_stored_link_key = reinterpret_cast(input); - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_OCF_DELETE_STORED_LINK_KEY"); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", - delete_stored_link_key->bdaddr.b[0], delete_stored_link_key->bdaddr.b[1], - delete_stored_link_key->bdaddr.b[2], delete_stored_link_key->bdaddr.b[3], - delete_stored_link_key->bdaddr.b[4], delete_stored_link_key->bdaddr.b[5]); - DEBUG_LOG(WII_IPC_WIIMOTE, " delete_all: 0x%01x", delete_stored_link_key->delete_all); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_OCF_DELETE_STORED_LINK_KEY"); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", delete_stored_link_key->bdaddr.b[0], + delete_stored_link_key->bdaddr.b[1], delete_stored_link_key->bdaddr.b[2], + delete_stored_link_key->bdaddr.b[3], delete_stored_link_key->bdaddr.b[4], + delete_stored_link_key->bdaddr.b[5]); + DEBUG_LOG(IOS_WIIMOTE, " delete_all: 0x%01x", delete_stored_link_key->delete_all); WiimoteDevice* wiiMote = AccessWiiMote(delete_stored_link_key->bdaddr); if (wiiMote == nullptr) @@ -1487,8 +1483,8 @@ void BluetoothEmu::CommandDeleteStoredLinkKey(const u8* input) SendEventCommandComplete(HCI_CMD_DELETE_STORED_LINK_KEY, &reply, sizeof(hci_delete_stored_link_key_rp)); - ERROR_LOG(WII_IPC_WIIMOTE, "HCI: CommandDeleteStoredLinkKey... Probably the security for linking " - "has failed. Could be a problem with loading the SCONF"); + ERROR_LOG(IOS_WIIMOTE, "HCI: CommandDeleteStoredLinkKey... Probably the security for linking " + "has failed. Could be a problem with loading the SCONF"); } void BluetoothEmu::CommandWriteLocalName(const u8* input) @@ -1499,8 +1495,8 @@ void BluetoothEmu::CommandWriteLocalName(const u8* input) hci_write_local_name_rp reply; reply.status = 0x00; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_LOCAL_NAME:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " local_name: %s", write_local_name->name); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_WRITE_LOCAL_NAME:"); + DEBUG_LOG(IOS_WIIMOTE, " local_name: %s", write_local_name->name); SendEventCommandComplete(HCI_CMD_WRITE_LOCAL_NAME, &reply, sizeof(hci_write_local_name_rp)); } @@ -1515,8 +1511,8 @@ void BluetoothEmu::CommandWritePageTimeOut(const u8* input) hci_host_buffer_size_rp reply; reply.status = 0x00; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_PAGE_TIMEOUT:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " timeout: %i", write_page_timeout->timeout); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_WRITE_PAGE_TIMEOUT:"); + DEBUG_LOG(IOS_WIIMOTE, " timeout: %i", write_page_timeout->timeout); SendEventCommandComplete(HCI_CMD_WRITE_PAGE_TIMEOUT, &reply, sizeof(hci_host_buffer_size_rp)); } @@ -1538,9 +1534,9 @@ void BluetoothEmu::CommandWriteScanEnable(const u8* input) {"HCI_INQUIRY_AND_PAGE_SCAN_ENABLE"}, }; - DEBUG_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_SCAN_ENABLE: (0x%02x)", + DEBUG_LOG(IOS_WIIMOTE, "Command: HCI_CMD_WRITE_SCAN_ENABLE: (0x%02x)", write_scan_enable->scan_enable); - DEBUG_LOG(WII_IPC_WIIMOTE, " scan_enable: %s", scanning[write_scan_enable->scan_enable]); + DEBUG_LOG(IOS_WIIMOTE, " scan_enable: %s", scanning[write_scan_enable->scan_enable]); SendEventCommandComplete(HCI_CMD_WRITE_SCAN_ENABLE, &reply, sizeof(hci_write_scan_enable_rp)); } @@ -1553,10 +1549,10 @@ void BluetoothEmu::CommandWriteUnitClass(const u8* input) hci_write_unit_class_rp reply; reply.status = 0x00; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_UNIT_CLASS:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " COD[0]: 0x%02x", write_unit_class->uclass[0]); - DEBUG_LOG(WII_IPC_WIIMOTE, " COD[1]: 0x%02x", write_unit_class->uclass[1]); - DEBUG_LOG(WII_IPC_WIIMOTE, " COD[2]: 0x%02x", write_unit_class->uclass[2]); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_WRITE_UNIT_CLASS:"); + DEBUG_LOG(IOS_WIIMOTE, " COD[0]: 0x%02x", write_unit_class->uclass[0]); + DEBUG_LOG(IOS_WIIMOTE, " COD[1]: 0x%02x", write_unit_class->uclass[1]); + DEBUG_LOG(IOS_WIIMOTE, " COD[2]: 0x%02x", write_unit_class->uclass[2]); SendEventCommandComplete(HCI_CMD_WRITE_UNIT_CLASS, &reply, sizeof(hci_write_unit_class_rp)); } @@ -1569,11 +1565,11 @@ void BluetoothEmu::CommandHostBufferSize(const u8* input) hci_host_buffer_size_rp reply; reply.status = 0x00; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_HOST_BUFFER_SIZE:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " max_acl_size: %i", host_buffer_size->max_acl_size); - DEBUG_LOG(WII_IPC_WIIMOTE, " max_sco_size: %i", host_buffer_size->max_sco_size); - DEBUG_LOG(WII_IPC_WIIMOTE, " num_acl_pkts: %i", host_buffer_size->num_acl_pkts); - DEBUG_LOG(WII_IPC_WIIMOTE, " num_sco_pkts: %i", host_buffer_size->num_sco_pkts); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_HOST_BUFFER_SIZE:"); + DEBUG_LOG(IOS_WIIMOTE, " max_acl_size: %i", host_buffer_size->max_acl_size); + DEBUG_LOG(IOS_WIIMOTE, " max_sco_size: %i", host_buffer_size->max_sco_size); + DEBUG_LOG(IOS_WIIMOTE, " num_acl_pkts: %i", host_buffer_size->num_acl_pkts); + DEBUG_LOG(IOS_WIIMOTE, " num_sco_pkts: %i", host_buffer_size->num_sco_pkts); SendEventCommandComplete(HCI_CMD_HOST_BUFFER_SIZE, &reply, sizeof(hci_host_buffer_size_rp)); } @@ -1584,9 +1580,9 @@ void BluetoothEmu::CommandWriteLinkSupervisionTimeout(const u8* input) reinterpret_cast(input); // timeout of 0 means timing out is disabled - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_LINK_SUPERVISION_TIMEOUT"); - DEBUG_LOG(WII_IPC_WIIMOTE, " con_handle: 0x%04x", supervision->con_handle); - DEBUG_LOG(WII_IPC_WIIMOTE, " timeout: 0x%02x", supervision->timeout); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_WRITE_LINK_SUPERVISION_TIMEOUT"); + DEBUG_LOG(IOS_WIIMOTE, " con_handle: 0x%04x", supervision->con_handle); + DEBUG_LOG(IOS_WIIMOTE, " timeout: 0x%02x", supervision->timeout); hci_write_link_supervision_timeout_rp reply; reply.status = 0x00; @@ -1604,8 +1600,8 @@ void BluetoothEmu::CommandWriteInquiryScanType(const u8* input) hci_write_inquiry_scan_type_rp reply; reply.status = 0x00; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_INQUIRY_SCAN_TYPE:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " type: %i", set_event_filter->type); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_WRITE_INQUIRY_SCAN_TYPE:"); + DEBUG_LOG(IOS_WIIMOTE, " type: %i", set_event_filter->type); SendEventCommandComplete(HCI_CMD_WRITE_INQUIRY_SCAN_TYPE, &reply, sizeof(hci_write_inquiry_scan_type_rp)); @@ -1623,8 +1619,8 @@ void BluetoothEmu::CommandWriteInquiryMode(const u8* input) {"Standard Inquiry Result event format (default)"}, {"Inquiry Result format with RSSI"}, {"Inquiry Result with RSSI format or Extended Inquiry Result format"}}; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_INQUIRY_MODE:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " mode: %s", inquiry_mode_tag[inquiry_mode->mode]); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_WRITE_INQUIRY_MODE:"); + DEBUG_LOG(IOS_WIIMOTE, " mode: %s", inquiry_mode_tag[inquiry_mode->mode]); SendEventCommandComplete(HCI_CMD_WRITE_INQUIRY_MODE, &reply, sizeof(hci_write_inquiry_mode_rp)); } @@ -1640,8 +1636,8 @@ void BluetoothEmu::CommandWritePageScanType(const u8* input) static char page_scan_type[][128] = {{"Mandatory: Standard Scan (default)"}, {"Optional: Interlaced Scan"}}; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_PAGE_SCAN_TYPE:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " type: %s", page_scan_type[write_page_scan_type->type]); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_WRITE_PAGE_SCAN_TYPE:"); + DEBUG_LOG(IOS_WIIMOTE, " type: %s", page_scan_type[write_page_scan_type->type]); SendEventCommandComplete(HCI_CMD_WRITE_PAGE_SCAN_TYPE, &reply, sizeof(hci_write_page_scan_type_rp)); @@ -1657,13 +1653,13 @@ void BluetoothEmu::CommandReadLocalVer(const u8* input) reply.manufacturer = 0x000F; // manufacturer: reserved for tests reply.lmp_subversion = 0x430e; // LMP subversion - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_LOCAL_VER:"); - DEBUG_LOG(WII_IPC_WIIMOTE, "return:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " status: %i", reply.status); - DEBUG_LOG(WII_IPC_WIIMOTE, " hci_revision: %i", reply.hci_revision); - DEBUG_LOG(WII_IPC_WIIMOTE, " lmp_version: %i", reply.lmp_version); - DEBUG_LOG(WII_IPC_WIIMOTE, " manufacturer: %i", reply.manufacturer); - DEBUG_LOG(WII_IPC_WIIMOTE, " lmp_subversion: %i", reply.lmp_subversion); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_READ_LOCAL_VER:"); + DEBUG_LOG(IOS_WIIMOTE, "return:"); + DEBUG_LOG(IOS_WIIMOTE, " status: %i", reply.status); + DEBUG_LOG(IOS_WIIMOTE, " hci_revision: %i", reply.hci_revision); + DEBUG_LOG(IOS_WIIMOTE, " lmp_version: %i", reply.lmp_version); + DEBUG_LOG(IOS_WIIMOTE, " manufacturer: %i", reply.manufacturer); + DEBUG_LOG(IOS_WIIMOTE, " lmp_subversion: %i", reply.lmp_subversion); SendEventCommandComplete(HCI_CMD_READ_LOCAL_VER, &reply, sizeof(hci_read_local_ver_rp)); } @@ -1681,11 +1677,11 @@ void BluetoothEmu::CommandReadLocalFeatures(const u8* input) reply.features[6] = 0x00; reply.features[7] = 0x80; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_LOCAL_FEATURES:"); - DEBUG_LOG(WII_IPC_WIIMOTE, "return:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " features: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", - reply.features[0], reply.features[1], reply.features[2], reply.features[3], - reply.features[4], reply.features[5], reply.features[6], reply.features[7]); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_READ_LOCAL_FEATURES:"); + DEBUG_LOG(IOS_WIIMOTE, "return:"); + DEBUG_LOG(IOS_WIIMOTE, " features: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", reply.features[0], + reply.features[1], reply.features[2], reply.features[3], reply.features[4], + reply.features[5], reply.features[6], reply.features[7]); SendEventCommandComplete(HCI_CMD_READ_LOCAL_FEATURES, &reply, sizeof(hci_read_local_features_rp)); } @@ -1702,12 +1698,12 @@ void BluetoothEmu::CommandReadBufferSize(const u8* input) reply.max_sco_size = SCO_PKT_SIZE; reply.num_sco_pkts = SCO_PKT_NUM; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_BUFFER_SIZE:"); - DEBUG_LOG(WII_IPC_WIIMOTE, "return:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " max_acl_size: %i", reply.max_acl_size); - DEBUG_LOG(WII_IPC_WIIMOTE, " num_acl_pkts: %i", reply.num_acl_pkts); - DEBUG_LOG(WII_IPC_WIIMOTE, " max_sco_size: %i", reply.max_sco_size); - DEBUG_LOG(WII_IPC_WIIMOTE, " num_sco_pkts: %i", reply.num_sco_pkts); + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_READ_BUFFER_SIZE:"); + DEBUG_LOG(IOS_WIIMOTE, "return:"); + DEBUG_LOG(IOS_WIIMOTE, " max_acl_size: %i", reply.max_acl_size); + DEBUG_LOG(IOS_WIIMOTE, " num_acl_pkts: %i", reply.num_acl_pkts); + DEBUG_LOG(IOS_WIIMOTE, " max_sco_size: %i", reply.max_sco_size); + DEBUG_LOG(IOS_WIIMOTE, " num_sco_pkts: %i", reply.num_sco_pkts); SendEventCommandComplete(HCI_CMD_READ_BUFFER_SIZE, &reply, sizeof(hci_read_buffer_size_rp)); } @@ -1718,9 +1714,9 @@ void BluetoothEmu::CommandReadBDAdrr(const u8* input) reply.status = 0x00; reply.bdaddr = m_ControllerBD; - INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_BDADDR:"); - DEBUG_LOG(WII_IPC_WIIMOTE, "return:"); - DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", reply.bdaddr.b[0], + INFO_LOG(IOS_WIIMOTE, "Command: HCI_CMD_READ_BDADDR:"); + DEBUG_LOG(IOS_WIIMOTE, "return:"); + DEBUG_LOG(IOS_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x", reply.bdaddr.b[0], reply.bdaddr.b[1], reply.bdaddr.b[2], reply.bdaddr.b[3], reply.bdaddr.b[4], reply.bdaddr.b[5]); @@ -1739,10 +1735,10 @@ void BluetoothEmu::CommandVendorSpecific_FC4F(const u8* input, u32 size) hci_status_rp reply; reply.status = 0x00; - INFO_LOG(WII_IPC_WIIMOTE, "Command: CommandVendorSpecific_FC4F: (callstack WUDiRemovePatch)"); - DEBUG_LOG(WII_IPC_WIIMOTE, "Input (size 0x%x):", size); + INFO_LOG(IOS_WIIMOTE, "Command: CommandVendorSpecific_FC4F: (callstack WUDiRemovePatch)"); + DEBUG_LOG(IOS_WIIMOTE, "Input (size 0x%x):", size); - Dolphin_Debugger::PrintDataBuffer(LogTypes::WII_IPC_WIIMOTE, input, size, "Data: "); + Dolphin_Debugger::PrintDataBuffer(LogTypes::IOS_WIIMOTE, input, size, "Data: "); SendEventCommandComplete(0xFC4F, &reply, sizeof(hci_status_rp)); } @@ -1752,9 +1748,9 @@ void BluetoothEmu::CommandVendorSpecific_FC4C(const u8* input, u32 size) hci_status_rp reply; reply.status = 0x00; - DEBUG_LOG(WII_IPC_WIIMOTE, "Command: CommandVendorSpecific_FC4C:"); - DEBUG_LOG(WII_IPC_WIIMOTE, "Input (size 0x%x):", size); - Dolphin_Debugger::PrintDataBuffer(LogTypes::WII_IPC_WIIMOTE, input, size, "Data: "); + DEBUG_LOG(IOS_WIIMOTE, "Command: CommandVendorSpecific_FC4C:"); + DEBUG_LOG(IOS_WIIMOTE, "Input (size 0x%x):", size); + Dolphin_Debugger::PrintDataBuffer(LogTypes::IOS_WIIMOTE, input, size, "Data: "); SendEventCommandComplete(0xFC4C, &reply, sizeof(hci_status_rp)); } @@ -1774,7 +1770,7 @@ WiimoteDevice* BluetoothEmu::AccessWiiMote(const bdaddr_t& _rAddr) return &wiimote; } - ERROR_LOG(WII_IPC_WIIMOTE, "Can't find WiiMote by bd: %02x:%02x:%02x:%02x:%02x:%02x", _rAddr.b[0], + ERROR_LOG(IOS_WIIMOTE, "Can't find WiiMote by bd: %02x:%02x:%02x:%02x:%02x:%02x", _rAddr.b[0], _rAddr.b[1], _rAddr.b[2], _rAddr.b[3], _rAddr.b[4], _rAddr.b[5]); return nullptr; } @@ -1787,7 +1783,7 @@ WiimoteDevice* BluetoothEmu::AccessWiiMote(u16 _ConnectionHandle) return &wiimote; } - ERROR_LOG(WII_IPC_WIIMOTE, "Can't find Wiimote by connection handle %02x", _ConnectionHandle); + ERROR_LOG(IOS_WIIMOTE, "Can't find Wiimote by connection handle %02x", _ConnectionHandle); PanicAlertT("Can't find Wii Remote by connection handle %02x", _ConnectionHandle); return nullptr; } diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp b/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp index 06c28eaaa0..4acdbe8870 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp @@ -72,7 +72,7 @@ BluetoothReal::BluetoothReal(u32 device_id, const std::string& device_name) : BluetoothBase(device_id, device_name) { const int ret = libusb_init(&m_libusb_context); - _assert_msg_(WII_IPC_WIIMOTE, ret == 0, "Failed to init libusb."); + _assert_msg_(IOS_WIIMOTE, ret == 0, "Failed to init libusb."); LoadLinkKeys(); } @@ -99,7 +99,7 @@ IOSReturnCode BluetoothReal::Open(const IOSOpenRequest& request) { libusb_device** list; const ssize_t cnt = libusb_get_device_list(m_libusb_context, &list); - _dbg_assert_msg_(WII_IPC_HLE, cnt > 0, "Couldn't get device list"); + _dbg_assert_msg_(IOS, cnt > 0, "Couldn't get device list"); for (ssize_t i = 0; i < cnt; ++i) { libusb_device* device = list[i]; @@ -109,7 +109,7 @@ IOSReturnCode BluetoothReal::Open(const IOSOpenRequest& request) const int ret = libusb_get_active_config_descriptor(device, &config_descriptor); if (ret != 0) { - ERROR_LOG(WII_IPC_WIIMOTE, "Failed to get config descriptor for device %04x:%04x: %s", + ERROR_LOG(IOS_WIIMOTE, "Failed to get config descriptor for device %04x:%04x: %s", device_descriptor.idVendor, device_descriptor.idProduct, libusb_error_name(ret)); continue; } @@ -125,7 +125,7 @@ IOSReturnCode BluetoothReal::Open(const IOSOpenRequest& request) sizeof(product)); libusb_get_string_descriptor_ascii(m_handle, device_descriptor.iSerialNumber, serial_number, sizeof(serial_number)); - NOTICE_LOG(WII_IPC_WIIMOTE, "Using device %04x:%04x (rev %x) for Bluetooth: %s %s %s", + NOTICE_LOG(IOS_WIIMOTE, "Using device %04x:%04x (rev %x) for Bluetooth: %s %s %s", device_descriptor.idVendor, device_descriptor.idProduct, device_descriptor.bcdDevice, manufacturer, product, serial_number); m_is_wii_bt_module = @@ -331,7 +331,7 @@ void BluetoothReal::SendHCIResetCommand() const u16 payload[] = {HCI_CMD_RESET}; memcpy(packet, payload, sizeof(payload)); libusb_control_transfer(m_handle, type, 0, 0, 0, packet, sizeof(packet), TIMEOUT); - INFO_LOG(WII_IPC_WIIMOTE, "Sent a reset command to adapter"); + INFO_LOG(IOS_WIIMOTE, "Sent a reset command to adapter"); } void BluetoothReal::SendHCIDeleteLinkKeyCommand() @@ -444,7 +444,7 @@ void BluetoothReal::FakeSyncButtonEvent(CtrlBuffer& ctrl, const u8* payload, con // This causes the emulated software to perform a BT inquiry and connect to found Wiimotes. void BluetoothReal::FakeSyncButtonPressedEvent(CtrlBuffer& ctrl) { - NOTICE_LOG(WII_IPC_WIIMOTE, "Faking 'sync button pressed' (0x08) event packet"); + NOTICE_LOG(IOS_WIIMOTE, "Faking 'sync button pressed' (0x08) event packet"); const u8 payload[1] = {0x08}; FakeSyncButtonEvent(ctrl, payload, sizeof(payload)); m_sync_button_state = SyncButtonState::Ignored; @@ -453,7 +453,7 @@ void BluetoothReal::FakeSyncButtonPressedEvent(CtrlBuffer& ctrl) // When the red sync button is held for 10 seconds, a HCI event with payload 09 is sent. void BluetoothReal::FakeSyncButtonHeldEvent(CtrlBuffer& ctrl) { - NOTICE_LOG(WII_IPC_WIIMOTE, "Faking 'sync button held' (0x09) event packet"); + NOTICE_LOG(IOS_WIIMOTE, "Faking 'sync button held' (0x09) event packet"); const u8 payload[1] = {0x09}; FakeSyncButtonEvent(ctrl, payload, sizeof(payload)); m_sync_button_state = SyncButtonState::Ignored; @@ -568,7 +568,7 @@ void BluetoothReal::CommandCallback(libusb_transfer* tr) const std::unique_ptr cmd(static_cast(tr->user_data)); if (tr->status != LIBUSB_TRANSFER_COMPLETED && tr->status != LIBUSB_TRANSFER_NO_DEVICE) { - ERROR_LOG(WII_IPC_WIIMOTE, "libusb command transfer failed, status: 0x%02x", tr->status); + ERROR_LOG(IOS_WIIMOTE, "libusb command transfer failed, status: 0x%02x", tr->status); if (!s_showed_failed_transfer.IsSet()) { Core::DisplayMessage("Failed to send a command to the Bluetooth adapter.", 10000); @@ -590,7 +590,7 @@ void BluetoothReal::TransferCallback(libusb_transfer* tr) if (tr->status != LIBUSB_TRANSFER_COMPLETED && tr->status != LIBUSB_TRANSFER_TIMED_OUT && tr->status != LIBUSB_TRANSFER_NO_DEVICE) { - ERROR_LOG(WII_IPC_WIIMOTE, "libusb transfer failed, status: 0x%02x", tr->status); + ERROR_LOG(IOS_WIIMOTE, "libusb transfer failed, status: 0x%02x", tr->status); if (!s_showed_failed_transfer.IsSet()) { Core::DisplayMessage("Failed to transfer to or from to the Bluetooth adapter.", 10000); diff --git a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp index 57caa8743a..dddd3feb64 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp @@ -42,7 +42,7 @@ WiimoteDevice::WiimoteDevice(Device::BluetoothEmu* host, int number, bdaddr_t bd m_Name(number == WIIMOTE_BALANCE_BOARD ? "Nintendo RVL-WBC-01" : "Nintendo RVL-CNT-01"), m_pHost(host) { - INFO_LOG(WII_IPC_WIIMOTE, "Wiimote: #%i Constructed", number); + INFO_LOG(IOS_WIIMOTE, "Wiimote: #%i Constructed", number); m_ConnectionState = (ready) ? CONN_READY : CONN_INACTIVE; m_ConnectionHandle = 0x100 + number; @@ -172,7 +172,7 @@ bool WiimoteDevice::LinkChannel() return true; } - DEBUG_LOG(WII_IPC_WIIMOTE, "ConnectionState CONN_LINKING -> CONN_COMPLETE"); + DEBUG_LOG(IOS_WIIMOTE, "ConnectionState CONN_LINKING -> CONN_COMPLETE"); m_ConnectionState = CONN_COMPLETE; return false; @@ -203,7 +203,7 @@ void WiimoteDevice::Activate(bool ready) void WiimoteDevice::EventConnectionAccepted() { - DEBUG_LOG(WII_IPC_WIIMOTE, "ConnectionState %x -> CONN_LINKING", m_ConnectionState); + DEBUG_LOG(IOS_WIIMOTE, "ConnectionState %x -> CONN_LINKING", m_ConnectionState); m_ConnectionState = CONN_LINKING; } @@ -256,12 +256,12 @@ void WiimoteDevice::ExecuteL2capCmd(u8* _pData, u32 _Size) l2cap_hdr_t* pHeader = (l2cap_hdr_t*)_pData; u8* pData = _pData + sizeof(l2cap_hdr_t); u32 DataSize = _Size - sizeof(l2cap_hdr_t); - DEBUG_LOG(WII_IPC_WIIMOTE, " CID 0x%04x, Len 0x%x, DataSize 0x%x", pHeader->dcid, - pHeader->length, DataSize); + DEBUG_LOG(IOS_WIIMOTE, " CID 0x%04x, Len 0x%x, DataSize 0x%x", pHeader->dcid, pHeader->length, + DataSize); if (pHeader->length != DataSize) { - INFO_LOG(WII_IPC_WIIMOTE, "Faulty packet. It is dropped."); + INFO_LOG(IOS_WIIMOTE, "Faulty packet. It is dropped."); return; } @@ -273,7 +273,7 @@ void WiimoteDevice::ExecuteL2capCmd(u8* _pData, u32 _Size) default: { - _dbg_assert_msg_(WII_IPC_WIIMOTE, DoesChannelExist(pHeader->dcid), + _dbg_assert_msg_(IOS_WIIMOTE, DoesChannelExist(pHeader->dcid), "L2CAP: SendACLPacket to unknown channel %i", pHeader->dcid); CChannelMap::iterator itr = m_Channel.find(pHeader->dcid); @@ -308,8 +308,7 @@ void WiimoteDevice::ExecuteL2capCmd(u8* _pData, u32 _Size) break; default: - ERROR_LOG(WII_IPC_WIIMOTE, "Channel 0x04%x has unknown PSM %x", pHeader->dcid, - rChannel.PSM); + ERROR_LOG(IOS_WIIMOTE, "Channel 0x04%x has unknown PSM %x", pHeader->dcid, rChannel.PSM); break; } } @@ -329,8 +328,8 @@ void WiimoteDevice::SignalChannel(u8* _pData, u32 _Size) switch (cmd_hdr->code) { case L2CAP_COMMAND_REJ: - ERROR_LOG(WII_IPC_WIIMOTE, "SignalChannel - L2CAP_COMMAND_REJ (something went wrong)." - "Try to replace your SYSCONF file with a new copy."); + ERROR_LOG(IOS_WIIMOTE, "SignalChannel - L2CAP_COMMAND_REJ (something went wrong)." + "Try to replace your SYSCONF file with a new copy."); break; case L2CAP_CONNECT_REQ: @@ -354,7 +353,7 @@ void WiimoteDevice::SignalChannel(u8* _pData, u32 _Size) break; default: - ERROR_LOG(WII_IPC_WIIMOTE, " Unknown Command-Code (0x%02x)", cmd_hdr->code); + ERROR_LOG(IOS_WIIMOTE, " Unknown Command-Code (0x%02x)", cmd_hdr->code); return; } @@ -383,11 +382,11 @@ void WiimoteDevice::ReceiveConnectionReq(u8 _Ident, u8* _pData, u32 _Size) rChannel.SCID = pCommandConnectionReq->scid; rChannel.DCID = pCommandConnectionReq->scid; - DEBUG_LOG(WII_IPC_WIIMOTE, "[L2CAP] ReceiveConnectionRequest"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Ident: 0x%02x", _Ident); - DEBUG_LOG(WII_IPC_WIIMOTE, " PSM: 0x%04x", rChannel.PSM); - DEBUG_LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", rChannel.SCID); - DEBUG_LOG(WII_IPC_WIIMOTE, " DCID: 0x%04x", rChannel.DCID); + DEBUG_LOG(IOS_WIIMOTE, "[L2CAP] ReceiveConnectionRequest"); + DEBUG_LOG(IOS_WIIMOTE, " Ident: 0x%02x", _Ident); + DEBUG_LOG(IOS_WIIMOTE, " PSM: 0x%04x", rChannel.PSM); + DEBUG_LOG(IOS_WIIMOTE, " SCID: 0x%04x", rChannel.SCID); + DEBUG_LOG(IOS_WIIMOTE, " DCID: 0x%04x", rChannel.DCID); // response l2cap_con_rsp_cp Rsp; @@ -396,7 +395,7 @@ void WiimoteDevice::ReceiveConnectionReq(u8 _Ident, u8* _pData, u32 _Size) Rsp.result = L2CAP_SUCCESS; Rsp.status = L2CAP_NO_INFO; - DEBUG_LOG(WII_IPC_WIIMOTE, "[L2CAP] SendConnectionResponse"); + DEBUG_LOG(IOS_WIIMOTE, "[L2CAP] SendConnectionResponse"); SendCommandToACL(_Ident, L2CAP_CONNECT_RSP, sizeof(l2cap_con_rsp_cp), (u8*)&Rsp); // update state machine @@ -412,17 +411,17 @@ void WiimoteDevice::ReceiveConnectionResponse(u8 _Ident, u8* _pData, u32 _Size) { l2cap_con_rsp_cp* rsp = (l2cap_con_rsp_cp*)_pData; - _dbg_assert_(WII_IPC_WIIMOTE, _Size == sizeof(l2cap_con_rsp_cp)); + _dbg_assert_(IOS_WIIMOTE, _Size == sizeof(l2cap_con_rsp_cp)); - DEBUG_LOG(WII_IPC_WIIMOTE, "[L2CAP] ReceiveConnectionResponse"); - DEBUG_LOG(WII_IPC_WIIMOTE, " DCID: 0x%04x", rsp->dcid); - DEBUG_LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", rsp->scid); - DEBUG_LOG(WII_IPC_WIIMOTE, " Result: 0x%04x", rsp->result); - DEBUG_LOG(WII_IPC_WIIMOTE, " Status: 0x%04x", rsp->status); + DEBUG_LOG(IOS_WIIMOTE, "[L2CAP] ReceiveConnectionResponse"); + DEBUG_LOG(IOS_WIIMOTE, " DCID: 0x%04x", rsp->dcid); + DEBUG_LOG(IOS_WIIMOTE, " SCID: 0x%04x", rsp->scid); + DEBUG_LOG(IOS_WIIMOTE, " Result: 0x%04x", rsp->result); + DEBUG_LOG(IOS_WIIMOTE, " Status: 0x%04x", rsp->status); - _dbg_assert_(WII_IPC_WIIMOTE, rsp->result == L2CAP_SUCCESS); - _dbg_assert_(WII_IPC_WIIMOTE, rsp->status == L2CAP_NO_INFO); - _dbg_assert_(WII_IPC_WIIMOTE, DoesChannelExist(rsp->scid)); + _dbg_assert_(IOS_WIIMOTE, rsp->result == L2CAP_SUCCESS); + _dbg_assert_(IOS_WIIMOTE, rsp->status == L2CAP_NO_INFO); + _dbg_assert_(IOS_WIIMOTE, DoesChannelExist(rsp->scid)); SChannel& rChannel = m_Channel[rsp->scid]; rChannel.DCID = rsp->dcid; @@ -439,16 +438,16 @@ void WiimoteDevice::ReceiveConfigurationReq(u8 _Ident, u8* _pData, u32 _Size) u32 Offset = 0; l2cap_cfg_req_cp* pCommandConfigReq = (l2cap_cfg_req_cp*)_pData; - _dbg_assert_(WII_IPC_WIIMOTE, pCommandConfigReq->flags == - 0x00); // 1 means that the options are send in multi-packets - _dbg_assert_(WII_IPC_WIIMOTE, DoesChannelExist(pCommandConfigReq->dcid)); + _dbg_assert_(IOS_WIIMOTE, pCommandConfigReq->flags == + 0x00); // 1 means that the options are send in multi-packets + _dbg_assert_(IOS_WIIMOTE, DoesChannelExist(pCommandConfigReq->dcid)); SChannel& rChannel = m_Channel[pCommandConfigReq->dcid]; - DEBUG_LOG(WII_IPC_WIIMOTE, "[L2CAP] ReceiveConfigurationRequest"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Ident: 0x%02x", _Ident); - DEBUG_LOG(WII_IPC_WIIMOTE, " DCID: 0x%04x", pCommandConfigReq->dcid); - DEBUG_LOG(WII_IPC_WIIMOTE, " Flags: 0x%04x", pCommandConfigReq->flags); + DEBUG_LOG(IOS_WIIMOTE, "[L2CAP] ReceiveConfigurationRequest"); + DEBUG_LOG(IOS_WIIMOTE, " Ident: 0x%02x", _Ident); + DEBUG_LOG(IOS_WIIMOTE, " DCID: 0x%04x", pCommandConfigReq->dcid); + DEBUG_LOG(IOS_WIIMOTE, " Flags: 0x%04x", pCommandConfigReq->flags); Offset += sizeof(l2cap_cfg_req_cp); @@ -472,24 +471,24 @@ void WiimoteDevice::ReceiveConfigurationReq(u8 _Ident, u8* _pData, u32 _Size) { case L2CAP_OPT_MTU: { - _dbg_assert_(WII_IPC_WIIMOTE, pOptions->length == L2CAP_OPT_MTU_SIZE); + _dbg_assert_(IOS_WIIMOTE, pOptions->length == L2CAP_OPT_MTU_SIZE); l2cap_cfg_opt_val_t* pMTU = (l2cap_cfg_opt_val_t*)&_pData[Offset]; rChannel.MTU = pMTU->mtu; - DEBUG_LOG(WII_IPC_WIIMOTE, " MTU: 0x%04x", pMTU->mtu); + DEBUG_LOG(IOS_WIIMOTE, " MTU: 0x%04x", pMTU->mtu); } break; case L2CAP_OPT_FLUSH_TIMO: { - _dbg_assert_(WII_IPC_WIIMOTE, pOptions->length == L2CAP_OPT_FLUSH_TIMO_SIZE); + _dbg_assert_(IOS_WIIMOTE, pOptions->length == L2CAP_OPT_FLUSH_TIMO_SIZE); l2cap_cfg_opt_val_t* pFlushTimeOut = (l2cap_cfg_opt_val_t*)&_pData[Offset]; rChannel.FlushTimeOut = pFlushTimeOut->flush_timo; - DEBUG_LOG(WII_IPC_WIIMOTE, " FlushTimeOut: 0x%04x", pFlushTimeOut->flush_timo); + DEBUG_LOG(IOS_WIIMOTE, " FlushTimeOut: 0x%04x", pFlushTimeOut->flush_timo); } break; default: - _dbg_assert_msg_(WII_IPC_WIIMOTE, 0, "Unknown Option: 0x%02x", pOptions->type); + _dbg_assert_msg_(IOS_WIIMOTE, 0, "Unknown Option: 0x%02x", pOptions->type); break; } @@ -500,7 +499,7 @@ void WiimoteDevice::ReceiveConfigurationReq(u8 _Ident, u8* _pData, u32 _Size) RespLen += OptionSize; } - DEBUG_LOG(WII_IPC_WIIMOTE, "[L2CAP] SendConfigurationResponse"); + DEBUG_LOG(IOS_WIIMOTE, "[L2CAP] SendConfigurationResponse"); SendCommandToACL(_Ident, L2CAP_CONFIG_RSP, RespLen, TempBuffer); // update state machine @@ -514,12 +513,12 @@ void WiimoteDevice::ReceiveConfigurationResponse(u8 _Ident, u8* _pData, u32 _Siz { l2cap_cfg_rsp_cp* rsp = (l2cap_cfg_rsp_cp*)_pData; - DEBUG_LOG(WII_IPC_WIIMOTE, "[L2CAP] ReceiveConfigurationResponse"); - DEBUG_LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", rsp->scid); - DEBUG_LOG(WII_IPC_WIIMOTE, " Flags: 0x%04x", rsp->flags); - DEBUG_LOG(WII_IPC_WIIMOTE, " Result: 0x%04x", rsp->result); + DEBUG_LOG(IOS_WIIMOTE, "[L2CAP] ReceiveConfigurationResponse"); + DEBUG_LOG(IOS_WIIMOTE, " SCID: 0x%04x", rsp->scid); + DEBUG_LOG(IOS_WIIMOTE, " Flags: 0x%04x", rsp->flags); + DEBUG_LOG(IOS_WIIMOTE, " Result: 0x%04x", rsp->result); - _dbg_assert_(WII_IPC_WIIMOTE, rsp->result == L2CAP_SUCCESS); + _dbg_assert_(IOS_WIIMOTE, rsp->result == L2CAP_SUCCESS); // update state machine SChannel& rChannel = m_Channel[rsp->scid]; @@ -534,17 +533,17 @@ void WiimoteDevice::ReceiveDisconnectionReq(u8 _Ident, u8* _pData, u32 _Size) { l2cap_discon_req_cp* pCommandDisconnectionReq = (l2cap_discon_req_cp*)_pData; - DEBUG_LOG(WII_IPC_WIIMOTE, "[L2CAP] ReceiveDisconnectionReq"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Ident: 0x%02x", _Ident); - DEBUG_LOG(WII_IPC_WIIMOTE, " DCID: 0x%04x", pCommandDisconnectionReq->dcid); - DEBUG_LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", pCommandDisconnectionReq->scid); + DEBUG_LOG(IOS_WIIMOTE, "[L2CAP] ReceiveDisconnectionReq"); + DEBUG_LOG(IOS_WIIMOTE, " Ident: 0x%02x", _Ident); + DEBUG_LOG(IOS_WIIMOTE, " DCID: 0x%04x", pCommandDisconnectionReq->dcid); + DEBUG_LOG(IOS_WIIMOTE, " SCID: 0x%04x", pCommandDisconnectionReq->scid); // response l2cap_discon_req_cp Rsp; Rsp.dcid = pCommandDisconnectionReq->dcid; Rsp.scid = pCommandDisconnectionReq->scid; - DEBUG_LOG(WII_IPC_WIIMOTE, "[L2CAP] SendDisconnectionResponse"); + DEBUG_LOG(IOS_WIIMOTE, "[L2CAP] SendDisconnectionResponse"); SendCommandToACL(_Ident, L2CAP_DISCONNECT_RSP, sizeof(l2cap_discon_req_cp), (u8*)&Rsp); } @@ -571,9 +570,9 @@ void WiimoteDevice::SendConnectionRequest(u16 scid, u16 psm) cr.psm = psm; cr.scid = scid; - DEBUG_LOG(WII_IPC_WIIMOTE, "[L2CAP] SendConnectionRequest"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Psm: 0x%04x", cr.psm); - DEBUG_LOG(WII_IPC_WIIMOTE, " Scid: 0x%04x", cr.scid); + DEBUG_LOG(IOS_WIIMOTE, "[L2CAP] SendConnectionRequest"); + DEBUG_LOG(IOS_WIIMOTE, " Psm: 0x%04x", cr.psm); + DEBUG_LOG(IOS_WIIMOTE, " Scid: 0x%04x", cr.scid); SendCommandToACL(L2CAP_CONNECT_REQ, L2CAP_CONNECT_REQ, sizeof(l2cap_con_req_cp), (u8*)&cr); } @@ -588,9 +587,9 @@ void WiimoteDevice::SendDisconnectRequest(u16 scid) cr.dcid = rChannel.DCID; cr.scid = rChannel.SCID; - DEBUG_LOG(WII_IPC_WIIMOTE, "[L2CAP] SendDisconnectionRequest"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Dcid: 0x%04x", cr.dcid); - DEBUG_LOG(WII_IPC_WIIMOTE, " Scid: 0x%04x", cr.scid); + DEBUG_LOG(IOS_WIIMOTE, "[L2CAP] SendDisconnectionRequest"); + DEBUG_LOG(IOS_WIIMOTE, " Dcid: 0x%04x", cr.dcid); + DEBUG_LOG(IOS_WIIMOTE, " Scid: 0x%04x", cr.scid); SendCommandToACL(L2CAP_DISCONNECT_REQ, L2CAP_DISCONNECT_REQ, sizeof(l2cap_discon_req_cp), (u8*)&cr); @@ -598,7 +597,7 @@ void WiimoteDevice::SendDisconnectRequest(u16 scid) void WiimoteDevice::SendConfigurationRequest(u16 scid, u16 MTU, u16 FlushTimeOut) { - _dbg_assert_(WII_IPC_WIIMOTE, DoesChannelExist(scid)); + _dbg_assert_(IOS_WIIMOTE, DoesChannelExist(scid)); SChannel& rChannel = m_Channel[scid]; u8 Buffer[1024]; @@ -609,9 +608,9 @@ void WiimoteDevice::SendConfigurationRequest(u16 scid, u16 MTU, u16 FlushTimeOut cr->flags = 0; Offset += sizeof(l2cap_cfg_req_cp); - DEBUG_LOG(WII_IPC_WIIMOTE, "[L2CAP] SendConfigurationRequest"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Dcid: 0x%04x", cr->dcid); - DEBUG_LOG(WII_IPC_WIIMOTE, " Flags: 0x%04x", cr->flags); + DEBUG_LOG(IOS_WIIMOTE, "[L2CAP] SendConfigurationRequest"); + DEBUG_LOG(IOS_WIIMOTE, " Dcid: 0x%04x", cr->dcid); + DEBUG_LOG(IOS_WIIMOTE, " Flags: 0x%04x", cr->flags); l2cap_cfg_opt_t* pOptions; @@ -629,7 +628,7 @@ void WiimoteDevice::SendConfigurationRequest(u16 scid, u16 MTU, u16 FlushTimeOut pOptions->length = L2CAP_OPT_MTU_SIZE; *(u16*)&Buffer[Offset] = MTU; Offset += L2CAP_OPT_MTU_SIZE; - DEBUG_LOG(WII_IPC_WIIMOTE, " MTU: 0x%04x", MTU); + DEBUG_LOG(IOS_WIIMOTE, " MTU: 0x%04x", MTU); } if (FlushTimeOut || rChannel.FlushTimeOut) @@ -642,7 +641,7 @@ void WiimoteDevice::SendConfigurationRequest(u16 scid, u16 MTU, u16 FlushTimeOut pOptions->length = L2CAP_OPT_FLUSH_TIMO_SIZE; *(u16*)&Buffer[Offset] = FlushTimeOut; Offset += L2CAP_OPT_FLUSH_TIMO_SIZE; - DEBUG_LOG(WII_IPC_WIIMOTE, " FlushTimeOut: 0x%04x", FlushTimeOut); + DEBUG_LOG(IOS_WIIMOTE, " FlushTimeOut: 0x%04x", FlushTimeOut); } SendCommandToACL(L2CAP_CONFIG_REQ, L2CAP_CONFIG_REQ, Offset, Buffer); @@ -672,12 +671,12 @@ void WiimoteDevice::SDPSendServiceSearchResponse(u16 cid, u16 TransactionID, // verify block... we handle search pattern for HID service only { CBigEndianBuffer buffer(pServiceSearchPattern); - _dbg_assert_(WII_IPC_WIIMOTE, buffer.Read8(0) == SDP_SEQ8); // data sequence - _dbg_assert_(WII_IPC_WIIMOTE, buffer.Read8(1) == 0x03); // sequence size + _dbg_assert_(IOS_WIIMOTE, buffer.Read8(0) == SDP_SEQ8); // data sequence + _dbg_assert_(IOS_WIIMOTE, buffer.Read8(1) == 0x03); // sequence size // HIDClassID - _dbg_assert_(WII_IPC_WIIMOTE, buffer.Read8(2) == 0x19); - _dbg_assert_(WII_IPC_WIIMOTE, buffer.Read16(3) == 0x1124); + _dbg_assert_(IOS_WIIMOTE, buffer.Read8(2) == 0x19); + _dbg_assert_(IOS_WIIMOTE, buffer.Read16(3) == 0x1124); } u8 DataFrame[1000]; @@ -722,7 +721,7 @@ static u32 ParseCont(u8* pCont) { return 0x00; } - ERROR_LOG(WII_IPC_WIIMOTE, "ParseCont: wrong cont: %i", typeID); + ERROR_LOG(IOS_WIIMOTE, "ParseCont: wrong cont: %i", typeID); PanicAlert("ParseCont: wrong cont: %i", typeID); return 0; } @@ -741,7 +740,7 @@ static int ParseAttribList(u8* pAttribIDList, u16& _startID, u16& _endID) if (MAX_LOGLEVEL >= LogTypes::LOG_LEVELS::LDEBUG) { - _dbg_assert_(WII_IPC_WIIMOTE, sequence == SDP_SEQ8); + _dbg_assert_(IOS_WIIMOTE, sequence == SDP_SEQ8); (void)seqSize; } @@ -757,7 +756,7 @@ static int ParseAttribList(u8* pAttribIDList, u16& _startID, u16& _endID) _startID = attribList.Read16(attribOffset); attribOffset += 2; _endID = _startID; - WARN_LOG(WII_IPC_WIIMOTE, "Read just a single attrib - not tested"); + WARN_LOG(IOS_WIIMOTE, "Read just a single attrib - not tested"); PanicAlert("Read just a single attrib - not tested"); } @@ -771,11 +770,11 @@ void WiimoteDevice::SDPSendServiceAttributeResponse(u16 cid, u16 TransactionID, { if (ServiceHandle != 0x10000) { - ERROR_LOG(WII_IPC_WIIMOTE, "Unknown service handle %x", ServiceHandle); + ERROR_LOG(IOS_WIIMOTE, "Unknown service handle %x", ServiceHandle); PanicAlert("Unknown service handle %x", ServiceHandle); } - // _dbg_assert_(WII_IPC_WIIMOTE, ServiceHandle == 0x10000); + // _dbg_assert_(IOS_WIIMOTE, ServiceHandle == 0x10000); u32 contState = ParseCont(pContinuationState); @@ -817,9 +816,9 @@ void WiimoteDevice::HandleSDP(u16 cid, u8* _pData, u32 _Size) // SDP_ServiceSearchRequest case 0x02: { - WARN_LOG(WII_IPC_WIIMOTE, "!!! SDP_ServiceSearchRequest !!!"); + WARN_LOG(IOS_WIIMOTE, "!!! SDP_ServiceSearchRequest !!!"); - _dbg_assert_(WII_IPC_WIIMOTE, _Size == 13); + _dbg_assert_(IOS_WIIMOTE, _Size == 13); u16 TransactionID = buffer.Read16(1); u8* pServiceSearchPattern = buffer.GetPointer(5); @@ -833,7 +832,7 @@ void WiimoteDevice::HandleSDP(u16 cid, u8* _pData, u32 _Size) // SDP_ServiceAttributeRequest case 0x04: { - WARN_LOG(WII_IPC_WIIMOTE, "!!! SDP_ServiceAttributeRequest !!!"); + WARN_LOG(IOS_WIIMOTE, "!!! SDP_ServiceAttributeRequest !!!"); u16 startAttrID, endAttrID; u32 offset = 1; @@ -855,7 +854,7 @@ void WiimoteDevice::HandleSDP(u16 cid, u8* _pData, u32 _Size) break; default: - ERROR_LOG(WII_IPC_WIIMOTE, "WIIMOTE: Unknown SDP command %x", _pData[0]); + ERROR_LOG(IOS_WIIMOTE, "WIIMOTE: Unknown SDP command %x", _pData[0]); PanicAlert("WIIMOTE: Unknown SDP command %x", _pData[0]); break; } @@ -890,9 +889,9 @@ void WiimoteDevice::SendCommandToACL(u8 _Ident, u8 _Code, u8 _CommandLength, u8* memcpy(&DataFrame[Offset], _pCommandData, _CommandLength); - DEBUG_LOG(WII_IPC_WIIMOTE, "Send ACL Command to CPU"); - DEBUG_LOG(WII_IPC_WIIMOTE, " Ident: 0x%02x", _Ident); - DEBUG_LOG(WII_IPC_WIIMOTE, " Code: 0x%02x", _Code); + DEBUG_LOG(IOS_WIIMOTE, "Send ACL Command to CPU"); + DEBUG_LOG(IOS_WIIMOTE, " Ident: 0x%02x", _Ident); + DEBUG_LOG(IOS_WIIMOTE, " Code: 0x%02x", _Code); // send .... m_pHost->SendACLPacket(GetConnectionHandle(), DataFrame, pHeader->length + sizeof(l2cap_hdr_t)); @@ -910,7 +909,7 @@ void WiimoteDevice::ReceiveL2capData(u16 scid, const void* _pData, u32 _Size) Offset += sizeof(l2cap_hdr_t); // Check if we are already reporting on this channel - _dbg_assert_(WII_IPC_WIIMOTE, DoesChannelExist(scid)); + _dbg_assert_(IOS_WIIMOTE, DoesChannelExist(scid)); SChannel& rChannel = m_Channel[scid]; // Add an additional 4 byte header to the Wiimote report diff --git a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteHIDAttr.cpp b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteHIDAttr.cpp index d97ab7db60..7d25836560 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteHIDAttr.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteHIDAttr.cpp @@ -93,7 +93,7 @@ const u8* GetAttribPacket(u32 serviceHandle, u32 cont, u32& _size) if (serviceHandle == 0x10001) { - _dbg_assert_(WII_IPC_WIIMOTE, cont == 0x00); + _dbg_assert_(IOS_WIIMOTE, cont == 0x00); _size = sizeof(packet4_0x10001); return packet4_0x10001; } diff --git a/Source/Core/Core/IOS/USB/USB_HIDv4.cpp b/Source/Core/Core/IOS/USB/USB_HIDv4.cpp index 07c4cba414..f3492a4f77 100644 --- a/Source/Core/Core/IOS/USB/USB_HIDv4.cpp +++ b/Source/Core/Core/IOS/USB/USB_HIDv4.cpp @@ -76,7 +76,7 @@ USB_HIDv4::USB_HIDv4(u32 device_id, const std::string& device_name) : Device(dev int ret = libusb_init(nullptr); if (ret) { - ERROR_LOG(WII_IPC_HID, "libusb_init failed with error: %d", ret); + ERROR_LOG(IOS_HID, "libusb_init failed with error: %d", ret); } else { @@ -158,7 +158,7 @@ IPCCommandResult USB_HIDv4::IOCtl(const IOSIOCtlRequest& request) if (dev_handle == nullptr) { - INFO_LOG(WII_IPC_HID, "Could not find handle: %X", dev_num); + INFO_LOG(IOS_HID, "Could not find handle: %X", dev_num); break; } struct libusb_transfer* transfer = libusb_alloc_transfer(0); @@ -171,7 +171,7 @@ IPCCommandResult USB_HIDv4::IOCtl(const IOSIOCtlRequest& request) (void*)(size_t)request.address, /* no timeout */ 0); libusb_submit_transfer(transfer); - // DEBUG_LOG(WII_IPC_HID, "HID::IOCtl(Control)(%02X, %02X) (BufferIn: (%08x, %i), + // DEBUG_LOG(IOS_HID, "HID::IOCtl(Control)(%02X, %02X) (BufferIn: (%08x, %i), // request.buffer_out: // (%08x, %i)", // bmRequestType, bRequest, BufferIn, request.buffer_in_size, request.buffer_out, @@ -195,7 +195,7 @@ IPCCommandResult USB_HIDv4::IOCtl(const IOSIOCtlRequest& request) if (dev_handle == nullptr) { - INFO_LOG(WII_IPC_HID, "Could not find handle: %X", dev_num); + INFO_LOG(IOS_HID, "Could not find handle: %X", dev_num); break; } @@ -218,13 +218,13 @@ IPCCommandResult USB_HIDv4::IOCtl(const IOSIOCtlRequest& request) EnqueueReply(pending_request, -1); deviceCommandAddress = 0; } - INFO_LOG(WII_IPC_HID, "HID::IOCtl(Shutdown) (BufferIn: (%08x, %i), BufferOut: (%08x, %i)", + INFO_LOG(IOS_HID, "HID::IOCtl(Shutdown) (BufferIn: (%08x, %i), BufferOut: (%08x, %i)", request.buffer_in, request.buffer_in_size, request.buffer_out, request.buffer_out_size); break; } default: - request.Log(GetDeviceName(), LogTypes::WII_IPC_HID); + request.Log(GetDeviceName(), LogTypes::IOS_HID); } return GetDefaultReply(return_value); @@ -237,19 +237,19 @@ bool USB_HIDv4::ClaimDevice(libusb_device_handle* dev) { if ((ret = libusb_detach_kernel_driver(dev, 0)) && ret != LIBUSB_ERROR_NOT_SUPPORTED) { - ERROR_LOG(WII_IPC_HID, "libusb_detach_kernel_driver failed with error: %d", ret); + ERROR_LOG(IOS_HID, "libusb_detach_kernel_driver failed with error: %d", ret); return false; } } else if (ret != 0 && ret != LIBUSB_ERROR_NOT_SUPPORTED) { - ERROR_LOG(WII_IPC_HID, "libusb_kernel_driver_active error ret = %d", ret); + ERROR_LOG(IOS_HID, "libusb_kernel_driver_active error ret = %d", ret); return false; } if ((ret = libusb_claim_interface(dev, 0))) { - ERROR_LOG(WII_IPC_HID, "libusb_claim_interface failed with error: %d", ret); + ERROR_LOG(IOS_HID, "libusb_claim_interface failed with error: %d", ret); return false; } @@ -258,8 +258,8 @@ bool USB_HIDv4::ClaimDevice(libusb_device_handle* dev) IPCCommandResult USB_HIDv4::IOCtlV(const IOSIOCtlVRequest& request) { - Dolphin_Debugger::PrintCallstack(LogTypes::WII_IPC_HID, LogTypes::LWARNING); - request.DumpUnknown(GetDeviceName(), LogTypes::WII_IPC_HID); + Dolphin_Debugger::PrintCallstack(LogTypes::IOS_HID, LogTypes::LWARNING); + request.DumpUnknown(GetDeviceName(), LogTypes::IOS_HID); return GetDefaultReply(IPC_SUCCESS); } @@ -313,7 +313,7 @@ void USB_HIDv4::FillOutDevices(const IOSIOCtlRequest& request) libusb_device** list; // libusb_device *found = nullptr; ssize_t cnt = libusb_get_device_list(nullptr, &list); - INFO_LOG(WII_IPC_HID, "Found %ld viable USB devices.", cnt); + INFO_LOG(IOS_HID, "Found %ld viable USB devices.", cnt); for (d = 0; d < cnt; d++) { libusb_device* device = list[d]; @@ -322,7 +322,7 @@ void USB_HIDv4::FillOutDevices(const IOSIOCtlRequest& request) if (dRet) { // could not aquire the descriptor, no point in trying to use it. - WARN_LOG(WII_IPC_HID, "libusb_get_device_descriptor failed with error: %d", dRet); + WARN_LOG(IOS_HID, "libusb_get_device_descriptor failed with error: %d", dRet); continue; } OffsetStart = OffsetBuffer; @@ -384,7 +384,7 @@ void USB_HIDv4::FillOutDevices(const IOSIOCtlRequest& request) else { if (cRet) - WARN_LOG(WII_IPC_HID, "libusb_get_config_descriptor failed with: %d", cRet); + WARN_LOG(IOS_HID, "libusb_get_config_descriptor failed with: %d", cRet); deviceValid = false; OffsetBuffer = OffsetStart; } @@ -405,13 +405,12 @@ void USB_HIDv4::FillOutDevices(const IOSIOCtlRequest& request) if (devNum < 0) { // too many devices to handle. - ERROR_LOG(WII_IPC_HID, - "Exhausted device list, there are way too many usb devices plugged in."); + ERROR_LOG(IOS_HID, "Exhausted device list, there are way too many usb devices plugged in."); OffsetBuffer = OffsetStart; continue; } - INFO_LOG(WII_IPC_HID, "Found device with Vendor: %X Product: %X Devnum: %d", desc.idVendor, + INFO_LOG(IOS_HID, "Found device with Vendor: %X Product: %X Devnum: %d", desc.idVendor, desc.idProduct, devNum); Memory::Write_U32(devNum, OffsetStart + 4); // write device num @@ -424,7 +423,7 @@ void USB_HIDv4::FillOutDevices(const IOSIOCtlRequest& request) u16 check_cur = (u16)(hidDeviceAliases[i] >> 48); if (hidDeviceAliases[i] != 0 && check_cur != check) { - INFO_LOG(WII_IPC_HID, "Removing: device %d %hX %hX", i, check, check_cur); + INFO_LOG(IOS_HID, "Removing: device %d %hX %hX", i, check, check_cur); std::lock_guard lk(m_open_devices_mutex); if (m_open_devices.find(i) != m_open_devices.end()) { @@ -494,14 +493,14 @@ libusb_device_handle* USB_HIDv4::GetDeviceByDevNum(u32 devNum) { if (dRet) { - ERROR_LOG(WII_IPC_HID, "Dolphin does not have access to this device: Bus %03d Device " - "%03d: ID ????:???? (couldn't get id).", + ERROR_LOG(IOS_HID, "Dolphin does not have access to this device: Bus %03d Device " + "%03d: ID ????:???? (couldn't get id).", bus, port); } else { ERROR_LOG( - WII_IPC_HID, + IOS_HID, "Dolphin does not have access to this device: Bus %03d Device %03d: ID %04X:%04X.", bus, port, desc.idVendor, desc.idProduct); } @@ -513,21 +512,21 @@ libusb_device_handle* USB_HIDv4::GetDeviceByDevNum(u32 devNum) { // Max of one warning. has_warned_about_drivers = true; - WARN_LOG(WII_IPC_HID, "Please install the libusb drivers for the device %04X:%04X", + WARN_LOG(IOS_HID, "Please install the libusb drivers for the device %04X:%04X", desc.idVendor, desc.idProduct); } } #endif else { - ERROR_LOG(WII_IPC_HID, "libusb_open failed to open device with error = %d", ret); + ERROR_LOG(IOS_HID, "libusb_open failed to open device with error = %d", ret); } continue; } if (!ClaimDevice(handle)) { - ERROR_LOG(WII_IPC_HID, "Could not claim the device for handle: %X", devNum); + ERROR_LOG(IOS_HID, "Could not claim the device for handle: %X", devNum); libusb_close(handle); continue; } diff --git a/Source/Core/Core/IOS/USB/USB_KBD.cpp b/Source/Core/Core/IOS/USB/USB_KBD.cpp index 0ac68a238f..5f35a3bc39 100644 --- a/Source/Core/Core/IOS/USB/USB_KBD.cpp +++ b/Source/Core/Core/IOS/USB/USB_KBD.cpp @@ -44,7 +44,7 @@ USB_KBD::USB_KBD(u32 device_id, const std::string& device_name) : Device(device_ IOSReturnCode USB_KBD::Open(const IOSOpenRequest& request) { - INFO_LOG(WII_IPC_HLE, "USB_KBD: Open"); + INFO_LOG(IOS, "USB_KBD: Open"); IniFile ini; ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); ini.GetOrCreateSection("USB Keyboard")->Get("Layout", &m_KeyboardLayout, KBD_LAYOUT_QWERTY); diff --git a/Source/Core/Core/IOS/WFS/WFSI.cpp b/Source/Core/Core/IOS/WFS/WFSI.cpp index e50bd0db11..641e43d5f3 100644 --- a/Source/Core/Core/IOS/WFS/WFSI.cpp +++ b/Source/Core/Core/IOS/WFS/WFSI.cpp @@ -37,7 +37,7 @@ void ARCUnpacker::Extract(const WriteCallback& callback) u32 fourcc = Common::swap32(m_whole_file.data()); if (fourcc != 0x55AA382D) { - ERROR_LOG(WII_IPC_HLE, "ARCUnpacker: invalid fourcc (%08x)", fourcc); + ERROR_LOG(IOS, "ARCUnpacker: invalid fourcc (%08x)", fourcc); return; } @@ -95,12 +95,12 @@ IPCCommandResult WFSI::IOCtl(const IOSIOCtlRequest& request) u32 tmd_addr = Memory::Read_U32(request.buffer_in); u32 tmd_size = Memory::Read_U32(request.buffer_in + 4); - INFO_LOG(WII_IPC_HLE, "IOCTL_WFSI_PREPARE_DEVICE"); + INFO_LOG(IOS, "IOCTL_WFSI_PREPARE_DEVICE"); constexpr u32 MAX_TMD_SIZE = 0x4000; if (tmd_size > MAX_TMD_SIZE) { - ERROR_LOG(WII_IPC_HLE, "IOCTL_WFSI_INIT: TMD size too large (%d)", tmd_size); + ERROR_LOG(IOS, "IOCTL_WFSI_INIT: TMD size too large (%d)", tmd_size); return_error_code = IPC_EINVAL; break; } @@ -137,7 +137,7 @@ IPCCommandResult WFSI::IOCtl(const IOSIOCtlRequest& request) TMDReader::Content content_info; if (!m_tmd.FindContentById(content_id, &content_info)) { - WARN_LOG(WII_IPC_HLE, "%s: Content id %08x not found", ioctl_name, content_id); + WARN_LOG(IOS, "%s: Content id %08x not found", ioctl_name, content_id); return_error_code = -10003; break; } @@ -145,7 +145,7 @@ IPCCommandResult WFSI::IOCtl(const IOSIOCtlRequest& request) memset(m_aes_iv, 0, sizeof(m_aes_iv)); m_aes_iv[0] = content_info.index >> 8; m_aes_iv[1] = content_info.index & 0xFF; - INFO_LOG(WII_IPC_HLE, "%s: Content id %08x found at index %d", ioctl_name, content_id, + INFO_LOG(IOS, "%s: Content id %08x found at index %d", ioctl_name, content_id, content_info.index); m_arc_unpacker.Reset(); @@ -162,8 +162,8 @@ IPCCommandResult WFSI::IOCtl(const IOSIOCtlRequest& request) u32 content_id = Memory::Read_U32(request.buffer_in + 0xC); u32 input_ptr = Memory::Read_U32(request.buffer_in + 0x10); u32 input_size = Memory::Read_U32(request.buffer_in + 0x14); - INFO_LOG(WII_IPC_HLE, "%s: %08x bytes of data at %08x from content id %d", ioctl_name, - content_id, input_ptr, input_size); + INFO_LOG(IOS, "%s: %08x bytes of data at %08x from content id %d", ioctl_name, content_id, + input_ptr, input_size); std::vector decrypted(input_size); mbedtls_aes_crypt_cbc(&m_aes_ctx, MBEDTLS_AES_DECRYPT, input_size, m_aes_iv, @@ -179,17 +179,17 @@ IPCCommandResult WFSI::IOCtl(const IOSIOCtlRequest& request) const char* ioctl_name = request.request == IOCTL_WFSI_FINALIZE_PROFILE ? "IOCTL_WFSI_FINALIZE_PROFILE" : "IOCTL_WFSI_FINALIZE_CONTENT"; - INFO_LOG(WII_IPC_HLE, "%s", ioctl_name); + INFO_LOG(IOS, "%s", ioctl_name); auto callback = [this](const std::string& filename, const std::vector& bytes) { - INFO_LOG(WII_IPC_HLE, "Extract: %s (%zd bytes)", filename.c_str(), bytes.size()); + INFO_LOG(IOS, "Extract: %s (%zd bytes)", filename.c_str(), bytes.size()); std::string path = WFS::NativePath(m_base_extract_path + "/" + filename); File::CreateFullPath(path); File::IOFile f(path, "wb"); if (!f) { - ERROR_LOG(WII_IPC_HLE, "Could not extract %s to %s", filename.c_str(), path.c_str()); + ERROR_LOG(IOS, "Could not extract %s to %s", filename.c_str(), path.c_str()); return; } f.WriteBytes(bytes.data(), bytes.size()); @@ -206,25 +206,25 @@ IPCCommandResult WFSI::IOCtl(const IOSIOCtlRequest& request) // Bytes 0-4: ?? // Bytes 4-8: game id // Bytes 1c-1e: title id? - WARN_LOG(WII_IPC_HLE, "IOCTL_WFSI_DELETE_TITLE: unimplemented"); + WARN_LOG(IOS, "IOCTL_WFSI_DELETE_TITLE: unimplemented"); break; case IOCTL_WFSI_IMPORT_TITLE: - WARN_LOG(WII_IPC_HLE, "IOCTL_WFSI_IMPORT_TITLE: unimplemented"); + WARN_LOG(IOS, "IOCTL_WFSI_IMPORT_TITLE: unimplemented"); break; case IOCTL_WFSI_INIT: // Nothing to do. - INFO_LOG(WII_IPC_HLE, "IOCTL_WFSI_INIT"); + INFO_LOG(IOS, "IOCTL_WFSI_INIT"); break; case IOCTL_WFSI_SET_DEVICE_NAME: - INFO_LOG(WII_IPC_HLE, "IOCTL_WFSI_SET_DEVICE_NAME"); + INFO_LOG(IOS, "IOCTL_WFSI_SET_DEVICE_NAME"); m_device_name = Memory::GetString(request.buffer_in); break; case IOCTL_WFSI_APPLY_TITLE_PROFILE: - INFO_LOG(WII_IPC_HLE, "IOCTL_WFSI_APPLY_TITLE_PROFILE"); + INFO_LOG(IOS, "IOCTL_WFSI_APPLY_TITLE_PROFILE"); m_base_extract_path = StringFromFormat( "/vol/%s/_install/%c%c%c%c/content", m_device_name.c_str(), @@ -238,7 +238,7 @@ IPCCommandResult WFSI::IOCtl(const IOSIOCtlRequest& request) // TODO(wfs): Should be returning an error. However until we have // everything properly stubbed it's easier to simulate the methods // succeeding. - request.DumpUnknown(GetDeviceName(), LogTypes::WII_IPC_HLE, LogTypes::LWARNING); + request.DumpUnknown(GetDeviceName(), LogTypes::IOS, LogTypes::LWARNING); Memory::Memset(request.buffer_out, 0, request.buffer_out_size); break; } diff --git a/Source/Core/Core/IOS/WFS/WFSSRV.cpp b/Source/Core/Core/IOS/WFS/WFSSRV.cpp index 0f863d0f04..ea0fab0d7f 100644 --- a/Source/Core/Core/IOS/WFS/WFSSRV.cpp +++ b/Source/Core/Core/IOS/WFS/WFSSRV.cpp @@ -41,18 +41,18 @@ IPCCommandResult WFSSRV::IOCtl(const IOSIOCtlRequest& request) { case IOCTL_WFS_INIT: // TODO(wfs): Implement. - INFO_LOG(WII_IPC_HLE, "IOCTL_WFS_INIT"); + INFO_LOG(IOS, "IOCTL_WFS_INIT"); break; case IOCTL_WFS_DEVICE_INFO: - INFO_LOG(WII_IPC_HLE, "IOCTL_WFS_DEVICE_INFO"); + INFO_LOG(IOS, "IOCTL_WFS_DEVICE_INFO"); Memory::Write_U64(16ull << 30, request.buffer_out); // 16GB storage. Memory::Write_U8(4, request.buffer_out + 8); break; case IOCTL_WFS_GET_DEVICE_NAME: { - INFO_LOG(WII_IPC_HLE, "IOCTL_WFS_GET_DEVICE_NAME"); + INFO_LOG(IOS, "IOCTL_WFS_GET_DEVICE_NAME"); Memory::Write_U8(static_cast(m_device_name.size()), request.buffer_out); Memory::CopyToEmu(request.buffer_out + 1, m_device_name.data(), m_device_name.size()); break; @@ -60,14 +60,14 @@ IPCCommandResult WFSSRV::IOCtl(const IOSIOCtlRequest& request) case IOCTL_WFS_ATTACH_DETACH_2: // TODO(wfs): Implement. - INFO_LOG(WII_IPC_HLE, "IOCTL_WFS_ATTACH_DETACH_2(%u)", request.request); + INFO_LOG(IOS, "IOCTL_WFS_ATTACH_DETACH_2(%u)", request.request); Memory::Write_U32(1, request.buffer_out); Memory::Write_U32(0, request.buffer_out + 4); // device id? Memory::Write_U32(0, request.buffer_out + 8); break; case IOCTL_WFS_ATTACH_DETACH: - INFO_LOG(WII_IPC_HLE, "IOCTL_WFS_ATTACH_DETACH(%u)", request.request); + INFO_LOG(IOS, "IOCTL_WFS_ATTACH_DETACH(%u)", request.request); Memory::Write_U32(1, request.buffer_out); Memory::Write_U32(0, request.buffer_out + 4); Memory::Write_U32(0, request.buffer_out + 8); @@ -76,18 +76,18 @@ IPCCommandResult WFSSRV::IOCtl(const IOSIOCtlRequest& request) // TODO(wfs): Globbing is not really implemented, we just fake the one case // (listing /vol/*) which is required to get the installer to work. case IOCTL_WFS_GLOB_START: - INFO_LOG(WII_IPC_HLE, "IOCTL_WFS_GLOB_START(%u)", request.request); + INFO_LOG(IOS, "IOCTL_WFS_GLOB_START(%u)", request.request); Memory::Memset(request.buffer_out, 0, request.buffer_out_size); Memory::CopyToEmu(request.buffer_out + 0x14, m_device_name.data(), m_device_name.size()); break; case IOCTL_WFS_GLOB_NEXT: - INFO_LOG(WII_IPC_HLE, "IOCTL_WFS_GLOB_NEXT(%u)", request.request); + INFO_LOG(IOS, "IOCTL_WFS_GLOB_NEXT(%u)", request.request); return_error_code = WFS_EEMPTY; break; case IOCTL_WFS_GLOB_END: - INFO_LOG(WII_IPC_HLE, "IOCTL_WFS_GLOB_END(%u)", request.request); + INFO_LOG(IOS, "IOCTL_WFS_GLOB_END(%u)", request.request); Memory::Memset(request.buffer_out, 0, request.buffer_out_size); break; @@ -106,13 +106,13 @@ IPCCommandResult WFSSRV::IOCtl(const IOSIOCtlRequest& request) if (!fd_obj->Open()) { - ERROR_LOG(WII_IPC_HLE, "IOCTL_WFS_OPEN(%s, %d): error opening file", path.c_str(), mode); + ERROR_LOG(IOS, "IOCTL_WFS_OPEN(%s, %d): error opening file", path.c_str(), mode); ReleaseFileDescriptor(fd); return_error_code = -1; // TODO(wfs): proper error code. break; } - INFO_LOG(WII_IPC_HLE, "IOCTL_WFS_OPEN(%s, %d) -> %d", path.c_str(), mode, fd); + INFO_LOG(IOS, "IOCTL_WFS_OPEN(%s, %d) -> %d", path.c_str(), mode, fd); Memory::Write_U16(fd, request.buffer_out + 0x14); break; } @@ -120,7 +120,7 @@ IPCCommandResult WFSSRV::IOCtl(const IOSIOCtlRequest& request) case IOCTL_WFS_CLOSE: { u16 fd = Memory::Read_U16(request.buffer_in + 0x4); - INFO_LOG(WII_IPC_HLE, "IOCTL_WFS_CLOSE(%d)", fd); + INFO_LOG(IOS, "IOCTL_WFS_CLOSE(%d)", fd); ReleaseFileDescriptor(fd); break; } @@ -134,7 +134,7 @@ IPCCommandResult WFSSRV::IOCtl(const IOSIOCtlRequest& request) FileDescriptor* fd_obj = FindFileDescriptor(fd); if (fd_obj == nullptr) { - ERROR_LOG(WII_IPC_HLE, "IOCTL_WFS_READ: invalid file descriptor %d", fd); + ERROR_LOG(IOS, "IOCTL_WFS_READ: invalid file descriptor %d", fd); return_error_code = -1; // TODO(wfs): proper error code. break; } @@ -147,7 +147,7 @@ IPCCommandResult WFSSRV::IOCtl(const IOSIOCtlRequest& request) } fd_obj->position += read_bytes; - INFO_LOG(WII_IPC_HLE, "IOCTL_WFS_READ: read %zd bytes from FD %d (%s)", read_bytes, fd, + INFO_LOG(IOS, "IOCTL_WFS_READ: read %zd bytes from FD %d (%s)", read_bytes, fd, fd_obj->path.c_str()); return_error_code = static_cast(read_bytes); break; @@ -156,7 +156,7 @@ IPCCommandResult WFSSRV::IOCtl(const IOSIOCtlRequest& request) default: // TODO(wfs): Should be returning -3. However until we have everything // properly stubbed it's easier to simulate the methods succeeding. - request.DumpUnknown(GetDeviceName(), LogTypes::WII_IPC_HLE, LogTypes::LWARNING); + request.DumpUnknown(GetDeviceName(), LogTypes::IOS, LogTypes::LWARNING); Memory::Memset(request.buffer_out, 0, request.buffer_out_size); break; } @@ -220,7 +220,7 @@ bool WFSSRV::FileDescriptor::Open() } else { - ERROR_LOG(WII_IPC_HLE, "WFSOpen: invalid mode %d", mode); + ERROR_LOG(IOS, "WFSOpen: invalid mode %d", mode); return false; } diff --git a/Source/Core/Core/WiiRoot.cpp b/Source/Core/Core/WiiRoot.cpp index d0be403339..dad2252cf1 100644 --- a/Source/Core/Core/WiiRoot.cpp +++ b/Source/Core/Core/WiiRoot.cpp @@ -23,11 +23,11 @@ void InitializeWiiRoot(bool use_temporary) s_temp_wii_root = File::CreateTempDir(); if (s_temp_wii_root.empty()) { - ERROR_LOG(WII_IPC_FILEIO, "Could not create temporary directory"); + ERROR_LOG(IOS_FILEIO, "Could not create temporary directory"); return; } File::CopyDir(File::GetSysDirectory() + WII_USER_DIR, s_temp_wii_root); - WARN_LOG(WII_IPC_FILEIO, "Using temporary directory %s for minimal Wii FS", + WARN_LOG(IOS_FILEIO, "Using temporary directory %s for minimal Wii FS", s_temp_wii_root.c_str()); static bool s_registered; if (!s_registered) diff --git a/Source/Core/Core/ec_wii.cpp b/Source/Core/Core/ec_wii.cpp index c814863cc4..b756f666a2 100644 --- a/Source/Core/Core/ec_wii.cpp +++ b/Source/Core/Core/ec_wii.cpp @@ -129,24 +129,23 @@ EcWii::EcWii() { init = false; - INFO_LOG(WII_IPC_ES, "Successfully loaded keys.bin created by: %s", BootMiiKeysBin.creator); + INFO_LOG(IOS_ES, "Successfully loaded keys.bin created by: %s", BootMiiKeysBin.creator); } else { - ERROR_LOG(WII_IPC_ES, - "Failed to read keys.bin, check it is the correct size of %08zX bytes.", + ERROR_LOG(IOS_ES, "Failed to read keys.bin, check it is the correct size of %08zX bytes.", sizeof(BootMiiKeysBin)); } } else { - ERROR_LOG(WII_IPC_ES, "Failed to open keys.bin, maybe a permissions error or it is in use?"); + ERROR_LOG(IOS_ES, "Failed to open keys.bin, maybe a permissions error or it is in use?"); } } else { ERROR_LOG( - WII_IPC_ES, + IOS_ES, "%s could not be found. Using default values. We recommend you grab keys.bin from BootMii.", keys_path.c_str()); }