/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ /* * Copyright (c) 2015-2016, Integrated Device Technology Inc. * Copyright (c) 2015, Prodrive Technologies * Copyright (c) 2015, Texas Instruments Incorporated * Copyright (c) 2015, RapidIO Trade Association * All rights reserved. * * This software is available to you under a choice of one of two licenses. * You may choose to be licensed under the terms of the GNU General Public * License(GPL) Version 2, or the BSD-3 Clause license below: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _RIO_MPORT_CDEV_H_ #define _RIO_MPORT_CDEV_H_ #include <linux/ioctl.h> #include <linux/types.h> struct rio_mport_maint_io { … }; /* * Definitions for RapidIO data transfers: * - memory mapped (MAPPED) * - packet generation from memory (TRANSFER) */ #define RIO_TRANSFER_MODE_MAPPED … #define RIO_TRANSFER_MODE_TRANSFER … #define RIO_CAP_DBL_SEND … #define RIO_CAP_DBL_RECV … #define RIO_CAP_PW_SEND … #define RIO_CAP_PW_RECV … #define RIO_CAP_MAP_OUTB … #define RIO_CAP_MAP_INB … struct rio_mport_properties { … }; /* * Definitions for RapidIO events; * - incoming port-writes * - incoming doorbells */ #define RIO_DOORBELL … #define RIO_PORTWRITE … struct rio_doorbell { … }; struct rio_doorbell_filter { … }; struct rio_portwrite { … }; struct rio_pw_filter { … }; /* RapidIO base address for inbound requests set to value defined below * indicates that no specific RIO-to-local address translation is requested * and driver should use direct (one-to-one) address mapping. */ #define RIO_MAP_ANY_ADDR … struct rio_mmap { … }; struct rio_dma_mem { … }; struct rio_event { … }; enum rio_transfer_sync { … }; enum rio_transfer_dir { … }; /* * RapidIO data exchange transactions are lists of individual transfers. Each * transfer exchanges data between two RapidIO devices by remote direct memory * access and has its own completion code. * * The RapidIO specification defines four types of data exchange requests: * NREAD, NWRITE, SWRITE and NWRITE_R. The RapidIO DMA channel interface allows * to specify the required type of write operation or combination of them when * only the last data packet requires response. * * NREAD: read up to 256 bytes from remote device memory into local memory * NWRITE: write up to 256 bytes from local memory to remote device memory * without confirmation * SWRITE: as NWRITE, but all addresses and payloads must be 64-bit aligned * NWRITE_R: as NWRITE, but expect acknowledgment from remote device. * * The default exchange is chosen from NREAD and any of the WRITE modes as the * driver sees fit. For write requests the user can explicitly choose between * any of the write modes for each transaction. */ enum rio_exchange { … }; struct rio_transfer_io { … }; struct rio_transaction { … }; struct rio_async_tx_wait { … }; #define RIO_MAX_DEVNAME_SZ … struct rio_rdev_info { … }; /* Driver IOCTL codes */ #define RIO_MPORT_DRV_MAGIC … #define RIO_MPORT_MAINT_HDID_SET … #define RIO_MPORT_MAINT_COMPTAG_SET … #define RIO_MPORT_MAINT_PORT_IDX_GET … #define RIO_MPORT_GET_PROPERTIES … #define RIO_MPORT_MAINT_READ_LOCAL … #define RIO_MPORT_MAINT_WRITE_LOCAL … #define RIO_MPORT_MAINT_READ_REMOTE … #define RIO_MPORT_MAINT_WRITE_REMOTE … #define RIO_ENABLE_DOORBELL_RANGE … #define RIO_DISABLE_DOORBELL_RANGE … #define RIO_ENABLE_PORTWRITE_RANGE … #define RIO_DISABLE_PORTWRITE_RANGE … #define RIO_SET_EVENT_MASK … #define RIO_GET_EVENT_MASK … #define RIO_MAP_OUTBOUND … #define RIO_UNMAP_OUTBOUND … #define RIO_MAP_INBOUND … #define RIO_UNMAP_INBOUND … #define RIO_ALLOC_DMA … #define RIO_FREE_DMA … #define RIO_TRANSFER … #define RIO_WAIT_FOR_ASYNC … #define RIO_DEV_ADD … #define RIO_DEV_DEL … #endif /* _RIO_MPORT_CDEV_H_ */