Deleted Added
full compact
1/*
2 * Copyright (c) 2000 Matthew R. Green
3 * 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

--- 13 unchanged lines hidden (view full) ---

22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * from: NetBSD: if_hme_pci.c,v 1.4 2001/08/27 22:18:49 augustss Exp
29 *
30 * $FreeBSD: head/sys/dev/hme/if_hme_pci.c 93043 2002-03-23 19:37:11Z tmm $
31 */
32
33/*
34 * PCI front-end device driver for the HME ethernet device.
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>

--- 33 unchanged lines hidden (view full) ---

72 int hsc_irid;
73 bus_space_tag_t hsc_memt;
74 bus_space_handle_t hsc_memh;
75 void *hsc_ih;
76};
77
78static int hme_pci_probe(device_t);
79static int hme_pci_attach(device_t);
80
81static device_method_t hme_pci_methods[] = {
82 /* Device interface */
83 DEVMETHOD(device_probe, hme_pci_probe),
84 DEVMETHOD(device_attach, hme_pci_attach),
85
86 /* bus interface */
87 DEVMETHOD(bus_print_child, bus_generic_print_child),
88 DEVMETHOD(bus_driver_added, bus_generic_driver_added),
89
90 /* MII interface */
91 DEVMETHOD(miibus_readreg, hme_mii_readreg),
92 DEVMETHOD(miibus_writereg, hme_mii_writereg),

--- 84 unchanged lines hidden (view full) ---

177 if ((error = hme_config(sc)) != 0) {
178 device_printf(dev, "could not be configured\n");
179 goto fail_ires;
180 }
181
182 if ((error = bus_setup_intr(dev, hsc->hsc_ires, INTR_TYPE_NET, hme_intr,
183 sc, &hsc->hsc_ih)) != 0) {
184 device_printf(dev, "couldn't establish interrupt\n");
185 goto fail_ires;
186 }
187 return (0);
188
189fail_ires:
190 bus_release_resource(dev, SYS_RES_IRQ, hsc->hsc_irid, hsc->hsc_ires);
191fail_sres:
192 bus_release_resource(dev, SYS_RES_MEMORY, hsc->hsc_srid, hsc->hsc_sres);
193 return (ENXIO);
194}