iPXE
mlx_nvconfig.h
Go to the documentation of this file.
1 #ifndef MLX_NVCONFIG_H_
2 #define MLX_NVCONFIG_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_reg_access/mlx_reg_access.h"
26 #include "../../include/public/mlx_utils.h"
27 
28 typedef enum {
33 
34 typedef enum {
38 
39 typedef enum {
44 
49 };
50 
56 };
57 
61 };
62 
68 };
69 
74 };
75 
76 
77 struct nvconfig_nvqc {
79 /* -------------- */
80  mlx_uint32 support_rd :1; /*the configuration item is supported and can be read */
81  mlx_uint32 support_wr :1; /*the configuration item is supported and can be updated */
83  mlx_uint32 version :4; /*The maximum version of the configuration item currently supported by the firmware. */
85 };
86 
87 
89  mlx_uint32 length :9; /*Size of configuration item data in bytes between 0..256 */
91  mlx_uint32 version :4; /* Configuration item version */
94 
95  mlx_uint32 access_mode :2; /*Defines which value of the Configuration Item will be accessed.
96  0x0: NEXT - Next value to be applied
97  0x1: CURRENT - Currently set values (only valid for Query operation) Supported only if NVGC.nvda_read_current_settings==1.
98  0x2: FACTORY - Default factory values (only valid for Query operation). Supported only if NVGC.nvda_read_factory_settings==1.*/
99 
104 /* -------------- */
106 /* -------------- */
107  mlx_uint32 crc :16;
109 
110 };
111 
112 #define NVCONFIG_MAX_TLV_SIZE 256
113 
117 };
118 
119 struct nv_conf_cap {
120  /** WOL En/Dis **/
122  /** VPI En/Dis **/
124 };
125 
133 };
134 
135 
138  IN mlx_utils *utils,
139  IN mlx_uint8 port,
140  IN mlx_uint16 tlv_type,
141  OUT mlx_boolean *read_supported,
142  OUT mlx_boolean *write_supported
143  );
144 
145 
148  IN mlx_utils *utils,
149  IN mlx_uint8 port,
150  IN mlx_uint16 tlv_type
151  );
152 
155  IN mlx_utils *utils,
156  IN mlx_uint8 port,
157  IN mlx_uint16 tlv_type,
158  IN REG_ACCESS_OPT opt,
159  IN mlx_size data_size,
160  IN NV_DEFAULT_OPT def_en,
161  IN NVDA_WRITER_ID writer_id,
164  );
165 
166 #endif /* MLX_NVCONFIG_H_ */
uint8_t mlx_boolean
struct nvconfig_tlv_type_per_port per_port
Definition: mlx_nvconfig.h:71
FILE_LICENCE(GPL2_OR_LATER)
struct nvconfig_tlv_type_global global
Definition: mlx_nvconfig.h:73
mlx_status nvconfig_query_capability(IN mlx_utils *utils, IN mlx_uint8 port, IN mlx_uint16 tlv_type, OUT mlx_boolean *read_supported, OUT mlx_boolean *write_supported)
Definition: mlx_nvconfig.c:155
mlx_uint32 access_mode
Definition: mlx_nvconfig.h:95
mlx_uint32 reserved2
Definition: mlx_nvconfig.h:84
mlx_uint8 wol_en
WOL En/Dis.
Definition: mlx_nvconfig.h:121
mlx_uint32 reserved1
Definition: mlx_nvconfig.h:93
mlx_uint32 reserved
Definition: mlx_nvconfig.h:108
mlx_boolean fw_reset_needed
Definition: mlx_nvconfig.h:67
mlx_uint8 data[NVCONFIG_MAX_TLV_SIZE]
Definition: mlx_nvconfig.h:116
struct nvconfig_tlv_type_per_host per_host
Definition: mlx_nvconfig.h:72
REG_ACCESS_OPT
mlx_uint32 reserved0
Definition: mlx_nvconfig.h:90
uint32_t mlx_uint32
union nvconfig_tlv_type tlv_type
Definition: mlx_nvconfig.h:105
mlx_status nvconfig_nvdata_access(IN mlx_utils *utils, IN mlx_uint8 port, IN mlx_uint16 tlv_type, IN REG_ACCESS_OPT opt, IN mlx_size data_size, IN NV_DEFAULT_OPT def_en, IN NVDA_WRITER_ID writer_id, IN OUT mlx_uint8 *version, IN OUT mlx_void *data)
Definition: mlx_nvconfig.c:235
u8 port
Port number.
Definition: CIB_PRM.h:31
mlx_uint32 writer_id
Definition: mlx_nvconfig.h:92
u32 version
Version number.
Definition: ath9k_hw.c:1983
#define OUT
Definition: mlx_utils.h:29
mlx_uint32 support_rd
Definition: mlx_nvconfig.h:80
NVRAM_CLASS_CODE class_code
Definition: mlx_nvconfig.h:66
mlx_uint16 real_tlv_type
Definition: mlx_nvconfig.h:65
mlx_uint32 version
Definition: mlx_nvconfig.h:83
mlx_uint32 crc
Definition: mlx_nvconfig.h:105
mlx_uint32 version
Definition: mlx_nvconfig.h:91
size_t mlx_size
mlx_uint32 reserved3
Definition: mlx_nvconfig.h:102
uint16_t mlx_uint16
void mlx_void
#define IN
Definition: mlx_utils.h:28
#define NVCONFIG_MAX_TLV_SIZE
Definition: mlx_nvconfig.h:112
uint8_t mlx_uint8
union nvconfig_tlv_type tlv_type
Definition: mlx_nvconfig.h:78
mlx_status nvconfig_nvdata_invalidate(IN mlx_utils *utils, IN mlx_uint8 port, IN mlx_uint16 tlv_type)
Definition: mlx_nvconfig.c:197
mlx_uint32 header_type
Definition: mlx_nvconfig.h:101
mlx_uint32 reserved2
Definition: mlx_nvconfig.h:100
mlx_uint32 reserved1
Definition: mlx_nvconfig.h:82
NV_DEFAULT_OPT
Definition: mlx_nvconfig.h:39
int mlx_status
struct nvconfig_header nv_header
Definition: mlx_nvconfig.h:115
mlx_uint32 valid
Definition: mlx_nvconfig.h:103
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
NVRAM_CLASS_CODE
Definition: mlx_nvconfig.h:28
NVDA_WRITER_ID
Definition: mlx_nvconfig.h:34
mlx_uint8 vpi_en
VPI En/Dis.
Definition: mlx_nvconfig.h:123
mlx_uint32 support_wr
Definition: mlx_nvconfig.h:81
mlx_uint32 length
Definition: mlx_nvconfig.h:89