ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
hdd-ioctl.h
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
16 #ifndef __HDD_IOCTL_H__
17 #define __HDD_IOCTL_H__
18 
19 #include <tamtypes.h>
20 
22 // DEV9.IRX
23 
24 #define DEV9_TYPE_PCMCIA 0
25 #define DEV9_TYPE_EXPBAY 1
26 
27 #define DDIOC_MODEL 0x4401
28 #define DDIOC_OFF 0x4402
29 
31 // HDD.IRX
32 
33 // Partition format/types (as returned via the mode field for getstat/dread)
34 #define APA_TYPE_FREE 0x0000
36 #define APA_TYPE_MBR 0x0001
37 #define APA_TYPE_EXT2SWAP 0x0082
38 #define APA_TYPE_EXT2 0x0083
39 #define APA_TYPE_REISER 0x0088
40 #define APA_TYPE_PFS 0x0100
41 #define APA_TYPE_CFS 0x0101
42 
43 #define APA_IDMAX 32
45 #define APA_MAXSUB 64
46 #define APA_PASSMAX 8
48 #define APA_FLAG_SUB 0x0001
49 
50 //
51 // IOCTL2 commands
52 //
53 #define HIOCADDSUB 0x6801
54 #define HIOCDELSUB 0x6802
55 #define HIOCNSUB 0x6803
56 #define HIOCFLUSH 0x6804
57 
58 // Arbitrarily-named commands
60 #define HIOCTRANSFER 0x6832
62 #define HIOCGETSIZE 0x6833
64 #define HIOCSETPARTERROR 0x6834
66 #define HIOCGETPARTERROR 0x6835
67 
68 // I/O direction
69 #define APA_IO_MODE_READ 0x00
70 #define APA_IO_MODE_WRITE 0x01
71 
72 // structs for IOCTL2 commands
73 typedef struct
74 {
82  void *buffer;
84 
85 //
86 // DEVCTL commands
87 //
88 // 'H' set
90 #define HDIOC_MAXSECTOR 0x4801
92 #define HDIOC_TOTALSECTOR 0x4802
93 #define HDIOC_IDLE 0x4803
94 #define HDIOC_FLUSH 0x4804
95 #define HDIOC_SWAPTMP 0x4805
96 #define HDIOC_DEV9OFF 0x4806
97 #define HDIOC_STATUS 0x4807
98 #define HDIOC_FORMATVER 0x4808
99 #define HDIOC_SMARTSTAT 0x4809
101 #define HDIOC_FREESECTOR 0x480A
102 #define HDIOC_IDLEIMM 0x480B
103 
104 // 'h' command set
105 // Arbitrarily-named commands
106 #define HDIOC_GETTIME 0x6832
108 #define HDIOC_SETOSDMBR 0x6833
109 #define HDIOC_GETSECTORERROR 0x6834
111 #define HDIOC_GETERRORPARTNAME 0x6835
113 #define HDIOC_READSECTOR 0x6836
115 #define HDIOC_WRITESECTOR 0x6837
117 #define HDIOC_SCEIDENTIFY 0x6838
118 
119 // structs for DEVCTL commands
120 
121 typedef struct
122 {
125  u8 data[0];
127 
128 typedef struct
129 {
133 
134 //For backward-compatibility
135 // ioctl2 commands for ps2hdd.irx
136 #define HDDIO_ADD_SUB HIOCADDSUB
137 #define HDDIO_DELETE_END_SUB HIOCDELSUB
138 #define HDDIO_NUMBER_OF_SUBS HIOCNSUB
139 #define HDDIO_FLUSH_CACHE HIOCFLUSH
140 #define HDDIO_GETSIZE HIOCGETSIZE
141 
142 #define APA_IOCTL2_ADD_SUB HIOCADDSUB
143 #define APA_IOCTL2_DELETE_LAST_SUB HIOCDELSUB
144 #define APA_IOCTL2_NUMBER_OF_SUBS HIOCNSUB
145 #define APA_IOCTL2_FLUSH_CACHE HIOCFLUSH
146 
147 #define APA_IOCTL2_TRANSFER_DATA HIOCTRANSFER
148 #define APA_IOCTL2_GETSIZE HIOCGETSIZE
149 #define APA_IOCTL2_SET_PART_ERROR HIOCSETPARTERROR
150 #define APA_IOCTL2_GET_PART_ERROR HIOCGETPARTERROR
151 
152 // devctl commands for ps2hdd.irx
153 #define HDDCTL_MAX_SECTORS HDIOC_MAXSECTOR
154 #define HDDCTL_TOTAL_SECTORS HDIOC_TOTALSECTOR
155 #define HDDCTL_IDLE HDIOC_IDLE
156 #define HDDCTL_FLUSH_CACHE HDIOC_FLUSH
157 #define HDDCTL_SWAP_TMP HDIOC_SWAPTMP
158 #define HDDCTL_DEV9_SHUTDOWN HDIOC_DEV9OFF
159 #define HDDCTL_STATUS HDIOC_STATUS
160 #define HDDCTL_FORMAT HDIOC_FORMATVER
161 #define HDDCTL_SMART_STAT HDIOC_SMARTSTAT
162 #define HDDCTL_FREE_SECTORS HDIOC_FREESECTOR
163 
164 #define APA_DEVCTL_MAX_SECTORS HDIOC_MAXSECTOR
165 #define APA_DEVCTL_TOTAL_SECTORS HDIOC_TOTALSECTOR
166 #define APA_DEVCTL_IDLE HDIOC_IDLE
167 #define APA_DEVCTL_FLUSH_CACHE HDIOC_FLUSH
168 #define APA_DEVCTL_SWAP_TMP HDIOC_SWAPTMP
169 #define APA_DEVCTL_DEV9_SHUTDOWN HDIOC_DEV9OFF
170 #define APA_DEVCTL_STATUS HDIOC_STATUS
171 #define APA_DEVCTL_FORMAT HDIOC_FORMATVER
172 #define APA_DEVCTL_SMART_STAT HDIOC_SMARTSTAT
173 #define APA_DEVCTL_FREE_SECTORS HDIOC_FREESECTOR
174 
175 #define APA_DEVCTL_GETTIME HDIOC_GETTIME
176 #define APA_DEVCTL_SET_OSDMBR HDIOC_SETOSDMBR
177 #define APA_DEVCTL_GET_SECTOR_ERROR HDIOC_GETSECTORERROR
178 #define APA_DEVCTL_GET_ERROR_PART_NAME HDIOC_GETERRORPARTNAME
179 #define APA_DEVCTL_ATA_READ HDIOC_READSECTOR
180 #define APA_DEVCTL_ATA_WRITE HDIOC_WRITESECTOR
181 #define APA_DEVCTL_SCE_IDENTIFY_DRIVE HDIOC_SCEIDENTIFY
182 
184 // PFS.IRX
185 
186 // IOCTL2 commands
187 // Command set 'p'
188 #define PIOCALLOC 0x7001
189 #define PIOCFREE 0x7002
190 #define PIOCATTRADD 0x7003
191 #define PIOCATTRDEL 0x7004
192 #define PIOCATTRLOOKUP 0x7005
193 #define PIOCATTRREAD 0x7006
194 #define PIOCINVINODE 0x7032 //Only available in OSD version. Arbitrarily named.
195 
196 // DEVCTL commands
197 // Command set 'P'
198 #define PDIOC_ZONESZ 0x5001
199 #define PDIOC_ZONEFREE 0x5002
200 #define PDIOC_CLOSEALL 0x5003
201 #define PDIOC_GETFSCKSTAT 0x5004
202 #define PDIOC_CLRFSCKSTAT 0x5005
203 
204 // Arbitrarily-named commands
205 #define PDIOC_SHOWBITMAP 0xFF
206 
207 // I/O direction
208 #define PFS_IO_MODE_READ 0x00
209 #define PFS_IO_MODE_WRITE 0x01
210 
211 //For backward-compatibility
212 // ioctl2 commands for ps2fs.irx
213 #define PFSIO_ALLOC PIOCALLOC
214 #define PFSIO_FREE PIOCFREE
215 #define PFSIO_ATTR_ADD PIOCATTRADD
216 #define PFSIO_ATTR_DEL PIOCATTRDEL
217 #define PFSIO_ATTR_LOOKUP PIOCATTRLOOKUP
218 #define PFSIO_ATTR_READ PIOCATTRREAD
219 
220 #define PFS_IOCTL2_ALLOC PIOCALLOC
221 #define PFS_IOCTL2_FREE PIOCFREE
222 #define PFS_IOCTL2_ATTR_ADD PIOCATTRADD
223 #define PFS_IOCTL2_ATTR_DEL PIOCATTRDEL
224 #define PFS_IOCTL2_ATTR_LOOKUP PIOCATTRLOOKUP
225 #define PFS_IOCTL2_ATTR_READ PIOCATTRREAD
226 
227 // devctl commands for ps2fs.irx
228 #define PFSCTL_GET_ZONE_SIZE PDIOC_ZONESZ
229 #define PFSCTL_GET_ZONE_FREE PDIOC_ZONEFREE
230 #define PFSCTL_CLOSE_ALL PDIOC_CLOSEALL
231 #define PFSCTL_GET_STAT PDIOC_GETFSCKSTAT
232 #define PFSCTL_CLEAR_STAT PDIOC_CLRFSCKSTAT
233 
234 #define PFS_DEVCTL_GET_ZONE_SIZE PDIOC_ZONESZ
235 #define PFS_DEVCTL_GET_ZONE_FREE PDIOC_ZONEFREE
236 #define PFS_DEVCTL_CLOSE_ALL PDIOC_CLOSEALL
237 #define PFS_DEVCTL_GET_STAT PDIOC_GETFSCKSTAT
238 #define PFS_DEVCTL_CLEAR_STAT PDIOC_CLRFSCKSTAT
239 
240 #define PFS_DEVCTL_SHOW_BITMAP PDIOC_SHOWBITMAP
241 
242 #endif /* __HDD_IOCTL_H__ */
u32 data
Definition: libmouse.c:36
unsigned int u32
Definition: tamtypes.h:30
unsigned char u8
Definition: tamtypes.h:23