03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * CDDL HEADER START
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel * The contents of this file are subject to the terms of the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Common Development and Distribution License (the "License").
03831d35f7499c87d51205817c93e9a8d42c4baestevel * You may not use this file except in compliance with the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
03831d35f7499c87d51205817c93e9a8d42c4baestevel * or http://www.opensolaris.org/os/licensing.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * See the License for the specific language governing permissions
03831d35f7499c87d51205817c93e9a8d42c4baestevel * and limitations under the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel * When distributing Covered Code, include this CDDL HEADER in each
03831d35f7499c87d51205817c93e9a8d42c4baestevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If applicable, add the following below this CDDL HEADER, with the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * fields enclosed by brackets "[]" replaced with your own identifying
03831d35f7499c87d51205817c93e9a8d42c4baestevel * information: Portions Copyright [yyyy] [name of copyright owner]
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel * CDDL HEADER END
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Copyright 2000 Sun Microsystems, Inc. All rights reserved.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Use is subject to license terms.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#ifndef _MONTERCARLO_SYS_SCSBIOCTL_H
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define _MONTERCARLO_SYS_SCSBIOCTL_H
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#pragma ident "%Z%%M% %I% %E% SMI"
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#ifdef __cplusplus
03831d35f7499c87d51205817c93e9a8d42c4baestevelextern "C" {
03831d35f7499c87d51205817c93e9a8d42c4baestevel#endif
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * SCB HW information, which is needed in scsb.h for scsb.c.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * there are 32 data registers on the system controller board
03831d35f7499c87d51205817c93e9a8d42c4baestevel * most are used in P1.0, all are used in P1.5
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSB_DATA_REGISTERS 48
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define _SCSBIOC ('s' << 8)
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_GET_STATUS (_SCSBIOC | 1) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_I2C_XFER (_SCSBIOC | 2) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_ALL_LEDS_ON (_SCSBIOC | 3) /* Diagnostics */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_ALL_LEDS_OFF (_SCSBIOC | 4) /* Diagnostics */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_FREEZE (_SCSBIOC | 5) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_RESTORE (_SCSBIOC | 6) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_LED_NOK_SET (_SCSBIOC | 7) /* Diagnostics */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_LED_NOK_GET (_SCSBIOC | 8) /* Diagnostics */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_LED_OK_SET (_SCSBIOC | 9) /* Diagnostics */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_LED_OK_GET (_SCSBIOC | 10) /* Diagnostics */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_GET_FAN_STATUS (_SCSBIOC | 11) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_RESET_UNIT (_SCSBIOC | 12) /* Diagnostics */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_FAKE_INTR (_SCSBIOC | 13) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_BSELECT_SET (_SCSBIOC | 14) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_BSELECT_GET (_SCSBIOC | 15) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_BHEALTHY_SET (_SCSBIOC | 16) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_BHEALTHY_GET (_SCSBIOC | 17) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_GET_INTR_ARRAY (_SCSBIOC | 18) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define ENVC_IOC_ACQUIRE_SLOT_LED_CTRL (_SCSBIOC | 21) /* EnvMon */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define ENVC_IOC_RELEASE_SLOT_LED_CTRL (_SCSBIOC | 22) /* EnvMon */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define ENVC_IOC_SETFSP (_SCSBIOC | 23) /* EnvMon */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define ENVC_IOC_GETDSKLED (_SCSBIOC | 24) /* EnvMon */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define ENVC_IOC_SETDSKLED (_SCSBIOC | 25) /* EnvMon */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define ENVC_IOC_REGISTER_PID (_SCSBIOC | 26) /* EnvMon */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define ENVC_IOC_UNREGISTER_PID (_SCSBIOC | 27) /* EnvMon */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define ENVC_IOC_ACCONF_RESTORED (_SCSBIOC | 28) /* EnvMon */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define ENVC_IOC_ACCONF_STORED (_SCSBIOC | 29) /* EnvMon */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_REG_READ (_SCSBIOC | 31) /* Diagnostic */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_REG_WRITE (_SCSBIOC | 32) /* Diagnostic */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_GET_VERSIONS (_SCSBIOC | 33) /* Diagnostic */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/* these are for debug/testing and may be temporary */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_SHUTDOWN_POLL (_SCSBIOC | 41) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_SLOT_OCCUPANCY (_SCSBIOC | 42) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_INTEVENT_POLL (_SCSBIOC | 43) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_TOPOLOGY_DUMP (_SCSBIOC | 44) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_VALUE_MODE (_SCSBIOC | 45) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_GET_SLOT_INFO (_SCSBIOC | 46) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSBIOC_DEBUG_MODE (_SCSBIOC | 52) /* Internal */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * SCSBIOC_GET_VERSIONS structure
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSB_MODSTR_LEN 64
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSB_VERSTR_LEN 12
03831d35f7499c87d51205817c93e9a8d42c4baesteveltypedef struct scsb_ids {
03831d35f7499c87d51205817c93e9a8d42c4baestevel char modldrv_string[SCSB_MODSTR_LEN];
03831d35f7499c87d51205817c93e9a8d42c4baestevel char scsb_version[SCSB_VERSTR_LEN];
03831d35f7499c87d51205817c93e9a8d42c4baestevel uint8_t promid;
03831d35f7499c87d51205817c93e9a8d42c4baestevel uint8_t pad[3];
03831d35f7499c87d51205817c93e9a8d42c4baestevel} scsb_ids_t;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baesteveltypedef enum {
03831d35f7499c87d51205817c93e9a8d42c4baestevel GET = 0,
03831d35f7499c87d51205817c93e9a8d42c4baestevel SET = 1
03831d35f7499c87d51205817c93e9a8d42c4baestevel} scsb_op_t;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baesteveltypedef enum {
03831d35f7499c87d51205817c93e9a8d42c4baestevel NOK = 0,
03831d35f7499c87d51205817c93e9a8d42c4baestevel OK = 1,
03831d35f7499c87d51205817c93e9a8d42c4baestevel NOUSE = 2
03831d35f7499c87d51205817c93e9a8d42c4baestevel} scsb_led_t;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCSB_LED_TYPES 2
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baesteveltypedef enum {
03831d35f7499c87d51205817c93e9a8d42c4baestevel OFF = 0,
03831d35f7499c87d51205817c93e9a8d42c4baestevel ON = 1,
03831d35f7499c87d51205817c93e9a8d42c4baestevel BLINK = 2
03831d35f7499c87d51205817c93e9a8d42c4baestevel} scsb_ustate_t;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baesteveltypedef struct {
03831d35f7499c87d51205817c93e9a8d42c4baestevel scsb_unum_t unit_number;
03831d35f7499c87d51205817c93e9a8d42c4baestevel scsb_utype_t unit_type;
03831d35f7499c87d51205817c93e9a8d42c4baestevel scsb_ustate_t unit_state;
03831d35f7499c87d51205817c93e9a8d42c4baestevel scsb_led_t led_type;
03831d35f7499c87d51205817c93e9a8d42c4baestevel} scsb_uinfo_t;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/* SCSBIOC_GET_STATUS data */
03831d35f7499c87d51205817c93e9a8d42c4baesteveltypedef struct {
03831d35f7499c87d51205817c93e9a8d42c4baestevel uchar_t scsb_reg[SCSB_DATA_REGISTERS];
03831d35f7499c87d51205817c93e9a8d42c4baestevel} scsb_status_t;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/* SCSBIOC_REG_READ / SCSBIOC_REG_WRITE data */
03831d35f7499c87d51205817c93e9a8d42c4baesteveltypedef struct {
03831d35f7499c87d51205817c93e9a8d42c4baestevel int16_t ioc_result; /* O: return value */
03831d35f7499c87d51205817c93e9a8d42c4baestevel uint16_t ioc_resio; /* O: bytes not transfered */
03831d35f7499c87d51205817c93e9a8d42c4baestevel uint16_t ioc_wlen; /* I: length of write buffer */
03831d35f7499c87d51205817c93e9a8d42c4baestevel uint16_t ioc_rlen; /* I: length of read buffer */
03831d35f7499c87d51205817c93e9a8d42c4baestevel uchar_t ioc_rbuf[64];
03831d35f7499c87d51205817c93e9a8d42c4baestevel uchar_t ioc_wbuf[64];
03831d35f7499c87d51205817c93e9a8d42c4baestevel uchar_t ioc_regindex;
03831d35f7499c87d51205817c93e9a8d42c4baestevel} scsb_ioc_rdwr_t;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#ifdef __cplusplus
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel#endif
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#endif /* _MONTERCARLO_SYS_SCSBIOCTL_H */