1 /* $NetBSD: ppbus_io.h,v 1.4.4.4 2005/03/04 16:49:52 skrll Exp $ */
4 * Copyright (c) 1999 Nicolas Souchu
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
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
20 * FOR 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
28 * FreeBSD: src/sys/dev/ppbus/ppbio.h,v 1.1 2000/01/14 00:17:57 nsouch Exp
35 /* Parallel port bus I/O opcodes */
36 #define PPBUS_OUTSB_EPP 1
37 #define PPBUS_OUTSW_EPP 2
38 #define PPBUS_OUTSL_EPP 3
39 #define PPBUS_INSB_EPP 4
40 #define PPBUS_INSW_EPP 5
41 #define PPBUS_INSL_EPP 6
45 #define PPBUS_REPP_A 10
46 #define PPBUS_REPP_D 11
48 #define PPBUS_RFIFO 13
52 #define PPBUS_WEPP_A 17
53 #define PPBUS_WEPP_D 18
55 #define PPBUS_WFIFO 20
59 * Set of ppbus i/o routines callable from ppbus device drivers
62 #define ppbus_outsb_epp(dev,buf,cnt) \
63 ppbus_io((dev), PPBUS_OUTSB_EPP, (buf), (cnt), 0)
65 #define ppbus_outsw_epp(dev,buf,cnt) \
66 ppbus_io((dev), PPBUS_OUTSW_EPP, (buf), (cnt), 0)
68 #define ppbus_outsl_epp(dev,buf,cnt) \
69 ppbus_io((dev), PPBUS_OUTSL_EPP, (buf), (cnt), 0)
71 #define ppbus_insb_epp(dev,buf,cnt) \
72 ppbus_io((dev), PPBUS_INSB_EPP, (buf), (cnt), 0)
74 #define ppbus_insw_epp(dev,buf,cnt) \
75 ppbus_io(( dev), PPBUS_INSW_EPP, (buf), (cnt), 0)
77 #define ppbus_insl_epp(dev,buf,cnt) \
78 ppbus_io((dev), PPBUS_INSL_EPP, (buf), (cnt), 0))
80 #define ppbus_repp_A(dev) \
81 ppbus_io((dev), PPBUS_REPP_A, NULL, 0, 0)
83 #define ppbus_repp_D(dev) \
84 ppbus_io((dev), PPBUS_REPP_D, NULL, 0, 0)
86 #define ppbus_recr(dev) \
87 ppbus_io((dev), PPBUS_RECR, NULL, 0, 0)
89 #define ppbus_rfifo(dev) \
90 ppbus_io((dev), PPBUS_RFIFO, NULL, 0, 0)
92 #define ppbus_wepp_A(dev,byte) \
93 ppbus_io((dev), PPBUS_WEPP_A, NULL, 0, (byte))
95 #define ppbus_wepp_D(dev,byte) \
96 ppbus_io((dev), PPBUS_WEPP_D, NULL, 0, (byte))
98 #define ppbus_wecr(dev,byte) \
99 ppbus_io((dev), PPBUS_WECR, NULL, 0, (byte))
101 #define ppbus_wfifo(dev,byte) \
102 ppbus_io((dev), PPBUS_WFIFO, NULL, 0, (byte))
104 #define ppbus_rdtr(dev) \
105 ppbus_io((dev), PPBUS_RDTR, NULL, 0, 0)
107 #define ppbus_rstr(dev) \
108 ppbus_io((dev), PPBUS_RSTR, NULL, 0, 0)
110 #define ppbus_rctr(dev) \
111 ppbus_io((dev), PPBUS_RCTR, NULL, 0, 0)
113 #define ppbus_wdtr(dev,byte) \
114 ppbus_io((dev), PPBUS_WDTR, NULL, 0, (byte))
116 #define ppbus_wstr(dev,byte) \
117 ppbus_io((dev), PPBUS_WSTR, NULL, 0, (byte))
119 #define ppbus_wctr(dev,byte) \
120 ppbus_io((dev), PPBUS_WCTR, NULL, 0, (byte))
122 #endif /* __PPBUS_IO_H */