diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/nifm/nifm.cpp | 84 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm.h | 20 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm_a.cpp | 19 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm_a.h | 12 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm_s.cpp | 19 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm_s.h | 12 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm_u.cpp | 19 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm_u.h | 12 |
8 files changed, 75 insertions, 122 deletions
diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index e6f05eae5..d4108eafd 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp | |||
| @@ -96,6 +96,48 @@ public: | |||
| 96 | } | 96 | } |
| 97 | }; | 97 | }; |
| 98 | 98 | ||
| 99 | class IGeneralService final : public ServiceFramework<IGeneralService> { | ||
| 100 | public: | ||
| 101 | IGeneralService(); | ||
| 102 | |||
| 103 | private: | ||
| 104 | void GetClientId(Kernel::HLERequestContext& ctx) { | ||
| 105 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | ||
| 106 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 107 | rb.Push(RESULT_SUCCESS); | ||
| 108 | rb.Push<u64>(0); | ||
| 109 | } | ||
| 110 | void CreateScanRequest(Kernel::HLERequestContext& ctx) { | ||
| 111 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 112 | |||
| 113 | rb.Push(RESULT_SUCCESS); | ||
| 114 | rb.PushIpcInterface<IScanRequest>(); | ||
| 115 | |||
| 116 | LOG_DEBUG(Service_NIFM, "called"); | ||
| 117 | } | ||
| 118 | void CreateRequest(Kernel::HLERequestContext& ctx) { | ||
| 119 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 120 | |||
| 121 | rb.Push(RESULT_SUCCESS); | ||
| 122 | rb.PushIpcInterface<IRequest>(); | ||
| 123 | |||
| 124 | LOG_DEBUG(Service_NIFM, "called"); | ||
| 125 | } | ||
| 126 | void RemoveNetworkProfile(Kernel::HLERequestContext& ctx) { | ||
| 127 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | ||
| 128 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 129 | rb.Push(RESULT_SUCCESS); | ||
| 130 | } | ||
| 131 | void CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx) { | ||
| 132 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 133 | |||
| 134 | rb.Push(RESULT_SUCCESS); | ||
| 135 | rb.PushIpcInterface<INetworkProfile>(); | ||
| 136 | |||
| 137 | LOG_DEBUG(Service_NIFM, "called"); | ||
| 138 | } | ||
| 139 | }; | ||
| 140 | |||
| 99 | IGeneralService::IGeneralService() : ServiceFramework("IGeneralService") { | 141 | IGeneralService::IGeneralService() : ServiceFramework("IGeneralService") { |
| 100 | static const FunctionInfo functions[] = { | 142 | static const FunctionInfo functions[] = { |
| 101 | {1, &IGeneralService::GetClientId, "GetClientId"}, | 143 | {1, &IGeneralService::GetClientId, "GetClientId"}, |
| @@ -137,50 +179,28 @@ IGeneralService::IGeneralService() : ServiceFramework("IGeneralService") { | |||
| 137 | RegisterHandlers(functions); | 179 | RegisterHandlers(functions); |
| 138 | } | 180 | } |
| 139 | 181 | ||
| 140 | void IGeneralService::GetClientId(Kernel::HLERequestContext& ctx) { | 182 | void Module::Interface::CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) { |
| 141 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | ||
| 142 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 143 | rb.Push(RESULT_SUCCESS); | ||
| 144 | rb.Push<u64>(0); | ||
| 145 | } | ||
| 146 | |||
| 147 | void IGeneralService::CreateScanRequest(Kernel::HLERequestContext& ctx) { | ||
| 148 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 183 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 149 | |||
| 150 | rb.Push(RESULT_SUCCESS); | 184 | rb.Push(RESULT_SUCCESS); |
| 151 | rb.PushIpcInterface<IScanRequest>(); | 185 | rb.PushIpcInterface<IGeneralService>(); |
| 152 | |||
| 153 | LOG_DEBUG(Service_NIFM, "called"); | 186 | LOG_DEBUG(Service_NIFM, "called"); |
| 154 | } | 187 | } |
| 155 | 188 | ||
| 156 | void IGeneralService::CreateRequest(Kernel::HLERequestContext& ctx) { | 189 | void Module::Interface::CreateGeneralService(Kernel::HLERequestContext& ctx) { |
| 157 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 190 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 158 | |||
| 159 | rb.Push(RESULT_SUCCESS); | 191 | rb.Push(RESULT_SUCCESS); |
| 160 | rb.PushIpcInterface<IRequest>(); | 192 | rb.PushIpcInterface<IGeneralService>(); |
| 161 | |||
| 162 | LOG_DEBUG(Service_NIFM, "called"); | 193 | LOG_DEBUG(Service_NIFM, "called"); |
| 163 | } | 194 | } |
| 164 | 195 | ||
| 165 | void IGeneralService::RemoveNetworkProfile(Kernel::HLERequestContext& ctx) { | 196 | Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) |
| 166 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 197 | : ServiceFramework(name), module(std::move(module)) {} |
| 167 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 168 | rb.Push(RESULT_SUCCESS); | ||
| 169 | } | ||
| 170 | |||
| 171 | void IGeneralService::CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx) { | ||
| 172 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 173 | |||
| 174 | rb.Push(RESULT_SUCCESS); | ||
| 175 | rb.PushIpcInterface<INetworkProfile>(); | ||
| 176 | |||
| 177 | LOG_DEBUG(Service_NIFM, "called"); | ||
| 178 | } | ||
| 179 | 198 | ||
| 180 | void InstallInterfaces(SM::ServiceManager& service_manager) { | 199 | void InstallInterfaces(SM::ServiceManager& service_manager) { |
| 181 | std::make_shared<NIFM_A>()->InstallAsService(service_manager); | 200 | auto module = std::make_shared<Module>(); |
| 182 | std::make_shared<NIFM_S>()->InstallAsService(service_manager); | 201 | std::make_shared<NIFM_A>(module)->InstallAsService(service_manager); |
| 183 | std::make_shared<NIFM_U>()->InstallAsService(service_manager); | 202 | std::make_shared<NIFM_S>(module)->InstallAsService(service_manager); |
| 203 | std::make_shared<NIFM_U>(module)->InstallAsService(service_manager); | ||
| 184 | } | 204 | } |
| 185 | 205 | ||
| 186 | } // namespace NIFM | 206 | } // namespace NIFM |
diff --git a/src/core/hle/service/nifm/nifm.h b/src/core/hle/service/nifm/nifm.h index 6edbfe4a4..11d263b12 100644 --- a/src/core/hle/service/nifm/nifm.h +++ b/src/core/hle/service/nifm/nifm.h | |||
| @@ -9,16 +9,18 @@ | |||
| 9 | namespace Service { | 9 | namespace Service { |
| 10 | namespace NIFM { | 10 | namespace NIFM { |
| 11 | 11 | ||
| 12 | class IGeneralService final : public ServiceFramework<IGeneralService> { | 12 | class Module final { |
| 13 | public: | 13 | public: |
| 14 | IGeneralService(); | 14 | class Interface : public ServiceFramework<Interface> { |
| 15 | 15 | public: | |
| 16 | private: | 16 | Interface(std::shared_ptr<Module> module, const char* name); |
| 17 | void GetClientId(Kernel::HLERequestContext& ctx); | 17 | |
| 18 | void CreateScanRequest(Kernel::HLERequestContext& ctx); | 18 | void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx); |
| 19 | void CreateRequest(Kernel::HLERequestContext& ctx); | 19 | void CreateGeneralService(Kernel::HLERequestContext& ctx); |
| 20 | void RemoveNetworkProfile(Kernel::HLERequestContext& ctx); | 20 | |
| 21 | void CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx); | 21 | protected: |
| 22 | std::shared_ptr<Module> module; | ||
| 23 | }; | ||
| 22 | }; | 24 | }; |
| 23 | 25 | ||
| 24 | void InstallInterfaces(SM::ServiceManager& service_manager); | 26 | void InstallInterfaces(SM::ServiceManager& service_manager); |
diff --git a/src/core/hle/service/nifm/nifm_a.cpp b/src/core/hle/service/nifm/nifm_a.cpp index ee61d8ff4..f75df8c04 100644 --- a/src/core/hle/service/nifm/nifm_a.cpp +++ b/src/core/hle/service/nifm/nifm_a.cpp | |||
| @@ -2,29 +2,12 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/logging/log.h" | ||
| 6 | #include "core/hle/ipc_helpers.h" | ||
| 7 | #include "core/hle/service/nifm/nifm.h" | ||
| 8 | #include "core/hle/service/nifm/nifm_a.h" | 5 | #include "core/hle/service/nifm/nifm_a.h" |
| 9 | 6 | ||
| 10 | namespace Service { | 7 | namespace Service { |
| 11 | namespace NIFM { | 8 | namespace NIFM { |
| 12 | 9 | ||
| 13 | void NIFM_A::CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) { | 10 | NIFM_A::NIFM_A(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:a") { |
| 14 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 15 | rb.Push(RESULT_SUCCESS); | ||
| 16 | rb.PushIpcInterface<IGeneralService>(); | ||
| 17 | LOG_DEBUG(Service_NIFM, "called"); | ||
| 18 | } | ||
| 19 | |||
| 20 | void NIFM_A::CreateGeneralService(Kernel::HLERequestContext& ctx) { | ||
| 21 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 22 | rb.Push(RESULT_SUCCESS); | ||
| 23 | rb.PushIpcInterface<IGeneralService>(); | ||
| 24 | LOG_DEBUG(Service_NIFM, "called"); | ||
| 25 | } | ||
| 26 | |||
| 27 | NIFM_A::NIFM_A() : ServiceFramework("nifm:a") { | ||
| 28 | static const FunctionInfo functions[] = { | 11 | static const FunctionInfo functions[] = { |
| 29 | {4, &NIFM_A::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, | 12 | {4, &NIFM_A::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, |
| 30 | {5, &NIFM_A::CreateGeneralService, "CreateGeneralService"}, | 13 | {5, &NIFM_A::CreateGeneralService, "CreateGeneralService"}, |
diff --git a/src/core/hle/service/nifm/nifm_a.h b/src/core/hle/service/nifm/nifm_a.h index 06a92a93c..eaea14e29 100644 --- a/src/core/hle/service/nifm/nifm_a.h +++ b/src/core/hle/service/nifm/nifm_a.h | |||
| @@ -4,20 +4,14 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "core/hle/kernel/hle_ipc.h" | 7 | #include "core/hle/service/nifm/nifm.h" |
| 8 | #include "core/hle/service/service.h" | ||
| 9 | 8 | ||
| 10 | namespace Service { | 9 | namespace Service { |
| 11 | namespace NIFM { | 10 | namespace NIFM { |
| 12 | 11 | ||
| 13 | class NIFM_A final : public ServiceFramework<NIFM_A> { | 12 | class NIFM_A final : public Module::Interface { |
| 14 | public: | 13 | public: |
| 15 | NIFM_A(); | 14 | explicit NIFM_A(std::shared_ptr<Module> module); |
| 16 | ~NIFM_A() = default; | ||
| 17 | |||
| 18 | private: | ||
| 19 | void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx); | ||
| 20 | void CreateGeneralService(Kernel::HLERequestContext& ctx); | ||
| 21 | }; | 15 | }; |
| 22 | 16 | ||
| 23 | } // namespace NIFM | 17 | } // namespace NIFM |
diff --git a/src/core/hle/service/nifm/nifm_s.cpp b/src/core/hle/service/nifm/nifm_s.cpp index c38b2a4c7..9c0b300e4 100644 --- a/src/core/hle/service/nifm/nifm_s.cpp +++ b/src/core/hle/service/nifm/nifm_s.cpp | |||
| @@ -2,29 +2,12 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/logging/log.h" | ||
| 6 | #include "core/hle/ipc_helpers.h" | ||
| 7 | #include "core/hle/service/nifm/nifm.h" | ||
| 8 | #include "core/hle/service/nifm/nifm_s.h" | 5 | #include "core/hle/service/nifm/nifm_s.h" |
| 9 | 6 | ||
| 10 | namespace Service { | 7 | namespace Service { |
| 11 | namespace NIFM { | 8 | namespace NIFM { |
| 12 | 9 | ||
| 13 | void NIFM_S::CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) { | 10 | NIFM_S::NIFM_S(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:s") { |
| 14 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 15 | rb.Push(RESULT_SUCCESS); | ||
| 16 | rb.PushIpcInterface<IGeneralService>(); | ||
| 17 | LOG_DEBUG(Service_NIFM, "called"); | ||
| 18 | } | ||
| 19 | |||
| 20 | void NIFM_S::CreateGeneralService(Kernel::HLERequestContext& ctx) { | ||
| 21 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 22 | rb.Push(RESULT_SUCCESS); | ||
| 23 | rb.PushIpcInterface<IGeneralService>(); | ||
| 24 | LOG_DEBUG(Service_NIFM, "called"); | ||
| 25 | } | ||
| 26 | |||
| 27 | NIFM_S::NIFM_S() : ServiceFramework("nifm:s") { | ||
| 28 | static const FunctionInfo functions[] = { | 11 | static const FunctionInfo functions[] = { |
| 29 | {4, &NIFM_S::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, | 12 | {4, &NIFM_S::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, |
| 30 | {5, &NIFM_S::CreateGeneralService, "CreateGeneralService"}, | 13 | {5, &NIFM_S::CreateGeneralService, "CreateGeneralService"}, |
diff --git a/src/core/hle/service/nifm/nifm_s.h b/src/core/hle/service/nifm/nifm_s.h index d11a1ec29..f9e2d8039 100644 --- a/src/core/hle/service/nifm/nifm_s.h +++ b/src/core/hle/service/nifm/nifm_s.h | |||
| @@ -4,20 +4,14 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "core/hle/kernel/hle_ipc.h" | 7 | #include "core/hle/service/nifm/nifm.h" |
| 8 | #include "core/hle/service/service.h" | ||
| 9 | 8 | ||
| 10 | namespace Service { | 9 | namespace Service { |
| 11 | namespace NIFM { | 10 | namespace NIFM { |
| 12 | 11 | ||
| 13 | class NIFM_S final : public ServiceFramework<NIFM_S> { | 12 | class NIFM_S final : public Module::Interface { |
| 14 | public: | 13 | public: |
| 15 | NIFM_S(); | 14 | explicit NIFM_S(std::shared_ptr<Module> module); |
| 16 | ~NIFM_S() = default; | ||
| 17 | |||
| 18 | private: | ||
| 19 | void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx); | ||
| 20 | void CreateGeneralService(Kernel::HLERequestContext& ctx); | ||
| 21 | }; | 15 | }; |
| 22 | 16 | ||
| 23 | } // namespace NIFM | 17 | } // namespace NIFM |
diff --git a/src/core/hle/service/nifm/nifm_u.cpp b/src/core/hle/service/nifm/nifm_u.cpp index a5895c13c..44e6f483d 100644 --- a/src/core/hle/service/nifm/nifm_u.cpp +++ b/src/core/hle/service/nifm/nifm_u.cpp | |||
| @@ -2,29 +2,12 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/logging/log.h" | ||
| 6 | #include "core/hle/ipc_helpers.h" | ||
| 7 | #include "core/hle/service/nifm/nifm.h" | ||
| 8 | #include "core/hle/service/nifm/nifm_u.h" | 5 | #include "core/hle/service/nifm/nifm_u.h" |
| 9 | 6 | ||
| 10 | namespace Service { | 7 | namespace Service { |
| 11 | namespace NIFM { | 8 | namespace NIFM { |
| 12 | 9 | ||
| 13 | void NIFM_U::CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) { | 10 | NIFM_U::NIFM_U(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:u") { |
| 14 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 15 | rb.Push(RESULT_SUCCESS); | ||
| 16 | rb.PushIpcInterface<IGeneralService>(); | ||
| 17 | LOG_DEBUG(Service_NIFM, "called"); | ||
| 18 | } | ||
| 19 | |||
| 20 | void NIFM_U::CreateGeneralService(Kernel::HLERequestContext& ctx) { | ||
| 21 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 22 | rb.Push(RESULT_SUCCESS); | ||
| 23 | rb.PushIpcInterface<IGeneralService>(); | ||
| 24 | LOG_DEBUG(Service_NIFM, "called"); | ||
| 25 | } | ||
| 26 | |||
| 27 | NIFM_U::NIFM_U() : ServiceFramework("nifm:u") { | ||
| 28 | static const FunctionInfo functions[] = { | 11 | static const FunctionInfo functions[] = { |
| 29 | {4, &NIFM_U::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, | 12 | {4, &NIFM_U::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, |
| 30 | {5, &NIFM_U::CreateGeneralService, "CreateGeneralService"}, | 13 | {5, &NIFM_U::CreateGeneralService, "CreateGeneralService"}, |
diff --git a/src/core/hle/service/nifm/nifm_u.h b/src/core/hle/service/nifm/nifm_u.h index da40b604f..912006775 100644 --- a/src/core/hle/service/nifm/nifm_u.h +++ b/src/core/hle/service/nifm/nifm_u.h | |||
| @@ -4,20 +4,14 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "core/hle/kernel/hle_ipc.h" | 7 | #include "core/hle/service/nifm/nifm.h" |
| 8 | #include "core/hle/service/service.h" | ||
| 9 | 8 | ||
| 10 | namespace Service { | 9 | namespace Service { |
| 11 | namespace NIFM { | 10 | namespace NIFM { |
| 12 | 11 | ||
| 13 | class NIFM_U final : public ServiceFramework<NIFM_U> { | 12 | class NIFM_U final : public Module::Interface { |
| 14 | public: | 13 | public: |
| 15 | NIFM_U(); | 14 | explicit NIFM_U(std::shared_ptr<Module> module); |
| 16 | ~NIFM_U() = default; | ||
| 17 | |||
| 18 | private: | ||
| 19 | void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx); | ||
| 20 | void CreateGeneralService(Kernel::HLERequestContext& ctx); | ||
| 21 | }; | 15 | }; |
| 22 | 16 | ||
| 23 | } // namespace NIFM | 17 | } // namespace NIFM |