iPXE
Functions
mlx_cmd.h File Reference
#include "mlx_nodnic_data_structures.h"
#include "../../mlx_utils/include/public/mlx_utils.h"
#include "../../mlx_utils/include/public/mlx_pci_gw.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 ( GPL2_OR_LATER  )
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.

References 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().

{
        mlx_status              status = MLX_SUCCESS;
        mlx_utils               *utils = NULL;

        if ( device_priv == NULL || buffer == NULL ) {
                status = MLX_INVALID_PARAMETER;
                goto bad_param;
        }

        utils = device_priv->utils;

        status = mlx_pci_gw_read(utils, PCI_GW_SPACE_NODNIC, address, buffer);
        MLX_CHECK_STATUS(device_priv, status, read_error,"mlx_pci_gw_read failed");

read_error:
bad_param:
        return status;
}
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.

References 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().

{
        mlx_status              status = MLX_SUCCESS;
        mlx_utils               *utils = NULL;


        if ( device_priv == NULL ) {
                status = MLX_INVALID_PARAMETER;
                goto bad_param;
        }

        utils = device_priv->utils;


        status = mlx_pci_gw_write(utils, PCI_GW_SPACE_NODNIC, address, buffer);
        MLX_CHECK_STATUS(device_priv, status, write_error,"mlx_pci_gw_write failed");
write_error:
bad_param:
        return status;
}