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 
20 FILE_LICENCE ( GPL2_OR_LATER );
21 
22 #include "../../mlx_lib/mlx_vmac/mlx_vmac.h"
23 #include "../../include/public/mlx_icmd.h"
24 #include "../../include/public/mlx_bail.h"
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");
46 icmd_err:
47 bad_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");
71 icmd_err:
72 bad_param:
73  return status;
74 }
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
#define MLX_INVALID_PARAMETER
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
FILE_LICENCE(GPL2_OR_LATER)
uint8_t status
Status.
Definition: ena.h:16
#define OUT
Definition: mlx_utils.h:29
#define MLX_SUCCESS
#define IN
Definition: mlx_utils.h:28
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
int mlx_status
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362