2 * Copyright (C) 2011, 2012 glevand <geoffrey.levand@mail.ru>
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer,
10 * without modification, immediately at the beginning of the file.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 PS3SM_SID_REQ
= 0x0001,
34 PS3SM_SID_EXT_EVENT
= 0x0004,
35 PS3SM_SID_SET_NEXT_OP
= 0x0005,
36 PS3SM_SID_REQ_ERROR
= 0x0006,
37 PS3SM_SID_SET_ATTR
= 0x0008,
38 PS3SM_SID_GET_INTER_LPAR_PARAM
= 0x0009,
39 PS3SM_SID_SET_INTER_LPAR_PARAM
= 0x000a,
40 PS3SM_SID_CTL_LED
= 0x000c,
41 PS3SM_SID_RING_BUZZER
= 0x0015,
44 enum ps3sm_request_type
{
45 PS3SM_REQ_TYPE_SHUTDOWN
= 1,
48 enum ps3sm_guest_os_id
{
49 PS3SM_GOS_ID_SELF
= 0,
52 enum ps3sm_external_event
{
53 PS3SM_EXT_EVENT_POWER_PRESSED
= 3,
54 PS3SM_EXT_EVENT_POWER_RELEASED
= 4,
55 PS3SM_EXT_EVENT_RESET_PRESSED
= 5,
56 PS3SM_EXT_EVENT_RESET_RELEASED
= 6,
57 PS3SM_EXT_EVENT_THERMAL_ALERT
= 7,
58 PS3SM_EXT_EVENT_THERMAL_CLEARED
= 8,
61 enum ps3sm_next_operation
{
62 PS3SM_NEXT_OP_SYS_SHUTDOWN
= 1,
63 PS3SM_NEXT_OP_SYS_REBOOT
= 2,
64 PS3SM_NEXT_OP_LPAR_REBOOT
= 0x82,
67 enum ps3sm_wake_source
{
68 PS3SM_WAKE_SRC_DEFAULT
= 0,
69 PS3SM_WAKE_SRC_WOL
= 0x00000400,
70 PS3SM_WAKE_SRC_POR
= 0x80000000,
74 PS3SM_ATTR_POWER
= (1 << 0),
75 PS3SM_ATTR_RESET
= (1 << 1),
76 PS3SM_ATTR_THERMAL
= (1 << 2),
79 #define PS3SM_VERSION 1
85 uint32_t payload_length
;
86 uint16_t sid
; /* enum ps3sm_service */
91 #define PS3SM_HDR(_p) ((struct ps3sm_header *) (_p))
93 #define PS3SM_REQ_VERSION 1
96 struct ps3sm_header hdr
;
98 uint8_t type
; /* enum ps3sm_request_type */
99 uint8_t gos_id
; /* enum ps3sm_guest_os_id */
103 #define PS3SM_EXT_EVENT_VERSION 1
105 struct ps3sm_ext_event
{
106 struct ps3sm_header hdr
;
108 uint8_t type
; /* enum ps3sm_external_event */
114 #define PS3SM_SET_NEXT_OP_VERSION 3
116 struct ps3sm_set_next_op
{
117 struct ps3sm_header hdr
;
119 uint8_t type
; /* enum ps3sm_next_operation */
122 uint8_t wake_src
; /* enum ps3sm_wake_source */
126 #define PS3SM_REQ_ERROR_VERSION 1
128 struct ps3sm_req_error
{
129 struct ps3sm_header hdr
;
134 #define PS3SM_SET_ATTR_VERSION 1
136 struct ps3sm_set_attr
{
137 struct ps3sm_header hdr
;
140 uint32_t attrs
; /* enum ps3sm_attr */
143 #define PS3SM_CTL_LED_VERSION 1
145 struct ps3sm_ctl_led
{
146 struct ps3sm_header hdr
;
156 #define PS3SM_RING_BUZZER_VERSION 1
158 struct ps3sm_ring_buzzer
{
159 struct ps3sm_header hdr
;
168 ps3sm_init_header(struct ps3sm_header
*hdr
, uint32_t payload_length
,
169 uint16_t sid
, uint32_t tag
)
171 hdr
->version
= PS3SM_VERSION
;
172 hdr
->length
= sizeof(struct ps3sm_header
);
173 hdr
->payload_length
= payload_length
;
178 #endif /* _PS3SM_MSG_H */