FreeBSD/Linux Kernel Cross Reference
sys/dev/ppbus/nlpt.h
1 /*-
2 * Copyright (c) 1997 Nicolas Souchu
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * Distantly from :
27 * @(#)lptreg.h 1.1 (Berkeley) 12/19/90
28 * Id: lptreg.h,v 1.6 1997/02/22 09:36:52 peter Exp
29 *
30 * $FreeBSD$
31 */
32 #ifndef __NLPT_H
33 #define __NLPT_H
34
35 #define LPS_NERR 0x08 /* printer no error */
36 #define LPS_SEL 0x10 /* printer selected */
37 #define LPS_OUT 0x20 /* printer out of paper */
38 #define LPS_NACK 0x40 /* printer no ack of data */
39 #define LPS_NBSY 0x80 /* printer no ack of data */
40
41 #define LPC_STB 0x01 /* strobe data to printer */
42 #define LPC_AUTOL 0x02 /* automatic linefeed */
43 #define LPC_NINIT 0x04 /* initialize printer */
44 #define LPC_SEL 0x08 /* printer selected */
45 #define LPC_ENA 0x10 /* enable IRQ */
46
47 struct lpt_data {
48 unsigned short lpt_unit;
49
50 struct ppb_device lpt_dev;
51
52 short sc_state;
53 /* default case: negative prime, negative ack, handshake strobe,
54 prime once */
55 u_char sc_control;
56 char sc_flags;
57 #define LP_POS_INIT 0x04 /* if we are a postive init signal */
58 #define LP_POS_ACK 0x08 /* if we are a positive going ack */
59 #define LP_NO_PRIME 0x10 /* don't prime the printer at all */
60 #define LP_PRIMEOPEN 0x20 /* prime on every open */
61 #define LP_AUTOLF 0x40 /* tell printer to do an automatic lf */
62 #define LP_BYPASS 0x80 /* bypass printer ready checks */
63 struct buf *sc_inbuf;
64 struct buf *sc_statbuf;
65 short sc_xfercnt ;
66 char sc_primed;
67 char *sc_cp ;
68 u_short sc_irq ; /* IRQ status of port */
69 #define LP_HAS_IRQ 0x01 /* we have an irq available */
70 #define LP_USE_IRQ 0x02 /* we are using our irq */
71 #define LP_ENABLE_IRQ 0x04 /* enable IRQ on open */
72 #define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */
73 u_char sc_backoff ; /* time to call lptout() again */
74
75 #ifdef DEVFS
76 void *devfs_token;
77 void *devfs_token_ctl;
78 #endif
79 };
80
81 #endif
Cache object: 6cc106a644b998d7abdaecfd14b75993
|