Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
0002 /*
0003  * linux/include/linux/ppdev.h
0004  *
0005  * User-space parallel port device driver (header file).
0006  *
0007  * Copyright (C) 1998-9 Tim Waugh <tim@cyberelk.demon.co.uk>
0008  *
0009  * This program is free software; you can redistribute it and/or
0010  * modify it under the terms of the GNU General Public License
0011  * as published by the Free Software Foundation; either version
0012  * 2 of the License, or (at your option) any later version.
0013  *
0014  * Added PPGETTIME/PPSETTIME, Fred Barnes, 1999
0015  * Added PPGETMODES/PPGETMODE/PPGETPHASE, Fred Barnes <frmb2@ukc.ac.uk>, 03/01/2001
0016  */
0017 
0018 #ifndef _UAPI_LINUX_PPDEV_H
0019 #define _UAPI_LINUX_PPDEV_H
0020 
0021 #define PP_IOCTL    'p'
0022 
0023 /* Set mode for read/write (e.g. IEEE1284_MODE_EPP) */
0024 #define PPSETMODE   _IOW(PP_IOCTL, 0x80, int)
0025 
0026 /* Read status */
0027 #define PPRSTATUS   _IOR(PP_IOCTL, 0x81, unsigned char)
0028 #define PPWSTATUS   OBSOLETE__IOW(PP_IOCTL, 0x82, unsigned char)
0029 
0030 /* Read/write control */
0031 #define PPRCONTROL  _IOR(PP_IOCTL, 0x83, unsigned char)
0032 #define PPWCONTROL  _IOW(PP_IOCTL, 0x84, unsigned char)
0033 
0034 struct ppdev_frob_struct {
0035     unsigned char mask;
0036     unsigned char val;
0037 };
0038 #define PPFCONTROL      _IOW(PP_IOCTL, 0x8e, struct ppdev_frob_struct)
0039 
0040 /* Read/write data */
0041 #define PPRDATA     _IOR(PP_IOCTL, 0x85, unsigned char)
0042 #define PPWDATA     _IOW(PP_IOCTL, 0x86, unsigned char)
0043 
0044 /* Read/write econtrol (not used) */
0045 #define PPRECONTROL OBSOLETE__IOR(PP_IOCTL, 0x87, unsigned char)
0046 #define PPWECONTROL OBSOLETE__IOW(PP_IOCTL, 0x88, unsigned char)
0047 
0048 /* Read/write FIFO (not used) */
0049 #define PPRFIFO     OBSOLETE__IOR(PP_IOCTL, 0x89, unsigned char)
0050 #define PPWFIFO     OBSOLETE__IOW(PP_IOCTL, 0x8a, unsigned char)
0051 
0052 /* Claim the port to start using it */
0053 #define PPCLAIM     _IO(PP_IOCTL, 0x8b)
0054 
0055 /* Release the port when you aren't using it */
0056 #define PPRELEASE   _IO(PP_IOCTL, 0x8c)
0057 
0058 /* Yield the port (release it if another driver is waiting,
0059  * then reclaim) */
0060 #define PPYIELD     _IO(PP_IOCTL, 0x8d)
0061 
0062 /* Register device exclusively (must be before PPCLAIM). */
0063 #define PPEXCL      _IO(PP_IOCTL, 0x8f)
0064 
0065 /* Data line direction: non-zero for input mode. */
0066 #define PPDATADIR   _IOW(PP_IOCTL, 0x90, int)
0067 
0068 /* Negotiate a particular IEEE 1284 mode. */
0069 #define PPNEGOT     _IOW(PP_IOCTL, 0x91, int)
0070 
0071 /* Set control lines when an interrupt occurs. */
0072 #define PPWCTLONIRQ _IOW(PP_IOCTL, 0x92, unsigned char)
0073 
0074 /* Clear (and return) interrupt count. */
0075 #define PPCLRIRQ    _IOR(PP_IOCTL, 0x93, int)
0076 
0077 /* Set the IEEE 1284 phase that we're in (e.g. IEEE1284_PH_FWD_IDLE) */
0078 #define PPSETPHASE  _IOW(PP_IOCTL, 0x94, int)
0079 
0080 /* Set and get port timeout (struct timeval's) */
0081 #define PPGETTIME   _IOR(PP_IOCTL, 0x95, struct timeval)
0082 #define PPSETTIME   _IOW(PP_IOCTL, 0x96, struct timeval)
0083 
0084 /* Get available modes (what the hardware can do) */
0085 #define PPGETMODES  _IOR(PP_IOCTL, 0x97, unsigned int)
0086 
0087 /* Get the current mode and phaze */
0088 #define PPGETMODE   _IOR(PP_IOCTL, 0x98, int)
0089 #define PPGETPHASE  _IOR(PP_IOCTL, 0x99, int)
0090 
0091 /* get/set flags */
0092 #define PPGETFLAGS  _IOR(PP_IOCTL, 0x9a, int)
0093 #define PPSETFLAGS  _IOW(PP_IOCTL, 0x9b, int)
0094 
0095 /* flags visible to the world */
0096 #define PP_FASTWRITE    (1<<2)
0097 #define PP_FASTREAD (1<<3)
0098 #define PP_W91284PIC    (1<<4)
0099 
0100 /* only masks user-visible flags */
0101 #define PP_FLAGMASK (PP_FASTWRITE | PP_FASTREAD | PP_W91284PIC)
0102 
0103 #endif /* _UAPI_LINUX_PPDEV_H */