0bdcc246ffd65e63148ebaa63be812f54efb983c
[tpg/acess2.git] / Modules / USB / main.c
1 /*
2  * Acess2
3  * USB Stack
4  */
5 #define VERSION ( (0<<8)| 5 )
6 #define DEBUG   1
7 #include <common.h>
8 #include <vfs.h>
9 #include <fs_devfs.h>
10 #include <modules.h>
11 #include "usb.h"
12
13 // === IMPORTS ===
14  int    UHCI_Initialise();
15
16 // === PROTOTYPES ===
17  int    USB_Install(char **Arguments);
18 void    USB_Cleanup();
19 char    *USB_ReadDir(tVFS_Node *Node, int Pos);
20 tVFS_Node       *USB_FindDir(tVFS_Node *Node, char *Name);
21  int    USB_IOCtl(tVFS_Node *Node, int Id, void *Data);
22
23 // === GLOBALS ===
24 MODULE_DEFINE(0, VERSION, USB, 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         Warning("[USB  ] Not Complete - Devel Only");
47         return 0;
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, char *Name)
69  * \brief Locate an entry in the USB root
70  */
71 tVFS_Node *USB_FindDir(tVFS_Node *Node, char *Name)
72 {
73         return NULL;
74 }
75
76 /**
77  * \fn int USB_IOCtl(tVFS_Node *Node, int Id, void *Data)
78  * \brief Handles IOCtl Calls to the USB driver
79  */
80 int USB_IOCtl(tVFS_Node *Node, int Id, void *Data)
81 {
82         return 0;
83 }

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