xref: /linux/drivers/net/ethernet/intel/ixd/ixd_ctlq.h (revision 91ec2035134982b98fab0609a9fd8480e8217dc1)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (C) 2025 Intel Corporation */
3 
4 #ifndef _IXD_CTLQ_H_
5 #define _IXD_CTLQ_H_
6 
7 #include <linux/net/intel/virtchnl2.h>
8 
9 #define IXD_CTLQ_TIMEOUT 2000
10 
11 /**
12  * struct ixd_ctlq_req - Standard virtchnl request description
13  * @opcode: protocol opcode, only virtchnl2 is needed for now
14  * @send_size: required length of the send buffer
15  * @send_buff_init: function to initialize the allocated send buffer
16  * @recv_process: function to handle the CP response
17  * @ctx: additional context for callbacks
18  */
19 struct ixd_ctlq_req {
20 	enum virtchnl2_op opcode;
21 	size_t send_size;
22 	void (*send_buff_init)(struct ixd_adapter *adapter, void *send_buff,
23 			       void *ctx);
24 	int (*recv_process)(struct ixd_adapter *adapter, void *recv_buff,
25 			    size_t recv_size, void *ctx);
26 	void *ctx;
27 };
28 
29 void ixd_ctlq_clean_sq(struct ixd_adapter *adapter, bool force);
30 int ixd_ctlq_do_req(struct ixd_adapter *adapter,
31 		    const struct ixd_ctlq_req *req);
32 void ixd_ctlq_rx_task(struct work_struct *work);
33 
34 #endif /* _IXD_CTLQ_H_ */
35