xref: /linux/drivers/gpu/drm/xe/xe_gt_sriov_pf_control.h (revision 6dfafbd0299a60bfb5d5e277fdf100037c7ded07)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023-2024 Intel Corporation
4  */
5 
6 #ifndef _XE_GT_SRIOV_PF_CONTROL_H_
7 #define _XE_GT_SRIOV_PF_CONTROL_H_
8 
9 #include <linux/errno.h>
10 #include <linux/types.h>
11 
12 struct xe_gt;
13 
14 int xe_gt_sriov_pf_control_init(struct xe_gt *gt);
15 void xe_gt_sriov_pf_control_restart(struct xe_gt *gt);
16 
17 int xe_gt_sriov_pf_control_pause_vf(struct xe_gt *gt, unsigned int vfid);
18 int xe_gt_sriov_pf_control_resume_vf(struct xe_gt *gt, unsigned int vfid);
19 bool xe_gt_sriov_pf_control_check_save_data_done(struct xe_gt *gt, unsigned int vfid);
20 bool xe_gt_sriov_pf_control_check_save_failed(struct xe_gt *gt, unsigned int vfid);
21 int xe_gt_sriov_pf_control_process_save_data(struct xe_gt *gt, unsigned int vfid);
22 int xe_gt_sriov_pf_control_trigger_save_vf(struct xe_gt *gt, unsigned int vfid);
23 int xe_gt_sriov_pf_control_finish_save_vf(struct xe_gt *gt, unsigned int vfid);
24 int xe_gt_sriov_pf_control_restore_data_done(struct xe_gt *gt, unsigned int vfid);
25 bool xe_gt_sriov_pf_control_check_restore_failed(struct xe_gt *gt, unsigned int vfid);
26 int xe_gt_sriov_pf_control_process_restore_data(struct xe_gt *gt, unsigned int vfid);
27 int xe_gt_sriov_pf_control_trigger_restore_vf(struct xe_gt *gt, unsigned int vfid);
28 int xe_gt_sriov_pf_control_finish_restore_vf(struct xe_gt *gt, unsigned int vfid);
29 int xe_gt_sriov_pf_control_stop_vf(struct xe_gt *gt, unsigned int vfid);
30 int xe_gt_sriov_pf_control_trigger_flr(struct xe_gt *gt, unsigned int vfid);
31 int xe_gt_sriov_pf_control_sync_flr(struct xe_gt *gt, unsigned int vfid, bool sync);
32 int xe_gt_sriov_pf_control_wait_flr(struct xe_gt *gt, unsigned int vfid);
33 
34 #ifdef CONFIG_PCI_IOV
35 int xe_gt_sriov_pf_control_process_guc2pf(struct xe_gt *gt, const u32 *msg, u32 len);
36 #else
37 static inline int xe_gt_sriov_pf_control_process_guc2pf(struct xe_gt *gt, const u32 *msg, u32 len)
38 {
39 	return -EPROTO;
40 }
41 #endif
42 
43 #endif
44