iotests: Make _filter_nbd drop log lines
[qemu/ar7.git] / hw / pci-bridge / i82801b11.c
blobb143f8cb7906221fc33821069b0df9a0dc2933ab
1 /*
2 * Copyright (c) 2006 Fabrice Bellard
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
23 * QEMU i82801b11 dmi-to-pci Bridge Emulation
25 * Copyright (c) 2009, 2010, 2011
26 * Isaku Yamahata <yamahata at valinux co jp>
27 * VA Linux Systems Japan K.K.
28 * Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
30 * This library is free software; you can redistribute it and/or
31 * modify it under the terms of the GNU Lesser General Public
32 * License as published by the Free Software Foundation; either
33 * version 2 of the License, or (at your option) any later version.
35 * This library is distributed in the hope that it will be useful,
36 * but WITHOUT ANY WARRANTY; without even the implied warranty of
37 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
38 * Lesser General Public License for more details.
40 * You should have received a copy of the GNU Lesser General Public
41 * License along with this library; if not, see <http://www.gnu.org/licenses/>
44 #include "qemu/osdep.h"
45 #include "hw/pci/pci.h"
46 #include "hw/i386/ich9.h"
49 /*****************************************************************************/
50 /* ICH9 DMI-to-PCI bridge */
51 #define I82801ba_SSVID_OFFSET 0x50
52 #define I82801ba_SSVID_SVID 0
53 #define I82801ba_SSVID_SSID 0
55 typedef struct I82801b11Bridge {
56 /*< private >*/
57 PCIBridge parent_obj;
58 /*< public >*/
59 } I82801b11Bridge;
61 static int i82801b11_bridge_initfn(PCIDevice *d)
63 int rc;
65 rc = pci_bridge_initfn(d, TYPE_PCI_BUS);
66 if (rc < 0) {
67 return rc;
70 rc = pci_bridge_ssvid_init(d, I82801ba_SSVID_OFFSET,
71 I82801ba_SSVID_SVID, I82801ba_SSVID_SSID);
72 if (rc < 0) {
73 goto err_bridge;
75 pci_config_set_prog_interface(d->config, PCI_CLASS_BRIDGE_PCI_INF_SUB);
76 return 0;
78 err_bridge:
79 pci_bridge_exitfn(d);
81 return rc;
84 static void i82801b11_bridge_class_init(ObjectClass *klass, void *data)
86 PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
87 DeviceClass *dc = DEVICE_CLASS(klass);
89 k->is_bridge = 1;
90 k->vendor_id = PCI_VENDOR_ID_INTEL;
91 k->device_id = PCI_DEVICE_ID_INTEL_82801BA_11;
92 k->revision = ICH9_D2P_A2_REVISION;
93 k->init = i82801b11_bridge_initfn;
94 k->config_write = pci_bridge_write_config;
95 set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
98 static const TypeInfo i82801b11_bridge_info = {
99 .name = "i82801b11-bridge",
100 .parent = TYPE_PCI_BRIDGE,
101 .instance_size = sizeof(I82801b11Bridge),
102 .class_init = i82801b11_bridge_class_init,
105 static void d2pbr_register(void)
107 type_register_static(&i82801b11_bridge_info);
110 type_init(d2pbr_register);