1.\" Copyright (c) 1983, 1991 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" from: @(#)ec.4 6.7 (Berkeley) 3/27/91 33.\" $Id: ec.4,v 1.2 1993/08/01 07:36:24 mycroft Exp $ 34.\" 35.Dd March 27, 1991 36.Dt EC 4 vax 37.Os BSD 4.2 38.Sh NAME 39.Nm ec 40.Nd 3Com 10 Mb/s Ethernet interface 41.Sh SYNOPSIS 42.Cd "device ec0 at uba0 csr 161000 vector ecrint eccollide ecxint flags 0" 43.Sh DESCRIPTION 44The 45.Nm ec 46interface provides access to a 10 Mb/s Ethernet network through 47a 3com controller. 48.Pp 49The hardware has 32 kilobytes of dual-ported memory on the 50.Tn UNIBUS . 51This memory 52is used for internal buffering by the board, and the interface code reads 53the buffer contents directly through the 54.Tn UNIBUS . 55The address of this memory is given in the 56.Ar flags 57field 58in the configuration file. 59The first interface normally has its memory at Unibus address 0. 60.Pp 61Each of the host's network addresses 62is specified at boot time with an 63.Dv SIOCSIFADDR 64.Xr ioctl 2 . 65The 66.Nm ec 67interface employs the address resolution protocol described in 68.Xr arp 4 69to dynamically map between Internet and Ethernet addresses on the local 70network. 71.Pp 72The interface normally tries to use a 73.Dq trailer 74encapsulation 75to minimize copying data on input and output. 76The use of trailers is negotiated with 77.Tn ARP . 78This negotiation may be disabled, on a per-interface basis, 79by setting the 80.Dv IFF_NOTRAILERS 81flag with an 82.Dv SIOCSIFFLAGS 83.Xr ioctl . 84.Pp 85The interface software implements an exponential backoff algorithm 86when notified of a collision on the cable. This algorithm utilizes 87a 16-bit mask and the 88.Tn VAX-11 Ns 's 89interval timer in calculating a series 90of random backoff values. The algorithm is as follows: 91.Bl -enum -offset indent 92.It 93Initialize the mask to be all 1's. 94.It 95If the mask is zero, 16 retries have been made and we give 96up. 97.It 98Shift the mask left one bit and formulate a backoff by 99masking the interval timer with the smaller of the complement of this mask 100and a 5-bit mask, resulting in a pseudo-random number between 0 and 31. 101This produces the number of slot times to delay, 102where a slot is 51 microseconds. 103.It 104Use the value calculated in step 3 to delay before retransmitting 105the packet. 106The delay is done in a software busy loop. 107.El 108.Sh DIAGNOSTICS 109.Bl -diag 110.It ec%d: send error. 111After 16 retransmissions using the 112exponential backoff algorithm described above, the packet 113was dropped. 114.Pp 115.It ec%d: input error (offset=%d). 116The hardware indicated an error 117in reading a packet off the cable or an illegally sized packet. 118The buffer offset value is printed for debugging purposes. 119.Pp 120.It ec%d: can't handle af%d. 121The interface was handed 122a message with addresses formatted in an unsuitable address 123family; the packet was dropped. 124.El 125.Sh SEE ALSO 126.Xr netintro 4 , 127.Xr inet 4 , 128.Xr arp 4 129.Sh HISTORY 130The 131.Nm 132driver appeared in 133.Bx 4.2 . 134.Sh BUGS 135The hardware is not capable of talking to itself. The software 136implements local sending and broadcast by sending such packets to the 137loop interface. This is a kludge. 138.Pp 139Backoff delays are done in a software busy loop. This can degrade the 140system if the network experiences frequent collisions. 141