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