Rev 846 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1049 | mauro | 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 ehci_hcd_init(void); |
||
13 | extern void ehci_hcd_cleanup(void); |
||
14 | |||
15 | extern int usb_mouse_init(void); |
||
16 | extern void usb_mouse_exit(void); |
||
17 | |||
18 | extern int usb_kbd_init(void); |
||
19 | extern void usb_kbd_exit(void); |
||
20 | |||
21 | extern int hid_init(void); |
||
22 | extern void hid_exit(void); |
||
23 | |||
24 | |||
25 | static int usb_installed = FALSE; |
||
26 | |||
27 | /* to do: return error code */ |
||
28 | int USB26_init() |
||
29 | { |
||
30 | if (usb_installed == TRUE) |
||
31 | return 0; |
||
32 | |||
33 | usb_init(); |
||
34 | ehci_hcd_init(); |
||
35 | ohci_hcd_pci_init(); |
||
36 | uhci_hcd_init(); |
||
37 | usb_mouse_init(); |
||
38 | usb_kbd_init(); |
||
39 | hid_init(); |
||
40 | |||
41 | usb_installed = TRUE; |
||
42 | |||
43 | return 0; |
||
44 | } |
||
45 | |||
46 | /* to do : add all usb closing functions ?*/ |
||
47 | int USB26_close() |
||
48 | { |
||
49 | if (usb_installed == FALSE) |
||
50 | return -1; |
||
51 | |||
52 | ehci_hcd_cleanup(); |
||
53 | ohci_hcd_pci_cleanup(); |
||
54 | uhci_hcd_cleanup(); |
||
55 | usb_mouse_exit(); |
||
56 | usb_kbd_exit(); |
||
57 | hid_exit(); |
||
58 | usb_exit(); |
||
59 | |||
60 | usb_installed = FALSE; |
||
61 | |||
62 | return 0; |
||
63 | } |