DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

udi_primary_init_t(3udi)


Primary region initialization structure

SYNOPSIS

#include <udi.h>

typedef const struct {

	udi_mgmt_ops_t *mgmt_ops;

	const udi_ubit8_t *mgmt_op_flags;

	udi_size_t mgmt_scratch_requirement;

	udi_ubit8_t enumeration_attr_list_length;

	udi_size_t rdata_size;

	udi_size_t child_data_size;

	udi_ubit8_t per_parent_paths;

} udi_primary_init_t;
 
/* Maximum Legal Scratch Requirement */
 
#define  UDI_MAX_SCRATCH				4000
 
/* Operation Flags */
 
#define UDI_OP_LONG_EXEC (1U<<0)

MEMBERS mgmt_ops is a pointer to an ops vector of driver entry points for the required Management Metalanguage channel operation routines. See Chapter 24, "Management Metalanguage" for details on Management Metalanguage and its channel operations.

mgmt_op_flags is a pointer to an array of flag values with a one-for-one correspondence between entries in the mgmt_op_flags array and entries in the mgmt_ops array. This array may be used to indicate characteristics of the implementation of the corresponding operation to the environment:

UDI_OP_LONG_EXEC - indicates to the environment that the corresponding operation will execute for an extended period of time (relative to normal operations within this driver). This is a hint to the environment and allows the environment to make implementation specific decisions when scheduling the driver to perform this operation.

mgmt_scratch_requirement specifies in bytes the driver's requirements for scratch area size in Management Metalanguage control blocks received over its management channel. The scratch size specified here must be the maximum of the driver's scratch size needs across the various control blocks in the Management Metalanguage. This value must not exceed UDI_MAX_SCRATCH (4000 bytes).

enumeration_attr_list_length is the number of elements of the udi_instance_attr_list_t array that the driver requires for attr_list in udi_enumerate_cb_t control blocks during udi_enumerate_req. This may be zero if the driver uses udi_enumerate_no_children for its udi_enumerate_req entry point routine.

rdata_size is the size, in bytes, of the region data area to be allocated for the primary region of each driver instance. rdata_size must be at least sizeof(udi_init_context_t) and must not exceed UDI_MIN_ALLOC_LIMIT (see udi_limits_t).

child_data_size is the size, in bytes, of child data to be allocated for each call to udi_enumerate_req. child_data_size must not exceed UDI_MIN_ALLOC_LIMIT.

per_parent_paths specifies the number of path handles that the environment should supply for each parent that is bound to this driver instance. The path handles are supplied to the driver in the udi_channel_event_cb_t control block for each UDI_CHANNEL_BOUND event.

DESCRIPTION The udi_primary_init_t structure contains information the environment needs to subsequently create a new primary region and associated management channel when each driver instance for this driver is instantiated. This structure is part of udi_init_info.

The primary region's region data area is a memory area that is rdata_size bytes in size. It contains a udi_init_context_t structure at the front of this data area. When the region is created the bytes following the init context structure will be initialized to zero. The driver must never free this memory; it will be freed automatically when the region is destroyed.

When the Management Agent in the environment creates a driver instance, it will automatically create a primary region according to the parameters provided in the udi_primary_init_t structure. A management channel will also be created and anchored to this region. The channel context for this channel will be set to point to the region's region data area.

The primary region's end of the management channel will be anchored using mgmt_ops as the ops vector and mgmt_scratch_requirement as the scratch size requirement for all Management Metalanguage control blocks.

Drivers may also request the creation of secondary regions within a driver instance, by using udi_secondary_init_t.

REFERENCES udi_init_info, udi_mgmt_ops_t, udi_init_context_t, udi_secondary_init_t, udi_instance_attr_list_t, udi_enumerate_cb_t, udi_enumerate_req, udi_limits_t


UDI Core Specification Contents