712f6028f2b3fbdd6503dcfda4061c63828e4f35
[tpg/acess2.git] / Modules / USB / Core / main.c
1 /*
2  * Acess2
3  * USB Stack
4  */
5 #define VERSION ( (0<<8)| 5 )
6 #define DEBUG   1
7 #include <acess.h>
8 #include <vfs.h>
9 #include <fs_devfs.h>
10 #include <modules.h>
11 #include "usb.h"
12
13 // === IMPORTS ===
14 extern int      UHCI_Initialise(void);
15
16 // === PROTOTYPES ===
17  int    USB_Install(char **Arguments);
18 void    USB_Cleanup(void);
19 char    *USB_ReadDir(tVFS_Node *Node, int Pos);
20 tVFS_Node       *USB_FindDir(tVFS_Node *Node, const char *Name);
21  int    USB_IOCtl(tVFS_Node *Node, int Id, void *Data);
22
23 // === GLOBALS ===
24 MODULE_DEFINE(0, VERSION, USB_Core, USB_Install, NULL, NULL);
25 tDevFS_Driver   gUSB_DrvInfo = {
26         NULL, "usb", {
27                 .NumACLs = 1,
28                 .ACLs = &gVFS_ACL_EveryoneRX,
29                 .Flags = VFS_FFLAG_DIRECTORY,
30                 .ReadDir = USB_ReadDir,
31                 .FindDir = USB_FindDir,
32                 .IOCtl = USB_IOCtl
33         }
34 };
35 tUSBDevice      *gUSB_Devices = NULL;
36 tUSBHost        *gUSB_Hosts = NULL;
37
38 // === CODE ===
39 /**
40  * \fn int ModuleLoad()
41  * \brief Called once module is loaded
42  */
43 int USB_Install(char **Arguments)
44 {
45         UHCI_Initialise();
46         Log_Warning("USB", "Not Complete - Devel Only");
47         return MODULE_ERR_OK;
48 }
49
50 /**
51  * \fn void USB_Cleanup()
52  * \brief Called just before module is unloaded
53  */
54 void USB_Cleanup()
55 {
56 }
57
58 /**
59  * \fn char *USB_ReadDir(tVFS_Node *Node, int Pos)
60  * \brief Read from the USB root
61  */
62 char *USB_ReadDir(tVFS_Node *Node, int Pos)
63 {
64         return NULL;
65 }
66
67 /**
68  * \fn tVFS_Node *USB_FindDir(tVFS_Node *Node, const char *Name)
69  * \brief Locate an entry in the USB root
70  */
71 tVFS_Node *USB_FindDir(tVFS_Node *Node, const char *Name)
72 {
73         return NULL;
74 }
75
76 /**
77  * \brief Handles IOCtl Calls to the USB driver
78  */
79 int USB_IOCtl(tVFS_Node *Node, int Id, void *Data)
80 {
81         return 0;
82 }

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