Path: blob/main/sys/ofed/include/uapi/rdma/rdma_user_ioctl_cmds.h
39488 views
/*1* Copyright (c) 2018, Mellanox Technologies inc. All rights reserved.2*3* This software is available to you under a choice of one of two4* licenses. You may choose to be licensed under the terms of the GNU5* General Public License (GPL) Version 2, available from the file6* COPYING in the main directory of this source tree, or the7* OpenIB.org BSD license below:8*9* Redistribution and use in source and binary forms, with or10* without modification, are permitted provided that the following11* conditions are met:12*13* - Redistributions of source code must retain the above14* copyright notice, this list of conditions and the following15* disclaimer.16*17* - Redistributions in binary form must reproduce the above18* copyright notice, this list of conditions and the following19* disclaimer in the documentation and/or other materials20* provided with the distribution.21*22* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,23* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF24* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND25* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS26* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN27* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN28* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE29* SOFTWARE.30*/3132#ifndef RDMA_USER_IOCTL_CMDS_H33#define RDMA_USER_IOCTL_CMDS_H3435#ifdef _KERNEL36#include <linux/types.h>37#include <linux/ioctl.h>38#else39#include <infiniband/types.h>40#include <sys/ioccom.h>41#endif4243/* Documentation/ioctl/ioctl-number.rst */44#define RDMA_IOCTL_MAGIC 0x1b45#define RDMA_VERBS_IOCTL \46_IOWR(RDMA_IOCTL_MAGIC, 1, struct ib_uverbs_ioctl_hdr)4748enum {49/* User input */50UVERBS_ATTR_F_MANDATORY = 1U << 0,51/*52* Valid output bit should be ignored and considered set in53* mandatory fields. This bit is kernel output.54*/55UVERBS_ATTR_F_VALID_OUTPUT = 1U << 1,56};5758struct ib_uverbs_attr {59__u16 attr_id; /* command specific type attribute */60__u16 len; /* only for pointers and IDRs array */61__u16 flags; /* combination of UVERBS_ATTR_F_XXXX */62union {63struct {64__u8 elem_id;65__u8 reserved;66} enum_data;67__u16 reserved;68} attr_data;69union {70/*71* ptr to command, inline data, idr/fd or72* ptr to __u32 array of IDRs73*/74__aligned_u64 data;75/* Used by FD_IN and FD_OUT */76__s64 data_s64;77};78};7980struct ib_uverbs_ioctl_hdr {81__u16 length;82__u16 object_id;83__u16 method_id;84__u16 num_attrs;85__aligned_u64 reserved1;86__u32 driver_id;87__u32 reserved2;88struct ib_uverbs_attr attrs[0];89};9091#endif929394