~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to hw/pci-bridge/xio3130_downstream.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
 
57
57
static int xio3130_downstream_initfn(PCIDevice *d)
58
58
{
59
 
    PCIBridge* br = DO_UPCAST(PCIBridge, dev, d);
60
 
    PCIEPort *p = DO_UPCAST(PCIEPort, br, br);
61
 
    PCIESlot *s = DO_UPCAST(PCIESlot, port, p);
 
59
    PCIEPort *p = PCIE_PORT(d);
 
60
    PCIESlot *s = PCIE_SLOT(d);
62
61
    int rc;
63
62
 
64
63
    rc = pci_bridge_initfn(d, TYPE_PCIE_BUS);
113
112
 
114
113
static void xio3130_downstream_exitfn(PCIDevice *d)
115
114
{
116
 
    PCIBridge* br = DO_UPCAST(PCIBridge, dev, d);
117
 
    PCIEPort *p = DO_UPCAST(PCIEPort, br, br);
118
 
    PCIESlot *s = DO_UPCAST(PCIESlot, port, p);
 
115
    PCIESlot *s = PCIE_SLOT(d);
119
116
 
120
117
    pcie_aer_exit(d);
121
118
    pcie_chassis_del_slot(s);
138
135
    if (!d) {
139
136
        return NULL;
140
137
    }
141
 
    br = DO_UPCAST(PCIBridge, dev, d);
 
138
    br = PCI_BRIDGE(d);
142
139
 
143
 
    qdev = &br->dev.qdev;
 
140
    qdev = DEVICE(d);
144
141
    pci_bridge_map_irq(br, bus_name, map_irq);
145
142
    qdev_prop_set_uint8(qdev, "port", port);
146
143
    qdev_prop_set_uint8(qdev, "chassis", chassis);
147
144
    qdev_prop_set_uint16(qdev, "slot", slot);
148
145
    qdev_init_nofail(qdev);
149
146
 
150
 
    return DO_UPCAST(PCIESlot, port, DO_UPCAST(PCIEPort, br, br));
 
147
    return PCIE_SLOT(d);
151
148
}
152
149
 
153
150
static const VMStateDescription vmstate_xio3130_downstream = {
157
154
    .minimum_version_id_old = 1,
158
155
    .post_load = pcie_cap_slot_post_load,
159
156
    .fields = (VMStateField[]) {
160
 
        VMSTATE_PCIE_DEVICE(port.br.dev, PCIESlot),
161
 
        VMSTATE_STRUCT(port.br.dev.exp.aer_log, PCIESlot, 0,
162
 
                       vmstate_pcie_aer_log, PCIEAERLog),
 
157
        VMSTATE_PCIE_DEVICE(parent_obj.parent_obj.parent_obj, PCIESlot),
 
158
        VMSTATE_STRUCT(parent_obj.parent_obj.parent_obj.exp.aer_log,
 
159
                       PCIESlot, 0, vmstate_pcie_aer_log, PCIEAERLog),
163
160
        VMSTATE_END_OF_LIST()
164
161
    }
165
162
};
166
163
 
167
 
static Property xio3130_downstream_properties[] = {
168
 
    DEFINE_PROP_UINT8("port", PCIESlot, port.port, 0),
169
 
    DEFINE_PROP_UINT8("chassis", PCIESlot, chassis, 0),
170
 
    DEFINE_PROP_UINT16("slot", PCIESlot, slot, 0),
171
 
    DEFINE_PROP_UINT16("aer_log_max", PCIESlot,
172
 
    port.br.dev.exp.aer_log.log_max,
173
 
    PCIE_AER_LOG_MAX_DEFAULT),
174
 
    DEFINE_PROP_END_OF_LIST(),
175
 
};
176
 
 
177
164
static void xio3130_downstream_class_init(ObjectClass *klass, void *data)
178
165
{
179
166
    DeviceClass *dc = DEVICE_CLASS(klass);
187
174
    k->vendor_id = PCI_VENDOR_ID_TI;
188
175
    k->device_id = PCI_DEVICE_ID_TI_XIO3130D;
189
176
    k->revision = XIO3130_REVISION;
 
177
    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
190
178
    dc->desc = "TI X3130 Downstream Port of PCI Express Switch";
191
179
    dc->reset = xio3130_downstream_reset;
192
180
    dc->vmsd = &vmstate_xio3130_downstream;
193
 
    dc->props = xio3130_downstream_properties;
194
181
}
195
182
 
196
183
static const TypeInfo xio3130_downstream_info = {
197
184
    .name          = "xio3130-downstream",
198
 
    .parent        = TYPE_PCI_DEVICE,
199
 
    .instance_size = sizeof(PCIESlot),
 
185
    .parent        = TYPE_PCIE_SLOT,
200
186
    .class_init    = xio3130_downstream_class_init,
201
187
};
202
188