mirror of
https://github.com/torvalds/linux.git
synced 2026-04-27 02:52:27 -04:00
At start and shutdown, VFs notify the PF about their state. These notifications are carried out through a message exchange using the PFVF protocol. Function names lead to believe they do perform init or shutdown logic. This is to fix the naming to better reflect their purpose. Signed-off-by: Marco Chiappero <marco.chiappero@intel.com> Co-developed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Reviewed-by: Fiona Trahe <fiona.trahe@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
49 lines
1.4 KiB
C
49 lines
1.4 KiB
C
// SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
|
|
/* Copyright(c) 2015 - 2020 Intel Corporation */
|
|
#include "adf_accel_devices.h"
|
|
#include "adf_common_drv.h"
|
|
#include "adf_pf2vf_msg.h"
|
|
|
|
/**
|
|
* adf_vf2pf_notify_init() - send init msg to PF
|
|
* @accel_dev: Pointer to acceleration VF device.
|
|
*
|
|
* Function sends an init message from the VF to a PF
|
|
*
|
|
* Return: 0 on success, error code otherwise.
|
|
*/
|
|
int adf_vf2pf_notify_init(struct adf_accel_dev *accel_dev)
|
|
{
|
|
u32 msg = (ADF_VF2PF_MSGORIGIN_SYSTEM |
|
|
(ADF_VF2PF_MSGTYPE_INIT << ADF_VF2PF_MSGTYPE_SHIFT));
|
|
|
|
if (adf_iov_putmsg(accel_dev, msg, 0)) {
|
|
dev_err(&GET_DEV(accel_dev),
|
|
"Failed to send Init event to PF\n");
|
|
return -EFAULT;
|
|
}
|
|
set_bit(ADF_STATUS_PF_RUNNING, &accel_dev->status);
|
|
return 0;
|
|
}
|
|
EXPORT_SYMBOL_GPL(adf_vf2pf_notify_init);
|
|
|
|
/**
|
|
* adf_vf2pf_notify_shutdown() - send shutdown msg to PF
|
|
* @accel_dev: Pointer to acceleration VF device.
|
|
*
|
|
* Function sends a shutdown message from the VF to a PF
|
|
*
|
|
* Return: void
|
|
*/
|
|
void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev)
|
|
{
|
|
u32 msg = (ADF_VF2PF_MSGORIGIN_SYSTEM |
|
|
(ADF_VF2PF_MSGTYPE_SHUTDOWN << ADF_VF2PF_MSGTYPE_SHIFT));
|
|
|
|
if (test_bit(ADF_STATUS_PF_RUNNING, &accel_dev->status))
|
|
if (adf_iov_putmsg(accel_dev, msg, 0))
|
|
dev_err(&GET_DEV(accel_dev),
|
|
"Failed to send Shutdown event to PF\n");
|
|
}
|
|
EXPORT_SYMBOL_GPL(adf_vf2pf_notify_shutdown);
|