Kernel Functions for Drivers ddifmaccerrget(9F)
NAME
ddifmaccerrget, ddifmdmaerrget - get the error
status for an access or DMA handle
SYNOPSIS
#include
void ddifmaccerrget(ddiacchandlet acchandle,
ddifmerrort *errorstatus, int version);
void ddifmdmaerrget(ddidmahandlet dmahandle,
ddifmerrort *errorstatus, int version);
INTERFACE LEVEL
Solaris DI specific (Solaris DI)
PARAMETERS
acchandle Data access handle obtained from a previous
call to ddiregsmapsetup(9F),
ddidmamemalloc(9F), or to a similar func-
tion.
dmahandle DMA handle obtained from a previous call to
ddidmamemalloc(9F) or one of its deriva-
tives.
errorstatus Pointer to where the error status for the
access or DMA handle should be returned.
version Version number of ddifmerrort. The driver
should always set this to DIFMEVERSION.
DESCRIPTION
The ddifmdmaerrget() and ddifmaccerrget() functions
return the error status for a DMA or access handle respec-
tively. If a fault has occurred that affects the resource
mapped by the supplied handle, the supplied errorstatus
structure is updated to reflect error information captured
during error handling by a bus or other device driver in the
I/O data path.
If an error is indicated for an access handle, the driver
might no longer be able to access the mapped registers or
memory using programmed I/O through the handle. Typically,
this might occur after the device has failed to respond to
SunOS 5.11 Last change: 13 May 2007 1
Kernel Functions for Drivers ddifmaccerrget(9F)
an I/O access - in the case of a bus error, for instance, or
a timeout. The effect of programmed I/O access made at the
time of a fault is undefined. Read access via ddiget8(9F),
for example, can return random values, while write access
via ddiput8(9F) might or might not have an effect. It is
possible, however, that the error might be transient. In
that case, the driver can attempt to recover by calling
ddifmaccerrclear(), resetting the device to return it to
a known state, then retrying any potentially failed transac-
tions.
If an error is indicated for a DMA handle, it implies that
an error has been detected that has or will affect DMA tran-
sactions between the device and the memory currently bound
to the handle - or the memory most recently bound, if the
handle is currently unbound. Possible causes include the
failure of a component in the DMA data path or an attempt by
the device to make an invalid DMA access. The contents of
any memory currently or previously bound to the handle
should be considered indeterminate. The driver might be able
to continue by freeing memory that is bound to the handle
back to the system, resetting the device to return it to a
known state, then retrying any potentially failed transac-
tions.
If the driver is unable to recover, the operating state
should be changed by a call to ddifmserviceimpact() that
specifies DISERVICELOST for the impacted device instance.
If the recovery and retry succeed, a call should still be
made to ddifmserviceimpact() but DISERVICEUNAFECTED
should be specified.
CONTEXT
The ddifmaccerrget() and ddifmdmaerrget() functions
can be called from user, kernel, or high-level interrupt
context.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 13 May 2007 2
Kernel Functions for Drivers ddifmaccerrget(9F)
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
SEE ALSO
attributes(5), ddidmamemalloc(9F),
ddifmaccerrclear(9F), ddifmserviceimpact(9F),
ddiget8(9F), ddiput8(9F), ddiregsmapsetup(9F),
ddifmerror(9S),
Writing Device Drivers
SunOS 5.11 Last change: 13 May 2007 3
|