// SPDX-License-Identifier: MIT /* * Copyright © 2023 Intel Corporation */ #include <drm/drm_managed.h> #include "regs/xe_regs.h" #include "xe_assert.h" #include "xe_device.h" #include "xe_mmio.h" #include "xe_sriov.h" #include "xe_sriov_pf.h" /** * xe_sriov_mode_to_string - Convert enum value to string. * @mode: the &xe_sriov_mode to convert * * Returns: SR-IOV mode as a user friendly string. */ const char *xe_sriov_mode_to_string(enum xe_sriov_mode mode) { … } static bool test_is_vf(struct xe_device *xe) { … } /** * xe_sriov_probe_early - Probe a SR-IOV mode. * @xe: the &xe_device to probe mode on * * This function should be called only once and as soon as possible during * driver probe to detect whether we are running a SR-IOV Physical Function * (PF) or a Virtual Function (VF) device. * * SR-IOV PF mode detection is based on PCI @dev_is_pf() function. * SR-IOV VF mode detection is based on dedicated MMIO register read. */ void xe_sriov_probe_early(struct xe_device *xe) { … } static void fini_sriov(struct drm_device *drm, void *arg) { … } /** * xe_sriov_init - Initialize SR-IOV specific data. * @xe: the &xe_device to initialize * * In this function we create dedicated workqueue that will be used * by the SR-IOV specific workers. * * Return: 0 on success or a negative error code on failure. */ int xe_sriov_init(struct xe_device *xe) { … } /** * xe_sriov_print_info - Print basic SR-IOV information. * @xe: the &xe_device to print info from * @p: the &drm_printer * * Print SR-IOV related information into provided DRM printer. */ void xe_sriov_print_info(struct xe_device *xe, struct drm_printer *p) { … } /** * xe_sriov_function_name() - Get SR-IOV Function name. * @n: the Function number (identifier) to get name of * @buf: the buffer to format to * @size: size of the buffer (shall be at least 5 bytes) * * Return: formatted function name ("PF" or "VF%u"). */ const char *xe_sriov_function_name(unsigned int n, char *buf, size_t size) { … }