Home | History | Annotate | Download | only in linux
      1 /* $Id: parport.h,v 1.1 1998/05/17 10:57:52 andrea Exp andrea $ */
      2 
      3 /*
      4  * Any part of this program may be used in documents licensed under
      5  * the GNU Free Documentation License, Version 1.1 or any later version
      6  * published by the Free Software Foundation.
      7  */
      8 
      9 #ifndef _PARPORT_H_
     10 #define _PARPORT_H_
     11 
     12 /* Start off with user-visible constants */
     13 
     14 /* Maximum of 16 ports per machine */
     15 #define PARPORT_MAX  16
     16 
     17 /* Magic numbers */
     18 #define PARPORT_IRQ_NONE  -1
     19 #define PARPORT_DMA_NONE  -1
     20 #define PARPORT_IRQ_AUTO  -2
     21 #define PARPORT_DMA_AUTO  -2
     22 #define PARPORT_DMA_NOFIFO -3
     23 #define PARPORT_DISABLE   -2
     24 #define PARPORT_IRQ_PROBEONLY -3
     25 #define PARPORT_IOHI_AUTO -1
     26 
     27 #define PARPORT_CONTROL_STROBE    0x1
     28 #define PARPORT_CONTROL_AUTOFD    0x2
     29 #define PARPORT_CONTROL_INIT      0x4
     30 #define PARPORT_CONTROL_SELECT    0x8
     31 
     32 #define PARPORT_STATUS_ERROR      0x8
     33 #define PARPORT_STATUS_SELECT     0x10
     34 #define PARPORT_STATUS_PAPEROUT   0x20
     35 #define PARPORT_STATUS_ACK        0x40
     36 #define PARPORT_STATUS_BUSY       0x80
     37 
     38 /* Type classes for Plug-and-Play probe.  */
     39 typedef enum {
     40 	PARPORT_CLASS_LEGACY = 0,       /* Non-IEEE1284 device */
     41 	PARPORT_CLASS_PRINTER,
     42 	PARPORT_CLASS_MODEM,
     43 	PARPORT_CLASS_NET,
     44 	PARPORT_CLASS_HDC,              /* Hard disk controller */
     45 	PARPORT_CLASS_PCMCIA,
     46 	PARPORT_CLASS_MEDIA,            /* Multimedia device */
     47 	PARPORT_CLASS_FDC,              /* Floppy disk controller */
     48 	PARPORT_CLASS_PORTS,
     49 	PARPORT_CLASS_SCANNER,
     50 	PARPORT_CLASS_DIGCAM,
     51 	PARPORT_CLASS_OTHER,            /* Anything else */
     52 	PARPORT_CLASS_UNSPEC,           /* No CLS field in ID */
     53 	PARPORT_CLASS_SCSIADAPTER
     54 } parport_device_class;
     55 
     56 /* The "modes" entry in parport is a bit field representing the
     57    capabilities of the hardware. */
     58 #define PARPORT_MODE_PCSPP	(1<<0) /* IBM PC registers available. */
     59 #define PARPORT_MODE_TRISTATE	(1<<1) /* Can tristate. */
     60 #define PARPORT_MODE_EPP	(1<<2) /* Hardware EPP. */
     61 #define PARPORT_MODE_ECP	(1<<3) /* Hardware ECP. */
     62 #define PARPORT_MODE_COMPAT	(1<<4) /* Hardware 'printer protocol'. */
     63 #define PARPORT_MODE_DMA	(1<<5) /* Hardware can DMA. */
     64 #define PARPORT_MODE_SAFEININT	(1<<6) /* SPP registers accessible in IRQ. */
     65 
     66 /* IEEE1284 modes:
     67    Nibble mode, byte mode, ECP, ECPRLE and EPP are their own
     68    'extensibility request' values.  Others are special.
     69    'Real' ECP modes must have the IEEE1284_MODE_ECP bit set.  */
     70 #define IEEE1284_MODE_NIBBLE             0
     71 #define IEEE1284_MODE_BYTE              (1<<0)
     72 #define IEEE1284_MODE_COMPAT            (1<<8)
     73 #define IEEE1284_MODE_BECP              (1<<9) /* Bounded ECP mode */
     74 #define IEEE1284_MODE_ECP               (1<<4)
     75 #define IEEE1284_MODE_ECPRLE            (IEEE1284_MODE_ECP | (1<<5))
     76 #define IEEE1284_MODE_ECPSWE            (1<<10) /* Software-emulated */
     77 #define IEEE1284_MODE_EPP               (1<<6)
     78 #define IEEE1284_MODE_EPPSL             (1<<11) /* EPP 1.7 */
     79 #define IEEE1284_MODE_EPPSWE            (1<<12) /* Software-emulated */
     80 #define IEEE1284_DEVICEID               (1<<2)  /* This is a flag */
     81 #define IEEE1284_EXT_LINK               (1<<14) /* This flag causes the
     82 						 * extensibility link to
     83 						 * be requested, using
     84 						 * bits 0-6. */
     85 
     86 /* For the benefit of parport_read/write, you can use these with
     87  * parport_negotiate to use address operations.  They have no effect
     88  * other than to make parport_read/write use address transfers. */
     89 #define IEEE1284_ADDR			(1<<13)	/* This is a flag */
     90 #define IEEE1284_DATA			 0	/* So is this */
     91 
     92 /* Flags for block transfer operations. */
     93 #define PARPORT_EPP_FAST		(1<<0) /* Unreliable counts. */
     94 #define PARPORT_W91284PIC		(1<<1) /* have a Warp9 w91284pic in the device */
     95 
     96 /* The rest is for the kernel only */
     97 #endif /* _PARPORT_H_ */
     98