Callback Routine

This section provides the definition of the(*callback_ptr)() function prototype.


long eeh_callback(
                 unsigned long long cmd, /* EEH messages */
                 void *arg,              /* Pointer to dd defined argument */
                 unsigned long flag)     /* DD defined flag */
  • cmd – contains a kernel and driver message
  • arg – is a cookie to a target device driver that is usually a pointer to the adapter structure
  • flag argument can be either just EEH_MASTER or EEH_MASTER ORed with EEH_DD_PIO_ENABLED
    EEH_MASTER
    Indicates that the target device driver is the EEH_MASTER.
    EEH_DD_PIO_ENABLED
    Set only with the EEH_DD_DEBUG message to indicate that the PIO is enabled.

When eeh_init_multifunc() is called, the callback routines are registered. When eeh_clear() is called the callback routines are unregistered. The callback routines are necessary for EEH kernel services recovery. They coordinate shared EEH domain driver instances. For more information on how this coordination is done, see Enhanced I/O Error Handling Kernel Services.

The shared EEH domain drivers are expected to handle the following EEH kernel services messages:
EEH_DD_SUSPEND
Notifies all the device drivers on a slot that an EEH kernel services event occurred. The slot is either frozen or temporarily unavailable. Because an EEH kernel services event occurred, the device drivers suspend operations. Then, the EEH_MASTER driver either enables PIO or resets the slot.
EEH_DD_DEBUG
Notifies all drivers on a slot that they can now gather debug data from the devices. The device drivers log errors by calling the eeh_slot_error() function and passing in the gathered debug data. This message is sent when the EEH_MASTER calls the eeh_enable_pio() function. On the callback routine, the flag argument is set to EEH_DD_PIO_ENABLED.
EEH_DD_DEAD
Notifies all drivers on a slot that the slot reached an unrecoverable state and the slot is no longer usable. This message is sent anytime EEH kernel services fail because of hardware or firmware problems. This message is also broadcast when a driver calls the eeh_slot_error() function with the flag set to EEH_RESET_PERM. The device drivers usually perform necessary cleanup and mark the adapter as permanently unavailable.
EEH_DD_RESUME
Notifies all drivers on a slot that the EEH kernel services event was recovered successfully and that the callback routines can now resume normal operation. This message is sent at the end of a successful toggle of reset line and optional bridge configuration (for example, the bridge on the adapter). The device drivers must usually re-initialize their adapters before normal operation can begin again.

The device drivers define their own messages based on the contents of the sys/eeh.h file.

The eeh_callback() functions are scheduled to start sequentially at INTIODONE priority. They are not started in any specific order. For more information, see eeh_broadcast.