|
|
udi_ops_init_t(3udi)
Ops vector initialization structure
#include <udi.h>typedef void udi_op_t(void); typedef udi_op_t * const udi_ops_vector_t; typedef const struct { udi_index_t ops_idx; udi_index_t meta_idx; udi_index_t meta_ops_num; udi_size_t chan_context_size; udi_ops_vector_t *ops_vector; const udi_ubit8_t *op_flags; } udi_ops_init_t;MEMBERS ops_idx is a non-zero channel ops index number, assigned by the driver to uniquely identify this set of entry-point related properties for use in other initialization structures and service calls, or zero to terminate the ops_init_list list to which this structure belongs (see udi_init_info). If ops_idx is zero, all other members of this structure are ignored.
meta_idx is a non-zero metalanguage index number, assigned by the driver to uniquely identify a set of metalanguage related properties for a particular metalanguage.
meta_ops_num is a metalanguage-specific number, defined in the corresponding metalanguage specification, that uniquely identifies a type of ops vector with respect to other ops vector types in the same metalanguage.
chan_context_size is the size, in bytes, of a context area that will be automatically allocated, if non-zero, whenever this ops_idx is used to bind a child or parent instance to a driver instance or to bind a secondary region to the primary region for this driver. If non-zero, the value must be at least sizeof(udi_child_chan_context_t) for child bind channels or sizeof(udi_chan_context_t) for other bind channels and must not exceed UDI_MIN_ALLOC_LIMIT (see udi_limits_t).
ops_vector is a pointer to the metalanguage-specific <<meta>>_<<role>>_ops_t channel ops vector structure containing pointers to the various entry point routines for this type of channel. The structure pointed to by ops_vector must be a constant initialized variable. The address of this structure must be cast to (udi_ops_vector_t *) in order to be used as an initializer for ops_vector.
op_flags is a pointer to an array of flag values with a one-for-one correspondence between entries in the op_flags array and entries in the ops_vector array. This member is used in the same way as the mgmt_op_flags member of the udi_primary_init_t structure.
DESCRIPTION The udi_ops_init_t structure contains information the environment needs to subsequently create channel endpoints for a particular type of ops vector and control block usage. This structure is part of udi_init_info.
If non-zero, the ops_idx value must be unique with respect to all other udi_ops_init_t structures for the same driver (even for separate modules in a multi-module driver). Each module's udi_init_info for a particular metalanguage must include a set of udi_ops_init_t structures exactly matching the set of ops vectors used in that module.
If non-zero, the meta_idx value must match a meta_idx value from a "meta" declaration in the driver's static driver properties and must be unique with respect to all other meta_idx values for the same driver.
The meta_ops_num values in metalanguage definitions are typically named <<meta>>_<<role>>_OPS_NUM and each correspond to an ops vector type, typically named <<meta>>_<<role>>_ops_t. The ops_vector member must point to a constant initialized structure of this ops vector type.
When chan_context_size is non-zero and this ops_idx is used for a child, parent, or internal binding (as indicated by a matching "child_bind_ops", "parent_bind_ops", or "internal_bind_ops" declaration in the driver's static driver properties), a new context structure of this size is automatically allocated. For the parent's end of a parent-child bind channel, the new context structure will begin with a udi_child_chan_context_t; for all other channels it will begin with a udi_chan_context_t. The requested chan_context_size must be at least as large as the size of the appropriate header structure. Any remaining bytes will be initialized to zero.
chan_context_size is ignored for driver-spawned channels.
REFERENCES udi_init_info, udi_limits_t, udi_chan_context_t, udi_child_chan_context_t