blob: b0ce93a86fb788226f2bd62ca9d9d964bce34fef [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef IB_USER_MAD_H
8#define IB_USER_MAD_H
9#include <linux/types.h>
Christopher Ferris525ce912017-07-26 13:12:53 -070010#include <rdma/rdma_user_ioctl.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011#define IB_USER_MAD_ABI_VERSION 5
12struct ib_user_mad_hdr_old {
Tao Baod7db5942015-01-28 10:07:51 -080013 __u32 id;
14 __u32 status;
Tao Baod7db5942015-01-28 10:07:51 -080015 __u32 timeout_ms;
16 __u32 retries;
17 __u32 length;
18 __be32 qpn;
Tao Baod7db5942015-01-28 10:07:51 -080019 __be32 qkey;
20 __be16 lid;
21 __u8 sl;
22 __u8 path_bits;
Tao Baod7db5942015-01-28 10:07:51 -080023 __u8 grh_present;
24 __u8 gid_index;
25 __u8 hop_limit;
26 __u8 traffic_class;
Tao Baod7db5942015-01-28 10:07:51 -080027 __u8 gid[16];
28 __be32 flow_label;
Ben Cheng655a7c02013-10-16 16:09:24 -070029};
30struct ib_user_mad_hdr {
Tao Baod7db5942015-01-28 10:07:51 -080031 __u32 id;
32 __u32 status;
33 __u32 timeout_ms;
34 __u32 retries;
Tao Baod7db5942015-01-28 10:07:51 -080035 __u32 length;
36 __be32 qpn;
37 __be32 qkey;
38 __be16 lid;
Tao Baod7db5942015-01-28 10:07:51 -080039 __u8 sl;
40 __u8 path_bits;
41 __u8 grh_present;
42 __u8 gid_index;
Tao Baod7db5942015-01-28 10:07:51 -080043 __u8 hop_limit;
44 __u8 traffic_class;
45 __u8 gid[16];
46 __be32 flow_label;
Tao Baod7db5942015-01-28 10:07:51 -080047 __u16 pkey_index;
48 __u8 reserved[6];
Ben Cheng655a7c02013-10-16 16:09:24 -070049};
50struct ib_user_mad {
Tao Baod7db5942015-01-28 10:07:51 -080051 struct ib_user_mad_hdr hdr;
Christopher Ferris3a39c0b2021-09-02 00:03:38 +000052 __aligned_u64 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -070053};
54typedef unsigned long __attribute__((aligned(4))) packed_ulong;
Tao Baod7db5942015-01-28 10:07:51 -080055#define IB_USER_MAD_LONGS_PER_METHOD_MASK (128 / (8 * sizeof(long)))
Ben Cheng655a7c02013-10-16 16:09:24 -070056struct ib_user_mad_reg_req {
Tao Baod7db5942015-01-28 10:07:51 -080057 __u32 id;
58 packed_ulong method_mask[IB_USER_MAD_LONGS_PER_METHOD_MASK];
Tao Baod7db5942015-01-28 10:07:51 -080059 __u8 qpn;
60 __u8 mgmt_class;
61 __u8 mgmt_class_version;
62 __u8 oui[3];
Tao Baod7db5942015-01-28 10:07:51 -080063 __u8 rmpp_version;
Ben Cheng655a7c02013-10-16 16:09:24 -070064};
Christopher Ferris82d75042015-01-26 10:57:07 -080065enum {
Tao Baod7db5942015-01-28 10:07:51 -080066 IB_USER_MAD_USER_RMPP = (1 << 0),
Christopher Ferris82d75042015-01-26 10:57:07 -080067};
68#define IB_USER_MAD_REG_FLAGS_CAP (IB_USER_MAD_USER_RMPP)
69struct ib_user_mad_reg_req2 {
Tao Baod7db5942015-01-28 10:07:51 -080070 __u32 id;
Tao Baod7db5942015-01-28 10:07:51 -080071 __u32 qpn;
72 __u8 mgmt_class;
73 __u8 mgmt_class_version;
74 __u16 res;
Tao Baod7db5942015-01-28 10:07:51 -080075 __u32 flags;
Christopher Ferris76a1d452018-06-27 14:12:29 -070076 __aligned_u64 method_mask[2];
Tao Baod7db5942015-01-28 10:07:51 -080077 __u32 oui;
78 __u8 rmpp_version;
Tao Baod7db5942015-01-28 10:07:51 -080079 __u8 reserved[3];
Christopher Ferris82d75042015-01-26 10:57:07 -080080};
Ben Cheng655a7c02013-10-16 16:09:24 -070081#endif