1 | /*␊ |
2 | * Copyright (c) 2009 Evan Lojewski. All rights reserved.␊ |
3 | *␊ |
4 | */␊ |
5 | ␊ |
6 | #include "libsaio.h"␊ |
7 | #include "modules.h"␊ |
8 | #include "pci.h"␊ |
9 | #include "bootstruct.h"␊ |
10 | ␊ |
11 | extern int usb_loop(void);␊ |
12 | extern void notify_usb_dev(pci_dt_t *pci_dev);␊ |
13 | ␊ |
14 | void USBFix_pci_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6);␊ |
15 | void USBFix_start_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6);␊ |
16 | ␊ |
17 | ␊ |
18 | void USBFix_pci_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6)␊ |
19 | {␊ |
20 | ␉pci_dt_t* current = arg1;␊ |
21 | ␉if(current->class_id == PCI_CLASS_SERIAL_USB)␊ |
22 | ␉{␊ |
23 | ␉␉notify_usb_dev(current);␊ |
24 | ␉}␊ |
25 | }␊ |
26 | ␊ |
27 | void USBFix_start_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6)␊ |
28 | {␊ |
29 | ␉usb_loop();␊ |
30 | }␊ |
31 | ␊ |
32 | void USBFix_start(void);␊ |
33 | void USBFix_start(void)␊ |
34 | {␊ |
35 | register_hook_callback("PCIDevice", &USBFix_pci_hook);␊ |
36 | register_hook_callback("Kernel Start", &USBFix_start_hook);␊ |
37 | }␊ |
38 | ␊ |
39 | |