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 2001 Sun Microsystems, Inc. All rights reserved. 24*03831d35Sstevel * Use is subject to license terms. 25*03831d35Sstevel */ 26*03831d35Sstevel 27*03831d35Sstevel #ifndef _SYS_LW8_H 28*03831d35Sstevel #define _SYS_LW8_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 * subset of ioctl commands from PSARC 2000/019 38*03831d35Sstevel */ 39*03831d35Sstevel 40*03831d35Sstevel #define LOMIOCALCTL _IOW('a', 4, lom_aldata_t) 41*03831d35Sstevel #define LOMIOCALSTATE _IOWR('a', 5, lom_aldata_t) 42*03831d35Sstevel #define LOMIOCFLEDSTATE _IOR('a', 24, lom_fled_info_t) 43*03831d35Sstevel #define LOMIOCINFO _IOR('a', 25, lom_info_t) 44*03831d35Sstevel #define LOMIOCINFO2 _IOWR('a', 46, lom2_info_t) 45*03831d35Sstevel #define LOMIOCCTL _IOW('a', 27, lom_ctl_t) 46*03831d35Sstevel #define LOMIOCCTL2 _IOW('a', 40, lom_ctl2_t) 47*03831d35Sstevel #define LOMIOCPROG _IOWR('a', 28, lom_prog_t) 48*03831d35Sstevel #define LOMIOCWTMON _IOWR('a', 2, int) 49*03831d35Sstevel #define LOMIOCMREAD _IOR('a', 33, lom_mprog_t) 50*03831d35Sstevel #define LOMIOCEVENTLOG2 _IOWR('a', 45, lom_eventlog2_t) 51*03831d35Sstevel 52*03831d35Sstevel #define LOM_SERIAL_EVENTS_ON 0x100 53*03831d35Sstevel #define LOM_SERIAL_EVENTS_OFF 0x200 54*03831d35Sstevel #define LOM_SERIAL_EVENTS_DEF 0x300 55*03831d35Sstevel 56*03831d35Sstevel typedef struct { 57*03831d35Sstevel int alarm_no; 58*03831d35Sstevel int state; 59*03831d35Sstevel } lom_aldata_t; 60*03831d35Sstevel 61*03831d35Sstevel typedef struct { 62*03831d35Sstevel int on; 63*03831d35Sstevel } lom_fled_info_t; 64*03831d35Sstevel 65*03831d35Sstevel typedef struct { 66*03831d35Sstevel char ser_char; 67*03831d35Sstevel char pad1[7]; 68*03831d35Sstevel int fault_led; 69*03831d35Sstevel int pad2[2]; 70*03831d35Sstevel } lom_ctl_t; 71*03831d35Sstevel 72*03831d35Sstevel typedef struct { 73*03831d35Sstevel char escape_chars[6]; 74*03831d35Sstevel char pad1[2]; 75*03831d35Sstevel int serial_events; 76*03831d35Sstevel } lom_ctl2_t; 77*03831d35Sstevel 78*03831d35Sstevel typedef struct { 79*03831d35Sstevel int pad1[4]; 80*03831d35Sstevel int config; 81*03831d35Sstevel int pad2[8]; 82*03831d35Sstevel } lom_mprog_t; 83*03831d35Sstevel 84*03831d35Sstevel typedef struct { 85*03831d35Sstevel char ser_char; 86*03831d35Sstevel char pad1[7]; 87*03831d35Sstevel int fver; 88*03831d35Sstevel int fchksum; 89*03831d35Sstevel int prod_rev; 90*03831d35Sstevel char prod_id[12]; 91*03831d35Sstevel int pad2[1]; 92*03831d35Sstevel } lom_info_t; 93*03831d35Sstevel 94*03831d35Sstevel typedef struct { 95*03831d35Sstevel char escape_chars[6]; 96*03831d35Sstevel char pad1[2]; 97*03831d35Sstevel int serial_events; 98*03831d35Sstevel int pad2[1]; 99*03831d35Sstevel int fver; 100*03831d35Sstevel int fchksum; 101*03831d35Sstevel int prod_rev; 102*03831d35Sstevel char prod_id[12]; 103*03831d35Sstevel int serial_config; 104*03831d35Sstevel int baud_rate; 105*03831d35Sstevel int serial_hw_config; 106*03831d35Sstevel int phone_home_config; 107*03831d35Sstevel char phone_home_script[128]; 108*03831d35Sstevel int pad3[16]; 109*03831d35Sstevel } lom2_info_t; 110*03831d35Sstevel 111*03831d35Sstevel typedef struct { 112*03831d35Sstevel int index; /* bit 0x8000 should be set if last buffer */ 113*03831d35Sstevel uint8_t data[0x400]; 114*03831d35Sstevel int size; 115*03831d35Sstevel } lom_prog_t; 116*03831d35Sstevel 117*03831d35Sstevel #define MAX_EVENTS 128 118*03831d35Sstevel #define MAX_EVENT_STR 80 119*03831d35Sstevel 120*03831d35Sstevel typedef struct { 121*03831d35Sstevel int num; /* no. events requested and no. returned */ 122*03831d35Sstevel int level; /* level of events requested */ 123*03831d35Sstevel int pad1[MAX_EVENTS]; 124*03831d35Sstevel char string[MAX_EVENTS][MAX_EVENT_STR]; 125*03831d35Sstevel int pad2[MAX_EVENTS]; 126*03831d35Sstevel } lom_eventlog2_t; 127*03831d35Sstevel 128*03831d35Sstevel /* 129*03831d35Sstevel * Project private ioctl commands - used by lw8 picl frutree plugin only 130*03831d35Sstevel */ 131*03831d35Sstevel 132*03831d35Sstevel #define LOMIOCGETLED _IOWR('a', 100, lom_get_led_t) 133*03831d35Sstevel #define LOMIOCSETLED _IOWR('a', 101, lom_set_led_t) 134*03831d35Sstevel 135*03831d35Sstevel #define MAX_ID_LEN 16 136*03831d35Sstevel #define MAX_LOCATION_LEN 16 137*03831d35Sstevel #define MAX_COLOR_LEN 16 138*03831d35Sstevel 139*03831d35Sstevel #define LOM_LED_STATUS_OFF 0 140*03831d35Sstevel #define LOM_LED_STATUS_ON 1 141*03831d35Sstevel #define LOM_LED_STATUS_FLASHING 2 142*03831d35Sstevel #define LOM_LED_STATUS_BLINKING 3 143*03831d35Sstevel 144*03831d35Sstevel #define LOM_LED_POSITION_FRU 0 145*03831d35Sstevel #define LOM_LED_POSITION_LOCATION 1 146*03831d35Sstevel 147*03831d35Sstevel typedef struct { 148*03831d35Sstevel char location[MAX_LOCATION_LEN]; 149*03831d35Sstevel char id[MAX_ID_LEN]; 150*03831d35Sstevel int status; 151*03831d35Sstevel int position; 152*03831d35Sstevel char color[MAX_COLOR_LEN]; 153*03831d35Sstevel char next_id[MAX_ID_LEN]; 154*03831d35Sstevel } lom_get_led_t; 155*03831d35Sstevel 156*03831d35Sstevel typedef struct { 157*03831d35Sstevel char location[MAX_LOCATION_LEN]; 158*03831d35Sstevel char id[MAX_ID_LEN]; 159*03831d35Sstevel int status; 160*03831d35Sstevel } lom_set_led_t; 161*03831d35Sstevel 162*03831d35Sstevel #ifdef __cplusplus 163*03831d35Sstevel } 164*03831d35Sstevel #endif 165*03831d35Sstevel 166*03831d35Sstevel #endif /* _SYS_LW8_H */ 167