xtalk_error(D3)
xtalk_error_register - register handling function
As shipped in IRIX 6.5.19. Last changed in IRIX 6.5.15.
NAME xtalk_error_register - register handling function SYNOPSIS #include <sys/xtalk/xtalk.h> #include <sys/ioerror.h> int xtalk_error_register( vertex_hdl_t vhdl, error_handler_f *func, error_handler_arg_t arg) Arguments vhdl is the appropriate XIO registration point. func is a function to be used for error service arg is the parameter to pass as the first argument to the function when an error is diagnosed as a PIO to or a DMA from this XIO device. DESCRIPTION Some devices may, from time to time, either trigger a PIO error or encounter a DMA error that is expected by the driver. xtalk_error_register() provides a mechanism whereby the driver can be informed that such an error has occurred, and be given the ability to either recover from the error, or do a more precise diagnosis of the problem than is possible in the generic error handling code. There is no explicit unregistration function; to stop receiving error reports, call xtalk_error_register() with NULL values for the function pointer and parameter values. The error handler should be registered and unregistered at the same time as the interrupt handlers are connected and disconnected, and for the same reason: we would not want to call an error handler that no longer actually existed at the stored address. Note that error handlers would rarely use the alternate registration scenario outlined in xtalk_intr(D3). EXAMPLES Here is the typical way that xiofoo_attach(vertex_hdl_t pconn_vhdl) { ... xtalk_error_register(pconn_vhdl xiofoo_error_handler, xiofoo_soft); ... static int xiofoo_error_handler( error_handler_arg_t einfo, int error_code, ioerror_mode_t mode, ioerror_t *ioe) { ... if (recoverable) { recover the error; return IOERROR_HANDLED; } diagnose the chip into the console log; return IOERROR_PANIC; } The set of error codes, return codes, and fields within the ioerror structure may be expanded from time to time. The available values are documented in /usr/include/sys/ioerror.h FILES /usr/include/sys/ioerror.h SEE ALSO xtalk(D3), xtalk_dma(D3), xtalk_intr(D3), xtalk_get(D3), xtalk_pio(D3).