1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2016, Linaro Limited
4  * All rights reserved.
5  */
6 
7 #ifndef __TA_SOCKET_H
8 #define __TA_SOCKET_H
9 
10 #define TA_SOCKET_UUID { 0x873bcd08, 0xc2c3, 0x11e6, { \
11 			 0xa9, 0x37, 0xd0, 0xbf, 0x9c, 0x45, 0xc6, 0x1c } }
12 
13 /*
14  * Opens a TCP socket and returns an opaque handle
15  *
16  * [in]     params[0].value.a	ipVersion
17  * [in]     params[0].value.b	server port
18  * [in]     params[1].memref	server address
19  * [out]    params[2].memref	handle
20  * [out]    params[3].value.a	protocol error
21  */
22 #define TA_SOCKET_CMD_TCP_OPEN	0
23 
24 /*
25  * Opens a UDP socket and returns an opaque handle
26  *
27  * [in]     params[0].value.a	ipVersion
28  * [in]     params[0].value.b	server port
29  * [in]     params[1].memref	server address
30  * [out]    params[2].memref	handle
31  * [out]    params[3].value.a	protocol error
32  */
33 #define TA_SOCKET_CMD_UDP_OPEN	1
34 
35 /*
36  * Closes a socket
37  *
38  * [in]     params[0].memref	handle
39  */
40 #define TA_SOCKET_CMD_CLOSE	2
41 
42 /*
43  * Send data on socket
44  *
45  * [in]     params[0].memref	handle
46  * [in]     params[1].memref	data
47  * [in]     params[2].value.a	timeout
48  * [out]    params[2].value.b	sent bytes
49  */
50 #define TA_SOCKET_CMD_SEND	3
51 
52 /*
53  * Receive data on socket
54  *
55  * [in]     params[0].memref	handle
56  * [out]    params[1].memref	data
57  * [in]     params[2].value.a	timeout
58  */
59 #define TA_SOCKET_CMD_RECV	4
60 
61 /*
62  * Retrieve protocol error from socket
63  *
64  * [in]     params[0].memref	handle
65  * [out]    params[1].value.a	error code
66  */
67 #define TA_SOCKET_CMD_ERROR	5
68 
69 /*
70  * Ioctl on socket
71  *
72  * [in]     params[0].memref	handle
73  * [in/out] params[1].memref	data
74  * [in]     params[2].value.a	command code
75  */
76 #define TA_SOCKET_CMD_IOCTL	6
77 
78 #endif /*__TA_SOCKET_H*/
79