f44c09db278761d203d1b63cbf9eff4a4c4d1363
[dpdk.git] / drivers / net / ice / ice_dcf.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2020 Intel Corporation
3  */
4
5 #ifndef _ICE_DCF_H_
6 #define _ICE_DCF_H_
7
8 #include <rte_ethdev_driver.h>
9
10 #include <iavf_prototype.h>
11 #include <iavf_adminq_cmd.h>
12 #include <iavf_type.h>
13
14 #include "ice_logs.h"
15
16 struct dcf_virtchnl_cmd {
17         TAILQ_ENTRY(dcf_virtchnl_cmd) next;
18
19         enum virtchnl_ops v_op;
20         enum iavf_status v_ret;
21
22         uint16_t req_msglen;
23         uint8_t *req_msg;
24
25         uint16_t rsp_msglen;
26         uint16_t rsp_buflen;
27         uint8_t *rsp_msgbuf;
28
29         volatile int pending;
30 };
31
32 struct ice_dcf_hw {
33         struct iavf_hw avf;
34
35         rte_spinlock_t vc_cmd_send_lock;
36         rte_spinlock_t vc_cmd_queue_lock;
37         TAILQ_HEAD(, dcf_virtchnl_cmd) vc_cmd_queue;
38         uint8_t *arq_buf;
39
40         struct virtchnl_version_info virtchnl_version;
41         struct virtchnl_vf_resource *vf_res; /* VF resource */
42         struct virtchnl_vsi_resource *vsi_res; /* LAN VSI */
43         uint16_t vsi_id;
44 };
45
46 int ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw,
47                                  struct dcf_virtchnl_cmd *cmd);
48
49 int ice_dcf_init_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw);
50 void ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw);
51
52 #endif /* _ICE_DCF_H_ */