Julian Hall | 32798ff | 2022-12-19 13:33:42 +0000 | [diff] [blame] | 1 | /* |
Imre Kis | 6fd73d8 | 2024-07-04 13:36:10 +0200 | [diff] [blame] | 2 | * Copyright (c) 2022-2024, Arm Limited and Contributors. All rights reserved. |
Julian Hall | 32798ff | 2022-12-19 13:33:42 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef FWU_PROVIDER_H |
| 8 | #define FWU_PROVIDER_H |
| 9 | |
Gyorgy Szing | 3c44624 | 2023-03-31 01:53:15 +0200 | [diff] [blame] | 10 | #include "protocols/rpc/common/packed-c/encoding.h" |
Imre Kis | e584a98 | 2023-07-04 17:59:18 +0200 | [diff] [blame] | 11 | #include "rpc/common/endpoint/rpc_service_interface.h" |
Gyorgy Szing | 3c44624 | 2023-03-31 01:53:15 +0200 | [diff] [blame] | 12 | #include "service/common/provider/service_provider.h" |
Imre Kis | 6fd73d8 | 2024-07-04 13:36:10 +0200 | [diff] [blame] | 13 | #include "fwu_provider_shim.h" |
Julian Hall | 32798ff | 2022-12-19 13:33:42 +0000 | [diff] [blame] | 14 | |
| 15 | #ifdef __cplusplus |
| 16 | extern "C" { |
| 17 | #endif |
| 18 | |
| 19 | /** |
| 20 | * Interface dependencies |
| 21 | */ |
| 22 | struct fwu_provider_serializer; |
| 23 | struct update_agent; |
| 24 | |
| 25 | /** |
| 26 | * \brief fwu_provider instance structure |
| 27 | * |
| 28 | * An instance of the fwu_provider presents the service level interface for |
| 29 | * remote access to the fwu service. In addition to handling incoming call |
| 30 | * requests, the fwu_provider is responsible for access control, call parameter |
| 31 | * serialization/deserialization and parameter sanitation. Request are delegated |
| 32 | * to the associated update_agent. |
| 33 | */ |
Gyorgy Szing | 3c44624 | 2023-03-31 01:53:15 +0200 | [diff] [blame] | 34 | struct fwu_provider { |
Julian Hall | 32798ff | 2022-12-19 13:33:42 +0000 | [diff] [blame] | 35 | struct service_provider base_provider; |
Imre Kis | 6fd73d8 | 2024-07-04 13:36:10 +0200 | [diff] [blame] | 36 | struct fwu_provider_shim shim; |
Julian Hall | 32798ff | 2022-12-19 13:33:42 +0000 | [diff] [blame] | 37 | struct update_agent *update_agent; |
| 38 | }; |
| 39 | |
| 40 | /** |
| 41 | * \brief Initialise a fwu_provider |
| 42 | * |
| 43 | * \param[in] context The subject fwu_provider context |
| 44 | * \param[in] update_agent The associated update_agent |
| 45 | * |
| 46 | * \return A pointer to the exposed rpc_interface or NULL on failure |
| 47 | */ |
Imre Kis | e584a98 | 2023-07-04 17:59:18 +0200 | [diff] [blame] | 48 | struct rpc_service_interface *fwu_provider_init(struct fwu_provider *context, |
| 49 | struct update_agent *update_agent); |
Julian Hall | 32798ff | 2022-12-19 13:33:42 +0000 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * \brief De-initialise a fwu_provider |
| 53 | * |
| 54 | * \param[in] context The subject fwu_provider context |
| 55 | */ |
Gyorgy Szing | 3c44624 | 2023-03-31 01:53:15 +0200 | [diff] [blame] | 56 | void fwu_provider_deinit(struct fwu_provider *context); |
Julian Hall | 32798ff | 2022-12-19 13:33:42 +0000 | [diff] [blame] | 57 | |
Julian Hall | 32798ff | 2022-12-19 13:33:42 +0000 | [diff] [blame] | 58 | #ifdef __cplusplus |
| 59 | } /* extern "C" */ |
| 60 | #endif |
| 61 | |
| 62 | #endif /* FWU_PROVIDER_H */ |