DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

mditx_registerMT(D3mdi)


mditx_registerMT -- Multi-threaded interface registration routine for MP-aware drivers

Synopsis (Not in SVR5 version)

   #include <sys/mdi.h>
   

void mditx_registerMT( mditx_IFMT_t * txint, queue_t * q, mditx_GetResource_t get_txr, mditx_ProcessMsgMT_t process_msg, void * handle);

Description

The mditx_registerMT( ) function is the multi-threaded interface registration routine for MDI drivers. The caller provides pointers to the data and routines used by the mditx_interfaceMT( ) routine.

This routine should be called from the driver's open( ) routine.

Parameters

The parameters are defined as follows:

txint
pointer to an mditx_IFMT_t structure, which the driver declares as part of its per-device structure. This registration routine initializes this structure using the remaining parameters.

q
pointer to the driver's write queue

get_txr
pointer to a function with prototype:
   void * (*get_txr)(void * handle);
This routine is called with a single argument, handle (described below) to return a driver-specific resource used to transmit a single request. This resource is typically a transmit buffer or transmit buffer descriptor.

get_txr must ensure that any resource it returns is properly sequenced. For instance, if A's context calls get_txr, then B's context calls get_txr, the card transmits A's frame then B's frame, regardless of which order A's context and B's context happen to eventually call process_msg (see below). This can be accomplished by placing the resource in an ordered list.

get_txr must return NULL if no more transmit resources are available; a pointer to a valid resource otherwise.


process_msg
pointer to a function with prototype:
   void (*process_msg)(void * handle, void * txr, mblk_t * mp);
This routine is accepts three arguments: handle (described below), txr, the resource returned by get_txr, and mp, a pointer to the transmit request message. This routine commits the given message mp to the card. As mentioned above, frames are sent in the order in which their transmit resources were acquired (from get_txr), not the order in which they were committed (by process_msg). This ensures that frames are not inadvertently re-ordered.

handle
pointer to a device-specific data structure required by the driver to identify a particular device (usually the device-table pointer)

Context and synchronization

Blockable context.

Hardware applicability

All

Version applicability

mdi: 1

Differences between versions

This function is not supported in MDI on SVR5 systems. In DDI 8, use the mdi_tx_if_init(D3mdi) and related functions instead of mditx_registerMT( ).

Return values

None.

References

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