The net_device Structure in Detail
The net_device structure is at the very core of the
network driver layer and deserves a complete description. At a first
reading, however, you can skip this section, because you don’t need a
thorough understanding of the structure to get started. This list
describes all the fields, but more to provide a reference than to be
memorized. The rest of this chapter briefly describes each field as
soon as it is used in the sample code, so you don’t need to keep
referring back to this section.
struct net_device can be conceptually divided into
two parts: visible and invisible. The visible part of the structure
is made up of the fields that can be explicitly assigned in static
net_device structures. All structures in
drivers/net/Space.c are initialized in this way,
without using the tagged syntax for structure initialization. The
remaining fields are used internally by the network code and usually
are not initialized at compilation time, not even by tagged
initialization. Some of the fields are accessed by drivers (for
example, the ones that are assigned at initialization time), while
some shouldn’t be touched.
The Visible Head
The first part of struct net_device is composed of
the following fields, in this order:
-
char name[IFNAMSIZ]; The name of the device. If the name contains a
%dformat string, the first available device name with the given base is used; assigned numbers start at zero.-
unsigned long rmem_end;,unsigned long rmem_start;,