SVR5 and SCO OpenServer
intr(D2mdi)
intr --
process an MDI device interrupt
Syntax
See
intr(D2)
for syntax,
context,
and general usage information
about this entry point routine in DDI drivers.
See
intr(D2oddi)
for syntax, context,
and general usage information
about this entry point routine in ODDI drivers.
Usage
The
intr( )
entry point routine is called
when the network adapter generates an interrupt.
It may also be called if another device
shares this interrupt vector with
the MDI driver.
It is extremely important that an MDI driver
spends a small amount of time in its interrupt handler
so that system performance is not adversely affected.
The
intr( )
routine can be called immediately after the
cm_intr_attach(D3)
or
mod_drvattach(D3)
routines.
The MDI driver should perform
the following processing:
-
Check whether the interrupt was generated
by the MDI device or another device that
shares this interrupt.
If the MDI device did not generate the interrupt,
return.
-
Filter out any frames
based on the destination MAC address.
The destination MAC address must be one of:
-
If this is a received frame interrupt,
allocate a single STREAMS message block
large enough to hold the received frame
-
Copy the frame from the adapter into the STREAMS block
-
Call the
putnext(D3str)
function to hand this message to the next module upstream
Additional processing can occur in the
intr( )
entry point routine
if the service from interrupt algorithm is implemented;
see
``Increasing transmit performance'' in Developing MDI network adapter drivers.
If the driver is used on a smart-bus system (that is,
PCI, EISA, or MCA),
your interrupt routine can be called if interrupts are shared
with another device. In this case, you must check all
of your devices using the interrupt to see if it is yours.
For DDI 7 drivers, when you find one instance of
your hardware at a particular
interrupt, be sure to keep searching; another instance of your
hardware may also be using that interrupt.
MDI drivers generally should not make use of
a STREAMS read
srv(D2str)
routine;
inbound frames should be passed up at interrupt time.
If a spurious interrupt occurs,
the MDI driver
should increment the count of spurious interrupts
in its statistics structure (see
mac_stats_eth(D4mdi),
mac_stats_fddi(D4mdi),
and
mac_stats_tr(D4mdi))
and exit from the interrupt routine as soon as possible.
Spurious interrupts occur when one of the following is true:
-
The driver has not been opened.
-
The driver has not been bound with the
MAC_BIND_REQ(D7mdi)
message type.
-
The interrupt was not expected
(in other words, the Interrupt Status Register did not
indicate that anything needed to be done)
To mask interrupts from the network adapter,
MDI drivers should use an appropriate
lock function
or the kernel function
splstr(D3).
Do not use
splhi, intr_disable,
or the 80?86 STI/CLI instructions.
Do not assume that all interrupts are in the range 0-15 or 0-31.
For example, interrupt numbers can be up to 255 on APIC
PCI machines. It is preferable to store the interrupt in
the per-device structure(s) and search them for interrupt
matches, rather than declaring a static array of interrupt
vectors.
Version applicability
mdi:
1, 2, 2.1 running with ddi: 7, 7mp, 8, 8mp.
References
intr(D2),
intr(D2oddi),
mdi_get_unit(D3mdi),
mdi_valid_mca(D3mdi),
Intro(MDI)
manual page on OpenServer 6 and the
Intro(7mdi)
manual page on UnixWare 7.1.4.
``MAC addresses'' in HDK Technical Reference,
``Spin locks (DDI)'' in HDK Technical Reference
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005