lpt_ofisa_machdep.c revision 1.1.2.2 1 1.1.2.2 nathanw /* $NetBSD: lpt_ofisa_machdep.c,v 1.1.2.2 2002/02/28 04:11:54 nathanw Exp $ */
2 1.1.2.2 nathanw
3 1.1.2.2 nathanw /*
4 1.1.2.2 nathanw * Copyright 1998
5 1.1.2.2 nathanw * Digital Equipment Corporation. All rights reserved.
6 1.1.2.2 nathanw *
7 1.1.2.2 nathanw * This software is furnished under license and may be used and
8 1.1.2.2 nathanw * copied only in accordance with the following terms and conditions.
9 1.1.2.2 nathanw * Subject to these conditions, you may download, copy, install,
10 1.1.2.2 nathanw * use, modify and distribute this software in source and/or binary
11 1.1.2.2 nathanw * form. No title or ownership is transferred hereby.
12 1.1.2.2 nathanw *
13 1.1.2.2 nathanw * 1) Any source code used, modified or distributed must reproduce
14 1.1.2.2 nathanw * and retain this copyright notice and list of conditions as
15 1.1.2.2 nathanw * they appear in the source file.
16 1.1.2.2 nathanw *
17 1.1.2.2 nathanw * 2) No right is granted to use any trade name, trademark, or logo of
18 1.1.2.2 nathanw * Digital Equipment Corporation. Neither the "Digital Equipment
19 1.1.2.2 nathanw * Corporation" name nor any trademark or logo of Digital Equipment
20 1.1.2.2 nathanw * Corporation may be used to endorse or promote products derived
21 1.1.2.2 nathanw * from this software without the prior written permission of
22 1.1.2.2 nathanw * Digital Equipment Corporation.
23 1.1.2.2 nathanw *
24 1.1.2.2 nathanw * 3) This software is provided "AS-IS" and any express or implied
25 1.1.2.2 nathanw * warranties, including but not limited to, any implied warranties
26 1.1.2.2 nathanw * of merchantability, fitness for a particular purpose, or
27 1.1.2.2 nathanw * non-infringement are disclaimed. In no event shall DIGITAL be
28 1.1.2.2 nathanw * liable for any damages whatsoever, and in particular, DIGITAL
29 1.1.2.2 nathanw * shall not be liable for special, indirect, consequential, or
30 1.1.2.2 nathanw * incidental damages or damages for lost profits, loss of
31 1.1.2.2 nathanw * revenue or loss of use, whether such damages arise in contract,
32 1.1.2.2 nathanw * negligence, tort, under statute, in equity, at law or otherwise,
33 1.1.2.2 nathanw * even if advised of the possibility of such damage.
34 1.1.2.2 nathanw */
35 1.1.2.2 nathanw
36 1.1.2.2 nathanw #include <sys/param.h>
37 1.1.2.2 nathanw #include <sys/device.h>
38 1.1.2.2 nathanw #include <sys/systm.h>
39 1.1.2.2 nathanw #include <machine/bus.h>
40 1.1.2.2 nathanw #include <machine/intr.h>
41 1.1.2.2 nathanw
42 1.1.2.2 nathanw #include <dev/ofw/openfirm.h>
43 1.1.2.2 nathanw #include <dev/isa/isavar.h>
44 1.1.2.2 nathanw #include <dev/ofisa/ofisavar.h>
45 1.1.2.2 nathanw
46 1.1.2.2 nathanw #ifdef COMPAT_OLD_OFW
47 1.1.2.2 nathanw
48 1.1.2.2 nathanw extern int i87307PrinterConfig __P((bus_space_tag_t, u_int)); /* XXX */
49 1.1.2.2 nathanw
50 1.1.2.2 nathanw int
51 1.1.2.2 nathanw lpt_ofisa_md_match(parent, cf, aux)
52 1.1.2.2 nathanw struct device *parent;
53 1.1.2.2 nathanw struct cfdata *cf;
54 1.1.2.2 nathanw void *aux;
55 1.1.2.2 nathanw {
56 1.1.2.2 nathanw struct ofisa_attach_args *aa = aux;
57 1.1.2.2 nathanw char type[9];
58 1.1.2.2 nathanw char name[9];
59 1.1.2.2 nathanw int rv;
60 1.1.2.2 nathanw
61 1.1.2.2 nathanw rv = 0;
62 1.1.2.2 nathanw if (1) { /* XXX old firmware compat enabled */
63 1.1.2.2 nathanw /* match type and name properties */
64 1.1.2.2 nathanw if (OF_getprop(aa->oba.oba_phandle, "device_type",
65 1.1.2.2 nathanw type, sizeof(type)) > 0 &&
66 1.1.2.2 nathanw strcmp(type, "parallel") == 0 &&
67 1.1.2.2 nathanw OF_getprop(aa->oba.oba_phandle, "name", name,
68 1.1.2.2 nathanw sizeof(name)) > 0 &&
69 1.1.2.2 nathanw strcmp(name, "parallel") == 0)
70 1.1.2.2 nathanw rv = 4;
71 1.1.2.2 nathanw }
72 1.1.2.2 nathanw return (rv);
73 1.1.2.2 nathanw }
74 1.1.2.2 nathanw
75 1.1.2.2 nathanw int
76 1.1.2.2 nathanw lpt_ofisa_md_intr_fixup(parent, self, aux, descp, ndescs, ndescsfilled)
77 1.1.2.2 nathanw struct device *parent, *self;
78 1.1.2.2 nathanw void *aux;
79 1.1.2.2 nathanw struct ofisa_intr_desc *descp;
80 1.1.2.2 nathanw int ndescs, ndescsfilled;
81 1.1.2.2 nathanw {
82 1.1.2.2 nathanw
83 1.1.2.2 nathanw if (1) /* XXX old firmware compat enabled */
84 1.1.2.2 nathanw if (ndescs > 0 && ndescsfilled > 0) {
85 1.1.2.2 nathanw i87307PrinterConfig(&isa_io_bs_tag, descp[0].irq);
86 1.1.2.2 nathanw descp[0].share = IST_LEVEL;
87 1.1.2.2 nathanw }
88 1.1.2.2 nathanw return (ndescsfilled);
89 1.1.2.2 nathanw }
90 1.1.2.2 nathanw
91 1.1.2.2 nathanw #endif /* COMPAT_OLD_OFW */
92