4 # This work is licensed under the terms of the GNU GPL, version 2 or later.
5 # See the COPYING file in the top-level directory.
6 # SPDX-License-Identifier: GPL-2.0-or-later
15 # A PCI device memory region
17 # @base: the starting address (guest physical)
19 # @limit: the ending address (guest physical)
23 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
28 # Information about a PCI device I/O region.
30 # @bar: the index of the Base Address Register for this region
32 # @type: - 'io' if the region is a PIO region
33 # - 'memory' if the region is a MMIO region
37 # @prefetch: if @type is 'memory', true if the memory is prefetchable
39 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
43 { 'struct': 'PciMemoryRegion',
44 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
45 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
50 # Information about a bus of a PCI Bridge device
52 # @number: primary bus interface number. This should be the number of the
53 # bus the device resides on.
55 # @secondary: secondary bus interface number. This is the number of the
56 # main bus for the bridge
58 # @subordinate: This is the highest number bus that resides below the
61 # @io_range: The PIO range for all devices on this bridge
63 # @memory_range: The MMIO range for all devices on this bridge
65 # @prefetchable_range: The range of prefetchable MMIO for all devices on
70 { 'struct': 'PciBusInfo',
71 'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
72 'io_range': 'PciMemoryRange',
73 'memory_range': 'PciMemoryRange',
74 'prefetchable_range': 'PciMemoryRange' } }
79 # Information about a PCI Bridge device
81 # @bus: information about the bus the device resides on
83 # @devices: a list of @PciDeviceInfo for each device on this bridge
87 { 'struct': 'PciBridgeInfo',
88 'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
93 # Information about the Class of a PCI device
95 # @desc: a string description of the device's class
97 # @class: the class code of the device
101 { 'struct': 'PciDeviceClass',
102 'data': {'*desc': 'str', 'class': 'int'} }
107 # Information about the Id of a PCI device
109 # @device: the PCI device id
111 # @vendor: the PCI vendor id
113 # @subsystem: the PCI subsystem id (since 3.1)
115 # @subsystem-vendor: the PCI subsystem vendor id (since 3.1)
119 { 'struct': 'PciDeviceId',
120 'data': {'device': 'int', 'vendor': 'int', '*subsystem': 'int',
121 '*subsystem-vendor': 'int'} }
126 # Information about a PCI device
128 # @bus: the bus number of the device
130 # @slot: the slot the device is located in
132 # @function: the function of the slot used by the device
134 # @class_info: the class of the device
136 # @id: the PCI device id
138 # @irq: if an IRQ is assigned to the device, the IRQ number
140 # @irq_pin: the IRQ pin, zero means no IRQ (since 5.1)
142 # @qdev_id: the device name of the PCI device
144 # @pci_bridge: if the device is a PCI bridge, the bridge information
146 # @regions: a list of the PCI I/O regions associated with the device
148 # Notes: the contents of @class_info.desc are not stable and should only be
149 # treated as informational.
153 { 'struct': 'PciDeviceInfo',
154 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
155 'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
156 '*irq': 'int', 'irq_pin': 'int', 'qdev_id': 'str',
157 '*pci_bridge': 'PciBridgeInfo', 'regions': ['PciMemoryRegion'] }}
162 # Information about a PCI bus
164 # @bus: the bus index
166 # @devices: a list of devices on this bus
170 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
175 # Return information about the PCI bus topology of the guest.
177 # Returns: a list of @PciInfo for each PCI bus. Each bus is
178 # represented by a json-object, which has a key with a json-array of
179 # all PCI devices attached to it. Each device is represented by a
186 # -> { "execute": "query-pci" }
197 # "desc": "Host bridge"
213 # "desc": "ISA bridge"
229 # "desc": "IDE controller"
251 # "desc": "VGA controller"
261 # "mem_type_64": false,
264 # "address": 4026531840,
269 # "mem_type_64": false,
272 # "address": 4060086272,
277 # "mem_type_64": false,
292 # "desc": "RAM controller"
313 # Note: This example has been shortened as the real response is too long.
316 { 'command': 'query-pci', 'returns': ['PciInfo'] }