This appendix contains the following information for developers of Token Ring drivers for Digital UNIX:
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:
#
doconfig -c HOST1
*** 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 ***
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.
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.
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, Digital recommends that you 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.
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.