1 // SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
2 /* Copyright(c) 2015 - 2020 Intel Corporation */
3 #include "adf_accel_devices.h"
4 #include "adf_common_drv.h"
5 #include "adf_pf2vf_msg.h"
8 * adf_vf2pf_init() - send init msg to PF
9 * @accel_dev: Pointer to acceleration VF device.
11 * Function sends an init messge from the VF to a PF
13 * Return: 0 on success, error code otherwise.
15 int adf_vf2pf_init(struct adf_accel_dev
*accel_dev
)
17 u32 msg
= (ADF_VF2PF_MSGORIGIN_SYSTEM
|
18 (ADF_VF2PF_MSGTYPE_INIT
<< ADF_VF2PF_MSGTYPE_SHIFT
));
20 if (adf_iov_putmsg(accel_dev
, msg
, 0)) {
21 dev_err(&GET_DEV(accel_dev
),
22 "Failed to send Init event to PF\n");
25 set_bit(ADF_STATUS_PF_RUNNING
, &accel_dev
->status
);
28 EXPORT_SYMBOL_GPL(adf_vf2pf_init
);
31 * adf_vf2pf_shutdown() - send shutdown msg to PF
32 * @accel_dev: Pointer to acceleration VF device.
34 * Function sends a shutdown messge from the VF to a PF
38 void adf_vf2pf_shutdown(struct adf_accel_dev
*accel_dev
)
40 u32 msg
= (ADF_VF2PF_MSGORIGIN_SYSTEM
|
41 (ADF_VF2PF_MSGTYPE_SHUTDOWN
<< ADF_VF2PF_MSGTYPE_SHIFT
));
43 if (test_bit(ADF_STATUS_PF_RUNNING
, &accel_dev
->status
))
44 if (adf_iov_putmsg(accel_dev
, msg
, 0))
45 dev_err(&GET_DEV(accel_dev
),
46 "Failed to send Shutdown event to PF\n");
48 EXPORT_SYMBOL_GPL(adf_vf2pf_shutdown
);