DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
UDI driver coding basics

pseudod.c region data structure

The pseudod driver's region data structure contains more data than the udi_cmos driver's region data structure, to manage simulating reads and writes on a device.

pseudod.c sample code (cont.)


NOTE: pseudo_region_data_t is defined in the pseudod.h header file.

   /*
    * Region data
    */
   #define PSEUDO_BUF_SZ 1024
   typedef struct pseudo_region_data {
   	udi_init_context_t init_context;
   	test_state_t testmode;
   	udi_ubit32_t testcounter;
   	udi_ubit8_t rx_queue[PSEUDO_BUF_SZ];	/* A 'holding' place for
   					 * writes
   					 */
   	udi_ubit8_t * tx_queue;		/* The test pattern we
   					 * generate to fulfill reads.
   					 * points to a movable mem blk.
   					 */
   	udi_bus_bind_cb_t *bus_bind_cb;
   	udi_xfer_constraints_t xfer_constraints;	/* xfer constraints */
   } pseudo_region_data_t;


init_context
See ``init_context''.

testcounter
This element is used to count the test data read in the pseudo_gio_do_read GIO channel operation (see ``pseudod child channel operations'').

rx_queue

tx_queue
These elements are used in various channel operations to simulate real data reads and writes.

bus_bind_cb
See ``bus_bind_cb''.

xfer_constraints
The udi_xfer_constraints_t(3udi) structure is used to describe the ``transfer constraints'' for a specific channel operation. These transfer constraints are passed to a child via a metalanguage-specific bind acknowledgement channel operation to communicate the transfer requirements to the child. The transfer constraints information determines how to divide requests into appropriate individual control blocks and buffers for handling by the parent driver. The pseudod driver uses defines and passes transfer constraints to the GIO Mapper via pseudo_gio_bind_req, the acknowledgemenmt routine for the GIO bind channel operation (see ``pseudod child channel operations'').

Next topic: Scratch space, offsets, and requirements
Previous topic: trans_read/trans_write

© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - 19 June 2005