[PARPORT] User space parport driver


Tim Waugh (tim@cyberelk.demon.co.uk)
Mon, 16 Feb 1998 22:22:24 +0000 (GMT)


Hi guys,

I've just made ppuser-0.1 available, and it can be found at

        <http://www.cyberelk.demon.co.uk/parport/ppuser-0.1.tar.gz>
and <ftp://ftp.torque.net/pub/parport/ppuser-0.1.tar.gz>

You need the latest patch (980112), plus the one at the end of this mail.
Included in the tarball is a trivial test program, and it successfully
made my printer greet the world. :-)

Have a play with it.

Tim.
*/

--- linux/include/linux/parport.h~ Mon Feb 16 22:08:38 1998
+++ linux/include/linux/parport.h Mon Feb 16 22:08:43 1998
@@ -3,6 +3,61 @@
 #ifndef _PARPORT_H_
 #define _PARPORT_H_
 
+/* Maximum of 8 ports per machine */
+#define PARPORT_MAX 8
+
+#define PARPORT_CONTROL_STROBE 0x1
+#define PARPORT_CONTROL_AUTOFD 0x2
+#define PARPORT_CONTROL_INIT 0x4
+#define PARPORT_CONTROL_SELECT 0x8
+#define PARPORT_CONTROL_INTEN 0x10
+#define PARPORT_CONTROL_DIRECTION 0x20
+
+#define PARPORT_STATUS_ERROR 0x8
+#define PARPORT_STATUS_SELECT 0x10
+#define PARPORT_STATUS_PAPEROUT 0x20
+#define PARPORT_STATUS_ACK 0x40
+#define PARPORT_STATUS_BUSY 0x80
+
+/* Type classes for Plug-and-Play probe. */
+typedef enum {
+ PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */
+ PARPORT_CLASS_PRINTER,
+ PARPORT_CLASS_MODEM,
+ PARPORT_CLASS_NET,
+ PARPORT_CLASS_HDC, /* Hard disk controller */
+ PARPORT_CLASS_PCMCIA,
+ PARPORT_CLASS_MEDIA, /* Multimedia device */
+ PARPORT_CLASS_FDC, /* Floppy disk controller */
+ PARPORT_CLASS_PORTS,
+ PARPORT_CLASS_SCANNER,
+ PARPORT_CLASS_DIGCAM,
+ PARPORT_CLASS_OTHER, /* Anything else */
+ PARPORT_CLASS_UNSPEC /* No CLS field in ID */
+} parport_device_class;
+
+struct parport_device_info {
+ parport_device_class class;
+ char *mfr;
+ char *model;
+ char *cmdset;
+ char *description;
+};
+
+/* The "modes" entry in parport is a bit field representing the following
+ * modes.
+ * Note that LP_ECPEPP is for the SMC EPP+ECP mode which is NOT
+ * 100% compatible with EPP.
+ */
+#define PARPORT_MODE_PCSPP 0x0001
+#define PARPORT_MODE_PCPS2 0x0002
+#define PARPORT_MODE_PCEPP 0x0004
+#define PARPORT_MODE_PCECP 0x0008
+#define PARPORT_MODE_PCECPEPP 0x0010
+#define PARPORT_MODE_PCECR 0x0020 /* ECR Register Exists */
+#define PARPORT_MODE_PCECPPS2 0x0040
+
+#ifdef __KERNEL__
 #include <asm/system.h>
 #include <asm/ptrace.h>
 #include <asm/spinlock.h>
@@ -11,9 +66,6 @@
 
 #define PARPORT_NEED_GENERIC_OPS
 
-/* Maximum of 8 ports per machine */
-#define PARPORT_MAX 8
-
 /* Magic numbers */
 #define PARPORT_IRQ_NONE -1
 #define PARPORT_DMA_NONE -1
@@ -81,44 +133,6 @@
         void (*dec_use_count)(void);
 };
 
-#define PARPORT_CONTROL_STROBE 0x1
-#define PARPORT_CONTROL_AUTOFD 0x2
-#define PARPORT_CONTROL_INIT 0x4
-#define PARPORT_CONTROL_SELECT 0x8
-#define PARPORT_CONTROL_INTEN 0x10
-#define PARPORT_CONTROL_DIRECTION 0x20
-
-#define PARPORT_STATUS_ERROR 0x8
-#define PARPORT_STATUS_SELECT 0x10
-#define PARPORT_STATUS_PAPEROUT 0x20
-#define PARPORT_STATUS_ACK 0x40
-#define PARPORT_STATUS_BUSY 0x80
-
-/* Type classes for Plug-and-Play probe. */
-typedef enum {
- PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */
- PARPORT_CLASS_PRINTER,
- PARPORT_CLASS_MODEM,
- PARPORT_CLASS_NET,
- PARPORT_CLASS_HDC, /* Hard disk controller */
- PARPORT_CLASS_PCMCIA,
- PARPORT_CLASS_MEDIA, /* Multimedia device */
- PARPORT_CLASS_FDC, /* Floppy disk controller */
- PARPORT_CLASS_PORTS,
- PARPORT_CLASS_SCANNER,
- PARPORT_CLASS_DIGCAM,
- PARPORT_CLASS_OTHER, /* Anything else */
- PARPORT_CLASS_UNSPEC /* No CLS field in ID */
-} parport_device_class;
-
-struct parport_device_info {
- parport_device_class class;
- char *mfr;
- char *model;
- char *cmdset;
- char *description;
-};
-
 /* Each device can have two callback functions:
  * 1) a preemption function, called by the resource manager to request
  * that the driver relinquish control of the port. The driver should
@@ -272,19 +286,6 @@
         return parport_claim_or_block (dev);
 }
 
-/* The "modes" entry in parport is a bit field representing the following
- * modes.
- * Note that LP_ECPEPP is for the SMC EPP+ECP mode which is NOT
- * 100% compatible with EPP.
- */
-#define PARPORT_MODE_PCSPP 0x0001
-#define PARPORT_MODE_PCPS2 0x0002
-#define PARPORT_MODE_PCEPP 0x0004
-#define PARPORT_MODE_PCECP 0x0008
-#define PARPORT_MODE_PCECPEPP 0x0010
-#define PARPORT_MODE_PCECR 0x0020 /* ECR Register Exists */
-#define PARPORT_MODE_PCECPPS2 0x0040
-
 /* Flags used to identify what a device does. */
 #define PARPORT_DEV_TRAN 0x0000 /* We're transient. */
 #define PARPORT_DEV_LURK 0x0001 /* We lurk. */
@@ -348,4 +349,5 @@
 #define parport_claim_resources(p) (p)->ops->claim_resources(p)
 #endif
 
+#endif /* __KERNEL__ */
 #endif /* _PARPORT_H_ */

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Wed 30 Dec 1998 - 10:17:28 EST