]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ofed/libmthca/src/wqe.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ofed / libmthca / src / wqe.h
1 /*
2  * Copyright (c) 2004, 2005 Topspin Communications.  All rights reserved.
3  * Copyright (c) 2005 Cisco Systems.  All rights reserved.
4  *
5  * This software is available to you under a choice of one of two
6  * licenses.  You may choose to be licensed under the terms of the GNU
7  * General Public License (GPL) Version 2, available from the file
8  * COPYING in the main directory of this source tree, or the
9  * OpenIB.org BSD license below:
10  *
11  *     Redistribution and use in source and binary forms, with or
12  *     without modification, are permitted provided that the following
13  *     conditions are met:
14  *
15  *      - Redistributions of source code must retain the above
16  *        copyright notice, this list of conditions and the following
17  *        disclaimer.
18  *
19  *      - Redistributions in binary form must reproduce the above
20  *        copyright notice, this list of conditions and the following
21  *        disclaimer in the documentation and/or other materials
22  *        provided with the distribution.
23  *
24  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31  * SOFTWARE.
32  */
33
34 #ifndef WQE_H
35 #define WQE_H
36
37 enum {
38         MTHCA_SEND_DOORBELL     = 0x10,
39         MTHCA_RECV_DOORBELL     = 0x18
40 };
41
42 enum {
43         MTHCA_NEXT_DBD       = 1 << 7,
44         MTHCA_NEXT_FENCE     = 1 << 6,
45         MTHCA_NEXT_CQ_UPDATE = 1 << 3,
46         MTHCA_NEXT_EVENT_GEN = 1 << 2,
47         MTHCA_NEXT_SOLICIT   = 1 << 1,
48 };
49
50 enum {
51         MTHCA_INLINE_SEG = 1 << 31
52 };
53
54 enum {
55         MTHCA_INVAL_LKEY                        = 0x100,
56         MTHCA_TAVOR_MAX_WQES_PER_RECV_DB        = 256,
57         MTHCA_ARBEL_MAX_WQES_PER_SEND_DB        = 255
58 };
59
60 struct mthca_next_seg {
61         uint32_t        nda_op; /* [31:6] next WQE [4:0] next opcode */
62         uint32_t        ee_nds; /* [31:8] next EE  [7] DBD [6] F [5:0] next WQE size */
63         uint32_t        flags;  /* [3] CQ [2] Event [1] Solicit */
64         uint32_t        imm;    /* immediate data */
65 };
66
67 struct mthca_tavor_ud_seg {
68         uint32_t        reserved1;
69         uint32_t        lkey;
70         uint64_t        av_addr;
71         uint32_t        reserved2[4];
72         uint32_t        dqpn;
73         uint32_t        qkey;
74         uint32_t        reserved3[2];
75 };
76
77 struct mthca_arbel_ud_seg {
78         uint32_t        av[8];
79         uint32_t        dqpn;
80         uint32_t        qkey;
81         uint32_t        reserved[2];
82 };
83
84 struct mthca_bind_seg {
85         uint32_t        flags;  /* [31] Atomic [30] rem write [29] rem read */
86         uint32_t        reserved;
87         uint32_t        new_rkey;
88         uint32_t        lkey;
89         uint64_t        addr;
90         uint64_t        length;
91 };
92
93 struct mthca_raddr_seg {
94         uint64_t        raddr;
95         uint32_t        rkey;
96         uint32_t        reserved;
97 };
98
99 struct mthca_atomic_seg {
100         uint64_t        swap_add;
101         uint64_t        compare;
102 };
103
104 struct mthca_data_seg {
105         uint32_t        byte_count;
106         uint32_t        lkey;
107         uint64_t        addr;
108 };
109
110 struct mthca_inline_seg {
111         uint32_t        byte_count;
112 };
113
114 #endif /* WQE_H */