home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1742 / pp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  2.6 KB  |  95 lines

  1. /*
  2.     $Id: pp.h,v 2.6 90/08/24 11:49:16 sw Exp $
  3. */
  4.  
  5. /*
  6.     "Copyright 1990 Piercarlo Grandi. All rights reserved.";
  7. */
  8.  
  9. /*
  10.     This driver is free software; you can redistribute it and/or
  11.     modify it under the terms of the GNU General Public License as
  12.     published by the Free Software Foundation; either version 1, or
  13.     (at your option) any later version.
  14.  
  15.     As a special case, this driver may be incorporated in any OS kernel,
  16.     whether the GNU General Public License applies to it or not.
  17.  
  18.     This driver is distributed in the hope that it will be useful,
  19.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  20.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21.     GNU General Public License for more details.
  22.  
  23.     You may have received a copy of the GNU General Public License
  24.     along with this driver; if not, write to the Free Software
  25.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  26. */
  27.  
  28. /*
  29.     Status port defines
  30. */
  31.  
  32. #define ppNOTERROR    0x08    /* Online, paper present, OK        */
  33. #define ppONLINE    0x10    /* Printer is online            */
  34. #define ppNOPAPER    0x20    /* Paper missing            */
  35. #define ppNOTACK    0x40    /* Data have been read            */
  36. #define ppNOTBUSY    0x80    /* Interface ready            */
  37.  
  38. /*
  39.     Control port defines
  40. */
  41.  
  42. #define ppSTROBE    0x01    /* Strobe a character in        */
  43. #define ppAUTOLF    0x02    /* Enable auto line feed        */
  44. #define ppNOTRESET    0x04    /* Normal operation            */
  45. #define ppSELECT    0x08    /* Put the printer online        */
  46. #define ppINTERRUPT    0x10    /* Send interrupt when NOTACK is reset    */
  47.  
  48. #ifdef INKERNEL
  49.  
  50. /*
  51.     Here we have a difficult decision. We want to copy whole chunks of
  52.     user characters to kernel space and then push them out one by one
  53.     to the printer. How long these chunks should be, i.e. how much
  54.     buffer space should we consume? Should it be reserved statically or
  55.     dynamically? Here you have two choices. Either you reserve a static
  56.     buffer of the indicated size (typically a small one), or we will
  57.     reserve a block cache buffer dynamically if this is zero.
  58. */
  59.  
  60. #define ppSTATICSZ    128    /* Other good values: 128, 256        */
  61.  
  62. struct pp_guard
  63. {
  64.     struct
  65.     {
  66.     char unsigned        mask;
  67.     char unsigned        done;
  68.     }
  69.                 pause,spin;
  70. };
  71.  
  72. struct pp_config
  73. {
  74.     short                   data;
  75.     short                   status;
  76.     short                   control;
  77.     caddr_t            buf;
  78. #if (ppSTATICSZ == 0)
  79.     struct buf            *hdr;
  80. #endif
  81. };
  82.  
  83. extern struct pp_guard    pp_guard;
  84. extern struct pp_config    pp_config[];
  85. #if (ppSTATICSZ != 0)
  86.     extern char        pp_sbuf[][ppSTATICSZ];
  87. #endif
  88.  
  89. extern short        pp_max;
  90.  
  91. extern short unsigned    pp_longpause;
  92. extern short unsigned    pp_shortpause;
  93. extern short unsigned    pp_maxspins;
  94. #endif
  95.