4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
36 #include <sys/ddifm.h>
37 #include <sys/ddifm_impl.h>
39 /* FM handle cache support */
42 #define DEFAULT_DMACACHE_SZ 100
43 #define DEFAULT_ACCCACHE_SZ 10
45 extern int default_dmacache_sz
;
46 extern int default_acccache_sz
;
48 /* Forward declarations for FM NDI */
50 typedef struct i_ddi_fmc ndi_fmc_t
;
51 typedef struct i_ddi_fmc_entry ndi_fmcentry_t
;
53 /* Per-handle NDI error status */
54 typedef struct i_ndi_err
{
55 uint64_t err_ena
; /* ENA for this error */
56 int err_status
; /* error status */
57 int err_expected
; /* was this error expected? */
58 void *err_ontrap
; /* ontrap protection, if any */
59 struct i_ddi_fmc_entry
*err_fep
; /* FM cache link */
60 int (*err_cf
)(); /* compare function */
65 extern void ndi_fmc_insert(dev_info_t
*, int, void *, void *);
66 extern void ndi_fmc_remove(dev_info_t
*, int, const void *);
67 extern int ndi_fmc_error(dev_info_t
*, dev_info_t
*, int, uint64_t,
69 extern int ndi_fmc_entry_error(dev_info_t
*, int, ddi_fm_error_t
*,
71 extern int ndi_fmc_entry_error_all(dev_info_t
*, int, ddi_fm_error_t
*);
73 extern int ndi_fm_handler_dispatch(dev_info_t
*, dev_info_t
*,
74 const ddi_fm_error_t
*);
75 extern int i_ddi_fm_handler_dispatch(dev_info_t
*, const ddi_fm_error_t
*);
77 extern void ndi_fm_acc_err_set(ddi_acc_handle_t
, ddi_fm_error_t
*);
78 extern void ndi_fm_dma_err_set(ddi_dma_handle_t
, ddi_fm_error_t
*);
86 #endif /* _SYS_NDIFM_H */