Device Suspend/Resume Processing
Device drivers suspend and resume device operations in response to the issuing of suspend/ resume (TDV_USPEND/ TDV_RESUME) events to the event handling function (eventfn). Suspend and resume events are issued only to physical devices.
TDV_USPEND: Suspend Device
evttyp = TDV_USPEND
evtinf = NULL (none)
Suspension processing takes place in the following steps.
(A) If there is a request being processed at the time, the device driver waits for it to complete, pauses it or aborts. Which of these options to take depends on the device driver implementation. However, since the suspension must be effected as quickly as possible, pause or abort should be chosen if completion of the request will take time. Suspend events can be issued only for physical devices, but the same processing is applied to all logical devices included in the physical device.
Pause: Processing is suspended, then continues after the device resumes operation.
Abort: Processing is aborted just as when the abort function (abortfn) is executed, and is not continued after the device resumes operation.
(B) New requests other than a resume event are not accepted.
© The device power is cut and other suspension processing is performed.
Abort should be avoided, if at all possible, because of its effects on applications. It should be used only in such cases as long input waits from a serial port, or when interruption would be difficult. Normally, it is best to wait for completion of a request or, if possible, to pause (suspension and resumption).
Requests arriving at the device driver in suspend state are made to wait until operation resumes after which acceptance processing is performed. If the request does not involve access to the device, however, or can otherwise be processed even during suspension, a request may be accepted without waiting for resumption.
TDV_RESUME: Resume Device
evttyp = TDV_RESUME
evtinf = NULL (none)
Resumption processing takes place as follows.
(A) The device power is turned back on, the device states are restored and other device resumption processing is performed.
(B) Paused processing is resumed.
© Request acceptance is resumed.

Comments
Click here to Post a Comment