Archived
1
0
Fork 0
forked from Mirror/Ryujinx

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
This commit is contained in:
Ac_K 2023-09-20 22:55:27 +02:00 committed by GitHub
parent 44862dce3e
commit fb55f57da7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 238 additions and 56 deletions

View file

@ -1,8 +0,0 @@
namespace Ryujinx.HLE.HOS.Services.Wlan
{
[Service("wlan:inf")]
class IInfraManager : IpcService
{
public IInfraManager(ServiceCtx context) { }
}
}

View file

@ -1,8 +0,0 @@
namespace Ryujinx.HLE.HOS.Services.Wlan
{
[Service("wlan:lga")]
class ILocalGetActionFrame : IpcService
{
public ILocalGetActionFrame(ServiceCtx context) { }
}
}

View file

@ -1,8 +0,0 @@
namespace Ryujinx.HLE.HOS.Services.Wlan
{
[Service("wlan:lg")]
class ILocalGetFrame : IpcService
{
public ILocalGetFrame(ServiceCtx context) { }
}
}

View file

@ -1,8 +0,0 @@
namespace Ryujinx.HLE.HOS.Services.Wlan
{
[Service("wlan:lcl")]
class ILocalManager : IpcService
{
public ILocalManager(ServiceCtx context) { }
}
}

View file

@ -1,8 +0,0 @@
namespace Ryujinx.HLE.HOS.Services.Wlan
{
[Service("wlan:sg")]
class ISocketGetFrame : IpcService
{
public ISocketGetFrame(ServiceCtx context) { }
}
}

View file

@ -1,8 +0,0 @@
namespace Ryujinx.HLE.HOS.Services.Wlan
{
[Service("wlan:soc")]
class ISocketManager : IpcService
{
public ISocketManager(ServiceCtx context) { }
}
}

View file

@ -1,8 +0,0 @@
namespace Ryujinx.HLE.HOS.Services.Wlan
{
[Service("wlan:dtc")] // 6.0.0+
class IUnknown1 : IpcService
{
public IUnknown1(ServiceCtx context) { }
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Sf;
namespace Ryujinx.Horizon.Sdk.Wlan
{
interface IDetectManager : IServiceObject
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Sf;
namespace Ryujinx.Horizon.Sdk.Wlan
{
interface IGeneralServiceCreator : IServiceObject
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Sf;
namespace Ryujinx.Horizon.Sdk.Wlan
{
interface IInfraManager : IServiceObject
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Sf;
namespace Ryujinx.Horizon.Sdk.Wlan
{
interface ILocalGetActionFrame : IServiceObject
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Sf;
namespace Ryujinx.Horizon.Sdk.Wlan
{
interface ILocalGetFrame : IServiceObject
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Sf;
namespace Ryujinx.Horizon.Sdk.Wlan
{
interface ILocalManager : IServiceObject
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Sf;
namespace Ryujinx.Horizon.Sdk.Wlan
{
interface IPrivateServiceCreator : IServiceObject
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Sf;
namespace Ryujinx.Horizon.Sdk.Wlan
{
interface ISfDriverServiceCreator : IServiceObject
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Sf;
namespace Ryujinx.Horizon.Sdk.Wlan
{
interface ISocketGetFrame : IServiceObject
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Sf;
namespace Ryujinx.Horizon.Sdk.Wlan
{
interface ISocketManager : IServiceObject
{
}
}

View file

@ -3,6 +3,7 @@ using Ryujinx.Horizon.Lbl;
using Ryujinx.Horizon.LogManager;
using Ryujinx.Horizon.MmNv;
using Ryujinx.Horizon.Prepo;
using Ryujinx.Horizon.Wlan;
using System.Collections.Generic;
using System.Threading;
@ -29,6 +30,7 @@ namespace Ryujinx.Horizon
RegisterService<LmMain>();
RegisterService<MmNvMain>();
RegisterService<PrepoMain>();
RegisterService<WlanMain>();
_totalServices = entries.Count;

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Wlan;
namespace Ryujinx.Horizon.Wlan.Ipc
{
partial class DetectManager : IDetectManager
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Wlan;
namespace Ryujinx.Horizon.Wlan.Ipc
{
partial class GeneralServiceCreator : IGeneralServiceCreator
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Wlan;
namespace Ryujinx.Horizon.Wlan.Ipc
{
partial class InfraManager : IInfraManager
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Wlan;
namespace Ryujinx.Horizon.Wlan.Ipc
{
partial class LocalGetActionFrame : ILocalGetActionFrame
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Wlan;
namespace Ryujinx.Horizon.Wlan.Ipc
{
partial class LocalGetFrame : ILocalGetFrame
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Wlan;
namespace Ryujinx.Horizon.Wlan.Ipc
{
partial class LocalManager : ILocalManager
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Wlan;
namespace Ryujinx.Horizon.Wlan.Ipc
{
partial class PrivateServiceCreator : IPrivateServiceCreator
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Wlan;
namespace Ryujinx.Horizon.Wlan.Ipc
{
partial class SfDriverServiceCreator : ISfDriverServiceCreator
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Wlan;
namespace Ryujinx.Horizon.Wlan.Ipc
{
partial class SocketGetFrame : ISocketGetFrame
{
}
}

View file

@ -0,0 +1,8 @@
using Ryujinx.Horizon.Sdk.Wlan;
namespace Ryujinx.Horizon.Wlan.Ipc
{
partial class SocketManager : ISocketManager
{
}
}

View file

@ -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();
}
}
}

View file

@ -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();
}
}
}