0001
0002
0003
0004
0005
0006
0007
0008 #ifndef _LINUX_LP_H
0009 #define _LINUX_LP_H
0010
0011
0012 #include <linux/wait.h>
0013 #include <linux/mutex.h>
0014 #include <uapi/linux/lp.h>
0015
0016
0017 #define LP_PARPORT_UNSPEC -4
0018 #define LP_PARPORT_AUTO -3
0019 #define LP_PARPORT_OFF -2
0020 #define LP_PARPORT_NONE -1
0021
0022 #define LP_F(minor) lp_table[(minor)].flags
0023 #define LP_CHAR(minor) lp_table[(minor)].chars
0024 #define LP_TIME(minor) lp_table[(minor)].time
0025 #define LP_WAIT(minor) lp_table[(minor)].wait
0026 #define LP_IRQ(minor) lp_table[(minor)].dev->port->irq
0027
0028 #ifdef LP_STATS
0029 #define LP_STAT(minor) lp_table[(minor)].stats
0030 #endif
0031 #define LP_BUFFER_SIZE PAGE_SIZE
0032
0033 #define LP_BASE(x) lp_table[(x)].dev->port->base
0034
0035 #ifdef LP_STATS
0036 struct lp_stats {
0037 unsigned long chars;
0038 unsigned long sleeps;
0039 unsigned int maxrun;
0040 unsigned int maxwait;
0041 unsigned int meanwait;
0042 unsigned int mdev;
0043 };
0044 #endif
0045
0046 struct lp_struct {
0047 struct pardevice *dev;
0048 unsigned long flags;
0049 unsigned int chars;
0050 unsigned int time;
0051 unsigned int wait;
0052 char *lp_buffer;
0053 #ifdef LP_STATS
0054 unsigned int lastcall;
0055 unsigned int runchars;
0056 struct lp_stats stats;
0057 #endif
0058 wait_queue_head_t waitq;
0059 unsigned int last_error;
0060 struct mutex port_mutex;
0061 wait_queue_head_t dataq;
0062 long timeout;
0063 unsigned int best_mode;
0064 unsigned int current_mode;
0065 unsigned long bits;
0066 };
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082 #define LP_PINTEN 0x10
0083 #define LP_PSELECP 0x08
0084 #define LP_PINITP 0x04
0085 #define LP_PAUTOLF 0x02
0086 #define LP_PSTROBE 0x01
0087
0088
0089
0090
0091
0092
0093 #define LP_DUMMY 0x00
0094
0095
0096
0097
0098
0099 #define LP_DELAY 50
0100
0101 #endif