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_RCS_TCS_AF)) == 0) sc->cardout) { simple_unlock(&sc->el_softc_lock);

splx(s);

return INTR_NOT_SERVICED;

1

}

while ((status & (S_RCS_TCS_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);

}

2

1

2

Examines the status that the READ_STS macro returns.

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 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.

Implementing the Interrupt Section 13–3

Page 141
Image 141
Compaq AA-RNG2A-TE manual Reading the Interrupt Status, Processing Completed Receive and Transmit Operations