Uniform Driver Interface: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
Added more realistic configuration file and udi_cb_t definition
Line 65:
Below you can see a sample udiprops.txt:
 
properties_version 0x101
# You will want to state the driver requirements. While "requires udi"
# always needs to be present, the others may be omitted, depending on
# the driver.
message 1 Project UDI
requires udi 0x101 # Unfortunately 0x101 is the only version
message 2 http://www.project-UDI.org/participants.html
requires udi_bridge 0x101 # of the spec that can be implemented
message 3 Pseudo-Driver
message 4 Generic UDI Pseudo-Driver
release 3 1.01
supplier 1
# The ones below should be self-explanatory.
contact 2
name 3
shortname pseudod
##
module example
## Interface dependencies
##
requires udi 0x101
requires udi_gio 0x101
##
## Build instructions.
##
module examplepseudod
compile_options -DCMOS_BRIDGE_METADPSEUDO_GIO_META=1
source_files udi_examplepseudo.c pseudo.h
region 0
##
# The two statements below are used for building only and may be omitted
## Metalanguage usage
# from binary distributions as they serve no purpose.
##
meta 1 udi_gio # Generic I/O Metalanguage
compile_options -DCMOS_BRIDGE_META=1
source_files udi_example.c
child_bind_ops 1 0 1 # GIO meta, primary region, ops_index 1
meta 1 udi_bridge # Using the Bus Bridge Metalanguage
# Orphan driver; no device line
#
# Initialization, shutdown messages
#
message 1100 pseudod: devmgmt_req %d
message 1500 pseudod: final_cleanup_req
 
Of course, udiprops.txt can be a lot more complex than this, I only wanted you to see what itone looks like. You should check the specification for all compile options, statements and configuration options.
 
==Data objects==
Line 102 ⟶ 126:
 
Each control block may own a scratch space which is driver-specific and must be preserved across asynchronous and service calls. The driver can change the size for its control blocks' scratch spaces and if any of these are zero in size, their pointers must not be dereferenced.
 
<source lang="c">
typedef struct {
udi_channel_t channel;
void *context;
void *scratch;
void *initiator_context;
udi_origin_t origin;
} udi_cb_t;
</source>
 
==Initial state==