2 implementing the el_rint routine, 8 indicating that the interrupt was serviced – Compaq TRU64 AA-RNG2A-TE User Manual

Page 143

Advertising
background image

13.1.8 Indicating That the Interrupt Was Serviced

The following code shows how the el_intr( ) routine indicates that the
interrupt was serviced:

return INTR_SERVICED;

1

}

1

Returns the INTR_SERVICED constant to the kernel interrupt
dispatcher to indicate that el_intr( ) serviced the shared interrupt.

13.2 Implementing the el_rint Routine

The if_el driver’s el_rint( ) routine is the receive interrupt completion
routine. It performs the following tasks:

•

Counts the receive interrupt and reads the receive status (Section 13.2.1)

•

Pulls the packets from the FIFO buffer (Section 13.2.2)

•

Examines the first part of the packet (Section 13.2.3)

•

Copies the received packet into the mbuf (Section 13.2.4)

•

Discards a packet (Section 13.2.5)

13.2.1 Counting the Receive Interrupt and Reading the Receive

Status

The following code shows how the el_rint( ) routine counts the receive
interrupt and reads the receive status:

#define RXLOOP ((16*1024)/64)

1

static void el_rint(struct el_softc *sc,

struct ifnet *ifp)

{

int len, i, count=RXLOOP;

volatile short status;

struct mbuf *m;

unsigned char *dat;

unsigned int in;

struct ether_header eh;

sc->rint++;

2

status = READ_RXS(sc);

3

1

Defines a constant that represents the maximum number of packets in
a 16K receive buffer.

2

Increments the receive interrupt counter.

3

Calls the READ_RXS macro to read the receive status.

Implementing the Interrupt Section 13–5

Advertising