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

GIO metalanguage entry points

The Generic I/O (GIO) metalanguage is a generic pass-through metalanguage and can be used as a "top-side" metalanguage for drivers when a more specific metalanguage does not exist. The GIO metalanguage can also be used as an internal metalanguage between a multi-region driver's primary and secondary regions or between secondary regions.

The GIO metalanguage provides the ability to:

There are two roles to the GIO Metalanguage: the ``client'' and the ``provider''. Each region in a driver module can assume either of these roles independently of the other regions. When this metalanguage is used between drivers, the client is always a child of the provider. When used as an internal metalanguage, the client and provider are both in the same driver, but in different regions. Only clients can issue a bind request, and only providers can respond to a bind request.

GIO metalanguage entry points are defined in much the same way as Management metalanguage operations vectors (see ``Management metalanguage operations vector'').

The structure used for client-side operations is udi_gio_client_ops_t:

   typedef struct {
   	udi_channel_event_ind_op_t	*channel_event_ind_op ;
   	udi_gio_bind_ack_op_t		*gio_bind_ack_op ;
   	udi_gio_unbind_ack_op_t		*gio_unbind_ack_op ;
   	udi_gio_xfer_ack_op_t		*gio_xfer_ack_op ;
   	udi_gio_xfer_nak_op_t		*gio_xfer_nak_op ;
   	udi_gio_event_ind_op_t		*gio_event_ind_op ;
   } udi_gio_client_ops_t ;

The structure used for provider-side operations is udi_gio_provider_ops_t:

   typedef struct {
   	udi_channel_event_ind_op_t	*channel_event_ind_op ;
   	udi_gio_bind_req_op_t		*gio_bind_req_op ;
   	udi_gio_unbind_req_op_t		*gio_unbind_req_op ;
   	udi_gio_xfer_req_op_t		*gio_xfer_req_op ;
   	udi_gio_event_res_op_t		*gio_event_res_op ;
   } udi_gio_provider_ops_t ;

The udi_cmos and pseudod drivers both act solely as GIO providers. The structure names they define mirror the naming of the environment functions (as with the Management metalanguage definitions):

cmos_udi.c sample code (cont.)
   /*
    * Driver "top-side" entry points for the GIO Metalanguage.
    */
   

static udi_channel_event_ind_op_t cmos_child_channel_event; static udi_gio_bind_req_op_t cmos_gio_bind_req; static udi_gio_unbind_req_op_t cmos_gio_unbind_req; static udi_gio_xfer_req_op_t cmos_gio_xfer_req;

static udi_gio_provider_ops_t cmos_gio_provider_ops = { cmos_child_channel_event, cmos_gio_bind_req, cmos_gio_unbind_req, cmos_gio_xfer_req, udi_gio_event_res_unused };

pseudod.c sample code (cont.)
   /*
    * GIO/Pseudo Driver entry points
    */
   

static udi_channel_event_ind_op_t pseudo_gio_channel_event; static udi_gio_bind_req_op_t pseudo_gio_bind_req; static udi_gio_unbind_req_op_t pseudo_gio_unbind_req; static udi_gio_xfer_req_op_t pseudo_gio_xfer_req;

static udi_gio_provider_ops_t pseudo_gio_provider_ops = { pseudo_gio_channel_event, pseudo_gio_bind_req, pseudo_gio_unbind_req, pseudo_gio_xfer_req, udi_gio_event_res_unused };

The cmos_* and pseudo_* functions defined in the provider operations arrays shown above provide the driver-side entry points for handling the corresponding service calls coming from the environment.

For example, the cmos_child_channel_event and pseudo_gio_channel_event functions (defined later in the source code), are the driver-side entry points for the udi_gio_channel_event_ind service call, used by the environment to signal that a generic event has occurred on the other end of the channel. The driver side functions respond to the event appropriate and perform other necessary operations as required by the particular event.

The table below lists the environment side service calls to which the driver-side functions defined in the provider operations array respond.

udi_channel_event_ind Used by the environment to signal that a generic event has occurred on the other end of the channel. The type of event that has occurred, and additional parameters for the event, are contained in a udi_channel_event_cb_t control block passed as part of the service call. Both of the sample drivers are GIO providers, and so provide driver-side entry points cmos_child_channel_event and pseudo_gio_channel_event.
udi_gio_bind_req A GIO client uses this operation to request binding to a GIO provider and send a GIO bind control block (udi_gio_bind_cb_t) to the provider. The GIO provider function must send a corresponding udi_gio_bind_ack to the client before the client sends any further operations on the bind channel. The sample drivers provide cmos_gio_bind_req and pseudo_gio_bind_req entry points for this operation.
udi_gio_unbind_req A GIO client uses this operation to request unbinding from a GIO provider. and send a GIO bind control block (udi_gio_bind_cb_t) to the provider. The GIO provider function must send a corresponding udi_gio_unbind_req back to the client to complete the operation. The sample drivers provide cmos_gio_unbind_req and pseudo_gio_unbind_req entry points for this operation.
udi_gio_xfer_req A GIO client uses this operation to send a data transfer reuest to a GIO provider. A GIO transfer control block (udi_gio_xfer_cb_t) specifies the semantics and parameters for the request. The sample drivers are GIO providers, and so provide cmos_gio_xfer_req and pseudo_gio_xfer_req entry points for this operation.
udi_gio_event_res A GIO client uses this operation to acknowledge an event indication from a GIO provider, as delivered by a udi_gio_event_ind operation. The control block used must be the same udi_gio_event_cb_t control block passed to the driver in the corresponding udi_gio_event_ind operation. A proxy function, udi_gio_event_res_unused may be used as a GIO provider's udi_gio_event_res entry point if the provider never sends any event indications (and therefore expects no responses); this is the case with the sample drivers.

The specifics of the driver-side functions are discussed in the section ``Channel operations''.

The GIO environment service calls are described in detail in the section of the Core Specification. Also see udi_channel_event_ind(3udi).


Next topic: Primary region initialization
Previous topic: Bus bridge metalanguage entry points

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