ppdev.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /*
  3. * linux/include/linux/ppdev.h
  4. *
  5. * User-space parallel port device driver (header file).
  6. *
  7. * Copyright (C) 1998-9 Tim Waugh <[email protected]>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version
  12. * 2 of the License, or (at your option) any later version.
  13. *
  14. * Added PPGETTIME/PPSETTIME, Fred Barnes, 1999
  15. * Added PPGETMODES/PPGETMODE/PPGETPHASE, Fred Barnes <[email protected]>, 03/01/2001
  16. */
  17. #ifndef _UAPI_LINUX_PPDEV_H
  18. #define _UAPI_LINUX_PPDEV_H
  19. #define PP_IOCTL 'p'
  20. /* Set mode for read/write (e.g. IEEE1284_MODE_EPP) */
  21. #define PPSETMODE _IOW(PP_IOCTL, 0x80, int)
  22. /* Read status */
  23. #define PPRSTATUS _IOR(PP_IOCTL, 0x81, unsigned char)
  24. #define PPWSTATUS OBSOLETE__IOW(PP_IOCTL, 0x82, unsigned char)
  25. /* Read/write control */
  26. #define PPRCONTROL _IOR(PP_IOCTL, 0x83, unsigned char)
  27. #define PPWCONTROL _IOW(PP_IOCTL, 0x84, unsigned char)
  28. struct ppdev_frob_struct {
  29. unsigned char mask;
  30. unsigned char val;
  31. };
  32. #define PPFCONTROL _IOW(PP_IOCTL, 0x8e, struct ppdev_frob_struct)
  33. /* Read/write data */
  34. #define PPRDATA _IOR(PP_IOCTL, 0x85, unsigned char)
  35. #define PPWDATA _IOW(PP_IOCTL, 0x86, unsigned char)
  36. /* Read/write econtrol (not used) */
  37. #define PPRECONTROL OBSOLETE__IOR(PP_IOCTL, 0x87, unsigned char)
  38. #define PPWECONTROL OBSOLETE__IOW(PP_IOCTL, 0x88, unsigned char)
  39. /* Read/write FIFO (not used) */
  40. #define PPRFIFO OBSOLETE__IOR(PP_IOCTL, 0x89, unsigned char)
  41. #define PPWFIFO OBSOLETE__IOW(PP_IOCTL, 0x8a, unsigned char)
  42. /* Claim the port to start using it */
  43. #define PPCLAIM _IO(PP_IOCTL, 0x8b)
  44. /* Release the port when you aren't using it */
  45. #define PPRELEASE _IO(PP_IOCTL, 0x8c)
  46. /* Yield the port (release it if another driver is waiting,
  47. * then reclaim) */
  48. #define PPYIELD _IO(PP_IOCTL, 0x8d)
  49. /* Register device exclusively (must be before PPCLAIM). */
  50. #define PPEXCL _IO(PP_IOCTL, 0x8f)
  51. /* Data line direction: non-zero for input mode. */
  52. #define PPDATADIR _IOW(PP_IOCTL, 0x90, int)
  53. /* Negotiate a particular IEEE 1284 mode. */
  54. #define PPNEGOT _IOW(PP_IOCTL, 0x91, int)
  55. /* Set control lines when an interrupt occurs. */
  56. #define PPWCTLONIRQ _IOW(PP_IOCTL, 0x92, unsigned char)
  57. /* Clear (and return) interrupt count. */
  58. #define PPCLRIRQ _IOR(PP_IOCTL, 0x93, int)
  59. /* Set the IEEE 1284 phase that we're in (e.g. IEEE1284_PH_FWD_IDLE) */
  60. #define PPSETPHASE _IOW(PP_IOCTL, 0x94, int)
  61. /* Set and get port timeout (struct timeval's) */
  62. #define PPGETTIME _IOR(PP_IOCTL, 0x95, struct timeval)
  63. #define PPSETTIME _IOW(PP_IOCTL, 0x96, struct timeval)
  64. /* Get available modes (what the hardware can do) */
  65. #define PPGETMODES _IOR(PP_IOCTL, 0x97, unsigned int)
  66. /* Get the current mode and phaze */
  67. #define PPGETMODE _IOR(PP_IOCTL, 0x98, int)
  68. #define PPGETPHASE _IOR(PP_IOCTL, 0x99, int)
  69. /* get/set flags */
  70. #define PPGETFLAGS _IOR(PP_IOCTL, 0x9a, int)
  71. #define PPSETFLAGS _IOW(PP_IOCTL, 0x9b, int)
  72. /* flags visible to the world */
  73. #define PP_FASTWRITE (1<<2)
  74. #define PP_FASTREAD (1<<3)
  75. #define PP_W91284PIC (1<<4)
  76. /* only masks user-visible flags */
  77. #define PP_FLAGMASK (PP_FASTWRITE | PP_FASTREAD | PP_W91284PIC)
  78. #endif /* _UAPI_LINUX_PPDEV_H */