ib_user_mad.h revision 96c1db7b9d601c31d103389cac074a6cce0d7633
1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef IB_USER_MAD_H
20#define IB_USER_MAD_H
21#include <linux/types.h>
22#include <linux/ioctl.h>
23#define IB_USER_MAD_ABI_VERSION 5
24struct ib_user_mad_hdr_old {
25  __u32 id;
26  __u32 status;
27  __u32 timeout_ms;
28  __u32 retries;
29  __u32 length;
30  __be32 qpn;
31  __be32 qkey;
32  __be16 lid;
33  __u8 sl;
34  __u8 path_bits;
35  __u8 grh_present;
36  __u8 gid_index;
37  __u8 hop_limit;
38  __u8 traffic_class;
39  __u8 gid[16];
40  __be32 flow_label;
41};
42struct ib_user_mad_hdr {
43  __u32 id;
44  __u32 status;
45  __u32 timeout_ms;
46  __u32 retries;
47  __u32 length;
48  __be32 qpn;
49  __be32 qkey;
50  __be16 lid;
51  __u8 sl;
52  __u8 path_bits;
53  __u8 grh_present;
54  __u8 gid_index;
55  __u8 hop_limit;
56  __u8 traffic_class;
57  __u8 gid[16];
58  __be32 flow_label;
59  __u16 pkey_index;
60  __u8 reserved[6];
61};
62struct ib_user_mad {
63  struct ib_user_mad_hdr hdr;
64  __u64 data[0];
65};
66typedef unsigned long __attribute__((aligned(4))) packed_ulong;
67#define IB_USER_MAD_LONGS_PER_METHOD_MASK (128 / (8 * sizeof(long)))
68struct ib_user_mad_reg_req {
69  __u32 id;
70  packed_ulong method_mask[IB_USER_MAD_LONGS_PER_METHOD_MASK];
71  __u8 qpn;
72  __u8 mgmt_class;
73  __u8 mgmt_class_version;
74  __u8 oui[3];
75  __u8 rmpp_version;
76};
77enum {
78  IB_USER_MAD_USER_RMPP = (1 << 0),
79};
80#define IB_USER_MAD_REG_FLAGS_CAP (IB_USER_MAD_USER_RMPP)
81struct ib_user_mad_reg_req2 {
82  __u32 id;
83  __u32 qpn;
84  __u8 mgmt_class;
85  __u8 mgmt_class_version;
86  __u16 res;
87  __u32 flags;
88  __u64 method_mask[2];
89  __u32 oui;
90  __u8 rmpp_version;
91  __u8 reserved[3];
92};
93#define IB_IOCTL_MAGIC 0x1b
94#define IB_USER_MAD_REGISTER_AGENT _IOWR(IB_IOCTL_MAGIC, 1, struct ib_user_mad_reg_req)
95#define IB_USER_MAD_UNREGISTER_AGENT _IOW(IB_IOCTL_MAGIC, 2, __u32)
96#define IB_USER_MAD_ENABLE_PKEY _IO(IB_IOCTL_MAGIC, 3)
97#define IB_USER_MAD_REGISTER_AGENT2 _IOWR(IB_IOCTL_MAGIC, 4, struct ib_user_mad_reg_req2)
98#endif
99