fdc_acpi.c revision 1.2.2.3 1 1.2.2.3 thorpej /* $NetBSD: fdc_acpi.c,v 1.2.2.3 2003/01/15 18:44:14 thorpej Exp $ */
2 1.2.2.2 thorpej
3 1.2.2.2 thorpej /*
4 1.2.2.2 thorpej * Copyright (c) 2002 Jared D. McNeill <jmcneill (at) invisible.ca>
5 1.2.2.2 thorpej * All rights reserved.
6 1.2.2.2 thorpej *
7 1.2.2.2 thorpej * Redistribution and use in source and binary forms, with or without
8 1.2.2.2 thorpej * modification, are permitted provided that the following conditions
9 1.2.2.2 thorpej * are met:
10 1.2.2.2 thorpej * 1. Redistributions of source code must retain the above copyright
11 1.2.2.2 thorpej * notice, this list of conditions and the following disclaimer.
12 1.2.2.2 thorpej * 2. The name of the author may not be used to endorse or promote products
13 1.2.2.2 thorpej * derived from this software without specific prior written permission.
14 1.2.2.2 thorpej *
15 1.2.2.2 thorpej * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 1.2.2.2 thorpej * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 1.2.2.2 thorpej * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 1.2.2.2 thorpej * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 1.2.2.2 thorpej * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 1.2.2.2 thorpej * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 1.2.2.2 thorpej * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 1.2.2.2 thorpej * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 1.2.2.2 thorpej * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 1.2.2.2 thorpej * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 1.2.2.2 thorpej * SUCH DAMAGE.
26 1.2.2.2 thorpej */
27 1.2.2.2 thorpej
28 1.2.2.2 thorpej /*
29 1.2.2.2 thorpej * ACPI attachment for the PC Floppy Controller driver, based on
30 1.2.2.2 thorpej * sys/arch/i386/pnpbios/fdc_pnpbios.c by Jason R. Thorpe
31 1.2.2.2 thorpej */
32 1.2.2.2 thorpej
33 1.2.2.2 thorpej #include <sys/cdefs.h>
34 1.2.2.3 thorpej __KERNEL_RCSID(0, "$NetBSD: fdc_acpi.c,v 1.2.2.3 2003/01/15 18:44:14 thorpej Exp $");
35 1.2.2.2 thorpej
36 1.2.2.2 thorpej #include "rnd.h"
37 1.2.2.2 thorpej
38 1.2.2.2 thorpej #include <sys/param.h>
39 1.2.2.2 thorpej #include <sys/systm.h>
40 1.2.2.2 thorpej #include <sys/callout.h>
41 1.2.2.2 thorpej #include <sys/device.h>
42 1.2.2.2 thorpej #include <sys/buf.h>
43 1.2.2.2 thorpej #include <sys/queue.h>
44 1.2.2.3 thorpej #include <sys/disk.h>
45 1.2.2.3 thorpej #include <sys/dkstat.h>
46 1.2.2.2 thorpej #if NRND > 0
47 1.2.2.2 thorpej #include <sys/rnd.h>
48 1.2.2.2 thorpej #endif
49 1.2.2.2 thorpej
50 1.2.2.2 thorpej #include <machine/bus.h>
51 1.2.2.2 thorpej #include <machine/intr.h>
52 1.2.2.2 thorpej
53 1.2.2.2 thorpej #include <dev/isa/isavar.h>
54 1.2.2.2 thorpej #include <dev/isa/isadmavar.h>
55 1.2.2.2 thorpej
56 1.2.2.2 thorpej #include <dev/acpi/acpica.h>
57 1.2.2.2 thorpej #include <dev/acpi/acpireg.h>
58 1.2.2.2 thorpej #include <dev/acpi/acpivar.h>
59 1.2.2.2 thorpej
60 1.2.2.2 thorpej #include <dev/isa/fdcvar.h>
61 1.2.2.3 thorpej #include <dev/isa/fdvar.h>
62 1.2.2.3 thorpej #include <dev/isa/fdreg.h>
63 1.2.2.3 thorpej
64 1.2.2.3 thorpej #include <dev/acpi/fdc_acpireg.h>
65 1.2.2.2 thorpej
66 1.2.2.2 thorpej int fdc_acpi_match(struct device *, struct cfdata *, void *);
67 1.2.2.2 thorpej void fdc_acpi_attach(struct device *, struct device *, void *);
68 1.2.2.2 thorpej
69 1.2.2.2 thorpej struct fdc_acpi_softc {
70 1.2.2.2 thorpej struct fdc_softc sc_fdc;
71 1.2.2.2 thorpej bus_space_handle_t sc_baseioh;
72 1.2.2.3 thorpej struct acpi_devnode *sc_node; /* ACPI devnode */
73 1.2.2.2 thorpej };
74 1.2.2.2 thorpej
75 1.2.2.3 thorpej static int fdc_acpi_enumerate(struct fdc_acpi_softc *);
76 1.2.2.3 thorpej static void fdc_acpi_getknownfds(struct fdc_acpi_softc *);
77 1.2.2.3 thorpej
78 1.2.2.3 thorpej static const struct fd_type *fdc_acpi_nvtotype(char *, int, int);
79 1.2.2.3 thorpej
80 1.2.2.2 thorpej CFATTACH_DECL(fdc_acpi, sizeof(struct fdc_acpi_softc), fdc_acpi_match,
81 1.2.2.2 thorpej fdc_acpi_attach, NULL, NULL);
82 1.2.2.2 thorpej
83 1.2.2.2 thorpej /*
84 1.2.2.2 thorpej * Supported device IDs
85 1.2.2.2 thorpej */
86 1.2.2.2 thorpej
87 1.2.2.2 thorpej static const char * const fdc_acpi_ids[] = {
88 1.2.2.2 thorpej "PNP0700", /* PC standard floppy disk controller */
89 1.2.2.2 thorpej #if 0 /* XXX do we support this? */
90 1.2.2.2 thorpej "PNP0701", /* Standard floppy controller for MS Device Bay Spec */
91 1.2.2.2 thorpej #endif
92 1.2.2.2 thorpej NULL
93 1.2.2.2 thorpej };
94 1.2.2.2 thorpej
95 1.2.2.2 thorpej /*
96 1.2.2.2 thorpej * fdc_acpi_match: autoconf(9) match routine
97 1.2.2.2 thorpej */
98 1.2.2.2 thorpej int
99 1.2.2.2 thorpej fdc_acpi_match(struct device *parent, struct cfdata *match, void *aux)
100 1.2.2.2 thorpej {
101 1.2.2.2 thorpej struct acpi_attach_args *aa = aux;
102 1.2.2.2 thorpej const char *id;
103 1.2.2.2 thorpej int i;
104 1.2.2.2 thorpej
105 1.2.2.2 thorpej if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
106 1.2.2.2 thorpej return 0;
107 1.2.2.2 thorpej
108 1.2.2.2 thorpej for (i = 0; (id = fdc_acpi_ids[i]) != NULL; ++i) {
109 1.2.2.2 thorpej if (strcmp(aa->aa_node->ad_devinfo.HardwareId, id) == 0)
110 1.2.2.2 thorpej return 1;
111 1.2.2.2 thorpej }
112 1.2.2.2 thorpej
113 1.2.2.2 thorpej /* No matches found */
114 1.2.2.2 thorpej return 0;
115 1.2.2.2 thorpej }
116 1.2.2.2 thorpej
117 1.2.2.2 thorpej /*
118 1.2.2.2 thorpej * fdc_acpi_attach: autoconf(9) attach routine
119 1.2.2.2 thorpej */
120 1.2.2.2 thorpej void
121 1.2.2.2 thorpej fdc_acpi_attach(struct device *parent, struct device *self, void *aux)
122 1.2.2.2 thorpej {
123 1.2.2.2 thorpej struct fdc_acpi_softc *asc = (struct fdc_acpi_softc *)self;
124 1.2.2.2 thorpej struct fdc_softc *sc = &asc->sc_fdc;
125 1.2.2.2 thorpej struct acpi_attach_args *aa = aux;
126 1.2.2.2 thorpej struct acpi_resources res;
127 1.2.2.2 thorpej struct acpi_io *io, *ctlio;
128 1.2.2.2 thorpej struct acpi_irq *irq;
129 1.2.2.2 thorpej struct acpi_drq *drq;
130 1.2.2.2 thorpej ACPI_STATUS rv;
131 1.2.2.2 thorpej
132 1.2.2.2 thorpej printf("\n");
133 1.2.2.2 thorpej
134 1.2.2.2 thorpej sc->sc_ic = aa->aa_ic;
135 1.2.2.3 thorpej asc->sc_node = aa->aa_node;
136 1.2.2.2 thorpej
137 1.2.2.2 thorpej /* parse resources */
138 1.2.2.2 thorpej rv = acpi_resource_parse(&sc->sc_dev, aa->aa_node, &res,
139 1.2.2.2 thorpej &acpi_resource_parse_ops_default);
140 1.2.2.2 thorpej if (rv != AE_OK) {
141 1.2.2.2 thorpej printf("%s: unable to parse resources\n", sc->sc_dev.dv_xname);
142 1.2.2.2 thorpej return;
143 1.2.2.2 thorpej }
144 1.2.2.2 thorpej
145 1.2.2.2 thorpej /* find our i/o registers */
146 1.2.2.2 thorpej io = acpi_res_io(&res, 0);
147 1.2.2.2 thorpej if (io == NULL) {
148 1.2.2.2 thorpej printf("%s: unable to find i/o register resource\n",
149 1.2.2.2 thorpej sc->sc_dev.dv_xname);
150 1.2.2.2 thorpej return;
151 1.2.2.2 thorpej }
152 1.2.2.2 thorpej
153 1.2.2.2 thorpej /* find our IRQ */
154 1.2.2.2 thorpej irq = acpi_res_irq(&res, 0);
155 1.2.2.2 thorpej if (irq == NULL) {
156 1.2.2.2 thorpej printf("%s: unable to find irq resource\n",
157 1.2.2.2 thorpej sc->sc_dev.dv_xname);
158 1.2.2.2 thorpej return;
159 1.2.2.2 thorpej }
160 1.2.2.2 thorpej
161 1.2.2.2 thorpej /* find our DRQ */
162 1.2.2.2 thorpej drq = acpi_res_drq(&res, 0);
163 1.2.2.2 thorpej if (drq == NULL) {
164 1.2.2.2 thorpej printf("%s: unable to find drq resource\n",
165 1.2.2.2 thorpej sc->sc_dev.dv_xname);
166 1.2.2.2 thorpej return;
167 1.2.2.2 thorpej }
168 1.2.2.2 thorpej sc->sc_drq = drq->ar_drq;
169 1.2.2.2 thorpej
170 1.2.2.2 thorpej sc->sc_iot = aa->aa_iot;
171 1.2.2.2 thorpej if (bus_space_map(sc->sc_iot, io->ar_base, io->ar_length,
172 1.2.2.2 thorpej 0, &asc->sc_baseioh)) {
173 1.2.2.2 thorpej printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
174 1.2.2.2 thorpej return;
175 1.2.2.2 thorpej }
176 1.2.2.2 thorpej
177 1.2.2.2 thorpej switch (io->ar_length) {
178 1.2.2.2 thorpej case 4:
179 1.2.2.2 thorpej sc->sc_ioh = asc->sc_baseioh;
180 1.2.2.2 thorpej break;
181 1.2.2.2 thorpej case 6:
182 1.2.2.2 thorpej if (bus_space_subregion(sc->sc_iot, asc->sc_baseioh, 2, 4,
183 1.2.2.2 thorpej &sc->sc_ioh)) {
184 1.2.2.2 thorpej printf("%s: unable to subregion i/o space\n",
185 1.2.2.2 thorpej sc->sc_dev.dv_xname);
186 1.2.2.2 thorpej return;
187 1.2.2.2 thorpej }
188 1.2.2.2 thorpej break;
189 1.2.2.2 thorpej default:
190 1.2.2.2 thorpej printf("%s: unknown size: %d of io mapping\n",
191 1.2.2.2 thorpej sc->sc_dev.dv_xname, io->ar_length);
192 1.2.2.2 thorpej return;
193 1.2.2.2 thorpej }
194 1.2.2.2 thorpej
195 1.2.2.2 thorpej /*
196 1.2.2.2 thorpej * omitting the controller I/O port. (One has to exist for there to
197 1.2.2.2 thorpej * be a working fdc). Just try and force the mapping in.
198 1.2.2.2 thorpej */
199 1.2.2.2 thorpej ctlio = acpi_res_io(&res, 1);
200 1.2.2.2 thorpej if (ctlio == NULL) {
201 1.2.2.2 thorpej if (bus_space_map(sc->sc_iot, io->ar_base + io->ar_length + 1,
202 1.2.2.2 thorpej 1, 0, &sc->sc_fdctlioh)) {
203 1.2.2.2 thorpej printf("%s: unable to force map ctl i/o space\n",
204 1.2.2.2 thorpej sc->sc_dev.dv_xname);
205 1.2.2.2 thorpej return;
206 1.2.2.2 thorpej }
207 1.2.2.2 thorpej printf("%s: ctl io %x did't probe. Forced attach\n",
208 1.2.2.2 thorpej sc->sc_dev.dv_xname, io->ar_base + io->ar_length + 1);
209 1.2.2.2 thorpej } else {
210 1.2.2.2 thorpej if (bus_space_map(sc->sc_iot, ctlio->ar_base, ctlio->ar_length,
211 1.2.2.2 thorpej 0, &sc->sc_fdctlioh)) {
212 1.2.2.2 thorpej printf("%s: unable to map ctl i/o space\n",
213 1.2.2.2 thorpej sc->sc_dev.dv_xname);
214 1.2.2.2 thorpej return;
215 1.2.2.2 thorpej }
216 1.2.2.2 thorpej }
217 1.2.2.2 thorpej
218 1.2.2.3 thorpej sc->sc_ih = isa_intr_establish(aa->aa_ic, irq->ar_irq,
219 1.2.2.3 thorpej (irq->ar_type == ACPI_EDGE_SENSITIVE) ? IST_EDGE : IST_LEVEL,
220 1.2.2.3 thorpej IPL_BIO, fdcintr, sc);
221 1.2.2.3 thorpej
222 1.2.2.3 thorpej /* Setup direct configuration of floppy drives */
223 1.2.2.3 thorpej sc->sc_present = fdc_acpi_enumerate(asc);
224 1.2.2.3 thorpej if (sc->sc_present >= 0) {
225 1.2.2.3 thorpej sc->sc_known = 1;
226 1.2.2.3 thorpej fdc_acpi_getknownfds(asc);
227 1.2.2.3 thorpej } else {
228 1.2.2.3 thorpej /*
229 1.2.2.3 thorpej * XXX if there is no _FDE control method, attempt to
230 1.2.2.3 thorpej * probe without pnp
231 1.2.2.3 thorpej */
232 1.2.2.3 thorpej #ifdef ACPI_FDC_DEBUG
233 1.2.2.3 thorpej printf("%s: unable to enumerate, attempting normal probe\n",
234 1.2.2.3 thorpej sc->sc_dev.dv_xname);
235 1.2.2.3 thorpej #endif
236 1.2.2.3 thorpej }
237 1.2.2.2 thorpej
238 1.2.2.2 thorpej fdcattach(sc);
239 1.2.2.2 thorpej }
240 1.2.2.3 thorpej
241 1.2.2.3 thorpej static int
242 1.2.2.3 thorpej fdc_acpi_enumerate(struct fdc_acpi_softc *asc)
243 1.2.2.3 thorpej {
244 1.2.2.3 thorpej struct fdc_softc *sc = &asc->sc_fdc;
245 1.2.2.3 thorpej ACPI_OBJECT *fde;
246 1.2.2.3 thorpej ACPI_BUFFER buf;
247 1.2.2.3 thorpej ACPI_STATUS rv;
248 1.2.2.3 thorpej UINT32 *p;
249 1.2.2.3 thorpej int i, drives = -1;
250 1.2.2.3 thorpej
251 1.2.2.3 thorpej rv = acpi_eval_struct(asc->sc_node->ad_handle, "_FDE", &buf);
252 1.2.2.3 thorpej if (rv != AE_OK) {
253 1.2.2.3 thorpej #ifdef ACPI_FDC_DEBUG
254 1.2.2.3 thorpej printf("%s: failed to evaluate _FDE: %x\n",
255 1.2.2.3 thorpej sc->sc_dev.dv_xname, rv);
256 1.2.2.3 thorpej #endif
257 1.2.2.3 thorpej return drives;
258 1.2.2.3 thorpej }
259 1.2.2.3 thorpej fde = (ACPI_OBJECT *)buf.Pointer;
260 1.2.2.3 thorpej if (fde->Type != ACPI_TYPE_BUFFER) {
261 1.2.2.3 thorpej printf("%s: expected BUFFER, got %d\n", sc->sc_dev.dv_xname,
262 1.2.2.3 thorpej fde->Type);
263 1.2.2.3 thorpej goto out;
264 1.2.2.3 thorpej }
265 1.2.2.3 thorpej if (fde->Buffer.Length < 5 * sizeof(UINT32)) {
266 1.2.2.3 thorpej printf("%s: expected buffer len of %d, got %d\n",
267 1.2.2.3 thorpej sc->sc_dev.dv_xname,
268 1.2.2.3 thorpej 5 * sizeof(UINT32), fde->Buffer.Length);
269 1.2.2.3 thorpej goto out;
270 1.2.2.3 thorpej }
271 1.2.2.3 thorpej
272 1.2.2.3 thorpej p = (UINT32 *) fde->Buffer.Pointer;
273 1.2.2.3 thorpej
274 1.2.2.3 thorpej /*
275 1.2.2.3 thorpej * Indexes 0 through 3 are each UINT32 booleans. True if a drive
276 1.2.2.3 thorpej * is present.
277 1.2.2.3 thorpej */
278 1.2.2.3 thorpej drives = 0;
279 1.2.2.3 thorpej for (i = 0; i < 4; i++) {
280 1.2.2.3 thorpej if (p[i]) drives |= (1 << i);
281 1.2.2.3 thorpej #ifdef ACPI_FDC_DEBUG
282 1.2.2.3 thorpej printf("%s: drive %d %sattached\n", sc->sc_dev.dv_xname, i,
283 1.2.2.3 thorpej p[i] ? "" : "not ");
284 1.2.2.3 thorpej #endif
285 1.2.2.3 thorpej }
286 1.2.2.3 thorpej
287 1.2.2.3 thorpej /*
288 1.2.2.3 thorpej * p[4] reports tape presence. Possible values:
289 1.2.2.3 thorpej * 0 - Unknown if device is present
290 1.2.2.3 thorpej * 1 - Device is present
291 1.2.2.3 thorpej * 2 - Device is never present
292 1.2.2.3 thorpej * >2 - Reserved
293 1.2.2.3 thorpej *
294 1.2.2.3 thorpej * we don't currently use this.
295 1.2.2.3 thorpej */
296 1.2.2.3 thorpej
297 1.2.2.3 thorpej out:
298 1.2.2.3 thorpej AcpiOsFree(buf.Pointer);
299 1.2.2.3 thorpej return drives;
300 1.2.2.3 thorpej }
301 1.2.2.3 thorpej
302 1.2.2.3 thorpej static void
303 1.2.2.3 thorpej fdc_acpi_getknownfds(struct fdc_acpi_softc *asc)
304 1.2.2.3 thorpej {
305 1.2.2.3 thorpej struct fdc_softc *sc = &asc->sc_fdc;
306 1.2.2.3 thorpej ACPI_OBJECT *fdi, *e;
307 1.2.2.3 thorpej ACPI_BUFFER buf;
308 1.2.2.3 thorpej ACPI_STATUS rv;
309 1.2.2.3 thorpej int i;
310 1.2.2.3 thorpej
311 1.2.2.3 thorpej for (i = 0; i < 4; i++) {
312 1.2.2.3 thorpej if ((sc->sc_present & (1 << i)) == 0)
313 1.2.2.3 thorpej continue;
314 1.2.2.3 thorpej rv = acpi_eval_struct(asc->sc_node->ad_handle, "_FDI", &buf);
315 1.2.2.3 thorpej if (rv != AE_OK) {
316 1.2.2.3 thorpej #ifdef ACPI_FDC_DEBUG
317 1.2.2.3 thorpej printf("%s: failed to evaluate _FDI: %x on drive %d\n",
318 1.2.2.3 thorpej sc->sc_dev.dv_xname, rv, i);
319 1.2.2.3 thorpej #endif
320 1.2.2.3 thorpej /* XXX if _FDI fails, assume 1.44MB floppy */
321 1.2.2.3 thorpej sc->sc_knownfds[i] = &fdc_acpi_fdtypes[0];
322 1.2.2.3 thorpej continue;
323 1.2.2.3 thorpej }
324 1.2.2.3 thorpej fdi = (ACPI_OBJECT *)buf.Pointer;
325 1.2.2.3 thorpej if (fdi->Type != ACPI_TYPE_PACKAGE) {
326 1.2.2.3 thorpej printf("%s: expected PACKAGE, got %d\n",
327 1.2.2.3 thorpej sc->sc_dev.dv_xname, fdi->Type);
328 1.2.2.3 thorpej goto out;
329 1.2.2.3 thorpej }
330 1.2.2.3 thorpej e = fdi->Package.Elements;
331 1.2.2.3 thorpej sc->sc_knownfds[i] = fdc_acpi_nvtotype(sc->sc_dev.dv_xname,
332 1.2.2.3 thorpej e[1].Integer.Value, e[0].Integer.Value);
333 1.2.2.3 thorpej
334 1.2.2.3 thorpej /* if fdc_acpi_nvtotype returns NULL, don't attach drive */
335 1.2.2.3 thorpej if (!sc->sc_knownfds[i])
336 1.2.2.3 thorpej sc->sc_present &= ~(1 << i);
337 1.2.2.3 thorpej
338 1.2.2.3 thorpej out:
339 1.2.2.3 thorpej AcpiOsFree(buf.Pointer);
340 1.2.2.3 thorpej }
341 1.2.2.3 thorpej }
342 1.2.2.3 thorpej
343 1.2.2.3 thorpej static const struct fd_type *
344 1.2.2.3 thorpej fdc_acpi_nvtotype(char *fdc, int nvraminfo, int drive)
345 1.2.2.3 thorpej {
346 1.2.2.3 thorpej int type;
347 1.2.2.3 thorpej
348 1.2.2.3 thorpej type = (drive == 0 ? nvraminfo : nvraminfo << 4) & 0xf0;
349 1.2.2.3 thorpej switch (type) {
350 1.2.2.3 thorpej case ACPI_FDC_DISKETTE_NONE:
351 1.2.2.3 thorpej return NULL;
352 1.2.2.3 thorpej case ACPI_FDC_DISKETTE_12M:
353 1.2.2.3 thorpej return &fdc_acpi_fdtypes[1];
354 1.2.2.3 thorpej case ACPI_FDC_DISKETTE_TYPE5:
355 1.2.2.3 thorpej case ACPI_FDC_DISKETTE_TYPE6:
356 1.2.2.3 thorpej case ACPI_FDC_DISKETTE_144M:
357 1.2.2.3 thorpej return &fdc_acpi_fdtypes[0];
358 1.2.2.3 thorpej case ACPI_FDC_DISKETTE_360K:
359 1.2.2.3 thorpej return &fdc_acpi_fdtypes[3];
360 1.2.2.3 thorpej case ACPI_FDC_DISKETTE_720K:
361 1.2.2.3 thorpej return &fdc_acpi_fdtypes[4];
362 1.2.2.3 thorpej default:
363 1.2.2.3 thorpej #ifdef ACPI_FDC_DEBUG
364 1.2.2.3 thorpej printf("%s: drive %d: unknown device type 0x%x\n",
365 1.2.2.3 thorpej fdc, drive, type);
366 1.2.2.3 thorpej #endif
367 1.2.2.3 thorpej return NULL;
368 1.2.2.3 thorpej }
369 1.2.2.3 thorpej }
370