Rev 1049 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
846 | giacomo | 1 | #include <kernel/kern.h> |
2 | |||
3 | extern int usb_init(void); |
||
4 | extern void usb_exit(void); |
||
5 | |||
6 | extern int ohci_hcd_pci_init (void); |
||
7 | extern void ohci_hcd_pci_cleanup (void); |
||
8 | |||
9 | extern int uhci_hcd_init(void); |
||
10 | extern void uhci_hcd_cleanup(void); |
||
11 | |||
12 | extern int usb_mouse_init(void); |
||
13 | extern void usb_mouse_exit(void); |
||
14 | |||
15 | extern int usb_kbd_init(void); |
||
16 | extern void usb_kbd_exit(void); |
||
17 | |||
18 | extern int hid_init(void); |
||
19 | extern void hid_exit(void); |
||
20 | |||
21 | |||
22 | static int usb_installed = FALSE; |
||
23 | |||
24 | /* to do: return error code */ |
||
25 | int USB26_init() |
||
26 | { |
||
27 | if (usb_installed == TRUE) |
||
28 | return 0; |
||
29 | |||
30 | usb_init(); |
||
31 | ohci_hcd_pci_init(); |
||
32 | uhci_hcd_init(); |
||
33 | usb_mouse_init(); |
||
34 | usb_kbd_init(); |
||
35 | hid_init(); |
||
36 | |||
37 | usb_installed = TRUE; |
||
38 | |||
39 | return 0; |
||
40 | } |
||
41 | |||
42 | /* to do : add all usb closing functions ?*/ |
||
43 | int USB26_close() |
||
44 | { |
||
45 | if (usb_installed == FALSE) |
||
46 | return -1; |
||
47 | |||
48 | ohci_hcd_pci_cleanup(); |
||
49 | uhci_hcd_cleanup(); |
||
50 | usb_mouse_exit(); |
||
51 | usb_kbd_exit(); |
||
52 | hid_exit(); |
||
53 | usb_exit(); |
||
54 | usb_installed = FALSE; |
||
55 | return 0; |
||
56 | } |