iPXE
mlx_cmd.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Mellanox Technologies Ltd.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
18 */
19
20FILE_LICENCE ( GPL2_OR_LATER );
21
22#include "../include/mlx_cmd.h"
27
30 IN nodnic_device_priv *device_priv,
33 )
34{
36 mlx_utils *utils = NULL;
37
38 if ( device_priv == NULL || buffer == NULL ) {
40 goto bad_param;
41 }
42
43 utils = device_priv->utils;
44
46 MLX_CHECK_STATUS(device_priv, status, read_error,"mlx_pci_gw_read failed");
47
48read_error:
49bad_param:
50 return status;
51}
52
55 IN nodnic_device_priv *device_priv,
58 )
59{
61 mlx_utils *utils = NULL;
62
63
64 if ( device_priv == NULL ) {
66 goto bad_param;
67 }
68
69 utils = device_priv->utils;
70
71
73 MLX_CHECK_STATUS(device_priv, status, write_error,"mlx_pci_gw_write failed");
74write_error:
75bad_param:
76 return status;
77}
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
uint8_t status
Status.
Definition ena.h:5
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
#define MLX_CHECK_STATUS(id, status, label, message)
Definition mlx_bail.h:37
mlx_status nodnic_cmd_write(IN nodnic_device_priv *device_priv, IN mlx_uint32 address, IN mlx_pci_gw_buffer buffer)
Definition mlx_cmd.c:54
mlx_status nodnic_cmd_read(IN nodnic_device_priv *device_priv, IN mlx_uint32 address, OUT mlx_pci_gw_buffer *buffer)
Definition mlx_cmd.c:29
struct _nodnic_device_priv nodnic_device_priv
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_uint32 mlx_pci_gw_buffer
Definition mlx_pci_gw.h:52
#define PCI_GW_SPACE_NODNIC
Definition mlx_pci_gw.h:47
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
#define MLX_INVALID_PARAMETER
#define MLX_SUCCESS
int mlx_status
#define IN
Definition mlx_utils.h:28
#define OUT
Definition mlx_utils.h:29