1.\" $NetBSD: vp.4,v 1.10 2002/01/15 02:11:31 wiz Exp $ 2.\" 3.\" Copyright (c) 1980, 1991, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by the University of 17.\" California, Berkeley and its contributors. 18.\" 4. Neither the name of the University nor the names of its contributors 19.\" may be used to endorse or promote products derived from this software 20.\" without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" from: @(#)vp.4 8.1 (Berkeley) 6/5/93 35.\" 36.Dd June 5, 1993 37.Dt VP 4 vax 38.Os 39.Sh NAME 40.Nm vp 41.Nd Versatec printer/plotter interface 42.Sh SYNOPSIS 43.Cd "vp0 at uba0 csr 0177510 vector vpintr vpintr" 44.Sh DESCRIPTION 45NOTE: This driver has not been ported from 46.Bx 4.4 47yet. 48.Pp 49The Versatec printer/plotter is normally used with the 50line printer system. 51This description is designed for those who wish to drive the Versatec directly. 52.Pp 53To use the Versatec yourself, you must realize that you cannot open the 54device, 55.Pa /dev/vp0 56if there is a daemon active. 57You can see if there is a daemon active by doing a 58.Xr lpq 1 , 59and seeing if there are any files being sent. 60Printing should be turned off using 61.Xr lpc 8 . 62.Pp 63To set the Versatec into plot mode you should include 64.Aq Pa sys/vcmd.h 65and use the 66.Xr ioctl 2 67call 68.Bd -literal -offset indent 69ioctl(fileno(vp), VSETSTATE, plotmd); 70.Ed 71.Pp 72where 73.Em plotmd 74is defined to be 75.Bd -literal -offset indent 76int plotmd[] = { VPLOT, 0, 0 }; 77.Ed 78.Pp 79and 80.Em vp 81is the result of a call to 82.Xr fopen 3 83on stdio. 84When you finish using the Versatec in plot mode you should eject paper 85by sending it a 86.Tn EOT 87after putting it back into print mode, i.e. by 88.Bd -literal -offset indent 89int prtmd[] = { VPRINT, 0, 0 }; 90\&... 91fflush(vp); 92ioctl(fileno(vp), VSETSTATE, prtmd); 93write(fileno(vp), "\e04", 1); 94.Ed 95.Sh FILES 96.Bl -tag -width /dev/vp0xx -compact 97.It Pa /dev/vp0 98.El 99.Sh DIAGNOSTICS 100The following error numbers are significant at the 101time the device is opened. 102.Bl -tag -width [ENXIO] 103.It Bq Er ENXIO 104The device is already in use. 105.It Bq Er EIO 106The device is offline. 107.El 108.Sh SEE ALSO 109.Xr lpr 1 , 110.\".Xr vtroff 1 , 111.Xr va 4 , 112.\".Xr font 5 , 113.Xr lpd 8 114.Sh HISTORY 115A 116.Nm 117driver appeared in 118.At v7 . 119.Sh BUGS 120The configuration part of the driver assumes that the device is set up to 121vector print mode through 0174 and plot mode through 0200. 122As the configuration program can't be sure 123which vector interrupted at boot time, 124we specify that it has two interrupt vectors, 125and if an interrupt comes through 0200 it is reset to 0174. 126This is safe for devices with one or two vectors at these two addresses. 127Other configurations with 2 vectors may require changes in the driver. 128