1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright(c) 2007-2022 Intel Corporation */
3 #ifndef ADF_PFVF_VF_PROTO_H
4 #define ADF_PFVF_VF_PROTO_H
5 
6 #include <linux/types.h>
7 #include "adf_accel_devices.h"
8 
9 #define ADF_PFVF_MSG_COLLISION_DETECT_DELAY 10
10 #define ADF_PFVF_MSG_ACK_DELAY 2
11 #define ADF_PFVF_MSG_ACK_MAX_RETRY 100
12 
13 /* How often to retry if there is no response */
14 #define ADF_PFVF_MSG_RESP_RETRIES 5
15 #define ADF_PFVF_MSG_RESP_TIMEOUT                                              \
16 	(ADF_PFVF_MSG_ACK_DELAY * ADF_PFVF_MSG_ACK_MAX_RETRY +                 \
17 	 ADF_PFVF_MSG_COLLISION_DETECT_DELAY)
18 
19 int adf_send_vf2pf_msg(struct adf_accel_dev *accel_dev,
20 		       struct pfvf_message msg);
21 int adf_send_vf2pf_req(struct adf_accel_dev *accel_dev,
22 		       struct pfvf_message msg,
23 		       struct pfvf_message *resp);
24 int adf_send_vf2pf_blkmsg_req(struct adf_accel_dev *accel_dev,
25 			      u8 type,
26 			      u8 *buffer,
27 			      unsigned int *buffer_len);
28 
29 int adf_enable_vf2pf_comms(struct adf_accel_dev *accel_dev);
30 
31 #endif /* ADF_PFVF_VF_PROTO_H */
32