diff options
| author | Ac_K <Acoustik666@gmail.com> | 2023-09-20 22:55:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-20 22:55:27 +0200 |
| commit | fb55f57da7cbeb39d12d39a13be16ff602a8fda3 (patch) | |
| tree | b7b0bff4513e39d70eb219966e473ca8f498e2a8 /src/Ryujinx.Horizon/Wlan | |
| parent | 44862dce3ef307b12366376ada3fa0db693bfaf9 (diff) | |
Horizon: Migrate wlan and stubs latest services (#5708)
* Horizon: Migrate wlan and stubs latest services
This PR migrate empty wlan services, values are found by RE.
Latest firmwares added some other services which are now stubbed and up-to-date.
* Fix imports ordering
Diffstat (limited to 'src/Ryujinx.Horizon/Wlan')
| -rw-r--r-- | src/Ryujinx.Horizon/Wlan/Ipc/DetectManager.cs | 8 | ||||
| -rw-r--r-- | src/Ryujinx.Horizon/Wlan/Ipc/GeneralServiceCreator.cs | 8 | ||||
| -rw-r--r-- | src/Ryujinx.Horizon/Wlan/Ipc/InfraManager.cs | 8 | ||||
| -rw-r--r-- | src/Ryujinx.Horizon/Wlan/Ipc/LocalGetActionFrame.cs | 8 | ||||
| -rw-r--r-- | src/Ryujinx.Horizon/Wlan/Ipc/LocalGetFrame.cs | 8 | ||||
| -rw-r--r-- | src/Ryujinx.Horizon/Wlan/Ipc/LocalManager.cs | 8 | ||||
| -rw-r--r-- | src/Ryujinx.Horizon/Wlan/Ipc/PrivateServiceCreator.cs | 8 | ||||
| -rw-r--r-- | src/Ryujinx.Horizon/Wlan/Ipc/SfDriverServiceCreator.cs | 8 | ||||
| -rw-r--r-- | src/Ryujinx.Horizon/Wlan/Ipc/SocketGetFrame.cs | 8 | ||||
| -rw-r--r-- | src/Ryujinx.Horizon/Wlan/Ipc/SocketManager.cs | 8 | ||||
| -rw-r--r-- | src/Ryujinx.Horizon/Wlan/WlanIpcServer.cs | 59 | ||||
| -rw-r--r-- | src/Ryujinx.Horizon/Wlan/WlanMain.cs | 17 |
12 files changed, 156 insertions, 0 deletions
diff --git a/src/Ryujinx.Horizon/Wlan/Ipc/DetectManager.cs b/src/Ryujinx.Horizon/Wlan/Ipc/DetectManager.cs new file mode 100644 index 00000000..595592f7 --- /dev/null +++ b/src/Ryujinx.Horizon/Wlan/Ipc/DetectManager.cs @@ -0,0 +1,8 @@ +using Ryujinx.Horizon.Sdk.Wlan; + +namespace Ryujinx.Horizon.Wlan.Ipc +{ + partial class DetectManager : IDetectManager + { + } +} diff --git a/src/Ryujinx.Horizon/Wlan/Ipc/GeneralServiceCreator.cs b/src/Ryujinx.Horizon/Wlan/Ipc/GeneralServiceCreator.cs new file mode 100644 index 00000000..7f651d22 --- /dev/null +++ b/src/Ryujinx.Horizon/Wlan/Ipc/GeneralServiceCreator.cs @@ -0,0 +1,8 @@ +using Ryujinx.Horizon.Sdk.Wlan; + +namespace Ryujinx.Horizon.Wlan.Ipc +{ + partial class GeneralServiceCreator : IGeneralServiceCreator + { + } +} diff --git a/src/Ryujinx.Horizon/Wlan/Ipc/InfraManager.cs b/src/Ryujinx.Horizon/Wlan/Ipc/InfraManager.cs new file mode 100644 index 00000000..d69c73b5 --- /dev/null +++ b/src/Ryujinx.Horizon/Wlan/Ipc/InfraManager.cs @@ -0,0 +1,8 @@ +using Ryujinx.Horizon.Sdk.Wlan; + +namespace Ryujinx.Horizon.Wlan.Ipc +{ + partial class InfraManager : IInfraManager + { + } +} diff --git a/src/Ryujinx.Horizon/Wlan/Ipc/LocalGetActionFrame.cs b/src/Ryujinx.Horizon/Wlan/Ipc/LocalGetActionFrame.cs new file mode 100644 index 00000000..8458655e --- /dev/null +++ b/src/Ryujinx.Horizon/Wlan/Ipc/LocalGetActionFrame.cs @@ -0,0 +1,8 @@ +using Ryujinx.Horizon.Sdk.Wlan; + +namespace Ryujinx.Horizon.Wlan.Ipc +{ + partial class LocalGetActionFrame : ILocalGetActionFrame + { + } +} diff --git a/src/Ryujinx.Horizon/Wlan/Ipc/LocalGetFrame.cs b/src/Ryujinx.Horizon/Wlan/Ipc/LocalGetFrame.cs new file mode 100644 index 00000000..5ce8724d --- /dev/null +++ b/src/Ryujinx.Horizon/Wlan/Ipc/LocalGetFrame.cs @@ -0,0 +1,8 @@ +using Ryujinx.Horizon.Sdk.Wlan; + +namespace Ryujinx.Horizon.Wlan.Ipc +{ + partial class LocalGetFrame : ILocalGetFrame + { + } +} diff --git a/src/Ryujinx.Horizon/Wlan/Ipc/LocalManager.cs b/src/Ryujinx.Horizon/Wlan/Ipc/LocalManager.cs new file mode 100644 index 00000000..789ac190 --- /dev/null +++ b/src/Ryujinx.Horizon/Wlan/Ipc/LocalManager.cs @@ -0,0 +1,8 @@ +using Ryujinx.Horizon.Sdk.Wlan; + +namespace Ryujinx.Horizon.Wlan.Ipc +{ + partial class LocalManager : ILocalManager + { + } +} diff --git a/src/Ryujinx.Horizon/Wlan/Ipc/PrivateServiceCreator.cs b/src/Ryujinx.Horizon/Wlan/Ipc/PrivateServiceCreator.cs new file mode 100644 index 00000000..c25723f9 --- /dev/null +++ b/src/Ryujinx.Horizon/Wlan/Ipc/PrivateServiceCreator.cs @@ -0,0 +1,8 @@ +using Ryujinx.Horizon.Sdk.Wlan; + +namespace Ryujinx.Horizon.Wlan.Ipc +{ + partial class PrivateServiceCreator : IPrivateServiceCreator + { + } +} diff --git a/src/Ryujinx.Horizon/Wlan/Ipc/SfDriverServiceCreator.cs b/src/Ryujinx.Horizon/Wlan/Ipc/SfDriverServiceCreator.cs new file mode 100644 index 00000000..fd74024b --- /dev/null +++ b/src/Ryujinx.Horizon/Wlan/Ipc/SfDriverServiceCreator.cs @@ -0,0 +1,8 @@ +using Ryujinx.Horizon.Sdk.Wlan; + +namespace Ryujinx.Horizon.Wlan.Ipc +{ + partial class SfDriverServiceCreator : ISfDriverServiceCreator + { + } +} diff --git a/src/Ryujinx.Horizon/Wlan/Ipc/SocketGetFrame.cs b/src/Ryujinx.Horizon/Wlan/Ipc/SocketGetFrame.cs new file mode 100644 index 00000000..5c1663f6 --- /dev/null +++ b/src/Ryujinx.Horizon/Wlan/Ipc/SocketGetFrame.cs @@ -0,0 +1,8 @@ +using Ryujinx.Horizon.Sdk.Wlan; + +namespace Ryujinx.Horizon.Wlan.Ipc +{ + partial class SocketGetFrame : ISocketGetFrame + { + } +} diff --git a/src/Ryujinx.Horizon/Wlan/Ipc/SocketManager.cs b/src/Ryujinx.Horizon/Wlan/Ipc/SocketManager.cs new file mode 100644 index 00000000..a112e745 --- /dev/null +++ b/src/Ryujinx.Horizon/Wlan/Ipc/SocketManager.cs @@ -0,0 +1,8 @@ +using Ryujinx.Horizon.Sdk.Wlan; + +namespace Ryujinx.Horizon.Wlan.Ipc +{ + partial class SocketManager : ISocketManager + { + } +} diff --git a/src/Ryujinx.Horizon/Wlan/WlanIpcServer.cs b/src/Ryujinx.Horizon/Wlan/WlanIpcServer.cs new file mode 100644 index 00000000..eb13f028 --- /dev/null +++ b/src/Ryujinx.Horizon/Wlan/WlanIpcServer.cs @@ -0,0 +1,59 @@ +using Ryujinx.Horizon.Sdk.Sf.Hipc; +using Ryujinx.Horizon.Sdk.Sm; +using Ryujinx.Horizon.Wlan.Ipc; + +namespace Ryujinx.Horizon.Wlan +{ + class WlanIpcServer + { + private const int WlanOtherMaxSessionsCount = 10; + private const int WlanDtcMaxSessionsCount = 4; + private const int WlanMaxSessionsCount = 30; + private const int WlanNdMaxSessionsCount = 5; + private const int WlanPMaxSessionsCount = 30; + private const int TotalMaxSessionsCount = WlanDtcMaxSessionsCount + WlanMaxSessionsCount + WlanNdMaxSessionsCount + WlanPMaxSessionsCount + WlanOtherMaxSessionsCount * 6; + + private const int PointerBufferSize = 0x1000; + private const int MaxDomains = 16; + private const int MaxDomainObjects = 10; + private const int MaxPortsCount = 10; + + private static readonly ManagerOptions _options = new(PointerBufferSize, MaxDomains, MaxDomainObjects, false); + + private SmApi _sm; + private ServerManager _serverManager; + + public void Initialize() + { + HeapAllocator allocator = new(); + + _sm = new SmApi(); + _sm.Initialize().AbortOnFailure(); + + _serverManager = new ServerManager(allocator, _sm, MaxPortsCount, _options, TotalMaxSessionsCount); + +#pragma warning disable IDE0055 // Disable formatting + _serverManager.RegisterObjectForServer(new GeneralServiceCreator(), ServiceName.Encode("wlan"), WlanMaxSessionsCount); // 15.0.0+ + _serverManager.RegisterObjectForServer(new DetectManager(), ServiceName.Encode("wlan:dtc"), WlanDtcMaxSessionsCount); // 6.0.0-14.1.2 + _serverManager.RegisterObjectForServer(new InfraManager(), ServiceName.Encode("wlan:inf"), WlanOtherMaxSessionsCount); // 1.0.0-14.1.2 + _serverManager.RegisterObjectForServer(new LocalManager(), ServiceName.Encode("wlan:lcl"), WlanOtherMaxSessionsCount); // 1.0.0-14.1.2 + _serverManager.RegisterObjectForServer(new LocalGetFrame(), ServiceName.Encode("wlan:lg"), WlanOtherMaxSessionsCount); // 1.0.0-14.1.2 + _serverManager.RegisterObjectForServer(new LocalGetActionFrame(), ServiceName.Encode("wlan:lga"), WlanOtherMaxSessionsCount); // 1.0.0-14.1.2 + _serverManager.RegisterObjectForServer(new SfDriverServiceCreator(), ServiceName.Encode("wlan:nd"), WlanNdMaxSessionsCount); // 15.0.0+ + _serverManager.RegisterObjectForServer(new PrivateServiceCreator(), ServiceName.Encode("wlan:p"), WlanPMaxSessionsCount); // 15.0.0+ + _serverManager.RegisterObjectForServer(new SocketGetFrame(), ServiceName.Encode("wlan:sg"), WlanOtherMaxSessionsCount); // 1.0.0-14.1.2 + _serverManager.RegisterObjectForServer(new SocketManager(), ServiceName.Encode("wlan:soc"), WlanOtherMaxSessionsCount); // 1.0.0-14.1.2 +#pragma warning restore IDE0055 + } + + public void ServiceRequests() + { + _serverManager.ServiceRequests(); + } + + public void Shutdown() + { + _serverManager.Dispose(); + } + } +} diff --git a/src/Ryujinx.Horizon/Wlan/WlanMain.cs b/src/Ryujinx.Horizon/Wlan/WlanMain.cs new file mode 100644 index 00000000..1381a8cb --- /dev/null +++ b/src/Ryujinx.Horizon/Wlan/WlanMain.cs @@ -0,0 +1,17 @@ +namespace Ryujinx.Horizon.Wlan +{ + class WlanMain : IService + { + public static void Main(ServiceTable serviceTable) + { + WlanIpcServer ipcServer = new(); + + ipcServer.Initialize(); + + serviceTable.SignalServiceReady(); + + ipcServer.ServiceRequests(); + ipcServer.Shutdown(); + } + } +} |
