Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Any part of this program may be used in documents licensed under
0003  * the GNU Free Documentation License, Version 1.1 or any later version
0004  * published by the Free Software Foundation.
0005  */
0006 
0007 #ifndef _UAPI_PARPORT_H_
0008 #define _UAPI_PARPORT_H_
0009 
0010 /* Start off with user-visible constants */
0011 
0012 /* Maximum of 16 ports per machine */
0013 #define PARPORT_MAX  16
0014 
0015 /* Magic numbers */
0016 #define PARPORT_IRQ_NONE  -1
0017 #define PARPORT_DMA_NONE  -1
0018 #define PARPORT_IRQ_AUTO  -2
0019 #define PARPORT_DMA_AUTO  -2
0020 #define PARPORT_DMA_NOFIFO -3
0021 #define PARPORT_DISABLE   -2
0022 #define PARPORT_IRQ_PROBEONLY -3
0023 #define PARPORT_IOHI_AUTO -1
0024 
0025 #define PARPORT_CONTROL_STROBE    0x1
0026 #define PARPORT_CONTROL_AUTOFD    0x2
0027 #define PARPORT_CONTROL_INIT      0x4
0028 #define PARPORT_CONTROL_SELECT    0x8
0029 
0030 #define PARPORT_STATUS_ERROR      0x8
0031 #define PARPORT_STATUS_SELECT     0x10
0032 #define PARPORT_STATUS_PAPEROUT   0x20
0033 #define PARPORT_STATUS_ACK        0x40
0034 #define PARPORT_STATUS_BUSY       0x80
0035 
0036 /* Type classes for Plug-and-Play probe.  */
0037 typedef enum {
0038     PARPORT_CLASS_LEGACY = 0,       /* Non-IEEE1284 device */
0039     PARPORT_CLASS_PRINTER,
0040     PARPORT_CLASS_MODEM,
0041     PARPORT_CLASS_NET,
0042     PARPORT_CLASS_HDC,              /* Hard disk controller */
0043     PARPORT_CLASS_PCMCIA,
0044     PARPORT_CLASS_MEDIA,            /* Multimedia device */
0045     PARPORT_CLASS_FDC,              /* Floppy disk controller */
0046     PARPORT_CLASS_PORTS,
0047     PARPORT_CLASS_SCANNER,
0048     PARPORT_CLASS_DIGCAM,
0049     PARPORT_CLASS_OTHER,            /* Anything else */
0050     PARPORT_CLASS_UNSPEC,           /* No CLS field in ID */
0051     PARPORT_CLASS_SCSIADAPTER
0052 } parport_device_class;
0053 
0054 /* The "modes" entry in parport is a bit field representing the
0055    capabilities of the hardware. */
0056 #define PARPORT_MODE_PCSPP  (1<<0) /* IBM PC registers available. */
0057 #define PARPORT_MODE_TRISTATE   (1<<1) /* Can tristate. */
0058 #define PARPORT_MODE_EPP    (1<<2) /* Hardware EPP. */
0059 #define PARPORT_MODE_ECP    (1<<3) /* Hardware ECP. */
0060 #define PARPORT_MODE_COMPAT (1<<4) /* Hardware 'printer protocol'. */
0061 #define PARPORT_MODE_DMA    (1<<5) /* Hardware can DMA. */
0062 #define PARPORT_MODE_SAFEININT  (1<<6) /* SPP registers accessible in IRQ. */
0063 
0064 /* IEEE1284 modes: 
0065    Nibble mode, byte mode, ECP, ECPRLE and EPP are their own
0066    'extensibility request' values.  Others are special.
0067    'Real' ECP modes must have the IEEE1284_MODE_ECP bit set.  */
0068 #define IEEE1284_MODE_NIBBLE             0
0069 #define IEEE1284_MODE_BYTE              (1<<0)
0070 #define IEEE1284_MODE_COMPAT            (1<<8)
0071 #define IEEE1284_MODE_BECP              (1<<9) /* Bounded ECP mode */
0072 #define IEEE1284_MODE_ECP               (1<<4)
0073 #define IEEE1284_MODE_ECPRLE            (IEEE1284_MODE_ECP | (1<<5))
0074 #define IEEE1284_MODE_ECPSWE            (1<<10) /* Software-emulated */
0075 #define IEEE1284_MODE_EPP               (1<<6)
0076 #define IEEE1284_MODE_EPPSL             (1<<11) /* EPP 1.7 */
0077 #define IEEE1284_MODE_EPPSWE            (1<<12) /* Software-emulated */
0078 #define IEEE1284_DEVICEID               (1<<2)  /* This is a flag */
0079 #define IEEE1284_EXT_LINK               (1<<14) /* This flag causes the
0080                          * extensibility link to
0081                          * be requested, using
0082                          * bits 0-6. */
0083 
0084 /* For the benefit of parport_read/write, you can use these with
0085  * parport_negotiate to use address operations.  They have no effect
0086  * other than to make parport_read/write use address transfers. */
0087 #define IEEE1284_ADDR           (1<<13) /* This is a flag */
0088 #define IEEE1284_DATA            0  /* So is this */
0089 
0090 /* Flags for block transfer operations. */
0091 #define PARPORT_EPP_FAST        (1<<0) /* Unreliable counts. */
0092 #define PARPORT_W91284PIC       (1<<1) /* have a Warp9 w91284pic in the device */
0093 
0094 /* The rest is for the kernel only */
0095 #endif /* _UAPI_PARPORT_H_ */