Data Structures | Defines | Typedefs | Functions
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


#define IN
#define OUT


typedef mlx_uint16 mlx_pci_gw_space


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)

Define Documentation

#define IN

Definition at line 28 of file mlx_utils.h.

#define OUT

Definition at line 29 of file mlx_utils.h.

Typedef Documentation

Definition at line 31 of file mlx_utils.h.

Function Documentation

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);
        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);