Deleted Added
sdiff udiff text old ( 47718 ) new ( 50254 )
full compact
1/*
2 * Copyright (c) 1990 William F. Jolitz, TeleMuse
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 34 unchanged lines hidden (view full) ---

43 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
44 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
45 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 * SUCH DAMAGE.
47 *
48 * from: unknown origin, 386BSD 0.1
49 * From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp
50 * From Id: nlpt.c,v 1.14 1999/02/08 13:55:43 des Exp
51 * $Id: lpt.c,v 1.6 1999/06/03 22:03:35 peter Exp $
52 */
53
54/*
55 * Device Driver for AT parallel printer port
56 * Written by William Jolitz 12/18/90
57 */
58
59/*
60 * Updated for ppbus by Nicolas Souchu
61 * [Mon Jul 28 1997]
62 */
63
64
65#ifdef KERNEL
66
67#include <sys/param.h>
68#include <sys/systm.h>
69#include <sys/conf.h>
70#include <sys/buf.h>
71#include <sys/kernel.h>
72#include <sys/uio.h>
73#include <sys/syslog.h>
74#include <sys/malloc.h>
75
76#include <machine/clock.h>
77#include <machine/lpt.h>
78#endif /*KERNEL*/
79
80#include <dev/ppbus/ppbconf.h>
81#include <dev/ppbus/ppb_1284.h>

--- 45 unchanged lines hidden (view full) ---

127 char *sc_cp ;
128 u_short sc_irq ; /* IRQ status of port */
129#define LP_HAS_IRQ 0x01 /* we have an irq available */
130#define LP_USE_IRQ 0x02 /* we are using our irq */
131#define LP_ENABLE_IRQ 0x04 /* enable IRQ on open */
132#define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */
133 u_char sc_backoff ; /* time to call lptout() again */
134
135};
136
137static int nlpt = 0;
138#define MAXLPT 8 /* XXX not much better! */
139static struct lpt_data *lptdata[MAXLPT];
140
141#define LPT_NAME "lpt" /* our official name */
142

--- 282 unchanged lines hidden (view full) ---

425 } else {
426 sc->sc_irq = 0;
427 lprintf((LPT_NAME "%d: Polled port\n", dev->id_unit));
428 }
429 lprintf(("irq %x\n", sc->sc_irq));
430
431 lpt_release_ppbus(sc);
432
433 make_dev(&lpt_cdevsw, dev->id_unit,
434 UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d", dev->id_unit);
435 make_dev(&lpt_cdevsw, dev->id_unit | LP_BYPASS,
436 UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", dev->id_unit);
437 return (1);
438}
439
440static void
441lptout(void *arg)
442{
443 struct lpt_data *sc = arg;
444 int pl;

--- 502 unchanged lines hidden ---