Figure 3–2: Mapping Alternate Names
#define is_ac #define ztime #define ctrblk
ether_driver
.
.
.
ess_ac
ess_ztime
ess_ctrblk
.
.
.
arpcom
.
.
.
ac_if
ac_hwaddr
.
.
.
#define is_if
#define ac_enaddr
#define is_addr
3.2 Enabling Support for Enhanced Hardware Management
Enhanced hardware management (EHM) is a feature of Tru64 UNIX Version 5.0 that allows a system administrator to view, and possibly modify, various attributes of the hardware on either a local or a remote system.
To support this facility, device drivers and bus drivers must provide their specific, predefined attributes to a centralized management entity. Examples of these attributes for network drivers include the type of LAN device, its hardware address, the type of media it is attached to, and how fast it can operate. The LAN subsystem supplies access routines for defining and exporting these attributes.
To use these routines, a network driver must declare a net_hw_mgmt data structure as shown by the following code:
struct net_hw_mgmt ehm;
1
1
Declares a net_hw_mgmt data structure and calls it ehm.
3.3 Defining Media State Information
The media state information contained in a network driver’s softc data structure consists of information about the lan_media data structure. The following code shows the declaration and definition of the media state information in the if_el device driver’s el_softc data structure:
struct lan_media | lan_media; | 1 |
#define lm_media_mode lan_media.lan_media_mode #define lm_media_state lan_media.lan_media_state
#define lm_media | lan_media.lan_media | 4 |
2
3
1
2
Declares a lan_media data structure and calls it lan_media. The lan_media data structure contains media state values.
Defines an alternate name for referencing the lan_media_mode member of the lan_media data structure. The value that is stored in