From c31a24195014accdaddad21a0feb2855a0cf2f67 Mon Sep 17 00:00:00 2001 From: Sergi Granell Date: Wed, 25 Oct 2017 22:40:52 +0200 Subject: Add more NIDs, update udcd.h --- include/kernel/udcd.h | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'include/kernel/udcd.h') diff --git a/include/kernel/udcd.h b/include/kernel/udcd.h index fef2bf6..bdb6e56 100644 --- a/include/kernel/udcd.h +++ b/include/kernel/udcd.h @@ -338,14 +338,14 @@ typedef struct SceUdcdDriver { SceUdcdStringDescriptor *stringDescriptorsUnk0; //!< Unknown string descriptors SceUdcdStringDescriptor *stringDescriptorsUnk1; //!< Default String descriptor SceUdcdStringDescriptor *stringDescriptorsUnk2; //!< String descriptors (unknown) - int (*processRequest) (int recipient, int arg /* endpoint number or interface number */, SceUdcdEP0DeviceRequest *req); //!< Received a control request - int (*changeSetting) (int interfaceNumber, int alternateSetting); //!< Change alternate setting - int (*attach) (int usb_version); //!< Configuration set (attach) function - void (*detach) (void); //!< Configuration unset (detach) function - void (*configure) (int usb_version, int desc_count, SceUdcdInterfaceSettings *settings); //!< Configure the device - int (*start) (int size, void *args); //!< Function called when the driver is started - int (*stop) (int size, void *args); //!< Function called when the driver is stopped - unsigned int unk1; //!< Unknown data + int (*processRequest)(int recipient, int arg /* endpoint number or interface number */, SceUdcdEP0DeviceRequest *req, void *user_data); //!< Received a control request + int (*changeSetting)(int interfaceNumber, int alternateSetting); //!< Change alternate setting + int (*attach)(int usb_version, void *user_data); //!< Configuration set (attach) function + void (*detach)(void *user_data); //!< Configuration unset (detach) function + void (*configure)(int usb_version, int desc_count, SceUdcdInterfaceSettings *settings, void *user_data); //!< Configure the device + int (*start)(int size, void *args, void *user_data); //!< Function called when the driver is started + int (*stop)(int size, void *args, void *user_data); //!< Function called when the driver is stopped + void *user_data; //!< User data unsigned int unk2; //!< Unknown data struct SceUdcdDriver *link; //!< Link to next USB driver in the chain, set to NULL } SceUdcdDriver; @@ -476,6 +476,16 @@ int sceUdcdWaitCancel(void); */ int sceUdcdRegister(SceUdcdDriver *drv); +/** + * Register a USB driver to a specific USB bus. + * + * @param drv - Pointer to a filled out USB driver + * @param bus - The USB bus index (usually 2) + * + * @return 0 on success, < 0 on error + */ +int sceUdcdRegisterToBus(SceUdcdDriver *drv, int bus); + /** * Unregister a USB driver * -- cgit v1.2.3