Defining Fifo Maintenance Information; Defining Bus-Specific Information - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

access a CSR directly. The driver-specific macros handle the read and write
operations that are made on these device registers.
The following code shows the declarations of the CSR addresses in the if_el
device driver's el_softc data structure. Make sure that the CSR pointer
information part of your softc data structure has similar declarations.
io_handle_t regE;
io_handle_t regC;
io_handle_t regA;
io_handle_t reg8;
io_handle_t reg6;
io_handle_t reg4;
io_handle_t reg2;
io_handle_t reg0;
io_handle_t data;
Declares the CSR addresses for the if_el driver. These addresses are
1
computed during the probe( ) routine by adding the specified offset
(0xE, 0xC, 0xA, and so forth) to the base address.

3.8 Defining FIFO Maintenance Information

The first-in/first-out (FIFO) maintenance information in the if_el driver's
el_softc data structure consists of a variable that stores a value that
the device keeps on board. The following code shows its declaration. This
information is hardware-specific, so you can omit it from your network
device driver's softc data structure.
unsigned long

3.9 Defining Bus-Specific Information

The bus-specific information in a network driver's softc data structure
consists of information about the bus or buses on which the driver operates.
The if_el driver operates on the PCMCIA and ISA buses, so that the
information in this section reflects these buses.
The following code shows the bus-specific declarations in the if_el device
driver's el_softc data structure. The bus-specific information that is
described here may not apply to your network device driver. However, the
declarations do give you an idea of some of the information that a network
driver needs to keep when operating on the PCMCIA and ISA buses.
int
irq;
int
iobase;
int
isa_tag;
int
cardout;
int
reprobe;
int
ispcmcia;
struct
card_info *cinfop;
Contains the interrupt request (IRQ) to use.
1
1
txfree;
1
2
3
4
5
6
7
Defining the softc Data Structure 3–7

Advertisement

Table of Contents
loading

Table of Contents