xgehal-event.h revision 171095
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: head/sys/dev/nxge/include/xgehal-event.h 171095 2007-06-29 22:47:18Z sam $
27171095Ssam */
28171095Ssam
29171095Ssam/*
30171095Ssam *  FileName :    xgehal-event.h
31171095Ssam *
32171095Ssam *  Description:  event types
33171095Ssam *
34171095Ssam *  Created:      7 June 2004
35171095Ssam */
36171095Ssam
37171095Ssam#ifndef XGE_HAL_EVENT_H
38171095Ssam#define XGE_HAL_EVENT_H
39171095Ssam
40171095Ssam#include <dev/nxge/include/xge-os-pal.h>
41171095Ssam
42171095Ssam__EXTERN_BEGIN_DECLS
43171095Ssam
44171095Ssam#define XGE_HAL_EVENT_BASE		0
45171095Ssam#define XGE_LL_EVENT_BASE		100
46171095Ssam
47171095Ssam/**
48171095Ssam * enum xge_hal_event_e - Enumerates slow-path HAL events.
49171095Ssam * @XGE_HAL_EVENT_UNKNOWN: Unknown (and invalid) event.
50171095Ssam * @XGE_HAL_EVENT_SERR: Serious hardware error event.
51171095Ssam * @XGE_HAL_EVENT_LINK_IS_UP: The link state has changed from 'down' to
52171095Ssam * 'up'; upper-layer driver (typically, link layer) is
53171095Ssam * supposed to wake the queue, etc.
54171095Ssam * @XGE_HAL_EVENT_LINK_IS_DOWN: Link-down event.
55171095Ssam *                    The link state has changed from 'down' to 'up';
56171095Ssam *                    upper-layer driver is supposed to stop traffic, etc.
57171095Ssam * @XGE_HAL_EVENT_ECCERR: ECC error event.
58171095Ssam * @XGE_HAL_EVENT_PARITYERR: Parity error event.
59171095Ssam * @XGE_HAL_EVENT_TARGETABORT: Target abort event. Used when device
60171095Ssam * aborts transmit operation with the corresponding transfer code
61171095Ssam * (for T_CODE enum see xgehal-fifo.h and xgehal-ring.h)
62171095Ssam * @XGE_HAL_EVENT_SLOT_FREEZE: Slot-freeze event. Driver tries to distinguish
63171095Ssam * slot-freeze from the rest critical events (e.g. ECC) when it is
64171095Ssam * impossible to PIO read "through" the bus, i.e. when getting all-foxes.
65171095Ssam *
66171095Ssam * xge_hal_event_e enumerates slow-path HAL eventis.
67171095Ssam *
68171095Ssam * See also: xge_hal_uld_cbs_t{}, xge_uld_link_up_f{},
69171095Ssam * xge_uld_link_down_f{}.
70171095Ssam */
71171095Ssamtypedef enum xge_hal_event_e {
72171095Ssam	XGE_HAL_EVENT_UNKNOWN		= 0,
73171095Ssam	/* HAL events */
74171095Ssam	XGE_HAL_EVENT_SERR		= XGE_HAL_EVENT_BASE + 1,
75171095Ssam	XGE_HAL_EVENT_LINK_IS_UP	= XGE_HAL_EVENT_BASE + 2,
76171095Ssam	XGE_HAL_EVENT_LINK_IS_DOWN	= XGE_HAL_EVENT_BASE + 3,
77171095Ssam	XGE_HAL_EVENT_ECCERR		= XGE_HAL_EVENT_BASE + 4,
78171095Ssam	XGE_HAL_EVENT_PARITYERR		= XGE_HAL_EVENT_BASE + 5,
79171095Ssam	XGE_HAL_EVENT_TARGETABORT       = XGE_HAL_EVENT_BASE + 6,
80171095Ssam	XGE_HAL_EVENT_SLOT_FREEZE       = XGE_HAL_EVENT_BASE + 7,
81171095Ssam} xge_hal_event_e;
82171095Ssam
83171095Ssam__EXTERN_END_DECLS
84171095Ssam
85171095Ssam#endif /* XGE_HAL_EVENT_H */
86