1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright (c) 2016-2017, Linaro Limited 4 */ 5 6 #ifndef __TEE_ISOCKET_H 7 #define __TEE_ISOCKET_H 8 9 #include <stdint.h> 10 #include <tee_api_types.h> 11 #include <__tee_isocket_defines.h> 12 13 typedef void *TEE_iSocketHandle; 14 15 typedef const struct TEE_iSocket_s { 16 uint32_t TEE_iSocketVersion; 17 uint8_t protocolID; 18 TEE_Result (*open)(TEE_iSocketHandle *ctx, void *setup, 19 uint32_t *protocolError); 20 21 TEE_Result (*close)(TEE_iSocketHandle ctx); 22 23 TEE_Result (*send)(TEE_iSocketHandle ctx, const void *buf, 24 uint32_t *length, uint32_t timeout); 25 26 TEE_Result (*recv)(TEE_iSocketHandle ctx, void *buf, uint32_t *length, 27 uint32_t timeout); 28 29 uint32_t (*error)(TEE_iSocketHandle ctx); 30 31 TEE_Result (*ioctl)(TEE_iSocketHandle ctx, uint32_t commandCode, 32 void *buf, uint32_t *length); 33 } TEE_iSocket; 34 35 #endif /*__TEE_ISOCKET_H*/ 36