if_wb.c (61041) | if_wb.c (63090) |
---|---|
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_wb.c 61041 2000-05-28 16:13:43Z peter $ | 32 * $FreeBSD: head/sys/pci/if_wb.c 63090 2000-07-13 22:54:34Z archie $ |
33 */ 34 35/* 36 * Winbond fast ethernet PCI NIC driver 37 * 38 * Supports various cheap network adapters based on the Winbond W89C840F 39 * fast ethernet controller chip. This includes adapters manufactured by 40 * Winbond itself and some made by Linksys. --- 83 unchanged lines hidden (view full) --- 124#define WB_USEIOSPACE 125 126#include <pci/if_wbreg.h> 127 128MODULE_DEPEND(wb, miibus, 1, 1, 1); 129 130#ifndef lint 131static const char rcsid[] = | 33 */ 34 35/* 36 * Winbond fast ethernet PCI NIC driver 37 * 38 * Supports various cheap network adapters based on the Winbond W89C840F 39 * fast ethernet controller chip. This includes adapters manufactured by 40 * Winbond itself and some made by Linksys. --- 83 unchanged lines hidden (view full) --- 124#define WB_USEIOSPACE 125 126#include <pci/if_wbreg.h> 127 128MODULE_DEPEND(wb, miibus, 1, 1, 1); 129 130#ifndef lint 131static const char rcsid[] = |
132 "$FreeBSD: head/sys/pci/if_wb.c 61041 2000-05-28 16:13:43Z peter $"; | 132 "$FreeBSD: head/sys/pci/if_wb.c 63090 2000-07-13 22:54:34Z archie $"; |
133#endif 134 135/* 136 * Various supported device vendors/types and their names. 137 */ 138static struct wb_type wb_devs[] = { 139 { WB_VENDORID, WB_DEVICEID_840F, 140 "Winbond W89C840F 10/100BaseTX" }, --- 821 unchanged lines hidden (view full) --- 962 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->wb_irq); 963 bus_release_resource(dev, WB_RES, WB_RID, sc->wb_res); 964 free(sc->wb_ldata_ptr, M_DEVBUF); 965 error = ENXIO; 966 goto fail; 967 } 968 969 /* | 133#endif 134 135/* 136 * Various supported device vendors/types and their names. 137 */ 138static struct wb_type wb_devs[] = { 139 { WB_VENDORID, WB_DEVICEID_840F, 140 "Winbond W89C840F 10/100BaseTX" }, --- 821 unchanged lines hidden (view full) --- 962 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->wb_irq); 963 bus_release_resource(dev, WB_RES, WB_RID, sc->wb_res); 964 free(sc->wb_ldata_ptr, M_DEVBUF); 965 error = ENXIO; 966 goto fail; 967 } 968 969 /* |
970 * Call MI attach routines. | 970 * Call MI attach routine. |
971 */ | 971 */ |
972 if_attach(ifp); 973 ether_ifattach(ifp); | 972 ether_ifattach(ifp, ETHER_BPF_SUPPORTED); |
974 | 973 |
975 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); 976 | |
977fail: 978 if (error) 979 device_delete_child(dev, sc->wb_miibus); 980 splx(s); 981 982 return(error); 983} 984 --- 5 unchanged lines hidden (view full) --- 990 int s; 991 992 s = splimp(); 993 994 sc = device_get_softc(dev); 995 ifp = &sc->arpcom.ac_if; 996 997 wb_stop(sc); | 974fail: 975 if (error) 976 device_delete_child(dev, sc->wb_miibus); 977 splx(s); 978 979 return(error); 980} 981 --- 5 unchanged lines hidden (view full) --- 987 int s; 988 989 s = splimp(); 990 991 sc = device_get_softc(dev); 992 ifp = &sc->arpcom.ac_if; 993 994 wb_stop(sc); |
998 if_detach(ifp); | 995 ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); |
999 1000 /* Delete any miibus and phy devices attached to this interface */ 1001 bus_generic_detach(dev); 1002 device_delete_child(dev, sc->wb_miibus); 1003 1004 bus_teardown_intr(dev, sc->wb_irq, sc->wb_intrhand); 1005 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->wb_irq); 1006 bus_release_resource(dev, WB_RES, WB_RID, sc->wb_res); --- 883 unchanged lines hidden --- | 996 997 /* Delete any miibus and phy devices attached to this interface */ 998 bus_generic_detach(dev); 999 device_delete_child(dev, sc->wb_miibus); 1000 1001 bus_teardown_intr(dev, sc->wb_irq, sc->wb_intrhand); 1002 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->wb_irq); 1003 bus_release_resource(dev, WB_RES, WB_RID, sc->wb_res); --- 883 unchanged lines hidden --- |