2
* Copyright (C) 2015 Mellanox Technologies Ltd.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; either version 2 of the
7
* License, or any later version.
9
* This program is distributed in the hope that it will be useful, but
10
* WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20
FILE_LICENCE ( GPL2_OR_LATER );
23
#include "../../include/private/mlx_utils_priv.h"
24
#include "../../include/public/mlx_pci.h"
25
#include "../../include/public/mlx_utils.h"
33
mlx_status status = MLX_SUCCESS;
34
if( pci == NULL || utils == NULL ){
35
status = MLX_INVALID_PARAMETER;
39
status = mlx_pci_init(utils);
40
status = mlx_utils_init_lock(utils);
47
IN mlx_utils *utils __attribute__ ((unused))
50
mlx_status status = MLX_SUCCESS;
51
mlx_utils_free_lock(utils);
56
mlx_utils_delay_in_ms(
60
mlx_utils_delay_in_ms_priv(msecs);
64
mlx_utils_delay_in_us(
68
mlx_utils_delay_in_us_priv(usecs);
77
mlx_utils_ilog2_priv(i, log);
83
IN OUT mlx_utils *utils
86
return mlx_utils_init_lock_priv(&(utils->lock));
92
IN OUT mlx_utils *utils
95
return mlx_utils_free_lock_priv(utils->lock);
99
mlx_utils_acquire_lock (
100
IN OUT mlx_utils *utils
103
return mlx_utils_acquire_lock_priv(utils->lock);
107
mlx_utils_release_lock (
108
IN OUT mlx_utils *utils
111
return mlx_utils_release_lock_priv(utils->lock);
117
OUT mlx_uint32 *rand_num
120
return mlx_utils_rand_priv(utils, rand_num);