Skip site navigation (1)Skip section navigation (2)
Date:      17 May 2001 10:05:17 +0200
From:      sperber@informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor])
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/27403: lpt driver doesn't handle flags anymore
Message-ID:  <y9ln18cbdtu.fsf@informatik.uni-tuebingen.de>

next in thread | raw e-mail | index | archive | help

>Number:         27403
>Category:       kern
>Synopsis:       lpt driver doesn't handle flags anymore
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 17 01:10:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Mike Sperber <sperber@informatik.uni-tuebingen.de
>Release:        FreeBSD 4.3-RELEASE i386
>Organization:
Wilhelm-Schickard-Institut / Programmierung
>Environment:
System: FreeBSD sams 4.3-RELEASE FreeBSD 4.3-RELEASE #1: Mon May 7 13:35:27 MST 2001 sperber@sams:/usr/local/src/sys/compile/SAMS i386


>Description:

The lpt driver provides historical provision for some options to be
encoded in the minor device number:

#define LP_POS_INIT	0x04	/* if we are a postive init signal */
#define LP_POS_ACK	0x08	/* if we are a positive going ack */
#define LP_NO_PRIME	0x10	/* don't prime the printer at all */
#define LP_PRIMEOPEN	0x20	/* prime on every open */
#define LP_AUTOLF	0x40	/* tell printer to do an automatic lf */
#define LP_BYPASS	0x80	/* bypass  printer ready checks */

(The first two seem to no longer be supported by the code, the rest
is.)

This used to work at least up to FreeBSD 2.2.  Now, using mknod to
create lpt devices with any of these options set, FreeBSD no longer
recognizes the resulting device notes as attached to the driver.
("Device not configured.") My guess is that it used to mask out higher
bits from the minor device number in earlier versions of FreeBSD which
it doesn't do anymore.

There is explicit provision for LP_BYPASS and LP_BYPASS by itself only
for the lpt0.ctl device.

>How-To-Repeat:

As root:

mknod /dev/lpt0.autolf c 16 64
cat /dev/null > /dev/lpt0.autolf

>Fix:

If I've diagnosed the problem right the old way of setting options is
hard to support in the new framework.  There seem to be two ways of
approaching this:

- make the options kernel-configurable

- provide explicit support for NO_PRIME (as for LP_BYPASS) by itself
  and implement ioctls for priming the port and turning on auto
  linefeed.

I'm willing and able to implement either of these, given some guidance
from the maintainers on how to proceed.
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?y9ln18cbdtu.fsf>