vxgehal-driver.h revision 221167
1221167Sgnn/*- 2221167Sgnn * Copyright(c) 2002-2011 Exar Corp. 3221167Sgnn * All rights reserved. 4221167Sgnn * 5221167Sgnn * Redistribution and use in source and binary forms, with or without 6221167Sgnn * modification are permitted provided the following conditions are met: 7221167Sgnn * 8221167Sgnn * 1. Redistributions of source code must retain the above copyright notice, 9221167Sgnn * this list of conditions and the following disclaimer. 10221167Sgnn * 11221167Sgnn * 2. Redistributions in binary form must reproduce the above copyright 12221167Sgnn * notice, this list of conditions and the following disclaimer in the 13221167Sgnn * documentation and/or other materials provided with the distribution. 14221167Sgnn * 15221167Sgnn * 3. Neither the name of the Exar Corporation nor the names of its 16221167Sgnn * contributors may be used to endorse or promote products derived from 17221167Sgnn * this software without specific prior written permission. 18221167Sgnn * 19221167Sgnn * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20221167Sgnn * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21221167Sgnn * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22221167Sgnn * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23221167Sgnn * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24221167Sgnn * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25221167Sgnn * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26221167Sgnn * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27221167Sgnn * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28221167Sgnn * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29221167Sgnn * POSSIBILITY OF SUCH DAMAGE. 30221167Sgnn */ 31221167Sgnn/*$FreeBSD: head/sys/dev/vxge/vxgehal/vxgehal-driver.h 221167 2011-04-28 14:33:15Z gnn $*/ 32221167Sgnn 33221167Sgnn#ifndef VXGE_HAL_DRIVER_H 34221167Sgnn#define VXGE_HAL_DRIVER_H 35221167Sgnn 36221167Sgnn__EXTERN_BEGIN_DECLS 37221167Sgnn 38221167Sgnn/* maximum number of events consumed in a syncle poll() cycle */ 39221167Sgnn#define VXGE_HAL_DRIVER_QUEUE_CONSUME_MAX 5 40221167Sgnn 41221167Sgnn/* 42221167Sgnn * struct __hal_driver_t - Represents HAL object for driver. 43221167Sgnn * @config: HAL configuration. 44221167Sgnn * @devices: List of all PCI-enumerated X3100 devices in the system. 45221167Sgnn * A single vxge_hal_driver_t instance contains zero or more 46221167Sgnn * X3100 devices. 47221167Sgnn * @devices_lock: Lock to protect %devices when inserting/removing. 48221167Sgnn * @is_initialized: True if HAL is initialized; false otherwise. 49221167Sgnn * @uld_callbacks: Upper-layer driver callbacks. See vxge_hal_uld_cbs_t {}. 50221167Sgnn * @debug_module_mask: 32bit mask that defines which components of the 51221167Sgnn * driver are to be traced. The trace-able components are listed in 52221167Sgnn * xgehal_debug.h: 53221167Sgnn * @debug_level: See vxge_debug_level_e {}. 54221167Sgnn * 55221167Sgnn * HAL (driver) object. There is a single instance of this structure per HAL. 56221167Sgnn */ 57221167Sgnntypedef struct __hal_driver_t { 58221167Sgnn vxge_hal_driver_config_t config; 59221167Sgnn int is_initialized; 60221167Sgnn vxge_hal_uld_cbs_t uld_callbacks; 61221167Sgnn u32 debug_level; 62221167Sgnn} __hal_driver_t; 63221167Sgnn 64221167Sgnnextern __hal_driver_t *g_vxge_hal_driver; 65221167Sgnn 66221167Sgnn__EXTERN_END_DECLS 67221167Sgnn 68221167Sgnn#endif /* VXGE_HAL_DRIVER_H */ 69