lpt.c (47718) | lpt.c (50254) |
---|---|
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 | 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.5 1999/05/31 11:24:56 phk 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 | 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#include "opt_devfs.h" | |
67 68#include <sys/param.h> 69#include <sys/systm.h> 70#include <sys/conf.h> 71#include <sys/buf.h> 72#include <sys/kernel.h> 73#include <sys/uio.h> 74#include <sys/syslog.h> | 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> |
75#ifdef DEVFS 76#include <sys/devfsext.h> 77#endif /*DEVFS*/ | |
78#include <sys/malloc.h> 79 80#include <machine/clock.h> 81#include <machine/lpt.h> 82#endif /*KERNEL*/ 83 84#include <dev/ppbus/ppbconf.h> 85#include <dev/ppbus/ppb_1284.h> --- 45 unchanged lines hidden (view full) --- 131 char *sc_cp ; 132 u_short sc_irq ; /* IRQ status of port */ 133#define LP_HAS_IRQ 0x01 /* we have an irq available */ 134#define LP_USE_IRQ 0x02 /* we are using our irq */ 135#define LP_ENABLE_IRQ 0x04 /* enable IRQ on open */ 136#define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */ 137 u_char sc_backoff ; /* time to call lptout() again */ 138 | 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 |
139#ifdef DEVFS 140 void *devfs_token; 141 void *devfs_token_ctl; 142#endif | |
143}; 144 145static int nlpt = 0; 146#define MAXLPT 8 /* XXX not much better! */ 147static struct lpt_data *lptdata[MAXLPT]; 148 149#define LPT_NAME "lpt" /* our official name */ 150 --- 282 unchanged lines hidden (view full) --- 433 } else { 434 sc->sc_irq = 0; 435 lprintf((LPT_NAME "%d: Polled port\n", dev->id_unit)); 436 } 437 lprintf(("irq %x\n", sc->sc_irq)); 438 439 lpt_release_ppbus(sc); 440 | 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 |
441#ifdef DEVFS 442 sc->devfs_token = devfs_add_devswf(&lpt_cdevsw, 443 dev->id_unit, DV_CHR, 444 UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d", dev->id_unit); 445 sc->devfs_token_ctl = devfs_add_devswf(&lpt_cdevsw, 446 dev->id_unit | LP_BYPASS, DV_CHR, 447 UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", dev->id_unit); 448#endif 449 | 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); |
450 return (1); 451} 452 453static void 454lptout(void *arg) 455{ 456 struct lpt_data *sc = arg; 457 int pl; --- 502 unchanged lines hidden --- | 437 return (1); 438} 439 440static void 441lptout(void *arg) 442{ 443 struct lpt_data *sc = arg; 444 int pl; --- 502 unchanged lines hidden --- |