1*03831d35Sstevel /* 2*03831d35Sstevel * CDDL HEADER START 3*03831d35Sstevel * 4*03831d35Sstevel * The contents of this file are subject to the terms of the 5*03831d35Sstevel * Common Development and Distribution License (the "License"). 6*03831d35Sstevel * You may not use this file except in compliance with the License. 7*03831d35Sstevel * 8*03831d35Sstevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*03831d35Sstevel * or http://www.opensolaris.org/os/licensing. 10*03831d35Sstevel * See the License for the specific language governing permissions 11*03831d35Sstevel * and limitations under the License. 12*03831d35Sstevel * 13*03831d35Sstevel * When distributing Covered Code, include this CDDL HEADER in each 14*03831d35Sstevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*03831d35Sstevel * If applicable, add the following below this CDDL HEADER, with the 16*03831d35Sstevel * fields enclosed by brackets "[]" replaced with your own identifying 17*03831d35Sstevel * information: Portions Copyright [yyyy] [name of copyright owner] 18*03831d35Sstevel * 19*03831d35Sstevel * CDDL HEADER END 20*03831d35Sstevel */ 21*03831d35Sstevel 22*03831d35Sstevel /* 23*03831d35Sstevel * Copyright 2000 Sun Microsystems, Inc. All rights reserved. 24*03831d35Sstevel * Use is subject to license terms. 25*03831d35Sstevel */ 26*03831d35Sstevel 27*03831d35Sstevel #ifndef _MONTERCARLO_SYS_SCSBIOCTL_H 28*03831d35Sstevel #define _MONTERCARLO_SYS_SCSBIOCTL_H 29*03831d35Sstevel 30*03831d35Sstevel #pragma ident "%Z%%M% %I% %E% SMI" 31*03831d35Sstevel 32*03831d35Sstevel #ifdef __cplusplus 33*03831d35Sstevel extern "C" { 34*03831d35Sstevel #endif 35*03831d35Sstevel 36*03831d35Sstevel /* 37*03831d35Sstevel * SCB HW information, which is needed in scsb.h for scsb.c. 38*03831d35Sstevel * there are 32 data registers on the system controller board 39*03831d35Sstevel * most are used in P1.0, all are used in P1.5 40*03831d35Sstevel */ 41*03831d35Sstevel #define SCSB_DATA_REGISTERS 48 42*03831d35Sstevel 43*03831d35Sstevel 44*03831d35Sstevel #define _SCSBIOC ('s' << 8) 45*03831d35Sstevel 46*03831d35Sstevel #define SCSBIOC_GET_STATUS (_SCSBIOC | 1) /* Internal */ 47*03831d35Sstevel #define SCSBIOC_I2C_XFER (_SCSBIOC | 2) /* Internal */ 48*03831d35Sstevel 49*03831d35Sstevel #define SCSBIOC_ALL_LEDS_ON (_SCSBIOC | 3) /* Diagnostics */ 50*03831d35Sstevel #define SCSBIOC_ALL_LEDS_OFF (_SCSBIOC | 4) /* Diagnostics */ 51*03831d35Sstevel 52*03831d35Sstevel #define SCSBIOC_FREEZE (_SCSBIOC | 5) /* Internal */ 53*03831d35Sstevel #define SCSBIOC_RESTORE (_SCSBIOC | 6) /* Internal */ 54*03831d35Sstevel 55*03831d35Sstevel #define SCSBIOC_LED_NOK_SET (_SCSBIOC | 7) /* Diagnostics */ 56*03831d35Sstevel #define SCSBIOC_LED_NOK_GET (_SCSBIOC | 8) /* Diagnostics */ 57*03831d35Sstevel #define SCSBIOC_LED_OK_SET (_SCSBIOC | 9) /* Diagnostics */ 58*03831d35Sstevel #define SCSBIOC_LED_OK_GET (_SCSBIOC | 10) /* Diagnostics */ 59*03831d35Sstevel #define SCSBIOC_GET_FAN_STATUS (_SCSBIOC | 11) /* Internal */ 60*03831d35Sstevel #define SCSBIOC_RESET_UNIT (_SCSBIOC | 12) /* Diagnostics */ 61*03831d35Sstevel #define SCSBIOC_FAKE_INTR (_SCSBIOC | 13) /* Internal */ 62*03831d35Sstevel #define SCSBIOC_BSELECT_SET (_SCSBIOC | 14) /* Internal */ 63*03831d35Sstevel #define SCSBIOC_BSELECT_GET (_SCSBIOC | 15) /* Internal */ 64*03831d35Sstevel #define SCSBIOC_BHEALTHY_SET (_SCSBIOC | 16) /* Internal */ 65*03831d35Sstevel #define SCSBIOC_BHEALTHY_GET (_SCSBIOC | 17) /* Internal */ 66*03831d35Sstevel #define SCSBIOC_GET_INTR_ARRAY (_SCSBIOC | 18) /* Internal */ 67*03831d35Sstevel 68*03831d35Sstevel #define ENVC_IOC_ACQUIRE_SLOT_LED_CTRL (_SCSBIOC | 21) /* EnvMon */ 69*03831d35Sstevel #define ENVC_IOC_RELEASE_SLOT_LED_CTRL (_SCSBIOC | 22) /* EnvMon */ 70*03831d35Sstevel #define ENVC_IOC_SETFSP (_SCSBIOC | 23) /* EnvMon */ 71*03831d35Sstevel #define ENVC_IOC_GETDSKLED (_SCSBIOC | 24) /* EnvMon */ 72*03831d35Sstevel #define ENVC_IOC_SETDSKLED (_SCSBIOC | 25) /* EnvMon */ 73*03831d35Sstevel #define ENVC_IOC_REGISTER_PID (_SCSBIOC | 26) /* EnvMon */ 74*03831d35Sstevel #define ENVC_IOC_UNREGISTER_PID (_SCSBIOC | 27) /* EnvMon */ 75*03831d35Sstevel #define ENVC_IOC_ACCONF_RESTORED (_SCSBIOC | 28) /* EnvMon */ 76*03831d35Sstevel #define ENVC_IOC_ACCONF_STORED (_SCSBIOC | 29) /* EnvMon */ 77*03831d35Sstevel 78*03831d35Sstevel #define SCSBIOC_REG_READ (_SCSBIOC | 31) /* Diagnostic */ 79*03831d35Sstevel #define SCSBIOC_REG_WRITE (_SCSBIOC | 32) /* Diagnostic */ 80*03831d35Sstevel #define SCSBIOC_GET_VERSIONS (_SCSBIOC | 33) /* Diagnostic */ 81*03831d35Sstevel 82*03831d35Sstevel /* these are for debug/testing and may be temporary */ 83*03831d35Sstevel #define SCSBIOC_SHUTDOWN_POLL (_SCSBIOC | 41) /* Internal */ 84*03831d35Sstevel #define SCSBIOC_SLOT_OCCUPANCY (_SCSBIOC | 42) /* Internal */ 85*03831d35Sstevel #define SCSBIOC_INTEVENT_POLL (_SCSBIOC | 43) /* Internal */ 86*03831d35Sstevel #define SCSBIOC_TOPOLOGY_DUMP (_SCSBIOC | 44) /* Internal */ 87*03831d35Sstevel #define SCSBIOC_VALUE_MODE (_SCSBIOC | 45) /* Internal */ 88*03831d35Sstevel #define SCSBIOC_GET_SLOT_INFO (_SCSBIOC | 46) /* Internal */ 89*03831d35Sstevel #define SCSBIOC_DEBUG_MODE (_SCSBIOC | 52) /* Internal */ 90*03831d35Sstevel 91*03831d35Sstevel /* 92*03831d35Sstevel * SCSBIOC_GET_VERSIONS structure 93*03831d35Sstevel */ 94*03831d35Sstevel #define SCSB_MODSTR_LEN 64 95*03831d35Sstevel #define SCSB_VERSTR_LEN 12 96*03831d35Sstevel typedef struct scsb_ids { 97*03831d35Sstevel char modldrv_string[SCSB_MODSTR_LEN]; 98*03831d35Sstevel char scsb_version[SCSB_VERSTR_LEN]; 99*03831d35Sstevel uint8_t promid; 100*03831d35Sstevel uint8_t pad[3]; 101*03831d35Sstevel } scsb_ids_t; 102*03831d35Sstevel 103*03831d35Sstevel 104*03831d35Sstevel typedef enum { 105*03831d35Sstevel GET = 0, 106*03831d35Sstevel SET = 1 107*03831d35Sstevel } scsb_op_t; 108*03831d35Sstevel 109*03831d35Sstevel typedef enum { 110*03831d35Sstevel NOK = 0, 111*03831d35Sstevel OK = 1, 112*03831d35Sstevel NOUSE = 2 113*03831d35Sstevel } scsb_led_t; 114*03831d35Sstevel 115*03831d35Sstevel #define SCSB_LED_TYPES 2 116*03831d35Sstevel 117*03831d35Sstevel typedef enum { 118*03831d35Sstevel OFF = 0, 119*03831d35Sstevel ON = 1, 120*03831d35Sstevel BLINK = 2 121*03831d35Sstevel } scsb_ustate_t; 122*03831d35Sstevel 123*03831d35Sstevel typedef struct { 124*03831d35Sstevel scsb_unum_t unit_number; 125*03831d35Sstevel scsb_utype_t unit_type; 126*03831d35Sstevel scsb_ustate_t unit_state; 127*03831d35Sstevel scsb_led_t led_type; 128*03831d35Sstevel } scsb_uinfo_t; 129*03831d35Sstevel 130*03831d35Sstevel 131*03831d35Sstevel /* SCSBIOC_GET_STATUS data */ 132*03831d35Sstevel typedef struct { 133*03831d35Sstevel uchar_t scsb_reg[SCSB_DATA_REGISTERS]; 134*03831d35Sstevel } scsb_status_t; 135*03831d35Sstevel 136*03831d35Sstevel 137*03831d35Sstevel /* SCSBIOC_REG_READ / SCSBIOC_REG_WRITE data */ 138*03831d35Sstevel typedef struct { 139*03831d35Sstevel int16_t ioc_result; /* O: return value */ 140*03831d35Sstevel uint16_t ioc_resio; /* O: bytes not transfered */ 141*03831d35Sstevel uint16_t ioc_wlen; /* I: length of write buffer */ 142*03831d35Sstevel uint16_t ioc_rlen; /* I: length of read buffer */ 143*03831d35Sstevel uchar_t ioc_rbuf[64]; 144*03831d35Sstevel uchar_t ioc_wbuf[64]; 145*03831d35Sstevel uchar_t ioc_regindex; 146*03831d35Sstevel } scsb_ioc_rdwr_t; 147*03831d35Sstevel 148*03831d35Sstevel 149*03831d35Sstevel #ifdef __cplusplus 150*03831d35Sstevel } 151*03831d35Sstevel #endif 152*03831d35Sstevel 153*03831d35Sstevel #endif /* _MONTERCARLO_SYS_SCSBIOCTL_H */ 154