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