2 * Copyright (c) 2010-2012 Broadcom. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions, and the following disclaimer,
9 * without modification.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. The names of the above-listed copyright holders may not be used
14 * to endorse or promote products derived from this software without
15 * specific prior written permission.
17 * ALTERNATIVELY, this software may be distributed under the terms of the
18 * GNU General Public License ("GPL") version 2, as published by the Free
19 * Software Foundation.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #ifndef VCHIQ_IOCTLS_H
35 #define VCHIQ_IOCTLS_H
39 #define VCHIQ_IOC_MAGIC 0xc4
40 #define VCHIQ_INVALID_HANDLE (~0)
43 VCHIQ_SERVICE_PARAMS_T params;
46 unsigned int handle; /* OUT */
47 } VCHIQ_CREATE_SERVICE_T;
52 const VCHIQ_ELEMENT_T *elements;
53 } VCHIQ_QUEUE_MESSAGE_T;
60 VCHIQ_BULK_MODE_T mode;
61 } VCHIQ_QUEUE_BULK_TRANSFER_T;
64 VCHIQ_REASON_T reason;
65 VCHIQ_HEADER_T *header;
66 void *service_userdata;
68 } VCHIQ_COMPLETION_DATA_T;
72 VCHIQ_COMPLETION_DATA_T *buf;
73 unsigned int msgbufsize;
74 unsigned int msgbufcount; /* IN/OUT */
76 } VCHIQ_AWAIT_COMPLETION_T;
83 } VCHIQ_DEQUEUE_MESSAGE_T;
86 unsigned int config_size;
87 VCHIQ_CONFIG_T *pconfig;
92 VCHIQ_SERVICE_OPTION_T option;
94 } VCHIQ_SET_SERVICE_OPTION_T;
101 #define VCHIQ_IOC_CONNECT _IO(VCHIQ_IOC_MAGIC, 0)
102 #define VCHIQ_IOC_SHUTDOWN _IO(VCHIQ_IOC_MAGIC, 1)
103 #define VCHIQ_IOC_CREATE_SERVICE \
104 _IOWR(VCHIQ_IOC_MAGIC, 2, VCHIQ_CREATE_SERVICE_T)
105 #define VCHIQ_IOC_REMOVE_SERVICE _IO(VCHIQ_IOC_MAGIC, 3)
106 #define VCHIQ_IOC_QUEUE_MESSAGE \
107 _IOW(VCHIQ_IOC_MAGIC, 4, VCHIQ_QUEUE_MESSAGE_T)
108 #define VCHIQ_IOC_QUEUE_BULK_TRANSMIT \
109 _IOWR(VCHIQ_IOC_MAGIC, 5, VCHIQ_QUEUE_BULK_TRANSFER_T)
110 #define VCHIQ_IOC_QUEUE_BULK_RECEIVE \
111 _IOWR(VCHIQ_IOC_MAGIC, 6, VCHIQ_QUEUE_BULK_TRANSFER_T)
112 #define VCHIQ_IOC_AWAIT_COMPLETION \
113 _IOWR(VCHIQ_IOC_MAGIC, 7, VCHIQ_AWAIT_COMPLETION_T)
114 #define VCHIQ_IOC_DEQUEUE_MESSAGE \
115 _IOWR(VCHIQ_IOC_MAGIC, 8, VCHIQ_DEQUEUE_MESSAGE_T)
116 #define VCHIQ_IOC_GET_CLIENT_ID _IO(VCHIQ_IOC_MAGIC, 9)
117 #define VCHIQ_IOC_GET_CONFIG \
118 _IOWR(VCHIQ_IOC_MAGIC, 10, VCHIQ_GET_CONFIG_T)
119 #define VCHIQ_IOC_CLOSE_SERVICE _IO(VCHIQ_IOC_MAGIC, 11)
120 #define VCHIQ_IOC_USE_SERVICE _IO(VCHIQ_IOC_MAGIC, 12)
121 #define VCHIQ_IOC_RELEASE_SERVICE _IO(VCHIQ_IOC_MAGIC, 13)
122 #define VCHIQ_IOC_SET_SERVICE_OPTION \
123 _IOW(VCHIQ_IOC_MAGIC, 14, VCHIQ_SET_SERVICE_OPTION_T)
124 #define VCHIQ_IOC_DUMP_PHYS_MEM \
125 _IOW(VCHIQ_IOC_MAGIC, 15, VCHIQ_DUMP_MEM_T)
126 #define VCHIQ_IOC_LIB_VERSION _IO(VCHIQ_IOC_MAGIC, 16)
127 #define VCHIQ_IOC_CLOSE_DELIVERED _IO(VCHIQ_IOC_MAGIC, 17)
128 #define VCHIQ_IOC_MAX 17