#include "usb.h"
// === IMPORTS ===
- int UHCI_Initialise();
+extern void USB_PollThread(void *unused);
+extern void USB_AsyncThread(void *Unused);
// === 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);
+tVFS_NodeType gUSB_RootNodeType = {
+ .ReadDir = USB_ReadDir,
+ .FindDir = USB_FindDir,
+ .IOCtl = USB_IOCtl
+};
tDevFS_Driver gUSB_DrvInfo = {
NULL, "usb", {
.NumACLs = 1,
.ACLs = &gVFS_ACL_EveryoneRX,
.Flags = VFS_FFLAG_DIRECTORY,
- .ReadDir = USB_ReadDir,
- .FindDir = USB_FindDir,
- .IOCtl = USB_IOCtl
+ .Type = &gUSB_RootNodeType
}
};
-tUSBDevice *gUSB_Devices = 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");
+
+ Proc_SpawnWorker(USB_PollThread, NULL);
+ Proc_SpawnWorker(USB_AsyncThread, NULL);
+
return MODULE_ERR_OK;
}
/**
- * \fn void USB_Cleanup()
* \brief Called just before module is unloaded
*/
void USB_Cleanup()
}
/**
- * \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;
}