mgh: fix for default HDD DMA mode, that wasn't correctly set
[open-ps2-loader.git] / modules / vmc / mcman / secrman.h
blob53c4369b9ede372522286f0ce36a98625b361990
1 #ifndef IOP_SECRMAN_H
2 #define IOP_SECRMAN_H
4 #include "types.h"
5 #include "irx.h"
7 // Encrypted file Data Block info struct
8 typedef struct t_Block_Data {
9 u32 size; // Size of data block
10 u32 flags; // Flags : 3 -> block to decrypt, 0 -> block to take in input file, 2 -> block to prepare
11 u8 checksum[8];
12 } Block_Data_t;
14 // Encrypted file BIT table struct
15 typedef struct t_Bit_Data {
16 u32 headersize; // Kelf header size (same as Kelf_Header_t.Kelf_header_size)
17 u8 block_count; // Number of blocks in the Kelf file
18 u8 pad1;
19 u8 pad2;
20 u8 pad3;
21 Block_Data_t blocks[63];// Kelf blocks infos
22 } Bit_Data_t;
24 // Encrypted file header struct
25 typedef struct t_Kelf_Header {
26 u32 unknown1;
27 u32 unknown2;
28 u16 unknown3_half;
29 u16 version;
30 u32 unknown4;
31 u32 ELF_size; // Size of data blocks = Decrypted elf size
32 u16 Kelf_header_size; // Kelf header size
33 u16 unknown5;
34 u16 flags; // ? for header purpose
35 u16 BIT_count; // used to set/get kbit and kc offset
36 u32 mg_zones;
37 } Kelf_Header_t;
39 #define secrman_IMPORTS_start DECLARE_IMPORT_TABLE(secrman, 1, 3)
40 #define secrman_IMPORTS_end END_IMPORT_TABLE
42 /* 04 */ void SetMcCommandCallback(void *addr);
43 #define I_SetMcCommandCallback DECLARE_IMPORT(4, SetMcCommandCallback)
45 /* 05 */ void SetMcDevIDCallback(void *addr);
46 #define I_SetMcDevIDCallback DECLARE_IMPORT(5, SetMcDevIDCallback)
48 /* 06 */ int SecrAuthCard(int port, int slot, int cnum);
49 #define I_SecrAuthCard DECLARE_IMPORT(6, SecrAuthCard)
51 /* 07 */ void SecrResetAuthCard(int port, int slot, int cnum);
52 #define I_SecrResetAuthCard DECLARE_IMPORT(7, SecrResetAuthCard)
54 /* 08 */ int SecrCardBootHeader(int port, int slot, void *buf, void *bit, int *psize);
55 #define I_SecrCardBootHeader DECLARE_IMPORT(8, SecrCardBootHeader)
57 /* 09 */ int SecrCardBootBlock(void *src, void *dst, int size);
58 #define I_SecrCardBootBlock DECLARE_IMPORT(9, SecrCardBootBlock)
60 /* 10 */ void *SecrCardBootFile(int port, int slot, void *buf);
61 #define I_SecrCardBootFile DECLARE_IMPORT(10, SecrCardBootFile)
63 /* 11 */ int SecrDiskBootHeader(void *buf, void *bit, int *psize);
64 #define I_SecrDiskBootHeader DECLARE_IMPORT(11, SecrDiskBootHeader)
66 /* 12 */ int SecrDiskBootBlock(void *src, void *dst, int size);
67 #define I_SecrDiskBootBlock DECLARE_IMPORT(12, SecrDiskBootBlock)
69 /* 13 */ void *SecrDiskBootFile(void *buf);
70 #define I_SecrDiskBootFile DECLARE_IMPORT(13, SecrDiskBootFile)
72 /* FOLLOWING EXPORTS ARE ONLY AVAILABLE IN SPECIAL SECRMAN OR FREESECR */
74 /* 14 */ int SecrDownloadHeader(int port, int slot, void *buf, void *bit, int *psize);
75 #define I_SecrDownloadHeader DECLARE_IMPORT(14, SecrDownloadHeader)
77 /* 15 */ int SecrDownloadBlock(void *src, int size);
78 #define I_SecrDownloadBlock DECLARE_IMPORT(15, SecrDownloadBlock)
80 /* 16 */ void *SecrDownloadFile(int port, int slot, void *buf);
81 #define I_SecrDownloadFile DECLARE_IMPORT(16, SecrDownloadFile)
83 /* 17 */ int SecrDownloadGetKbit(int port, int slot, void *kbit);
84 #define I_SecrDownloadGetKbit DECLARE_IMPORT(17, SecrDownloadGetKbit)
86 /* 18 */ int SecrDownloadGetKc(int port, int slot, void *kbit);
87 #define I_SecrDownloadGetKc DECLARE_IMPORT(18, SecrDownloadGetKc)
89 /* 19 */ int SecrDownloadGetICVPS2(void *icvps2);
90 #define I_SecrDownloadGetICVPS2 DECLARE_IMPORT(19, SecrDownloadGetICVPS2)
92 #endif /* IOP_SECRMAN_H */