1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * Copyright © 2025 Intel Corporation 4 */ 5 6 #ifndef _XE_SRIOV_PF_PROVISION_H_ 7 #define _XE_SRIOV_PF_PROVISION_H_ 8 9 #include <linux/types.h> 10 11 #include "xe_sriov_pf_provision_types.h" 12 13 struct xe_device; 14 15 int xe_sriov_pf_provision_bulk_apply_eq(struct xe_device *xe, u32 eq); 16 int xe_sriov_pf_provision_apply_vf_eq(struct xe_device *xe, unsigned int vfid, u32 eq); 17 int xe_sriov_pf_provision_query_vf_eq(struct xe_device *xe, unsigned int vfid, u32 *eq); 18 19 int xe_sriov_pf_provision_bulk_apply_pt(struct xe_device *xe, u32 pt); 20 int xe_sriov_pf_provision_apply_vf_pt(struct xe_device *xe, unsigned int vfid, u32 pt); 21 int xe_sriov_pf_provision_query_vf_pt(struct xe_device *xe, unsigned int vfid, u32 *pt); 22 23 int xe_sriov_pf_provision_bulk_apply_priority(struct xe_device *xe, u32 prio); 24 int xe_sriov_pf_provision_apply_vf_priority(struct xe_device *xe, unsigned int vfid, u32 prio); 25 int xe_sriov_pf_provision_query_vf_priority(struct xe_device *xe, unsigned int vfid, u32 *prio); 26 27 int xe_sriov_pf_provision_vfs(struct xe_device *xe, unsigned int num_vfs); 28 int xe_sriov_pf_unprovision_vfs(struct xe_device *xe, unsigned int num_vfs); 29 30 int xe_sriov_pf_provision_set_mode(struct xe_device *xe, enum xe_sriov_provisioning_mode mode); 31 32 /** 33 * xe_sriov_pf_provision_set_custom_mode() - Change VFs provision mode to custom. 34 * @xe: the PF &xe_device 35 * 36 * This function can only be called on PF. 37 * 38 * Return: 0 on success or a negative error code on failure. 39 */ 40 static inline int xe_sriov_pf_provision_set_custom_mode(struct xe_device *xe) 41 { 42 return xe_sriov_pf_provision_set_mode(xe, XE_SRIOV_PROVISIONING_MODE_CUSTOM); 43 } 44 45 #endif 46