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 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 1 deletion(-) (limited to 'include/kernel/udcd.h') 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) * -- cgit v1.2.3