xref: /netbsd-src/sys/dev/ofw/openfirmio.h (revision 1fbab01a9353563bcc435f692ca5268e5626005a)
1*1fbab01aSdholland /*	$NetBSD: openfirmio.h,v 1.7 2015/09/06 06:01:00 dholland Exp $ */
27d085e8eSmatt 
37d085e8eSmatt /*
47d085e8eSmatt  * Copyright (c) 1992, 1993
57d085e8eSmatt  *	The Regents of the University of California.  All rights reserved.
67d085e8eSmatt  *
77d085e8eSmatt  * This software was developed by the Computer Systems Engineering group
87d085e8eSmatt  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
97d085e8eSmatt  * contributed to Berkeley.
107d085e8eSmatt  *
117d085e8eSmatt  * All advertising materials mentioning features or use of this software
127d085e8eSmatt  * must display the following acknowledgement:
137d085e8eSmatt  *	This product includes software developed by the University of
147d085e8eSmatt  *	California, Lawrence Berkeley Laboratory.
157d085e8eSmatt  *
167d085e8eSmatt  * Redistribution and use in source and binary forms, with or without
177d085e8eSmatt  * modification, are permitted provided that the following conditions
187d085e8eSmatt  * are met:
197d085e8eSmatt  * 1. Redistributions of source code must retain the above copyright
207d085e8eSmatt  *    notice, this list of conditions and the following disclaimer.
217d085e8eSmatt  * 2. Redistributions in binary form must reproduce the above copyright
227d085e8eSmatt  *    notice, this list of conditions and the following disclaimer in the
237d085e8eSmatt  *    documentation and/or other materials provided with the distribution.
24aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
257d085e8eSmatt  *    may be used to endorse or promote products derived from this software
267d085e8eSmatt  *    without specific prior written permission.
277d085e8eSmatt  *
287d085e8eSmatt  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
297d085e8eSmatt  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
307d085e8eSmatt  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
317d085e8eSmatt  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
327d085e8eSmatt  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
337d085e8eSmatt  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
347d085e8eSmatt  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
357d085e8eSmatt  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
367d085e8eSmatt  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
377d085e8eSmatt  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
387d085e8eSmatt  * SUCH DAMAGE.
397d085e8eSmatt  *
407d085e8eSmatt  *	@(#)openpromio.h	8.1 (Berkeley) 6/11/93
417d085e8eSmatt  */
42ef047f21Smatt #ifndef _DEV_OFW_OPENFIRMIO_H_
43ef047f21Smatt #define _DEV_OFW_OPENFIRMIO_H_
447d085e8eSmatt 
45*1fbab01aSdholland #include <sys/ioccom.h>
46*1fbab01aSdholland 
477d085e8eSmatt struct ofiocdesc {
487d085e8eSmatt 	int	of_nodeid;		/* passed or returned node id */
497d085e8eSmatt 	int	of_namelen;		/* length of op_name */
507d085e8eSmatt 	char	*of_name;		/* pointer to field name */
517d085e8eSmatt 	int	of_buflen;		/* length of op_buf (value-result) */
527d085e8eSmatt 	char	*of_buf;		/* pointer to field value */
537d085e8eSmatt };
547d085e8eSmatt 
557d085e8eSmatt #define	OFIOCGET	_IOWR('O', 1, struct ofiocdesc) /* get openprom field */
567d085e8eSmatt #define	OFIOCSET	_IOW('O', 2, struct ofiocdesc) /* set openprom field */
577d085e8eSmatt #define	OFIOCNEXTPROP	_IOWR('O', 3, struct ofiocdesc) /* get next property */
58a790bc76Smatt #define	OFIOCGETOPTNODE	_IOR('O', 4, int)	/* get options node */
597d085e8eSmatt #define	OFIOCGETNEXT	_IOWR('O', 5, int)	/* get next node of node */
607d085e8eSmatt #define	OFIOCGETCHILD	_IOWR('O', 6, int)	/* get first child of node */
617d085e8eSmatt #define	OFIOCFINDDEVICE	_IOWR('O', 7, struct ofiocdesc) /* find a specific device */
62ef047f21Smatt 
63ef047f21Smatt #endif /* _DEV_OFW_OPENFIRMIO_H_ */
64