X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FUSB%2FCore%2Fusb.h;h=9bc45c8e08df1149e3489dc1f3c60f4a9600387d;hb=6844966136c3cc3c7e93a2b69977780e84ff65db;hp=c0cf7854a1425bfd59e083f8198b334a33840d87;hpb=f8b9bcd7dba0da30a4ae21aa0e7d5feae2db3841;p=tpg%2Facess2.git diff --git a/Modules/USB/Core/usb.h b/Modules/USB/Core/usb.h index c0cf7854..9bc45c8e 100644 --- a/Modules/USB/Core/usb.h +++ b/Modules/USB/Core/usb.h @@ -7,34 +7,58 @@ // === TYPES === typedef struct sUSBHost tUSBHost; +typedef struct sUSBHub tUSBHub; typedef struct sUSBDevice tUSBDevice; // === STRUCTURES === /** - * \brief Defines a USB Host Controller + * \brief Defines a USB Host Controller type */ struct sUSBHost { - int (*SendIN)(void *Ptr, int Fcn, int Endpt, int DataTgl, void *Data, size_t Length); - int (*SendOUT)(void *Ptr, int Fcn, int Endpt, int DataTgl, void *Data, size_t Length); - int (*SendSETUP)(void *Ptr, int Fcn, int Endpt, int DataTgl, void *Data, size_t Length); + tUSBHost *Next; + + void (*CheckPorts)(void *Ptr); + + void *(*SendIN)(void *Ptr, int Fcn, int Endpt, int DataTgl, int bIOC, void *Data, size_t Length); + void *(*SendOUT)(void *Ptr, int Fcn, int Endpt, int DataTgl, int bIOC, void *Data, size_t Length); + void *(*SendSETUP)(void *Ptr, int Fcn, int Endpt, int DataTgl, int bIOC, void *Data, size_t Length); }; /** - * \brief Defines a single device on the USB Bus + * \brief USB Hub data */ -struct sUSBDevice +struct sUSBHub { + /** + * \brief Host controller used + */ tUSBHost *HostDef; void *Controller; - int Address; + int nPorts; + tUSBDevice *Devices[]; +}; - int MaxControl; - int MaxBulk; - int MaxISync; +/** + * \brief Defines a single device on the USB Bus + */ +struct sUSBDevice +{ + tUSBDevice *Next; + tUSBDevice *Hub; + + int Address; + + int Type; + + union { + tUSBHub Hub; + char Impl[0]; + } Data; }; -extern void USB_RegisterHost(tUSBHost *HostDef, void *ControllerPtr); +extern void USB_RegisterHost(tUSBHost *HostDef, void *ControllerPtr); +extern void USB_NewDevice(tUSBHub *Hub); #endif