Reading The Interrupt Status; Processing Completed Receive And Transmit Operations - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

13.1.3 Reading the Interrupt Status

The following code shows how the el_intr( ) routine uses the READ_STS
macro to read the interrupt status from the I/O status register:
status = READ_STS(sc);

13.1.4 Processing Completed Receive and Transmit Operations

The following code shows how the el_intr( ) routine processes the receive
and transmit rings:
if (((status & (S_RC|S_TC|S_AF)) == 0) || sc->cardout) {
simple_unlock(&sc->el_softc_lock);
splx(s);
return INTR_NOT_SERVICED;
}
while ((status & (S_RC|S_TC|S_AF)) && (!el_card_out(sc))) {
if (status & S_RC)
el_rint(sc, ifp);
if (status & S_TC)
el_tint(sc, ifp);
if (status & S_AF)
el_error(sc, ifp);
status = READ_STS(sc);
}
Examines the status that the READ_STS macro returns.
1
If the status variable does not have the receive complete (S_RC) bit,
the transmit complete (S_TC) bit, or the adapter failure (S_AF) bit set,
or if the PCMCIA card is out of the slot:
Calls the simple_unlock( ) routine to release the simple lock for
the resource that is associated with el_softc_lock.
Calls the splx( ) routine to reset the CPU priority to the level that
the s variable specifies.
Returns the constant INTR_NOT_SERVICED to the kernel interrupt
dispatcher. This constant indicates that this shared interrupt was
not for the if_el device.
While the status variable has the receive complete (S_RC) bit, the
2
transmit complete (S_TC) bit, or the adapter failure (S_AF) bit set, and
if the card has not been removed from the machine:
If the status variable has the S_RC bit set, calls the el_rint( )
routine to process the receive interrupt.
If the status variable has the S_TC bit set, calls the el_tint( )
routine to process the transmit interrupt.
1
2
Implementing the Interrupt Section 13–3

Advertisement

Table of Contents
loading

Table of Contents