1a23fd11yl/*
2a23fd11yl * CDDL HEADER START
3a23fd11yl *
4a23fd11yl * The contents of this file are subject to the terms of the
5a23fd11yl * Common Development and Distribution License (the "License").
6a23fd11yl * You may not use this file except in compliance with the License.
7a23fd11yl *
8a23fd11yl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9a23fd11yl * or http://www.opensolaris.org/os/licensing.
10a23fd11yl * See the License for the specific language governing permissions
11a23fd11yl * and limitations under the License.
12a23fd11yl *
13a23fd11yl * When distributing Covered Code, include this CDDL HEADER in each
14a23fd11yl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15a23fd11yl * If applicable, add the following below this CDDL HEADER, with the
16a23fd11yl * fields enclosed by brackets "[]" replaced with your own identifying
17a23fd11yl * information: Portions Copyright [yyyy] [name of copyright owner]
18a23fd11yl *
19a23fd11yl * CDDL HEADER END
20a23fd11yl *
218347601yl * Copyright (c) 2002-2006 Neterion, Inc.
22a23fd11yl */
23a23fd11yl
24a23fd11yl#ifndef XGE_HAL_EVENT_H
25a23fd11yl#define XGE_HAL_EVENT_H
26a23fd11yl
27a23fd11yl#include "xge-os-pal.h"
28a23fd11yl
298347601yl__EXTERN_BEGIN_DECLS
308347601yl
31a23fd11yl#define XGE_HAL_EVENT_BASE		0
32a23fd11yl#define XGE_LL_EVENT_BASE		100
33a23fd11yl
34a23fd11yl/**
35a23fd11yl * enum xge_hal_event_e - Enumerates slow-path HAL events.
36a23fd11yl * @XGE_HAL_EVENT_UNKNOWN: Unknown (and invalid) event.
37a23fd11yl * @XGE_HAL_EVENT_SERR: Serious hardware error event.
38a23fd11yl * @XGE_HAL_EVENT_LINK_IS_UP: The link state has changed from 'down' to
39a23fd11yl * 'up'; upper-layer driver (typically, link layer) is
40a23fd11yl * supposed to wake the queue, etc.
41a23fd11yl * @XGE_HAL_EVENT_LINK_IS_DOWN: Link-down event.
42a23fd11yl *                    The link state has changed from 'down' to 'up';
43a23fd11yl *                    upper-layer driver is supposed to stop traffic, etc.
44a23fd11yl * @XGE_HAL_EVENT_ECCERR: ECC error event.
45a23fd11yl * @XGE_HAL_EVENT_PARITYERR: Parity error event.
46a23fd11yl * @XGE_HAL_EVENT_TARGETABORT: Target abort event. Used when device
47a23fd11yl * aborts transmit operation with the corresponding transfer code
48a23fd11yl * (for T_CODE enum see xgehal-fifo.h and xgehal-ring.h)
49a23fd11yl * @XGE_HAL_EVENT_SLOT_FREEZE: Slot-freeze event. Driver tries to distinguish
50a23fd11yl * slot-freeze from the rest critical events (e.g. ECC) when it is
51a23fd11yl * impossible to PIO read "through" the bus, i.e. when getting all-foxes.
52a23fd11yl *
53a23fd11yl * xge_hal_event_e enumerates slow-path HAL eventis.
54a23fd11yl *
55a23fd11yl * See also: xge_hal_uld_cbs_t{}, xge_uld_link_up_f{},
56a23fd11yl * xge_uld_link_down_f{}.
57a23fd11yl */
58a23fd11yltypedef enum xge_hal_event_e {
59a23fd11yl	XGE_HAL_EVENT_UNKNOWN		= 0,
60a23fd11yl	/* HAL events */
61a23fd11yl	XGE_HAL_EVENT_SERR		= XGE_HAL_EVENT_BASE + 1,
62a23fd11yl	XGE_HAL_EVENT_LINK_IS_UP	= XGE_HAL_EVENT_BASE + 2,
63a23fd11yl	XGE_HAL_EVENT_LINK_IS_DOWN	= XGE_HAL_EVENT_BASE + 3,
64a23fd11yl	XGE_HAL_EVENT_ECCERR		= XGE_HAL_EVENT_BASE + 4,
65a23fd11yl	XGE_HAL_EVENT_PARITYERR		= XGE_HAL_EVENT_BASE + 5,
66a23fd11yl	XGE_HAL_EVENT_TARGETABORT       = XGE_HAL_EVENT_BASE + 6,
67a23fd11yl	XGE_HAL_EVENT_SLOT_FREEZE       = XGE_HAL_EVENT_BASE + 7,
68a23fd11yl} xge_hal_event_e;
69a23fd11yl
708347601yl__EXTERN_END_DECLS
718347601yl
72a23fd11yl#endif /* XGE_HAL_EVENT_H */
73