1156230Smux/*- 2156230Smux * Copyright (c) 2002-2007 Neterion, Inc. 3156230Smux * All rights reserved. 4156230Smux * 5156230Smux * Redistribution and use in source and binary forms, with or without 6156230Smux * modification, are permitted provided that the following conditions 7156230Smux * are met: 8156230Smux * 1. Redistributions of source code must retain the above copyright 9156230Smux * notice, this list of conditions and the following disclaimer. 10156230Smux * 2. Redistributions in binary form must reproduce the above copyright 11156230Smux * notice, this list of conditions and the following disclaimer in the 12156230Smux * documentation and/or other materials provided with the distribution. 13156230Smux * 14156230Smux * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15156230Smux * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16156230Smux * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17156230Smux * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18156230Smux * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19156230Smux * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20156230Smux * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21156230Smux * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22156230Smux * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23156230Smux * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24156230Smux * SUCH DAMAGE. 25156230Smux * 26156230Smux * $FreeBSD: releng/10.3/sys/dev/nxge/include/xgehal-event.h 173139 2007-10-29 14:19:32Z rwatson $ 27156230Smux */ 28156230Smux 29156230Smux#ifndef XGE_HAL_EVENT_H 30156230Smux#define XGE_HAL_EVENT_H 31156230Smux 32156230Smux#include <dev/nxge/include/xge-os-pal.h> 33156230Smux 34156230Smux__EXTERN_BEGIN_DECLS 35156230Smux 36156230Smux#define XGE_HAL_EVENT_BASE 0 37156230Smux#define XGE_LL_EVENT_BASE 100 38156230Smux 39156230Smux/** 40156230Smux * enum xge_hal_event_e - Enumerates slow-path HAL events. 41156230Smux * @XGE_HAL_EVENT_UNKNOWN: Unknown (and invalid) event. 42156230Smux * @XGE_HAL_EVENT_SERR: Serious hardware error event. 43156230Smux * @XGE_HAL_EVENT_LINK_IS_UP: The link state has changed from 'down' to 44156230Smux * 'up'; upper-layer driver (typically, link layer) is 45156230Smux * supposed to wake the queue, etc. 46156230Smux * @XGE_HAL_EVENT_LINK_IS_DOWN: Link-down event. 47156230Smux * The link state has changed from 'down' to 'up'; 48156230Smux * upper-layer driver is supposed to stop traffic, etc. 49156230Smux * @XGE_HAL_EVENT_ECCERR: ECC error event. 50156230Smux * @XGE_HAL_EVENT_PARITYERR: Parity error event. 51156230Smux * @XGE_HAL_EVENT_TARGETABORT: Target abort event. Used when device 52156230Smux * aborts transmit operation with the corresponding transfer code 53156230Smux * (for T_CODE enum see xgehal-fifo.h and xgehal-ring.h) 54156230Smux * @XGE_HAL_EVENT_SLOT_FREEZE: Slot-freeze event. Driver tries to distinguish 55156230Smux * slot-freeze from the rest critical events (e.g. ECC) when it is 56156230Smux * impossible to PIO read "through" the bus, i.e. when getting all-foxes. 57156230Smux * 58156230Smux * xge_hal_event_e enumerates slow-path HAL eventis. 59156230Smux * 60156230Smux * See also: xge_hal_uld_cbs_t{}, xge_uld_link_up_f{}, 61156230Smux * xge_uld_link_down_f{}. 62156230Smux */ 63156230Smuxtypedef enum xge_hal_event_e { 64156230Smux XGE_HAL_EVENT_UNKNOWN = 0, 65156230Smux /* HAL events */ 66156230Smux XGE_HAL_EVENT_SERR = XGE_HAL_EVENT_BASE + 1, 67156230Smux XGE_HAL_EVENT_LINK_IS_UP = XGE_HAL_EVENT_BASE + 2, 68156230Smux XGE_HAL_EVENT_LINK_IS_DOWN = XGE_HAL_EVENT_BASE + 3, 69156230Smux XGE_HAL_EVENT_ECCERR = XGE_HAL_EVENT_BASE + 4, 70156230Smux XGE_HAL_EVENT_PARITYERR = XGE_HAL_EVENT_BASE + 5, 71156230Smux XGE_HAL_EVENT_TARGETABORT = XGE_HAL_EVENT_BASE + 6, 72156230Smux XGE_HAL_EVENT_SLOT_FREEZE = XGE_HAL_EVENT_BASE + 7, 73156230Smux} xge_hal_event_e; 74156230Smux 75156230Smux__EXTERN_END_DECLS 76156230Smux 77156230Smux#endif /* XGE_HAL_EVENT_H */ 78156230Smux