Rev 1049 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1063 | tullio | 1 | |
2 | /* |
||
3 | * This program is free software; you can redistribute it and/or modify |
||
4 | * it under the terms of the GNU General Public License as published by |
||
5 | * the Free Software Foundation; either version 2 of the License, or |
||
6 | * (at your option) any later version. |
||
7 | * |
||
8 | * This program is distributed in the hope that it will be useful, |
||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
11 | * GNU General Public License for more details. |
||
12 | * |
||
13 | * You should have received a copy of the GNU General Public License |
||
14 | * along with this program; if not, write to the Free Software |
||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
16 | * |
||
17 | */ |
||
18 | |||
1049 | mauro | 19 | #include <kernel/kern.h> |
20 | |||
21 | extern int usb_init(void); |
||
22 | extern void usb_exit(void); |
||
23 | |||
24 | extern int ohci_hcd_pci_init (void); |
||
25 | extern void ohci_hcd_pci_cleanup (void); |
||
26 | |||
27 | extern int uhci_hcd_init(void); |
||
28 | extern void uhci_hcd_cleanup(void); |
||
29 | |||
30 | extern int ehci_hcd_init(void); |
||
31 | extern void ehci_hcd_cleanup(void); |
||
32 | |||
33 | extern int usb_mouse_init(void); |
||
34 | extern void usb_mouse_exit(void); |
||
35 | |||
36 | extern int usb_kbd_init(void); |
||
37 | extern void usb_kbd_exit(void); |
||
38 | |||
39 | extern int hid_init(void); |
||
40 | extern void hid_exit(void); |
||
41 | |||
42 | |||
43 | static int usb_installed = FALSE; |
||
44 | |||
45 | /* to do: return error code */ |
||
46 | int USB26_init() |
||
47 | { |
||
48 | if (usb_installed == TRUE) |
||
49 | return 0; |
||
50 | |||
51 | usb_init(); |
||
52 | ehci_hcd_init(); |
||
53 | ohci_hcd_pci_init(); |
||
54 | uhci_hcd_init(); |
||
55 | usb_mouse_init(); |
||
56 | usb_kbd_init(); |
||
57 | hid_init(); |
||
58 | |||
59 | usb_installed = TRUE; |
||
60 | |||
61 | return 0; |
||
62 | } |
||
63 | |||
64 | /* to do : add all usb closing functions ?*/ |
||
65 | int USB26_close() |
||
66 | { |
||
67 | if (usb_installed == FALSE) |
||
68 | return -1; |
||
69 | |||
70 | ehci_hcd_cleanup(); |
||
71 | ohci_hcd_pci_cleanup(); |
||
72 | uhci_hcd_cleanup(); |
||
73 | usb_mouse_exit(); |
||
74 | usb_kbd_exit(); |
||
75 | hid_exit(); |
||
76 | usb_exit(); |
||
77 | |||
78 | usb_installed = FALSE; |
||
79 | |||
80 | return 0; |
||
81 | } |