xref: /freebsd/sys/ofed/include/uapi/rdma/rdma_user_ioctl.h (revision d048e8c6196a580e6fafc23bbeabc141add7d3b0)
1b633e08cSHans Petter Selasky /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2b633e08cSHans Petter Selasky /*
3b633e08cSHans Petter Selasky  * Copyright (c) 2016 Mellanox Technologies, LTD. All rights reserved.
4b633e08cSHans Petter Selasky  *
5b633e08cSHans Petter Selasky  * This software is available to you under a choice of one of two
6b633e08cSHans Petter Selasky  * licenses.  You may choose to be licensed under the terms of the GNU
7b633e08cSHans Petter Selasky  * General Public License (GPL) Version 2, available from the file
8b633e08cSHans Petter Selasky  * COPYING in the main directory of this source tree, or the
9b633e08cSHans Petter Selasky  * OpenIB.org BSD license below:
10b633e08cSHans Petter Selasky  *
11b633e08cSHans Petter Selasky  *     Redistribution and use in source and binary forms, with or
12b633e08cSHans Petter Selasky  *     without modification, are permitted provided that the following
13b633e08cSHans Petter Selasky  *     conditions are met:
14b633e08cSHans Petter Selasky  *
15b633e08cSHans Petter Selasky  *      - Redistributions of source code must retain the above
16b633e08cSHans Petter Selasky  *        copyright notice, this list of conditions and the following
17b633e08cSHans Petter Selasky  *        disclaimer.
18b633e08cSHans Petter Selasky  *
19b633e08cSHans Petter Selasky  *      - Redistributions in binary form must reproduce the above
20b633e08cSHans Petter Selasky  *        copyright notice, this list of conditions and the following
21b633e08cSHans Petter Selasky  *        disclaimer in the documentation and/or other materials
22b633e08cSHans Petter Selasky  *        provided with the distribution.
23b633e08cSHans Petter Selasky  *
24b633e08cSHans Petter Selasky  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25b633e08cSHans Petter Selasky  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26b633e08cSHans Petter Selasky  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27b633e08cSHans Petter Selasky  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28b633e08cSHans Petter Selasky  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29b633e08cSHans Petter Selasky  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30b633e08cSHans Petter Selasky  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31b633e08cSHans Petter Selasky  * SOFTWARE.
32b633e08cSHans Petter Selasky  */
33b633e08cSHans Petter Selasky 
34b633e08cSHans Petter Selasky #ifndef RDMA_USER_IOCTL_H
35b633e08cSHans Petter Selasky #define RDMA_USER_IOCTL_H
36b633e08cSHans Petter Selasky 
37b633e08cSHans Petter Selasky #ifdef _KERNEL
38b633e08cSHans Petter Selasky #include <linux/types.h>
39b633e08cSHans Petter Selasky #include <linux/ioctl.h>
40b633e08cSHans Petter Selasky #else
41b633e08cSHans Petter Selasky #include <infiniband/types.h>
42b633e08cSHans Petter Selasky #include <sys/ioccom.h>
43b633e08cSHans Petter Selasky #endif
44b633e08cSHans Petter Selasky 
45b633e08cSHans Petter Selasky #include <rdma/ib_user_mad.h>
46b633e08cSHans Petter Selasky #include <rdma/rdma_user_ioctl_cmds.h>
47b633e08cSHans Petter Selasky 
48b633e08cSHans Petter Selasky /* Legacy name, for user space application which already use it */
49b633e08cSHans Petter Selasky #define IB_IOCTL_MAGIC		RDMA_IOCTL_MAGIC
50b633e08cSHans Petter Selasky 
51b633e08cSHans Petter Selasky /*
52b633e08cSHans Petter Selasky  * General blocks assignments
53*d048e8c6SGordon Bergling  * It is closed on purpose do not expose it to user space
54b633e08cSHans Petter Selasky  * #define MAD_CMD_BASE		0x00
55b633e08cSHans Petter Selasky  */
56b633e08cSHans Petter Selasky 
57b633e08cSHans Petter Selasky /* MAD specific section */
58b633e08cSHans Petter Selasky #define IB_USER_MAD_REGISTER_AGENT	_IOWR(RDMA_IOCTL_MAGIC, 0x01, struct ib_user_mad_reg_req)
59b633e08cSHans Petter Selasky #define IB_USER_MAD_UNREGISTER_AGENT	_IOW(RDMA_IOCTL_MAGIC,  0x02, __u32)
60b633e08cSHans Petter Selasky #define IB_USER_MAD_ENABLE_PKEY		_IO(RDMA_IOCTL_MAGIC,   0x03)
61b633e08cSHans Petter Selasky #define IB_USER_MAD_REGISTER_AGENT2	_IOWR(RDMA_IOCTL_MAGIC, 0x04, struct ib_user_mad_reg_req2)
62b633e08cSHans Petter Selasky 
63b633e08cSHans Petter Selasky #endif /* RDMA_USER_IOCTL_H */
64