xref: /illumos-gate/usr/src/uts/sun4/io/px/px_fm.h (revision 88f3d7297a011d0fa0768a7b2082305a822487b2)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_PX_FM_H
28 #define	_SYS_PX_FM_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #define	PX_ERR_PIL	14
37 #define	PX_ERR_LOW_PIL  9
38 
39 /*
40  * Error handlers maybe called due to trap or interrupts
41  * occured.
42  */
43 #define	PX_TRAP_CALL	0
44 #define	PX_INTR_CALL	1
45 #define	PX_LIB_CALL	2
46 
47 /*
48  * Definition of Fire internal error severity -
49  *   PX_FATAL_HW: errors that automatically cause Fire HW reset,
50  *   PX_FATAL_GOS: errors that causes OS cease to function immediately,
51  *   PX_STUCK_FATAL: errors that is likely to spam, causing hang,
52  *   PX_FATAL_SW: errors that cause partial OS lose function,
53  *   PX_NONFATAL: errors that can be recovered or ignored.
54  */
55 #define	PX_FATAL_HW		0x10
56 #define	PX_FATAL_GOS		0x8
57 #define	PX_STUCK_FATAL		0x4
58 #define	PX_FATAL_SW		0x2
59 #define	PX_NONFATAL		0x1
60 #define	PX_OK			DDI_FM_OK
61 #define	PX_ERR_UNKNOWN		0x80
62 
63 /*
64  * Error handling FMA hook
65  */
66 extern void px_bus_enter(dev_info_t *dip, ddi_acc_handle_t handle);
67 extern void px_bus_exit(dev_info_t *dip, ddi_acc_handle_t handle);
68 extern int px_fm_attach(px_t *px_p);
69 extern void px_fm_detach(px_t *px_p);
70 extern int px_fm_init_child(dev_info_t *, dev_info_t *, int,
71     ddi_iblock_cookie_t *);
72 extern void px_fm_acc_setup(ddi_map_req_t *, dev_info_t *);
73 extern int px_handle_lookup(dev_info_t *, int, uint64_t, void *);
74 extern int px_fm_callback(dev_info_t *, ddi_fm_error_t *, const void *);
75 extern int px_err_handle(px_t *px_p, ddi_fm_error_t *derr, int caller,
76     boolean_t checkjbc);
77 
78 /*
79  * Fire interrupt handlers
80  */
81 extern uint_t px_err_cb_intr(caddr_t arg);
82 extern uint_t px_err_dmc_pec_intr(caddr_t arg);
83 extern uint_t px_err_fabric_intr(px_t *px_p, msgcode_t msg_code,
84     pcie_req_id_t rid);
85 
86 /*
87  * Common error handling functions
88  */
89 extern void px_err_safeacc_check(px_t *px_p, ddi_fm_error_t *derr);
90 
91 #ifdef	__cplusplus
92 }
93 #endif
94 
95 #endif	/* _SYS_PX_FM_H */
96