Deleted Added
full compact
acpi_isab.c (128071) acpi_isab.c (129829)
1/*-
2 * Copyright (c) 2003 John Baldwin <jhb@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

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

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
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2003 John Baldwin <jhb@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

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

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
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_isab.c 128071 2004-04-09 18:14:32Z njl $");
28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_isab.c 129829 2004-05-29 04:32:50Z njl $");
29
30/*
31 * ISA Bridge driver for Generic ISA Bus Devices. See section 10.7 of the
32 * ACPI 2.0a specification for details on this device.
33 */
34
35#include "opt_acpi.h"
36#include <sys/param.h>
37#include <sys/bus.h>
29
30/*
31 * ISA Bridge driver for Generic ISA Bus Devices. See section 10.7 of the
32 * ACPI 2.0a specification for details on this device.
33 */
34
35#include "opt_acpi.h"
36#include <sys/param.h>
37#include <sys/bus.h>
38#include <sys/malloc.h>
39#include <sys/kernel.h>
38#include <sys/kernel.h>
39#include <sys/malloc.h>
40
41#include "acpi.h"
40
41#include "acpi.h"
42
43#include <dev/acpica/acpivar.h>
44#include <isa/isavar.h>
45
42#include <dev/acpica/acpivar.h>
43#include <isa/isavar.h>
44
46/*
47 * Hooks for the ACPI CA debugging infrastructure
48 */
45/* Hooks for the ACPI CA debugging infrastructure. */
49#define _COMPONENT ACPI_BUS
50ACPI_MODULE_NAME("ISA_ACPI")
51
52struct acpi_isab_softc {
53 device_t ap_dev;
54 ACPI_HANDLE ap_handle;
55};
56
46#define _COMPONENT ACPI_BUS
47ACPI_MODULE_NAME("ISA_ACPI")
48
49struct acpi_isab_softc {
50 device_t ap_dev;
51 ACPI_HANDLE ap_handle;
52};
53
57
58static int acpi_isab_probe(device_t bus);
59static int acpi_isab_attach(device_t bus);
60static int acpi_isab_read_ivar(device_t dev, device_t child, int which,
61 uintptr_t *result);
62
63static device_method_t acpi_isab_methods[] = {
64 /* Device interface */
65 DEVMETHOD(device_probe, acpi_isab_probe),

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

89
90DRIVER_MODULE(acpi_isab, acpi, acpi_isab_driver, isab_devclass, 0, 0);
91MODULE_DEPEND(acpi_isab, acpi, 1, 1, 1);
92
93static int
94acpi_isab_probe(device_t dev)
95{
96
54static int acpi_isab_probe(device_t bus);
55static int acpi_isab_attach(device_t bus);
56static int acpi_isab_read_ivar(device_t dev, device_t child, int which,
57 uintptr_t *result);
58
59static device_method_t acpi_isab_methods[] = {
60 /* Device interface */
61 DEVMETHOD(device_probe, acpi_isab_probe),

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

85
86DRIVER_MODULE(acpi_isab, acpi, acpi_isab_driver, isab_devclass, 0, 0);
87MODULE_DEPEND(acpi_isab, acpi, 1, 1, 1);
88
89static int
90acpi_isab_probe(device_t dev)
91{
92
97 if ((acpi_get_type(dev) == ACPI_TYPE_DEVICE) &&
93 if (acpi_get_type(dev) == ACPI_TYPE_DEVICE &&
98 !acpi_disabled("isa") &&
99 devclass_get_device(isab_devclass, 0) == dev &&
100 (acpi_MatchHid(dev, "PNP0A05") || acpi_MatchHid(dev, "PNP0A06"))) {
101 device_set_desc(dev, "ACPI Generic ISA bridge");
94 !acpi_disabled("isa") &&
95 devclass_get_device(isab_devclass, 0) == dev &&
96 (acpi_MatchHid(dev, "PNP0A05") || acpi_MatchHid(dev, "PNP0A06"))) {
97 device_set_desc(dev, "ACPI Generic ISA bridge");
102 return(0);
98 return (0);
103 }
99 }
104 return(ENXIO);
100 return (ENXIO);
105}
106
107static int
108acpi_isab_attach(device_t dev)
109{
110 struct acpi_isab_softc *sc;
111
112 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);

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

119}
120
121static int
122acpi_isab_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
123{
124 struct acpi_isab_softc *sc = device_get_softc(dev);
125
126 switch (which) {
101}
102
103static int
104acpi_isab_attach(device_t dev)
105{
106 struct acpi_isab_softc *sc;
107
108 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);

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

115}
116
117static int
118acpi_isab_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
119{
120 struct acpi_isab_softc *sc = device_get_softc(dev);
121
122 switch (which) {
127 case ACPI_IVAR_HANDLE:
123 case ACPI_IVAR_HANDLE:
128 *result = (uintptr_t)sc->ap_handle;
124 *result = (uintptr_t)sc->ap_handle;
129 return(0);
125 return (0);
130 }
126 }
131 return(ENOENT);
127 return (ENOENT);
132}
128}