From 74b6a25a875d13935ba921c4d7b2e52b7c9ca2b6 Mon Sep 17 00:00:00 2001 From: Sergi Granell Date: Mon, 27 Aug 2018 09:33:26 +0200 Subject: Update UDCD --- include/kernel/udcd.h | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++- nids/360/SceUdcd.yml | 9 ++++- 2 files changed, 102 insertions(+), 2 deletions(-) diff --git a/include/kernel/udcd.h b/include/kernel/udcd.h index e309899..cea21d1 100644 --- a/include/kernel/udcd.h +++ b/include/kernel/udcd.h @@ -417,6 +417,18 @@ int sceUdcdWaitBusInitialized(unsigned int timeout, int bus); */ int sceUdcdStart(const char *driverName, int size, void *args); +/** + * Start a USB driver for an UDCD bus. + * + * @param driverName - Name of the USB driver to start + * @param size - Size of arguments to pass to USB driver start + * @param args - Arguments to pass to USB driver start + * @param[in] bus - UDCD bus (default is 2) + * + * @return 0 on success, < 0 on error. + */ +int sceUdcdStartInternal(const char *driverName, int size, void *args, int bus); + /** * Stop a USB driver. * @@ -428,6 +440,18 @@ int sceUdcdStart(const char *driverName, int size, void *args); */ int sceUdcdStop(const char *driverName, int size, void *args); +/** + * Stop a USB driver for an UDCD bus. + * + * @param driverName - Name of the USB driver to stop + * @param size - Size of arguments to pass to USB driver start + * @param args - Arguments to pass to USB driver start + * @param[in] bus - UDCD bus (default is 2) + * + * @return 0 on success, < 0 on error. + */ +int sceUdcdStopInternal(const char *driverName, int size, void *args, int bus); + /** * Activate a USB driver. * @@ -437,6 +461,17 @@ int sceUdcdStop(const char *driverName, int size, void *args); */ int sceUdcdActivate(unsigned int productId); +/** + * Activate a USB driver for an UDCD bus. + * + * @param pid - Product ID for the default USB Driver + * @param[in] bus_powered - Enable USB bus power + * @param[in] bus - UDCD bus (default is 2) + * + * @return 0 on success, < 0 on error. + */ +int sceUdcdActivateInternal(unsigned int productId, unsigned int bus_powered, int bus); + /** * Deactivate USB driver. * @@ -444,6 +479,15 @@ int sceUdcdActivate(unsigned int productId); */ int sceUdcdDeactivate(void); +/** + * Deactivate USB driver for an UDCD bus. + * + * @param[in] bus - UDCD bus (default is 2) + * + * @return 0 on success, < 0 on error. + */ +int sceUdcdDeactivateInternal(int bus); + /** * Get USB state * @@ -451,6 +495,15 @@ int sceUdcdDeactivate(void); */ int sceUdcdGetDeviceState(void); +/** + * Get USB state for an UDCD bus + * + * @param[in] bus - UDCD bus (default is 2) + * + * @return One or more ::SceUdcdStatus. + */ +int sceUdcdGetDeviceStateInternal(int bus); + /** * Get device information * @@ -460,6 +513,16 @@ int sceUdcdGetDeviceState(void); */ int sceUdcdGetDeviceInfo(SceUdcdDeviceInfo *devInfo); +/** + * Get device information for an UDCD bus + * + * @param[out] devInfo - Device information + * @param[in] bus - UDCD bus (default is 2) + * + * @return 0 on success, < 0 on error. +*/ +int sceUdcdGetDeviceInfoInternal(SceUdcdDeviceInfo *devInfo, int bus); + /** * Get state of a specific USB driver * @@ -517,7 +580,7 @@ int sceUdcdRegister(SceUdcdDriver *drv); * * @return 0 on success, < 0 on error */ -int sceUdcdRegisterToBus(SceUdcdDriver *drv, int bus); +int sceUdcdRegisterInternal(SceUdcdDriver *drv, int bus); /** * Unregister a USB driver @@ -528,6 +591,16 @@ int sceUdcdRegisterToBus(SceUdcdDriver *drv, int bus); */ int sceUdcdUnregister(SceUdcdDriver *drv); +/** + * Unregister a USB driver for an UDCD bus + * + * @param drv - Pointer to a filled out USB driver + * @param[in] bus - UDCD bus (default is 2) + * + * @return 0 on success, < 0 on error + */ +int sceUdcdUnregisterInternal(SceUdcdDriver *drv, int bus); + /** * Clear the FIFO on an endpoint * @@ -537,6 +610,16 @@ int sceUdcdUnregister(SceUdcdDriver *drv); */ int sceUdcdClearFIFO(SceUdcdEndpoint *endp); +/** + * Clear the FIFO on an endpoint for an UDCD bus + * + * @param endp - The endpoint to clear + * @param[in] bus - UDCD bus (default is 2) + * + * @return 0 on success, < 0 on error + */ +int sceUdcdClearFIFOInternal(SceUdcdEndpoint *endp, int bus); + /** * Cancel any pending requests on an endpoint. * @@ -555,6 +638,16 @@ int sceUdcdReqCancelAll(SceUdcdEndpoint *endp); */ int sceUdcdStall(SceUdcdEndpoint *endp); +/** + * Stall an endpoint for an UDCD bus + * + * @param endp - The endpoint to stall + * @param[in] bus - UDCD bus (default is 2) + * + * @return 0 on success, < 0 on error + */ +int sceUdcdStallInternal(SceUdcdEndpoint *endp, int bus); + /** * Queue a send request (IN from host pov) * diff --git a/nids/360/SceUdcd.yml b/nids/360/SceUdcd.yml index db08486..e38b6b4 100644 --- a/nids/360/SceUdcd.yml +++ b/nids/360/SceUdcd.yml @@ -15,8 +15,11 @@ modules: nid: 0xBC05A8FB functions: sceUdcdActivate: 0x4FDEA423 + sceUdcdActivateInternal: 0x9119247B sceUdcdClearFIFO: 0x9F53D64D + sceUdcdClearFIFOInternal: 0xA35F3BAF sceUdcdDeactivate: 0x8AE87657 + sceUdcdDeactivateInternal: 0xFDC10F93 sceUdcdGetDeviceInfo: 0xFBEA3703 sceUdcdGetDeviceInfoInternal: 0x45EB0177 sceUdcdGetDeviceState: 0xE054B5E4 @@ -24,16 +27,20 @@ modules: sceUdcdGetDrvState: 0xC0CA5DDB sceUdcdGetDrvStateInternal: 0x512F77BC sceUdcdRegister: 0x4E55244D - sceUdcdRegisterToBus: 0x64675918 + sceUdcdRegisterInternal: 0x64675918 sceUdcdReqCancelAll: 0x38787672 sceUdcdReqRecv: 0xC60A74B2 sceUdcdReqRecvInternal: 0x175E6179 sceUdcdReqSend: 0x1ED0E89E sceUdcdReqSendInternal: 0x2E3E622A sceUdcdStall: 0x34079250 + sceUdcdStallInternal: 0x9B44DF29 sceUdcdStart: 0x9FD733EA + sceUdcdStartInternal: 0x90F8BCAE sceUdcdStop: 0x1494293B + sceUdcdStopInternal: 0x150FD3BB sceUdcdUnregister: 0x0DECE532 + sceUdcdUnregisterInternal: 0x6CCD152E sceUdcdWaitBusInitialized: 0x1C684884 sceUdcdWaitState: 0xD03017C0 sceUdcdWaitStateInternal: 0x7AD0C8D1 -- cgit v1.2.3