7 typedef struct udi_init_s udi_init_t;
8 typedef struct udi_primary_init_s udi_primary_init_t;
9 typedef struct udi_secondary_init_s udi_secondary_init_t;
10 typedef struct udi_ops_init_s udi_ops_init_t;
11 typedef struct udi_cb_init_s udi_cb_init_t;
12 typedef struct udi_cb_select_s udi_cb_select_t;
13 typedef struct udi_gcb_init_s udi_gcb_init_t;
15 typedef struct udi_init_context_s udi_init_context_t;
16 typedef struct udi_limits_s udi_limits_t;
17 typedef struct udi_chan_context_s udi_chan_context_t;
18 typedef struct udi_child_chan_context_s udi_child_chan_context_t;
20 typedef void udi_op_t(void);
21 typedef udi_op_t * const udi_ops_vector_t;
24 * \brief UDI Initialisation Structure
26 * Defines how to initialise and use a UDI driver
31 * \brief Defines the primary region
32 * \note For secondary modules this must be NULL
34 udi_primary_init_t *primary_init_info;
37 * \brief Defines all secondary regions
38 * Pointer to a list (so, essentially an array) of ::udi_secondary_init_t
39 * It is terminated by an entry with ::udi_secondary_init_t.region_idx
41 * \note If NULL, it is to be treated as an empty list
43 udi_secondary_init_t *secondary_init_list;
46 * \brief Channel operations
47 * Pointer to a ::udi_ops_init_t.ops_idx == 0 terminated list that
48 * defines the channel opterations usage for each ops vector implemented
50 * \note Must contain at least one entry for each metalanguage used
52 udi_ops_init_t *ops_init_list;
55 * \brief Control Blocks
57 udi_cb_init_t *cb_init_list;
60 * \brief Generic Control Blocks
62 udi_gcb_init_t *gcb_init_list;
65 * \brief Overrides for control blocks
66 * Allows a control block to override the ammount of scratch space it
67 * gets for a specific ops vector.
69 udi_cb_select_t *cb_select_list;
74 * \name Flags for ::udi_primary_init_t.mgmt_op_flags
79 * \brief Tells the environment that this operation may take some time
80 * Used as a hint in scheduling tasks
82 #define UDI_OP_LONG_EXEC 0x01
89 * \brief Describes the Primary Region
90 * Tells the environment how to set up the driver's primary region.
92 struct udi_primary_init_s
95 * \brief Management Ops Vector
96 * Pointer to a list of functions for the Management Metalanguage
98 udi_mgmt_ops_t *mgmt_ops;
101 * \brief Flags for \a mgmt_ops
102 * Each entry in \a mgmt_ops is acommanied by an entry in this array.
103 * Each entry contains the flags that apply to the specified ops vector.
104 * \see UDI_OP_LONG_EXEC
106 const udi_ubit8_t *mgmt_op_flags;
109 * \brief Scratch space size
110 * Specifies the number of bytes to allocate for each control block
111 * passed by the environment.
112 * \note must not exceed ::UDI_MAX_SCRATCH
114 udi_size_t mgmt_scratch_requirement;
117 * \todo What is this?
119 udi_ubit8_t enumeration_attr_list_length;
122 * \brief Size in bytes to allocate to each instance of the primary
124 * Essentially the size of the driver's instance state
125 * \note Must be at least sizeof(udi_init_context_t) and not more
126 * than UDI_MIN_ALLOC_LIMIT
128 udi_size_t rdata_size;
131 * \brief Size in bytes to allocate for each call to ::udi_enumerate_req
132 * \note Must not exceed UDI_MIN_ALLOC_LIMIT
134 udi_size_t child_data_size;
137 * \brief Number of path handles for each parent bound to this driver
138 * \todo What the hell are path handles?
140 udi_ubit8_t per_parent_paths;
144 * \brief Tells the environment how to create a secondary region
146 struct udi_secondary_init_s
149 * \brief Region Index
150 * Non-zero driver-dependent index value that identifies the region
151 * \note This corresponds to a "region" declaration in the udiprops.txt
154 udi_index_t region_idx;
156 * \brief Number of bytes to allocate
158 * \note Again, must be between sizeof(udi_init_context_t) and
159 * UDI_MIN_ALLOC_LIMIT
161 udi_size_t rdata_size;
165 * \brief Defines channel endpoints (ways of communicating with the driver)
168 struct udi_ops_init_s
171 * \brief ops index number
172 * Used to uniquely this entry
173 * \note If this is zero, it marks the end of the list
177 * \brief Metalanguage Index
178 * Defines what metalanguage is used
180 udi_index_t meta_idx;
182 * \brief Metalanguage Operation
183 * Defines what metalanguage operation is used
185 udi_index_t meta_ops_num;
187 * \brief Size of the context area
188 * \note If non-zero, must be at least
190 udi_size_t chan_context_size;
192 * \brief Pointer to the operations
193 * Pointer to a <<meta>>_<<role>>_ops_t structure
195 udi_ops_vector_t *ops_vector;
197 * \brief Flags for each entry in \a ops_vector
199 //const udi_ubit8_t *op_flags;
203 * \brief Defines control blocks
204 * Much the same as ::udi_ops_init_t
209 udi_index_t meta_idx;
210 udi_index_t meta_cb_num;
211 udi_size_t scratch_requirement;
213 * \brief Size of inline memory
215 udi_size_t inline_size;
217 * \brief Layout of inline memory
219 udi_layout_t *inline_layout;
223 * \brief Overrides the scratch size for an operation
225 struct udi_cb_select_s
232 * \brief General Control Blocks
233 * These control blocks can only be used as general data storage, not
234 * for any channel operations.
236 struct udi_gcb_init_s
239 udi_size_t scratch_requirement;
246 * \brief Environement Imposed Limits
251 * \brief Maximum legal ammount of memory that can be allocated
253 udi_size_t max_legal_alloc;
256 * \brief Maximum ammount of guaranteed memory
258 udi_size_t max_safe_alloc;
260 * \brief Maximum size of the final string from ::udi_trace_write
263 udi_size_t max_trace_log_formatted_len;
265 * \brief Maximum legal size of an instanct attribute value
267 udi_size_t max_instance_attr_len;
269 * \brief Minumum time difference (in nanoseconds between unique values
270 * returned by ::udi_time_current
272 udi_ubit32_t min_curtime_res;
274 * \brief Minimum resolution of timers
275 * \see ::udi_timer_start_repeating, ::udi_timer_start
277 udi_ubit32_t min_timer_res;
281 * \brief Primary Region Context data
283 struct udi_init_context_s
285 udi_index_t region_idx;
290 * \brief Channel context data
292 struct udi_chan_context_s
295 * \brief Pointer to the driver instance's initial region data
301 * \brief Child Channel context
303 struct udi_child_chan_context_s
306 * \brief Pointer to the driver instance's initial region data
310 * \brief Some sort of unique ID number
312 udi_ubit32_t child_ID;