Misc - Changes to allow warning-less compilation with clang
[tpg/acess2.git] / KernelLand / Modules / USB / Core / usb.h
1 /*
2  * Acess2 USB Stack
3  * - By John Hodge (thePowersGang)
4  * 
5  * usb.h
6  * - USB Internal definitions
7  */
8 #ifndef _USB_H_
9 #define _USB_H_
10
11 #include <usb_core.h>
12 #include <usb_hub.h>
13 #include <usb_host.h>
14 #include "usb_proto.h"
15
16 typedef struct sUSBHubPort      tUSBHubPort;
17 typedef struct sUSBHost tUSBHost;
18 typedef struct sUSBDevice       tUSBDevice;
19 typedef struct sUSBEndpoint     tUSBEndpoint;
20
21 // === STRUCTURES ===
22 struct sUSBHubPort
23 {
24         void    *ListNext;
25         char    Status;
26         char    PortNum;
27         tUSBDevice      *Dev;
28 };
29
30 /**
31  * \brief USB Hub data
32  */
33 struct sUSBHub
34 {
35         tUSBInterface   *Interface;
36         
37          int    nPorts;
38         struct sUSBHubPort      Ports[];
39 };
40
41 struct sUSBEndpoint
42 {
43         tUSBEndpoint    *Next;  // (usb_poll.c) Clock list
44         tUSBInterface   *Interface;
45          int    EndpointIdx;    // Interface endpoint index
46          int    EndpointNum;    // Device endpoint num
47         void    *EndpointHandle;
48         
49          int    PollingPeriod;  // In 1ms intervals
50          int    MaxPacketSize;  // In bytes
51         Uint8   Type;   // Same as sUSBDriver.Endpoints.Type
52         
53          int    PollingAtoms;   // (usb_poll.c) Period in clock list
54         void    *InputData;
55 };
56
57 /**
58  * \brief Structure for a device's interface
59  */
60 struct sUSBInterface
61 {
62 //      tUSBInterface   *Next;
63         tUSBDevice      *Dev;
64
65         tUSBDriver      *Driver;
66         void    *Data;
67
68         struct sDescriptor_Interface    IfaceDesc;
69         
70          int    nEndpoints;
71         tUSBEndpoint    Endpoints[];
72 };
73
74 /**
75  * \brief Defines a single device on the USB Bus
76  */
77 struct sUSBDevice
78 {
79         tUSBHub *ParentHub;
80
81         /**
82          * \brief Host controller used
83          */
84         tUSBHost        *Host;
85          int    Address;
86
87         void    *EndpointHandles[16];
88
89         struct sDescriptor_Device       DevDesc;
90
91          int    nInterfaces;
92         tUSBInterface   *Interfaces[];
93 };
94
95 struct sUSBHost
96 {
97         struct sUSBHost *Next;
98         
99         tUSBHostDef     *HostDef;
100         void    *Ptr;
101         
102         Uint8   AddressBitmap[128/8];
103         
104         tUSBDevice      *RootHubDev;
105         tUSBInterface   *RootHubIf;
106         tUSBHub RootHub;
107 };
108
109 extern tUSBDriver       *USB_int_FindDriverByClass(Uint32 ClassCode);
110
111 #endif

UCC git Repository :: git.ucc.asn.au