Deleted Added
full compact
intpm.c (92739) intpm.c (93023)
1/*-
2 * Copyright (c) 1998, 1999 Takanori Watanabe
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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1998, 1999 Takanori Watanabe
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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/pci/intpm.c 92739 2002-03-20 02:08:01Z alfred $
26 * $FreeBSD: head/sys/pci/intpm.c 93023 2002-03-23 15:49:15Z nsouch $
27 */
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/kernel.h>
32#include <machine/bus_pio.h>
33#include <machine/bus_memio.h>
34#include <machine/bus.h>

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

145 intpm_pci_methods,
146 sizeof(struct intpm_pci_softc)
147};
148
149static int
150intsmb_probe(device_t dev)
151{
152 struct intsmb_softc *sc =(struct intsmb_softc *) device_get_softc(dev);
27 */
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/kernel.h>
32#include <machine/bus_pio.h>
33#include <machine/bus_memio.h>
34#include <machine/bus.h>

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

145 intpm_pci_methods,
146 sizeof(struct intpm_pci_softc)
147};
148
149static int
150intsmb_probe(device_t dev)
151{
152 struct intsmb_softc *sc =(struct intsmb_softc *) device_get_softc(dev);
153 sc->smbus=smbus_alloc_bus(dev);
153 sc->smbus=device_add_child(dev, "smbus", -1);
154 if (!sc->smbus)
155 return (EINVAL); /* XXX don't know what to return else */
156 device_set_desc(dev,"Intel PIIX4 SMBUS Interface");
157
158 return (0); /* XXX don't know what to return else */
159}
160static int
161intsmb_attach(device_t dev)

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

734 device_set_desc(dev,ep->desc);
735 bus_set_resource(dev,SYS_RES_IRQ,0,9,1); /* XXX setup intr resource */
736 return 0;
737 }else{
738 return ENXIO;
739 }
740}
741DRIVER_MODULE(intpm, pci , intpm_pci_driver, intpm_devclass, 0, 0);
154 if (!sc->smbus)
155 return (EINVAL); /* XXX don't know what to return else */
156 device_set_desc(dev,"Intel PIIX4 SMBUS Interface");
157
158 return (0); /* XXX don't know what to return else */
159}
160static int
161intsmb_attach(device_t dev)

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

734 device_set_desc(dev,ep->desc);
735 bus_set_resource(dev,SYS_RES_IRQ,0,9,1); /* XXX setup intr resource */
736 return 0;
737 }else{
738 return ENXIO;
739 }
740}
741DRIVER_MODULE(intpm, pci , intpm_pci_driver, intpm_devclass, 0, 0);
742MODULE_DEPEND(intpm, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
743MODULE_VERSION(intpm, 1);
742
743static void intpm_intr(void *arg)
744{
745 struct intpm_pci_softc *sc;
746 sc=(struct intpm_pci_softc *)arg;
747 intsmb_intr(sc->smbus);
748 intsmb_slvintr(sc->smbus);
749
750}
744
745static void intpm_intr(void *arg)
746{
747 struct intpm_pci_softc *sc;
748 sc=(struct intpm_pci_softc *)arg;
749 intsmb_intr(sc->smbus);
750 intsmb_slvintr(sc->smbus);
751
752}