From dd0b8047eb8985ff398fd6e5e4fa11d1ea111e23 Mon Sep 17 00:00:00 2001 From: JamePeng Date: Sun, 14 Feb 2016 19:53:32 +0800 Subject: Reorganize the ndm service path for dummy implement function SuspendDaemons , ResumeDaemons , OverrideDefaultDaemons The NDM file move to /core/hle/service/ndm/ now! --- src/common/logging/backend.cpp | 1 + src/common/logging/log.h | 1 + src/core/CMakeLists.txt | 6 +++-- src/core/hle/service/ndm/ndm.cpp | 47 ++++++++++++++++++++++++++++++++++ src/core/hle/service/ndm/ndm.h | 52 ++++++++++++++++++++++++++++++++++++++ src/core/hle/service/ndm/ndm_u.cpp | 42 ++++++++++++++++++++++++++++++ src/core/hle/service/ndm/ndm_u.h | 22 ++++++++++++++++ src/core/hle/service/ndm_u.cpp | 45 --------------------------------- src/core/hle/service/ndm_u.h | 25 ------------------ src/core/hle/service/service.cpp | 5 ++-- 10 files changed, 172 insertions(+), 74 deletions(-) create mode 100644 src/core/hle/service/ndm/ndm.cpp create mode 100644 src/core/hle/service/ndm/ndm.h create mode 100644 src/core/hle/service/ndm/ndm_u.cpp create mode 100644 src/core/hle/service/ndm/ndm_u.h delete mode 100644 src/core/hle/service/ndm_u.cpp delete mode 100644 src/core/hle/service/ndm_u.h (limited to 'src') diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 54291429a..4c86151ab 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -42,6 +42,7 @@ namespace Log { SUB(Service, AM) \ SUB(Service, PTM) \ SUB(Service, LDR) \ + SUB(Service, NDM) \ SUB(Service, NIM) \ SUB(Service, NWM) \ SUB(Service, CAM) \ diff --git a/src/common/logging/log.h b/src/common/logging/log.h index 4b01805ae..e4c39c308 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -57,6 +57,7 @@ enum class Class : ClassType { Service_AM, ///< The AM (Application manager) service Service_PTM, ///< The PTM (Power status & misc.) service Service_LDR, ///< The LDR (3ds dll loader) service + Service_NDM, ///< The NDM (Network daemon manager) service Service_NIM, ///< The NIM (Network interface manager) service Service_NWM, ///< The NWM (Network wlan manager) service Service_CAM, ///< The CAM (Camera) service diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 35b61dada..3473e2f5b 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -87,7 +87,8 @@ set(SRCS hle/service/ir/ir_user.cpp hle/service/ldr_ro.cpp hle/service/mic_u.cpp - hle/service/ndm_u.cpp + hle/service/ndm/ndm.cpp + hle/service/ndm/ndm_u.cpp hle/service/news/news.cpp hle/service/news/news_s.cpp hle/service/news/news_u.cpp @@ -218,7 +219,8 @@ set(HEADERS hle/service/ir/ir_user.h hle/service/ldr_ro.h hle/service/mic_u.h - hle/service/ndm_u.h + hle/service/ndm/ndm.h + hle/service/ndm/ndm_u.h hle/service/news/news.h hle/service/news/news_s.h hle/service/news/news_u.h diff --git a/src/core/hle/service/ndm/ndm.cpp b/src/core/hle/service/ndm/ndm.cpp new file mode 100644 index 000000000..47076a7b8 --- /dev/null +++ b/src/core/hle/service/ndm/ndm.cpp @@ -0,0 +1,47 @@ +// Copyright 2016 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "common/common_types.h" +#include "common/logging/log.h" +#include "core/hle/service/service.h" +#include "core/hle/service/ndm/ndm.h" +#include "core/hle/service/ndm/ndm_u.h" + +namespace Service { +namespace NDM { + +void SuspendDaemons(Service::Interface* self) { + u32* cmd_buff = Kernel::GetCommandBuffer(); + + LOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x%08X ", cmd_buff[1]); + + cmd_buff[1] = RESULT_SUCCESS.raw; // No error +} + +void ResumeDaemons(Service::Interface* self) { + u32* cmd_buff = Kernel::GetCommandBuffer(); + + LOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x%08X ", cmd_buff[1]); + + cmd_buff[1] = RESULT_SUCCESS.raw; // No error +} + +void OverrideDefaultDaemons(Service::Interface* self) { + u32* cmd_buff = Kernel::GetCommandBuffer(); + + LOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x%08X ", cmd_buff[1]); + + cmd_buff[1] = RESULT_SUCCESS.raw; // No error +} + +void Init() { + AddService(new NDM_U_Interface); +} + +void Shutdown() { + +} + +}// namespace NDM +}// namespace Service diff --git a/src/core/hle/service/ndm/ndm.h b/src/core/hle/service/ndm/ndm.h new file mode 100644 index 000000000..734730f8c --- /dev/null +++ b/src/core/hle/service/ndm/ndm.h @@ -0,0 +1,52 @@ +// Copyright 2016 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "common/common_types.h" + +namespace Service { + +class Interface; + +namespace NDM { + +/** + * SuspendDaemons + * Inputs: + * 0 : Command header (0x00020082) + * 1 : Daemon bit mask + * Outputs: + * 1 : Result, 0 on success, otherwise error code + */ +void SuspendDaemons(Service::Interface* self); + +/** + * ResumeDaemons + * Inputs: + * 0 : Command header (0x00020082) + * 1 : Daemon bit mask + * Outputs: + * 1 : Result, 0 on success, otherwise error code + */ +void ResumeDaemons(Service::Interface* self); + +/** + * OverrideDefaultDaemons + * Inputs: + * 0 : Command header (0x00020082) + * 1 : Daemon bit mask + * Outputs: + * 1 : Result, 0 on success, otherwise error code + */ +void OverrideDefaultDaemons(Service::Interface* self); + +/// Initialize NDM service +void Init(); + +/// Shutdown NDM service +void Shutdown(); + +}// namespace NDM +}// namespace Service diff --git a/src/core/hle/service/ndm/ndm_u.cpp b/src/core/hle/service/ndm/ndm_u.cpp new file mode 100644 index 000000000..bf95cc7aa --- /dev/null +++ b/src/core/hle/service/ndm/ndm_u.cpp @@ -0,0 +1,42 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "core/hle/service/ndm/ndm.h" +#include "core/hle/service/ndm/ndm_u.h" + +namespace Service { +namespace NDM { + +const Interface::FunctionInfo FunctionTable[] = { + {0x00010042, nullptr, "EnterExclusiveState"}, + {0x00020002, nullptr, "LeaveExclusiveState"}, + {0x00030000, nullptr, "QueryExclusiveMode"}, + {0x00040002, nullptr, "LockState"}, + {0x00050002, nullptr, "UnlockState"}, + {0x00060040, SuspendDaemons, "SuspendDaemons"}, + {0x00070040, ResumeDaemons, "ResumeDaemons"}, + {0x00080040, nullptr, "DisableWifiUsage"}, + {0x00090000, nullptr, "EnableWifiUsage"}, + {0x000A0000, nullptr, "GetCurrentState"}, + {0x000B0000, nullptr, "GetTargetState"}, + {0x000C0000, nullptr, ""}, + {0x000D0040, nullptr, "QueryStatus"}, + {0x000E0040, nullptr, "GetDaemonDisableCount"}, + {0x000F0000, nullptr, "GetSchedulerDisableCount"}, + {0x00100040, nullptr, "SetScanInterval"}, + {0x00110000, nullptr, "GetScanInterval"}, + {0x00120040, nullptr, "SetRetryInterval"}, + {0x00130000, nullptr, "GetRetryInterval"}, + {0x00140040, OverrideDefaultDaemons, "OverrideDefaultDaemons"}, + {0x00150000, nullptr, "ResetDefaultDaemons"}, + {0x00160000, nullptr, "GetDefaultDaemons"}, + {0x00170000, nullptr, "ClearHalfAwakeMacFilter"}, +}; + +NDM_U_Interface::NDM_U_Interface() { + Register(FunctionTable); +} + +} // namespace NDM +} // namespace Service diff --git a/src/core/hle/service/ndm/ndm_u.h b/src/core/hle/service/ndm/ndm_u.h new file mode 100644 index 000000000..d567abc84 --- /dev/null +++ b/src/core/hle/service/ndm/ndm_u.h @@ -0,0 +1,22 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "core/hle/service/service.h" + +namespace Service { +namespace NDM { + +class NDM_U_Interface : public Service::Interface { +public: + NDM_U_Interface(); + + std::string GetPortName() const override { + return "ndm:u"; + } +}; + +} // namespace NDM +} // namespace Service diff --git a/src/core/hle/service/ndm_u.cpp b/src/core/hle/service/ndm_u.cpp deleted file mode 100644 index 8fdf1ef90..000000000 --- a/src/core/hle/service/ndm_u.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include "core/hle/service/ndm_u.h" - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// Namespace NDM_U - -namespace NDM_U { - -const Interface::FunctionInfo FunctionTable[] = { - {0x00010042, nullptr, "EnterExclusiveState"}, - {0x00020002, nullptr, "LeaveExclusiveState"}, - {0x00030000, nullptr, "QueryExclusiveMode"}, - {0x00040002, nullptr, "LockState"}, - {0x00050002, nullptr, "UnlockState"}, - {0x00060040, nullptr, "SuspendDaemons"}, - {0x00070040, nullptr, "ResumeDaemons"}, - {0x00080040, nullptr, "DisableWifiUsage"}, - {0x00090000, nullptr, "EnableWifiUsage"}, - {0x000A0000, nullptr, "GetCurrentState"}, - {0x000B0000, nullptr, "GetTargetState"}, - {0x000C0000, nullptr, ""}, - {0x000D0040, nullptr, "QueryStatus"}, - {0x000E0040, nullptr, "GetDaemonDisableCount"}, - {0x000F0000, nullptr, "GetSchedulerDisableCount"}, - {0x00100040, nullptr, "SetScanInterval"}, - {0x00110000, nullptr, "GetScanInterval"}, - {0x00120040, nullptr, "SetRetryInterval"}, - {0x00130000, nullptr, "GetRetryInterval"}, - {0x00140040, nullptr, "OverrideDefaultDaemons"}, - {0x00150000, nullptr, "ResetDefaultDaemons"}, - {0x00160000, nullptr, "GetDefaultDaemons"}, - {0x00170000, nullptr, "ClearHalfAwakeMacFilter"}, -}; - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// Interface class - -Interface::Interface() { - Register(FunctionTable); -} - -} // namespace diff --git a/src/core/hle/service/ndm_u.h b/src/core/hle/service/ndm_u.h deleted file mode 100644 index 51c4b3902..000000000 --- a/src/core/hle/service/ndm_u.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include "core/hle/service/service.h" - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// Namespace NDM - -// No idea what this is - -namespace NDM_U { - -class Interface : public Service::Interface { -public: - Interface(); - - std::string GetPortName() const override { - return "ndm:u"; - } -}; - -} // namespace diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 0de0b13a3..35b648409 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -16,7 +16,6 @@ #include "core/hle/service/http_c.h" #include "core/hle/service/ldr_ro.h" #include "core/hle/service/mic_u.h" -#include "core/hle/service/ndm_u.h" #include "core/hle/service/ns_s.h" #include "core/hle/service/nwm_uds.h" #include "core/hle/service/pm_app.h" @@ -35,6 +34,7 @@ #include "core/hle/service/cfg/cfg.h" #include "core/hle/service/hid/hid.h" #include "core/hle/service/ir/ir.h" +#include "core/hle/service/ndm/ndm.h" #include "core/hle/service/news/news.h" #include "core/hle/service/nim/nim.h" #include "core/hle/service/ptm/ptm.h" @@ -114,6 +114,7 @@ void Init() { Service::HID::Init(); Service::IR::Init(); Service::NEWS::Init(); + Service::NDM::Init(); Service::NIM::Init(); Service::PTM::Init(); @@ -126,7 +127,6 @@ void Init() { AddService(new HTTP_C::Interface); AddService(new LDR_RO::Interface); AddService(new MIC_U::Interface); - AddService(new NDM_U::Interface); AddService(new NS_S::Interface); AddService(new NWM_UDS::Interface); AddService(new PM_APP::Interface); @@ -141,6 +141,7 @@ void Init() { void Shutdown() { Service::PTM::Shutdown(); + Service::NDM::Shutdown(); Service::NIM::Shutdown(); Service::NEWS::Shutdown(); Service::IR::Shutdown(); -- cgit v1.2.3