Implementing The El_Tint Routine; Counting The Transmit Interrupt; Reading The Transmit Status And Counting All Significant Events - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

if ((sc->debug) && (count <= 0))
printf("el%d: Receive in INFINITE loop %04X\n", ifp->if_unit, status);
}
Calls the WRITE_CMD macro to write data to the command port register.
1
The data to be written is the receive discard top packet command
(CMD_RXDTP).

13.3 Implementing the el_tint Routine

The if_el device driver's el_tint( ) routine is the transmit interrupt
completion routine. It performs the following tasks:
Counts the transmit interrupt (Section 13.3.1)
Reads the transmit status and counts all significant events
(Section 13.3.2)
Manages excessive data collisions (Section 13.3.3)
Writes to the status register to obtain the next value (Section 13.3.4)
Queues other transmits (Section 13.3.5)

13.3.1 Counting the Transmit Interrupt

The following code shows how the el_tint( ) routine counts the transmit
interrupt:
#define TXLOOP ((16*1024)/64)
static void el_tint(struct el_softc *sc,
struct ifnet *ifp)
{
int count=TXLOOP;
volatile unsigned int status;
sc->tint++;
1
Increments a counter of the number of the transmit interrupts that
1
have been processed.
13.3.2 Reading the Transmit Status and Counting All Significant
Events
The following code shows how the el_tint( ) routine reads the transmit
status and counts all significant events:
status = READ_TXS(sc);
while ((status & (TX_CM<<8)) && (count-- > 0)) {
if (status & ((TX_JB|TX_UN)<<8)) {
ifp->if_oerrors++;
sc->ctrblk.est_sendfail++;
sc->txreset++;
WRITE_TXS(sc, status);
13–10 Implementing the Interrupt Section
1
2
3

Advertisement

Table of Contents
loading

Table of Contents