PS2SDK
PS2 Homebrew Libraries
hdd-ioctl.h File Reference
#include <tamtypes.h>
+ Include dependency graph for hdd-ioctl.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hddIoctl2Transfer_t
 
struct  hddAtaTransfer_t
 
struct  hddSetOsdMBR_t
 

Macros

#define DEV9_TYPE_PCMCIA   0
 
#define DEV9_TYPE_EXPBAY   1
 
#define DDIOC_MODEL   0x4401
 
#define DDIOC_OFF   0x4402
 
#define DDIOC_SETPIO3   0x4403
 
#define DDIOC_LED2CTL   0x4404
 
#define APA_TYPE_FREE   0x0000
 
#define APA_TYPE_MBR   0x0001
 
#define APA_TYPE_EXT2SWAP   0x0082
 
#define APA_TYPE_EXT2   0x0083
 
#define APA_TYPE_REISER   0x0088
 
#define APA_TYPE_PFS   0x0100
 
#define APA_TYPE_CFS   0x0101
 
#define APA_TYPE_HDL   0x1337
 
#define APA_IDMAX   32
 
#define APA_MAXSUB   64
 
#define APA_PASSMAX   8
 
#define APA_FLAG_SUB   0x0001
 
#define HIOCADDSUB   0x6801
 
#define HIOCDELSUB   0x6802
 
#define HIOCNSUB   0x6803
 
#define HIOCFLUSH   0x6804
 
#define HIOCTRANSFER   0x6832
 
#define HIOCGETSIZE   0x6833
 
#define HIOCSETPARTERROR   0x6834
 
#define HIOCGETPARTERROR   0x6835
 
#define HIOCGETPARTSTART   0x6836
 
#define APA_IO_MODE_READ   0x00
 
#define APA_IO_MODE_WRITE   0x01
 
#define HDIOC_MAXSECTOR   0x4801
 
#define HDIOC_TOTALSECTOR   0x4802
 
#define HDIOC_IDLE   0x4803
 
#define HDIOC_FLUSH   0x4804
 
#define HDIOC_SWAPTMP   0x4805
 
#define HDIOC_DEV9OFF   0x4806
 
#define HDIOC_STATUS   0x4807
 
#define HDIOC_FORMATVER   0x4808
 
#define HDIOC_SMARTSTAT   0x4809
 
#define HDIOC_FREESECTOR   0x480A
 
#define HDIOC_IDLEIMM   0x480B
 
#define HDIOC_GETTIME   0x6832
 
#define HDIOC_SETOSDMBR   0x6833
 
#define HDIOC_GETSECTORERROR   0x6834
 
#define HDIOC_GETERRORPARTNAME   0x6835
 
#define HDIOC_READSECTOR   0x6836
 
#define HDIOC_WRITESECTOR   0x6837
 
#define HDIOC_SCEIDENTIFY   0x6838
 
#define HDIOC_INSTSEC   0x6839
 
#define HDIOC_SETMAXLBA28   0x683A
 
#define HDIOC_GETMAXLBA48   0x683B
 
#define HDIOC_ISLBA48   0x683C
 
#define HDIOC_PRESETMAXLBA28   0x683D
 
#define HDIOC_POSTSETMAXLBA28   0x683E
 
#define HDIOC_ENABLEWRITECACHE   0x683F
 
#define HDIOC_DISABLEWRITECACHE   0x6840
 
#define HDDIO_ADD_SUB   HIOCADDSUB
 
#define HDDIO_DELETE_END_SUB   HIOCDELSUB
 
#define HDDIO_NUMBER_OF_SUBS   HIOCNSUB
 
#define HDDIO_FLUSH_CACHE   HIOCFLUSH
 
#define HDDIO_GETSIZE   HIOCGETSIZE
 
#define APA_IOCTL2_ADD_SUB   HIOCADDSUB
 
#define APA_IOCTL2_DELETE_LAST_SUB   HIOCDELSUB
 
#define APA_IOCTL2_NUMBER_OF_SUBS   HIOCNSUB
 
#define APA_IOCTL2_FLUSH_CACHE   HIOCFLUSH
 
#define APA_IOCTL2_TRANSFER_DATA   HIOCTRANSFER
 
#define APA_IOCTL2_GETSIZE   HIOCGETSIZE
 
#define APA_IOCTL2_SET_PART_ERROR   HIOCSETPARTERROR
 
#define APA_IOCTL2_GET_PART_ERROR   HIOCGETPARTERROR
 
#define HDDCTL_MAX_SECTORS   HDIOC_MAXSECTOR
 
#define HDDCTL_TOTAL_SECTORS   HDIOC_TOTALSECTOR
 
#define HDDCTL_IDLE   HDIOC_IDLE
 
#define HDDCTL_FLUSH_CACHE   HDIOC_FLUSH
 
#define HDDCTL_SWAP_TMP   HDIOC_SWAPTMP
 
#define HDDCTL_DEV9_SHUTDOWN   HDIOC_DEV9OFF
 
#define HDDCTL_STATUS   HDIOC_STATUS
 
#define HDDCTL_FORMAT   HDIOC_FORMATVER
 
#define HDDCTL_SMART_STAT   HDIOC_SMARTSTAT
 
#define HDDCTL_FREE_SECTORS   HDIOC_FREESECTOR
 
#define APA_DEVCTL_MAX_SECTORS   HDIOC_MAXSECTOR
 
#define APA_DEVCTL_TOTAL_SECTORS   HDIOC_TOTALSECTOR
 
#define APA_DEVCTL_IDLE   HDIOC_IDLE
 
#define APA_DEVCTL_FLUSH_CACHE   HDIOC_FLUSH
 
#define APA_DEVCTL_SWAP_TMP   HDIOC_SWAPTMP
 
#define APA_DEVCTL_DEV9_SHUTDOWN   HDIOC_DEV9OFF
 
#define APA_DEVCTL_STATUS   HDIOC_STATUS
 
#define APA_DEVCTL_FORMAT   HDIOC_FORMATVER
 
#define APA_DEVCTL_SMART_STAT   HDIOC_SMARTSTAT
 
#define APA_DEVCTL_FREE_SECTORS   HDIOC_FREESECTOR
 
#define APA_DEVCTL_GETTIME   HDIOC_GETTIME
 
#define APA_DEVCTL_SET_OSDMBR   HDIOC_SETOSDMBR
 
#define APA_DEVCTL_GET_SECTOR_ERROR   HDIOC_GETSECTORERROR
 
#define APA_DEVCTL_GET_ERROR_PART_NAME   HDIOC_GETERRORPARTNAME
 
#define APA_DEVCTL_ATA_READ   HDIOC_READSECTOR
 
#define APA_DEVCTL_ATA_WRITE   HDIOC_WRITESECTOR
 
#define APA_DEVCTL_SCE_IDENTIFY_DRIVE   HDIOC_SCEIDENTIFY
 
#define PIOCALLOC   0x7001
 
#define PIOCFREE   0x7002
 
#define PIOCATTRADD   0x7003
 
#define PIOCATTRDEL   0x7004
 
#define PIOCATTRLOOKUP   0x7005
 
#define PIOCATTRREAD   0x7006
 
#define PIOCINVINODE   0x7032
 
#define PDIOC_ZONESZ   0x5001
 
#define PDIOC_ZONEFREE   0x5002
 
#define PDIOC_CLOSEALL   0x5003
 
#define PDIOC_GETFSCKSTAT   0x5004
 
#define PDIOC_CLRFSCKSTAT   0x5005
 
#define PDIOC_SHOWBITMAP   0xFF
 
#define PFS_IO_MODE_READ   0x00
 
#define PFS_IO_MODE_WRITE   0x01
 
#define PFSIO_ALLOC   PIOCALLOC
 
#define PFSIO_FREE   PIOCFREE
 
#define PFSIO_ATTR_ADD   PIOCATTRADD
 
#define PFSIO_ATTR_DEL   PIOCATTRDEL
 
#define PFSIO_ATTR_LOOKUP   PIOCATTRLOOKUP
 
#define PFSIO_ATTR_READ   PIOCATTRREAD
 
#define PFS_IOCTL2_ALLOC   PIOCALLOC
 
#define PFS_IOCTL2_FREE   PIOCFREE
 
#define PFS_IOCTL2_ATTR_ADD   PIOCATTRADD
 
#define PFS_IOCTL2_ATTR_DEL   PIOCATTRDEL
 
#define PFS_IOCTL2_ATTR_LOOKUP   PIOCATTRLOOKUP
 
#define PFS_IOCTL2_ATTR_READ   PIOCATTRREAD
 
#define PFSCTL_GET_ZONE_SIZE   PDIOC_ZONESZ
 
#define PFSCTL_GET_ZONE_FREE   PDIOC_ZONEFREE
 
#define PFSCTL_CLOSE_ALL   PDIOC_CLOSEALL
 
#define PFSCTL_GET_STAT   PDIOC_GETFSCKSTAT
 
#define PFSCTL_CLEAR_STAT   PDIOC_CLRFSCKSTAT
 
#define PFS_DEVCTL_GET_ZONE_SIZE   PDIOC_ZONESZ
 
#define PFS_DEVCTL_GET_ZONE_FREE   PDIOC_ZONEFREE
 
#define PFS_DEVCTL_CLOSE_ALL   PDIOC_CLOSEALL
 
#define PFS_DEVCTL_GET_STAT   PDIOC_GETFSCKSTAT
 
#define PFS_DEVCTL_CLEAR_STAT   PDIOC_CLRFSCKSTAT
 
#define PFS_DEVCTL_SHOW_BITMAP   PDIOC_SHOWBITMAP
 

Detailed Description

Common HDD IOCTL, DEVCTL and IOCTL2 command definitions

Definition in file hdd-ioctl.h.


Data Structure Documentation

◆ hddIoctl2Transfer_t

struct hddIoctl2Transfer_t

Definition at line 79 of file hdd-ioctl.h.

Data Fields
u32 sub

main(0)/subs(1+) to read/write

u32 sector
u32 size

in sectors

u32 mode

ATAD_MODE_READ/ATAD_MODE_WRITE.....

void * buffer

◆ hddAtaTransfer_t

struct hddAtaTransfer_t

Definition at line 137 of file hdd-ioctl.h.

Data Fields
u32 lba
u32 size
u8 data[]

◆ hddSetOsdMBR_t

struct hddSetOsdMBR_t

Definition at line 144 of file hdd-ioctl.h.

Data Fields
u32 start
u32 size

Macro Definition Documentation

◆ APA_TYPE_MBR

#define APA_TYPE_MBR   0x0001

Master Boot Record

Definition at line 38 of file hdd-ioctl.h.

◆ APA_MAXSUB

#define APA_MAXSUB   64

Maximum # of sub-partitions

Definition at line 48 of file hdd-ioctl.h.

◆ APA_FLAG_SUB

#define APA_FLAG_SUB   0x0001

Sub-partition status for partitions (attr field)

Definition at line 51 of file hdd-ioctl.h.

◆ HIOCTRANSFER

#define HIOCTRANSFER   0x6832

Used by PFS.IRX to read/write data

Definition at line 63 of file hdd-ioctl.h.

◆ HIOCGETSIZE

#define HIOCGETSIZE   0x6833

For main(0)/subs(1+)

Definition at line 65 of file hdd-ioctl.h.

◆ HIOCSETPARTERROR

#define HIOCSETPARTERROR   0x6834

Set (sector of a partition) that has an error

Definition at line 67 of file hdd-ioctl.h.

◆ HIOCGETPARTERROR

#define HIOCGETPARTERROR   0x6835

Get (sector of a partition) that has an error

Definition at line 69 of file hdd-ioctl.h.

◆ HDIOC_MAXSECTOR

#define HDIOC_MAXSECTOR   0x4801

Maximum partition size (in sectors)

Definition at line 96 of file hdd-ioctl.h.

◆ HDIOC_TOTALSECTOR

#define HDIOC_TOTALSECTOR   0x4802

Capacity of the disk (in sectors)

Definition at line 98 of file hdd-ioctl.h.

◆ HDIOC_FREESECTOR

#define HDIOC_FREESECTOR   0x480A

Returns the approximate amount of free space

Definition at line 107 of file hdd-ioctl.h.

◆ HDIOC_SETOSDMBR

#define HDIOC_SETOSDMBR   0x6833

arg = hddSetOsdMBR_t

Definition at line 114 of file hdd-ioctl.h.

◆ HDIOC_GETERRORPARTNAME

#define HDIOC_GETERRORPARTNAME   0x6835

bufp = namebuffer[0x20]

Definition at line 117 of file hdd-ioctl.h.

◆ HDIOC_READSECTOR

#define HDIOC_READSECTOR   0x6836

arg = hddAtaTransfer_t

Definition at line 119 of file hdd-ioctl.h.

◆ HDIOC_WRITESECTOR

#define HDIOC_WRITESECTOR   0x6837

arg = hddAtaTransfer_t

Definition at line 121 of file hdd-ioctl.h.

◆ HDIOC_SCEIDENTIFY

#define HDIOC_SCEIDENTIFY   0x6838

bufp = buffer for atadSceIdentifyDrive

Definition at line 123 of file hdd-ioctl.h.

◆ HDIOC_SETMAXLBA28

#define HDIOC_SETMAXLBA28   0x683A

arg = u32

Definition at line 127 of file hdd-ioctl.h.