iPXE
Functions
mlx_cmd.c File Reference
#include "../include/mlx_cmd.h"
#include "../../mlx_utils/include/public/mlx_pci_gw.h"
#include "../../mlx_utils/include/public/mlx_bail.h"
#include "../../mlx_utils/include/public/mlx_pci.h"
#include "../../mlx_utils/include/public/mlx_logging.h"

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
 
mlx_status nodnic_cmd_read (IN nodnic_device_priv *device_priv, IN mlx_uint32 address, OUT mlx_pci_gw_buffer *buffer)
 
mlx_status nodnic_cmd_write (IN nodnic_device_priv *device_priv, IN mlx_uint32 address, IN mlx_pci_gw_buffer buffer)
 

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER  )

◆ nodnic_cmd_read()

mlx_status nodnic_cmd_read ( IN nodnic_device_priv device_priv,
IN mlx_uint32  address,
OUT mlx_pci_gw_buffer buffer 
)

Definition at line 29 of file mlx_cmd.c.

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 
48 read_error:
49 bad_param:
50  return status;
51 }
#define MLX_INVALID_PARAMETER
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
uint64_t address
Base address.
Definition: ena.h:24
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Definition: netvsc.h:16
#define MLX_SUCCESS
uint8_t status
Status.
Definition: ena.h:16
int mlx_status
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
#define PCI_GW_SPACE_NODNIC
Definition: mlx_pci_gw.h:47

References address, buffer, MLX_CHECK_STATUS, MLX_INVALID_PARAMETER, mlx_pci_gw_read(), MLX_SUCCESS, NULL, PCI_GW_SPACE_NODNIC, and status.

Referenced by check_nodnic_interface_supported(), nodnic_device_get_cap(), nodnic_device_get_fw_version(), nodnic_device_get_nodnic_data(), nodnic_port_get_qpn(), nodnic_port_query(), nodnic_port_set(), nodnic_port_thin_init(), and wait_for_device_initialization().

◆ nodnic_cmd_write()

mlx_status nodnic_cmd_write ( IN nodnic_device_priv device_priv,
IN mlx_uint32  address,
IN mlx_pci_gw_buffer  buffer 
)

Definition at line 54 of file mlx_cmd.c.

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");
74 write_error:
75 bad_param:
76  return status;
77 }
#define MLX_INVALID_PARAMETER
uint64_t address
Base address.
Definition: ena.h:24
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Definition: netvsc.h:16
#define MLX_SUCCESS
uint8_t status
Status.
Definition: ena.h:16
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
int mlx_status
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
#define PCI_GW_SPACE_NODNIC
Definition: mlx_pci_gw.h:47

References address, buffer, MLX_CHECK_STATUS, MLX_INVALID_PARAMETER, mlx_pci_gw_write(), MLX_SUCCESS, NULL, PCI_GW_SPACE_NODNIC, and status.

Referenced by disable_nodnic_inteface(), nodnic_device_clear_int(), nodnic_device_start_nodnic(), nodnic_port_add_mac_filter(), nodnic_port_allocate_dbr_dma(), nodnic_port_create_qp(), nodnic_port_set(), and nodnic_port_update_ring_doorbell().