Transmit FWU function ID and status fields in shared memory
The PSA firmware update protocol transmits the function ID and status
fields in the request/response structures in the shared memory. Add shim
layer to extract and insert common function ID and status fields. This
way the actual FWU provider functions don't have to individually handle
these fields.
Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: Icdf73caf2f56da39bf1c384b4fafbe8fe9885555
diff --git a/components/service/fwu/provider/fwu_provider.c b/components/service/fwu/provider/fwu_provider.c
index ded6db7..9085a98 100644
--- a/components/service/fwu/provider/fwu_provider.c
+++ b/components/service/fwu/provider/fwu_provider.c
@@ -49,6 +49,8 @@
struct update_agent *update_agent)
{
const struct rpc_uuid service_uuid = { .uuid = TS_FWU_SERVICE_UUID };
+ struct rpc_service_interface *rpc_interface = NULL;
+
/* Initialise the fwu_provider */
context->update_agent = update_agent;
@@ -58,7 +60,11 @@
service_provider_init(&context->base_provider, context, &service_uuid, handler_table,
sizeof(handler_table) / sizeof(struct service_handler));
- return service_provider_get_rpc_interface(&context->base_provider);
+ rpc_interface = service_provider_get_rpc_interface(&context->base_provider);
+ if (!rpc_interface)
+ return NULL;
+
+ return fwu_provider_shim_init(&context->shim, rpc_interface);
}
void fwu_provider_deinit(struct fwu_provider *context)