vxgehal-driver.h revision 330897
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright(c) 2002-2011 Exar Corp.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification are permitted provided the following conditions are met:
9 *
10 *    1. Redistributions of source code must retain the above copyright notice,
11 *       this list of conditions and the following disclaimer.
12 *
13 *    2. Redistributions in binary form must reproduce the above copyright
14 *       notice, this list of conditions and the following disclaimer in the
15 *       documentation and/or other materials provided with the distribution.
16 *
17 *    3. Neither the name of the Exar Corporation nor the names of its
18 *       contributors may be used to endorse or promote products derived from
19 *       this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
33/*$FreeBSD: stable/11/sys/dev/vxge/vxgehal/vxgehal-driver.h 330897 2018-03-14 03:19:51Z eadler $*/
34
35#ifndef	VXGE_HAL_DRIVER_H
36#define	VXGE_HAL_DRIVER_H
37
38__EXTERN_BEGIN_DECLS
39
40/* maximum number of events consumed in a syncle poll() cycle */
41#define	VXGE_HAL_DRIVER_QUEUE_CONSUME_MAX	5
42
43/*
44 * struct __hal_driver_t - Represents HAL object for driver.
45 * @config: HAL configuration.
46 * @devices: List of all PCI-enumerated X3100 devices in the system.
47 * A single vxge_hal_driver_t instance contains zero or more
48 * X3100 devices.
49 * @devices_lock: Lock to protect %devices when inserting/removing.
50 * @is_initialized: True if HAL is initialized; false otherwise.
51 * @uld_callbacks: Upper-layer driver callbacks. See vxge_hal_uld_cbs_t {}.
52 * @debug_module_mask: 32bit mask that defines which components of the
53 * driver are to be traced. The trace-able components are listed in
54 * xgehal_debug.h:
55 * @debug_level: See vxge_debug_level_e {}.
56 *
57 * HAL (driver) object. There is a single instance of this structure per HAL.
58 */
59typedef struct __hal_driver_t {
60	vxge_hal_driver_config_t	config;
61	int				is_initialized;
62	vxge_hal_uld_cbs_t		uld_callbacks;
63	u32				debug_level;
64} __hal_driver_t;
65
66extern __hal_driver_t *g_vxge_hal_driver;
67
68__EXTERN_END_DECLS
69
70#endif	/* VXGE_HAL_DRIVER_H */
71