~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/lp.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * usr/include/linux/lp.h c.1991-1992 James Wiegand
  4  * many modifications copyright (C) 1992 Michael K. Johnson
  5  * Interrupt support added 1993 Nigel Gamble
  6  * Removed 8255 status defines from inside __KERNEL__ Marcelo Tosatti 
  7  */
  8 #ifndef _LINUX_LP_H
  9 #define _LINUX_LP_H
 10 
 11 
 12 #include <linux/wait.h>
 13 #include <linux/mutex.h>
 14 #include <uapi/linux/lp.h>
 15 
 16 /* Magic numbers for defining port-device mappings */
 17 #define LP_PARPORT_UNSPEC -4
 18 #define LP_PARPORT_AUTO -3
 19 #define LP_PARPORT_OFF -2
 20 #define LP_PARPORT_NONE -1
 21 
 22 #define LP_F(minor)     lp_table[(minor)].flags         /* flags for busy, etc. */
 23 #define LP_CHAR(minor)  lp_table[(minor)].chars         /* busy timeout */
 24 #define LP_TIME(minor)  lp_table[(minor)].time          /* wait time */
 25 #define LP_WAIT(minor)  lp_table[(minor)].wait          /* strobe wait */
 26 #define LP_IRQ(minor)   lp_table[(minor)].dev->port->irq /* interrupt # */
 27                                         /* PARPORT_IRQ_NONE means polled */
 28 #ifdef LP_STATS
 29 #define LP_STAT(minor)  lp_table[(minor)].stats         /* statistics area */
 30 #endif
 31 #define LP_BUFFER_SIZE PAGE_SIZE
 32 
 33 #define LP_BASE(x)      lp_table[(x)].dev->port->base
 34 
 35 #ifdef LP_STATS
 36 struct lp_stats {
 37         unsigned long chars;
 38         unsigned long sleeps;
 39         unsigned int maxrun;
 40         unsigned int maxwait;
 41         unsigned int meanwait;
 42         unsigned int mdev;
 43 };
 44 #endif
 45 
 46 struct lp_struct {
 47         struct pardevice *dev;
 48         unsigned long flags;
 49         unsigned int chars;
 50         unsigned int time;
 51         unsigned int wait;
 52         char *lp_buffer;
 53 #ifdef LP_STATS
 54         unsigned int lastcall;
 55         unsigned int runchars;
 56         struct lp_stats stats;
 57 #endif
 58         wait_queue_head_t waitq;
 59         unsigned int last_error;
 60         struct mutex port_mutex;
 61         wait_queue_head_t dataq;
 62         long timeout;
 63         unsigned int best_mode;
 64         unsigned int current_mode;
 65         unsigned long bits;
 66 };
 67 
 68 /*
 69  * The following constants describe the various signals of the printer port
 70  * hardware.  Note that the hardware inverts some signals and that some
 71  * signals are active low.  An example is LP_STROBE, which must be programmed
 72  * with 1 for being active and 0 for being inactive, because the strobe signal
 73  * gets inverted, but it is also active low.
 74  */
 75 
 76 
 77 /* 
 78  * defines for 8255 control port
 79  * base + 2 
 80  * accessed with LP_C(minor)
 81  */
 82 #define LP_PINTEN       0x10  /* high to read data in or-ed with data out */
 83 #define LP_PSELECP      0x08  /* inverted output, active low */
 84 #define LP_PINITP       0x04  /* unchanged output, active low */
 85 #define LP_PAUTOLF      0x02  /* inverted output, active low */
 86 #define LP_PSTROBE      0x01  /* short high output on raising edge */
 87 
 88 /* 
 89  * the value written to ports to test existence. PC-style ports will 
 90  * return the value written. AT-style ports will return 0. so why not
 91  * make them the same ? 
 92  */
 93 #define LP_DUMMY        0x00
 94 
 95 /*
 96  * This is the port delay time, in microseconds.
 97  * It is used only in the lp_init() and lp_reset() routine.
 98  */
 99 #define LP_DELAY        50
100 
101 #endif
102 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php