GNU Linux-libre 4.19.286-gnu1
[releases.git] / drivers / net / ethernet / intel / iavf / i40e_prototype.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2013 - 2018 Intel Corporation. */
3
4 #ifndef _I40E_PROTOTYPE_H_
5 #define _I40E_PROTOTYPE_H_
6
7 #include "i40e_type.h"
8 #include "i40e_alloc.h"
9 #include <linux/avf/virtchnl.h>
10
11 /* Prototypes for shared code functions that are not in
12  * the standard function pointer structures.  These are
13  * mostly because they are needed even before the init
14  * has happened and will assist in the early SW and FW
15  * setup.
16  */
17
18 /* adminq functions */
19 i40e_status i40evf_init_adminq(struct i40e_hw *hw);
20 i40e_status i40evf_shutdown_adminq(struct i40e_hw *hw);
21 void i40e_adminq_init_ring_data(struct i40e_hw *hw);
22 i40e_status i40evf_clean_arq_element(struct i40e_hw *hw,
23                                              struct i40e_arq_event_info *e,
24                                              u16 *events_pending);
25 i40e_status i40evf_asq_send_command(struct i40e_hw *hw,
26                                 struct i40e_aq_desc *desc,
27                                 void *buff, /* can be NULL */
28                                 u16  buff_size,
29                                 struct i40e_asq_cmd_details *cmd_details);
30 bool i40evf_asq_done(struct i40e_hw *hw);
31
32 /* debug function for adminq */
33 void i40evf_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask,
34                      void *desc, void *buffer, u16 buf_len);
35
36 void i40e_idle_aq(struct i40e_hw *hw);
37 void i40evf_resume_aq(struct i40e_hw *hw);
38 bool i40evf_check_asq_alive(struct i40e_hw *hw);
39 i40e_status i40evf_aq_queue_shutdown(struct i40e_hw *hw, bool unloading);
40 const char *i40evf_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err);
41 const char *i40evf_stat_str(struct i40e_hw *hw, i40e_status stat_err);
42
43 i40e_status i40evf_aq_get_rss_lut(struct i40e_hw *hw, u16 seid,
44                                   bool pf_lut, u8 *lut, u16 lut_size);
45 i40e_status i40evf_aq_set_rss_lut(struct i40e_hw *hw, u16 seid,
46                                   bool pf_lut, u8 *lut, u16 lut_size);
47 i40e_status i40evf_aq_get_rss_key(struct i40e_hw *hw,
48                                   u16 seid,
49                                   struct i40e_aqc_get_set_rss_key_data *key);
50 i40e_status i40evf_aq_set_rss_key(struct i40e_hw *hw,
51                                   u16 seid,
52                                   struct i40e_aqc_get_set_rss_key_data *key);
53
54 i40e_status i40e_set_mac_type(struct i40e_hw *hw);
55
56 extern struct i40e_rx_ptype_decoded i40evf_ptype_lookup[];
57
58 static inline struct i40e_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
59 {
60         return i40evf_ptype_lookup[ptype];
61 }
62
63 /* i40e_common for VF drivers*/
64 void i40e_vf_parse_hw_config(struct i40e_hw *hw,
65                              struct virtchnl_vf_resource *msg);
66 i40e_status i40e_vf_reset(struct i40e_hw *hw);
67 i40e_status i40e_aq_send_msg_to_pf(struct i40e_hw *hw,
68                                    enum virtchnl_ops v_opcode,
69                                    i40e_status v_retval, u8 *msg, u16 msglen,
70                                    struct i40e_asq_cmd_details *cmd_details);
71 #endif /* _I40E_PROTOTYPE_H_ */