Import 2.1.42pre1
[davej-history.git] / include / linux / lp_m68k.h
blobca8f7a31dc9e54b3abc67d364bc5f2591498b3b9
1 #ifndef _LINUX_LP_H
2 #define _LINUX_LP_H
4 /*
5 * split in two parts by Joerg Dorchain
6 * usr/include/linux/lp.h modified for Amiga by Michael Rausch
7 * modified for Atari by Andreas Schwab
8 * bug fixed by Jes Sorensen 18/8-94:
9 * It was not possible to compile the kernel only for Atari or Amiga.
11 * linux i386 version c.1991-1992 James Wiegand
12 * many modifications copyright (C) 1992 Michael K. Johnson
13 * Interrupt support added 1993 Nigel Gamble
17 * many many printers are we going to support? currently, this is the
18 * hardcoded limit
20 #define MAX_LP 5
23 * Per POSIX guidelines, this module reserves the LP and lp prefixes
24 * These are the lp_table[minor].flags flags...
26 #define LP_EXIST 0x0001
27 #define LP_BUSY 0x0004
28 #define LP_ABORT 0x0040
29 #define LP_CAREFUL 0x0080
30 #define LP_ABORTOPEN 0x0100
32 /* timeout for each character. This is relative to bus cycles -- it
33 * is the count in a busy loop. THIS IS THE VALUE TO CHANGE if you
34 * have extremely slow printing, or if the machine seems to slow down
35 * a lot when you print. If you have slow printing, increase this
36 * number and recompile, and if your system gets bogged down, decrease
37 * this number. This can be changed with the tunelp(8) command as well.
40 #define LP_INIT_CHAR 1000
42 /* The parallel port specs apparently say that there needs to be
43 * a .5usec wait before and after the strobe. Since there are wildly
44 * different computers running linux, I can't come up with a perfect
45 * value, but since it worked well on most printers before without,
46 * I'll initialize it to 0.
49 #define LP_INIT_WAIT 0
51 /* This is the amount of time that the driver waits for the printer to
52 * catch up when the printer's buffer appears to be filled. If you
53 * want to tune this and have a fast printer (i.e. HPIIIP), decrease
54 * this number, and if you have a slow printer, increase this number.
55 * This is in hundredths of a second, the default 2 being .05 second.
56 * Or use the tunelp(8) command, which is especially nice if you want
57 * change back and forth between character and graphics printing, which
58 * are wildly different...
61 #define LP_INIT_TIME 40
63 /* IOCTL numbers */
64 #define LPCHAR 0x0601 /* corresponds to LP_INIT_CHAR */
65 #define LPTIME 0x0602 /* corresponds to LP_INIT_TIME */
66 #define LPABORT 0x0604 /* call with TRUE arg to abort on error,
67 FALSE to retry. Default is retry. */
68 #define LPSETIRQ 0x0605 /* call with new IRQ number,
69 or 0 for polling (no IRQ) */
70 #define LPGETIRQ 0x0606 /* get the current IRQ number */
71 #define LPWAIT 0x0608 /* corresponds to LP_INIT_WAIT */
72 #define LPCAREFUL 0x0609 /* call with TRUE arg to require out-of-paper, off-
73 line, and error indicators good on all writes,
74 FALSE to ignore them. Default is ignore. */
75 #define LPABORTOPEN 0x060a /* call with TRUE arg to abort open() on error,
76 FALSE to ignore error. Default is ignore. */
77 #define LPGETSTATUS 0x060b /* return LP_S(minor) */
78 #define LPRESET 0x060c /* reset printer */
80 /* timeout for printk'ing a timeout, in jiffies (100ths of a second).
81 This is also used for re-checking error conditions if LP_ABORT is
82 not set. This is the default behavior. */
84 #define LP_TIMEOUT_INTERRUPT (60 * HZ)
85 #define LP_TIMEOUT_POLLED (10 * HZ)
88 #define LP_BUFFER_SIZE 1024 /*256*/
90 enum lp_type {
91 LP_UNKNOWN = 0,
92 LP_AMIGA = 1,
93 LP_ATARI = 2,
94 LP_MFC = 3,
95 LP_IOEXT = 4
99 * warning: this structure is in kernel space and has to fit in one page,
100 * i.e. must not be larger than 4k
102 struct lp_struct {
103 char *name;
104 unsigned int irq;
105 void (*lp_out)(int,int); /*output char function*/
106 int (*lp_is_busy)(int);
107 int (*lp_has_pout)(int);
108 int (*lp_is_online)(int);
109 int (*lp_dummy)(int);
110 int (*lp_ioctl)(int, unsigned int, unsigned long);
111 int (*lp_open)(int); /* for module use counter */
112 void (*lp_release)(int); /* for module use counter */
113 int flags; /*for BUSY... */
114 unsigned int chars; /*busy timeout */
115 unsigned int time; /*wait time */
116 unsigned int wait;
117 struct wait_queue *lp_wait_q; /*strobe wait */
118 void *base; /* hardware drivers internal use*/
119 enum lp_type type;
120 char lp_buffer[LP_BUFFER_SIZE];
121 int do_print;
122 unsigned long copy_size,bytes_written;
125 extern struct lp_struct *lp_table[MAX_LP];
126 extern unsigned int lp_irq;
128 void lp_interrupt(int dev);
129 int lp_init(void);
130 int register_parallel(struct lp_struct *, int);
131 void unregister_parallel(int);
133 #endif