iPXE
Data Structures | Macros | Functions | Variables
mlx_nvconfig_defaults.c File Reference
#include "../../mlx_lib/mlx_nvconfig/mlx_nvconfig.h"
#include "../../include/public/mlx_memory.h"
#include "../../include/public/mlx_bail.h"
#include "../../mlx_lib/mlx_nvconfig/mlx_nvconfig_defaults.h"

Go to the source code of this file.

Data Structures

struct  tlv_default
 

Macros

#define TlvDefaultEntry(_tlv_type, _data_size, _set_defaults)
 

Functions

 FILE_LICENCE (GPL2_OR_LATER)
 
static mlx_status nvconfig_get_boot_default_conf (IN void *data, IN int status, OUT void *def_struct)
 
static mlx_status nvconfig_get_boot_ext_default_conf (IN void *data, IN int status, OUT void *def_struct)
 
static mlx_status nvconfig_get_iscsi_init_dhcp_default_conf (IN void *data, IN int status, OUT void *def_struct)
 
static mlx_status nvconfig_get_ib_boot_default_conf (IN void *data, IN int status, OUT void *def_struct)
 
static mlx_status nvconfig_get_wol_default_conf (IN void *data, IN int status, OUT void *def_struct)
 
static mlx_status nvconfig_get_iscsi_gen_default_conf (IN void *data, IN int status, OUT void *def_struct)
 
static mlx_status nvconfig_get_ib_dhcp_default_conf (IN void *data, IN int status, OUT void *def_struct)
 
static mlx_status nvconfig_get_ocsd_ocbb_default_conf (IN void *data, IN int status, OUT void *def_struct)
 
static mlx_status nvconfig_get_vpi_link_default_conf (IN void *data, IN int status, OUT void *def_struct)
 
static mlx_status nvconfig_get_rom_banner_to_default_conf (IN void *data, IN int status, OUT void *def_struct)
 
static mlx_status nvconfig_get_nv_virt_caps_default_conf (IN void *data, IN int status, OUT void *def_struct)
 
static mlx_status nvconfig_get_nv_virt_default_conf (IN void *data, IN int status, OUT void *def_struct)
 
static mlx_status nvconfig_get_rom_cap_default_conf (IN void *data, IN int status, OUT void *def_struct)
 
static mlx_status nvconfig_nvdata_default_access (IN mlx_utils *utils, IN mlx_uint8 port, IN mlx_uint16 tlv_type, IN mlx_size data_size, OUT mlx_void *data)
 
static mlx_status nvconfig_nvdata_read_default_value (IN mlx_utils *utils, IN mlx_uint8 modifier, IN struct tlv_default *def, OUT void *def_struct)
 
static void nvconfig_nvdata_read_default_values (IN mlx_utils *utils, IN mlx_uint8 modifier, IN struct tlv_default defaults_table[], IN mlx_uint8 defaults_table_size, OUT void *def_strct)
 
mlx_status nvconfig_read_port_default_values (IN mlx_utils *utils, IN mlx_uint8 port, OUT struct mlx_nvconfig_port_conf_defaults *port_conf_def)
 
mlx_status nvconfig_read_general_default_values (IN mlx_utils *utils, OUT struct mlx_nvconfig_conf_defaults *conf_def)
 
mlx_status nvconfig_read_rom_ini_values (IN mlx_utils *utils, OUT struct mlx_nvcofnig_romini *rom_ini)
 

Variables

static struct tlv_default tlv_port_defaults []
 
static struct tlv_default tlv_general_defaults []
 

Macro Definition Documentation

◆ TlvDefaultEntry

#define TlvDefaultEntry (   _tlv_type,
  _data_size,
  _set_defaults 
)
Value:
{ \
.tlv_type = _tlv_type, \
.data_size = sizeof ( _data_size ), \
.set_defaults = _set_defaults, \
}

Definition at line 34 of file mlx_nvconfig_defaults.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER  )

◆ nvconfig_get_boot_default_conf()

static mlx_status nvconfig_get_boot_default_conf ( IN void *  data,
IN int  status,
OUT void *  def_struct 
)
static

Definition at line 42 of file mlx_nvconfig_defaults.c.

47 {
48  union mlx_nvconfig_nic_boot_conf *nic_boot_conf =
50  struct mlx_nvconfig_port_conf_defaults *port_conf_def =
51  (struct mlx_nvconfig_port_conf_defaults *) def_struct;
52 
53  /* boot_option_rom_en is deprecated - enabled always */
55 
56  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
57  "TLV not found. Using hard-coded defaults ");
58  port_conf_def->boot_vlan = nic_boot_conf->vlan_id;
59  port_conf_def->boot_protocol = nic_boot_conf->legacy_boot_prot;
60  port_conf_def->boot_retry_count = nic_boot_conf->boot_retry_count;
61  port_conf_def->boot_vlan_en = nic_boot_conf->en_vlan;
62 
63  return MLX_SUCCESS;
64 
65 nvdata_access_err:
66  port_conf_def->boot_vlan = DEFAULT_BOOT_VLAN;
67  port_conf_def->boot_protocol = DEFAULT_BOOT_PROTOCOL;
68 
69  return status;
70 }
#define DEFAULT_OPTION_ROM_EN
uint8_t status
Status.
Definition: ena.h:16
#define MLX_SUCCESS
#define DEFAULT_BOOT_VLAN
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
#define DEFAULT_BOOT_PROTOCOL

References mlx_nvconfig_port_conf_defaults::boot_option_rom_en, mlx_nvconfig_port_conf_defaults::boot_protocol, mlx_nvconfig_port_conf_defaults::boot_retry_count, mlx_nvconfig_nic_boot_conf::boot_retry_count, mlx_nvconfig_port_conf_defaults::boot_vlan, mlx_nvconfig_port_conf_defaults::boot_vlan_en, data, DEFAULT_BOOT_PROTOCOL, DEFAULT_BOOT_VLAN, DEFAULT_OPTION_ROM_EN, mlx_nvconfig_nic_boot_conf::en_vlan, mlx_nvconfig_nic_boot_conf::legacy_boot_prot, MLX_CHECK_STATUS, MLX_SUCCESS, NULL, status, and mlx_nvconfig_nic_boot_conf::vlan_id.

◆ nvconfig_get_boot_ext_default_conf()

static mlx_status nvconfig_get_boot_ext_default_conf ( IN void *  data,
IN int  status,
OUT void *  def_struct 
)
static

Definition at line 74 of file mlx_nvconfig_defaults.c.

79 {
80  union mlx_nvconfig_nic_boot_ext_conf *nic_boot_ext_conf =
82  struct mlx_nvconfig_port_conf_defaults *port_conf_def =
83  (struct mlx_nvconfig_port_conf_defaults *) def_struct;
84 
85  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
86  "TLV not found. Using hard-coded defaults ");
87  port_conf_def->linkup_timeout = nic_boot_ext_conf->linkup_timeout;
88  port_conf_def->ip_ver = nic_boot_ext_conf->ip_ver;
89  port_conf_def->undi_network_wait_to = nic_boot_ext_conf->undi_network_wait_to;
90  return MLX_SUCCESS;
91 
92 nvdata_access_err:
93  port_conf_def->linkup_timeout = DEFAULT_BOOT_LINK_UP_TO;
94  port_conf_def->ip_ver = DEFAULT_BOOT_IP_VER;
96  return status;
97 }
#define DEFAULT_BOOT_IP_VER
uint8_t status
Status.
Definition: ena.h:16
#define DEFAULT_BOOT_UNDI_NETWORK_WAIT_TO
#define MLX_SUCCESS
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define DEFAULT_BOOT_LINK_UP_TO
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References data, DEFAULT_BOOT_IP_VER, DEFAULT_BOOT_LINK_UP_TO, DEFAULT_BOOT_UNDI_NETWORK_WAIT_TO, mlx_nvconfig_port_conf_defaults::ip_ver, mlx_nvconfig_nic_boot_ext_conf::ip_ver, mlx_nvconfig_port_conf_defaults::linkup_timeout, mlx_nvconfig_nic_boot_ext_conf::linkup_timeout, MLX_CHECK_STATUS, MLX_SUCCESS, NULL, status, mlx_nvconfig_port_conf_defaults::undi_network_wait_to, and mlx_nvconfig_nic_boot_ext_conf::undi_network_wait_to.

◆ nvconfig_get_iscsi_init_dhcp_default_conf()

static mlx_status nvconfig_get_iscsi_init_dhcp_default_conf ( IN void *  data,
IN int  status,
OUT void *  def_struct 
)
static

Definition at line 101 of file mlx_nvconfig_defaults.c.

106 {
107  union mlx_nvconfig_iscsi_init_dhcp_conf *iscsi_init_dhcp_conf =
109  struct mlx_nvconfig_port_conf_defaults *port_conf_def =
110  (struct mlx_nvconfig_port_conf_defaults *) def_struct;
111 
112  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
113  "TLV not found. Using hard-coded defaults ");
114  port_conf_def->iscsi_dhcp_params_en = iscsi_init_dhcp_conf->dhcp_iscsi_en;
115  port_conf_def->iscsi_ipv4_dhcp_en = iscsi_init_dhcp_conf->ipv4_dhcp_en;
116 
117  return MLX_SUCCESS;
118 
119 nvdata_access_err:
122 
123  return status;
124 }
#define DEFAULT_ISCSI_DHCP_PARAM_EN
uint8_t status
Status.
Definition: ena.h:16
#define DEFAULT_ISCSI_IPV4_DHCP_EN
#define MLX_SUCCESS
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References data, DEFAULT_ISCSI_DHCP_PARAM_EN, DEFAULT_ISCSI_IPV4_DHCP_EN, mlx_nvconfig_iscsi_init_dhcp_conf::dhcp_iscsi_en, mlx_nvconfig_iscsi_init_dhcp_conf::ipv4_dhcp_en, mlx_nvconfig_port_conf_defaults::iscsi_dhcp_params_en, mlx_nvconfig_port_conf_defaults::iscsi_ipv4_dhcp_en, MLX_CHECK_STATUS, MLX_SUCCESS, NULL, and status.

◆ nvconfig_get_ib_boot_default_conf()

static mlx_status nvconfig_get_ib_boot_default_conf ( IN void *  data,
IN int  status,
OUT void *  def_struct 
)
static

Definition at line 128 of file mlx_nvconfig_defaults.c.

133 {
134  union mlx_nvconfig_nic_ib_boot_conf *ib_boot_conf =
136  struct mlx_nvconfig_port_conf_defaults *port_conf_def =
137  (struct mlx_nvconfig_port_conf_defaults *) def_struct;
138 
139  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
140  "nvconfig_nvdata_default_access failed ");
141  port_conf_def->boot_pkey = ib_boot_conf->boot_pkey;
142 
143 nvdata_access_err:
144  return status;
145 }
uint8_t status
Status.
Definition: ena.h:16
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References mlx_nvconfig_port_conf_defaults::boot_pkey, mlx_nvconfig_nic_ib_boot_conf::boot_pkey, data, MLX_CHECK_STATUS, NULL, and status.

◆ nvconfig_get_wol_default_conf()

static mlx_status nvconfig_get_wol_default_conf ( IN void *  data,
IN int  status,
OUT void *  def_struct 
)
static

Definition at line 149 of file mlx_nvconfig_defaults.c.

154 {
155  union mlx_nvconfig_wol_conf *wol_conf = (union mlx_nvconfig_wol_conf *) data;
156  struct mlx_nvconfig_port_conf_defaults *port_conf_def =
157  (struct mlx_nvconfig_port_conf_defaults *) def_struct;
158 
159  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
160  "nvconfig_nvdata_default_access failed ");
161  port_conf_def->en_wol_magic = wol_conf->en_wol_magic;
162 
163 nvdata_access_err:
164  return status;
165 }
uint8_t status
Status.
Definition: ena.h:16
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References data, mlx_nvconfig_port_conf_defaults::en_wol_magic, mlx_nvconfig_wol_conf::en_wol_magic, MLX_CHECK_STATUS, NULL, and status.

◆ nvconfig_get_iscsi_gen_default_conf()

static mlx_status nvconfig_get_iscsi_gen_default_conf ( IN void *  data,
IN int  status,
OUT void *  def_struct 
)
static

Definition at line 169 of file mlx_nvconfig_defaults.c.

173 {
174  union mlx_nvconfig_iscsi_general *iscsi_gen =
176  struct mlx_nvconfig_port_conf_defaults *port_conf_def =
177  (struct mlx_nvconfig_port_conf_defaults *) def_struct;
178 
179  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
180  "nvconfig_nvdata_default_access failed ");
181  port_conf_def->iscsi_boot_to_target = iscsi_gen->boot_to_target;
182  port_conf_def->iscsi_vlan_en = iscsi_gen->vlan_en;
183  port_conf_def->iscsi_tcp_timestamps_en = iscsi_gen->tcp_timestamps_en;
184  port_conf_def->iscsi_chap_mutual_auth_en = iscsi_gen->chap_mutual_auth_en;
185  port_conf_def->iscsi_chap_auth_en = iscsi_gen->chap_auth_en;
186  port_conf_def->iscsi_lun_busy_retry_count = iscsi_gen->lun_busy_retry_count;
187  port_conf_def->iscsi_link_up_delay_time = iscsi_gen->link_up_delay_time;
188  port_conf_def->iscsi_drive_num = iscsi_gen->drive_num;
189 
190  return MLX_SUCCESS;
191 
192 nvdata_access_err:
193  port_conf_def->iscsi_drive_num = DEFAULT_ISCSI_DRIVE_NUM;
194  return status;
195 }
uint8_t status
Status.
Definition: ena.h:16
#define MLX_SUCCESS
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define DEFAULT_ISCSI_DRIVE_NUM
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References mlx_nvconfig_iscsi_general::boot_to_target, mlx_nvconfig_iscsi_general::chap_auth_en, mlx_nvconfig_iscsi_general::chap_mutual_auth_en, data, DEFAULT_ISCSI_DRIVE_NUM, mlx_nvconfig_iscsi_general::drive_num, mlx_nvconfig_port_conf_defaults::iscsi_boot_to_target, mlx_nvconfig_port_conf_defaults::iscsi_chap_auth_en, mlx_nvconfig_port_conf_defaults::iscsi_chap_mutual_auth_en, mlx_nvconfig_port_conf_defaults::iscsi_drive_num, mlx_nvconfig_port_conf_defaults::iscsi_link_up_delay_time, mlx_nvconfig_port_conf_defaults::iscsi_lun_busy_retry_count, mlx_nvconfig_port_conf_defaults::iscsi_tcp_timestamps_en, mlx_nvconfig_port_conf_defaults::iscsi_vlan_en, mlx_nvconfig_iscsi_general::link_up_delay_time, mlx_nvconfig_iscsi_general::lun_busy_retry_count, MLX_CHECK_STATUS, MLX_SUCCESS, NULL, status, mlx_nvconfig_iscsi_general::tcp_timestamps_en, and mlx_nvconfig_iscsi_general::vlan_en.

◆ nvconfig_get_ib_dhcp_default_conf()

static mlx_status nvconfig_get_ib_dhcp_default_conf ( IN void *  data,
IN int  status,
OUT void *  def_struct 
)
static

Definition at line 199 of file mlx_nvconfig_defaults.c.

204 {
205  union mlx_nvconfig_ib_dhcp_conf *ib_dhcp =
207  struct mlx_nvconfig_port_conf_defaults *port_conf_def =
208  (struct mlx_nvconfig_port_conf_defaults *) def_struct;
209 
210  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
211  "nvconfig_nvdata_default_access failed ");
212  port_conf_def->client_identifier = ib_dhcp->client_identifier;
213  port_conf_def->mac_admin_bit = ib_dhcp->mac_admin_bit;
214 
215 nvdata_access_err:
216  return status;
217 }
uint8_t status
Status.
Definition: ena.h:16
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References mlx_nvconfig_port_conf_defaults::client_identifier, mlx_nvconfig_ib_dhcp_conf::client_identifier, data, mlx_nvconfig_port_conf_defaults::mac_admin_bit, mlx_nvconfig_ib_dhcp_conf::mac_admin_bit, MLX_CHECK_STATUS, NULL, and status.

◆ nvconfig_get_ocsd_ocbb_default_conf()

static mlx_status nvconfig_get_ocsd_ocbb_default_conf ( IN void *  data,
IN int  status,
OUT void *  def_struct 
)
static

Definition at line 221 of file mlx_nvconfig_defaults.c.

222  {
223  union mlx_nvconfig_ocsd_ocbb_conf *ocsd_ocbb =
225  struct mlx_nvconfig_conf_defaults *conf_def =
226  (struct mlx_nvconfig_conf_defaults *) def_struct;
227 
228  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
229  "TLV not found. Using hard-coded defaults ");
230  conf_def->ocsd_ocbb_en = ocsd_ocbb->ocsd_ocbb_en;
231 
232  return MLX_SUCCESS;
233 
234 nvdata_access_err:
236 
237  return status;
238 }
uint8_t status
Status.
Definition: ena.h:16
#define MLX_SUCCESS
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
#define DEFAULT_OCSD_OCBB_EN

References data, DEFAULT_OCSD_OCBB_EN, MLX_CHECK_STATUS, MLX_SUCCESS, NULL, mlx_nvconfig_conf_defaults::ocsd_ocbb_en, mlx_nvconfig_ocsd_ocbb_conf::ocsd_ocbb_en, and status.

◆ nvconfig_get_vpi_link_default_conf()

static mlx_status nvconfig_get_vpi_link_default_conf ( IN void *  data,
IN int  status,
OUT void *  def_struct 
)
static

Definition at line 242 of file mlx_nvconfig_defaults.c.

247 {
248  union mlx_nvconfig_vpi_link_conf *vpi_link =
250  struct mlx_nvconfig_port_conf_defaults *port_conf_def =
251  (struct mlx_nvconfig_port_conf_defaults *) def_struct;
252 
253  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
254  "nvconfig_nvdata_default_access failed ");
255  port_conf_def->network_link_type = vpi_link->network_link_type;
256  port_conf_def->default_link_type = vpi_link->default_link_type;
257 
258 nvdata_access_err:
259  return status;
260 }
uint8_t status
Status.
Definition: ena.h:16
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References data, mlx_nvconfig_port_conf_defaults::default_link_type, mlx_nvconfig_vpi_link_conf::default_link_type, MLX_CHECK_STATUS, mlx_nvconfig_port_conf_defaults::network_link_type, mlx_nvconfig_vpi_link_conf::network_link_type, NULL, and status.

◆ nvconfig_get_rom_banner_to_default_conf()

static mlx_status nvconfig_get_rom_banner_to_default_conf ( IN void *  data,
IN int  status,
OUT void *  def_struct 
)
static

Definition at line 264 of file mlx_nvconfig_defaults.c.

269 {
270  union mlx_nvconfig_rom_banner_timeout_conf *rom_banner_timeout_conf =
272  struct mlx_nvconfig_conf_defaults *conf_def =
273  (struct mlx_nvconfig_conf_defaults *) def_struct;
274 
275  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
276  "TLV not found. Using hard-coded defaults ");
277  conf_def->flexboot_menu_to = rom_banner_timeout_conf->rom_banner_to;
278 
279  return MLX_SUCCESS;
280 
281 nvdata_access_err:
283 
284  return status;
285 }
uint8_t status
Status.
Definition: ena.h:16
#define MLX_SUCCESS
#define DEFAULT_FLEXBOOT_MENU_TO
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References data, DEFAULT_FLEXBOOT_MENU_TO, mlx_nvconfig_conf_defaults::flexboot_menu_to, MLX_CHECK_STATUS, MLX_SUCCESS, NULL, mlx_nvconfig_rom_banner_timeout_conf::rom_banner_to, and status.

◆ nvconfig_get_nv_virt_caps_default_conf()

static mlx_status nvconfig_get_nv_virt_caps_default_conf ( IN void *  data,
IN int  status,
OUT void *  def_struct 
)
static

Definition at line 289 of file mlx_nvconfig_defaults.c.

294 {
295  union mlx_nvconfig_virt_caps *nv_virt_caps =
296  (union mlx_nvconfig_virt_caps *) data;
297  struct mlx_nvconfig_conf_defaults *conf_def =
298  (struct mlx_nvconfig_conf_defaults *) def_struct;
299 
300  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
301  "TLV not found. Using hard-coded defaults ");
302  conf_def->max_vfs = nv_virt_caps->max_vfs_per_pf;
303 
304  return MLX_SUCCESS;
305 
306 nvdata_access_err:
307  conf_def->max_vfs = DEFAULT_MAX_VFS;
308 
309  return status;
310 }
uint8_t status
Status.
Definition: ena.h:16
#define MLX_SUCCESS
#define DEFAULT_MAX_VFS
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References data, DEFAULT_MAX_VFS, mlx_nvconfig_conf_defaults::max_vfs, mlx_nvconfig_virt_caps::max_vfs_per_pf, MLX_CHECK_STATUS, MLX_SUCCESS, NULL, and status.

◆ nvconfig_get_nv_virt_default_conf()

static mlx_status nvconfig_get_nv_virt_default_conf ( IN void *  data,
IN int  status,
OUT void *  def_struct 
)
static

Definition at line 314 of file mlx_nvconfig_defaults.c.

319 {
320  union mlx_nvconfig_virt_conf *nv_virt_conf =
321  (union mlx_nvconfig_virt_conf *) data;
322  struct mlx_nvconfig_conf_defaults *conf_def =
323  (struct mlx_nvconfig_conf_defaults *) def_struct;
324 
325  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
326  "nvconfig_nvdata_default_access failed ");
327  conf_def->total_vfs = nv_virt_conf->num_of_vfs;
328  conf_def->sriov_en = nv_virt_conf->virt_mode;
329 
330 nvdata_access_err:
331  return status;
332 }
uint8_t status
Status.
Definition: ena.h:16
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References data, MLX_CHECK_STATUS, NULL, mlx_nvconfig_virt_conf::num_of_vfs, mlx_nvconfig_conf_defaults::sriov_en, status, mlx_nvconfig_conf_defaults::total_vfs, and mlx_nvconfig_virt_conf::virt_mode.

◆ nvconfig_get_rom_cap_default_conf()

static mlx_status nvconfig_get_rom_cap_default_conf ( IN void *  data,
IN int  status,
OUT void *  def_struct 
)
static

Definition at line 336 of file mlx_nvconfig_defaults.c.

337  {
338  union mlx_nvconfig_rom_cap_conf *rom_cap_conf =
340  struct mlx_nvconfig_conf_defaults *conf_def =
341  (struct mlx_nvconfig_conf_defaults *) def_struct;
342 
343  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
344  "TLV not found. Using hard-coded defaults ");
345  conf_def->boot_ip_ver_en = rom_cap_conf->boot_ip_ver_en;
346 
347  return MLX_SUCCESS;
348 
349 nvdata_access_err:
351 
352  return status;
353 }
#define DEFAULT_BOOT_IP_VERSION_EN
uint8_t status
Status.
Definition: ena.h:16
#define MLX_SUCCESS
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References mlx_nvconfig_conf_defaults::boot_ip_ver_en, mlx_nvconfig_rom_cap_conf::boot_ip_ver_en, data, DEFAULT_BOOT_IP_VERSION_EN, MLX_CHECK_STATUS, MLX_SUCCESS, NULL, and status.

◆ nvconfig_nvdata_default_access()

static mlx_status nvconfig_nvdata_default_access ( IN mlx_utils utils,
IN mlx_uint8  port,
IN mlx_uint16  tlv_type,
IN mlx_size  data_size,
OUT mlx_void data 
)
static

Definition at line 376 of file mlx_nvconfig_defaults.c.

383 {
386  mlx_uint8 version = 0;
387 
389  data_size, TLV_ACCESS_DEFAULT_EN, 0,
390  &version, data);
391  MLX_CHECK_STATUS(NULL, status, nvdata_access_err,
392  "nvconfig_nvdata_access failed ");
393  for (index = 0; index * 4 < data_size; index++) {
395  ((mlx_uint32 *) data) + index);
396  }
397 
398 nvdata_access_err:
399  return status;
400 }
uint8_t status
Status.
Definition: ena.h:16
uint32_t mlx_uint32
u8 port
Port number.
Definition: CIB_PRM.h:31
u32 version
Version number.
Definition: ath9k_hw.c:1983
#define MLX_SUCCESS
uint8_t mlx_uint8
int mlx_status
mlx_status mlx_memory_be32_to_cpu(IN mlx_utils *utils, IN mlx_uint32 source, IN mlx_uint32 *destination)
Definition: mlx_memory.c:224
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
uint64_t index
Index of the first segment within the content.
Definition: pccrc.h:21
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
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

References data, tlv_default::data_size, index, MLX_CHECK_STATUS, mlx_memory_be32_to_cpu(), MLX_SUCCESS, NULL, nvconfig_nvdata_access(), port, REG_ACCESS_READ, status, TLV_ACCESS_DEFAULT_EN, tlv_default::tlv_type, and version.

Referenced by nvconfig_nvdata_read_default_value().

◆ nvconfig_nvdata_read_default_value()

static mlx_status nvconfig_nvdata_read_default_value ( IN mlx_utils utils,
IN mlx_uint8  modifier,
IN struct tlv_default def,
OUT void *  def_struct 
)
static

Definition at line 404 of file mlx_nvconfig_defaults.c.

410 {
412  void *data = NULL;
413 
414  status = mlx_memory_zalloc(utils, def->data_size,&data);
415  MLX_CHECK_STATUS(utils, status, memory_err,
416  "mlx_memory_zalloc failed ");
417  status = nvconfig_nvdata_default_access(utils, modifier, def->tlv_type,
418  def->data_size, data);
419  def->set_defaults(data, status, def_struct);
420  mlx_memory_free(utils, &data);
421 
422 memory_err:
423  return status;
424 }
static mlx_status nvconfig_nvdata_default_access(IN mlx_utils *utils, IN mlx_uint8 port, IN mlx_uint16 tlv_type, IN mlx_size data_size, OUT mlx_void *data)
uint8_t status
Status.
Definition: ena.h:16
mlx_status mlx_memory_free(IN mlx_utils *utils, IN mlx_void **ptr)
Definition: mlx_memory.c:63
#define MLX_SUCCESS
mlx_status mlx_memory_zalloc(IN mlx_utils *utils, IN mlx_size size, OUT mlx_void **ptr)
Definition: mlx_memory.c:45
int mlx_status
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References data, MLX_CHECK_STATUS, mlx_memory_free(), mlx_memory_zalloc(), MLX_SUCCESS, NULL, nvconfig_nvdata_default_access(), and status.

Referenced by nvconfig_nvdata_read_default_values().

◆ nvconfig_nvdata_read_default_values()

static void nvconfig_nvdata_read_default_values ( IN mlx_utils utils,
IN mlx_uint8  modifier,
IN struct tlv_default  defaults_table[],
IN mlx_uint8  defaults_table_size,
OUT void *  def_strct 
)
static

Definition at line 428 of file mlx_nvconfig_defaults.c.

435 {
436  struct tlv_default *defs;
437  unsigned int i;
438 
439  for (i = 0; i < defaults_table_size; i++) {
440  defs = &defaults_table[i];
441  nvconfig_nvdata_read_default_value(utils, modifier, defs, def_strct);
442  }
443 }
static mlx_status nvconfig_nvdata_read_default_value(IN mlx_utils *utils, IN mlx_uint8 modifier, IN struct tlv_default *def, OUT void *def_struct)

References nvconfig_nvdata_read_default_value().

Referenced by nvconfig_read_general_default_values(), and nvconfig_read_port_default_values().

◆ nvconfig_read_port_default_values()

mlx_status nvconfig_read_port_default_values ( IN mlx_utils utils,
IN mlx_uint8  port,
OUT struct mlx_nvconfig_port_conf_defaults port_conf_def 
)

Definition at line 446 of file mlx_nvconfig_defaults.c.

451 {
453 
454  if (utils == NULL || port_conf_def == NULL) {
456  MLX_DEBUG_ERROR(utils,"bad params.");
457  goto bad_param;
458  }
459  mlx_memory_set(utils, port_conf_def, 0, sizeof(*port_conf_def));
461  (sizeof(tlv_port_defaults)/sizeof(tlv_port_defaults[0])),
462  port_conf_def);
463 
464 bad_param:
465  return status;
466 }
#define MLX_INVALID_PARAMETER
static struct tlv_default tlv_port_defaults[]
static void nvconfig_nvdata_read_default_values(IN mlx_utils *utils, IN mlx_uint8 modifier, IN struct tlv_default defaults_table[], IN mlx_uint8 defaults_table_size, OUT void *def_strct)
uint8_t status
Status.
Definition: ena.h:16
mlx_status mlx_memory_set(IN mlx_utils *utils, IN mlx_void *block, IN mlx_int32 value, IN mlx_size size)
Definition: mlx_memory.c:171
u8 port
Port number.
Definition: CIB_PRM.h:31
#define MLX_SUCCESS
#define MLX_DEBUG_ERROR(...)
Definition: mlx_logging.h:29
int mlx_status
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References MLX_DEBUG_ERROR, MLX_INVALID_PARAMETER, mlx_memory_set(), MLX_SUCCESS, NULL, nvconfig_nvdata_read_default_values(), port, status, and tlv_port_defaults.

◆ nvconfig_read_general_default_values()

mlx_status nvconfig_read_general_default_values ( IN mlx_utils utils,
OUT struct mlx_nvconfig_conf_defaults conf_def 
)

Definition at line 469 of file mlx_nvconfig_defaults.c.

473 {
475 
476  if (utils == NULL || conf_def == NULL) {
478  MLX_DEBUG_ERROR(utils,"bad params.");
479  goto bad_param;
480  }
481  mlx_memory_set(utils, conf_def, 0, sizeof(*conf_def));
483  (sizeof(tlv_general_defaults)/sizeof(tlv_general_defaults[0])),
484  conf_def);
485 
486 bad_param:
487  return status;
488 }
#define MLX_INVALID_PARAMETER
static void nvconfig_nvdata_read_default_values(IN mlx_utils *utils, IN mlx_uint8 modifier, IN struct tlv_default defaults_table[], IN mlx_uint8 defaults_table_size, OUT void *def_strct)
uint8_t status
Status.
Definition: ena.h:16
mlx_status mlx_memory_set(IN mlx_utils *utils, IN mlx_void *block, IN mlx_int32 value, IN mlx_size size)
Definition: mlx_memory.c:171
#define MLX_SUCCESS
#define MLX_DEBUG_ERROR(...)
Definition: mlx_logging.h:29
int mlx_status
static struct tlv_default tlv_general_defaults[]
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References MLX_DEBUG_ERROR, MLX_INVALID_PARAMETER, mlx_memory_set(), MLX_SUCCESS, NULL, nvconfig_nvdata_read_default_values(), status, and tlv_general_defaults.

◆ nvconfig_read_rom_ini_values()

mlx_status nvconfig_read_rom_ini_values ( IN mlx_utils utils,
OUT struct mlx_nvcofnig_romini rom_ini 
)

Definition at line 491 of file mlx_nvconfig_defaults.c.

495 {
497  mlx_uint8 version = 0;
499 
500  if (utils == NULL || rom_ini == NULL) {
502  MLX_DEBUG_ERROR(utils,"bad params.");
503  goto bad_param;
504  }
505  mlx_memory_set(utils, rom_ini, 0, sizeof(*rom_ini));
506 
508  sizeof(*rom_ini), TLV_ACCESS_DEFAULT_DIS, 0,
509  &version, rom_ini);
510  MLX_CHECK_STATUS(NULL, status, bad_param,
511  "nvconfig_nvdata_access failed ");
512  for (index = 0; index * 4 < sizeof(*rom_ini); index++) {
513  mlx_memory_be32_to_cpu(utils, (((mlx_uint32 *) rom_ini)[index]),
514  ((mlx_uint32 *) rom_ini) + index);
515  }
516 
517 bad_param:
518  return status;
519 }
#define MLX_INVALID_PARAMETER
uint8_t status
Status.
Definition: ena.h:16
uint32_t mlx_uint32
mlx_status mlx_memory_set(IN mlx_utils *utils, IN mlx_void *block, IN mlx_int32 value, IN mlx_size size)
Definition: mlx_memory.c:171
u32 version
Version number.
Definition: ath9k_hw.c:1983
#define MLX_SUCCESS
uint8_t mlx_uint8
#define MLX_DEBUG_ERROR(...)
Definition: mlx_logging.h:29
int mlx_status
mlx_status mlx_memory_be32_to_cpu(IN mlx_utils *utils, IN mlx_uint32 source, IN mlx_uint32 *destination)
Definition: mlx_memory.c:224
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
uint64_t index
Index of the first segment within the content.
Definition: pccrc.h:21
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
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

References GLOBAL_ROM_INI_TYPE, index, MLX_CHECK_STATUS, MLX_DEBUG_ERROR, MLX_INVALID_PARAMETER, mlx_memory_be32_to_cpu(), mlx_memory_set(), MLX_SUCCESS, NULL, nvconfig_nvdata_access(), REG_ACCESS_READ, status, TLV_ACCESS_DEFAULT_DIS, and version.

Variable Documentation

◆ tlv_port_defaults

struct tlv_default tlv_port_defaults[]
static
Initial value:
= {
}
static mlx_status nvconfig_get_iscsi_init_dhcp_default_conf(IN void *data, IN int status, OUT void *def_struct)
static mlx_status nvconfig_get_boot_default_conf(IN void *data, IN int status, OUT void *def_struct)
static mlx_status nvconfig_get_iscsi_gen_default_conf(IN void *data, IN int status, OUT void *def_struct)
static mlx_status nvconfig_get_vpi_link_default_conf(IN void *data, IN int status, OUT void *def_struct)
static mlx_status nvconfig_get_ib_boot_default_conf(IN void *data, IN int status, OUT void *def_struct)
static mlx_status nvconfig_get_wol_default_conf(IN void *data, IN int status, OUT void *def_struct)
#define TlvDefaultEntry(_tlv_type, _data_size, _set_defaults)
static mlx_status nvconfig_get_boot_ext_default_conf(IN void *data, IN int status, OUT void *def_struct)
static mlx_status nvconfig_get_ib_dhcp_default_conf(IN void *data, IN int status, OUT void *def_struct)

Definition at line 355 of file mlx_nvconfig_defaults.c.

Referenced by nvconfig_read_port_default_values().

◆ tlv_general_defaults

struct tlv_default tlv_general_defaults[]
static
Initial value:
= {
}
static mlx_status nvconfig_get_rom_banner_to_default_conf(IN void *data, IN int status, OUT void *def_struct)
static mlx_status nvconfig_get_rom_cap_default_conf(IN void *data, IN int status, OUT void *def_struct)
static mlx_status nvconfig_get_nv_virt_caps_default_conf(IN void *data, IN int status, OUT void *def_struct)
#define TlvDefaultEntry(_tlv_type, _data_size, _set_defaults)
static mlx_status nvconfig_get_nv_virt_default_conf(IN void *data, IN int status, OUT void *def_struct)
static mlx_status nvconfig_get_ocsd_ocbb_default_conf(IN void *data, IN int status, OUT void *def_struct)

Definition at line 366 of file mlx_nvconfig_defaults.c.

Referenced by nvconfig_read_general_default_values().