Deleted Added
full compact
ata_iobus.c (200182) ata_iobus.c (249213)
1/*-
2 * Copyright 2002 by Peter Grehan. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
1/*-
2 * Copyright 2002 by Peter Grehan. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/powerpc/psim/ata_iobus.c 200182 2009-12-06 17:26:43Z nwhitehorn $
28 */
29
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/powerpc/psim/ata_iobus.c 249213 2013-04-06 19:12:49Z marius $");
30
30/*
31 * PSIM local bus ATA controller
32 */
31/*
32 * PSIM local bus ATA controller
33 */
33#include "opt_ata.h"
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/kernel.h>
37#include <sys/module.h>
38#include <sys/bus.h>
39#include <sys/malloc.h>
40#include <sys/sema.h>
41#include <sys/taskqueue.h>

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

75 DEVMETHOD(bus_print_child, ata_iobus_print_child),
76 DEVMETHOD(bus_alloc_resource, ata_iobus_alloc_resource),
77 DEVMETHOD(bus_release_resource, ata_iobus_release_resource),
78 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
79 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
80 DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
81 DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
82
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/kernel.h>
37#include <sys/module.h>
38#include <sys/bus.h>
39#include <sys/malloc.h>
40#include <sys/sema.h>
41#include <sys/taskqueue.h>

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

75 DEVMETHOD(bus_print_child, ata_iobus_print_child),
76 DEVMETHOD(bus_alloc_resource, ata_iobus_alloc_resource),
77 DEVMETHOD(bus_release_resource, ata_iobus_release_resource),
78 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
79 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
80 DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
81 DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
82
83 { 0, 0 }
83 DEVMETHOD_END
84};
85
86static driver_t ata_iobus_driver = {
87 "ataiobus",
88 ata_iobus_methods,
89 0,
90};
91
92static devclass_t ata_iobus_devclass;
93
84};
85
86static driver_t ata_iobus_driver = {
87 "ataiobus",
88 ata_iobus_methods,
89 0,
90};
91
92static devclass_t ata_iobus_devclass;
93
94DRIVER_MODULE(ataiobus, iobus, ata_iobus_driver, ata_iobus_devclass, 0, 0);
94DRIVER_MODULE(ataiobus, iobus, ata_iobus_driver, ata_iobus_devclass, NULL,
95 NULL);
95MODULE_DEPEND(ata, ata, 1, 1, 1);
96
97static int
98ata_iobus_probe(device_t dev)
99{
100 char *type = iobus_get_name(dev);
101
102 if (strncmp(type, "ata", 3) != 0)

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

216 /* Device interface */
217 DEVMETHOD(device_probe, ata_iobus_sub_probe),
218 DEVMETHOD(device_attach, ata_attach),
219 DEVMETHOD(device_detach, ata_detach),
220 DEVMETHOD(device_resume, ata_resume),
221
222 /* ATA interface */
223 DEVMETHOD(ata_setmode, ata_iobus_sub_setmode),
96MODULE_DEPEND(ata, ata, 1, 1, 1);
97
98static int
99ata_iobus_probe(device_t dev)
100{
101 char *type = iobus_get_name(dev);
102
103 if (strncmp(type, "ata", 3) != 0)

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

217 /* Device interface */
218 DEVMETHOD(device_probe, ata_iobus_sub_probe),
219 DEVMETHOD(device_attach, ata_attach),
220 DEVMETHOD(device_detach, ata_detach),
221 DEVMETHOD(device_resume, ata_resume),
222
223 /* ATA interface */
224 DEVMETHOD(ata_setmode, ata_iobus_sub_setmode),
224 { 0, 0 }
225 DEVMETHOD_END
225};
226
227static driver_t ata_iobus_sub_driver = {
228 "ata",
229 ata_iobus_sub_methods,
230 sizeof(struct ata_channel),
231};
232
226};
227
228static driver_t ata_iobus_sub_driver = {
229 "ata",
230 ata_iobus_sub_methods,
231 sizeof(struct ata_channel),
232};
233
233DRIVER_MODULE(ata, ataiobus, ata_iobus_sub_driver, ata_devclass, 0, 0);
234DRIVER_MODULE(ata, ataiobus, ata_iobus_sub_driver, ata_devclass, NULL, NULL);
234
235static int
236ata_iobus_sub_probe(device_t dev)
237{
238 struct ata_channel *ch = device_get_softc(dev);
239
240 /* Only a single unit per controller thus far */
241 ch->unit = 0;

--- 12 unchanged lines hidden ---
235
236static int
237ata_iobus_sub_probe(device_t dev)
238{
239 struct ata_channel *ch = device_get_softc(dev);
240
241 /* Only a single unit per controller thus far */
242 ch->unit = 0;

--- 12 unchanged lines hidden ---