if_rl.c (69127) | if_rl.c (69583) |
---|---|
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 69127 2000-11-24 17:36:07Z roger $ | 32 * $FreeBSD: head/sys/pci/if_rl.c 69583 2000-12-04 22:46:50Z wpaul $ |
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. --- 87 unchanged lines hidden (view full) --- 128 * uniprocessor systems though. 129 */ 130#define RL_USEIOSPACE 131 132#include <pci/if_rlreg.h> 133 134#ifndef lint 135static 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. --- 87 unchanged lines hidden (view full) --- 128 * uniprocessor systems though. 129 */ 130#define RL_USEIOSPACE 131 132#include <pci/if_rlreg.h> 133 134#ifndef lint 135static const char rcsid[] = |
136 "$FreeBSD: head/sys/pci/if_rl.c 69127 2000-11-24 17:36:07Z roger $"; | 136 "$FreeBSD: head/sys/pci/if_rl.c 69583 2000-12-04 22:46:50Z wpaul $"; |
137#endif 138 139/* 140 * Various supported device vendors/types and their names. 141 */ 142static struct rl_type rl_devs[] = { 143 { RT_VENDORID, RT_DEVICEID_8129, 144 "RealTek 8129 10/100BaseTX" }, --- 652 unchanged lines hidden (view full) --- 797 struct ifnet *ifp; 798 u_int16_t rl_did = 0; 799 int unit, error = 0, rid; 800 801 sc = device_get_softc(dev); 802 unit = device_get_unit(dev); 803 bzero(sc, sizeof(struct rl_softc)); 804 | 137#endif 138 139/* 140 * Various supported device vendors/types and their names. 141 */ 142static struct rl_type rl_devs[] = { 143 { RT_VENDORID, RT_DEVICEID_8129, 144 "RealTek 8129 10/100BaseTX" }, --- 652 unchanged lines hidden (view full) --- 797 struct ifnet *ifp; 798 u_int16_t rl_did = 0; 799 int unit, error = 0, rid; 800 801 sc = device_get_softc(dev); 802 unit = device_get_unit(dev); 803 bzero(sc, sizeof(struct rl_softc)); 804 |
805 mtx_init(&sc->rl_mtx, device_get_nameunit(dev), MTX_DEF); 806 RL_LOCK(sc); 807 |
|
805 /* 806 * Handle power management nonsense. 807 */ 808 809 command = pci_read_config(dev, RL_PCI_CAPID, 4) & 0x000000FF; 810 if (command == 0x01) { 811 812 command = pci_read_config(dev, RL_PCI_PWRMGMTCTRL, 4); --- 81 unchanged lines hidden (view full) --- 894 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq); 895 bus_release_resource(dev, RL_RES, RL_RID, sc->rl_res); 896 printf("rl%d: couldn't set up irq\n", unit); 897 goto fail; 898 } 899 900 callout_handle_init(&sc->rl_stat_ch); 901 | 808 /* 809 * Handle power management nonsense. 810 */ 811 812 command = pci_read_config(dev, RL_PCI_CAPID, 4) & 0x000000FF; 813 if (command == 0x01) { 814 815 command = pci_read_config(dev, RL_PCI_PWRMGMTCTRL, 4); --- 81 unchanged lines hidden (view full) --- 897 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq); 898 bus_release_resource(dev, RL_RES, RL_RID, sc->rl_res); 899 printf("rl%d: couldn't set up irq\n", unit); 900 goto fail; 901 } 902 903 callout_handle_init(&sc->rl_stat_ch); 904 |
902 mtx_init(&sc->rl_mtx, device_get_nameunit(dev), MTX_DEF); 903 RL_LOCK(sc); 904 | |
905 /* Reset the adapter. */ 906 rl_reset(sc); 907 sc->rl_eecmd_read = RL_EECMD_READ_6BIT; 908 rl_read_eeprom(sc, (caddr_t)&rl_did, 0, 1, 0); 909 if (rl_did != 0x8129) 910 sc->rl_eecmd_read = RL_EECMD_READ_8BIT; 911 912 /* --- 777 unchanged lines hidden --- | 905 /* Reset the adapter. */ 906 rl_reset(sc); 907 sc->rl_eecmd_read = RL_EECMD_READ_6BIT; 908 rl_read_eeprom(sc, (caddr_t)&rl_did, 0, 1, 0); 909 if (rl_did != 0x8129) 910 sc->rl_eecmd_read = RL_EECMD_READ_8BIT; 911 912 /* --- 777 unchanged lines hidden --- |