Setting The Debug Flag; Enabling Tx And Rx - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

else {
lan_set_attribute(sc->ehm.current_val, NET_PROMISC_NDX, (void *)0);
}
WRITE_CMD(sc, CMD_FILTER+i);
If loopback mode is requested, enables it.
1
Sets the LAN loopback attribute for EHM support.
2
Selects to receive frames that are sent to both the local address and the
3
broadcast address.
If the network device receives all multicast packets, selects all group
4
addresses.
If the network device receives all packets destined to all stations, selects
5
promiscuous mode.
Sets the LAN promiscuous mode attribute for EHM support.
6
Calls the WRITE_CMD macro to write data to the command port register.
7
In this call, the data to be written is the set receive (RX) filter command
(CMD_FILTER) with the appropriate flags set.

8.2.11 Setting the Debug Flag

The following code shows how the el_init_locked( ) routine sets the
debug flag for turning on debugging on a running system. This task is
optional.
if (ifp->if_flags & IFF_DEBUG)
sc->debug++;
else
sc->debug = 0;
if (sc->debug) {
WRITE_CMD(sc, CMD_WINDOW3);
i = READ_TXF(sc);
printf("el%d: Transmit FIFO size == %d\n", unit, i);
i = READ_RXF(sc);
WRITE_CMD(sc, CMD_WINDOW1);
printf("el%d: Receive FIFO size == %d\n", unit, i);
}
Sets debug mode if the IFF_DEBUG bit is set.
1
If debugging mode is set, prints the transmit and receive first-in/first-out
2
(FIFO) sizes.

8.2.12 Enabling TX and RX

The following code shows how the el_init_locked( ) routine enables
transmit (TX) and receive (RX). Make sure that you perform similar
initialization tasks for the hardware device that your network driver
controls.
7
1
2
Implementing the Initialization Section 8–9

Advertisement

Table of Contents
loading

Table of Contents