ps3dm_sm: set_del_encdec_key: fixed description for default key
[ps3dm-utils.git] / ps3ss.h
blob7f4c9c229e560c7616f80f86f038790004388bb7
2 /*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; version 2 of the License.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #ifndef _PS3SS_H_
18 #define _PS3SS_H_
20 #include <stdint.h>
22 #define PS3SS_FID_VTRM 0x2000
23 #define PS3SS_PID_VTRM_GET_STATUS 0x2002
25 #define PS3SS_FID_SRTC 0x3000
26 #define PS3SS_PID_SRTC_GET_TIME 0x3002
28 #define PS3SS_FID_SM 0x5000
29 #define PS3SS_PID_SM_SET_ENCDEC_KEY 0x5001
30 #define PS3SS_PID_SM_SET_DEL_ENCDEC_KEY 0x5002
31 #define PS3SS_PID_SM_GET_RND_NUMBER 0x5003
32 #define PS3SS_PID_SM_DRIVE_AUTH 0x5004
33 #define PS3SS_PID_SM_PS2_DISC_AUTH 0x5005
34 #define PS3SS_PID_SM_GET_VERSION 0x5006
35 #define PS3SS_PID_SM_DRIVE_CTRL 0x5007
37 #define PS3SS_FID_UM 0x6000
38 #define PS3SS_PID_UM_UPDATE_PKG 0x6001
39 #define PS3SS_PID_UM_INSPECT_PKG 0x6002
40 #define PS3SS_PID_UM_GET_PKG_INFO 0x6003
41 #define PS3SS_PID_UM_GET_FIX_INSTR 0x6004
42 #define PS3SS_PID_UM_EXTRACT_PKG 0x6005
43 #define PS3SS_PID_UM_GET_EXTRACT_PKG 0x6006
44 #define PS3SS_PID_UM_GET_TOKEN_SEED 0x6009
45 #define PS3SS_PID_UM_SET_TOKEN 0x600a
46 #define PS3SS_PID_UM_READ_EPROM 0x600b
47 #define PS3SS_PID_UM_WRITE_EPROM 0x600c
48 #define PS3SS_PID_UM_CHECK_INT 0x6010
49 #define PS3SS_PID_UM_GET_APPL_VER 0x6011
51 #define PS3SS_FID_SCM 0x9000
52 #define PS3SS_PID_SCM_GET_REGION_DATA 0x9006
53 #define PS3SS_PID_SCM_GET_TIME 0x9009
54 #define PS3SS_PID_SCM_READ_EPROM 0x900b
55 #define PS3SS_PID_SCM_WRITE_EPROM 0x900c
56 #define PS3SS_PID_SCM_GET_SC_STATUS 0x900e
58 #define PS3SS_FID_IIM 0x17000
59 #define PS3SS_PID_IIM_GET_DATA_SIZE 0x17001
60 #define PS3SS_PID_IIM_GET_DATA 0x17002
61 #define PS3SS_PID_IIM_GET_CISD_SIZE 0x17015
63 #define PS3SS_FID_AIM 0x19000
64 #define PS3SS_PID_AIM_GET_DEV_TYPE 0x19002
65 #define PS3SS_PID_AIM_GET_DEV_ID 0x19003
66 #define PS3SS_PID_AIM_GET_PS_CODE 0x19004
67 #define PS3SS_PID_AIM_GET_OPEN_PS_ID 0x19005
69 #define PS3SS_FID_USB_DONGLE_AUTH 0x24000
70 #define PS3SS_PID_USB_DONGLE_AUTH_GEN_CHALLENGE 0x24001
71 #define PS3SS_PID_USB_DONGLE_AUTH_VERIFY_RESP 0x24002
73 struct ps3ss_hdr {
74 uint64_t packet_id;
75 uint64_t function_id;
76 uint32_t retval;
77 uint8_t res[4];
78 uint64_t laid;
79 uint64_t paid;
82 #define PS3SS_HDR_SIZE sizeof(struct ps3ss_hdr)
84 struct ps3ss_vtrm_get_status {
85 uint32_t field0;
86 uint8_t res1[4];
87 uint32_t field8;
88 uint8_t res2[4];
89 uint32_t field10;
90 uint8_t res3[4];
93 struct ps3ss_srtc_get_time {
94 uint64_t field0;
95 uint64_t field8;
96 uint64_t field10;
99 struct ps3ss_sm_set_encdec_key {
100 uint8_t key[24];
101 uint64_t key_size;
102 uint64_t param;
105 struct ps3ss_sm_set_del_encdec_key {
106 uint64_t param;
109 struct ps3ss_sm_get_rnd_number {
110 uint8_t field0[24];
113 struct ps3ss_sm_drive_auth {
114 uint64_t param;
117 struct ps3ss_sm_ps2_disc_auth {
118 uint8_t field0[56];
121 struct ps3ss_sm_get_version {
122 uint8_t field0[8];
125 struct ps3ss_sm_drive_ctrl {
126 uint64_t param;
127 uint8_t field8[16];
130 struct ps3ss_um_update_pkg {
131 uint32_t in_lpar_mem;
132 uint8_t res1[4];
133 uint32_t pkg_type;
134 uint8_t res2[4];
135 uint32_t flags;
136 uint8_t res3[4];
137 uint64_t lpar_id;
138 uint64_t pkg_size;
139 union {
140 struct {
141 uint64_t lpar_addr;
142 uint64_t size;
143 uint64_t field10;
144 } lpar_mem_segs[0];
146 uint8_t raw[0];
147 } pkg_data;
148 /* uint64_t request_id */
151 struct ps3ss_um_get_pkg_info {
152 uint32_t type;
153 uint8_t res[4];
154 uint64_t version;
157 struct ps3ss_um_get_fix_instr {
158 uint8_t field0[12];
161 struct ps3ss_um_get_extract_pkg {
162 uint32_t in_lpar_mem;
163 uint8_t res1[4];
164 uint64_t field8;
165 uint32_t field10;
166 uint8_t res2[4];
167 uint64_t request_id;
168 uint64_t buf_size;
169 uint8_t buf[0];
172 struct ps3ss_um_get_token_seed {
173 uint64_t token_size;
174 uint8_t token[80];
175 uint64_t seed_size;
176 uint8_t seed[80];
179 struct ps3ss_um_read_eprom {
180 uint32_t offset;
181 uint8_t res[4];
182 uint8_t val;
185 struct ps3ss_um_write_eprom {
186 uint32_t offset;
187 uint8_t res[4];
188 uint8_t val;
191 struct ps3ss_scm_get_region_data {
192 uint64_t id;
193 uint64_t data_size;
194 uint8_t data[0];
197 struct ps3ss_scm_get_time {
198 uint64_t tid;
199 uint64_t field8;
200 uint64_t field10;
203 struct ps3ss_scm_read_eprom {
204 uint32_t offset;
205 uint8_t res1[4];
206 uint32_t nread;
207 uint8_t res2[4];
208 uint64_t buf_size;
209 uint8_t buf[0];
212 struct ps3ss_scm_write_eprom {
213 uint32_t offset;
214 uint8_t res1[4];
215 uint32_t nwrite;
216 uint8_t res2[4];
217 uint64_t buf_size;
218 uint8_t buf[0];
221 struct ps3ss_scm_get_sc_status {
222 uint32_t version;
223 uint8_t res1[4];
224 uint32_t mode;
225 uint8_t res2[4];
228 struct ps3ss_iim_get_data_size {
229 uint64_t index;
230 uint64_t size;
233 struct ps3ss_iim_get_data {
234 uint64_t index;
235 uint64_t buf_size;
236 uint8_t buf[0];
237 /* uint64_t data_size */
240 struct ps3ss_iim_get_cisd_size {
241 uint64_t size;
244 struct ps3ss_aim_get_dev_type {
245 uint8_t field0[16];
248 struct ps3ss_aim_get_dev_id {
249 uint8_t field0[16];
252 struct ps3ss_aim_get_ps_code {
253 uint8_t field0[8];
256 struct ps3ss_aim_get_open_ps_id {
257 uint8_t field0[16];
260 struct ps3ss_usb_dongle_auth_gen_challenge {
261 uint8_t header[3];
262 uint8_t challenge[20];
265 struct ps3ss_usb_dongle_auth_verify_resp {
266 uint8_t header[3];
267 uint16_t dongle_id;
268 uint8_t response[20];
269 } __attribute__ ((packed));
271 #endif