MDI driver initialization, configuration, and closing
Section D2mdi manual pages
lists the entry point routines
that can be used in an MDI driver
and describes special practices used for MDI.
The entry point routines used for
initialization, configuration, and closing
in an MDI driver are:
-
All SVR5 MDI drivers must be coded as
dynamically-loaded kernel modules
and so use the
_load(D2mdi)
entry point routine for initialization.
-
DDI 8 drivers must also include the
config(D2mdi)
entry point routine with
the CFG_ADD and CFG_REMOVE subfunctions coded.
MDI drivers should fully implement
the CFG_SUSPEND and CFG_RESUME subfunctions;
at a minimum, they must code the
CFG_SUSPEND subfunction
to turn off interrupts
if the driver is used on a bus architecture
that supports shared interrupts,
such as PCI.
Other subfunctions can be coded as required.
-
DDI 7 and SCO OpenServer 5 MDI drivers
must implement a
halt(D2mdi)
routine to disable interrupts
for adapters that may support shared interrupts
such as PCI.
-
DDI 8 ISA devices must also code
the CFG_VERIFY subfunction to the
config(D2mdi)
entry point routine.
Drivers written for DDI versions prior to version 8
use the
_verify(D2mdi)
entry point routine for this purpose.
mdi_AT_verify(D3mdi)
is available to SVR5 drivers
that support both DDI 8 and prior versions.
-
SCO OpenServer 5 MDI drivers
(MDI version 1)
code all initialization functionality in their
init(D2)
entry point routines.
This includes all functionality that is coded into DDI drivers'
_load( ),
config( ),
and
_verify( )
routines.
-
MDI drivers must display configuration information
as part of their initialization.
DDI drivers do this by calling the
mdi_printcfg(D3mdi)
function in their
config(D2mdi)
entry point routines (DDI 8)
or
_load(D2mdi)
entry point routines (pre-DDI 8).
SCO OpenServer 5 ODDI drivers call the
printcfg(D3oddi)
function from their
init(D2mdi)
routines..
-
Initialization that is required
only when the driver is opened
can be coded in the driver's
open(D2mdi)
entry point routine.
MDI drivers are exclusive-open devices,
so MDI drivers must prevent multiple opens.
-
The
_unload(D2mdi)
entry point routine
defines actions to be taken
when the driver is unloaded from the kernel.
All resources that are allocated in the driver's
_load(D2mdi)
entry point routine
must be freed in the driver's
_unload( )
entry point routine.
The
_unload( )
routine must also cancel pending callouts such as
itimeout(D3)
and
bufcall(D3str)
and free memory and locks that were allocated in the
_load( )
entry point routine.
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005