]>
Commit | Line | Data |
---|---|---|
38fe3975 BC |
1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | /* Copyright(c) 2023 Advanced Micro Devices, Inc. */ | |
3 | ||
4 | #ifndef _VFIO_DEV_H_ | |
5 | #define _VFIO_DEV_H_ | |
6 | ||
7 | #include <linux/pci.h> | |
8 | #include <linux/vfio_pci_core.h> | |
9 | ||
f232836a | 10 | #include "dirty.h" |
bb500dbe BC |
11 | #include "lm.h" |
12 | ||
38fe3975 BC |
13 | struct pds_vfio_pci_device { |
14 | struct vfio_pci_core_device vfio_coredev; | |
15 | ||
bb500dbe BC |
16 | struct pds_vfio_lm_file *save_file; |
17 | struct pds_vfio_lm_file *restore_file; | |
f232836a | 18 | struct pds_vfio_dirty dirty; |
bb500dbe BC |
19 | struct mutex state_mutex; /* protect migration state */ |
20 | enum vfio_device_mig_state state; | |
ae2667cd | 21 | struct mutex reset_mutex; /* protect reset_done flow */ |
bb500dbe | 22 | u8 deferred_reset; |
7dabb1bc BC |
23 | enum vfio_device_mig_state deferred_reset_state; |
24 | struct notifier_block nb; | |
bb500dbe | 25 | |
38fe3975 | 26 | int vf_id; |
63f77a71 | 27 | u16 client_id; |
38fe3975 BC |
28 | }; |
29 | ||
f232836a BC |
30 | void pds_vfio_state_mutex_unlock(struct pds_vfio_pci_device *pds_vfio); |
31 | ||
38fe3975 BC |
32 | const struct vfio_device_ops *pds_vfio_ops_info(void); |
33 | struct pds_vfio_pci_device *pds_vfio_pci_drvdata(struct pci_dev *pdev); | |
bb500dbe | 34 | void pds_vfio_reset(struct pds_vfio_pci_device *pds_vfio); |
38fe3975 | 35 | |
63f77a71 | 36 | struct pci_dev *pds_vfio_to_pci_dev(struct pds_vfio_pci_device *pds_vfio); |
bb500dbe | 37 | struct device *pds_vfio_to_dev(struct pds_vfio_pci_device *pds_vfio); |
63f77a71 | 38 | |
38fe3975 | 39 | #endif /* _VFIO_DEV_H_ */ |