1*27af7e00SGuenter Roeck /* 2*27af7e00SGuenter Roeck * USB UHCI controller emulation 3*27af7e00SGuenter Roeck * 4*27af7e00SGuenter Roeck * Copyright (c) 2005 Fabrice Bellard 5*27af7e00SGuenter Roeck * 6*27af7e00SGuenter Roeck * Copyright (c) 2008 Max Krasnyansky 7*27af7e00SGuenter Roeck * Magor rewrite of the UHCI data structures parser and frame processor 8*27af7e00SGuenter Roeck * Support for fully async operation and multiple outstanding transactions 9*27af7e00SGuenter Roeck * 10*27af7e00SGuenter Roeck * Permission is hereby granted, free of charge, to any person obtaining a copy 11*27af7e00SGuenter Roeck * of this software and associated documentation files (the "Software"), to deal 12*27af7e00SGuenter Roeck * in the Software without restriction, including without limitation the rights 13*27af7e00SGuenter Roeck * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14*27af7e00SGuenter Roeck * copies of the Software, and to permit persons to whom the Software is 15*27af7e00SGuenter Roeck * furnished to do so, subject to the following conditions: 16*27af7e00SGuenter Roeck * 17*27af7e00SGuenter Roeck * The above copyright notice and this permission notice shall be included in 18*27af7e00SGuenter Roeck * all copies or substantial portions of the Software. 19*27af7e00SGuenter Roeck * 20*27af7e00SGuenter Roeck * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21*27af7e00SGuenter Roeck * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22*27af7e00SGuenter Roeck * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 23*27af7e00SGuenter Roeck * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24*27af7e00SGuenter Roeck * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25*27af7e00SGuenter Roeck * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26*27af7e00SGuenter Roeck * THE SOFTWARE. 27*27af7e00SGuenter Roeck */ 28*27af7e00SGuenter Roeck #ifndef HW_USB_HCD_UHCI_PCI_H 29*27af7e00SGuenter Roeck #define HW_USB_HCD_UHCI_PCI_H 30*27af7e00SGuenter Roeck 31*27af7e00SGuenter Roeck #include "hcd-uhci.h" 32*27af7e00SGuenter Roeck 33*27af7e00SGuenter Roeck #define TYPE_UHCI_PCI "pci-uhci" 34*27af7e00SGuenter Roeck 35*27af7e00SGuenter Roeck struct UHCIPCIState { 36*27af7e00SGuenter Roeck PCIDevice dev; 37*27af7e00SGuenter Roeck UHCIState state; 38*27af7e00SGuenter Roeck 39*27af7e00SGuenter Roeck /* Properties */ 40*27af7e00SGuenter Roeck char *masterbus; 41*27af7e00SGuenter Roeck uint32_t firstport; 42*27af7e00SGuenter Roeck uint32_t frame_bandwidth; 43*27af7e00SGuenter Roeck uint32_t maxframes; 44*27af7e00SGuenter Roeck uint32_t num_ports; 45*27af7e00SGuenter Roeck }; 46*27af7e00SGuenter Roeck 47*27af7e00SGuenter Roeck OBJECT_DECLARE_TYPE(UHCIPCIState, UHCIPCIDeviceClass, UHCI_PCI) 48*27af7e00SGuenter Roeck 49*27af7e00SGuenter Roeck typedef struct UHCIPCIInfo { 50*27af7e00SGuenter Roeck const char *name; 51*27af7e00SGuenter Roeck uint16_t vendor_id; 52*27af7e00SGuenter Roeck uint16_t device_id; 53*27af7e00SGuenter Roeck uint8_t revision; 54*27af7e00SGuenter Roeck uint8_t irq_pin; 55*27af7e00SGuenter Roeck void (*realize)(PCIDevice *dev, Error **errp); 56*27af7e00SGuenter Roeck bool unplug; 57*27af7e00SGuenter Roeck bool notuser; /* disallow user_creatable */ 58*27af7e00SGuenter Roeck } UHCIPCIInfo; 59*27af7e00SGuenter Roeck 60*27af7e00SGuenter Roeck void usb_uhci_common_realize_pci(PCIDevice *dev, Error **errp); 61*27af7e00SGuenter Roeck void uhci_pci_data_class_init(ObjectClass *klass, void *data); 62*27af7e00SGuenter Roeck 63*27af7e00SGuenter Roeck #endif /* HW_USB_HCD_UHCI_PCI_H */ 64