2 * Copyright (c) 2004 Yoshihiro TAKAHASHI
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions, and the following disclaimer,
10 * without modification, immediately at the beginning of the file.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, 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
29 #include <sys/cdefs.h>
30 __FBSDID("$FreeBSD$");
32 #include <sys/param.h>
35 #include <sys/kernel.h>
36 #include <sys/module.h>
38 #include <sys/systm.h>
40 #include <pc98/pc98/fdcvar.h>
41 #include <pc98/pc98/fdreg.h>
43 #include <isa/isavar.h>
44 #include <pc98/pc98/pc98.h>
47 fdc_cbus_probe(device_t dev)
52 fdc = device_get_softc(dev);
53 bzero(fdc, sizeof *fdc);
57 if (isa_get_vendorid(dev))
60 /* Attempt to allocate our resources for the duration of the probe */
61 error = fdc_alloc_resources(fdc);
65 /* see if it can handle a command */
66 if (fd_cmd(fdc, 3, NE7CMD_SPECIFY, NE7_SPEC_1(4, 240),
67 NE7_SPEC_2(2, 0), 0)) {
72 fdc_release_resources(fdc);
76 static device_method_t fdc_methods[] = {
77 /* Device interface */
78 DEVMETHOD(device_probe, fdc_cbus_probe),
79 DEVMETHOD(device_attach, fdc_attach),
80 DEVMETHOD(device_detach, fdc_detach),
81 DEVMETHOD(device_shutdown, bus_generic_shutdown),
82 DEVMETHOD(device_suspend, bus_generic_suspend),
83 DEVMETHOD(device_resume, bus_generic_resume),
86 DEVMETHOD(bus_print_child, fdc_print_child),
87 DEVMETHOD(bus_read_ivar, fdc_read_ivar),
88 /* Our children never use any other bus interface methods. */
93 static driver_t fdc_driver = {
96 sizeof(struct fdc_data)
99 DRIVER_MODULE(fdc, isa, fdc_driver, fdc_devclass, 0, 0);