Modules/USB - Fiddling with USB
[tpg/acess2.git] / Modules / USB / Core / usb.h
1 /*
2  * AcessOS Version 1
3  * USB Stack
4  */
5 #ifndef _USB_H_
6 #define _USB_H_
7
8 // === TYPES ===
9 typedef struct sUSBHost tUSBHost;
10 typedef struct sUSBHub  tUSBHub;
11 typedef struct sUSBDevice       tUSBDevice;
12
13 // === STRUCTURES ===
14 /**
15  * \brief Defines a USB Host Controller type
16  */
17 struct sUSBHost
18 {
19         tUSBHost        *Next;
20
21         void    (*CheckPorts)(void *Ptr);
22
23         void    *(*SendIN)(void *Ptr, int Fcn, int Endpt, int DataTgl, int bIOC, void *Data, size_t Length);
24         void    *(*SendOUT)(void *Ptr, int Fcn, int Endpt, int DataTgl, int bIOC, void *Data, size_t Length);
25         void    *(*SendSETUP)(void *Ptr, int Fcn, int Endpt, int DataTgl, int bIOC, void *Data, size_t Length);
26 };
27
28 /**
29  * \brief USB Hub data
30  */
31 struct sUSBHub
32 {
33         /**
34          * \brief Host controller used
35          */
36         tUSBHost        *HostDef;
37         void    *Controller;
38
39          int    nPorts;
40         tUSBDevice      *Devices[];
41 };
42
43 /**
44  * \brief Defines a single device on the USB Bus
45  */
46 struct sUSBDevice
47 {
48         tUSBDevice      *Next;
49         tUSBDevice      *Hub;
50
51          int    Address;
52         
53          int    Type;
54         
55         union {
56                 tUSBHub Hub;
57                 char    Impl[0];
58         }       Data;
59 };
60
61 extern void     USB_RegisterHost(tUSBHost *HostDef, void *ControllerPtr);
62 extern void     USB_NewDevice(tUSBHub *Hub);
63
64 #endif

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