Modules/USB - Fiddling with USB
[tpg/acess2.git] / Modules / USB / Core / main.c
index 5744c29..9a6458e 100644 (file)
 #include "usb.h"
 
 // === IMPORTS ===
- int   UHCI_Initialise();
+extern int     UHCI_Initialise(void);
 
 // === PROTOTYPES ===
  int   USB_Install(char **Arguments);
-void   USB_Cleanup();
+void   USB_Cleanup(void);
 char   *USB_ReadDir(tVFS_Node *Node, int Pos);
-tVFS_Node      *USB_FindDir(tVFS_Node *Node, char *Name);
+tVFS_Node      *USB_FindDir(tVFS_Node *Node, const char *Name);
  int   USB_IOCtl(tVFS_Node *Node, int Id, void *Data);
 
 // === GLOBALS ===
-MODULE_DEFINE(0, VERSION, USB, USB_Install, NULL, NULL);
+MODULE_DEFINE(0, VERSION, USB_Core, USB_Install, NULL, NULL);
 tDevFS_Driver  gUSB_DrvInfo = {
        NULL, "usb", {
                .NumACLs = 1,
@@ -32,23 +32,40 @@ tDevFS_Driver       gUSB_DrvInfo = {
                .IOCtl = USB_IOCtl
        }
 };
-tUSBDevice     *gUSB_Devices = NULL;
+tUSBDevice     *gUSB_RootHubs = NULL;
 tUSBHost       *gUSB_Hosts = NULL;
 
 // === CODE ===
 /**
- * \fn int ModuleLoad()
  * \brief Called once module is loaded
  */
 int USB_Install(char **Arguments)
 {
        UHCI_Initialise();
-       Warning("[USB  ] Not Complete - Devel Only");
+       Log_Warning("USB", "Not Complete - Devel Only");
        return MODULE_ERR_OK;
 }
 
 /**
- * \fn void USB_Cleanup()
+ * \brief USB polling thread
+ */
+int USB_PollThread(void *unused)
+{
+       for(;;)
+       {
+               for( tUSBHost *host = gUSB_Hosts; host; host = host->Next )
+               {
+                       // host->CheckPorts(host);
+               }
+
+               for( tUSBDevice *dev = gUSB_RootHubs; dev; dev = dev->Next )
+               {
+                       
+               }
+       }
+}
+
+/**
  * \brief Called just before module is unloaded
  */
 void USB_Cleanup()
@@ -65,10 +82,10 @@ char *USB_ReadDir(tVFS_Node *Node, int Pos)
 }
 
 /**
- * \fn tVFS_Node *USB_FindDir(tVFS_Node *Node, char *Name)
+ * \fn tVFS_Node *USB_FindDir(tVFS_Node *Node, const char *Name)
  * \brief Locate an entry in the USB root
  */
-tVFS_Node *USB_FindDir(tVFS_Node *Node, char *Name)
+tVFS_Node *USB_FindDir(tVFS_Node *Node, const char *Name)
 {
        return NULL;
 }

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