mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-08-27 09:08:53 +00:00

The rendered html documentation for "Xe ASSERTs" doesn't look nice with the mixed caps and gives the impression it was a typo. Use Title Case Style. Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241105071539.2623727-1-lucas.demarchi@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
47 lines
1.3 KiB
C
47 lines
1.3 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2023-2024 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _XE_SRIOV_PF_HELPERS_H_
|
|
#define _XE_SRIOV_PF_HELPERS_H_
|
|
|
|
#include "xe_assert.h"
|
|
#include "xe_device_types.h"
|
|
#include "xe_sriov.h"
|
|
#include "xe_sriov_types.h"
|
|
|
|
/**
|
|
* xe_sriov_pf_assert_vfid() - warn if &id is not a supported VF number when debugging.
|
|
* @xe: the PF &xe_device to assert on
|
|
* @vfid: the VF number to assert
|
|
*
|
|
* Assert that &xe represents the Physical Function (PF) device and provided &vfid
|
|
* is within a range of supported VF numbers (up to maximum number of VFs that
|
|
* driver can support, including VF0 that represents the PF itself).
|
|
*
|
|
* Note: Effective only on debug builds. See `Xe Asserts`_ for more information.
|
|
*/
|
|
#define xe_sriov_pf_assert_vfid(xe, vfid) \
|
|
xe_assert((xe), (vfid) <= xe_sriov_pf_get_totalvfs(xe))
|
|
|
|
/**
|
|
* xe_sriov_pf_get_totalvfs() - Get maximum number of VFs that driver can support.
|
|
* @xe: the &xe_device to query (shall be PF)
|
|
*
|
|
* Return: Maximum number of VFs that this PF driver supports.
|
|
*/
|
|
static inline int xe_sriov_pf_get_totalvfs(struct xe_device *xe)
|
|
{
|
|
xe_assert(xe, IS_SRIOV_PF(xe));
|
|
return xe->sriov.pf.driver_max_vfs;
|
|
}
|
|
|
|
static inline struct mutex *xe_sriov_pf_master_mutex(struct xe_device *xe)
|
|
{
|
|
xe_assert(xe, IS_SRIOV_PF(xe));
|
|
return &xe->sriov.pf.master_lock;
|
|
}
|
|
|
|
#endif
|