1171095Ssam/*- 2171095Ssam * Copyright (c) 2002-2007 Neterion, Inc. 3171095Ssam * All rights reserved. 4171095Ssam * 5171095Ssam * Redistribution and use in source and binary forms, with or without 6171095Ssam * modification, are permitted provided that the following conditions 7171095Ssam * are met: 8171095Ssam * 1. Redistributions of source code must retain the above copyright 9171095Ssam * notice, this list of conditions and the following disclaimer. 10171095Ssam * 2. Redistributions in binary form must reproduce the above copyright 11171095Ssam * notice, this list of conditions and the following disclaimer in the 12171095Ssam * documentation and/or other materials provided with the distribution. 13171095Ssam * 14171095Ssam * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15171095Ssam * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16171095Ssam * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17171095Ssam * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18171095Ssam * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19171095Ssam * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20171095Ssam * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21171095Ssam * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22171095Ssam * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23171095Ssam * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24171095Ssam * SUCH DAMAGE. 25171095Ssam * 26171095Ssam * $FreeBSD$ 27171095Ssam */ 28171095Ssam 29171095Ssam#ifndef XGE_HAL_EVENT_H 30171095Ssam#define XGE_HAL_EVENT_H 31171095Ssam 32171095Ssam#include <dev/nxge/include/xge-os-pal.h> 33171095Ssam 34171095Ssam__EXTERN_BEGIN_DECLS 35171095Ssam 36173139Srwatson#define XGE_HAL_EVENT_BASE 0 37173139Srwatson#define XGE_LL_EVENT_BASE 100 38171095Ssam 39171095Ssam/** 40171095Ssam * enum xge_hal_event_e - Enumerates slow-path HAL events. 41171095Ssam * @XGE_HAL_EVENT_UNKNOWN: Unknown (and invalid) event. 42171095Ssam * @XGE_HAL_EVENT_SERR: Serious hardware error event. 43171095Ssam * @XGE_HAL_EVENT_LINK_IS_UP: The link state has changed from 'down' to 44171095Ssam * 'up'; upper-layer driver (typically, link layer) is 45171095Ssam * supposed to wake the queue, etc. 46171095Ssam * @XGE_HAL_EVENT_LINK_IS_DOWN: Link-down event. 47171095Ssam * The link state has changed from 'down' to 'up'; 48171095Ssam * upper-layer driver is supposed to stop traffic, etc. 49171095Ssam * @XGE_HAL_EVENT_ECCERR: ECC error event. 50171095Ssam * @XGE_HAL_EVENT_PARITYERR: Parity error event. 51171095Ssam * @XGE_HAL_EVENT_TARGETABORT: Target abort event. Used when device 52171095Ssam * aborts transmit operation with the corresponding transfer code 53171095Ssam * (for T_CODE enum see xgehal-fifo.h and xgehal-ring.h) 54171095Ssam * @XGE_HAL_EVENT_SLOT_FREEZE: Slot-freeze event. Driver tries to distinguish 55171095Ssam * slot-freeze from the rest critical events (e.g. ECC) when it is 56171095Ssam * impossible to PIO read "through" the bus, i.e. when getting all-foxes. 57171095Ssam * 58171095Ssam * xge_hal_event_e enumerates slow-path HAL eventis. 59171095Ssam * 60171095Ssam * See also: xge_hal_uld_cbs_t{}, xge_uld_link_up_f{}, 61171095Ssam * xge_uld_link_down_f{}. 62171095Ssam */ 63171095Ssamtypedef enum xge_hal_event_e { 64173139Srwatson XGE_HAL_EVENT_UNKNOWN = 0, 65171095Ssam /* HAL events */ 66173139Srwatson XGE_HAL_EVENT_SERR = XGE_HAL_EVENT_BASE + 1, 67173139Srwatson XGE_HAL_EVENT_LINK_IS_UP = XGE_HAL_EVENT_BASE + 2, 68173139Srwatson XGE_HAL_EVENT_LINK_IS_DOWN = XGE_HAL_EVENT_BASE + 3, 69173139Srwatson XGE_HAL_EVENT_ECCERR = XGE_HAL_EVENT_BASE + 4, 70173139Srwatson XGE_HAL_EVENT_PARITYERR = XGE_HAL_EVENT_BASE + 5, 71173139Srwatson XGE_HAL_EVENT_TARGETABORT = XGE_HAL_EVENT_BASE + 6, 72173139Srwatson XGE_HAL_EVENT_SLOT_FREEZE = XGE_HAL_EVENT_BASE + 7, 73171095Ssam} xge_hal_event_e; 74171095Ssam 75171095Ssam__EXTERN_END_DECLS 76171095Ssam 77171095Ssam#endif /* XGE_HAL_EVENT_H */ 78