This appendix contains the following information for developers of Token Ring drivers for the Tru64 UNIX operating system:
Enabling source routing
Using canonical addresses
Avoiding unaligned access
Setting fields in the
softc
structure of
the driver
Source routing is a bridging mechanism that systems on a Token Ring local area network (LAN) use to send messages to a system on another interconnected Token Ring LAN. Under this mechanism, the system that is the source of a message uses a route discover process to determine the optimum route over Token Ring LANs and bridges to a destination system.
To use the Token Ring source routing module you must add the TRSRCF
option to your kernel configuration file.
Use the
doconfig -c
command to add the TRSRCF option, as follows:
Enter the
doconfig -c
HOSTNAME
command from the superuser prompt (#).
HOSTNAME
is the name of your system in uppercase letters; for
example, for a system called
host1
you would enter:
#
doconfig -c HOST1
Add TRSRCF to the options section of the kernel configuration file.
Enter
y
when the system asks whether you want to
edit the kernel configuration file.
The
doconfig
command
allows you to edit the configuration file with the
ed
editor.
For information about using the
ed
editor, see
ed
(1).
The following
ed
editing session shows how to add
the TRSRCF option to the kernel configuration file for
host1
.
The number of the line after which you append the new line can differ between
kernel configuration files:
*** KERNEL CONFIGURATION AND BUILD PROCEDURE ***
Saving /sys/conf/HOST1 as /sys/conf/HOST1.bck
Do you want to edit the configuration file? (y/n) [n]:
y
Using ed to edit the configuration file. Press return when ready,
or type 'quit' to skip the editing session:
2153
48a
options TRSRCF
.
1,$w
2185
q
*** PERFORMING KERNEL BUILD ***
After the new kernel is built, you must move it from the directory
where
doconfig
places it to the root directory (\/
) and reboot your system.
For detailed information on reconfiguring your kernel or the
doconfig
command see the
System Administration
manual.
The Token Ring source routing functionality is initialized if the
trn_units
variable is greater than or equal to 1.
The
trn_units
variable indicates the number of Token Ring adapters initialized
on the system.
The driver should declare
trn_units
as follows:
extern int trn_units;
At the end of its
attach
routine, the driver should increment the
trn_units
variable as follows:
trn_units++;
For information on source routing management see the
Network Administration
manual.
D.2 Using Canonical Addresses
The Token Ring driver requires that the destination address (DA) and source address (SA) in the Media Access Control (MAC) header be in the canonical form while presenting it to the layers above the driver.
The canonical form is also known as the Least Significant Bit (LSB) format. It differs from the noncanonical form, known as the Most Significant Bit (MSB) format, in that it transmits the LSB first. The noncanonical form transmits the MSB first. The two formats also differ in that the bit order within each octet is reversed.
For example, the following address is in noncanonical form:
10:00:d4:f0:22:c4
The same address in canonical form is as follows:
08-00-2b-0f-44-23
If the hardware does not present the driver with a canonical address
in the MAC header, you should convert the address to canonical form before
passing it up to the higher layers.
The
haddr_convert
kernel routine is available for converting canonical addresses to noncanonical,
and vice versa.
It has the following format:
haddr_convert(
addr)
unsigned char *addr
The
addr
variable is a pointer to the 6 bytes
of the address that require conversion from either noncanonical to canonical
or canonical to noncanonical form.
The converted address is returned in the
same buffer.
D.3 Avoiding Unaligned Access
The frame that the driver receives consists of the Media Access Control (MAC) header, which includes the Routing Information Field (RIF) and data. Because the length of the RIF can vary between 0 and 18 bytes, the data after the RIF may not be aligned to a longword boundary. To avoid degraded performance, you should pad the RIF field so that data always starts on a longword boundary.
Figure D-1
illustrates the relationship between
the components of the MAC header and the data in a typical frame.
Figure D-1: Typical Frame
D.4 Setting Fields in the softc Structure of the Driver
The
softc
structure contains driver-specific information.
You must set the following field of the
softc
structure
in the
attach
routine of the driver:
sc->isac.ac_arphrd=ARPHRD_802;
Here,
sc
is a pointer to the
softc
structure, and
ARPHRD_802
is the value of the hardware type used in an Address Resolution
Protocol (ARP) packet sent from this interface.
A value of 6 for
ARPHRD_802
indicates an IEEE 802 network.