pnpvar.h revision 52059
150769Sdfr/*-
250769Sdfr * Copyright (c) 1999 Doug Rabson
350769Sdfr * All rights reserved.
450769Sdfr *
550769Sdfr * Redistribution and use in source and binary forms, with or without
650769Sdfr * modification, are permitted provided that the following conditions
750769Sdfr * are met:
850769Sdfr * 1. Redistributions of source code must retain the above copyright
950769Sdfr *    notice, this list of conditions and the following disclaimer.
1050769Sdfr * 2. Redistributions in binary form must reproduce the above copyright
1150769Sdfr *    notice, this list of conditions and the following disclaimer in the
1250769Sdfr *    documentation and/or other materials provided with the distribution.
1350769Sdfr *
1450769Sdfr * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1550769Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1650769Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1750769Sdfr * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1850769Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1950769Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2050769Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2150769Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2250769Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2350769Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2450769Sdfr * SUCH DAMAGE.
2550769Sdfr *
2650769Sdfr *	$FreeBSD: head/sys/isa/pnpvar.h 52059 1999-10-09 13:11:46Z dfr $
2750769Sdfr */
2850769Sdfr
2950769Sdfr#ifndef _ISA_PNPVAR_H_
3050769Sdfr#define _ISA_PNPVAR_H_
3150769Sdfr
3250769Sdfr#ifdef KERNEL
3350769Sdfr
3450769Sdfr#if 0
3550769Sdfrvoid    pnp_write(int d, u_char r); /* used by Luigi's sound driver */
3650769Sdfru_char  pnp_read(int d); /* currently unused, but who knows... */
3750769Sdfr#endif
3850769Sdfr
3950769Sdfr#define PNP_HEXTONUM(c)	((c) >= 'a'		\
4050769Sdfr			 ? (c) - 'a' + 10	\
4150769Sdfr			 : ((c) >= 'A'		\
4250769Sdfr			    ? (c) - 'A' + 10	\
4350769Sdfr			    : (c) - '0'))
4450769Sdfr
4550769Sdfr#define PNP_EISAID(s)				\
4650769Sdfr	((((s[0] - '@') & 0x1f) << 2)		\
4750769Sdfr	 | (((s[1] - '@') & 0x18) >> 3)		\
4850769Sdfr	 | (((s[1] - '@') & 0x07) << 13)	\
4950769Sdfr	 | (((s[2] - '@') & 0x1f) << 8)		\
5050769Sdfr	 | (PNP_HEXTONUM(s[4]) << 16)		\
5150769Sdfr	 | (PNP_HEXTONUM(s[3]) << 20)		\
5250769Sdfr	 | (PNP_HEXTONUM(s[6]) << 24)		\
5350769Sdfr	 | (PNP_HEXTONUM(s[5]) << 28))
5450769Sdfr
5552059Sdfrvoid pnp_parse_resources(device_t dev, u_char *resources, int len);
5652059Sdfr
5750769Sdfr#endif /* KERNEL */
5850769Sdfr
5950769Sdfr#endif /* !_ISA_PNPVAR_H_ */
60