if_sf.c (61041) | if_sf.c (63090) |
---|---|
1/* 2 * Copyright (c) 1997, 1998, 1999 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, 1999 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/dev/sf/if_sf.c 61041 2000-05-28 16:13:43Z peter $ | 32 * $FreeBSD: head/sys/dev/sf/if_sf.c 63090 2000-07-13 22:54:34Z archie $ |
33 */ 34 35/* 36 * Adaptec AIC-6915 "Starfire" PCI fast ethernet driver for FreeBSD. 37 * Programming manual is available from: 38 * ftp.adaptec.com:/pub/BBS/userguides/aic6915_pg.pdf. 39 * 40 * Written by Bill Paul <wpaul@ctr.columbia.edu> --- 76 unchanged lines hidden (view full) --- 117#define SF_USEIOSPACE 118 119#include <pci/if_sfreg.h> 120 121MODULE_DEPEND(sf, miibus, 1, 1, 1); 122 123#ifndef lint 124static const char rcsid[] = | 33 */ 34 35/* 36 * Adaptec AIC-6915 "Starfire" PCI fast ethernet driver for FreeBSD. 37 * Programming manual is available from: 38 * ftp.adaptec.com:/pub/BBS/userguides/aic6915_pg.pdf. 39 * 40 * Written by Bill Paul <wpaul@ctr.columbia.edu> --- 76 unchanged lines hidden (view full) --- 117#define SF_USEIOSPACE 118 119#include <pci/if_sfreg.h> 120 121MODULE_DEPEND(sf, miibus, 1, 1, 1); 122 123#ifndef lint 124static const char rcsid[] = |
125 "$FreeBSD: head/sys/dev/sf/if_sf.c 61041 2000-05-28 16:13:43Z peter $"; | 125 "$FreeBSD: head/sys/dev/sf/if_sf.c 63090 2000-07-13 22:54:34Z archie $"; |
126#endif 127 128static struct sf_type sf_devs[] = { 129 { AD_VENDORID, AD_DEVICEID_STARFIRE, 130 "Adaptec AIC-6915 10/100BaseTX" }, 131 { 0, 0, NULL } 132}; 133 --- 690 unchanged lines hidden (view full) --- 824 ifp->if_output = ether_output; 825 ifp->if_start = sf_start; 826 ifp->if_watchdog = sf_watchdog; 827 ifp->if_init = sf_init; 828 ifp->if_baudrate = 10000000; 829 ifp->if_snd.ifq_maxlen = SF_TX_DLIST_CNT - 1; 830 831 /* | 126#endif 127 128static struct sf_type sf_devs[] = { 129 { AD_VENDORID, AD_DEVICEID_STARFIRE, 130 "Adaptec AIC-6915 10/100BaseTX" }, 131 { 0, 0, NULL } 132}; 133 --- 690 unchanged lines hidden (view full) --- 824 ifp->if_output = ether_output; 825 ifp->if_start = sf_start; 826 ifp->if_watchdog = sf_watchdog; 827 ifp->if_init = sf_init; 828 ifp->if_baudrate = 10000000; 829 ifp->if_snd.ifq_maxlen = SF_TX_DLIST_CNT - 1; 830 831 /* |
832 * Call MI attach routines. | 832 * Call MI attach routine. |
833 */ | 833 */ |
834 if_attach(ifp); 835 ether_ifattach(ifp); | 834 ether_ifattach(ifp, ETHER_BPF_SUPPORTED); |
836 | 835 |
837 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); 838 | |
839fail: 840 splx(s); 841 return(error); 842} 843 844static int sf_detach(dev) 845 device_t dev; 846{ 847 struct sf_softc *sc; 848 struct ifnet *ifp; 849 int s; 850 851 s = splimp(); 852 853 sc = device_get_softc(dev); 854 ifp = &sc->arpcom.ac_if; 855 | 836fail: 837 splx(s); 838 return(error); 839} 840 841static int sf_detach(dev) 842 device_t dev; 843{ 844 struct sf_softc *sc; 845 struct ifnet *ifp; 846 int s; 847 848 s = splimp(); 849 850 sc = device_get_softc(dev); 851 ifp = &sc->arpcom.ac_if; 852 |
856 if_detach(ifp); | 853 ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); |
857 sf_stop(sc); 858 859 bus_generic_detach(dev); 860 device_delete_child(dev, sc->sf_miibus); 861 862 bus_teardown_intr(dev, sc->sf_irq, sc->sf_intrhand); 863 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sf_irq); 864 bus_release_resource(dev, SF_RES, SF_RID, sc->sf_res); --- 619 unchanged lines hidden --- | 854 sf_stop(sc); 855 856 bus_generic_detach(dev); 857 device_delete_child(dev, sc->sf_miibus); 858 859 bus_teardown_intr(dev, sc->sf_irq, sc->sf_intrhand); 860 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sf_irq); 861 bus_release_resource(dev, SF_RES, SF_RID, sc->sf_res); --- 619 unchanged lines hidden --- |