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
33 # - 'io' if the region is a PIO region
34 # - 'memory' if the region is a MMIO region
38 # @prefetch: if @type is 'memory', true if the memory is prefetchable
40 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
44 { 'struct': 'PciMemoryRegion',
45 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
46 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
51 # Information about a bus of a PCI Bridge device
53 # @number: primary bus interface number. This should be the number of
54 # the bus the device resides on.
56 # @secondary: secondary bus interface number. This is the number of
57 # the main bus for the bridge
59 # @subordinate: This is the highest number bus that resides below the
62 # @io_range: The PIO range for all devices on this bridge
64 # @memory_range: The MMIO range for all devices on this bridge
66 # @prefetchable_range: The range of prefetchable MMIO for all devices
71 { 'struct': 'PciBusInfo',
72 'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
73 'io_range': 'PciMemoryRange',
74 'memory_range': 'PciMemoryRange',
75 'prefetchable_range': 'PciMemoryRange' } }
80 # Information about a PCI Bridge device
82 # @bus: information about the bus the device resides on
84 # @devices: a list of @PciDeviceInfo for each device on this bridge
88 { 'struct': 'PciBridgeInfo',
89 'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
94 # Information about the Class of a PCI device
96 # @desc: a string description of the device's class
98 # @class: the class code of the device
102 { 'struct': 'PciDeviceClass',
103 'data': {'*desc': 'str', 'class': 'int'} }
108 # Information about the Id of a PCI device
110 # @device: the PCI device id
112 # @vendor: the PCI vendor id
114 # @subsystem: the PCI subsystem id (since 3.1)
116 # @subsystem-vendor: the PCI subsystem vendor id (since 3.1)
120 { 'struct': 'PciDeviceId',
121 'data': {'device': 'int', 'vendor': 'int', '*subsystem': 'int',
122 '*subsystem-vendor': 'int'} }
127 # Information about a PCI device
129 # @bus: the bus number of the device
131 # @slot: the slot the device is located in
133 # @function: the function of the slot used by the device
135 # @class_info: the class of the device
137 # @id: the PCI device id
139 # @irq: if an IRQ is assigned to the device, the IRQ number
141 # @irq_pin: the IRQ pin, zero means no IRQ (since 5.1)
143 # @qdev_id: the device name of the PCI device
145 # @pci_bridge: if the device is a PCI bridge, the bridge information
147 # @regions: a list of the PCI I/O regions associated with the device
149 # Notes: the contents of @class_info.desc are not stable and should
150 # only be treated as informational.
154 { 'struct': 'PciDeviceInfo',
155 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
156 'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
157 '*irq': 'int', 'irq_pin': 'int', 'qdev_id': 'str',
158 '*pci_bridge': 'PciBridgeInfo', 'regions': ['PciMemoryRegion'] }}
163 # Information about a PCI bus
165 # @bus: the bus index
167 # @devices: a list of devices on this bus
171 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
176 # Return information about the PCI bus topology of the guest.
178 # Returns: a list of @PciInfo for each PCI bus. Each bus is
179 # represented by a json-object, which has a key with a json-array
180 # of all PCI devices attached to it. Each device is represented
187 # -> { "execute": "query-pci" }
198 # "desc": "Host bridge"
214 # "desc": "ISA bridge"
230 # "desc": "IDE controller"
252 # "desc": "VGA controller"
262 # "mem_type_64": false,
265 # "address": 4026531840,
270 # "mem_type_64": false,
273 # "address": 4060086272,
278 # "mem_type_64": false,
293 # "desc": "RAM controller"
314 # Note: This example has been shortened as the real response is too
317 { 'command': 'query-pci', 'returns': ['PciInfo'] }