openpromio.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1989-2000, 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_OPENPROMIO_H
#define _SYS_OPENPROMIO_H
#pragma ident "%Z%%M% %I% %E% SMI"
/* From SunOS 4.1.1 <sundev/openpromio.h> */
#ifdef __cplusplus
extern "C" {
#endif
/*
* XXX HACK ALERT
*
* You might think that this interface could support setting non-ASCII
* property values. Unfortunately the 4.0.3c openprom driver SETOPT
* code ignores oprom_size and uses strlen() to compute the length of
* the value. The 4.0.3c openprom eeprom command makes its contribution
* by not setting oprom_size to anything meaningful. So, if we want the
* driver to trust oprom_size we have to use SETOPT2. XXX.
*/
struct openpromio {
union {
char b[1]; /* For property names and values */
/* NB: Adjacent, Null terminated */
int i;
} opio_u;
};
#define oprom_array opio_u.b
#define oprom_node opio_u.i
/*
* OPROMMAXPARAM is used as a limit by the driver, and it has been
* increased to be 4 times the largest possible size of a property,
* which is 8K (nvramrc property).
*/
/*
* Note that all OPROM ioctl codes are type void. Since the amount
*/
/*
* Return values from OPROMGETCONS:
*/
#define OPROMCONS_NOT_WSCONS 0
#if defined(__sparc)
/*
* Data structure returned in oprom_array, from OPROMREADY64:
*
* With return codes 1 and 2, also returns nodeid, a nodeid
* of a flashprom node, and a message string with the minimum version
* requirement for this platform.
*/
struct openprom_opr64 {
int return_code; /* See below */
int nodeid; /* Valid with positive return codes */
};
/*
* return_code values from OPROMREADY64:
*/
#define OP64R_READY 0 /* ready or not applicable */
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_OPENPROMIO_H */