17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*5cff7825Smh27603 * Common Development and Distribution License (the "License"). 6*5cff7825Smh27603 * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22*5cff7825Smh27603 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _SYS_PPMIO_H 277c478bd9Sstevel@tonic-gate #define _SYS_PPMIO_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #include <sys/types.h> 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #ifdef __cplusplus 347c478bd9Sstevel@tonic-gate extern "C" { 357c478bd9Sstevel@tonic-gate #endif 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate #define PPMIOC ('p' << 8) 387c478bd9Sstevel@tonic-gate #define PPMIOCSET (PPMIOC | 1) 397c478bd9Sstevel@tonic-gate #define PPMIOCGET (PPMIOC | 2) 407c478bd9Sstevel@tonic-gate #define PPMGET_DPWR (PPMIOC | 3) 417c478bd9Sstevel@tonic-gate #define PPMGET_DOMBYDEV (PPMIOC | 4) 427c478bd9Sstevel@tonic-gate #define PPMGET_DEVBYDOM (PPMIOC | 5) 43*5cff7825Smh27603 /* 44*5cff7825Smh27603 * The following two ioctls are used for testing purposes only. 45*5cff7825Smh27603 */ 46*5cff7825Smh27603 #if defined(__x86) 47*5cff7825Smh27603 #define PPMGET_NORMAL (PPMIOC | 6) 48*5cff7825Smh27603 #define PPMSET_NORMAL (PPMIOC | 7) 49*5cff7825Smh27603 #endif 507c478bd9Sstevel@tonic-gate 517c478bd9Sstevel@tonic-gate /* 527c478bd9Sstevel@tonic-gate * PPMIOCGET 537c478bd9Sstevel@tonic-gate * Note: this ioctl command is available for Excalibur and Grover 547c478bd9Sstevel@tonic-gate * only, but will be removed in future, replacing with PPMGET_DPWR 557c478bd9Sstevel@tonic-gate */ 567c478bd9Sstevel@tonic-gate typedef struct ppmreq { 577c478bd9Sstevel@tonic-gate int ppmdev; 587c478bd9Sstevel@tonic-gate union ppmop { 597c478bd9Sstevel@tonic-gate struct idev_power { 607c478bd9Sstevel@tonic-gate int level; 617c478bd9Sstevel@tonic-gate } idev_power; 627c478bd9Sstevel@tonic-gate } ppmop; 637c478bd9Sstevel@tonic-gate } ppmreq_t; 647c478bd9Sstevel@tonic-gate 657c478bd9Sstevel@tonic-gate /* definition for ppmdev */ 667c478bd9Sstevel@tonic-gate #define PPM_INTERNAL_DEVICE_POWER 1 677c478bd9Sstevel@tonic-gate 687c478bd9Sstevel@tonic-gate /* 697c478bd9Sstevel@tonic-gate * PPMGET_DPWR 707c478bd9Sstevel@tonic-gate */ 717c478bd9Sstevel@tonic-gate struct ppm_dpwr { 727c478bd9Sstevel@tonic-gate char *domain; /* domain name */ 737c478bd9Sstevel@tonic-gate int level; /* domain power level */ 747c478bd9Sstevel@tonic-gate }; 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate /* 777c478bd9Sstevel@tonic-gate * PPMGET_DOMBYDEV 787c478bd9Sstevel@tonic-gate */ 797c478bd9Sstevel@tonic-gate struct ppm_bydev { 807c478bd9Sstevel@tonic-gate char *path; /* device prom path */ 817c478bd9Sstevel@tonic-gate char *domlist; /* domain names */ 827c478bd9Sstevel@tonic-gate size_t size; /* size of domlist buffer */ 837c478bd9Sstevel@tonic-gate }; 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gate /* 867c478bd9Sstevel@tonic-gate * PPMGET_DEVBYDOM 877c478bd9Sstevel@tonic-gate */ 887c478bd9Sstevel@tonic-gate struct ppm_bydom { 897c478bd9Sstevel@tonic-gate char *domain; /* domain name */ 907c478bd9Sstevel@tonic-gate char *devlist; /* domain device list */ 917c478bd9Sstevel@tonic-gate size_t size; /* size of devlist buffer */ 927c478bd9Sstevel@tonic-gate }; 937c478bd9Sstevel@tonic-gate 94*5cff7825Smh27603 /* 95*5cff7825Smh27603 * PPM[GS]ET_NORM 96*5cff7825Smh27603 */ 97*5cff7825Smh27603 struct ppm_norm { 98*5cff7825Smh27603 char *path; /* device prom path */ 99*5cff7825Smh27603 int norm; /* normal level */ 100*5cff7825Smh27603 }; 1017c478bd9Sstevel@tonic-gate 1027c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32 1037c478bd9Sstevel@tonic-gate /* 1047c478bd9Sstevel@tonic-gate * kernel view of ILP32 data structure 1057c478bd9Sstevel@tonic-gate */ 1067c478bd9Sstevel@tonic-gate struct ppm_dpwr32 { 1077c478bd9Sstevel@tonic-gate caddr32_t domain; /* domain name */ 1087c478bd9Sstevel@tonic-gate int32_t level; /* domain power level */ 1097c478bd9Sstevel@tonic-gate }; 1107c478bd9Sstevel@tonic-gate 1117c478bd9Sstevel@tonic-gate struct ppm_bydev32 { 1127c478bd9Sstevel@tonic-gate caddr32_t path; /* device prom path */ 1137c478bd9Sstevel@tonic-gate caddr32_t domlist; /* domain names */ 1147c478bd9Sstevel@tonic-gate size32_t size; /* size of domlist buffer */ 1157c478bd9Sstevel@tonic-gate }; 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gate struct ppm_bydom32 { 1187c478bd9Sstevel@tonic-gate caddr32_t domain; /* domain name */ 1197c478bd9Sstevel@tonic-gate caddr32_t devlist; /* domain device list */ 1207c478bd9Sstevel@tonic-gate size32_t size; /* size of devlist buffer */ 1217c478bd9Sstevel@tonic-gate }; 122*5cff7825Smh27603 123*5cff7825Smh27603 struct ppm_norm32 { 124*5cff7825Smh27603 caddr32_t path; /* device prom path */ 125*5cff7825Smh27603 int32_t norm; /* normal level */ 126*5cff7825Smh27603 }; 1277c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */ 1287c478bd9Sstevel@tonic-gate 1297c478bd9Sstevel@tonic-gate /* 1307c478bd9Sstevel@tonic-gate * .level may be the following 1317c478bd9Sstevel@tonic-gate */ 1327c478bd9Sstevel@tonic-gate #define PPMIO_POWER_OFF 0 1337c478bd9Sstevel@tonic-gate #define PPMIO_POWER_ON 1 1347c478bd9Sstevel@tonic-gate #define PPMIO_LED_BLINKING 2 1357c478bd9Sstevel@tonic-gate #define PPMIO_LED_SOLIDON 3 1367c478bd9Sstevel@tonic-gate /* (s10) */ 1377c478bd9Sstevel@tonic-gate #define PPM_IDEV_POWER_OFF PPMIO_POWER_OFF 1387c478bd9Sstevel@tonic-gate #define PPM_IDEV_POWER_ON PPMIO_POWER_ON 1397c478bd9Sstevel@tonic-gate 1407c478bd9Sstevel@tonic-gate 1417c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1427c478bd9Sstevel@tonic-gate } 1437c478bd9Sstevel@tonic-gate #endif 1447c478bd9Sstevel@tonic-gate 1457c478bd9Sstevel@tonic-gate #endif /* _SYS_PPMIO_H */ 146