$NetBSD: vp.4,v 1.14 2017/07/31 18:45:43 ryoon Exp $

Copyright (c) 1980, 1991, 1993
The Regents of the University of California. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

from: @(#)vp.4 8.1 (Berkeley) 6/5/93

.Dd February 17, 2017 .Dt VP 4 vax .Os .Sh NAME .Nm vp .Nd Versatec printer/plotter interface .Sh SYNOPSIS .Cd "vp0 at uba0 csr 0177510 vector vpintr vpintr" .Sh DESCRIPTION NOTE: This driver has not been ported from x 4.4 yet.

p The Versatec printer/plotter is normally used with the line printer system. This description is designed for those who wish to drive the Versatec directly.

p To use the Versatec yourself, you must realize that you cannot open the device,

a /dev/vp0 if there is a daemon active. You can see if there is a daemon active by doing a .Xr vax/lpq 1 , and seeing if there are any files being sent. Printing should be turned off using .Xr vax/lpc 8 .

p To set the Versatec into plot mode you should include n sys/vcmd.h and use the .Xr ioctl 2 call d -literal -offset indent ioctl(fileno(vp), VSETSTATE, plotmd); .Ed

p where .Em plotmd is defined to be d -literal -offset indent int plotmd[] = { VPLOT, 0, 0 }; .Ed

p and .Em vp is the result of a call to .Xr fopen 3 on stdio. When you finish using the Versatec in plot mode you should eject paper by sending it a .Tn EOT after putting it back into print mode, i.e. by d -literal -offset indent int prtmd[] = { VPRINT, 0, 0 }; ... fflush(vp); ioctl(fileno(vp), VSETSTATE, prtmd); write(fileno(vp), "\e04", 1); .Ed .Sh FILES l -tag -width /dev/vp0xx -compact t Pa /dev/vp0 .El .Sh DIAGNOSTICS The following error numbers are significant at the time the device is opened. l -tag -width [ENXIO] t Bq Er ENXIO The device is already in use. t Bq Er EIO The device is offline. .El .Sh SEE ALSO .Xr vax/lpr 1 , .Xr vtroff 1 ,
.Xr vax/va 4 , .Xr font 5 ,
.Xr vax/lpd 8 .Sh HISTORY A .Nm driver appeared in .At v7 . .Sh BUGS The configuration part of the driver assumes that the device is set up to vector print mode through 0174 and plot mode through 0200. As the configuration program can't be sure which vector interrupted at boot time, we specify that it has two interrupt vectors, and if an interrupt comes through 0200 it is reset to 0174. This is safe for devices with one or two vectors at these two addresses. Other configurations with 2 vectors may require changes in the driver.