HDK Technical Reference

Entry-point routines

Entry-point routines form the backbone of any driver code. They are called, as needed, in response to system calls or other requirements. The kernel accesses them through structures that store the memory address where the routine starts. Different structures are used for different driver versions and device types.

Entry-point routines for the major interfaces are documented in the following manual page sections:

Other D2* sections are provided for other interfaces.

DDI 8 entry points

Beginning with DDI version 8, SVR5 drivers do not use the named entry point scheme that is discussed below. Instead, entry points are declared in a drvops(D4) vector which is pointed to by the driver's drvinfo(D4) structure and registered with a call to the drv_attach(D3) function at runtime.

DDI 8 introduces new required entry point routines and obsoletes some entry point routines that were required in earlier DDI versions. See Intro(D2), Intro(D2mdi), Intro(D2sdi), and Intro(D2str) for detailed comparisons of the entry point sets for different versions. See ``Driver structure'' for an overview of how the entry point routines for the structure of a kernel driver.

Named entry points

DDI versions before version 8 as well as SCO OpenServer 5 and most other UNIX operating systems use the named entry point scheme to access a driver's entry point routines. This means that the kernel accesses these routines based on their names being in a particular format: the driver prefix(D1) followed by the standard routine name such as open, close, intr. For example, if the driver prefix is xx, it will contain entry point routines named xxopen( ), xxclose( ), xxintr( ), and so forth. These named entry-point routines are accessed through switch tables.

Named entry point routines must be defined as global symbols. Named entry points for DDI drivers are declared in the driver's Master(DSP/4dsp) file, with declared values such as $entry open, $entry close, $entry ioctl, and so forth. ODDI drivers on SCO OpenServer 5 identify their named entry point routines using a character code given in the mdevice(F) file.

STREAMS entry points

STREAMS drivers (including MDI) never use a named entry point scheme. Instead, the entry points are defined in the driver's streamtab(D4str) and qinit(D4str) structures.

For DDI 8 and later SVR5 drivers, the drvinfo structure includes a pointer to the driver's streamtab struture.

SDI entry points

DDI 8 drivers use the drvops(D4) structure that is attached with drv_attach(D3) to identify generic DDI entry points such as config(D2sdi). They also call the sdi_register(D3sdi) function and pass an hba_info(D4sdi) structure which points to additional SDI-specific operations, including the special SDI versions of open( ), close( ), and ioctl( ) that are used in HBA drivers to support the SDI passthrough feature.

DDI 7 and earlier HBA drivers do not use any of the standard DDI entry points that are accessed through the switch tables, so all their entry points are declared in the hba_info(D4sdi) structure which is attached with the sdi_register(D3sdi) function.

SDI target and layered drivers do not use any specialized entry point routines so all their entry points are declared and registered using the DDI conventions. ( )

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