- Implement EnumServicesStatusW.
[reactos.git] / reactos / drivers / usb / miniport / sys / BootUSB.c
1 /*
2 * USB support for XBOX, based on Linux kernel source
3 *
4 * 2003-06-21 Georg Acher (georg@acher.org)
5 *
6 */
7
8 #include "../usb_wrapper.h"
9
10 void subsys_usb_init(void);
11 void module_exit_usb_exit(void);
12
13 extern struct pci_device_id *module_table_pci_ids;
14
15 // straigth call...
16 int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id);
17 void usb_hcd_pci_remove (struct pci_dev *dev);
18
19 void XPADInit(void);
20 void XPADRemove(void);
21 void XRemoteInit(void);
22 void XRemoteRemove(void);
23
24 extern int (*thread_handler)(void*);
25 int (*hub_thread_handler)(void*);
26
27 extern int nousb;
28 extern int xpad_num;
29
30 struct pci_dev xx_ohci_dev={
31 .vendor = 0,
32 .device = 0,
33 .bus = NULL,
34 .irq = 1, // currently not used...
35 .slot_name = "OHCI",
36 .dev = {.name = "PCI",.dma_mask=1},
37 .base = {0xfed00000},
38 .flags = {}
39 };
40
41 /*------------------------------------------------------------------------*/
42 void BootStartUSB(void)
43 {
44 int n;
45
46 nousb=0;
47
48 init_wrapper();
49 subsys_usb_init();
50 hub_thread_handler=thread_handler;
51 usb_hcd_pci_probe(&xx_ohci_dev, module_table_pci_ids);
52 XPADInit();
53
54 XRemoteInit();
55
56 UsbKeyBoardInit();
57
58 for(n=0;n<30;n++) {
59 USBGetEvents();
60 wait_ms(1);
61 }
62 }
63 /*------------------------------------------------------------------------*/
64 void USBGetEvents(void)
65 {
66 inc_jiffies(1);
67 do_all_timers();
68 hub_thread_handler(NULL);
69 handle_irqs(-1);
70 }
71 /*------------------------------------------------------------------------*/
72 void BootStopUSB(void)
73 {
74 int n;
75
76 XPADRemove();
77 XRemoteRemove();
78 UsbKeyBoardRemove();
79
80 for(n=0;n<100;n++)
81 {
82 USBGetEvents();
83 wait_ms(1);
84 }
85
86 module_exit_usb_exit();
87 usb_hcd_pci_remove(&xx_ohci_dev);
88
89 }
90 /*------------------------------------------------------------------------*/