proxyclient: add nvme_{init,shutdown}

Signed-off-by: Sven Peter <sven@svenpeter.dev>
This commit is contained in:
Sven Peter 2022-01-10 18:16:59 +01:00 committed by Hector Martin
parent 2307e756d3
commit 0b9829e227
3 changed files with 19 additions and 0 deletions

View file

@ -586,6 +586,9 @@ class M1N1Proxy(Reloadable):
P_PCIE_INIT = 0xe00
P_PCIE_SHUTDOWN = 0xe01
P_NVME_INIT = 0xf00
P_NVME_SHUTDOWN = 0xf01
def __init__(self, iface, debug=False):
self.debug = debug
self.iface = iface
@ -1004,6 +1007,11 @@ class M1N1Proxy(Reloadable):
def pcie_shutdown(self):
return self.request(self.P_PCIE_SHUTDOWN)
def nvme_init(self):
return self.request(self.P_NVME_INIT)
def nvme_shutdown(self):
return self.request(self.P_NVME_SHUTDOWN)
__all__.extend(k for k, v in globals().items()
if (callable(v) or isinstance(v, type)) and v.__module__ == __name__)

View file

@ -11,6 +11,7 @@
#include "kboot.h"
#include "malloc.h"
#include "memory.h"
#include "nvme.h"
#include "pcie.h"
#include "pmgr.h"
#include "smp.h"
@ -495,6 +496,14 @@ int proxy_process(ProxyRequest *request, ProxyReply *reply)
pcie_shutdown();
break;
case P_NVME_INIT:
if (!nvme_init())
reply->retval = -1;
break;
case P_NVME_SHUTDOWN:
nvme_shutdown();
break;
default:
reply->status = S_BADCMD;
break;

View file

@ -139,6 +139,8 @@ typedef enum {
P_PCIE_INIT = 0xe00,
P_PCIE_SHUTDOWN,
P_NVME_INIT = 0xf00,
P_NVME_SHUTDOWN,
} ProxyOp;
#define S_OK 0