iPXE
mlx_utils.h File Reference
#include "mlx_logging.h"
#include "mlx_types.h"

Go to the source code of this file.

Data Structures

struct  mlx_pci_gw
struct  mlx_icmd
struct  mlx_utils

Macros

#define IN
#define OUT

Typedefs

typedef mlx_uint16 mlx_pci_gw_space

Functions

 FILE_LICENCE (GPL2_OR_LATER)
mlx_status mlx_utils_init (IN mlx_utils *utils, IN mlx_pci *pci)
mlx_status mlx_utils_teardown (IN mlx_utils *utils)
mlx_status mlx_utils_delay_in_ms (IN mlx_uint32 msecs)
mlx_status mlx_utils_delay_in_us (IN mlx_uint32 usecs)
mlx_status mlx_utils_ilog2 (IN mlx_uint32 i, OUT mlx_uint32 *log)
mlx_status mlx_utils_init_lock (IN OUT mlx_utils *utils)
mlx_status mlx_utils_free_lock (IN OUT mlx_utils *utils)
mlx_status mlx_utils_acquire_lock (IN OUT mlx_utils *utils)
mlx_status mlx_utils_release_lock (IN OUT mlx_utils *utils)
mlx_status mlx_utils_rand (IN mlx_utils *utils, OUT mlx_uint32 *rand_num)

Macro Definition Documentation

◆ IN

#define IN

Definition at line 28 of file mlx_utils.h.

Referenced by ARShiftU64(), AsciiCharToUpper(), AsciiStrCatS(), AsciiStrCmp(), AsciiStrCpyS(), AsciiStrDecimalToUint64(), AsciiStrDecimalToUint64S(), AsciiStrDecimalToUintn(), AsciiStrDecimalToUintnS(), AsciiStrHexToBytes(), AsciiStrHexToUint64(), AsciiStrHexToUint64S(), AsciiStrHexToUintn(), AsciiStrHexToUintnS(), AsciiStriCmp(), AsciiStrLen(), AsciiStrnCatS(), AsciiStrnCmp(), AsciiStrnCpyS(), AsciiStrnLenS(), AsciiStrnSizeS(), AsciiStrnToUnicodeStrS(), AsciiStrSize(), AsciiStrStr(), AsciiStrToGuid(), AsciiStrToIpv4Address(), AsciiStrToIpv6Address(), AsciiStrToUnicodeStrS(), Base64Decode(), Base64Encode(), BcdToDecimal8(), BitFieldAnd16(), BitFieldAnd32(), BitFieldAnd64(), BitFieldAnd8(), BitFieldAndThenOr16(), BitFieldAndThenOr32(), BitFieldAndThenOr64(), BitFieldAndThenOr8(), BitFieldCountOnes32(), BitFieldCountOnes64(), BitFieldOr16(), BitFieldOr32(), BitFieldOr64(), BitFieldOr8(), BitFieldRead16(), BitFieldRead32(), BitFieldRead64(), BitFieldRead8(), BitFieldWrite16(), BitFieldWrite32(), BitFieldWrite64(), BitFieldWrite8(), CalculateCheckSum16(), CalculateCheckSum32(), CalculateCheckSum64(), CalculateCheckSum8(), CalculateCrc16Ansi(), CalculateCrc16CcittF(), CalculateCrc32(), CalculateCrc32c(), CalculateSum16(), CalculateSum32(), CalculateSum64(), CalculateSum8(), CharToUpper(), check_nodnic_interface_supported(), ConvertGuidToUuid(), ConvertUuidToGuid(), DecimalToBcd8(), disable_nodnic_inteface(), DivS64x64Remainder(), DivU64x32(), DivU64x32Remainder(), DivU64x64Remainder(), EFI_STATUS(), FILE_LICENCE(), GetFirstNode(), GetNextNode(), GetPowerOfTwo32(), GetPowerOfTwo64(), GetPreviousNode(), HighBitSet32(), HighBitSet64(), init_operation_tlv(), InitializeListHead(), InsertHeadList(), InsertTailList(), IsListEmpty(), IsNodeAtEnd(), IsNodeInList(), IsNull(), LongJump(), LowBitSet32(), LowBitSet64(), LRotU32(), LRotU64(), LShiftU64(), mlx_blink_leds(), mlx_get_max_mtu(), mlx_get_max_speed(), mlx_icmd_clear_semaphore(), mlx_icmd_get_semaphore(), mlx_icmd_get_status(), mlx_icmd_go(), mlx_icmd_init(), mlx_icmd_read_buffer(), mlx_icmd_send_command(), mlx_icmd_set_opcode(), mlx_icmd_write_buffer(), mlx_memory_alloc(), mlx_memory_alloc_dma(), mlx_memory_alloc_dma_priv(), mlx_memory_alloc_priv(), mlx_memory_be32_to_cpu(), mlx_memory_be32_to_cpu_priv(), mlx_memory_cmp(), mlx_memory_cmp_priv(), mlx_memory_cpu_to_be32(), mlx_memory_cpu_to_be32_priv(), mlx_memory_cpy(), mlx_memory_cpy_priv(), mlx_memory_free(), mlx_memory_free_dma(), mlx_memory_free_dma_priv(), mlx_memory_free_priv(), mlx_memory_map_dma(), mlx_memory_map_dma_priv(), mlx_memory_set(), mlx_memory_set_priv(), mlx_memory_ummap_dma(), mlx_memory_ummap_dma_priv(), mlx_memory_zalloc(), mlx_memory_zalloc_priv(), mlx_pci_config(), mlx_pci_config_byte(), mlx_pci_config_dword(), mlx_pci_config_word(), mlx_pci_gw_check_capability_id(), mlx_pci_gw_free_ownership(), mlx_pci_gw_get_ownership(), mlx_pci_gw_init(), mlx_pci_gw_read(), mlx_pci_gw_search_capability(), mlx_pci_gw_set_space(), mlx_pci_gw_teardown(), mlx_pci_gw_wait_for_flag_value(), mlx_pci_gw_write(), mlx_pci_init(), mlx_pci_init_priv(), mlx_pci_mem_read(), mlx_pci_mem_read_priv(), mlx_pci_mem_write(), mlx_pci_mem_write_priv(), mlx_pci_read(), mlx_pci_read_priv(), mlx_pci_teardown(), mlx_pci_teardown_priv(), mlx_pci_write(), mlx_pci_write_priv(), mlx_reg_access(), mlx_set_admin_mtu(), mlx_set_link_speed(), mlx_utils_acquire_lock(), mlx_utils_acquire_lock_priv(), mlx_utils_delay_in_ms(), mlx_utils_delay_in_ms_priv(), mlx_utils_delay_in_us(), mlx_utils_delay_in_us_priv(), mlx_utils_free_lock(), mlx_utils_free_lock_priv(), mlx_utils_ilog2(), mlx_utils_ilog2_priv(), mlx_utils_init(), mlx_utils_init_lock(), mlx_utils_rand(), mlx_utils_rand_priv(), mlx_utils_release_lock(), mlx_utils_release_lock_priv(), mlx_utils_teardown(), mlx_vmac_query_virt_mac(), mlx_vmac_set_virt_mac(), ModU64x32(), MultS64x64(), MultU64x32(), MultU64x64(), nodnic_cmd_read(), nodnic_cmd_write(), nodnic_device_clear_int(), nodnic_device_get_cap(), nodnic_device_get_fw_version(), nodnic_device_get_nodnic_data(), nodnic_device_init(), nodnic_device_start_nodnic(), nodnic_device_teardown(), nodnic_port_add_mac_filter(), nodnic_port_add_mgid_filter(), nodnic_port_allocate_dbr_dma(), nodnic_port_allocate_eq(), nodnic_port_allocate_ring_db_dma(), nodnic_port_check_and_set_dma(), nodnic_port_close(), nodnic_port_cq_dbr_dma_init(), nodnic_port_create_cq(), nodnic_port_create_qp(), nodnic_port_destroy_cq(), nodnic_port_destroy_qp(), nodnic_port_disable_dma(), nodnic_port_enable_dma(), nodnic_port_free_eq(), nodnic_port_get_cq_size(), nodnic_port_get_qpn(), nodnic_port_get_state(), nodnic_port_get_type(), nodnic_port_init(), nodnic_port_query(), nodnic_port_read_port_management_change_event(), nodnic_port_read_reset_needed(), nodnic_port_recv_db_dma(), nodnic_port_remove_mac_filter(), nodnic_port_remove_mgid_filter(), nodnic_port_rx_pi_dma_alloc(), nodnic_port_send_db_dma(), nodnic_port_set(), nodnic_port_set_dma(), nodnic_port_set_network(), nodnic_port_set_promisc(), nodnic_port_set_promisc_multicast(), nodnic_port_set_send_uar_offset(), nodnic_port_thin_init(), nodnic_port_tx_dbr_dma_init(), nodnic_port_update_ring_doorbell(), nodnic_port_update_tx_db_func(), nvconfig_fill_tlv_type(), nvconfig_get_boot_default_conf(), nvconfig_get_boot_ext_default_conf(), nvconfig_get_ib_boot_default_conf(), nvconfig_get_ib_dhcp_default_conf(), nvconfig_get_iscsi_gen_default_conf(), nvconfig_get_iscsi_init_dhcp_default_conf(), nvconfig_get_nv_virt_caps_default_conf(), nvconfig_get_nv_virt_default_conf(), nvconfig_get_ocsd_ocbb_default_conf(), nvconfig_get_rom_banner_to_default_conf(), nvconfig_get_rom_cap_default_conf(), nvconfig_get_tlv_type_and_class(), nvconfig_get_vpi_link_default_conf(), nvconfig_get_wol_default_conf(), nvconfig_nvdata_access(), nvconfig_nvdata_default_access(), nvconfig_nvdata_invalidate(), nvconfig_nvdata_read_default_value(), nvconfig_nvdata_read_default_values(), nvconfig_query_capability(), nvconfig_read_general_default_values(), nvconfig_read_port_default_values(), nvconfig_read_rom_ini_values(), nvconfig_set_fw_reset_level(), PathCleanUpDirectories(), PathRemoveLastItem(), QuickSort(), ReadUnaligned16(), ReadUnaligned24(), ReadUnaligned32(), ReadUnaligned64(), RemoveEntryList(), RRotU32(), RRotU64(), RShiftU64(), SetInterruptState(), StrCatS(), StrCmp(), StrCpyS(), StrDecimalToUint64(), StrDecimalToUint64S(), StrDecimalToUintn(), StrDecimalToUintnS(), StrHexToBytes(), StrHexToUint64(), StrHexToUint64S(), StrHexToUintn(), StrHexToUintnS(), StrLen(), StrnCatS(), StrnCmp(), StrnCpyS(), StrnLenS(), StrnSizeS(), StrSize(), StrStr(), StrToGuid(), StrToIpv4Address(), StrToIpv6Address(), SwapBytes16(), SwapBytes32(), SwapBytes64(), SwapListEntries(), SwitchStack(), TdCall(), TdVmCall(), UnicodeStrnToAsciiStrS(), UnicodeStrToAsciiStrS(), wait_for_device_initialization(), WriteUnaligned16(), WriteUnaligned24(), WriteUnaligned32(), and WriteUnaligned64().

◆ OUT

#define OUT

Definition at line 29 of file mlx_utils.h.

Referenced by AsciiStrCatS(), AsciiStrCpyS(), AsciiStrDecimalToUint64S(), AsciiStrDecimalToUintnS(), AsciiStrHexToBytes(), AsciiStrHexToUint64S(), AsciiStrHexToUintnS(), AsciiStrnCatS(), AsciiStrnCpyS(), AsciiStrnToUnicodeStrS(), AsciiStrToGuid(), AsciiStrToIpv4Address(), AsciiStrToIpv6Address(), AsciiStrToUnicodeStrS(), Base64Decode(), Base64Encode(), check_nodnic_interface_supported(), ConvertGuidToUuid(), ConvertUuidToGuid(), DivS64x64Remainder(), DivU64x32Remainder(), DivU64x64Remainder(), FILE_LICENCE(), InitializeListHead(), InsertHeadList(), InsertTailList(), mlx_get_max_mtu(), mlx_get_max_speed(), mlx_icmd_get_status(), mlx_icmd_read_buffer(), mlx_icmd_send_command(), mlx_memory_alloc(), mlx_memory_alloc_dma(), mlx_memory_alloc_dma_priv(), mlx_memory_alloc_priv(), mlx_memory_cmp(), mlx_memory_cmp_priv(), mlx_memory_cpy(), mlx_memory_cpy_priv(), mlx_memory_map_dma(), mlx_memory_map_dma_priv(), mlx_memory_zalloc(), mlx_memory_zalloc_priv(), mlx_pci_config(), mlx_pci_config_byte(), mlx_pci_config_dword(), mlx_pci_config_word(), mlx_pci_gw_check_capability_id(), mlx_pci_gw_read(), mlx_pci_gw_search_capability(), mlx_pci_mem_read(), mlx_pci_mem_read_priv(), mlx_pci_read(), mlx_pci_read_priv(), mlx_reg_access(), mlx_utils_acquire_lock(), mlx_utils_free_lock(), mlx_utils_ilog2(), mlx_utils_ilog2_priv(), mlx_utils_init_lock(), mlx_utils_init_lock_priv(), mlx_utils_rand(), mlx_utils_rand_priv(), mlx_utils_release_lock(), mlx_vmac_query_virt_mac(), mlx_vmac_set_virt_mac(), nodnic_cmd_read(), nodnic_device_get_fw_version(), nodnic_port_cq_dbr_dma_init(), nodnic_port_create_cq(), nodnic_port_create_qp(), nodnic_port_get_cq_size(), nodnic_port_get_qpn(), nodnic_port_get_state(), nodnic_port_get_type(), nodnic_port_query(), nodnic_port_read_port_management_change_event(), nodnic_port_read_reset_needed(), nodnic_port_remove_mgid_filter(), nodnic_port_rx_pi_dma_alloc(), nodnic_port_tx_dbr_dma_init(), nvconfig_fill_tlv_type(), nvconfig_get_boot_default_conf(), nvconfig_get_boot_ext_default_conf(), nvconfig_get_ib_boot_default_conf(), nvconfig_get_ib_dhcp_default_conf(), nvconfig_get_iscsi_gen_default_conf(), nvconfig_get_iscsi_init_dhcp_default_conf(), nvconfig_get_nv_virt_caps_default_conf(), nvconfig_get_nv_virt_default_conf(), nvconfig_get_ocsd_ocbb_default_conf(), nvconfig_get_rom_banner_to_default_conf(), nvconfig_get_rom_cap_default_conf(), nvconfig_get_tlv_type_and_class(), nvconfig_get_vpi_link_default_conf(), nvconfig_get_wol_default_conf(), nvconfig_nvdata_access(), nvconfig_nvdata_default_access(), nvconfig_nvdata_read_default_value(), nvconfig_nvdata_read_default_values(), nvconfig_query_capability(), nvconfig_read_general_default_values(), nvconfig_read_port_default_values(), nvconfig_read_rom_ini_values(), PathRemoveLastItem(), QuickSort(), SetJump(), StrCatS(), StrCpyS(), StrDecimalToUint64S(), StrDecimalToUintnS(), StrHexToBytes(), StrHexToUint64S(), StrHexToUintnS(), StrnCatS(), StrnCpyS(), StrToGuid(), StrToIpv4Address(), StrToIpv6Address(), SwapListEntries(), TdCall(), TdVmCall(), UnicodeStrnToAsciiStrS(), UnicodeStrToAsciiStrS(), WriteUnaligned16(), WriteUnaligned24(), WriteUnaligned32(), and WriteUnaligned64().

Typedef Documentation

◆ mlx_pci_gw_space

Definition at line 31 of file mlx_utils.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER )

◆ mlx_utils_init()

mlx_status mlx_utils_init ( IN mlx_utils * utils,
IN mlx_pci * pci )

Definition at line 28 of file mlx_utils.c.

32{
34 if( pci == NULL || utils == NULL ){
36 goto bail;
37 }
38 utils->pci = pci;
39 status = mlx_pci_init(utils);
41bail:
42 return status;
43}
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
uint8_t status
Status.
Definition ena.h:5
mlx_status mlx_pci_init(IN mlx_utils *utils)
Definition mlx_pci.c:28
#define MLX_INVALID_PARAMETER
#define MLX_SUCCESS
int mlx_status
mlx_status mlx_utils_init_lock(IN OUT mlx_utils *utils)
Definition mlx_utils.c:83

References IN, MLX_INVALID_PARAMETER, mlx_pci_init(), MLX_SUCCESS, mlx_utils_init_lock(), NULL, and status.

Referenced by flexboot_nodnic_is_supported(), and init_mlx_utils().

◆ mlx_utils_teardown()

mlx_status mlx_utils_teardown ( IN mlx_utils * utils)

Definition at line 46 of file mlx_utils.c.

49{
52 mlx_pci_teardown(utils);
53 return status;
54}
mlx_status mlx_pci_teardown(IN mlx_utils *utils)
Definition mlx_pci.c:43
mlx_status mlx_utils_free_lock(IN OUT mlx_utils *utils)
Definition mlx_utils.c:92

References IN, mlx_pci_teardown(), MLX_SUCCESS, mlx_utils_free_lock(), and status.

Referenced by flexboot_nodnic_is_supported(), free_mlx_utils(), and init_mlx_utils().

◆ mlx_utils_delay_in_ms()

mlx_status mlx_utils_delay_in_ms ( IN mlx_uint32 msecs)

Definition at line 57 of file mlx_utils.c.

60{
62 return MLX_SUCCESS;
63}
mlx_status mlx_utils_delay_in_ms_priv(IN mlx_uint32 msecs)

References IN, MLX_SUCCESS, and mlx_utils_delay_in_ms_priv().

Referenced by mlx_icmd_get_semaphore(), mlx_icmd_go(), and wait_for_device_initialization().

◆ mlx_utils_delay_in_us()

mlx_status mlx_utils_delay_in_us ( IN mlx_uint32 usecs)

Definition at line 65 of file mlx_utils.c.

68{
70 return MLX_SUCCESS;
71}
mlx_status mlx_utils_delay_in_us_priv(IN mlx_uint32 usecs)

References IN, MLX_SUCCESS, and mlx_utils_delay_in_us_priv().

Referenced by mlx_pci_gw_get_ownership(), mlx_pci_gw_read(), and mlx_pci_gw_wait_for_flag_value().

◆ mlx_utils_ilog2()

mlx_status mlx_utils_ilog2 ( IN mlx_uint32 i,
OUT mlx_uint32 * log )

Definition at line 73 of file mlx_utils.c.

77{
79 return MLX_SUCCESS;
80}
mlx_status mlx_utils_ilog2_priv(IN mlx_uint32 i, OUT mlx_uint32 *log)

References IN, MLX_SUCCESS, mlx_utils_ilog2_priv(), and OUT.

Referenced by nodnic_port_create_qp().

◆ mlx_utils_init_lock()

mlx_status mlx_utils_init_lock ( IN OUT mlx_utils * utils)

Definition at line 83 of file mlx_utils.c.

86{
87 return mlx_utils_init_lock_priv(&(utils->lock));
88
89}
mlx_status mlx_utils_init_lock_priv(OUT void **lock)

References IN, mlx_utils_init_lock_priv(), and OUT.

Referenced by mlx_utils_init().

◆ mlx_utils_free_lock()

mlx_status mlx_utils_free_lock ( IN OUT mlx_utils * utils)

Definition at line 92 of file mlx_utils.c.

95{
96 return mlx_utils_free_lock_priv(utils->lock);
97}
mlx_status mlx_utils_free_lock_priv(IN void *lock)

References IN, mlx_utils_free_lock_priv(), and OUT.

Referenced by mlx_utils_teardown().

◆ mlx_utils_acquire_lock()

mlx_status mlx_utils_acquire_lock ( IN OUT mlx_utils * utils)

Definition at line 100 of file mlx_utils.c.

103{
104 return mlx_utils_acquire_lock_priv(utils->lock);
105}
mlx_status mlx_utils_acquire_lock_priv(IN void *lock)

References IN, mlx_utils_acquire_lock_priv(), and OUT.

Referenced by mlx_pci_gw_read(), and mlx_pci_gw_write().

◆ mlx_utils_release_lock()

mlx_status mlx_utils_release_lock ( IN OUT mlx_utils * utils)

Definition at line 108 of file mlx_utils.c.

111{
112 return mlx_utils_release_lock_priv(utils->lock);
113}
mlx_status mlx_utils_release_lock_priv(IN void *lock)

References IN, mlx_utils_release_lock_priv(), and OUT.

Referenced by mlx_pci_gw_read(), and mlx_pci_gw_write().

◆ mlx_utils_rand()

mlx_status mlx_utils_rand ( IN mlx_utils * utils,
OUT mlx_uint32 * rand_num )

Definition at line 116 of file mlx_utils.c.

120{
121 return mlx_utils_rand_priv(utils, rand_num);
122}
mlx_status mlx_utils_rand_priv(IN mlx_utils *utils, OUT mlx_uint32 *rand_num)

References IN, mlx_utils_rand_priv(), and OUT.

Referenced by mlx_icmd_get_semaphore().