Modules/USB - Working on a structure for the USB subsystem
[tpg/acess2.git] / Modules / USB / Core / usb.h
index 0b1b7b9..65bba9d 100644 (file)
@@ -5,19 +5,25 @@
 #ifndef _USB_H_
 #define _USB_H_
 
-// === TYPES ===
+#include <usb_core.h>
+#include <usb_hub.h>
+#include <usb_host.h>
+
 typedef struct sUSBHost        tUSBHost;
-typedef struct sUSBDevice      tUSBDevice;
 
 // === STRUCTURES ===
 /**
- * \brief Defines a USB Host Controller
+ * \brief USB Hub data
  */
-struct sUSBHost
+struct sUSBHub
 {
-        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);
+       tUSBHub *Next;
+       tUSBDevice      *Device;
+       
+       tUSB_HubPoll    CheckPorts;
+       
+        int    nPorts;
+       tUSBDevice      *Devices[];
 };
 
 /**
@@ -25,13 +31,29 @@ struct sUSBHost
  */
 struct sUSBDevice
 {
-       tUSBHost        *Host;
+       tUSBDevice      *Next;
+       tUSBDevice      *ParentHub;
 
+       /**
+        * \brief Host controller used
+        */
+       tUSBHost        *Host;
         int    Address;
+       
+       tUSBDriver      *Driver;
+       void    *Data;
+};
 
-        int    MaxControl;
-        int    MaxBulk;
-        int    MaxISync;
+struct sUSBHost
+{
+       struct sUSBHost *Next;
+       
+       tUSBHostDef     *HostDef;
+       void    *Ptr;
+       
+       Uint8   AddressBitmap[128/8];
 };
 
+extern void    USB_NewDevice(tUSBHub *Hub);
+
 #endif

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