2 Copyright © 2015, The AROS Development Team. All rights reserved.
9 #ifndef VUSBHCI_DEVICE_H
10 #define VUSBHCI_DEVICE_H
12 #include <aros/debug.h>
13 #include <aros/macros.h>
15 #include <proto/exec.h>
16 #include <proto/arossupport.h>
18 #include <devices/usb.h>
19 #include <devices/usb_hub.h>
20 #include <devices/newstyle.h>
21 #include <devices/usbhardware.h>
24 #define RC_DONTREPLY -1
27 #define mybug(l, x) D(if ((l>=MYBUG_LEVEL)||(l==-1)) { do { { bug x; } } while (0); } )
28 #define mybug_unit(l, x) D(if ((l>=MYBUG_LEVEL)||(l==-1)) { do { { bug("%s %s: ", unit->name, __FUNCTION__); bug x; } } while (0); } )
36 struct List ctrlxfer_queue
;
37 struct List intrxfer_queue
;
38 struct List bulkxfer_queue
;
39 struct List isocxfer_queue
;
41 struct VUSBHCIRootHub
{
43 struct List intrxfer_queue
; /* Status Change endpoint */
47 struct UsbStdDevDesc devdesc
;
50 struct UsbStdCfgDesc cfgdesc
;
51 struct UsbStdIfDesc ifdesc
;
52 struct UsbStdEPDesc epdesc
;
55 struct UsbHubDesc hubdesc
;
57 struct UsbHubStatus hubstatus
;
59 struct UsbPortStatus portstatus
;
68 struct Task
*handler_task
;
69 BOOL handler_task_run
;
71 //struct Library *HostLibBase;
73 struct VUSBHCIUnit
*usbunit200
;
74 struct VUSBHCIUnit
*usbunit300
;
77 BOOL
cmdAbortIO(struct IOUsbHWReq
*ioreq
);
78 WORD
cmdUsbReset(struct IOUsbHWReq
*ioreq
);
79 WORD
cmdNSDeviceQuery(struct IOStdReq
*ioreq
);
80 WORD
cmdQueryDevice(struct IOUsbHWReq
*ioreq
);
81 WORD
cmdControlXFerRootHub(struct IOUsbHWReq
*ioreq
);
82 WORD
cmdIntXFerRootHub(struct IOUsbHWReq
*ioreq
);
83 WORD
cmdIntXFer(struct IOUsbHWReq
*ioreq
);
84 WORD
cmdControlXFer(struct IOUsbHWReq
*ioreq
);
85 WORD
cmdBulkXFer(struct IOUsbHWReq
*ioreq
);
86 WORD
cmdISOXFer(struct IOUsbHWReq
*ioreq
);
87 void uhwCheckRootHubChanges(struct VUSBHCIUnit
*unit
);
89 void call_libusb_event_handler(void);
90 int do_libusb_ctrl_transfer(struct IOUsbHWReq
*ioreq
);
91 int do_libusb_intr_transfer(struct IOUsbHWReq
*ioreq
);
92 int do_libusb_bulk_transfer(struct IOUsbHWReq
*ioreq
);
93 int do_libusb_isoc_transfer(struct IOUsbHWReq
*ioreq
);
95 BOOL
libusb_bridge_init(struct VUSBHCIBase
*VUSBHCIBase
);
96 VOID
libusb_bridge_cleanup();
98 #endif /* VUSBHCI_DEVICE_H */