
The second argument to the WRITE_CCR and the other write macros
specifies the data to be written to the device register in bus address
space. These write macros construct the second argument by referencing
the val variable. For the if_el driver, this data is typically one of the
device register offsets that is defined in the if_elreg.h file.
The read and write driver-specific macros call the mb( ) kernel routine
to perform a memory barrier. The mb( ) kernel routine ensures that
the read or write operation is issued before the CPU executes any
subsequent code. See Section 7.5 of the Tru64 UNIX
Writing Device
Drivers manual for more information about the mb( ) routine and
when to use it.
Table 1–1 provides information on the driver-specific macros.
Table 1–1: Driver-Specific Macros
Macro Description
READ_CCR and WRITE_CCR Read from and write to the 3Com 3C5x9 device’s
configuration control register.
READ_ACR and WRITE_ACR Read from and write to the 3Com 3C5x9 device’s
address control register.
WRITE_RCR
Write to the 3Com 3C5x9 device’s resource
configuration register.
WRITE_ECR
Write to the 3Com 3C5x9 device’s EEPROM command
register.
READ_EDR
Read from the 3Com 3C5x9 device’s EEPROM data
register.
WRITE_CMD
Write to the 3Com 3C5x9 device’s command port
registers.
READ_STS
Read from the 3Com 3C5x9 device’s I/O status register.
READ_DATA and
WRITE_DATA
Read from and write to the 3Com 3C5x9 device’s
receive data and transmit data registers.
READ_ND and WRITE_ND Read from and write to the 3Com 3C5x9 device’s
network diagnostic register.
READ_MD and WRITE_MD Read from and write to the 3Com 3C5x9 device’s media
type and status register.
READ_TXF and READ_RXF Read from the 3Com 3C5x9 device’s transmit and
receive FIFO registers.
WRITE_AD1, WRITE_AD2,
and WRITE_AD3
Set the LAN physical address for the 3Com 3C5x9
device.
READ_TXS and WRITE_TXS Read from and write to the 3Com 3C5x9 device’s
transmit status register.
Network Device Driver Environment 1–9