mlx_utils.c File Reference
#include <stddef.h>
#include "../../include/private/mlx_utils_priv.h"
#include "../../include/public/mlx_pci.h"
#include "../../include/public/mlx_utils.h"

Go to the source code of this file.


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)

Function Documentation



◆ 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);
40  status = mlx_utils_init_lock(utils);
41 bail:
42  return status;
43 }
mlx_status mlx_utils_init_lock(IN OUT mlx_utils *utils)
Definition: mlx_utils.c:83
uint8_t status
Definition: ena.h:16
mlx_status mlx_pci_init(IN mlx_utils *utils)
Definition: mlx_pci.c:28
int mlx_status
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References 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 {
51  mlx_utils_free_lock(utils);
52  mlx_pci_teardown(utils);
53  return status;
54 }
mlx_status mlx_pci_teardown(IN mlx_utils *utils)
Definition: mlx_pci.c:43
uint8_t status
Definition: ena.h:16
mlx_status mlx_utils_free_lock(IN OUT mlx_utils *utils)
Definition: mlx_utils.c:92
int mlx_status

References 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 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 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 {
78  mlx_utils_ilog2_priv(i, log);
79  return MLX_SUCCESS;
80 }
mlx_status mlx_utils_ilog2_priv(IN mlx_uint32 i, OUT mlx_uint32 *log)

References MLX_SUCCESS, and mlx_utils_ilog2_priv().

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));
89 }
mlx_status mlx_utils_init_lock_priv(OUT void **lock)

References mlx_utils_init_lock_priv().

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

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

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

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

Referenced by mlx_icmd_get_semaphore().