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
37 #include <linux/ioctl.h>
40 #define VCHIQ_IOC_MAGIC 0xc4
41 #define VCHIQ_INVALID_HANDLE (~0)
44 VCHIQ_SERVICE_PARAMS_T params;
47 unsigned int handle; /* OUT */
48 } VCHIQ_CREATE_SERVICE_T;
53 const struct vchiq_element *elements;
54 } VCHIQ_QUEUE_MESSAGE_T;
61 VCHIQ_BULK_MODE_T mode;
62 } VCHIQ_QUEUE_BULK_TRANSFER_T;
65 VCHIQ_REASON_T reason;
66 VCHIQ_HEADER_T *header;
67 void *service_userdata;
69 } VCHIQ_COMPLETION_DATA_T;
73 VCHIQ_COMPLETION_DATA_T *buf;
74 unsigned int msgbufsize;
75 unsigned int msgbufcount; /* IN/OUT */
77 } VCHIQ_AWAIT_COMPLETION_T;
84 } VCHIQ_DEQUEUE_MESSAGE_T;
87 unsigned int config_size;
88 VCHIQ_CONFIG_T *pconfig;
93 VCHIQ_SERVICE_OPTION_T option;
95 } VCHIQ_SET_SERVICE_OPTION_T;
102 #define VCHIQ_IOC_CONNECT _IO(VCHIQ_IOC_MAGIC, 0)
103 #define VCHIQ_IOC_SHUTDOWN _IO(VCHIQ_IOC_MAGIC, 1)
104 #define VCHIQ_IOC_CREATE_SERVICE \
105 _IOWR(VCHIQ_IOC_MAGIC, 2, VCHIQ_CREATE_SERVICE_T)
106 #define VCHIQ_IOC_REMOVE_SERVICE _IO(VCHIQ_IOC_MAGIC, 3)
107 #define VCHIQ_IOC_QUEUE_MESSAGE \
108 _IOW(VCHIQ_IOC_MAGIC, 4, VCHIQ_QUEUE_MESSAGE_T)
109 #define VCHIQ_IOC_QUEUE_BULK_TRANSMIT \
110 _IOWR(VCHIQ_IOC_MAGIC, 5, VCHIQ_QUEUE_BULK_TRANSFER_T)
111 #define VCHIQ_IOC_QUEUE_BULK_RECEIVE \
112 _IOWR(VCHIQ_IOC_MAGIC, 6, VCHIQ_QUEUE_BULK_TRANSFER_T)
113 #define VCHIQ_IOC_AWAIT_COMPLETION \
114 _IOWR(VCHIQ_IOC_MAGIC, 7, VCHIQ_AWAIT_COMPLETION_T)
115 #define VCHIQ_IOC_DEQUEUE_MESSAGE \
116 _IOWR(VCHIQ_IOC_MAGIC, 8, VCHIQ_DEQUEUE_MESSAGE_T)
117 #define VCHIQ_IOC_GET_CLIENT_ID _IO(VCHIQ_IOC_MAGIC, 9)
118 #define VCHIQ_IOC_GET_CONFIG \
119 _IOWR(VCHIQ_IOC_MAGIC, 10, VCHIQ_GET_CONFIG_T)
120 #define VCHIQ_IOC_CLOSE_SERVICE _IO(VCHIQ_IOC_MAGIC, 11)
121 #define VCHIQ_IOC_USE_SERVICE _IO(VCHIQ_IOC_MAGIC, 12)
122 #define VCHIQ_IOC_RELEASE_SERVICE _IO(VCHIQ_IOC_MAGIC, 13)
123 #define VCHIQ_IOC_SET_SERVICE_OPTION \
124 _IOW(VCHIQ_IOC_MAGIC, 14, VCHIQ_SET_SERVICE_OPTION_T)
125 #define VCHIQ_IOC_DUMP_PHYS_MEM \
126 _IOW(VCHIQ_IOC_MAGIC, 15, VCHIQ_DUMP_MEM_T)
127 #define VCHIQ_IOC_LIB_VERSION _IO(VCHIQ_IOC_MAGIC, 16)
128 #define VCHIQ_IOC_CLOSE_DELIVERED _IO(VCHIQ_IOC_MAGIC, 17)
129 #define VCHIQ_IOC_MAX 17