1.\" $OpenBSD: wb.4,v 1.7 2001/06/23 07:04:00 pjanzen Exp $ 2.\" 3.\" Copyright (c) 1997, 1998 4.\" Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by Bill Paul. 17.\" 4. Neither the name of the author nor the names of any co-contributors 18.\" may be used to endorse or promote products derived from this software 19.\" without specific prior written permission. 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND 22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24.\" ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD 25.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 31.\" THE POSSIBILITY OF SUCH DAMAGE. 32.\" 33.\" $FreeBSD: wb.4,v 1.2 1998/12/05 09:31:25 rnordier Exp $ 34.\" 35.Dd November 4, 1998 36.Dt WB 4 37.Os 38.Sh NAME 39.Nm wb 40.Nd Winbond W89C840F Fast Ethernet driver 41.Sh SYNOPSIS 42.Cd "wb* at pci? dev ? function ?" 43.Sh DESCRIPTION 44The 45.Nm 46driver provides support for PCI Ethernet adapters and embedded 47controllers based on the Winbond W89C840F Fast Ethernet controller chip. 48This includes the Trendware TE100-PCIE and various other cheap boards. 49The 840F should not be confused with the 940F, which is 50an NE2000 clone and only supports 10Mbps speeds. 51.Pp 52The Winbond controller uses bus master DMA and is designed to be 53a DEC "tulip" work-alike. 54It differs from the standard DEC design 55in several ways: the control and status registers are spaced 4 56bytes apart instead of 8, and the receive filter is programmed through 57registers rather than by downloading a special setup frame via 58the transmit DMA engine. 59Using an external PHY, the Winbond chip 60supports both 10 and 100Mbps speeds in either full or half duplex. 61.Pp 62The 63.Nm 64driver supports the following media types: 65.Pp 66.Bl -tag -width xxxxxxxxxxxxxxxxxxxx 67.It autoselect 68Enable autoselection of the media type and options. 69This is only supported if the PHY chip attached to the Winbond controller 70supports NWAY autonegotiation. 71The user can manually override 72the autoselected mode by adding media options to the appropriate 73.Pa /etc/hostname.wb%d 74file. 75.It 10baseT/UTP 76Set 10Mbps operation. 77The 78.Ar mediaopt 79option can also be used to select either 80.Ar full-duplex 81or 82.Ar half-duplex 83modes. 84.It 100baseTX 85Set 100Mbps (Fast Ethernet) operation. 86The 87.Ar mediaopt 88option can also be used to select either 89.Ar full-duplex 90or 91.Ar half-duplex 92modes. 93.El 94.Pp 95The 96.Nm 97driver supports the following media options: 98.Pp 99.Bl -tag -width xxxxxxxxxxxxxxxxxxxx 100.It full-duplex 101Force full duplex operation 102.It half-duplex 103Force half duplex operation. 104.El 105.Pp 106Note that the 100baseTX media type is only available if supported 107by the adapter. 108For more information on configuring this device, see 109.Xr ifconfig 8 . 110.Sh DIAGNOSTICS 111.Bl -diag 112.It "wb%d: couldn't map memory" 113A fatal initialization error has occurred. 114.It "wb%d: couldn't map interrupt" 115A fatal initialization error has occurred. 116.It "wb%d: watchdog timeout" 117The device has stopped responding to the network, or there is a problem with 118the network connection (cable). 119.It "wb%d: no memory for rx list" 120The driver failed to allocate an mbuf for the receiver ring. 121.It "wb%d: no memory for tx list" 122The driver failed to allocate an mbuf for the transmitter ring when 123allocating a pad buffer or collapsing an mbuf chain into a cluster. 124.It "wb%d: chip is in D3 power state -- setting to D0" 125This message applies only to adapters which support power management. 126Some operating systems place the controller in low power 127mode when shutting down, and some PCI BIOSes fail to bring the chip 128out of this state before configuring it. 129The controller loses all of its PCI configuration in the D3 state, so if the 130BIOS does not set it back to full power mode in time, it won't be able 131to configure it correctly. 132The driver tries to detect this condition and bring 133the adapter back to the D0 (full power) state, but this may not be 134enough to return the driver to a fully operational condition. 135If you see this message at boot time and the driver fails to attach 136the device as a network interface, you will have to perform second 137warm boot to have the device properly configured. 138.Pp 139Note that this condition only occurs when warm booting from another 140operating system. 141If you power down your system prior to booting 142.Ox , 143the card should be configured correctly. 144.El 145.Sh SEE ALSO 146.Xr arp 4 , 147.Xr netintro 4 , 148.Xr ifconfig 8 149.Sh HISTORY 150The 151.Nm 152device driver first appeared in 153.Fx 3.0 . 154.Ox 155support first appeared in 156.Ox 2.5 . 157.Sh AUTHORS 158The 159.Nm 160driver was written by 161.An Bill Paul Aq wpaul@ctr.columbia.edu . 162.Sh BUGS 163The Winbond chip seems to behave strangely in some cases when the 164link partner switches modes. 165If for example both sides are set to 10Mbps half-duplex, and the other end 166is changed to 100Mbps full-duplex, the Winbond's receiver suddenly starts 167writing trash all over the RX descriptors. 168The 169.Nm 170driver handles this by forcing a reset of both the controller 171chip and attached PHY. 172This is drastic, but it appears to be the only way to recover properly from 173this condition. 174