1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright (c) 2020, Open Mobile Platform LLC 4 */ 5 6 #ifndef PLUGIN_H 7 #define PLUGIN_H 8 9 #include <stdint.h> 10 #include <tee_client_api.h> 11 #include <tee_plugin_method.h> 12 13 struct tee_ioctl_param; 14 15 /* This structure describes one plugin for the supplicant */ 16 struct plugin { 17 void *handle; 18 struct plugin_method *method; /* Implemented in the plugin */ 19 struct plugin *next; 20 }; 21 22 #ifdef TEE_SUPP_PLUGINS 23 /* 24 * Loads all shared objects from 'CFG_TEE_PLUGIN_LOAD_PATH' 25 * and binds all functions. 26 * 27 * @return 'TEEC_SUCCESS' if all plugins were successfully loaded. 28 */ 29 TEEC_Result plugin_load_all(void); 30 31 /* Plugin RPC handler */ 32 TEEC_Result plugin_process(size_t num_params, struct tee_ioctl_param *params); 33 #else plugin_load_all(void)34static inline TEEC_Result plugin_load_all(void) 35 { 36 return TEEC_SUCCESS; 37 } 38 plugin_process(size_t num_params,struct tee_ioctl_param * params)39static inline TEEC_Result plugin_process(size_t num_params, 40 struct tee_ioctl_param *params) 41 { 42 (void)num_params; 43 (void)params; 44 45 return TEEC_ERROR_NOT_SUPPORTED; 46 } 47 #endif /*TEE_SUPP_PLUGINS*/ 48 49 #endif /* PLUGIN_H */ 50 51