[golan] Add Connect-IB, ConnectX-4 and ConnectX-4 Lx (Infiniband) support
[ipxe.git] / src / drivers / infiniband / mlx_utils / mlx_lib / mlx_ocbb / mlx_ocbb.h
1 #ifndef MLX_OCBB_H_
2 #define MLX_OCBB_H_
3
4 /*
5 * Copyright (C) 2015 Mellanox Technologies Ltd.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
21 */
22
23 FILE_LICENCE ( GPL2_OR_LATER );
24
25 #include "mlx_utils.h"
26
27 #define MLX_OCBB_EVENT_DATA_SIZE 2
28 struct mlx_ocbb_init {
29 mlx_uint32 address_hi;
30 mlx_uint32 address_lo;
31 };
32
33 struct mlx_ocbb_query_status {
34 mlx_uint32 reserved :24;
35 mlx_uint32 status :8;
36 };
37
38 struct mlx_ocbb_set_event {
39 mlx_uint64 event_data;
40 mlx_uint32 event_number :8;
41 mlx_uint32 event_length :8;
42 mlx_uint32 data_length :8;
43 mlx_uint32 data_start_offset :8;
44 };
45
46 mlx_status
47 mlx_ocbb_init (
48 IN mlx_utils *utils,
49 IN mlx_uint64 address
50 );
51
52 mlx_status
53 mlx_ocbb_query_header_status (
54 IN mlx_utils *utils,
55 OUT mlx_uint8 *ocbb_status
56 );
57
58 mlx_status
59 mlx_ocbb_query_etoc_status (
60 IN mlx_utils *utils,
61 OUT mlx_uint8 *ocbb_status
62 );
63
64 mlx_status
65 mlx_ocbb_set_event (
66 IN mlx_utils *utils,
67 IN mlx_uint64 EventData,
68 IN mlx_uint8 EventNumber,
69 IN mlx_uint8 EventLength,
70 IN mlx_uint8 DataLength,
71 IN mlx_uint8 DataStartOffset
72 );
73 #endif /* MLX_OCBB_H_ */