Annotation of sys/arch/mvme68k/dev/lp.c, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: lp.c,v 1.10 2004/07/30 22:29:45 miod Exp $ */
! 2:
! 3: /*
! 4: * Copyright (c) 1995 Theo de Raadt
! 5: * All rights reserved.
! 6: *
! 7: * Redistribution and use in source and binary forms, with or without
! 8: * modification, are permitted provided that the following conditions
! 9: * are met:
! 10: * 1. Redistributions of source code must retain the above copyright
! 11: * notice, this list of conditions and the following disclaimer.
! 12: * 2. Redistributions in binary form must reproduce the above copyright
! 13: * notice, this list of conditions and the following disclaimer in the
! 14: * documentation and/or other materials provided with the distribution.
! 15: *
! 16: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
! 17: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! 18: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
! 19: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
! 20: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
! 21: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
! 22: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
! 23: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
! 24: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
! 25: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
! 26: */
! 27:
! 28: #include <sys/param.h>
! 29: #include <sys/ioctl.h>
! 30: #include <sys/proc.h>
! 31: #include <sys/user.h>
! 32: #include <sys/tty.h>
! 33: #include <sys/uio.h>
! 34: #include <sys/systm.h>
! 35: #include <sys/kernel.h>
! 36: #include <sys/syslog.h>
! 37: #include <sys/fcntl.h>
! 38: #include <sys/device.h>
! 39:
! 40: #include <machine/autoconf.h>
! 41: #include <machine/conf.h>
! 42: #include <machine/cpu.h>
! 43:
! 44: #include <mvme68k/dev/pccreg.h>
! 45:
! 46: struct lpsoftc {
! 47: struct device sc_dev;
! 48: struct intrhand sc_ih;
! 49: };
! 50:
! 51: void lpattach(struct device *, struct device *, void *);
! 52: int lpmatch(struct device *, void *, void *);
! 53:
! 54: struct cfattach lp_ca = {
! 55: sizeof(struct lpsoftc), lpmatch, lpattach
! 56: };
! 57:
! 58: struct cfdriver lp_cd = {
! 59: NULL, "lp", DV_DULL
! 60: };
! 61:
! 62: int lpintr(void *);
! 63:
! 64: /*
! 65: * a PCC chip always has an lp attached to it.
! 66: */
! 67: int
! 68: lpmatch(parent, cf, args)
! 69: struct device *parent;
! 70: void *cf;
! 71: void *args;
! 72: {
! 73: return (1);
! 74: }
! 75:
! 76: void
! 77: lpattach(parent, self, args)
! 78: struct device *parent, *self;
! 79: void *args;
! 80: {
! 81: struct lpsoftc *sc = (struct lpsoftc *)self;
! 82: struct confargs *ca = args;
! 83:
! 84: printf(": unsupported\n");
! 85:
! 86: sc->sc_ih.ih_fn = lpintr;
! 87: sc->sc_ih.ih_arg = sc;
! 88: sc->sc_ih.ih_ipl = ca->ca_ipl;
! 89: pccintr_establish(PCCV_PRINTER, &sc->sc_ih, self->dv_xname);
! 90:
! 91: sys_pcc->pcc_lpirq = ca->ca_ipl | PCC_IRQ_IEN | PCC_LPIRQ_ACK;
! 92: }
! 93:
! 94: int
! 95: lpintr(dev)
! 96: void *dev;
! 97: {
! 98: return (0);
! 99: }
! 100:
! 101: /*ARGSUSED*/
! 102: int
! 103: lpopen(dev, flag, mode, p)
! 104: dev_t dev;
! 105: int flag, mode;
! 106: struct proc *p;
! 107: {
! 108:
! 109: return (0);
! 110: }
! 111:
! 112: /*ARGSUSED*/
! 113: int
! 114: lpclose(dev, flag, mode, p)
! 115: dev_t dev;
! 116: int flag, mode;
! 117: struct proc *p;
! 118: {
! 119:
! 120: return (0);
! 121: }
! 122:
! 123: /*ARGSUSED*/
! 124: int
! 125: lpwrite(dev, uio, flags)
! 126: dev_t dev;
! 127: struct uio *uio;
! 128: int flags;
! 129: {
! 130: return (EOPNOTSUPP);
! 131: }
! 132:
! 133: int
! 134: lpioctl(dev, cmd, data, flag, p)
! 135: dev_t dev;
! 136: u_long cmd;
! 137: caddr_t data;
! 138: int flag;
! 139: struct proc *p;
! 140: {
! 141: return (EOPNOTSUPP);
! 142: }
! 143:
CVSweb