X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FUSB%2FCore%2Fusb.h;h=5a133630f5bbd5938a908d6b6b484eccb4cbf665;hb=17993abdd6e2662878dbd8dffe1517b0bf579e6e;hp=65bba9d00bd055b03e707a94e2571a6f8faae64d;hpb=dfe55553735a8cfa2b7207e5096caddded32c992;p=tpg%2Facess2.git diff --git a/Modules/USB/Core/usb.h b/Modules/USB/Core/usb.h index 65bba9d0..5a133630 100644 --- a/Modules/USB/Core/usb.h +++ b/Modules/USB/Core/usb.h @@ -1,6 +1,9 @@ /* - * AcessOS Version 1 - * USB Stack + * Acess2 USB Stack + * - By John Hodge (thePowersGang) + * + * usb.h + * - USB Internal definitions */ #ifndef _USB_H_ #define _USB_H_ @@ -10,6 +13,8 @@ #include typedef struct sUSBHost tUSBHost; +typedef struct sUSBDevice tUSBDevice; +typedef struct sUSBEndpoint tUSBEndpoint; // === STRUCTURES === /** @@ -17,31 +22,57 @@ typedef struct sUSBHost tUSBHost; */ struct sUSBHub { - tUSBHub *Next; - tUSBDevice *Device; - - tUSB_HubPoll CheckPorts; + tUSBInterface *Interface; int nPorts; tUSBDevice *Devices[]; }; +struct sUSBEndpoint +{ + tUSBEndpoint *Next; // (usb_poll.c) Clock list + tUSBInterface *Interface; + int EndpointIdx; // Interface endpoint index + int EndpointNum; // Device endpoint num + + int PollingPeriod; // In 1ms intervals + int MaxPacketSize; // In bytes + Uint8 Type; // Same as sUSBDriver.Endpoints.Type + + int PollingAtoms; // (usb_poll.c) Period in clock list + void *InputData; +}; + +/** + * \brief Structure for a device's interface + */ +struct sUSBInterface +{ +// tUSBInterface *Next; + tUSBDevice *Dev; + + tUSBDriver *Driver; + void *Data; + + int nEndpoints; + tUSBEndpoint Endpoints[]; +}; + /** * \brief Defines a single device on the USB Bus */ struct sUSBDevice { - tUSBDevice *Next; - tUSBDevice *ParentHub; + tUSBHub *ParentHub; /** * \brief Host controller used */ tUSBHost *Host; int Address; - - tUSBDriver *Driver; - void *Data; + + int nInterfaces; + tUSBInterface *Interfaces[]; }; struct sUSBHost @@ -52,8 +83,12 @@ struct sUSBHost void *Ptr; Uint8 AddressBitmap[128/8]; + + tUSBDevice RootHubDev; + tUSBInterface RootHubIf; + tUSBHub RootHub; }; -extern void USB_NewDevice(tUSBHub *Hub); +extern tUSBDriver *USB_int_FindDriverByClass(Uint32 ClassCode); #endif