udi_devmgmt_req(3udi)
Device Management request
#include <udi.h>void udi_devmgmt_req ( udi_mgmt_cb_t *cb, udi_ubit8_t mgmt_op, udi_ubit8_t parent_ID ); /* Values for mgmt_op */#define UDI_DMGMT_PREPARE_TO_SUSPEND 1 #define UDI_DMGMT_SUSPEND 2 #define UDI_DMGMT_SHUTDOWN 3 #define UDI_DMGMT_PARENT_SUSPENDED 4 #define UDI_DMGMT_RESUME 5 #define UDI_DMGMT_UNBIND 6ARGUMENTS cb is a pointer to a miscellaneous Management Metalanguage control block.
mgmt_op is a value that selects the operation type.
parent_ID is the parent ID that indicates the parent for which the operation is to take place. This will match the value originally supplied by the MA when the parent was bound to the current driver via the udi_channel_event_ind operation of type UDI_CHANNEL_BOUND.
TARGET CHANNEL The Management Agent's management channel to the parent driver.
DESCRIPTION The Management Agent issues this request to manage I/O transfers within a driver instance during hot plug operations.
The mgmt_op argument must be one of the following values and indicates the type of management operation being requested:
UDI_DMGMT_PREPARE_TO_SUSPEND - Indicates that a Suspend operation is about to take place relative to the indicated parent.
UDI_DMGMT_SUSPEND - Requests the instance to suspend all operation relative to the indicated parent, and queue or fail new requests that are received. The instance must not acknowledge the request until all outstanding requests to the indicated parent are complete. The device must be put in a state that is prepared for the possibility of having power removed (for example, disk caches must be flushed), but device state and communications connections should not be completely shut down.
UDI_DMGMT_SHUTDOWN - Treated as UDI_DMGMT_SUSPEND, with the addition that the device must be completely shut down (in particular, all communications connections should be terminated).
UDI_DMGMT_PARENT_SUSPENDED - Indicates that outbound traffic via the indicated parent has been suspended.
UDI_DMGMT_RESUME - Indicates that the instance is to cancel any suspended or throttled state and is to resume full operation. I/O shall resume onto the then-active set of parents; if a multi-parent driver has parent-specific routing requirements, it must compare parent_ID against the set of currently-bound parents and fail if that parent is no longer (re-)bound.
UDI_DMGMT_UNBIND - Indicates that the driver must unbind from the indicated parent. The driver must first complete a metalanguage-specific unbind sequence with its parent and free resources related to that parent (it may choose to defer freeing some resources until it receives a udi_final_cleanup_req). As much as possible, the device should be shut down, as if it might be removed or powered off after this operation completes if this is the last parent. Communications connections should be terminated. Storage device write-back caches should be flushed to permanent storage, for example. When the unbinding is complete (and not before), the driver must respond to the UDI_DMGMT_UNBIND request with a corresponding udi_devmgmt_ack.