Documented GVF_SAVE_VAR alongside other flags, and removed a query/doubt
[AROS.git] / rom / usb / vusbhc / vusbhci_device.h
blob341f8c9678741f30031159238344c1662c5e9f61
1 /*
2 Copyright © 2015-2016, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
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>
23 #define RC_OK 0
24 #define RC_DONTREPLY -1
26 #define MYBUG_LEVEL 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); } )
30 struct VUSBHCIUnit {
31 struct Node node;
32 CONST_STRPTR name;
33 ULONG state;
34 BOOL allocated;
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 */
45 UWORD addr;
47 struct UsbStdDevDesc devdesc;
49 struct RHConfig {
50 struct UsbStdCfgDesc cfgdesc;
51 struct UsbStdIfDesc ifdesc;
52 struct UsbStdEPDesc epdesc;
53 } config;
55 struct UsbHubDesc hubdesc;
57 struct UsbHubStatus hubstatus;
59 struct UsbPortStatus portstatus;
61 } roothub;
65 struct VUSBHCIBase {
66 struct Device device;
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 */