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*5cff7825Smh * Common Development and Distribution License (the "License"). 6*5cff7825Smh * 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*5cff7825Smh * 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 #include <sys/types.h> 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #ifdef __cplusplus 327c478bd9Sstevel@tonic-gate extern "C" { 337c478bd9Sstevel@tonic-gate #endif 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate #define PPMIOC ('p' << 8) 367c478bd9Sstevel@tonic-gate #define PPMIOCSET (PPMIOC | 1) 377c478bd9Sstevel@tonic-gate #define PPMIOCGET (PPMIOC | 2) 387c478bd9Sstevel@tonic-gate #define PPMGET_DPWR (PPMIOC | 3) 397c478bd9Sstevel@tonic-gate #define PPMGET_DOMBYDEV (PPMIOC | 4) 407c478bd9Sstevel@tonic-gate #define PPMGET_DEVBYDOM (PPMIOC | 5) 41*5cff7825Smh /* 42*5cff7825Smh * The following two ioctls are used for testing purposes only. 43*5cff7825Smh */ 44*5cff7825Smh #if defined(__x86) 45*5cff7825Smh #define PPMGET_NORMAL (PPMIOC | 6) 46*5cff7825Smh #define PPMSET_NORMAL (PPMIOC | 7) 47*5cff7825Smh #endif 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gate /* 507c478bd9Sstevel@tonic-gate * PPMIOCGET 517c478bd9Sstevel@tonic-gate * Note: this ioctl command is available for Excalibur and Grover 527c478bd9Sstevel@tonic-gate * only, but will be removed in future, replacing with PPMGET_DPWR 537c478bd9Sstevel@tonic-gate */ 547c478bd9Sstevel@tonic-gate typedef struct ppmreq { 557c478bd9Sstevel@tonic-gate int ppmdev; 567c478bd9Sstevel@tonic-gate union ppmop { 577c478bd9Sstevel@tonic-gate struct idev_power { 587c478bd9Sstevel@tonic-gate int level; 597c478bd9Sstevel@tonic-gate } idev_power; 607c478bd9Sstevel@tonic-gate } ppmop; 617c478bd9Sstevel@tonic-gate } ppmreq_t; 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate /* definition for ppmdev */ 647c478bd9Sstevel@tonic-gate #define PPM_INTERNAL_DEVICE_POWER 1 657c478bd9Sstevel@tonic-gate 667c478bd9Sstevel@tonic-gate /* 677c478bd9Sstevel@tonic-gate * PPMGET_DPWR 687c478bd9Sstevel@tonic-gate */ 697c478bd9Sstevel@tonic-gate struct ppm_dpwr { 707c478bd9Sstevel@tonic-gate char *domain; /* domain name */ 717c478bd9Sstevel@tonic-gate int level; /* domain power level */ 727c478bd9Sstevel@tonic-gate }; 737c478bd9Sstevel@tonic-gate 747c478bd9Sstevel@tonic-gate /* 757c478bd9Sstevel@tonic-gate * PPMGET_DOMBYDEV 767c478bd9Sstevel@tonic-gate */ 777c478bd9Sstevel@tonic-gate struct ppm_bydev { 787c478bd9Sstevel@tonic-gate char *path; /* device prom path */ 797c478bd9Sstevel@tonic-gate char *domlist; /* domain names */ 807c478bd9Sstevel@tonic-gate size_t size; /* size of domlist buffer */ 817c478bd9Sstevel@tonic-gate }; 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gate /* 847c478bd9Sstevel@tonic-gate * PPMGET_DEVBYDOM 857c478bd9Sstevel@tonic-gate */ 867c478bd9Sstevel@tonic-gate struct ppm_bydom { 877c478bd9Sstevel@tonic-gate char *domain; /* domain name */ 887c478bd9Sstevel@tonic-gate char *devlist; /* domain device list */ 897c478bd9Sstevel@tonic-gate size_t size; /* size of devlist buffer */ 907c478bd9Sstevel@tonic-gate }; 917c478bd9Sstevel@tonic-gate 92*5cff7825Smh /* 93*5cff7825Smh * PPM[GS]ET_NORM 94*5cff7825Smh */ 95*5cff7825Smh struct ppm_norm { 96*5cff7825Smh char *path; /* device prom path */ 97*5cff7825Smh int norm; /* normal level */ 98*5cff7825Smh }; 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32 1017c478bd9Sstevel@tonic-gate /* 1027c478bd9Sstevel@tonic-gate * kernel view of ILP32 data structure 1037c478bd9Sstevel@tonic-gate */ 1047c478bd9Sstevel@tonic-gate struct ppm_dpwr32 { 1057c478bd9Sstevel@tonic-gate caddr32_t domain; /* domain name */ 1067c478bd9Sstevel@tonic-gate int32_t level; /* domain power level */ 1077c478bd9Sstevel@tonic-gate }; 1087c478bd9Sstevel@tonic-gate 1097c478bd9Sstevel@tonic-gate struct ppm_bydev32 { 1107c478bd9Sstevel@tonic-gate caddr32_t path; /* device prom path */ 1117c478bd9Sstevel@tonic-gate caddr32_t domlist; /* domain names */ 1127c478bd9Sstevel@tonic-gate size32_t size; /* size of domlist buffer */ 1137c478bd9Sstevel@tonic-gate }; 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gate struct ppm_bydom32 { 1167c478bd9Sstevel@tonic-gate caddr32_t domain; /* domain name */ 1177c478bd9Sstevel@tonic-gate caddr32_t devlist; /* domain device list */ 1187c478bd9Sstevel@tonic-gate size32_t size; /* size of devlist buffer */ 1197c478bd9Sstevel@tonic-gate }; 120*5cff7825Smh 121*5cff7825Smh struct ppm_norm32 { 122*5cff7825Smh caddr32_t path; /* device prom path */ 123*5cff7825Smh int32_t norm; /* normal level */ 124*5cff7825Smh }; 1257c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */ 1267c478bd9Sstevel@tonic-gate 1277c478bd9Sstevel@tonic-gate /* 1287c478bd9Sstevel@tonic-gate * .level may be the following 1297c478bd9Sstevel@tonic-gate */ 1307c478bd9Sstevel@tonic-gate #define PPMIO_POWER_OFF 0 1317c478bd9Sstevel@tonic-gate #define PPMIO_POWER_ON 1 1327c478bd9Sstevel@tonic-gate #define PPMIO_LED_BLINKING 2 1337c478bd9Sstevel@tonic-gate #define PPMIO_LED_SOLIDON 3 1347c478bd9Sstevel@tonic-gate /* (s10) */ 1357c478bd9Sstevel@tonic-gate #define PPM_IDEV_POWER_OFF PPMIO_POWER_OFF 1367c478bd9Sstevel@tonic-gate #define PPM_IDEV_POWER_ON PPMIO_POWER_ON 1377c478bd9Sstevel@tonic-gate 1387c478bd9Sstevel@tonic-gate 1397c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1407c478bd9Sstevel@tonic-gate } 1417c478bd9Sstevel@tonic-gate #endif 1427c478bd9Sstevel@tonic-gate 1437c478bd9Sstevel@tonic-gate #endif /* _SYS_PPMIO_H */ 144