if_ti.c (62793) | if_ti.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/ti/if_ti.c 62793 2000-07-08 00:14:12Z gallatin $ | 32 * $FreeBSD: head/sys/dev/ti/if_ti.c 63090 2000-07-13 22:54:34Z archie $ |
33 */ 34 35/* 36 * Alteon Networks Tigon PCI gigabit ethernet driver for FreeBSD. 37 * Manuals, sample driver and firmware source kits are available 38 * from http://www.alteon.com/support/openkits. 39 * 40 * Written by Bill Paul <wpaul@ctr.columbia.edu> --- 80 unchanged lines hidden (view full) --- 121#include <pci/if_tireg.h> 122#include <pci/ti_fw.h> 123#include <pci/ti_fw2.h> 124 125#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_IP_FRAGS) 126 127#if !defined(lint) 128static const char rcsid[] = | 33 */ 34 35/* 36 * Alteon Networks Tigon PCI gigabit ethernet driver for FreeBSD. 37 * Manuals, sample driver and firmware source kits are available 38 * from http://www.alteon.com/support/openkits. 39 * 40 * Written by Bill Paul <wpaul@ctr.columbia.edu> --- 80 unchanged lines hidden (view full) --- 121#include <pci/if_tireg.h> 122#include <pci/ti_fw.h> 123#include <pci/ti_fw2.h> 124 125#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_IP_FRAGS) 126 127#if !defined(lint) 128static const char rcsid[] = |
129 "$FreeBSD: head/sys/dev/ti/if_ti.c 62793 2000-07-08 00:14:12Z gallatin $"; | 129 "$FreeBSD: head/sys/dev/ti/if_ti.c 63090 2000-07-13 22:54:34Z archie $"; |
130#endif 131 132/* 133 * Various supported device vendors/types and their names. 134 */ 135 136static struct ti_type ti_devs[] = { 137 { ALT_VENDORID, ALT_DEVICEID_ACENIC, --- 1579 unchanged lines hidden (view full) --- 1717 ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_FX, 0, NULL); 1718 ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_FX|IFM_FDX, 0, NULL); 1719 ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_1000_SX, 0, NULL); 1720 ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_1000_SX|IFM_FDX, 0, NULL); 1721 ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL); 1722 ifmedia_set(&sc->ifmedia, IFM_ETHER|IFM_AUTO); 1723 1724 /* | 130#endif 131 132/* 133 * Various supported device vendors/types and their names. 134 */ 135 136static struct ti_type ti_devs[] = { 137 { ALT_VENDORID, ALT_DEVICEID_ACENIC, --- 1579 unchanged lines hidden (view full) --- 1717 ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_FX, 0, NULL); 1718 ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_FX|IFM_FDX, 0, NULL); 1719 ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_1000_SX, 0, NULL); 1720 ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_1000_SX|IFM_FDX, 0, NULL); 1721 ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL); 1722 ifmedia_set(&sc->ifmedia, IFM_ETHER|IFM_AUTO); 1723 1724 /* |
1725 * Call MI attach routines. | 1725 * Call MI attach routine. |
1726 */ | 1726 */ |
1727 if_attach(ifp); 1728 ether_ifattach(ifp); | 1727 ether_ifattach(ifp, ETHER_BPF_SUPPORTED); |
1729 | 1728 |
1730 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); 1731 | |
1732fail: 1733 splx(s); 1734 1735 return(error); 1736} 1737 1738static int ti_detach(dev) 1739 device_t dev; 1740{ 1741 struct ti_softc *sc; 1742 struct ifnet *ifp; 1743 int s; 1744 1745 s = splimp(); 1746 1747 sc = device_get_softc(dev); 1748 ifp = &sc->arpcom.ac_if; 1749 | 1729fail: 1730 splx(s); 1731 1732 return(error); 1733} 1734 1735static int ti_detach(dev) 1736 device_t dev; 1737{ 1738 struct ti_softc *sc; 1739 struct ifnet *ifp; 1740 int s; 1741 1742 s = splimp(); 1743 1744 sc = device_get_softc(dev); 1745 ifp = &sc->arpcom.ac_if; 1746 |
1750 if_detach(ifp); | 1747 ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); |
1751 ti_stop(sc); 1752 1753 bus_teardown_intr(dev, sc->ti_irq, sc->ti_intrhand); 1754 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->ti_irq); 1755 bus_release_resource(dev, SYS_RES_MEMORY, TI_PCI_LOMEM, sc->ti_res); 1756 1757 contigfree(sc->ti_cdata.ti_jumbo_buf, TI_JMEM, M_DEVBUF); 1758 contigfree(sc->ti_rdata, sizeof(struct ti_ring_data), M_DEVBUF); --- 762 unchanged lines hidden --- | 1748 ti_stop(sc); 1749 1750 bus_teardown_intr(dev, sc->ti_irq, sc->ti_intrhand); 1751 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->ti_irq); 1752 bus_release_resource(dev, SYS_RES_MEMORY, TI_PCI_LOMEM, sc->ti_res); 1753 1754 contigfree(sc->ti_cdata.ti_jumbo_buf, TI_JMEM, M_DEVBUF); 1755 contigfree(sc->ti_rdata, sizeof(struct ti_ring_data), M_DEVBUF); --- 762 unchanged lines hidden --- |