1953cd93fSNicolas Souchu.\" 2953cd93fSNicolas Souchu.\" Copyright (c) 1993 Christopher G. Demetriou 3953cd93fSNicolas Souchu.\" Copyright (c) 1994 Geoffrey M. Rehmet 4e3ded6e2SNicolas Souchu.\" Copyright (c) 1999 Nicolas Souchu 5953cd93fSNicolas Souchu.\" All rights reserved. 6953cd93fSNicolas Souchu.\" 7953cd93fSNicolas Souchu.\" Redistribution and use in source and binary forms, with or without 8953cd93fSNicolas Souchu.\" modification, are permitted provided that the following conditions 9953cd93fSNicolas Souchu.\" are met: 10953cd93fSNicolas Souchu.\" 1. Redistributions of source code must retain the above copyright 11953cd93fSNicolas Souchu.\" notice, this list of conditions and the following disclaimer. 12953cd93fSNicolas Souchu.\" 2. Redistributions in binary form must reproduce the above copyright 13953cd93fSNicolas Souchu.\" notice, this list of conditions and the following disclaimer in the 14953cd93fSNicolas Souchu.\" documentation and/or other materials provided with the distribution. 15953cd93fSNicolas Souchu.\" 16953cd93fSNicolas Souchu.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17953cd93fSNicolas Souchu.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18953cd93fSNicolas Souchu.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19953cd93fSNicolas Souchu.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20953cd93fSNicolas Souchu.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21953cd93fSNicolas Souchu.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22953cd93fSNicolas Souchu.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23953cd93fSNicolas Souchu.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24953cd93fSNicolas Souchu.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25953cd93fSNicolas Souchu.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26953cd93fSNicolas Souchu.\" SUCH DAMAGE. 27953cd93fSNicolas Souchu.\" 287f3dea24SPeter Wemm.\" $FreeBSD$ 29953cd93fSNicolas Souchu.\" 30953cd93fSNicolas Souchu.Dd February 14, 1999 31953cd93fSNicolas Souchu.Dt LPT 4 32953cd93fSNicolas Souchu.Os FreeBSD 33953cd93fSNicolas Souchu.Sh NAME 34953cd93fSNicolas Souchu.Nm lpt 35eb083802SRuslan Ermilov.Nd generic printer device driver 36953cd93fSNicolas Souchu.Sh SYNOPSIS 376b713d58SJeroen Ruigrok van der Werven.Cd "device ppbus" 386b713d58SJeroen Ruigrok van der Werven.Cd "device lpt" 39953cd93fSNicolas Souchu.Pp 40e6dccbdbSJeroen Ruigrok van der Werven.Cd "device ppc0 at isa? port IO_LPT1 irq 7" 41e6dccbdbSJeroen Ruigrok van der Werven.Cd "device ppc1 at isa? port IO_LPT2 irq 7" 42e6dccbdbSJeroen Ruigrok van der Werven.Cd "device ppc2 at isa? port IO_LPT3 irq 7" 43953cd93fSNicolas Souchu.Pp 44953cd93fSNicolas SouchuFor BIOS-probed ports: 4567d2f3d7SJeroen Ruigrok van der Werven.Cd "device ppc0 at isa? port? irq 7" 46953cd93fSNicolas Souchu.Pp 47953cd93fSNicolas SouchuFor polled ports: 4867d2f3d7SJeroen Ruigrok van der Werven.Cd "device ppc0 at isa? port?" 49e6dccbdbSJeroen Ruigrok van der Werven.Cd "device ppc1 at isa? port IO_LPT2" 50953cd93fSNicolas Souchu.Pp 51953cd93fSNicolas SouchuFor DMA capable parallel port: 5267d2f3d7SJeroen Ruigrok van der Werven.Cd "device ppc0 at isa? port? irq 7 drq 1" 53953cd93fSNicolas Souchu.Sh DESCRIPTION 54953cd93fSNicolas SouchuThe current 55953cd93fSNicolas Souchu.Em lpt 56953cd93fSNicolas Souchudriver is the port of the original lpt driver to the 57953cd93fSNicolas Souchu.Xr ppbus 4 58953cd93fSNicolas Souchusystem. 59953cd93fSNicolas Souchu.Pp 60953cd93fSNicolas SouchuOne purpose of this port was to allow parallel port sharing with other 616d249eeeSSheldon Hearnparallel devices. 626d249eeeSSheldon HearnSecondly, inb()/outb() calls have been replaced by ppbus 636d249eeeSSheldon Hearnfunction calls. 646d249eeeSSheldon Hearnlpt is now arch-independent thanks to the ppbus interface. 656d249eeeSSheldon HearnSee 66953cd93fSNicolas Souchu.Xr ppbus 4 67953cd93fSNicolas Souchufor more info about the ppbus system. 68953cd93fSNicolas Souchu.Pp 69953cd93fSNicolas SouchuThe parallel port bus is allocated by lpt when the printer device is opened 70953cd93fSNicolas Souchuand released only when the transfer is completed: either when the device 71953cd93fSNicolas Souchuis closed or when the entire buffer is sent in interrupt driven mode. 72953cd93fSNicolas Souchu.Pp 73953cd93fSNicolas SouchuThe driver can be configured to be either interrupt-driven, or 74953cd93fSNicolas Souchuto poll the printer. Ports that are configured to be 75953cd93fSNicolas Souchuinterrupt-driven can be switched to polled mode by using the 76953cd93fSNicolas Souchu.Xr lptcontrol 8 77953cd93fSNicolas Souchucommand. 78953cd93fSNicolas Souchu.Pp 79953cd93fSNicolas SouchuDepending on your hardware, extended capabilities may be configured with the 80953cd93fSNicolas Souchu.Xr lptcontrol 8 816d249eeeSSheldon Hearncommand. 826d249eeeSSheldon HearnWith an ECP/ISA port, you can take advantage 83953cd93fSNicolas Souchuof FIFO and DMA. 84e3ded6e2SNicolas Souchu.Pp 85e3ded6e2SNicolas SouchuIn order to retrieve printer info from /dev/lpt0, just apply the 86e3ded6e2SNicolas Souchu.Nm cat 876d249eeeSSheldon Hearncommand to the device. 886d249eeeSSheldon HearnIf the printer supports IEEE1284 nibble mode and has 89e3ded6e2SNicolas Souchudata to send to the host, you'll get it. 90953cd93fSNicolas Souchu.Sh SEE ALSO 91953cd93fSNicolas Souchu.Xr ppbus 4 , 92953cd93fSNicolas Souchu.Xr lptcontrol 8 93953cd93fSNicolas Souchu.Sh HISTORY 94953cd93fSNicolas SouchuThis driver replaces the functionality of the lpa 95953cd93fSNicolas Souchudriver, which is now defunct. 96953cd93fSNicolas Souchu.Sh FILES 97953cd93fSNicolas Souchu.Bl -tag -width Pa -compact 98953cd93fSNicolas Souchu.It Pa /dev/lpt0 99953cd93fSNicolas Souchufirst parallel port driver 100953cd93fSNicolas Souchu.El 101953cd93fSNicolas Souchu.Sh BUGS 102953cd93fSNicolas SouchuThere are lots of them, especially in cheap parallel port implementations. 103953cd93fSNicolas Souchu.Pp 104953cd93fSNicolas SouchuIt is only possible to open a lpt port when a printer is connected and 105953cd93fSNicolas Souchuon-line, making it impossible to run 106953cd93fSNicolas Souchu.Xr lptcontrol 8 107953cd93fSNicolas Souchuwhen there is no printer connected. 108953cd93fSNicolas Souchu.Pp 109953cd93fSNicolas SouchuThis driver could still stand a rewrite. 110