From 8a8552bef9894289aad242e19295ad29914d903d Mon Sep 17 00:00:00 2001 From: PTRCoder Date: Sat, 24 Aug 2024 19:58:48 +0200 Subject: [PATCH] Squashed commit of the following: commit aeb1e224f32ae688df1df3fe31c1b45b87378f50 Author: PTRCoder Date: Fri Aug 23 13:18:17 2024 +0200 Fixed member reference commit c3b1beae1c14609cbcc82419122d0ccea24fed4f Author: PTRCoder Date: Fri Aug 23 13:11:30 2024 +0200 Readded NWM_UDS header commit 6b03ca58a294a74fd0eeb36a81de4121f2ff382e Author: PTRCoder Date: Fri Aug 23 12:44:40 2024 +0200 Updated include statements commit 36c4adf4312e96401525d57b9a4afdc306024269 Author: PTRCoder Date: Fri Aug 23 00:58:25 2024 +0200 Potential member reference fix commit 6d28737856f5bc6f39694f076abd83ef6f8e9ce0 Author: PTRCoder Date: Fri Aug 23 00:48:51 2024 +0200 Fixed missing void return type commit 14eb3126780d565487dce1da0703281c4aee9d45 Author: PTRCoder Date: Fri Aug 23 00:14:41 2024 +0200 Using correct way to call UDS service commit 2acc2a35a9443e56cb67513403442a8e84bf7297 Author: PTRCoder Date: Thu Aug 22 22:39:15 2024 +0200 Updated API commit d204bfa05c851d21c48d965622a0e61c54ba68a2 Author: PTRCoder Date: Thu Aug 22 22:38:49 2024 +0200 Initial NWM_INF::RecvBeaconBroadcastData implementation commit 01baadf7a46c575600dbe06600dd2c4c77edadc0 Author: PTRCoder Date: Thu Aug 22 19:23:17 2024 +0200 Included member type commit 36f416469f2a6d29d07788d403ab12f437c229cd Author: PTRCoder Date: Thu Aug 22 19:06:52 2024 +0200 Coding style fixes commit 4e73a1d057bcf3b701b164724322e12959a34075 Author: PTRCoder Date: Thu Aug 22 19:02:37 2024 +0200 Starting tests --- src/core/hle/service/ac/ac.cpp | 18 ++++++++++++++++++ src/core/hle/service/ac/ac.h | 13 +++++++++++++ src/core/hle/service/ac/ac_i.cpp | 2 +- src/core/hle/service/ac/ac_u.cpp | 2 +- src/core/hle/service/nwm/nwm_inf.cpp | 10 +++++++++- src/core/hle/service/nwm/nwm_inf.h | 15 +++++++++++++++ 6 files changed, 57 insertions(+), 3 deletions(-) diff --git a/src/core/hle/service/ac/ac.cpp b/src/core/hle/service/ac/ac.cpp index 1f499bcc7..8e6e7f803 100644 --- a/src/core/hle/service/ac/ac.cpp +++ b/src/core/hle/service/ac/ac.cpp @@ -180,6 +180,24 @@ void Module::Interface::GetStatus(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_AC, "(STUBBED) called"); } +void Module::Interface::ScanAPs(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp(ctx); + const u32 arg1 = rp.Pop(); + LOG_WARNING(Service_AC, "val1: {}", arg1); + const u32 arg2 = rp.Pop(); + LOG_WARNING(Service_AC, "val2: {}", arg2); + const u32 arg3 = rp.Pop(); + LOG_WARNING(Service_AC, "val3: {}", arg3); + const u32 arg4 = rp.Pop(); + LOG_WARNING(Service_AC, "val4: {}", arg4); + const u32 arg5 = rp.Pop(); + LOG_WARNING(Service_AC, "val5: {}", arg5); + + IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); + rb.Push(ResultUnknown); + LOG_WARNING(Service_AC, "(STUBBED) called"); +} + void Module::Interface::GetInfraPriority(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx); [[maybe_unused]] const std::vector& ac_config = rp.PopStaticBuffer(); diff --git a/src/core/hle/service/ac/ac.h b/src/core/hle/service/ac/ac.h index 4fdd8e4bc..959016f06 100644 --- a/src/core/hle/service/ac/ac.h +++ b/src/core/hle/service/ac/ac.h @@ -122,6 +122,19 @@ public: */ void GetConnectingInfraPriority(Kernel::HLERequestContext& ctx); + /** + * AC::ScanAPs service function + * Inputs: + * 1 : Size + * 2-3 : ProcessID + * 64: (Size << 14) | 2 + * 65: Pointer to output structure + * Outputs: + * 1 : Result of function, 0 on success, otherwise error code + * 2 : ? + */ + void ScanAPs(Kernel::HLERequestContext& ctx); + /** * AC::GetInfraPriority service function * Inputs: diff --git a/src/core/hle/service/ac/ac_i.cpp b/src/core/hle/service/ac/ac_i.cpp index ab361a029..1a5ffc49b 100644 --- a/src/core/hle/service/ac/ac_i.cpp +++ b/src/core/hle/service/ac/ac_i.cpp @@ -23,7 +23,7 @@ AC_I::AC_I(std::shared_ptr ac) : Module::Interface(std::move(ac), "ac:i" {0x000F, &AC_I::GetConnectingInfraPriority, "GetConnectingInfraPriority"}, {0x0010, nullptr, "GetCurrentNZoneInfo"}, {0x0011, nullptr, "GetNZoneApNumService"}, - {0x001D, nullptr, "ScanAPs"}, + {0x001D, &AC_I::ScanAPs, "ScanAPs"}, {0x0024, nullptr, "AddDenyApType"}, {0x0027, &AC_I::GetInfraPriority, "GetInfraPriority"}, {0x002C, &AC_I::SetFromApplication, "SetFromApplication"}, diff --git a/src/core/hle/service/ac/ac_u.cpp b/src/core/hle/service/ac/ac_u.cpp index bc2af0028..58257a65f 100644 --- a/src/core/hle/service/ac/ac_u.cpp +++ b/src/core/hle/service/ac/ac_u.cpp @@ -23,7 +23,7 @@ AC_U::AC_U(std::shared_ptr ac) : Module::Interface(std::move(ac), "ac:u" {0x000F, &AC_U::GetConnectingInfraPriority, "GetConnectingInfraPriority"}, {0x0010, nullptr, "GetCurrentNZoneInfo"}, {0x0011, nullptr, "GetNZoneApNumService"}, - {0x001D, nullptr, "ScanAPs"}, + {0x001D, &AC_U::ScanAPs, "ScanAPs"}, {0x0024, nullptr, "AddDenyApType"}, {0x0027, &AC_U::GetInfraPriority, "GetInfraPriority"}, {0x002C, &AC_U::SetFromApplication, "SetFromApplication"}, diff --git a/src/core/hle/service/nwm/nwm_inf.cpp b/src/core/hle/service/nwm/nwm_inf.cpp index dca2cbaee..69ffd7d64 100644 --- a/src/core/hle/service/nwm/nwm_inf.cpp +++ b/src/core/hle/service/nwm/nwm_inf.cpp @@ -3,16 +3,24 @@ // Refer to the license.txt file included. #include "common/archives.h" +#include "core/core.h" #include "core/hle/service/nwm/nwm_inf.h" +#include "core/hle/service/nwm/nwm_uds.h" SERIALIZE_EXPORT_IMPL(Service::NWM::NWM_INF) namespace Service::NWM { +void NWM_INF::RecvBeaconBroadcastData(Kernel::HLERequestContext& ctx) { + // TODO(PTR) Update implementation to cover differences between NWM_INF and NWM_UDS + auto nwm_uds = Core::System::GetInstance().ServiceManager().GetService("nwm::UDS"); + nwm_uds->HandleSyncRequest(ctx); +} + NWM_INF::NWM_INF() : ServiceFramework("nwm::INF") { static const FunctionInfo functions[] = { // clang-format off - {0x0006, nullptr, "RecvBeaconBroadcastData"}, + {0x0006, &NWM_INF::RecvBeaconBroadcastData, "RecvBeaconBroadcastData"}, {0x0007, nullptr, "ConnectToEncryptedAP"}, {0x0008, nullptr, "ConnectToAP"}, // clang-format on diff --git a/src/core/hle/service/nwm/nwm_inf.h b/src/core/hle/service/nwm/nwm_inf.h index 9f8c65a2b..4fe9adb35 100644 --- a/src/core/hle/service/nwm/nwm_inf.h +++ b/src/core/hle/service/nwm/nwm_inf.h @@ -12,6 +12,21 @@ class NWM_INF final : public ServiceFramework { public: NWM_INF(); + /** + * NWM::RecvBeaconBroadcastData service function + * Inputs: + * 1 : Output buffer max size + * 2-14 : Input ScanInputStruct. + * 15 : u32, unknown + * 16 : Value 0x0 + * 17 : Input handle + * 18 : (Size<<4) | 12 + * 19 : Output BeaconDataReply buffer ptr + * Outputs: + * 1 : Result of function, 0 on success, otherwise error code + */ + void RecvBeaconBroadcastData(Kernel::HLERequestContext& ctx); + private: SERVICE_SERIALIZATION_SIMPLE };