Lines Matching refs:pds_vfio

11 struct pci_dev *pds_vfio_to_pci_dev(struct pds_vfio_pci_device *pds_vfio)  in pds_vfio_to_pci_dev()  argument
13 return pds_vfio->vfio_coredev.pdev; in pds_vfio_to_pci_dev()
16 struct device *pds_vfio_to_dev(struct pds_vfio_pci_device *pds_vfio) in pds_vfio_to_dev() argument
18 return &pds_vfio_to_pci_dev(pds_vfio)->dev; in pds_vfio_to_dev()
29 void pds_vfio_reset(struct pds_vfio_pci_device *pds_vfio, in pds_vfio_reset() argument
32 pds_vfio_put_restore_file(pds_vfio); in pds_vfio_reset()
33 pds_vfio_put_save_file(pds_vfio); in pds_vfio_reset()
35 pds_vfio_dirty_disable(pds_vfio, false); in pds_vfio_reset()
36 pds_vfio->state = state; in pds_vfio_reset()
43 struct pds_vfio_pci_device *pds_vfio = in pds_vfio_set_device_state() local
48 mutex_lock(&pds_vfio->state_mutex); in pds_vfio_set_device_state()
55 while (pds_vfio->state != VFIO_DEVICE_STATE_ERROR && in pds_vfio_set_device_state()
56 new_state != pds_vfio->state) { in pds_vfio_set_device_state()
59 int err = vfio_mig_get_next_state(vdev, pds_vfio->state, in pds_vfio_set_device_state()
66 res = pds_vfio_step_device_state_locked(pds_vfio, next_state); in pds_vfio_set_device_state()
70 pds_vfio->state = next_state; in pds_vfio_set_device_state()
72 if (WARN_ON(res && new_state != pds_vfio->state)) { in pds_vfio_set_device_state()
77 mutex_unlock(&pds_vfio->state_mutex); in pds_vfio_set_device_state()
78 if (pds_vfio->state == VFIO_DEVICE_STATE_ERROR) in pds_vfio_set_device_state()
87 struct pds_vfio_pci_device *pds_vfio = in pds_vfio_get_device_state() local
91 mutex_lock(&pds_vfio->state_mutex); in pds_vfio_get_device_state()
92 *current_state = pds_vfio->state; in pds_vfio_get_device_state()
93 mutex_unlock(&pds_vfio->state_mutex); in pds_vfio_get_device_state()
118 struct pds_vfio_pci_device *pds_vfio = in pds_vfio_init_device() local
132 pds_vfio->vf_id = vf_id; in pds_vfio_init_device()
134 mutex_init(&pds_vfio->state_mutex); in pds_vfio_init_device()
144 pci_domain_nr(pdev->bus), pds_vfio); in pds_vfio_init_device()
151 struct pds_vfio_pci_device *pds_vfio = in pds_vfio_release_device() local
155 mutex_destroy(&pds_vfio->state_mutex); in pds_vfio_release_device()
161 struct pds_vfio_pci_device *pds_vfio = in pds_vfio_open_device() local
166 err = vfio_pci_core_enable(&pds_vfio->vfio_coredev); in pds_vfio_open_device()
170 pds_vfio->state = VFIO_DEVICE_STATE_RUNNING; in pds_vfio_open_device()
172 vfio_pci_core_finish_enable(&pds_vfio->vfio_coredev); in pds_vfio_open_device()
179 struct pds_vfio_pci_device *pds_vfio = in pds_vfio_close_device() local
183 mutex_lock(&pds_vfio->state_mutex); in pds_vfio_close_device()
184 pds_vfio_put_restore_file(pds_vfio); in pds_vfio_close_device()
185 pds_vfio_put_save_file(pds_vfio); in pds_vfio_close_device()
186 pds_vfio_dirty_disable(pds_vfio, true); in pds_vfio_close_device()
187 mutex_unlock(&pds_vfio->state_mutex); in pds_vfio_close_device()