Compaq AA-RNG2A-TE manual Setting the Debug Flag, Enabling TX and RX

Models: AA-RNG2A-TE

1 159
Download 159 pages 42.56 Kb
Page 109
Image 109

else {

lan_set_attribute(sc->ehm.current_val, NET_PROMISC_NDX, (void *)0);

}

WRITE_CMD(sc, CMD_FILTER+i);

7

1

2

3

4

5

6

7

If loopback mode is requested, enables it.

Sets the LAN loopback attribute for EHM support.

Selects to receive frames that are sent to both the local address and the broadcast address.

If the network device receives all multicast packets, selects all group addresses.

If the network device receives all packets destined to all stations, selects promiscuous mode.

Sets the LAN promiscuous mode attribute for EHM support.

Calls the WRITE_CMD macro to write data to the command port register. 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;

1

if (sc->debug) { 2 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);

}

1

2

Sets debug mode if the IFF_DEBUG bit is set.

If debugging mode is set, prints the transmit and receive first-in/first-out (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.

Implementing the Initialization Section 8–9

Page 109
Image 109
Compaq AA-RNG2A-TE manual Setting the Debug Flag, Enabling TX and RX