1 /* $NetBSD: pucvar.h,v 1.2 1999/02/06 06:29:54 cgd Exp $ */ 2 /* $FreeBSD: src/sys/dev/puc/pucvar.h,v 1.1.2.4 2003/04/04 08:42:17 sobomax Exp $ */ 3 /* $DragonFly: src/sys/dev/misc/puc/pucvar.h,v 1.2 2003/06/17 04:28:29 dillon Exp $ */ 4 5 /*- 6 * Copyright (c) 2002 JF Hay. All rights reserved. 7 * Copyright (c) 2000 M. Warner Losh. All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 12 * 1. Redistributions of source code must retain the above copyright 13 * notice unmodified, this list of conditions, and the following 14 * disclaimer. 15 * 2. Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in the 17 * documentation and/or other materials provided with the distribution. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 /* 32 * Copyright (c) 1998, 1999 Christopher G. Demetriou. All rights reserved. 33 * 34 * Redistribution and use in source and binary forms, with or without 35 * modification, are permitted provided that the following conditions 36 * are met: 37 * 1. Redistributions of source code must retain the above copyright 38 * notice, this list of conditions and the following disclaimer. 39 * 2. Redistributions in binary form must reproduce the above copyright 40 * notice, this list of conditions and the following disclaimer in the 41 * documentation and/or other materials provided with the distribution. 42 * 3. All advertising materials mentioning features or use of this software 43 * must display the following acknowledgement: 44 * This product includes software developed by Christopher G. Demetriou 45 * for the NetBSD Project. 46 * 4. The name of the author may not be used to endorse or promote products 47 * derived from this software without specific prior written permission 48 * 49 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 50 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 51 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 52 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 53 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 54 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 55 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 56 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 57 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 58 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 59 */ 60 61 /* 62 * Exported (or conveniently located) PCI "universal" communications card 63 * software structures. 64 * 65 * Author: Christopher G. Demetriou, May 14, 1998. 66 */ 67 68 #define PUC_MAX_PORTS 16 69 70 struct puc_device_description { 71 const char *name; 72 uint32_t rval[4]; 73 uint32_t rmask[4]; 74 struct { 75 int type; 76 int bar; 77 int offset; 78 u_int serialfreq; 79 u_int flags; 80 } ports[PUC_MAX_PORTS]; 81 uint32_t ilr_type; 82 uint32_t ilr_offset[2]; 83 }; 84 85 #define PUC_REG_VEND 0 86 #define PUC_REG_PROD 1 87 #define PUC_REG_SVEND 2 88 #define PUC_REG_SPROD 3 89 90 #define PUC_PORT_TYPE_NONE 0 91 #define PUC_PORT_TYPE_COM 1 92 #define PUC_PORT_TYPE_LPT 2 93 94 /* Interrupt Latch Register (ILR) types */ 95 #define PUC_ILR_TYPE_NONE 0 96 #define PUC_ILR_TYPE_DIGI 1 97 98 #define PUC_PORT_VALID(desc, port) \ 99 ((port) < PUC_MAX_PORTS && (desc)->ports[(port)].type != PUC_PORT_TYPE_NONE) 100 #define PUC_PORT_BAR_INDEX(bar) (((bar) - PCIR_MAPS) / 4) 101 102 #define PUC_MAX_BAR 6 103 104 enum puc_device_ivars { 105 PUC_IVAR_FREQ 106 }; 107 108 extern const struct puc_device_description puc_devices[]; 109