Sony PlayStation2 Study
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.0 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. # _____ ___ ____ ___ ____
  3. # ____| | ____| | | |____|
  4. # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
  5. #-----------------------------------------------------------------------
  6. # Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
  7. # Licenced under Academic Free License version 2.0
  8. # Review ps2sdk README & LICENSE files for further details.
  9. */
  10. /**
  11. * @file
  12. * ioctl(), ioctl2(), and devctl() definitions.
  13. */
  14. #ifndef __SYS_IOCTL_H__
  15. #define __SYS_IOCTL_H__
  16. #include <tamtypes.h>
  17. #define _IOC(type, nr) (((type) << 8)|(nr))
  18. #define HDD_IOC_TYPE 'H'
  19. #define HDD_CTL_TYPE 'h'
  20. /* hddfsd ioctl2(). */
  21. /** Add a subpartition. */
  22. #define HDDIOCADDSUB _IOC(HDD_IOC_TYPE, 1)
  23. /** Delete a subpartition. */
  24. #define HDDIOCDELSUB _IOC(HDD_IOC_TYPE, 2)
  25. /** Get the number of subpartitions. */
  26. #define HDDIOCGETSUBS _IOC(HDD_IOC_TYPE, 3)
  27. /** Flush the HDD's cache. */
  28. #define HDDIOCFLUSH _IOC(HDD_IOC_TYPE, 4)
  29. typedef struct {
  30. /** Main or subpartition index. */
  31. u32 sub;
  32. /** Start LBA. */
  33. u32 lba;
  34. /** Number of sectors. */
  35. u32 nsectors;
  36. /** Transfer direction, same as ata_device_dma_transfer(). */
  37. int dir;
  38. /** Data buffer. */
  39. void *buf;
  40. } hdd_ioc_devio_t;
  41. /** Write to partition data area. */
  42. #define HDDIOCDEVIO _IOC(HDD_IOC_TYPE, 50)
  43. /** Size of main or subpartition. */
  44. #define HDDIOCGETSIZE _IOC(HDD_IOC_TYPE, 51)
  45. /** Set the last drive error. */
  46. #define HDDIOCSETERROR _IOC(HDD_IOC_TYPE, 52)
  47. /** Get the last drive error. */
  48. #define HDDIOCGETERROR _IOC(HDD_IOC_TYPE, 53)
  49. /* hddfsd devctl(). */
  50. /** Get max. partition sectors. */
  51. #define HDDCTLGETMAXSECT _IOC(HDD_CTL_TYPE, 1)
  52. /** Get total number of sectors. */
  53. #define HDDCTLGETTOTALSECT _IOC(HDD_CTL_TYPE, 2)
  54. /** Set the drive's idle timeout. */
  55. #define HDDCTLSETIDLE _IOC(HDD_CTL_TYPE, 3)
  56. /** Flush the HDD's cache. */
  57. #define HDDCTLFLUSH _IOC(HDD_CTL_TYPE, 4)
  58. /** Swap this partition for _)tmp. */
  59. #define HDDCTLSWAPTMP _IOC(HDD_CTL_TYPE, 5)
  60. /** Shutdown the drive. */
  61. #define HDDCTLSHUTDOWN _IOC(HDD_CTL_TYPE, 6)
  62. /** Get status of drive. */
  63. #define HDDCTLGETSTATUS _IOC(HDD_CTL_TYPE, 7)
  64. /** Get version of APA format. */
  65. #define HDDCTLGETFMTVER _IOC(HDD_CTL_TYPE, 8)
  66. /** Get SMART status for this drive. */
  67. #define HDDCTLGETSMARTSTAT _IOC(HDD_CTL_TYPE, 9)
  68. /* hddfsd extended devctl(). */
  69. /** Get the current date. */
  70. #define HDDCTLGETDATE _IOC(HDD_IOC_TYPE, 50)
  71. /** Not supported by hddfsd.irx! */
  72. #define HDDCTLINSTALLOSD _IOC(HDD_IOC_TYPE, 51)
  73. /** Get the last drive error. */
  74. #define HDDCTLGETERROR _IOC(HDD_IOC_TYPE, 52)
  75. /** Get the id of the error partition. */
  76. #define HDDCTLGETERRORID _IOC(HDD_IOC_TYPE, 53)
  77. typedef struct {
  78. u32 lba;
  79. u32 nsectors;
  80. u8 buf[];
  81. } hdd_ctl_driveio_t;
  82. /** ATA device read. */
  83. #define HDDCTLDRIVEREAD _IOC(HDD_IOC_TYPE, 54)
  84. /** ATA device write. */
  85. #define HDDCTLDRIVEWRITE _IOC(HDD_IOC_TYPE, 55)
  86. /** Not supported by hddfsd.irx! */
  87. #define HDDCTLSCEIDENTIFY _IOC(HDD_IOC_TYPE, 56)
  88. #endif /* __SYS_IOCTL_H__ */