Modules/USB - Fiddling with USB
[tpg/acess2.git] / Modules / USB / Core / usb.h
index c0cf785..9bc45c8 100644 (file)
@@ -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

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