iPXE
mlx_pci_gw.h
Go to the documentation of this file.
1#ifndef INCLUDE_PUBLIC_MLX_PCI_GW_H_
2#define INCLUDE_PUBLIC_MLX_PCI_GW_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
23FILE_LICENCE ( GPL2_OR_LATER );
24
25#include "mlx_utils.h"
26
27#define PCI_GW_FIRST_CAPABILITY_POINTER_OFFSET 0x34
28
29#define PCI_GW_CAPABILITY_ID 0x9
30
31#define PCI_GW_CAPABILITY_ID_OFFSET 0x0
32#define PCI_GW_CAPABILITY_NEXT_POINTER_OFFSET 0x1
33#define PCI_GW_CAPABILITY_SPACE_OFFSET 0x4
34#define PCI_GW_CAPABILITY_STATUS_OFFSET 0x7
35#define PCI_GW_CAPABILITY_COUNTER_OFFSET 0x8
36#define PCI_GW_CAPABILITY_SEMAPHORE_OFFSET 0xC
37#define PCI_GW_CAPABILITY_ADDRESS_OFFSET 0x10
38#define PCI_GW_CAPABILITY_FLAG_OFFSET 0x10
39#define PCI_GW_CAPABILITY_DATA_OFFSET 0x14
40
41#define PCI_GW_SEMPHORE_TRIES 3000000
42#define PCI_GW_GET_OWNERSHIP_TRIES 5000
43#define PCI_GW_READ_FLAG_TRIES 3000000
44
45#define PCI_GW_WRITE_FLAG 0x80000000
46
47#define PCI_GW_SPACE_NODNIC 0x4
48#define PCI_GW_SPACE_ALL_ICMD 0x3
49#define PCI_GW_SPACE_SEMAPHORE 0xa
50#define PCI_GW_SPACE_CR0 0x2
51
53
54
57 IN mlx_utils *utils
58 );
61 IN mlx_utils *utils
62 );
65 IN mlx_utils *utils,
66 IN mlx_pci_gw_space space,
69 );
70
73 IN mlx_utils *utils,
74 IN mlx_pci_gw_space space,
77 );
78
79
80
81#endif /* INCLUDE_PUBLIC_MLX_PCI_GW_H_ */
uint64_t address
Base address.
Definition ena.h:13
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Definition netvsc.h:5
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
mlx_status mlx_pci_gw_teardown(IN mlx_utils *utils)
Definition mlx_pci_gw.c:247
mlx_status mlx_pci_gw_read(IN mlx_utils *utils, IN mlx_pci_gw_space space, IN mlx_uint32 address, OUT mlx_pci_gw_buffer *buffer)
Definition mlx_pci_gw.c:258
mlx_status mlx_pci_gw_init(IN mlx_utils *utils)
Definition mlx_pci_gw.c:218
mlx_uint32 mlx_pci_gw_buffer
Definition mlx_pci_gw.h:52
mlx_status mlx_pci_gw_write(IN mlx_utils *utils, IN mlx_pci_gw_space space, IN mlx_uint32 address, IN mlx_pci_gw_buffer buffer)
Definition mlx_pci_gw.c:328
uint32_t mlx_uint32
int mlx_status
mlx_uint16 mlx_pci_gw_space
Definition mlx_utils.h:31
#define IN
Definition mlx_utils.h:28
#define OUT
Definition mlx_utils.h:29