ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

parallel.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 /*
00004  * usr/include/linux/lp.h c.1991-1992 James Wiegand
00005  * many modifications copyright (C) 1992 Michael K. Johnson
00006  * Interrupt support added 1993 Nigel Gamble
00007  */
00008 
00009 /*
00010  * Per POSIX guidelines, this module reserves the LP and lp prefixes
00011  * These are the lp_table[minor].flags flags...
00012  */
00013 #define LP_EXIST 0x0001
00014 #define LP_SELEC 0x0002
00015 #define LP_BUSY  0x0004
00016 #define LP_OFFL  0x0008
00017 #define LP_NOPA  0x0010
00018 #define LP_ERR   0x0020
00019 #define LP_ABORT 0x0040
00020 #define LP_CAREFUL 0x0080
00021 #define LP_ABORTOPEN 0x0100
00022 
00023 /* timeout for each character.  This is relative to bus cycles -- it
00024  * is the count in a busy loop.  THIS IS THE VALUE TO CHANGE if you
00025  * have extremely slow printing, or if the machine seems to slow down
00026  * a lot when you print.  If you have slow printing, increase this
00027  * number and recompile, and if your system gets bogged down, decrease
00028  * this number.  This can be changed with the tunelp(8) command as well.
00029  */
00030 
00031 #define LP_INIT_CHAR 1000
00032 
00033 /* The parallel port specs apparently say that there needs to be
00034  * a .5usec wait before and after the strobe.  Since there are wildly
00035  * different computers running linux, I can't come up with a perfect
00036  * value, but since it worked well on most printers before without,
00037  * I'll initialize it to 0.
00038  */
00039 
00040 #define LP_INIT_WAIT 0
00041 
00042 /* This is the amount of time that the driver waits for the printer to
00043  * catch up when the printer's buffer appears to be filled.  If you
00044  * want to tune this and have a fast printer (i.e. HPIIIP), decrease
00045  * this number, and if you have a slow printer, increase this number.
00046  * This is in hundredths of a second, the default 2 being .05 second.
00047  * Or use the tunelp(8) command, which is especially nice if you want
00048  * change back and forth between character and graphics printing, which
00049  * are wildly different...
00050  */
00051 
00052 #define LP_INIT_TIME 2
00053 
00054 /* IOCTL numbers */
00055 #define LPCHAR   0x0601  /* corresponds to LP_INIT_CHAR */
00056 #define LPTIME   0x0602  /* corresponds to LP_INIT_TIME */
00057 #define LPABORT  0x0604  /* call with TRUE arg to abort on error,
00058                 FALSE to retry.  Default is retry.  */
00059 #define LPSETIRQ 0x0605  /* call with new IRQ number,
00060                 or 0 for polling (no IRQ) */
00061 #define LPGETIRQ 0x0606  /* get the current IRQ number */
00062 #define LPWAIT   0x0608  /* corresponds to LP_INIT_WAIT */
00063 #define LPCAREFUL   0x0609  /* call with TRUE arg to require out-of-paper, off-
00064                 line, and error indicators good on all writes,
00065                 FALSE to ignore them.  Default is ignore. */
00066 #define LPABORTOPEN 0x060a  /* call with TRUE arg to abort open() on error,
00067                 FALSE to ignore error.  Default is ignore.  */
00068 #define LPGETSTATUS 0x060b  /* return LP_S(minor) */
00069 #define LPRESET     0x060c  /* reset printer */
00070 
00071 /* timeout for print'ing a timeout, in jiffies (100ths of a second).
00072    This is also used for re-checking error conditions if LP_ABORT is
00073    not set.  This is the default behavior. */
00074 
00075 #define LP_TIMEOUT_INTERRUPT    (60 * HZ)
00076 #define LP_TIMEOUT_POLLED   (10 * HZ)
00077 
00078 #if 0
00079 #define LP_B(minor) lp_table[(minor)].base      /* IO address */
00080 #define LP_F(minor) lp_table[(minor)].flags     /* flags for busy, etc. */
00081 #define LP_S(minor) inb_p(LP_B((minor)) + 1)    /* status port */
00082 #define LP_C(minor) (lp_table[(minor)].base + 2)    /* control port */
00083 #define LP_CHAR(minor)  lp_table[(minor)].chars     /* busy timeout */
00084 #define LP_TIME(minor)  lp_table[(minor)].time      /* wait time */
00085 #define LP_WAIT(minor)  lp_table[(minor)].wait      /* strobe wait */
00086 #define LP_IRQ(minor)   lp_table[(minor)].irq       /* interrupt # */
00087                             /* 0 means polled */
00088 #endif
00089 
00090 #define LP_BUFFER_SIZE 256
00091 
00092 
00093 /*
00094  * The following constants describe the various signals of the printer port
00095  * hardware.  Note that the hardware inverts some signals and that some
00096  * signals are active low.  An example is LP_STROBE, which must be programmed
00097  * with 1 for being active and 0 for being inactive, because the strobe signal
00098  * gets inverted, but it is also active low.
00099  */
00100 
00101 /*
00102  * bit defines for 8255 status port
00103  * base + 1
00104  * accessed with LP_S(minor), which gets the byte...
00105  */
00106 #define LP_PBUSY    0x80  /* inverted input, active high */
00107 #define LP_PACK     0x40  /* unchanged input, active low */
00108 #define LP_POUTPA   0x20  /* unchanged input, active high */
00109 #define LP_PSELECD  0x10  /* unchanged input, active high */
00110 #define LP_PERRORP  0x08  /* unchanged input, active low */
00111 
00112 /*
00113  * defines for 8255 control port
00114  * base + 2
00115  * accessed with LP_C(minor)
00116  */
00117 #define LP_PINTEN   0x10
00118 #define LP_PSELECP  0x08  /* inverted output, active low */
00119 #define LP_PINITP   0x04  /* unchanged output, active low */
00120 #define LP_PAUTOLF  0x02  /* inverted output, active low */
00121 #define LP_PSTROBE  0x01  /* inverted output, active low */
00122 
00123 /*
00124  * the value written to ports to test existence. PC-style ports will
00125  * return the value written. AT-style ports will return 0. so why not
00126  * make them the same ?
00127  */
00128 #define LP_DUMMY    0x00
00129 
00130 /*
00131  * This is the port delay time.  Your mileage may vary.
00132  * It is used only in the lp_init() routine.
00133  */
00134 #define LP_DELAY    150000

Generated on Sat May 26 2012 04:26:41 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.