1219820Sjeff/*
2219820Sjeff * Copyright (c) 2007 Cisco, Inc.  All rights reserved.
3219820Sjeff *
4219820Sjeff * This software is available to you under a choice of one of two
5219820Sjeff * licenses.  You may choose to be licensed under the terms of the GNU
6219820Sjeff * General Public License (GPL) Version 2, available from the file
7219820Sjeff * COPYING in the main directory of this source tree, or the
8219820Sjeff * OpenIB.org BSD license below:
9219820Sjeff *
10219820Sjeff *     Redistribution and use in source and binary forms, with or
11219820Sjeff *     without modification, are permitted provided that the following
12219820Sjeff *     conditions are met:
13219820Sjeff *
14219820Sjeff *      - Redistributions of source code must retain the above
15219820Sjeff *        copyright notice, this list of conditions and the following
16219820Sjeff *        disclaimer.
17219820Sjeff *
18219820Sjeff *      - Redistributions in binary form must reproduce the above
19219820Sjeff *        copyright notice, this list of conditions and the following
20219820Sjeff *        disclaimer in the documentation and/or other materials
21219820Sjeff *        provided with the distribution.
22219820Sjeff *
23219820Sjeff * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24219820Sjeff * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25219820Sjeff * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26219820Sjeff * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27219820Sjeff * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28219820Sjeff * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29219820Sjeff * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30219820Sjeff * SOFTWARE.
31219820Sjeff */
32219820Sjeff
33219820Sjeff#ifndef WQE_H
34219820Sjeff#define WQE_H
35219820Sjeff
36219820Sjeffenum {
37219820Sjeff	MLX4_SEND_DOORBELL	= 0x14,
38219820Sjeff};
39219820Sjeff
40219820Sjeffenum {
41219820Sjeff	MLX4_WQE_CTRL_FENCE	= 1 << 6,
42219820Sjeff	MLX4_WQE_CTRL_CQ_UPDATE	= 3 << 2,
43219820Sjeff	MLX4_WQE_CTRL_SOLICIT	= 1 << 1,
44219820Sjeff};
45219820Sjeff
46219820Sjeffenum {
47219820Sjeff	MLX4_INLINE_SEG		= 1 << 31,
48219820Sjeff	MLX4_INLINE_ALIGN	= 64,
49219820Sjeff};
50219820Sjeff
51219820Sjeffenum {
52219820Sjeff	MLX4_INVALID_LKEY	= 0x100,
53219820Sjeff};
54219820Sjeff
55219820Sjeffstruct mlx4_wqe_ctrl_seg {
56219820Sjeff	uint32_t		owner_opcode;
57219820Sjeff	uint16_t                vlan_tag;
58219820Sjeff	uint8_t                 ins_vlan;
59219820Sjeff	uint8_t			fence_size;
60219820Sjeff	/*
61219820Sjeff	 * High 24 bits are SRC remote buffer; low 8 bits are flags:
62219820Sjeff	 * [7]   SO (strong ordering)
63219820Sjeff	 * [5]   TCP/UDP checksum
64219820Sjeff	 * [4]   IP checksum
65219820Sjeff	 * [3:2] C (generate completion queue entry)
66219820Sjeff	 * [1]   SE (solicited event)
67219820Sjeff	 * [0]   FL (force loopback)
68219820Sjeff	 */
69219820Sjeff	uint32_t		xrcrb_flags;
70219820Sjeff	/*
71219820Sjeff	 * imm is immediate data for send/RDMA write w/ immediate;
72219820Sjeff	 * also invalidation key for send with invalidate; input
73219820Sjeff	 * modifier for WQEs on CCQs.
74219820Sjeff	 */
75219820Sjeff	uint32_t		imm;
76219820Sjeff};
77219820Sjeff
78219820Sjeffstruct mlx4_wqe_datagram_seg {
79219820Sjeff	uint32_t		av[8];
80219820Sjeff	uint32_t		dqpn;
81219820Sjeff	uint32_t		qkey;
82219820Sjeff	uint16_t		vlan;
83219820Sjeff	uint8_t			mac[6];
84219820Sjeff};
85219820Sjeff
86219820Sjeffstruct mlx4_wqe_data_seg {
87219820Sjeff	uint32_t		byte_count;
88219820Sjeff	uint32_t		lkey;
89219820Sjeff	uint64_t		addr;
90219820Sjeff};
91219820Sjeff
92219820Sjeffstruct mlx4_wqe_inline_seg {
93219820Sjeff	uint32_t		byte_count;
94219820Sjeff};
95219820Sjeff
96219820Sjeffstruct mlx4_wqe_srq_next_seg {
97219820Sjeff	uint16_t		reserved1;
98219820Sjeff	uint16_t		next_wqe_index;
99219820Sjeff	uint32_t		reserved2[3];
100219820Sjeff};
101219820Sjeff
102219820Sjeffstruct mlx4_wqe_raddr_seg {
103219820Sjeff	uint64_t		raddr;
104219820Sjeff	uint32_t		rkey;
105219820Sjeff	uint32_t		reserved;
106219820Sjeff};
107219820Sjeff
108219820Sjeffstruct mlx4_wqe_atomic_seg {
109219820Sjeff	uint64_t		swap_add;
110219820Sjeff	uint64_t		compare;
111219820Sjeff};
112219820Sjeff
113219820Sjeffstruct mlx4_wqe_bind_seg {
114219820Sjeff	uint32_t		flags1;
115219820Sjeff	uint32_t		flags2;
116219820Sjeff	uint32_t		new_rkey;
117219820Sjeff	uint32_t		lkey;
118219820Sjeff	uint64_t		addr;
119219820Sjeff	uint64_t		length;
120219820Sjeff};
121219820Sjeff
122219820Sjeff#endif /* WQE_H */
123