SVR5 and SCO OpenServer
open(D2mdi)
open --
gain access to an MDI device
Syntax
See
open(D2)
and
open(D2str)
for syntax,
context,
and general usage information
about this entry point routine in DDI drivers.
See
open(D2str)
for syntax, context,
and general usage information
about this entry point routine in ODDI drivers.
NOTE:
Beginning with DDI 8,
the
open( )
entry point routine has the same syntax
for STREAMS-based and non-STREAMS drivers.
In earlier DDI versions
and for all ODDI versions,
the
open( )
routine has a different syntax for STREAMS drivers.
Usage
The
open( )
entry point routine is called when the
special device file for the MDI device
is opened.
This can take place at one of several points
during system startup,
depending on the configuration of the system:
-
When nd start is run.
-
When the /etc/rc2.d/S15nd script is run
as the system enters run level 2.
-
When the system enters multi-user mode (run-level 3)
from single-user mode.
-
When an application opens the MDI driver directly.
An MDI driver must perform the following in its
open( )
routine:
-
Completely reset and initialize the adapter
(even if it was done in the
_load(D2)
routine), because the hardware could have failed previously;
see
MAC_HWFAIL_IND(D7mdi).
-
Initialize all driver data structures to a known state, which includes:
-
Clear the multicast address table
-
Turn off promiscuous mode (if it was set)
This does not include:
-
clearing the statistics structure.
-
resetting the MAC address to the factory default value
if the MACIOC_SETADDR ioctl was used
to change the address.
This must be done so that users can recover from
hardware or driver problems
without having to reboot the entire system.
The
open( )
routine should fail if
the adapter did not successfully reset and initialize.
MDI drivers are single-open devices. Therefore, if a
device is currently open, this
open( )
should return EBUSY.
The driver's unit number(s), obtained with
mdi_get_unit(D3mdi)
in the driver's
_load(D2mdi)
routine, should be checked against the minor number (in DDI
7) or instance device number (in DDI 8). If there is
no match, this
open( )
should return ENODEV.
Other tasks that may be performed in an MDI driver's
open( )
routine include:
Multiple adapters should be supported
by the MDI driver.
One special device file
will be created in the /dev/mdi directory
for each adapter.
Version applicability
mdi:
1, 2, 2.1 running with ddi: 7, 7mp, 8, 8mp.
References
mdi_tx_if_init(D3mdi),
mdi_tx_if_enable(D3mdi),
mdi_get_unit(D3mdi),
open(D2),
open(D2str),
open(D2oddi),
Node(DSP/4dsp)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005