iPXE
Functions
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.

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)

Function Documentation

FILE_LICENCE ( GPL2_OR_LATER  )
mlx_status mlx_utils_init ( IN mlx_utils utils,
IN mlx_pci pci 
)

Definition at line 28 of file mlx_utils.c.

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_status status = MLX_SUCCESS;
        if( pci == NULL || utils == NULL ){
                status = MLX_INVALID_PARAMETER;
                goto bail;
        }
        utils->pci = pci;
        status = mlx_pci_init(utils);
        status = mlx_utils_init_lock(utils);
bail:
        return status;
}

Definition at line 73 of file mlx_utils.c.

References MLX_SUCCESS, and mlx_utils_ilog2_priv().

Referenced by nodnic_port_create_qp().

{
        mlx_utils_ilog2_priv(i, log);
        return MLX_SUCCESS;
}

Definition at line 83 of file mlx_utils.c.

References mlx_utils_init_lock_priv().

Referenced by mlx_utils_init().

{
        return mlx_utils_init_lock_priv(&(utils->lock));

}

Definition at line 92 of file mlx_utils.c.

References mlx_utils_free_lock_priv().

Referenced by mlx_utils_teardown().

{
        return mlx_utils_free_lock_priv(utils->lock);
}

Definition at line 100 of file mlx_utils.c.

References mlx_utils_acquire_lock_priv().

Referenced by mlx_pci_gw_read(), and mlx_pci_gw_write().

{
        return mlx_utils_acquire_lock_priv(utils->lock);
}

Definition at line 108 of file mlx_utils.c.

References mlx_utils_release_lock_priv().

Referenced by mlx_pci_gw_read(), and mlx_pci_gw_write().

{
        return mlx_utils_release_lock_priv(utils->lock);
}
mlx_status mlx_utils_rand ( IN mlx_utils utils,
OUT mlx_uint32 rand_num 
)

Definition at line 116 of file mlx_utils.c.

References mlx_utils_rand_priv().

Referenced by mlx_icmd_get_semaphore().

{
        return mlx_utils_rand_priv(utils, rand_num);
}