1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 #ifndef I40IW_VIRTCHNL_H
36 #define I40IW_VIRTCHNL_H
37
38 #include "i40iw_hmc.h"
39
40 #pragma pack(push, 1)
41
42 struct i40iw_virtchnl_op_buf {
43 u16 iw_op_code;
44 u16 iw_op_ver;
45 u16 iw_chnl_buf_len;
46 u16 rsvd;
47 u64 iw_chnl_op_ctx;
48
49 u8 iw_chnl_buf[1];
50 };
51
52 struct i40iw_virtchnl_resp_buf {
53 u64 iw_chnl_op_ctx;
54 u16 iw_chnl_buf_len;
55 s16 iw_op_ret_code;
56
57 u16 rsvd[2];
58 u8 iw_chnl_buf[1];
59 };
60
61 enum i40iw_virtchnl_ops {
62 I40IW_VCHNL_OP_GET_VER = 0,
63 I40IW_VCHNL_OP_GET_HMC_FCN,
64 I40IW_VCHNL_OP_ADD_HMC_OBJ_RANGE,
65 I40IW_VCHNL_OP_DEL_HMC_OBJ_RANGE,
66 I40IW_VCHNL_OP_GET_STATS
67 };
68
69 #define I40IW_VCHNL_OP_GET_VER_V0 0
70 #define I40IW_VCHNL_OP_GET_HMC_FCN_V0 0
71 #define I40IW_VCHNL_OP_ADD_HMC_OBJ_RANGE_V0 0
72 #define I40IW_VCHNL_OP_DEL_HMC_OBJ_RANGE_V0 0
73 #define I40IW_VCHNL_OP_GET_STATS_V0 0
74 #define I40IW_VCHNL_CHNL_VER_V0 0
75
76 struct i40iw_dev_hw_stats;
77
78 struct i40iw_virtchnl_hmc_obj_range {
79 u16 obj_type;
80 u16 rsvd;
81 u32 start_index;
82 u32 obj_count;
83 };
84
85 enum i40iw_status_code i40iw_vchnl_recv_pf(struct i40iw_sc_dev *dev,
86 u32 vf_id,
87 u8 *msg,
88 u16 len);
89
90 enum i40iw_status_code i40iw_vchnl_recv_vf(struct i40iw_sc_dev *dev,
91 u32 vf_id,
92 u8 *msg,
93 u16 len);
94
95 struct i40iw_virtchnl_req {
96 struct i40iw_sc_dev *dev;
97 struct i40iw_virtchnl_op_buf *vchnl_msg;
98 void *parm;
99 u32 vf_id;
100 u16 parm_len;
101 s16 ret_code;
102 };
103
104 #pragma pack(pop)
105
106 enum i40iw_status_code i40iw_vchnl_vf_get_ver(struct i40iw_sc_dev *dev,
107 u32 *vchnl_ver);
108
109 enum i40iw_status_code i40iw_vchnl_vf_get_hmc_fcn(struct i40iw_sc_dev *dev,
110 u16 *hmc_fcn);
111
112 enum i40iw_status_code i40iw_vchnl_vf_add_hmc_objs(struct i40iw_sc_dev *dev,
113 enum i40iw_hmc_rsrc_type rsrc_type,
114 u32 start_index,
115 u32 rsrc_count);
116
117 enum i40iw_status_code i40iw_vchnl_vf_del_hmc_obj(struct i40iw_sc_dev *dev,
118 enum i40iw_hmc_rsrc_type rsrc_type,
119 u32 start_index,
120 u32 rsrc_count);
121
122 enum i40iw_status_code i40iw_vchnl_vf_get_pe_stats(struct i40iw_sc_dev *dev,
123 struct i40iw_dev_hw_stats *hw_stats);
124 #endif