if_ed_pci.c (147149) | if_ed_pci.c (147184) |
---|---|
1/*- 2 * Copyright (c) 1996 Stefan Esser <se@freebsd.org> 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 --- 4 unchanged lines hidden (view full) --- 13 * documentation and/or other materials provided with the distribution. 14 * 3. Absolutely no warranty of function or purpose is made by the author 15 * Stefan Esser. 16 * 4. Modifications may be freely made to this file if the above conditions 17 * are met. 18 */ 19 20#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1996 Stefan Esser <se@freebsd.org> 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 --- 4 unchanged lines hidden (view full) --- 13 * documentation and/or other materials provided with the distribution. 14 * 3. Absolutely no warranty of function or purpose is made by the author 15 * Stefan Esser. 16 * 4. Modifications may be freely made to this file if the above conditions 17 * are met. 18 */ 19 20#include <sys/cdefs.h> |
21__FBSDID("$FreeBSD: head/sys/dev/ed/if_ed_pci.c 147149 2005-06-08 23:15:33Z imp $"); | 21__FBSDID("$FreeBSD: head/sys/dev/ed/if_ed_pci.c 147184 2005-06-09 18:46:36Z imp $"); |
22 23#include <sys/param.h> 24#include <sys/systm.h> 25#include <sys/socket.h> 26#include <sys/kernel.h> 27 28#include <sys/module.h> 29#include <sys/bus.h> --- 43 unchanged lines hidden (view full) --- 73 return (ENXIO); 74 device_set_desc(dev, ep->desc); 75 return (BUS_PROBE_DEFAULT); 76} 77 78static int 79ed_pci_attach(device_t dev) 80{ | 22 23#include <sys/param.h> 24#include <sys/systm.h> 25#include <sys/socket.h> 26#include <sys/kernel.h> 27 28#include <sys/module.h> 29#include <sys/bus.h> --- 43 unchanged lines hidden (view full) --- 73 return (ENXIO); 74 device_set_desc(dev, ep->desc); 75 return (BUS_PROBE_DEFAULT); 76} 77 78static int 79ed_pci_attach(device_t dev) 80{ |
81 struct ed_softc *sc = device_get_softc(dev); 82 int flags = 0; 83 int error; | 81 struct ed_softc *sc = device_get_softc(dev); 82 int flags = 0; 83 int error; |
84 | 84 |
85 error = ed_probe_Novell(dev, PCIR_BAR(0), flags); 86 if (error) { 87 ed_release_resources(dev); 88 return (error); | 85 error = ed_probe_Novell(dev, PCIR_BAR(0), flags); 86 if (error) { 87 ed_release_resources(dev); 88 return (error); |
89 } 90 ed_Novell_read_mac(sc); 91 | 89 } 90 ed_Novell_read_mac(sc); 91 |
92 error = ed_alloc_irq(dev, 0, RF_SHAREABLE); 93 if (error) { 94 ed_release_resources(dev); 95 return (error); 96 } 97 98 error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, | 92 error = ed_alloc_irq(dev, 0, RF_SHAREABLE); 93 if (error) { 94 ed_release_resources(dev); 95 return (error); 96 } 97 error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, |
99 edintr, sc, &sc->irq_handle); | 98 edintr, sc, &sc->irq_handle); |
100 if (error) { 101 ed_release_resources(dev); 102 return (error); 103 } | 99 if (error) { 100 ed_release_resources(dev); 101 return (error); 102 } |
104 105 error = ed_attach(dev); | 103 104 error = ed_attach(dev); |
106 if (error) 107 ed_release_resources(dev); | 105 if (error) 106 ed_release_resources(dev); |
108 return (error); 109} 110 111static device_method_t ed_pci_methods[] = { 112 /* Device interface */ 113 DEVMETHOD(device_probe, ed_pci_probe), 114 DEVMETHOD(device_attach, ed_pci_attach), 115 DEVMETHOD(device_attach, ed_detach), --- 13 unchanged lines hidden --- | 107 return (error); 108} 109 110static device_method_t ed_pci_methods[] = { 111 /* Device interface */ 112 DEVMETHOD(device_probe, ed_pci_probe), 113 DEVMETHOD(device_attach, ed_pci_attach), 114 DEVMETHOD(device_attach, ed_detach), --- 13 unchanged lines hidden --- |