3.15 Defining a Copy of the w3_eeprom Data Structure
The
w3_eeprom
data structure copy in the
if_el
driver’s
el_softc
data structure consists of information about the hardware-specific
w3_eeprom
data structure. The following code shows the declaration of this
device-specific data structure. If your device has an EEPROM, you might
want to save some or all of its contents in your
softc
data structure.
struct w3_eeprom eeprom;
1
1
Declares a copy of the
w3_eeprom
data structure and calls it
eeprom
.
3.16 Declaring the Simple Lock Data Structure
A network driver’s
softc
data structure contains the declaration of a
simple lock data structure. The
if_el
driver uses a simple lock to protect
the data integrity of the
el_softc
data structure on multiprocessor
systems. It also guarantees the sequence of register accesses that a CPU in
a multiprocessor system makes to the adapter. See Writing Kernel Modules
for more information about locking in an SMP environment.
The following code shows the declaration of the simple lock data structure
in the
if_el
driver’s
el_softc
data structure:
decl_simple_lock_data(, el_softc_lock)
1
1
Uses the
decl_simple_lock_data( )
routine to declare a simple lock
data structure as a member of the
el_softc
data structure. The simple
lock data structure is called
el_softc_lock
.
3–10 Defining the softc Data Structure