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