iPXE
mlx_vmac.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
25
28 IN mlx_utils *utils,
29 OUT struct mlx_vmac_query_virt_mac *virt_mac
30 )
31{
33 if (utils == NULL || virt_mac == NULL) {
35 goto bad_param;
36 }
37
39 utils,
41 virt_mac,
42 0,
43 sizeof(*virt_mac)
44 );
45 MLX_CHECK_STATUS(utils, status, icmd_err, "mlx_icmd_send_command failed");
46icmd_err:
47bad_param:
48 return status;
49}
50
53 IN mlx_utils *utils,
54 OUT struct mlx_vmac_set_virt_mac *virt_mac
55 )
56{
58 if (utils == NULL || virt_mac == NULL) {
60 goto bad_param;
61 }
62
64 utils,
66 virt_mac,
67 sizeof(*virt_mac),
68 0
69 );
70 MLX_CHECK_STATUS(utils, status, icmd_err, "mlx_icmd_send_command failed");
71icmd_err:
72bad_param:
73 return status;
74}
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
uint8_t status
Status.
Definition ena.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
@ QUERY_VIRTUAL_MAC
Definition mlx_icmd.h:38
@ SET_VIRTUAL_MAC
Definition mlx_icmd.h:39
mlx_status mlx_icmd_send_command(IN mlx_utils *utils, IN mlx_uint16 opcode, IN OUT mlx_void *data, IN mlx_uint32 write_data_size, IN mlx_uint32 read_data_size)
Definition mlx_icmd.c:310
#define MLX_INVALID_PARAMETER
#define MLX_SUCCESS
int mlx_status
#define IN
Definition mlx_utils.h:28
#define OUT
Definition mlx_utils.h:29
mlx_status mlx_vmac_set_virt_mac(IN mlx_utils *utils, OUT struct mlx_vmac_set_virt_mac *virt_mac)
Definition mlx_vmac.c:52
mlx_status mlx_vmac_query_virt_mac(IN mlx_utils *utils, OUT struct mlx_vmac_query_virt_mac *virt_mac)
Definition mlx_vmac.c:27