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