Setting Up The Media - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

header length is the size of the ether_header data structure plus 8
(the size of the maximum LLC header).
The media headers are represented by the following data structures:
ether_header
fddi_header
trn_header

6.3 Setting Up the Media

The following code shows how the el_attach( ) routine sets up
media-related information:
sc->is_ac.ac_bcastaddr = (u_char *)etherbroadcastaddr;
sc->is_ac.ac_arphrd = ARPHRD_ETHER;
ifp->if_mtu = ETHERMTU;
ifp->if_mediamtu = ETHERMTU;
ifp->if_type = IFT_ETHER;
((struct arpcom *)ifp)->ac_flag = 0;
sin = (struct sockaddr_in *)&ifp->if_addr;
sin->sin_family = AF_INET;
Sets the ac_bcastaddr member of the softc data structure for this
1
device to the Ethernet broadcast address. The system stores the
Ethernet broadcast address in the etherbroadcastaddr character
array. Tru64 UNIX defines the etherbroadcastaddr character array
in the if_ether.h file.
The name is_ac is an alternate name for the ess_ac member of the
ether_driver data structure. The ess_ac member is referred to as
the Ethernet common part and is actually an instance of the arpcom
data structure.
Sets the ac_arphrd member of the softc data structure for this
2
device to the constant ARPHRD_ETHER, which represents the Ethernet
hardware address. The if_arp.h file defines this constant.
For the Token Ring interface, set the ac_arphrd member to the
constant ARPHRD_802. The if_arp.h file also defines this constant.
For the FDDI interface, set the ac_arphrd member to the constant
ARPHRD_ETHER, which represents the Ethernet hardware address. See
RFC 826 for more details.
The media header structure for Ethernet-related
media. The if_ether.h file defines the
ether_header structure.
The media header structure for FDDI-related
media. The if_fddi.h file defines the
fddi_header structure.
The media header structure for Token Ring-related
media. The if_trn.h file defines the
trn_header structure.
2
3
4
5
6
7
8
Implementing the Autoconfiguration Support Section (attach) 6–3
1

Advertisement

Table of Contents
loading

Table of Contents