11991Sheppo /* 21991Sheppo * CDDL HEADER START 31991Sheppo * 41991Sheppo * The contents of this file are subject to the terms of the 51991Sheppo * Common Development and Distribution License (the "License"). 61991Sheppo * You may not use this file except in compliance with the License. 71991Sheppo * 81991Sheppo * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 91991Sheppo * or http://www.opensolaris.org/os/licensing. 101991Sheppo * See the License for the specific language governing permissions 111991Sheppo * and limitations under the License. 121991Sheppo * 131991Sheppo * When distributing Covered Code, include this CDDL HEADER in each 141991Sheppo * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 151991Sheppo * If applicable, add the following below this CDDL HEADER, with the 161991Sheppo * fields enclosed by brackets "[]" replaced with your own identifying 171991Sheppo * information: Portions Copyright [yyyy] [name of copyright owner] 181991Sheppo * 191991Sheppo * CDDL HEADER END 201991Sheppo */ 211991Sheppo 221991Sheppo /* 23*12260SHaik.Aftandilian@Sun.COM * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 241991Sheppo */ 251991Sheppo 261991Sheppo #ifndef _PLATSVC_H 271991Sheppo #define _PLATSVC_H 281991Sheppo 291991Sheppo #ifdef __cplusplus 301991Sheppo extern "C" { 311991Sheppo #endif 321991Sheppo 331991Sheppo #include <sys/types.h> 341991Sheppo #include <sys/ds.h> 351991Sheppo 361991Sheppo #define MAX_REASON_SIZE 1 3711172SHaik.Aftandilian@Sun.COM #define SUSPEND_MAX_REASON_SIZE 256 381991Sheppo 391991Sheppo /* 401991Sheppo * PLATSVC STATUS 411991Sheppo */ 421991Sheppo #define PLATSVC_SUCCESS 0x0 431991Sheppo #define PLATSVC_FAILURE 0x1 441991Sheppo #define PLATSVC_INVALID_MESG 0x2 451991Sheppo 461991Sheppo #define MD_UPDATE_SUCCESS PLATSVC_SUCCESS 471991Sheppo #define MD_UPDATE_FAILURE PLATSVC_FAILURE 481991Sheppo #define MD_UPDATE_INVALID_MSG PLATSVC_INVALID_MESG 491991Sheppo 501991Sheppo #define DOMAIN_SHUTDOWN_SUCCESS PLATSVC_SUCCESS 511991Sheppo #define DOMAIN_SHUTDOWN_FAILURE PLATSVC_FAILURE 521991Sheppo #define DOMAIN_SHUTDOWN_INVALID_MSG PLATSVC_INVALID_MESG 531991Sheppo 541991Sheppo #define DOMAIN_PANIC_SUCCESS PLATSVC_SUCCESS 551991Sheppo #define DOMAIN_PANIC_FAILURE PLATSVC_FAILURE 561991Sheppo #define DOMAIN_PANIC_INVALID_MSG PLATSVC_INVALID_MESG 571991Sheppo 5811172SHaik.Aftandilian@Sun.COM /* 5911172SHaik.Aftandilian@Sun.COM * Suspend message types. 6011172SHaik.Aftandilian@Sun.COM */ 6111172SHaik.Aftandilian@Sun.COM #define DOMAIN_SUSPEND_SUSPEND 0x0 6211172SHaik.Aftandilian@Sun.COM 6311172SHaik.Aftandilian@Sun.COM /* 6411172SHaik.Aftandilian@Sun.COM * Suspend response result values. 6511172SHaik.Aftandilian@Sun.COM */ 6611172SHaik.Aftandilian@Sun.COM #define DOMAIN_SUSPEND_PRE_SUCCESS PLATSVC_SUCCESS 6711172SHaik.Aftandilian@Sun.COM #define DOMAIN_SUSPEND_PRE_FAILURE PLATSVC_FAILURE 6811172SHaik.Aftandilian@Sun.COM #define DOMAIN_SUSPEND_INVALID_MSG PLATSVC_INVALID_MESG 6911172SHaik.Aftandilian@Sun.COM #define DOMAIN_SUSPEND_INPROGRESS 0x3 7011172SHaik.Aftandilian@Sun.COM #define DOMAIN_SUSPEND_SUSPEND_FAILURE 0x4 7111172SHaik.Aftandilian@Sun.COM #define DOMAIN_SUSPEND_POST_SUCCESS 0x5 7211172SHaik.Aftandilian@Sun.COM #define DOMAIN_SUSPEND_POST_FAILURE 0x6 7311172SHaik.Aftandilian@Sun.COM 7411172SHaik.Aftandilian@Sun.COM /* 7511172SHaik.Aftandilian@Sun.COM * Suspend recovery result values. 7611172SHaik.Aftandilian@Sun.COM */ 7711172SHaik.Aftandilian@Sun.COM #define DOMAIN_SUSPEND_REC_SUCCESS 0x0 7811172SHaik.Aftandilian@Sun.COM #define DOMAIN_SUSPEND_REC_FAILURE 0x1 7911172SHaik.Aftandilian@Sun.COM 80*12260SHaik.Aftandilian@Sun.COM /* 81*12260SHaik.Aftandilian@Sun.COM * String used as the error reason in the failure response when a 82*12260SHaik.Aftandilian@Sun.COM * suspend request is denied due to an ongoing DR operation. 83*12260SHaik.Aftandilian@Sun.COM */ 84*12260SHaik.Aftandilian@Sun.COM #define DOMAIN_SUSPEND_DR_ERROR_STR \ 85*12260SHaik.Aftandilian@Sun.COM "suspend failure: DR operation in progress" 86*12260SHaik.Aftandilian@Sun.COM 871991Sheppo typedef struct platsvc_md_update_req { 881991Sheppo uint64_t req_num; 891991Sheppo } platsvc_md_update_req_t; 901991Sheppo 911991Sheppo typedef struct platsvc_md_update_resp { 921991Sheppo uint64_t req_num; 931991Sheppo uint32_t result; 941991Sheppo } platsvc_md_update_resp_t; 951991Sheppo 961991Sheppo typedef struct platsvc_shutdown_req { 971991Sheppo uint64_t req_num; 981991Sheppo uint32_t delay; 991991Sheppo } platsvc_shutdown_req_t; 1001991Sheppo 1011991Sheppo typedef struct platsvc_shutdown_resp { 1021991Sheppo uint64_t req_num; 1031991Sheppo uint32_t result; 1041991Sheppo char reason[MAX_REASON_SIZE]; 1051991Sheppo } platsvc_shutdown_resp_t; 1061991Sheppo 1071991Sheppo typedef struct platsvc_panic_req { 1081991Sheppo uint64_t req_num; 1091991Sheppo } platsvc_panic_req_t; 1101991Sheppo 1111991Sheppo typedef struct platsvc_panic_resp { 1121991Sheppo uint64_t req_num; 1131991Sheppo uint32_t result; 1141991Sheppo char reason[MAX_REASON_SIZE]; 1151991Sheppo } platsvc_panic_resp_t; 1161991Sheppo 11711172SHaik.Aftandilian@Sun.COM typedef struct platsvc_suspend_req { 11811172SHaik.Aftandilian@Sun.COM uint64_t req_num; 11911172SHaik.Aftandilian@Sun.COM uint64_t type; 12011172SHaik.Aftandilian@Sun.COM } platsvc_suspend_req_t; 12111172SHaik.Aftandilian@Sun.COM 12211172SHaik.Aftandilian@Sun.COM typedef struct platsvc_suspend_resp { 12311172SHaik.Aftandilian@Sun.COM uint64_t req_num; 12411172SHaik.Aftandilian@Sun.COM uint32_t result; 12511172SHaik.Aftandilian@Sun.COM uint32_t rec_result; 12611172SHaik.Aftandilian@Sun.COM char reason[MAX_REASON_SIZE]; 12711172SHaik.Aftandilian@Sun.COM } platsvc_suspend_resp_t; 12811172SHaik.Aftandilian@Sun.COM 1291991Sheppo #ifdef __cplusplus 1301991Sheppo } 1311991Sheppo #endif 1321991Sheppo 1331991Sheppo #endif /* _PLATSVC_H */ 134