Driver-Specific Macros - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

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
READ_CCR and WRITE_CCR Read from and write to the 3Com 3C5x9 device's
READ_ACR and WRITE_ACR Read from and write to the 3Com 3C5x9 device's
WRITE_RCR
WRITE_ECR
READ_EDR
WRITE_CMD
READ_STS
READ_DATA and
WRITE_DATA
READ_ND and WRITE_ND
READ_MD and WRITE_MD
READ_TXF and READ_RXF
WRITE_AD1, WRITE_AD2,
and WRITE_AD3
READ_TXS and WRITE_TXS Read from and write to the 3Com 3C5x9 device's
Description
configuration control register.
address control register.
Write to the 3Com 3C5x9 device's resource
configuration register.
Write to the 3Com 3C5x9 device's EEPROM command
register.
Read from the 3Com 3C5x9 device's EEPROM data
register.
Write to the 3Com 3C5x9 device's command port
registers.
Read from the 3Com 3C5x9 device's I/O status register.
Read from and write to the 3Com 3C5x9 device's
receive data and transmit data registers.
Read from and write to the 3Com 3C5x9 device's
network diagnostic register.
Read from and write to the 3Com 3C5x9 device's media
type and status register.
Read from the 3Com 3C5x9 device's transmit and
receive FIFO registers.
Set the LAN physical address for the 3Com 3C5x9
device.
transmit status register.
Network Device Driver Environment 1–9

Advertisement

Table of Contents
loading

Table of Contents