if_rl.c (102335) | if_rl.c (103020) |
---|---|
1/* 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sys/pci/if_rl.c 102335 2002-08-23 23:49:02Z alfred $ | 32 * $FreeBSD: head/sys/pci/if_rl.c 103020 2002-09-06 16:38:06Z iwasaki $ |
33 */ 34 35/* 36 * RealTek 8129/8139 PCI NIC driver 37 * 38 * Supports several extremely cheap PCI 10/100 adapters based on 39 * the RealTek chipset. Datasheets can be obtained from 40 * www.realtek.com.tw. --- 85 unchanged lines hidden (view full) --- 126 * uniprocessor systems though. 127 */ 128#define RL_USEIOSPACE 129 130#include <pci/if_rlreg.h> 131 132#ifndef lint 133static const char rcsid[] = | 33 */ 34 35/* 36 * RealTek 8129/8139 PCI NIC driver 37 * 38 * Supports several extremely cheap PCI 10/100 adapters based on 39 * the RealTek chipset. Datasheets can be obtained from 40 * www.realtek.com.tw. --- 85 unchanged lines hidden (view full) --- 126 * uniprocessor systems though. 127 */ 128#define RL_USEIOSPACE 129 130#include <pci/if_rlreg.h> 131 132#ifndef lint 133static const char rcsid[] = |
134 "$FreeBSD: head/sys/pci/if_rl.c 102335 2002-08-23 23:49:02Z alfred $"; | 134 "$FreeBSD: head/sys/pci/if_rl.c 103020 2002-09-06 16:38:06Z iwasaki $"; |
135#endif 136 137/* 138 * Various supported device vendors/types and their names. 139 */ 140static struct rl_type rl_devs[] = { 141 { RT_VENDORID, RT_DEVICEID_8129, 142 "RealTek 8129 10/100BaseTX" }, --- 8 unchanged lines hidden (view full) --- 151 { ADDTRON_VENDORID, ADDTRON_DEVICEID_8139, 152 "Addtron Technolgy 8139 10/100BaseTX" }, 153 { DLINK_VENDORID, DLINK_DEVICEID_530TXPLUS, 154 "D-Link DFE-530TX+ 10/100BaseTX" }, 155 { DLINK_VENDORID, DLINK_DEVICEID_690TXD, 156 "D-Link DFE-690TXD 10/100BaseTX" }, 157 { NORTEL_VENDORID, ACCTON_DEVICEID_5030, 158 "Nortel Networks 10/100BaseTX" }, | 135#endif 136 137/* 138 * Various supported device vendors/types and their names. 139 */ 140static struct rl_type rl_devs[] = { 141 { RT_VENDORID, RT_DEVICEID_8129, 142 "RealTek 8129 10/100BaseTX" }, --- 8 unchanged lines hidden (view full) --- 151 { ADDTRON_VENDORID, ADDTRON_DEVICEID_8139, 152 "Addtron Technolgy 8139 10/100BaseTX" }, 153 { DLINK_VENDORID, DLINK_DEVICEID_530TXPLUS, 154 "D-Link DFE-530TX+ 10/100BaseTX" }, 155 { DLINK_VENDORID, DLINK_DEVICEID_690TXD, 156 "D-Link DFE-690TXD 10/100BaseTX" }, 157 { NORTEL_VENDORID, ACCTON_DEVICEID_5030, 158 "Nortel Networks 10/100BaseTX" }, |
159 { COREGA_VENDORID, COREGA_DEVICEID_CBTXD, 160 "Corega FEther CB-TXD" }, |
|
159 { 0, 0, NULL } 160}; 161 162static int rl_probe (device_t); 163static int rl_attach (device_t); 164static int rl_detach (device_t); 165 166static int rl_encap (struct rl_softc *, struct mbuf * ); --- 819 unchanged lines hidden (view full) --- 986 * Now read the exact device type from the EEPROM to find 987 * out if it's an 8129 or 8139. 988 */ 989 rl_read_eeprom(sc, (caddr_t)&rl_did, RL_EE_PCI_DID, 1, 0); 990 991 if (rl_did == RT_DEVICEID_8139 || rl_did == ACCTON_DEVICEID_5030 || 992 rl_did == DELTA_DEVICEID_8139 || rl_did == ADDTRON_DEVICEID_8139 || 993 rl_did == RT_DEVICEID_8138 || rl_did == DLINK_DEVICEID_530TXPLUS || | 161 { 0, 0, NULL } 162}; 163 164static int rl_probe (device_t); 165static int rl_attach (device_t); 166static int rl_detach (device_t); 167 168static int rl_encap (struct rl_softc *, struct mbuf * ); --- 819 unchanged lines hidden (view full) --- 988 * Now read the exact device type from the EEPROM to find 989 * out if it's an 8129 or 8139. 990 */ 991 rl_read_eeprom(sc, (caddr_t)&rl_did, RL_EE_PCI_DID, 1, 0); 992 993 if (rl_did == RT_DEVICEID_8139 || rl_did == ACCTON_DEVICEID_5030 || 994 rl_did == DELTA_DEVICEID_8139 || rl_did == ADDTRON_DEVICEID_8139 || 995 rl_did == RT_DEVICEID_8138 || rl_did == DLINK_DEVICEID_530TXPLUS || |
994 rl_did == DLINK_DEVICEID_690TXD) | 996 rl_did == DLINK_DEVICEID_690TXD || rl_did == COREGA_DEVICEID_CBTXD) |
995 sc->rl_type = RL_8139; 996 else if (rl_did == RT_DEVICEID_8129) 997 sc->rl_type = RL_8129; 998 else { 999 printf("rl%d: unknown device ID: %x\n", unit, rl_did); 1000 bus_teardown_intr(dev, sc->rl_irq, sc->rl_intrhand); 1001 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq); 1002 bus_release_resource(dev, RL_RES, RL_RID, sc->rl_res); --- 939 unchanged lines hidden --- | 997 sc->rl_type = RL_8139; 998 else if (rl_did == RT_DEVICEID_8129) 999 sc->rl_type = RL_8129; 1000 else { 1001 printf("rl%d: unknown device ID: %x\n", unit, rl_did); 1002 bus_teardown_intr(dev, sc->rl_irq, sc->rl_intrhand); 1003 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq); 1004 bus_release_resource(dev, RL_RES, RL_RID, sc->rl_res); --- 939 unchanged lines hidden --- |