1
2
3
4
5
6
7
8 #ifndef _LINUX_LP_H
9 #define _LINUX_LP_H
10
11
12 #include <linux/wait.h>
13 #include <linux/mutex.h>
14 #include <uapi/linux/lp.h>
15
16
17 #define LP_PARPORT_UNSPEC -4
18 #define LP_PARPORT_AUTO -3
19 #define LP_PARPORT_OFF -2
20 #define LP_PARPORT_NONE -1
21
22 #define LP_F(minor) lp_table[(minor)].flags
23 #define LP_CHAR(minor) lp_table[(minor)].chars
24 #define LP_TIME(minor) lp_table[(minor)].time
25 #define LP_WAIT(minor) lp_table[(minor)].wait
26 #define LP_IRQ(minor) lp_table[(minor)].dev->port->irq
27
28 #ifdef LP_STATS
29 #define LP_STAT(minor) lp_table[(minor)].stats
30 #endif
31 #define LP_BUFFER_SIZE PAGE_SIZE
32
33 #define LP_BASE(x) lp_table[(x)].dev->port->base
34
35 #ifdef LP_STATS
36 struct lp_stats {
37 unsigned long chars;
38 unsigned long sleeps;
39 unsigned int maxrun;
40 unsigned int maxwait;
41 unsigned int meanwait;
42 unsigned int mdev;
43 };
44 #endif
45
46 struct lp_struct {
47 struct pardevice *dev;
48 unsigned long flags;
49 unsigned int chars;
50 unsigned int time;
51 unsigned int wait;
52 char *lp_buffer;
53 #ifdef LP_STATS
54 unsigned int lastcall;
55 unsigned int runchars;
56 struct lp_stats stats;
57 #endif
58 wait_queue_head_t waitq;
59 unsigned int last_error;
60 struct mutex port_mutex;
61 wait_queue_head_t dataq;
62 long timeout;
63 unsigned int best_mode;
64 unsigned int current_mode;
65 unsigned long bits;
66 };
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82 #define LP_PINTEN 0x10
83 #define LP_PSELECP 0x08
84 #define LP_PINITP 0x04
85 #define LP_PAUTOLF 0x02
86 #define LP_PSTROBE 0x01
87
88
89
90
91
92
93 #define LP_DUMMY 0x00
94
95
96
97
98
99 #define LP_DELAY 50
100
101 #endif