xref: /freebsd/sys/dev/mlx5/mlx5_lib/mlx5.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1*e9dcd831SSlava Shwartsman /*-
2*e9dcd831SSlava Shwartsman  * Copyright (c) 2017, Mellanox Technologies, Ltd.  All rights reserved.
3*e9dcd831SSlava Shwartsman  *
4*e9dcd831SSlava Shwartsman  * This software is available to you under a choice of one of two
5*e9dcd831SSlava Shwartsman  * licenses.  You may choose to be licensed under the terms of the GNU
6*e9dcd831SSlava Shwartsman  * General Public License (GPL) Version 2, available from the file
7*e9dcd831SSlava Shwartsman  * COPYING in the main directory of this source tree, or the
8*e9dcd831SSlava Shwartsman  * OpenIB.org BSD license below:
9*e9dcd831SSlava Shwartsman  *
10*e9dcd831SSlava Shwartsman  *     Redistribution and use in source and binary forms, with or
11*e9dcd831SSlava Shwartsman  *     without modification, are permitted provided that the following
12*e9dcd831SSlava Shwartsman  *     conditions are met:
13*e9dcd831SSlava Shwartsman  *
14*e9dcd831SSlava Shwartsman  *      - Redistributions of source code must retain the above
15*e9dcd831SSlava Shwartsman  *        copyright notice, this list of conditions and the following
16*e9dcd831SSlava Shwartsman  *        disclaimer.
17*e9dcd831SSlava Shwartsman  *
18*e9dcd831SSlava Shwartsman  *      - Redistributions in binary form must reproduce the above
19*e9dcd831SSlava Shwartsman  *        copyright notice, this list of conditions and the following
20*e9dcd831SSlava Shwartsman  *        disclaimer in the documentation and/or other materials
21*e9dcd831SSlava Shwartsman  *        provided with the distribution.
22*e9dcd831SSlava Shwartsman  *
23*e9dcd831SSlava Shwartsman  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24*e9dcd831SSlava Shwartsman  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25*e9dcd831SSlava Shwartsman  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26*e9dcd831SSlava Shwartsman  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27*e9dcd831SSlava Shwartsman  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28*e9dcd831SSlava Shwartsman  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29*e9dcd831SSlava Shwartsman  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30*e9dcd831SSlava Shwartsman  * SOFTWARE.
31*e9dcd831SSlava Shwartsman  */
32*e9dcd831SSlava Shwartsman 
33*e9dcd831SSlava Shwartsman #ifndef __LIB_MLX5_H__
34*e9dcd831SSlava Shwartsman #define __LIB_MLX5_H__
35*e9dcd831SSlava Shwartsman 
36*e9dcd831SSlava Shwartsman void mlx5_init_reserved_gids(struct mlx5_core_dev *dev);
37*e9dcd831SSlava Shwartsman void mlx5_cleanup_reserved_gids(struct mlx5_core_dev *dev);
38*e9dcd831SSlava Shwartsman int  mlx5_core_reserve_gids(struct mlx5_core_dev *dev, unsigned int count);
39*e9dcd831SSlava Shwartsman void mlx5_core_unreserve_gids(struct mlx5_core_dev *dev, unsigned int count);
40*e9dcd831SSlava Shwartsman int  mlx5_core_reserved_gid_alloc(struct mlx5_core_dev *dev, int *gid_index);
41*e9dcd831SSlava Shwartsman void mlx5_core_reserved_gid_free(struct mlx5_core_dev *dev, int gid_index);
42*e9dcd831SSlava Shwartsman 
43*e9dcd831SSlava Shwartsman #endif
44