1290650Shselasky/*-
2337115Shselasky * Copyright (c) 2013-2017, Mellanox Technologies, Ltd.  All rights reserved.
3290650Shselasky *
4290650Shselasky * Redistribution and use in source and binary forms, with or without
5290650Shselasky * modification, are permitted provided that the following conditions
6290650Shselasky * are met:
7290650Shselasky * 1. Redistributions of source code must retain the above copyright
8290650Shselasky *    notice, this list of conditions and the following disclaimer.
9290650Shselasky * 2. Redistributions in binary form must reproduce the above copyright
10290650Shselasky *    notice, this list of conditions and the following disclaimer in the
11290650Shselasky *    documentation and/or other materials provided with the distribution.
12290650Shselasky *
13290650Shselasky * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND
14290650Shselasky * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15290650Shselasky * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16290650Shselasky * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
17290650Shselasky * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18290650Shselasky * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19290650Shselasky * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20290650Shselasky * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21290650Shselasky * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22290650Shselasky * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23290650Shselasky * SUCH DAMAGE.
24290650Shselasky *
25290650Shselasky * $FreeBSD: stable/11/sys/dev/mlx5/srq.h 337115 2018-08-02 08:56:27Z hselasky $
26290650Shselasky */
27290650Shselasky
28290650Shselasky#ifndef MLX5_SRQ_H
29290650Shselasky#define MLX5_SRQ_H
30290650Shselasky
31290650Shselasky#include <dev/mlx5/driver.h>
32290650Shselasky
33331807Shselaskyenum {
34331807Shselasky	MLX5_SRQ_FLAG_ERR    = (1 << 0),
35331807Shselasky	MLX5_SRQ_FLAG_WQ_SIG = (1 << 1),
36331807Shselasky};
37331807Shselasky
38331807Shselaskystruct mlx5_srq_attr {
39331807Shselasky	u32 type;
40331807Shselasky	u32 flags;
41331807Shselasky	u32 log_size;
42331807Shselasky	u32 wqe_shift;
43331807Shselasky	u32 log_page_size;
44331807Shselasky	u32 wqe_cnt;
45331807Shselasky	u32 srqn;
46331807Shselasky	u32 xrcd;
47331807Shselasky	u32 page_offset;
48331807Shselasky	u32 cqn;
49331807Shselasky	u32 pd;
50331807Shselasky	u32 lwm;
51331807Shselasky	u32 user_index;
52331807Shselasky	u64 db_record;
53331807Shselasky	u64 *pas;
54331807Shselasky};
55331807Shselasky
56331807Shselaskystruct mlx5_core_dev;
57331807Shselasky
58290650Shselaskyvoid mlx5_init_srq_table(struct mlx5_core_dev *dev);
59290650Shselaskyvoid mlx5_cleanup_srq_table(struct mlx5_core_dev *dev);
60290650Shselasky
61290650Shselasky#endif /* MLX5_SRQ_H */
62