Compaq AA-RNG2A-TE Network Card User Manual


 
2
Defining Device Register Offsets
The device register header file defines the device register offsets for the
device. The if_elreg.h file is the device register header file for the if_el
device driver. It defines the device register offsets for the 3Com 3C5x9 series
Ethernet adapter. Specifically, the if_elreg.h file contains the following
categories of device registers:
Interrupt and status register (Section 2.1)
Command port registers (Section 2.2)
Window 0 configuration registers (Section 2.3)
Window 3 configuration registers (Section 2.4)
Window 1 operational registers (Section 2.5)
Window 4 diagnostic registers (Section 2.6)
EEPROM data structure definition (Section 2.7)
Your network device might have different device registers. However, this
device register header file can serve as an example of how to set up device
register offset definitions. See your network device documentation to learn
about control and status registers for your device.
2.1 Interrupt and Status Register Offset Definitions
The following code shows the offset definitions for the interrupt and status
register. The if_el device driver reads these offsets from the interrupt
and status register. The CMD_ACKINT, CMD_SINTMASK, and CMD_ZINTMASK
commands either set or clear the bits.
#define STS_PORT 0xe 1
#define S_IL (1) 2
#define S_AF (1<<1) 3
#define S_TC (1<<2) 4
#define S_TA (1<<3) 5
#define S_RC (1<<4) 6
#define S_RE (1<<5) 7
#define S_IR (1<<6) 8
#define S_US (1<<7) 9
#define S_IP (1<<12) 10
#define CURWINDOW(x) ((x>>13)&0x7) 11
1 Defines the offset for the I/O port of the interrupt and status register.
This register can be set to one or more of the bit values.
Defining Device Register Offsets 21