iPXE
|
#include "../include/mlx_device.h"
#include "../include/mlx_cmd.h"
#include "../../mlx_utils/include/public/mlx_bail.h"
#include "../../mlx_utils/include/public/mlx_pci.h"
#include "../../mlx_utils/include/public/mlx_memory.h"
#include "../../mlx_utils/include/public/mlx_logging.h"
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER) | |
static mlx_status | check_nodnic_interface_supported (IN nodnic_device_priv *device_priv, OUT mlx_boolean *out) |
static mlx_status | wait_for_device_initialization (IN nodnic_device_priv *device_priv) |
static mlx_status | disable_nodnic_inteface (IN nodnic_device_priv *device_priv) |
static mlx_status | nodnic_device_start_nodnic (IN nodnic_device_priv *device_priv) |
static mlx_status | nodnic_device_get_nodnic_data (IN nodnic_device_priv *device_priv) |
mlx_status | nodnic_device_clear_int (IN nodnic_device_priv *device_priv) |
mlx_status | nodnic_device_init (IN nodnic_device_priv *device_priv) |
mlx_status | nodnic_device_teardown (IN nodnic_device_priv *device_priv) |
mlx_status | nodnic_device_get_cap (IN nodnic_device_priv *device_priv) |
mlx_status | nodnic_device_get_fw_version (IN nodnic_device_priv *device_priv, OUT mlx_uint16 *fw_ver_minor, OUT mlx_uint16 *fw_ver_sub_minor, OUT mlx_uint16 *fw_ver_major) |
#define CHECK_BIT | ( | field, | |
offset | |||
) | (((field) & ((mlx_uint32)1 << (offset))) != 0) |
Definition at line 29 of file mlx_device.c.
#define CHECK_DEVICE_INIT_TRIES 10 |
#define NODNIC_DEVICE_SUPPORT_MAC_FILTERS_OFFSET 15 |
#define NODNIC_DEVICE_SUPPORT_PROMISC_FILTER_OFFSET 14 |
#define NODNIC_DEVICE_SUPPORT_PROMISC_MULT_FILTER_OFFSET 13 |
#define NODNIC_DEVICE_LOG_WORKING_BUFFER_SIZE_OFFSET 8 |
#define NODNIC_DEVICE_LOG_WORKING_BUFFER_SIZE_MASK 0x7 |
#define NODNIC_DEVICE_LOG_PKEY_TABLE_SIZE_OFFSET 4 |
#define NODNIC_DEVICE_LOG_PKEY_TABLE_SIZE_MASK 0xF |
#define NODNIC_DEVICE_NUM_PORTS_OFFSET 0 |
#define NODNIC_DEVICE_LOG_MAX_RING_SIZE_OFFSET 24 |
#define NODNIC_DEVICE_LOG_MAX_RING_SIZE_MASK 0x3F |
#define NODNIC_DEVICE_PD_MASK 0xFFFFFF |
#define NODNIC_DEVICE_SUPPORT_RX_PI_DMA_OFFSET 31 |
#define NODNIC_DEVICE_SUPPORT_RX_PI_DMA_MASK 0x1 |
#define NODNIC_DEVICE_SUPPORT_UAR_TRX_DB_OFFSET 29 |
#define NODNIC_DEVICE_SUPPORT_UAR_TRX_DB_MASK 0x1 |
#define NODNIC_DEVICE_SUPPORT_BAR_CQ_CONTROL_OFFSET 27 |
#define NODNIC_DEVICE_SUPPORT_BAR_CQ_CONTROL_MASK 0x1 |
#define NODNIC_DEVICE_LOG_UAR_PAGE_SIZE_OFFSET 0 |
#define NODNIC_DEVICE_LOG_UAR_PAGE_SIZE_MASK 0xFF |
FILE_LICENCE | ( | GPL2_OR_LATER | ) |
|
static |
Definition at line 33 of file mlx_device.c.
References CHECK_BIT, MLX_FATAL_CHECK_STATUS, MLX_SUCCESS, nodnic_cmd_read(), NODNIC_NIC_INTERFACE_SUPPORTED_BIT, NODNIC_NIC_INTERFACE_SUPPORTED_OFFSET, out, and status.
Referenced by nodnic_device_start_nodnic().
|
static |
Definition at line 50 of file mlx_device.c.
References buffer, CHECK_BIT, CHECK_DEVICE_INIT_TRIES, MLX_CHECK_STATUS, MLX_FAILED, MLX_SUCCESS, mlx_utils_delay_in_ms(), nodnic_cmd_read(), NODNIC_INITIALIZING_BIT, NODNIC_INITIALIZING_OFFSET, and status.
Referenced by disable_nodnic_inteface(), and nodnic_device_start_nodnic().
|
static |
Definition at line 75 of file mlx_device.c.
References buffer, MLX_FATAL_CHECK_STATUS, MLX_SUCCESS, nodnic_cmd_write(), NODNIC_CMDQ_PHY_ADDR_LOW_OFFSET, NODNIC_DISABLE_INTERFACE_BIT, status, and wait_for_device_initialization().
Referenced by nodnic_device_get_nodnic_data(), and nodnic_device_teardown().
|
static |
Definition at line 94 of file mlx_device.c.
References buffer, check_nodnic_interface_supported(), MLX_FATAL_CHECK_STATUS, MLX_SUCCESS, MLX_UNSUPPORTED, nodnic_cmd_write(), NODNIC_NIC_INTERFACE_BIT, NODNIC_NIC_INTERFACE_OFFSET, status, and wait_for_device_initialization().
Referenced by nodnic_device_init().
|
static |
Definition at line 128 of file mlx_device.c.
References buffer, disable_nodnic_inteface(), MLX_DEBUG_ERROR, MLX_FATAL_CHECK_STATUS, MLX_SUCCESS, MLX_UNSUPPORTED, NODIC_SUPPORTED_REVISION, nodnic_cmd_read(), NODNIC_HARDWARE_FORMAT_OFFSET, NODNIC_LOCATION_OFFSET, NODNIC_REVISION_OFFSET, and status.
Referenced by nodnic_device_init().
mlx_status nodnic_device_clear_int | ( | IN nodnic_device_priv * | device_priv | ) |
Definition at line 165 of file mlx_device.c.
References MLX_CHECK_STATUS, mlx_memory_cpu_to_be32(), mlx_pci_mem_read(), mlx_pci_mem_write(), MLX_SUCCESS, MlxPciWidthUint32, nodnic_cmd_write(), NODNIC_NIC_DISABLE_INT_OFFSET, and status.
Referenced by flexboot_nodnic_eth_irq().
mlx_status nodnic_device_init | ( | IN nodnic_device_priv * | device_priv | ) |
Definition at line 195 of file mlx_device.c.
References MLX_FATAL_CHECK_STATUS, MLX_INVALID_PARAMETER, MLX_SUCCESS, nodnic_device_get_nodnic_data(), nodnic_device_start_nodnic(), NULL, and status.
Referenced by flexboot_nodnic_probe().
mlx_status nodnic_device_teardown | ( | IN nodnic_device_priv * | device_priv | ) |
Definition at line 218 of file mlx_device.c.
References disable_nodnic_inteface(), MLX_FATAL_CHECK_STATUS, MLX_SUCCESS, and status.
Referenced by flexboot_nodnic_probe(), and flexboot_nodnic_remove().
mlx_status nodnic_device_get_cap | ( | IN nodnic_device_priv * | device_priv | ) |
Definition at line 230 of file mlx_device.c.
References buffer, CHECK_BIT, FALSE, _nodnic_device_capabilites::log_max_ring_size, _nodnic_device_capabilites::log_pkey_table_size, _nodnic_device_capabilites::log_uar_page_size, _nodnic_device_capabilites::log_working_buffer_size, MLX_FATAL_CHECK_STATUS, MLX_INVALID_PARAMETER, MLX_SUCCESS, nodnic_cmd_read(), NODNIC_DEVICE_LOG_MAX_RING_SIZE_MASK, NODNIC_DEVICE_LOG_MAX_RING_SIZE_OFFSET, NODNIC_DEVICE_LOG_PKEY_TABLE_SIZE_MASK, NODNIC_DEVICE_LOG_PKEY_TABLE_SIZE_OFFSET, NODNIC_DEVICE_LOG_UAR_PAGE_SIZE_MASK, NODNIC_DEVICE_LOG_UAR_PAGE_SIZE_OFFSET, NODNIC_DEVICE_LOG_WORKING_BUFFER_SIZE_MASK, NODNIC_DEVICE_LOG_WORKING_BUFFER_SIZE_OFFSET, NODNIC_DEVICE_NUM_PORTS_OFFSET, NODNIC_DEVICE_PD_MASK, NODNIC_DEVICE_SUPPORT_BAR_CQ_CONTROL_OFFSET, NODNIC_DEVICE_SUPPORT_MAC_FILTERS_OFFSET, NODNIC_DEVICE_SUPPORT_PROMISC_FILTER_OFFSET, NODNIC_DEVICE_SUPPORT_PROMISC_MULT_FILTER_OFFSET, NODNIC_DEVICE_SUPPORT_RX_PI_DMA_OFFSET, NODNIC_DEVICE_SUPPORT_UAR_TRX_DB_OFFSET, NULL, _nodnic_device_capabilites::num_ports, status, _nodnic_device_capabilites::support_bar_cq_ctrl, _nodnic_device_capabilites::support_mac_filters, _nodnic_device_capabilites::support_promisc_filter, _nodnic_device_capabilites::support_promisc_multicast_filter, _nodnic_device_capabilites::support_rx_pi_dma, and _nodnic_device_capabilites::support_uar_tx_db.
Referenced by flexboot_nodnic_probe().
mlx_status nodnic_device_get_fw_version | ( | IN nodnic_device_priv * | device_priv, |
OUT mlx_uint16 * | fw_ver_minor, | ||
OUT mlx_uint16 * | fw_ver_sub_minor, | ||
OUT mlx_uint16 * | fw_ver_major | ||
) |
Definition at line 336 of file mlx_device.c.
References buffer, MLX_CHECK_STATUS, MLX_INVALID_PARAMETER, MLX_SUCCESS, nodnic_cmd_read(), NULL, and status.