[golan] Add Connect-IB, ConnectX-4 and ConnectX-4 Lx (Infiniband) support
[ipxe.git] / src / drivers / infiniband / mlx_utils / include / public / mlx_pci.h
1 #ifndef STUB_MLXUTILS_INCLUDE_PUBLIC_PCI_H_
2 #define STUB_MLXUTILS_INCLUDE_PUBLIC_PCI_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 typedef enum {
28 MlxPciWidthUint8 = 0,
29 MlxPciWidthUint16,
30 MlxPciWidthUint32,
31 MlxPciWidthUint64,
32 } mlx_pci_width;
33
34 mlx_status
35 mlx_pci_init(
36 IN mlx_utils *utils
37 );
38
39 mlx_status
40 mlx_pci_read(
41 IN mlx_utils *utils,
42 IN mlx_pci_width width,
43 IN mlx_uint32 offset,
44 IN mlx_uintn count,
45 OUT mlx_void *buffer
46 );
47
48 mlx_status
49 mlx_pci_write(
50 IN mlx_utils *utils,
51 IN mlx_pci_width width,
52 IN mlx_uint32 offset,
53 IN mlx_uintn count,
54 IN mlx_void *buffer
55 );
56
57 mlx_status
58 mlx_pci_mem_read(
59 IN mlx_utils *utils,
60 IN mlx_pci_width width,
61 IN mlx_uint8 bar_index,
62 IN mlx_uint64 offset,
63 IN mlx_uintn count,
64 OUT mlx_void *buffer
65 );
66
67 mlx_status
68 mlx_pci_mem_write(
69 IN mlx_utils *utils,
70 IN mlx_pci_width width,
71 IN mlx_uint8 bar_index,
72 IN mlx_uint64 offset,
73 IN mlx_uintn count,
74 IN mlx_void *buffer
75 );
76
77
78 #endif /* STUB_MLXUTILS_INCLUDE_PUBLIC_PCI_H_ */