Path: blob/master/include/uapi/rdma/rdma_user_ioctl_cmds.h
26295 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#include <linux/types.h>36#include <linux/ioctl.h>3738/* Documentation/userspace-api/ioctl/ioctl-number.rst */39#define RDMA_IOCTL_MAGIC 0x1b40#define RDMA_VERBS_IOCTL \41_IOWR(RDMA_IOCTL_MAGIC, 1, struct ib_uverbs_ioctl_hdr)4243enum {44/* User input */45UVERBS_ATTR_F_MANDATORY = 1U << 0,46/*47* Valid output bit should be ignored and considered set in48* mandatory fields. This bit is kernel output.49*/50UVERBS_ATTR_F_VALID_OUTPUT = 1U << 1,51};5253struct ib_uverbs_attr {54__u16 attr_id; /* command specific type attribute */55__u16 len; /* only for pointers and IDRs array */56__u16 flags; /* combination of UVERBS_ATTR_F_XXXX */57union {58struct {59__u8 elem_id;60__u8 reserved;61} enum_data;62__u16 reserved;63} attr_data;64union {65/*66* ptr to command, inline data, idr/fd or67* ptr to __u32 array of IDRs68*/69__aligned_u64 data;70/* Used by FD_IN and FD_OUT */71__s64 data_s64;72};73};7475struct ib_uverbs_ioctl_hdr {76__u16 length;77__u16 object_id;78__u16 method_id;79__u16 num_attrs;80__aligned_u64 reserved1;81__u32 driver_id;82__u32 reserved2;83struct ib_uverbs_attr attrs[];84};8586#endif878889