Path: blob/main/sys/contrib/vchiq/interface/vchiq_arm/vchiq_ioctl.h
48383 views
/**1* Copyright (c) 2010-2012 Broadcom. All rights reserved.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions5* are met:6* 1. Redistributions of source code must retain the above copyright7* notice, this list of conditions, and the following disclaimer,8* without modification.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12* 3. The names of the above-listed copyright holders may not be used13* to endorse or promote products derived from this software without14* specific prior written permission.15*16* ALTERNATIVELY, this software may be distributed under the terms of the17* GNU General Public License ("GPL") version 2, as published by the Free18* Software Foundation.19*20* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS21* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,22* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR23* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR24* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,25* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,26* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR27* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF28* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING29* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS30* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.31*/3233#ifndef VCHIQ_IOCTLS_H34#define VCHIQ_IOCTLS_H3536#include "vchiq_if.h"3738#define VCHIQ_IOC_MAGIC 0xc439#define VCHIQ_INVALID_HANDLE (~0)4041typedef struct {42VCHIQ_SERVICE_PARAMS_T params;43int is_open;44int is_vchi;45unsigned int handle; /* OUT */46} VCHIQ_CREATE_SERVICE_T;4748typedef struct {49unsigned int handle;50unsigned int count;51const VCHIQ_ELEMENT_T *elements;52} VCHIQ_QUEUE_MESSAGE_T;5354typedef struct {55unsigned int handle;56void *data;57unsigned int size;58void *userdata;59VCHIQ_BULK_MODE_T mode;60} VCHIQ_QUEUE_BULK_TRANSFER_T;6162typedef struct {63VCHIQ_REASON_T reason;64VCHIQ_HEADER_T *header;65void *service_userdata;66void *bulk_userdata;67} VCHIQ_COMPLETION_DATA_T;6869typedef struct {70unsigned int count;71VCHIQ_COMPLETION_DATA_T *buf;72unsigned int msgbufsize;73unsigned int msgbufcount; /* IN/OUT */74void **msgbufs;75} VCHIQ_AWAIT_COMPLETION_T;7677typedef struct {78unsigned int handle;79int blocking;80unsigned int bufsize;81void *buf;82} VCHIQ_DEQUEUE_MESSAGE_T;8384typedef struct {85unsigned int config_size;86VCHIQ_CONFIG_T *pconfig;87} VCHIQ_GET_CONFIG_T;8889typedef struct {90unsigned int handle;91VCHIQ_SERVICE_OPTION_T option;92int value;93} VCHIQ_SET_SERVICE_OPTION_T;9495typedef struct {96void *virt_addr;97size_t num_bytes;98} VCHIQ_DUMP_MEM_T;99100#define VCHIQ_IOC_CONNECT _IO(VCHIQ_IOC_MAGIC, 0)101#define VCHIQ_IOC_SHUTDOWN _IO(VCHIQ_IOC_MAGIC, 1)102#define VCHIQ_IOC_CREATE_SERVICE \103_IOWR(VCHIQ_IOC_MAGIC, 2, VCHIQ_CREATE_SERVICE_T)104#define VCHIQ_IOC_REMOVE_SERVICE _IO(VCHIQ_IOC_MAGIC, 3)105#define VCHIQ_IOC_QUEUE_MESSAGE \106_IOW(VCHIQ_IOC_MAGIC, 4, VCHIQ_QUEUE_MESSAGE_T)107#define VCHIQ_IOC_QUEUE_BULK_TRANSMIT \108_IOWR(VCHIQ_IOC_MAGIC, 5, VCHIQ_QUEUE_BULK_TRANSFER_T)109#define VCHIQ_IOC_QUEUE_BULK_RECEIVE \110_IOWR(VCHIQ_IOC_MAGIC, 6, VCHIQ_QUEUE_BULK_TRANSFER_T)111#define VCHIQ_IOC_AWAIT_COMPLETION \112_IOWR(VCHIQ_IOC_MAGIC, 7, VCHIQ_AWAIT_COMPLETION_T)113#define VCHIQ_IOC_DEQUEUE_MESSAGE \114_IOWR(VCHIQ_IOC_MAGIC, 8, VCHIQ_DEQUEUE_MESSAGE_T)115#define VCHIQ_IOC_GET_CLIENT_ID _IO(VCHIQ_IOC_MAGIC, 9)116#define VCHIQ_IOC_GET_CONFIG \117_IOWR(VCHIQ_IOC_MAGIC, 10, VCHIQ_GET_CONFIG_T)118#define VCHIQ_IOC_CLOSE_SERVICE _IO(VCHIQ_IOC_MAGIC, 11)119#define VCHIQ_IOC_USE_SERVICE _IO(VCHIQ_IOC_MAGIC, 12)120#define VCHIQ_IOC_RELEASE_SERVICE _IO(VCHIQ_IOC_MAGIC, 13)121#define VCHIQ_IOC_SET_SERVICE_OPTION \122_IOW(VCHIQ_IOC_MAGIC, 14, VCHIQ_SET_SERVICE_OPTION_T)123#define VCHIQ_IOC_DUMP_PHYS_MEM \124_IOW(VCHIQ_IOC_MAGIC, 15, VCHIQ_DUMP_MEM_T)125#define VCHIQ_IOC_LIB_VERSION _IO(VCHIQ_IOC_MAGIC, 16)126#define VCHIQ_IOC_CLOSE_DELIVERED _IO(VCHIQ_IOC_MAGIC, 17)127#define VCHIQ_IOC_MAX 17128129#endif130131132