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_bulk_apply_vram(struct xe_device *xe, u64 size); 28 int xe_sriov_pf_provision_apply_vf_vram(struct xe_device *xe, unsigned int vfid, u64 size); 29 int xe_sriov_pf_provision_query_vf_vram(struct xe_device *xe, unsigned int vfid, u64 *size); 30 31 int xe_sriov_pf_provision_vfs(struct xe_device *xe, unsigned int num_vfs); 32 int xe_sriov_pf_unprovision_vfs(struct xe_device *xe, unsigned int num_vfs); 33 34 int xe_sriov_pf_provision_set_mode(struct xe_device *xe, enum xe_sriov_provisioning_mode mode); 35 36 /** 37 * xe_sriov_pf_provision_set_custom_mode() - Change VFs provision mode to custom. 38 * @xe: the PF &xe_device 39 * 40 * This function can only be called on PF. 41 * 42 * Return: 0 on success or a negative error code on failure. 43 */ 44 static inline int xe_sriov_pf_provision_set_custom_mode(struct xe_device *xe) 45 { 46 return xe_sriov_pf_provision_set_mode(xe, XE_SRIOV_PROVISIONING_MODE_CUSTOM); 47 } 48 49 #endif 50