grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / devs / USB / drivers / EHCI / ehci.h
blob935102de44386d78447db210afeb135f5ac5350f
1 #ifndef EHCI_H_
2 #define EHCI_H_
4 /*
5 Copyright (C) 2006-2007 by Michal Schulz
6 $Id$
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU Library General Public License as
10 published by the Free Software Foundation; either version 2 of the
11 License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU Library General Public
19 License along with this program; if not, write to the
20 Free Software Foundation, Inc.,
21 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #include <inttypes.h>
25 #include <aros/asmcall.h>
26 #include LC_LIBDEFS_FILE
28 #define PCI_BASE_CLASS_SERIAL 0x0c
29 #define PCI_SUB_CLASS_USB 0x03
30 #define PCI_INTERFACE_EHCI 0x20
32 #define CLID_Drv_USB_EHCI "Bus::Drv::EHCI"
33 #define IID_Drv_USB_EHCI "Bus::Drv::EHCI"
35 #define mmio_l(var) (*(volatile uint32_t *)(var))
36 #define mmio_w(var) (*(volatile uint16_t *)(var))
37 #define mmio_b(var) (*(volatile uint8_t *)(var))
39 #undef HiddPCIDeviceAttrBase
40 #undef HiddUSBDeviceAttrBase
41 #undef HiddUSBHubAttrBase
42 #undef HiddUSBDrvAttrBase
43 #undef HiddOHCIAttrBase
44 #undef HiddAttrBase
46 #define HiddPCIDeviceAttrBase (SD(cl)->HiddPCIDeviceAB)
47 #define HiddUSBDeviceAttrBase (SD(cl)->HiddUSBDeviceAB)
48 #define HiddUSBHubAttrBase (SD(cl)->HiddUSBHubAB)
49 #define HiddUSBDrvAttrBase (SD(cl)->HiddUSBDrvAB)
50 #define HiddEHCIAttrBase (SD(cl)->HiddEHCIAB)
51 #define HiddAttrBase (SD(cl)->HiddAB)
53 #define BASE(lib)((struct ohcibase*)(lib))
54 #define SD(cl) (&BASE(cl->UserData)->sd)
56 #define METHOD(base, id, name) \
57 base ## __ ## id ## __ ## name (OOP_Class *cl, OOP_Object *o, struct p ## id ## _ ## name *msg)
59 struct ehci_staticdata
61 OOP_Class *ehciClass;
63 OOP_Object *irq;
64 OOP_Object *usb;
65 OOP_Object *pci;
67 OOP_AttrBase HiddPCIDeviceAB;
68 OOP_AttrBase HiddUSBDeviceAB;
69 OOP_AttrBase HiddUSBHubAB;
70 OOP_AttrBase HiddUSBDrvAB;
71 OOP_AttrBase HiddEHCIAB;
72 OOP_AttrBase HiddAB;
75 struct ehcibase
77 struct Library LibNode;
78 struct ehci_staticdata sd;
81 typedef struct EHCIData {
82 struct ehci_staticdata *sd;
83 } EHCIData;
85 #endif /*EHCI_H_*/