patch-2.1.33 linux/include/linux/lp.h

Next file: linux/include/linux/parport.h
Previous file: linux/include/asm-i386/uaccess.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.32/linux/include/linux/lp.h linux/include/linux/lp.h
@@ -78,19 +78,31 @@
 #define LP_TIMEOUT_INTERRUPT	(60 * HZ)
 #define LP_TIMEOUT_POLLED	(10 * HZ)
 
-#define LP_B(minor)	lp_table[(minor)].base		/* IO address */
 #define LP_F(minor)	lp_table[(minor)].flags		/* flags for busy, etc. */
-#define LP_S(minor)	inb_p(LP_B((minor)) + 1)	/* status port */
-#define LP_C(minor)	(lp_table[(minor)].base + 2)	/* control port */
 #define LP_CHAR(minor)	lp_table[(minor)].chars		/* busy timeout */
 #define LP_TIME(minor)	lp_table[(minor)].time		/* wait time */
 #define LP_WAIT(minor)	lp_table[(minor)].wait		/* strobe wait */
-#define LP_IRQ(minor)	lp_table[(minor)].irq		/* interrupt # */
+#define LP_IRQ(minor)	lp_table[(minor)].dev->port->irq /* interrupt # */
 							/* 0 means polled */
 #define LP_STAT(minor)	lp_table[(minor)].stats		/* statistics area */
-
 #define LP_BUFFER_SIZE 256
 
+#define LP_BASE(x)	lp_table[(x)].dev->port->base
+
+#define r_dtr(x)	inb(LP_BASE(x))
+#define r_str(x)	inb(LP_BASE(x)+1)
+#define r_ctr(x)	inb(LP_BASE(x)+2)
+#define r_epp(x)	inb(LP_BASE(x)+4)
+#define r_fifo(x)	inb(LP_BASE(x)+0x400)
+#define r_ecr(x)	inb(LP_BASE(x)+0x402)
+
+#define w_dtr(x,y)	outb((y), LP_BASE(x))
+#define w_str(x,y)	outb((y), LP_BASE(x)+1)
+#define w_ctr(x,y)	outb((y), LP_BASE(x)+2)
+#define w_epp(x,y)	outb((y), LP_BASE(x)+4)
+#define w_fifo(x,y)	outb((y), LP_BASE(x)+0x400)
+#define w_ecr(x,y)	outb((y), LP_BASE(x)+0x402)
+
 struct lp_stats {
 	unsigned long chars;
 	unsigned long sleeps;
@@ -101,8 +113,7 @@
 };
 
 struct lp_struct {
-	int base;
-	unsigned int irq;
+	struct ppd *dev;
 	int flags;
 	unsigned int chars;
 	unsigned int time;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov