xref: /onnv-gate/usr/src/uts/sun4u/io/pci/pci_fm.c (revision 1865:c8b524cdb631)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*1865Sdilpreet  * Common Development and Distribution License (the "License").
6*1865Sdilpreet  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*1865Sdilpreet  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
270Sstevel@tonic-gate 
280Sstevel@tonic-gate #include <sys/types.h>
290Sstevel@tonic-gate #include <sys/sunddi.h>
300Sstevel@tonic-gate #include <sys/sunndi.h>
310Sstevel@tonic-gate #include <sys/ddi_impldefs.h>
320Sstevel@tonic-gate #include <sys/async.h>
330Sstevel@tonic-gate #include <sys/membar.h>
340Sstevel@tonic-gate #include <sys/spl.h>
350Sstevel@tonic-gate #include <sys/iommu.h>
360Sstevel@tonic-gate #include <sys/pci/pci_obj.h>
370Sstevel@tonic-gate #include <sys/fm/util.h>
380Sstevel@tonic-gate #include <sys/fm/io/pci.h>
390Sstevel@tonic-gate #include <sys/fm/io/ddi.h>
400Sstevel@tonic-gate #include <sys/fm/io/sun4upci.h>
410Sstevel@tonic-gate #include <sys/fm/protocol.h>
420Sstevel@tonic-gate #include <sys/intr.h>
430Sstevel@tonic-gate 
440Sstevel@tonic-gate /*LINTLIBRARY*/
450Sstevel@tonic-gate 
460Sstevel@tonic-gate /*
470Sstevel@tonic-gate  * The routines below are generic sun4u PCI interfaces to support
480Sstevel@tonic-gate  * Fault Management.
490Sstevel@tonic-gate  *
500Sstevel@tonic-gate  * pci_dma_check, pci_acc_check, pci_handle_lookup are functions used
510Sstevel@tonic-gate  * to associate a captured PCI address to a particular dma/acc handle.
520Sstevel@tonic-gate  *
530Sstevel@tonic-gate  * pci_fm_acc_setup, pci_fm_init_child, pci_fm_create,
540Sstevel@tonic-gate  * pci_fm_destroy are constructors/destructors used to setup and teardown
550Sstevel@tonic-gate  * necessary resources.
560Sstevel@tonic-gate  *
570Sstevel@tonic-gate  * pci_bus_enter, pci_bus_exit are registered via busops and are used to
580Sstevel@tonic-gate  * provide exclusive access to the PCI bus.
590Sstevel@tonic-gate  *
600Sstevel@tonic-gate  * pci_err_callback is the registered callback for PCI which is called
610Sstevel@tonic-gate  * by the CPU code when it detects a UE/TO/BERR.
620Sstevel@tonic-gate  *
630Sstevel@tonic-gate  * pbm_ereport_post is used by the PBM code to generically report all
640Sstevel@tonic-gate  * PBM errors.
650Sstevel@tonic-gate  *
660Sstevel@tonic-gate  */
670Sstevel@tonic-gate 
680Sstevel@tonic-gate /*
690Sstevel@tonic-gate  * Function used to setup access functions depending on level of desired
700Sstevel@tonic-gate  * protection.
710Sstevel@tonic-gate  */
720Sstevel@tonic-gate void
pci_fm_acc_setup(ddi_map_req_t * mp,dev_info_t * rdip)730Sstevel@tonic-gate pci_fm_acc_setup(ddi_map_req_t *mp, dev_info_t *rdip)
740Sstevel@tonic-gate {
750Sstevel@tonic-gate 	uchar_t fflag;
760Sstevel@tonic-gate 	ddi_acc_hdl_t *hp;
770Sstevel@tonic-gate 	ddi_acc_impl_t *ap;
780Sstevel@tonic-gate 
790Sstevel@tonic-gate 	hp = mp->map_handlep;
800Sstevel@tonic-gate 	ap = (ddi_acc_impl_t *)hp->ah_platform_private;
810Sstevel@tonic-gate 	fflag = ap->ahi_common.ah_acc.devacc_attr_access;
820Sstevel@tonic-gate 
830Sstevel@tonic-gate 	if (mp->map_op == DDI_MO_MAP_LOCKED) {
840Sstevel@tonic-gate 		ndi_fmc_insert(rdip, ACC_HANDLE, (void *)hp, NULL);
850Sstevel@tonic-gate 		switch (fflag) {
860Sstevel@tonic-gate 		case DDI_FLAGERR_ACC:
870Sstevel@tonic-gate 			ap->ahi_get8 = i_ddi_prot_get8;
880Sstevel@tonic-gate 			ap->ahi_get16 = i_ddi_prot_get16;
890Sstevel@tonic-gate 			ap->ahi_get32 = i_ddi_prot_get32;
900Sstevel@tonic-gate 			ap->ahi_get64 = i_ddi_prot_get64;
910Sstevel@tonic-gate 			ap->ahi_put8 = i_ddi_prot_put8;
920Sstevel@tonic-gate 			ap->ahi_put16 = i_ddi_prot_put16;
930Sstevel@tonic-gate 			ap->ahi_put32 = i_ddi_prot_put32;
940Sstevel@tonic-gate 			ap->ahi_put64 = i_ddi_prot_put64;
950Sstevel@tonic-gate 			ap->ahi_rep_get8 = i_ddi_prot_rep_get8;
960Sstevel@tonic-gate 			ap->ahi_rep_get16 = i_ddi_prot_rep_get16;
970Sstevel@tonic-gate 			ap->ahi_rep_get32 = i_ddi_prot_rep_get32;
980Sstevel@tonic-gate 			ap->ahi_rep_get64 = i_ddi_prot_rep_get64;
990Sstevel@tonic-gate 			ap->ahi_rep_put8 = i_ddi_prot_rep_put8;
1000Sstevel@tonic-gate 			ap->ahi_rep_put16 = i_ddi_prot_rep_put16;
1010Sstevel@tonic-gate 			ap->ahi_rep_put32 = i_ddi_prot_rep_put32;
1020Sstevel@tonic-gate 			ap->ahi_rep_put64 = i_ddi_prot_rep_put64;
1030Sstevel@tonic-gate 			break;
1040Sstevel@tonic-gate 		case DDI_CAUTIOUS_ACC :
1050Sstevel@tonic-gate 			ap->ahi_get8 = i_ddi_caut_get8;
1060Sstevel@tonic-gate 			ap->ahi_get16 = i_ddi_caut_get16;
1070Sstevel@tonic-gate 			ap->ahi_get32 = i_ddi_caut_get32;
1080Sstevel@tonic-gate 			ap->ahi_get64 = i_ddi_caut_get64;
1090Sstevel@tonic-gate 			ap->ahi_put8 = i_ddi_caut_put8;
1100Sstevel@tonic-gate 			ap->ahi_put16 = i_ddi_caut_put16;
1110Sstevel@tonic-gate 			ap->ahi_put32 = i_ddi_caut_put32;
1120Sstevel@tonic-gate 			ap->ahi_put64 = i_ddi_caut_put64;
1130Sstevel@tonic-gate 			ap->ahi_rep_get8 = i_ddi_caut_rep_get8;
1140Sstevel@tonic-gate 			ap->ahi_rep_get16 = i_ddi_caut_rep_get16;
1150Sstevel@tonic-gate 			ap->ahi_rep_get32 = i_ddi_caut_rep_get32;
1160Sstevel@tonic-gate 			ap->ahi_rep_get64 = i_ddi_caut_rep_get64;
1170Sstevel@tonic-gate 			ap->ahi_rep_put8 = i_ddi_caut_rep_put8;
1180Sstevel@tonic-gate 			ap->ahi_rep_put16 = i_ddi_caut_rep_put16;
1190Sstevel@tonic-gate 			ap->ahi_rep_put32 = i_ddi_caut_rep_put32;
1200Sstevel@tonic-gate 			ap->ahi_rep_put64 = i_ddi_caut_rep_put64;
1210Sstevel@tonic-gate 			break;
1220Sstevel@tonic-gate 		default:
1230Sstevel@tonic-gate 			break;
1240Sstevel@tonic-gate 		}
1250Sstevel@tonic-gate 	} else if (mp->map_op == DDI_MO_UNMAP) {
1260Sstevel@tonic-gate 		ndi_fmc_remove(rdip, ACC_HANDLE, (void *)hp);
1270Sstevel@tonic-gate 	}
1280Sstevel@tonic-gate }
1290Sstevel@tonic-gate 
1300Sstevel@tonic-gate /*
1310Sstevel@tonic-gate  * Function used to initialize FMA for our children nodes. Called
1320Sstevel@tonic-gate  * through pci busops when child node calls ddi_fm_init.
1330Sstevel@tonic-gate  */
1340Sstevel@tonic-gate /* ARGSUSED */
1350Sstevel@tonic-gate int
pci_fm_init_child(dev_info_t * dip,dev_info_t * tdip,int cap,ddi_iblock_cookie_t * ibc)1360Sstevel@tonic-gate pci_fm_init_child(dev_info_t *dip, dev_info_t *tdip, int cap,
1370Sstevel@tonic-gate     ddi_iblock_cookie_t *ibc)
1380Sstevel@tonic-gate {
1390Sstevel@tonic-gate 	pci_t *pci_p = get_pci_soft_state(ddi_get_instance(dip));
1400Sstevel@tonic-gate 
1410Sstevel@tonic-gate 	ASSERT(ibc != NULL);
142*1865Sdilpreet 	*ibc = pci_p->pci_fm_ibc;
1430Sstevel@tonic-gate 
1440Sstevel@tonic-gate 	return (pci_p->pci_fm_cap);
1450Sstevel@tonic-gate }
1460Sstevel@tonic-gate 
1470Sstevel@tonic-gate /*
1480Sstevel@tonic-gate  * Lock accesses to the pci bus, to be able to protect against bus errors.
1490Sstevel@tonic-gate  */
1500Sstevel@tonic-gate void
pci_bus_enter(dev_info_t * dip,ddi_acc_handle_t handle)1510Sstevel@tonic-gate pci_bus_enter(dev_info_t *dip, ddi_acc_handle_t handle)
1520Sstevel@tonic-gate {
1530Sstevel@tonic-gate 	pci_t *pci_p = get_pci_soft_state(ddi_get_instance(dip));
1540Sstevel@tonic-gate 	pbm_t *pbm_p = pci_p->pci_pbm_p;
1550Sstevel@tonic-gate 
1560Sstevel@tonic-gate 	membar_sync();
1570Sstevel@tonic-gate 
1580Sstevel@tonic-gate 	mutex_enter(&pbm_p->pbm_pokefault_mutex);
1590Sstevel@tonic-gate 	pbm_p->pbm_excl_handle = handle;
1600Sstevel@tonic-gate }
1610Sstevel@tonic-gate 
1620Sstevel@tonic-gate /*
1630Sstevel@tonic-gate  * Unlock access to bus and clear errors before exiting.
1640Sstevel@tonic-gate  */
1650Sstevel@tonic-gate /* ARGSUSED */
1660Sstevel@tonic-gate void
pci_bus_exit(dev_info_t * dip,ddi_acc_handle_t handle)1670Sstevel@tonic-gate pci_bus_exit(dev_info_t *dip, ddi_acc_handle_t handle)
1680Sstevel@tonic-gate {
1690Sstevel@tonic-gate 	pci_t *pci_p = get_pci_soft_state(ddi_get_instance(dip));
1700Sstevel@tonic-gate 	pbm_t *pbm_p = pci_p->pci_pbm_p;
1710Sstevel@tonic-gate 	ddi_fm_error_t derr;
1720Sstevel@tonic-gate 
1730Sstevel@tonic-gate 	ASSERT(MUTEX_HELD(&pbm_p->pbm_pokefault_mutex));
1740Sstevel@tonic-gate 
1750Sstevel@tonic-gate 	membar_sync();
1760Sstevel@tonic-gate 
1770Sstevel@tonic-gate 	mutex_enter(&pci_p->pci_common_p->pci_fm_mutex);
1780Sstevel@tonic-gate 	ddi_fm_acc_err_get(pbm_p->pbm_excl_handle, &derr, DDI_FME_VERSION);
1790Sstevel@tonic-gate 
1800Sstevel@tonic-gate 	if (derr.fme_status == DDI_FM_OK) {
1810Sstevel@tonic-gate 		if (pci_check_error(pci_p) != 0) {
1820Sstevel@tonic-gate 			(void) pci_pbm_err_handler(pci_p->pci_dip, &derr,
1830Sstevel@tonic-gate 					(const void *)pci_p, PCI_BUS_EXIT_CALL);
1840Sstevel@tonic-gate 		}
1850Sstevel@tonic-gate 	}
1860Sstevel@tonic-gate 	mutex_exit(&pci_p->pci_common_p->pci_fm_mutex);
1870Sstevel@tonic-gate 
1880Sstevel@tonic-gate 	pbm_p->pbm_excl_handle = NULL;
1890Sstevel@tonic-gate 	mutex_exit(&pbm_p->pbm_pokefault_mutex);
1900Sstevel@tonic-gate }
1910Sstevel@tonic-gate 
1920Sstevel@tonic-gate /*
1930Sstevel@tonic-gate  * PCI error callback which is registered with our parent to call
1940Sstevel@tonic-gate  * for PCI logging when the CPU traps due to BERR/TO/UE.
1950Sstevel@tonic-gate  */
1960Sstevel@tonic-gate int
pci_err_callback(dev_info_t * dip,ddi_fm_error_t * derr,const void * impl_data)1970Sstevel@tonic-gate pci_err_callback(dev_info_t *dip, ddi_fm_error_t *derr,
1980Sstevel@tonic-gate     const void *impl_data)
1990Sstevel@tonic-gate {
2000Sstevel@tonic-gate 	pci_t *pci_p = (pci_t *)impl_data;
2010Sstevel@tonic-gate 	pci_common_t *cmn_p = pci_p->pci_common_p;
2020Sstevel@tonic-gate 	ecc_t *ecc_p = cmn_p->pci_common_ecc_p;
2030Sstevel@tonic-gate 	ecc_errstate_t ecc_err;
2040Sstevel@tonic-gate 	int fatal = 0;
2050Sstevel@tonic-gate 	int nonfatal = 0;
2060Sstevel@tonic-gate 	int unknown = 0;
2070Sstevel@tonic-gate 	int ret = DDI_FM_OK;
2080Sstevel@tonic-gate 
2090Sstevel@tonic-gate 	bzero(&ecc_err, sizeof (ecc_err));
2100Sstevel@tonic-gate 	mutex_enter(&cmn_p->pci_fm_mutex);
2110Sstevel@tonic-gate 	/*
2120Sstevel@tonic-gate 	 * Check and log ecc and pbm errors
2130Sstevel@tonic-gate 	 */
2140Sstevel@tonic-gate 	ecc_err.ecc_ii_p = ecc_p->ecc_ue;
2150Sstevel@tonic-gate 	ecc_err.ecc_ena = derr->fme_ena;
2160Sstevel@tonic-gate 	ecc_err.ecc_caller = PCI_TRAP_CALL;
2170Sstevel@tonic-gate 
2180Sstevel@tonic-gate 	if ((ret = ecc_err_handler(&ecc_err)) == DDI_FM_FATAL)
2190Sstevel@tonic-gate 		fatal++;
2200Sstevel@tonic-gate 	else if (ret == DDI_FM_NONFATAL)
2210Sstevel@tonic-gate 		nonfatal++;
2220Sstevel@tonic-gate 	else if (ret == DDI_FM_UNKNOWN)
2230Sstevel@tonic-gate 		unknown++;
2240Sstevel@tonic-gate 
2250Sstevel@tonic-gate 	if (pci_check_error(pci_p) != 0) {
2260Sstevel@tonic-gate 		int err = pci_pbm_err_handler(pci_p->pci_dip, derr,
2270Sstevel@tonic-gate 				(const void *)pci_p, PCI_TRAP_CALL);
2280Sstevel@tonic-gate 		if (err == DDI_FM_FATAL)
2290Sstevel@tonic-gate 			fatal++;
2300Sstevel@tonic-gate 		else if (err == DDI_FM_NONFATAL)
2310Sstevel@tonic-gate 			nonfatal++;
2320Sstevel@tonic-gate 		else if (err == DDI_FM_UNKNOWN)
2330Sstevel@tonic-gate 			unknown++;
2340Sstevel@tonic-gate 	}
2350Sstevel@tonic-gate 
2360Sstevel@tonic-gate 	mutex_exit(&cmn_p->pci_fm_mutex);
2370Sstevel@tonic-gate 
2380Sstevel@tonic-gate 	if (fatal)
2390Sstevel@tonic-gate 		return (DDI_FM_FATAL);
2400Sstevel@tonic-gate 	else if (nonfatal)
2410Sstevel@tonic-gate 		return (DDI_FM_NONFATAL);
2420Sstevel@tonic-gate 	else if (unknown)
2430Sstevel@tonic-gate 		return (DDI_FM_UNKNOWN);
2440Sstevel@tonic-gate 	else
2450Sstevel@tonic-gate 		return (DDI_FM_OK);
2460Sstevel@tonic-gate }
2470Sstevel@tonic-gate 
2480Sstevel@tonic-gate void
pci_fm_create(pci_t * pci_p)2490Sstevel@tonic-gate pci_fm_create(pci_t *pci_p)
2500Sstevel@tonic-gate {
2510Sstevel@tonic-gate 	pci_common_t *cmn_p = pci_p->pci_common_p;
2520Sstevel@tonic-gate 
2530Sstevel@tonic-gate 	/*
2540Sstevel@tonic-gate 	 * PCI detected ECC errorq, to schedule async handling
2550Sstevel@tonic-gate 	 * of ECC errors and logging.
2560Sstevel@tonic-gate 	 * The errorq is created here but destroyed when _fini is called
2570Sstevel@tonic-gate 	 * for the pci module.
2580Sstevel@tonic-gate 	 */
2590Sstevel@tonic-gate 	if (pci_ecc_queue == NULL) {
2600Sstevel@tonic-gate 		pci_ecc_queue = errorq_create("pci_ecc_queue",
2610Sstevel@tonic-gate 				(errorq_func_t)ecc_err_drain,
262*1865Sdilpreet 				(void *)pci_p->pci_ecc_p,
2630Sstevel@tonic-gate 				ECC_MAX_ERRS, sizeof (ecc_errstate_t),
2640Sstevel@tonic-gate 				PIL_2, ERRORQ_VITAL);
2650Sstevel@tonic-gate 		if (pci_ecc_queue == NULL)
2660Sstevel@tonic-gate 			panic("failed to create required system error queue");
2670Sstevel@tonic-gate 	}
2680Sstevel@tonic-gate 
2690Sstevel@tonic-gate 	/*
270*1865Sdilpreet 	 * Initialize pci_target_queue for FMA handling of pci errors.
2710Sstevel@tonic-gate 	 */
272*1865Sdilpreet 	pci_targetq_init();
2730Sstevel@tonic-gate 
2740Sstevel@tonic-gate 	/*
2750Sstevel@tonic-gate 	 * Initialize FMA support
2760Sstevel@tonic-gate 	 * The axq workaround prevents fault management of access errors
2770Sstevel@tonic-gate 	 */
2780Sstevel@tonic-gate 	if (pci_p->pci_pbm_p->pbm_pio_limit == 0)
2790Sstevel@tonic-gate 		pci_p->pci_fm_cap = DDI_FM_EREPORT_CAPABLE |
2800Sstevel@tonic-gate 			DDI_FM_ACCCHK_CAPABLE | DDI_FM_DMACHK_CAPABLE |
2810Sstevel@tonic-gate 			DDI_FM_ERRCB_CAPABLE;
2820Sstevel@tonic-gate 	else
2830Sstevel@tonic-gate 		pci_p->pci_fm_cap = DDI_FM_EREPORT_CAPABLE |
2840Sstevel@tonic-gate 			DDI_FM_DMACHK_CAPABLE | DDI_FM_ERRCB_CAPABLE;
2850Sstevel@tonic-gate 	/*
2860Sstevel@tonic-gate 	 * Call parent to get it's capablity
2870Sstevel@tonic-gate 	 */
2880Sstevel@tonic-gate 	ddi_fm_init(pci_p->pci_dip, &pci_p->pci_fm_cap,
2890Sstevel@tonic-gate 			&pci_p->pci_fm_ibc);
2900Sstevel@tonic-gate 	/*
2910Sstevel@tonic-gate 	 * Need to be ereport and error handler cabable
2920Sstevel@tonic-gate 	 */
2930Sstevel@tonic-gate 	ASSERT((pci_p->pci_fm_cap & DDI_FM_ERRCB_CAPABLE) &&
2940Sstevel@tonic-gate 	    (pci_p->pci_fm_cap & DDI_FM_EREPORT_CAPABLE));
2950Sstevel@tonic-gate 	/*
2960Sstevel@tonic-gate 	 * Initialize error handling mutex.
2970Sstevel@tonic-gate 	 */
2980Sstevel@tonic-gate 	if (cmn_p->pci_common_refcnt == 0) {
2990Sstevel@tonic-gate 		mutex_init(&cmn_p->pci_fm_mutex, NULL, MUTEX_DRIVER,
3000Sstevel@tonic-gate 				(void *)pci_p->pci_fm_ibc);
3010Sstevel@tonic-gate 	}
3020Sstevel@tonic-gate 
3030Sstevel@tonic-gate 	/*
3040Sstevel@tonic-gate 	 * Register error callback with our parent.
3050Sstevel@tonic-gate 	 */
3060Sstevel@tonic-gate 	ddi_fm_handler_register(pci_p->pci_dip, pci_err_callback,
3070Sstevel@tonic-gate 			pci_p);
3080Sstevel@tonic-gate 
3090Sstevel@tonic-gate }
3100Sstevel@tonic-gate 
3110Sstevel@tonic-gate void
pci_fm_destroy(pci_t * pci_p)3120Sstevel@tonic-gate pci_fm_destroy(pci_t *pci_p)
3130Sstevel@tonic-gate {
3140Sstevel@tonic-gate 	pci_common_t *cmn_p = pci_p->pci_common_p;
3150Sstevel@tonic-gate 
3160Sstevel@tonic-gate 	/* schizo non-shared objects */
3170Sstevel@tonic-gate 	ddi_fm_handler_unregister(pci_p->pci_dip);
3180Sstevel@tonic-gate 	ddi_fm_fini(pci_p->pci_dip);
3190Sstevel@tonic-gate 
3200Sstevel@tonic-gate 	if (cmn_p->pci_common_refcnt != 0)
3210Sstevel@tonic-gate 		return;
3220Sstevel@tonic-gate 
3230Sstevel@tonic-gate 	mutex_destroy(&cmn_p->pci_fm_mutex);
3240Sstevel@tonic-gate }
3250Sstevel@tonic-gate 
3260Sstevel@tonic-gate /*
3270Sstevel@tonic-gate  * Function used to post PCI block module specific ereports.
3280Sstevel@tonic-gate  */
3290Sstevel@tonic-gate void
pbm_ereport_post(dev_info_t * dip,uint64_t ena,pbm_errstate_t * pbm_err)3300Sstevel@tonic-gate pbm_ereport_post(dev_info_t *dip, uint64_t ena, pbm_errstate_t *pbm_err)
3310Sstevel@tonic-gate {
3320Sstevel@tonic-gate 	char buf[FM_MAX_CLASS];
3330Sstevel@tonic-gate 
3340Sstevel@tonic-gate 	(void) snprintf(buf, FM_MAX_CLASS, "%s.%s",
3350Sstevel@tonic-gate 	    pbm_err->pbm_bridge_type, pbm_err->pbm_err_class);
3360Sstevel@tonic-gate 
3370Sstevel@tonic-gate 	ena = ena ? ena : fm_ena_generate(0, FM_ENA_FMT1);
3380Sstevel@tonic-gate 
3390Sstevel@tonic-gate 	ddi_fm_ereport_post(dip, buf, ena, DDI_NOSLEEP,
3400Sstevel@tonic-gate 	    FM_VERSION, DATA_TYPE_UINT8, 0,
3410Sstevel@tonic-gate 	    PCI_CONFIG_STATUS, DATA_TYPE_UINT16, pbm_err->pbm_pci.pci_cfg_stat,
3420Sstevel@tonic-gate 	    PCI_CONFIG_COMMAND, DATA_TYPE_UINT16, pbm_err->pbm_pci.pci_cfg_comm,
3430Sstevel@tonic-gate 	    PCI_PBM_CSR, DATA_TYPE_UINT64, pbm_err->pbm_ctl_stat,
3440Sstevel@tonic-gate 	    PCI_PBM_AFSR, DATA_TYPE_UINT64, pbm_err->pbm_afsr,
3450Sstevel@tonic-gate 	    PCI_PBM_AFAR, DATA_TYPE_UINT64, pbm_err->pbm_afar,
3460Sstevel@tonic-gate 	    PCI_PBM_SLOT, DATA_TYPE_UINT64, pbm_err->pbm_err_sl,
3470Sstevel@tonic-gate 	    PCI_PBM_VALOG, DATA_TYPE_UINT64, pbm_err->pbm_va_log,
3480Sstevel@tonic-gate 	    NULL);
3490Sstevel@tonic-gate }
350