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