parport.h 3.6 KB

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