iPXE
Functions
mlx_pci_priv.h File Reference
#include "../../include/public/mlx_pci.h"
#include "../../include/public/mlx_utils.h"

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
mlx_status mlx_pci_init_priv (IN mlx_utils *utils)
mlx_status mlx_pci_teardown_priv (IN mlx_utils *utils)
mlx_status mlx_pci_read_priv (IN mlx_utils *utils, IN mlx_pci_width width, IN mlx_uint32 offset, IN mlx_uintn count, OUT mlx_void *buffer)
mlx_status mlx_pci_write_priv (IN mlx_utils *utils, IN mlx_pci_width width, IN mlx_uint32 offset, IN mlx_uintn count, IN mlx_void *buffer)
mlx_status mlx_pci_mem_read_priv (IN mlx_utils *utils, IN mlx_pci_width width, IN mlx_uint8 bar_index, IN mlx_uint64 offset, IN mlx_uintn count, OUT mlx_void *buffer)
mlx_status mlx_pci_mem_write_priv (IN mlx_utils *utils, IN mlx_pci_width width, IN mlx_uint8 bar_index, IN mlx_uint64 offset, IN mlx_uintn count, IN mlx_void *buffer)

Function Documentation

FILE_LICENCE ( GPL2_OR_LATER  )

Definition at line 111 of file mlx_pci_priv.c.

References adjust_pci_device(), ioremap(), MLX_SUCCESS, pci_bar_start(), PCI_BASE_ADDRESS_0, and status.

Referenced by mlx_pci_init().

{
        mlx_status status = MLX_SUCCESS;
        adjust_pci_device ( utils->pci );
#ifdef DEVICE_CX3
        utils->config = ioremap ( pci_bar_start ( utils->pci, PCI_BASE_ADDRESS_0),
                        0x100000 );
#endif
        return status;
}

Definition at line 125 of file mlx_pci_priv.c.

References iounmap(), MLX_SUCCESS, and status.

Referenced by mlx_pci_teardown().

{
        mlx_status status = MLX_SUCCESS;
#ifdef DEVICE_CX3
        iounmap( utils->config );
#endif
        return status;
}
mlx_status mlx_pci_read_priv ( IN mlx_utils utils,
IN mlx_pci_width  width,
IN mlx_uint32  offset,
IN mlx_uintn  count,
OUT mlx_void buffer 
)

Definition at line 137 of file mlx_pci_priv.c.

References mlx_pci_config(), MLX_SUCCESS, status, and TRUE.

Referenced by mlx_pci_read().

{
        mlx_status status = MLX_SUCCESS;
        status = mlx_pci_config(utils, TRUE, width, offset, count, buffer);
        return status;
}
mlx_status mlx_pci_write_priv ( IN mlx_utils utils,
IN mlx_pci_width  width,
IN mlx_uint32  offset,
IN mlx_uintn  count,
IN mlx_void buffer 
)

Definition at line 151 of file mlx_pci_priv.c.

References FALSE, mlx_pci_config(), MLX_SUCCESS, and status.

Referenced by mlx_pci_write().

{
        mlx_status status = MLX_SUCCESS;
        status = mlx_pci_config(utils, FALSE, width, offset, count, buffer);
        return status;
}
mlx_status mlx_pci_mem_read_priv ( IN mlx_utils utils,
IN mlx_pci_width  width,
IN mlx_uint8  bar_index,
IN mlx_uint64  offset,
IN mlx_uintn  count,
OUT mlx_void buffer 
)

Definition at line 165 of file mlx_pci_priv.c.

References MLX_INVALID_PARAMETER, MLX_SUCCESS, MlxPciWidthUint32, NULL, and readl().

Referenced by mlx_pci_mem_read().

{
        if (buffer == NULL || width != MlxPciWidthUint32)
                return MLX_INVALID_PARAMETER;
        *((mlx_uint32 *)buffer) = readl(offset);
        return MLX_SUCCESS;
}
mlx_status mlx_pci_mem_write_priv ( IN mlx_utils utils,
IN mlx_pci_width  width,
IN mlx_uint8  bar_index,
IN mlx_uint64  offset,
IN mlx_uintn  count,
IN mlx_void buffer 
)

Definition at line 181 of file mlx_pci_priv.c.

References barrier, MLX_INVALID_PARAMETER, MLX_SUCCESS, MlxPciWidthUint32, NULL, and writel().

Referenced by mlx_pci_mem_write().