diff options
-rw-r--r-- | include/user/mtpif.h | 30 | ||||
-rw-r--r-- | include/user/udcd.h | 96 | ||||
-rw-r--r-- | include/user/usbstorvstor.h | 52 | ||||
-rw-r--r-- | nids/360/SceUsbstorVStorDriver.yml | 11 |
4 files changed, 189 insertions, 0 deletions
diff --git a/include/user/mtpif.h b/include/user/mtpif.h new file mode 100644 index 0000000..9dff002 --- /dev/null +++ b/include/user/mtpif.h @@ -0,0 +1,30 @@ +#ifndef _PSP2_MTPIF_H_ +#define _PSP2_MTPIF_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Start MTP driver + * + * @param[in] flags - Set to 1 + * + * @return 0 on success, < 0 on error. +*/ +int sceMtpIfStartDriver(int flags); + +/** + * Stop MTP driver + * + * @param[in] flags - Set to 1 + * + * @return 0 on success, < 0 on error. +*/ +int sceMtpIfStopDriver(int flags); + +#ifdef __cplusplus +} +#endif + +#endif /* _PSP2_MTPIF_H_ */ diff --git a/include/user/udcd.h b/include/user/udcd.h new file mode 100644 index 0000000..789d717 --- /dev/null +++ b/include/user/udcd.h @@ -0,0 +1,96 @@ +#ifndef _PSP2_UDCD_H_ +#define _PSP2_UDCD_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * USB Status + */ +#define SCE_UDCD_STATUS_CONNECTION_NEW 0x0001 +#define SCE_UDCD_STATUS_CONNECTION_ESTABLISHED 0x0002 +#define SCE_UDCD_STATUS_CONNECTION_SUSPENDED 0x0004 +#define SCE_UDCD_STATUS_CABLE_DISCONNECTED 0x0010 +#define SCE_UDCD_STATUS_CABLE_CONNECTED 0x0020 +#define SCE_UDCD_STATUS_DEACTIVATED 0x0100 +#define SCE_UDCD_STATUS_ACTIVATED 0x0200 +#define SCE_UDCD_STATUS_IS_CHARGING 0x0400 +#define SCE_UDCD_STATUS_USE_USB_CHARGING 0x0800 +#define SCE_UDCD_STATUS_UNKNOWN_1000 0x1000 +#define SCE_UDCD_STATUS_UNKNOWN_2000 0x2000 + +typedef struct { + uint8_t info[64]; +} SceUdcdDeviceInfo; + +typedef struct { + int unk_00; + int unk_04; + int unk_08; + int unk_0C; + int unk_10; + const char *driverName; +} SceUdcdWaitParam; + +typedef struct { + int unk_00; + int state; + int cable; + int connection; + int use_usb_charging; + int unk_14; +} SceUdcdDeviceState; + +/** + * Get device state + * + * @param[out] state - Device state + * + * @return 0 on success, < 0 on error. +*/ +int sceUdcdGetDeviceState(SceUdcdDeviceState *state); + +/** + * Get device information + * + * @param[out] devInfo - Device information + * + * @return 0 on success, < 0 on error. +*/ +int sceUdcdGetDeviceInfo(SceUdcdDeviceInfo *devInfo); + +/** + * Register callback + * + * @param[in] cbid - Callback UID + * @param[in] state - State + * + * @return 0 on success, < 0 on error. +*/ +int sceUdcdRegisterCallback(SceUID cbid, int state); + +/** + * Unregister callback + * + * @param[in] cbid - Callback UID + * + * @return 0 on success, < 0 on error. +*/ +int sceUdcdUnregisterCallback(SceUID cbid); + +/** + * Wait for state + * + * @param[in] waitParam - Wait parameter + * @param[in] state - State + * + * @return 0 on success, < 0 on error. +*/ +int sceUdcdWaitState(SceUdcdWaitParam *waitParam, int state); + +#ifdef __cplusplus +} +#endif + +#endif /* _PSP2_UDCD_H_ */ diff --git a/include/user/usbstorvstor.h b/include/user/usbstorvstor.h new file mode 100644 index 0000000..c71eb66 --- /dev/null +++ b/include/user/usbstorvstor.h @@ -0,0 +1,52 @@ +#ifndef _PSP2_USBSTORVSTOR_H_ +#define _PSP2_USBSTORVSTOR_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + SCE_USBSTOR_VSTOR_TYPE_FAT = 0, + SCE_USBSTOR_VSTOR_TYPE_CDROM = 5, +}; + +/** + * Set image file path + * + * @param[in] path - Image file path + * + * @return 0 on success, < 0 on error. +*/ +int sceUsbstorVStorSetImgFilePath(const char *path); + +/** + * Set USB descriptor device information + * + * @param[in] name - Name + * @param[in] version - Version + * + * @return 0 on success, < 0 on error. +*/ +int sceUsbstorVStorSetDeviceInfo(const char *name, const char *version); + +/** + * Start USB virtual storage + * + * @param[in] type - One of ::UsbStorVstorType + * + * @return 0 on success, < 0 on error. +*/ +int sceUsbstorVStorStart(int type); + +/** + * Stop USB virtual storage + * + * @return 0 on success, < 0 on error. +*/ +int sceUsbstorVStorStop(void); + +#ifdef __cplusplus +} +#endif + +#endif /* _PSP2_USBSTORVSTOR_H_ */ diff --git a/nids/360/SceUsbstorVStorDriver.yml b/nids/360/SceUsbstorVStorDriver.yml new file mode 100644 index 0000000..d72ca3e --- /dev/null +++ b/nids/360/SceUsbstorVStorDriver.yml @@ -0,0 +1,11 @@ +modules: + SceUsbstorVStorDriver: + nid: 0x1150E326 + libraries: + SceUsbstorVStor: + nid: 0x17F294B9 + functions: + sceUsbstorVStorSetDeviceInfo: 0x14455C20 + sceUsbstorVStorSetImgFilePath: 0x8C9F93AB + sceUsbstorVStorStart: 0xB606F1AF + sceUsbstorVStorStop: 0x0FD67059 |