openfirmio.h revision 105398
1105398Stmm/*	$NetBSD: openfirmio.h,v 1.4 2002/09/06 13:23:19 gehenna Exp $ */
2105398Stmm
3105398Stmm/*
4105398Stmm * Copyright (c) 1992, 1993
5105398Stmm *	The Regents of the University of California.  All rights reserved.
6105398Stmm *
7105398Stmm * This software was developed by the Computer Systems Engineering group
8105398Stmm * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9105398Stmm * contributed to Berkeley.
10105398Stmm *
11105398Stmm * All advertising materials mentioning features or use of this software
12105398Stmm * must display the following acknowledgement:
13105398Stmm *	This product includes software developed by the University of
14105398Stmm *	California, Lawrence Berkeley Laboratory.
15105398Stmm *
16105398Stmm * Redistribution and use in source and binary forms, with or without
17105398Stmm * modification, are permitted provided that the following conditions
18105398Stmm * are met:
19105398Stmm * 1. Redistributions of source code must retain the above copyright
20105398Stmm *    notice, this list of conditions and the following disclaimer.
21105398Stmm * 2. Redistributions in binary form must reproduce the above copyright
22105398Stmm *    notice, this list of conditions and the following disclaimer in the
23105398Stmm *    documentation and/or other materials provided with the distribution.
24105398Stmm * 3. All advertising materials mentioning features or use of this software
25105398Stmm *    must display the following acknowledgement:
26105398Stmm *	This product includes software developed by the University of
27105398Stmm *	California, Berkeley and its contributors.
28105398Stmm * 4. Neither the name of the University nor the names of its contributors
29105398Stmm *    may be used to endorse or promote products derived from this software
30105398Stmm *    without specific prior written permission.
31105398Stmm *
32105398Stmm * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
33105398Stmm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34105398Stmm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
35105398Stmm * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
36105398Stmm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37105398Stmm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38105398Stmm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39105398Stmm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
40105398Stmm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
41105398Stmm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42105398Stmm * SUCH DAMAGE.
43105398Stmm *
44105398Stmm *	@(#)openpromio.h	8.1 (Berkeley) 6/11/93
45105398Stmm *
46105398Stmm * $FreeBSD: head/sys/dev/ofw/openfirmio.h 105398 2002-10-18 15:23:43Z tmm $
47105398Stmm */
48105398Stmm
49105398Stmm#ifndef _DEV_OFW_OPENFIRMIO_H_
50105398Stmm#define _DEV_OFW_OPENFIRMIO_H_
51105398Stmm
52105398Stmm#include <dev/ofw/openfirm.h>
53105398Stmm
54105398Stmmstruct ofiocdesc {
55105398Stmm	phandle_t	of_nodeid;	/* passed or returned node id */
56105398Stmm	int		of_namelen;	/* length of op_name */
57105398Stmm	const char	*of_name;	/* pointer to field name */
58105398Stmm	int		of_buflen;	/* length of op_buf (value-result) */
59105398Stmm	char		*of_buf;	/* pointer to field value */
60105398Stmm};
61105398Stmm
62105398Stmm#define	OFIOC_BASE	'O'
63105398Stmm
64105398Stmm/* Get openprom field. */
65105398Stmm#define	OFIOCGET	_IOWR(OFIOC_BASE, 1, struct ofiocdesc)
66105398Stmm#if 0
67105398Stmm/* Set openprom field. */
68105398Stmm#define	OFIOCSET	_IOW(OFIOC_BASE, 2, struct ofiocdesc)
69105398Stmm#endif
70105398Stmm/* Get next property. */
71105398Stmm#define	OFIOCNEXTPROP	_IOWR(OFIOC_BASE, 3, struct ofiocdesc)
72105398Stmm/* Get options node. */
73105398Stmm#define	OFIOCGETOPTNODE	_IOR(OFIOC_BASE, 4, phandle_t)
74105398Stmm/* Get next node of node. */
75105398Stmm#define	OFIOCGETNEXT	_IOWR(OFIOC_BASE, 5, phandle_t)
76105398Stmm/* Get first child of node. */
77105398Stmm#define	OFIOCGETCHILD	_IOWR(OFIOC_BASE, 6, phandle_t)
78105398Stmm/* Find a specific device. */
79105398Stmm#define	OFIOCFINDDEVICE	_IOWR(OFIOC_BASE, 7, struct ofiocdesc)
80105398Stmm
81105398Stmm#endif /* _DEV_OFW_OPENFIRMIO_H_ */
82