1 /*
2  * Copyright (C) 2021 Intel Corporation.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef __PASSTHRU_H__
9 #define __PASSTHRU_H__
10 
11 #include <types.h>
12 #include <limits.h>
13 
14 #include "pciaccess.h"
15 #include "pci_core.h"
16 #include "pciio.h"
17 
18 struct passthru_dev {
19 	struct pci_vdev *dev;
20 	struct pcibar bar[PCI_BARMAX + 2];
21 	struct {
22 		int		capoff;
23 	} msi;
24 	struct {
25 		int		capoff;
26 	} msix;
27 	struct {
28 		int 		capoff;
29 	} pmcap;
30 	bool pcie_cap;
31 	struct pcisel sel;
32 	int phys_pin;
33 	uint16_t phys_bdf;
34 	struct pci_device *phys_dev;
35 	/* Options for passthrough device:
36 	 *   need_reset - reset dev before passthrough
37 	 */
38 	bool need_reset;
39 	bool d3hot_reset;
40 	bool need_rombar;
41 	bool need_dsdt;
42 	char *rom_buffer;
43 	char dsdt_path[256];
44 	bool (*has_virt_pcicfg_regs)(int offset);
45 };
46 
47 #endif
48