home *** CD-ROM | disk | FTP | other *** search
- /*
- $Id: pp.h,v 2.6 90/08/24 11:49:16 sw Exp $
- */
-
- /*
- "Copyright 1990 Piercarlo Grandi. All rights reserved.";
- */
-
- /*
- This driver is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 1, or
- (at your option) any later version.
-
- As a special case, this driver may be incorporated in any OS kernel,
- whether the GNU General Public License applies to it or not.
-
- This driver is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You may have received a copy of the GNU General Public License
- along with this driver; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
- /*
- Status port defines
- */
-
- #define ppNOTERROR 0x08 /* Online, paper present, OK */
- #define ppONLINE 0x10 /* Printer is online */
- #define ppNOPAPER 0x20 /* Paper missing */
- #define ppNOTACK 0x40 /* Data have been read */
- #define ppNOTBUSY 0x80 /* Interface ready */
-
- /*
- Control port defines
- */
-
- #define ppSTROBE 0x01 /* Strobe a character in */
- #define ppAUTOLF 0x02 /* Enable auto line feed */
- #define ppNOTRESET 0x04 /* Normal operation */
- #define ppSELECT 0x08 /* Put the printer online */
- #define ppINTERRUPT 0x10 /* Send interrupt when NOTACK is reset */
-
- #ifdef INKERNEL
-
- /*
- Here we have a difficult decision. We want to copy whole chunks of
- user characters to kernel space and then push them out one by one
- to the printer. How long these chunks should be, i.e. how much
- buffer space should we consume? Should it be reserved statically or
- dynamically? Here you have two choices. Either you reserve a static
- buffer of the indicated size (typically a small one), or we will
- reserve a block cache buffer dynamically if this is zero.
- */
-
- #define ppSTATICSZ 128 /* Other good values: 128, 256 */
-
- struct pp_guard
- {
- struct
- {
- char unsigned mask;
- char unsigned done;
- }
- pause,spin;
- };
-
- struct pp_config
- {
- short data;
- short status;
- short control;
- caddr_t buf;
- #if (ppSTATICSZ == 0)
- struct buf *hdr;
- #endif
- };
-
- extern struct pp_guard pp_guard;
- extern struct pp_config pp_config[];
- #if (ppSTATICSZ != 0)
- extern char pp_sbuf[][ppSTATICSZ];
- #endif
-
- extern short pp_max;
-
- extern short unsigned pp_longpause;
- extern short unsigned pp_shortpause;
- extern short unsigned pp_maxspins;
- #endif
-