xref: /freebsd/sys/isa/pnpvar.h (revision 5b45337d)
14249382dSDoug Rabson /*-
24249382dSDoug Rabson  * Copyright (c) 1999 Doug Rabson
34249382dSDoug Rabson  * All rights reserved.
44249382dSDoug Rabson  *
54249382dSDoug Rabson  * Redistribution and use in source and binary forms, with or without
64249382dSDoug Rabson  * modification, are permitted provided that the following conditions
74249382dSDoug Rabson  * are met:
84249382dSDoug Rabson  * 1. Redistributions of source code must retain the above copyright
94249382dSDoug Rabson  *    notice, this list of conditions and the following disclaimer.
104249382dSDoug Rabson  * 2. Redistributions in binary form must reproduce the above copyright
114249382dSDoug Rabson  *    notice, this list of conditions and the following disclaimer in the
124249382dSDoug Rabson  *    documentation and/or other materials provided with the distribution.
134249382dSDoug Rabson  *
144249382dSDoug Rabson  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
154249382dSDoug Rabson  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
164249382dSDoug Rabson  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
174249382dSDoug Rabson  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
184249382dSDoug Rabson  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
194249382dSDoug Rabson  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
204249382dSDoug Rabson  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
214249382dSDoug Rabson  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
224249382dSDoug Rabson  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
234249382dSDoug Rabson  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
244249382dSDoug Rabson  * SUCH DAMAGE.
254249382dSDoug Rabson  *
264249382dSDoug Rabson  *	$FreeBSD$
274249382dSDoug Rabson  */
284249382dSDoug Rabson 
294249382dSDoug Rabson #ifndef _ISA_PNPVAR_H_
304249382dSDoug Rabson #define _ISA_PNPVAR_H_
314249382dSDoug Rabson 
324249382dSDoug Rabson #ifdef KERNEL
334249382dSDoug Rabson 
344249382dSDoug Rabson #if 0
354249382dSDoug Rabson void    pnp_write(int d, u_char r); /* used by Luigi's sound driver */
364249382dSDoug Rabson u_char  pnp_read(int d); /* currently unused, but who knows... */
374249382dSDoug Rabson #endif
384249382dSDoug Rabson 
394249382dSDoug Rabson #define PNP_HEXTONUM(c)	((c) >= 'a'		\
404249382dSDoug Rabson 			 ? (c) - 'a' + 10	\
414249382dSDoug Rabson 			 : ((c) >= 'A'		\
424249382dSDoug Rabson 			    ? (c) - 'A' + 10	\
434249382dSDoug Rabson 			    : (c) - '0'))
444249382dSDoug Rabson 
454249382dSDoug Rabson #define PNP_EISAID(s)				\
464249382dSDoug Rabson 	((((s[0] - '@') & 0x1f) << 2)		\
474249382dSDoug Rabson 	 | (((s[1] - '@') & 0x18) >> 3)		\
484249382dSDoug Rabson 	 | (((s[1] - '@') & 0x07) << 13)	\
494249382dSDoug Rabson 	 | (((s[2] - '@') & 0x1f) << 8)		\
504249382dSDoug Rabson 	 | (PNP_HEXTONUM(s[4]) << 16)		\
514249382dSDoug Rabson 	 | (PNP_HEXTONUM(s[3]) << 20)		\
524249382dSDoug Rabson 	 | (PNP_HEXTONUM(s[6]) << 24)		\
534249382dSDoug Rabson 	 | (PNP_HEXTONUM(s[5]) << 28))
544249382dSDoug Rabson 
555b45337dSDoug Rabson void pnp_parse_resources(device_t dev, u_char *resources, int len);
565b45337dSDoug Rabson 
574249382dSDoug Rabson #endif /* KERNEL */
584249382dSDoug Rabson 
594249382dSDoug Rabson #endif /* !_ISA_PNPVAR_H_ */
60