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