/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _SYS_IB_ADAPTERS_HERMON_FM_H
#define _SYS_IB_ADAPTERS_HERMON_FM_H
/*
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* HCA FMA compile note.
*
* FMA_TEST is used for HCA function tests, and
* the macro can be on by changing Makefile.
*
* in case of DEBUG
* FMA_TEST is on
*
* in case of non-DEBUG (DEBUG is off)
* FMA_TEST is off
*/
/*
* HCA FM common data structure
*/
/*
* HCA FM Structure
* This structure is used to catch HCA HW errors.
*/
struct i_hca_fm {
};
/*
* HCA FM acc handle structure
* This structure is holding ddi_acc_handle_t and other members
* to deal with HCA PIO FM.
*/
struct i_hca_acc_handle {
};
/*
* HCA FM function test structure
* This structure can be used to test the basic fm function test for HCA.
* The test code is included if the FMA_TEST macro is defined.
*/
struct i_hca_fm_test {
void *private; /* private data */
};
/*
* Hermon FM data structure
*/
/*
* The following defines are to supplement device error reporting.
* At each place where the planned FMA error matrix specifies that
* an ereport will be generated, for now there is a HERMON_FMANOTE()
* call generating an appropriate message string.
*
* This has been revised since it has been realized that FMA is only
* to be used for hardware errors. HERMON_FMANOTE() is used to report
* errors that are likely to be hardware, but possibly are not.
*/
/* CQE Syndrome errors - see hermon_cq.c */
/* event errors - see hermon_event.c */
/* HCR device failure returns - see hermon_cmd.c */
/* HCA initialization errors - see hermon.c */
/*
* HCA FM constants
*/
/* HCA FM state */
/* HCA FM state flags */
/* HCA ererport type */
/* HCA ereport detail */
/* Ignore HCA HW error check */
/* HCA FM pio retry operation state */
/* HCA firmware faults */
/*
* Hermon FM macros
*/
#ifdef FMA_TEST
#else
#endif /* FMA_TEST */
/*
* hermon_pio_init() is a macro initializing variables.
*/
TEST_DECLARE(tst) \
int status = HCA_PIO_OK; \
int cnt = HCA_PIO_RETRY_CNT
/*
* hermon_pio_start() is one of a pair of macros checking HW errors
* at PIO requests, which should be called before the requests are issued.
*/
if (st->hs_fm_async_fatal) { \
goto label; \
} else { \
cnt = HCA_PIO_RETRY_CNT; \
HCA_PIO_PERSISTENT) { \
goto label; \
} \
} \
} else { \
status = HCA_SKIP_HW_CHK; \
} \
do {
/*
* hermon_pio_end() is the other of a pair of macros checking HW errors
* at PIO requests, which should be called after the requests end.
* If a HW error is detected and can be isolated well, these macros
* retry the operation to determine if the error is persistent or not.
*/
if (status != HCA_SKIP_HW_CHK) { \
if (st->hs_fm_async_fatal) { \
goto label; \
} \
HCA_PIO_PERSISTENT) { \
goto label; \
} else if (status == HCA_PIO_TRANSIENT) { \
} \
} \
} while (status == HCA_PIO_TRANSIENT)
extern void hermon_fm_init(hermon_state_t *);
extern void hermon_fm_fini(hermon_state_t *);
extern int hermon_fm_ereport_init(hermon_state_t *);
extern void hermon_fm_ereport_fini(hermon_state_t *);
extern int hermon_get_state(hermon_state_t *);
extern void hermon_fm_ereport(hermon_state_t *, int, int);
hermon_test_t *);
hermon_test_t *);
extern void hermon_clr_state_nolock(hermon_state_t *, int);
extern void hermon_inter_err_chk(void *);
#ifdef FMA_TEST
extern void hermon_test_deregister(void);
extern int hermon_test_num;
#endif /* FMA_TEST */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_ADAPTERS_HERMON_FM_H */