]> asedeno.scripts.mit.edu Git - linux.git/blob - drivers/net/ethernet/intel/iavf/iavf_prototype.h
0dea4419c01f75332f59e432536afaaf566093d7
[linux.git] / drivers / net / ethernet / intel / iavf / iavf_prototype.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2013 - 2018 Intel Corporation. */
3
4 #ifndef _IAVF_PROTOTYPE_H_
5 #define _IAVF_PROTOTYPE_H_
6
7 #include "iavf_type.h"
8 #include "iavf_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 enum iavf_status iavf_init_adminq(struct iavf_hw *hw);
20 enum iavf_status iavf_shutdown_adminq(struct iavf_hw *hw);
21 void iavf_adminq_init_ring_data(struct iavf_hw *hw);
22 enum iavf_status iavf_clean_arq_element(struct iavf_hw *hw,
23                                         struct i40e_arq_event_info *e,
24                                         u16 *events_pending);
25 enum iavf_status iavf_asq_send_command(struct iavf_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 iavf_asq_done(struct iavf_hw *hw);
31
32 /* debug function for adminq */
33 void iavf_debug_aq(struct iavf_hw *hw, enum iavf_debug_mask mask,
34                    void *desc, void *buffer, u16 buf_len);
35
36 void iavf_idle_aq(struct iavf_hw *hw);
37 void iavf_resume_aq(struct iavf_hw *hw);
38 bool iavf_check_asq_alive(struct iavf_hw *hw);
39 enum iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading);
40 const char *iavf_aq_str(struct iavf_hw *hw, enum i40e_admin_queue_err aq_err);
41 const char *iavf_stat_str(struct iavf_hw *hw, enum iavf_status stat_err);
42
43 enum iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 seid,
44                                      bool pf_lut, u8 *lut, u16 lut_size);
45 enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid,
46                                      bool pf_lut, u8 *lut, u16 lut_size);
47 enum iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 seid,
48                                      struct i40e_aqc_get_set_rss_key_data *key);
49 enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
50                                      struct i40e_aqc_get_set_rss_key_data *key);
51
52 enum iavf_status iavf_set_mac_type(struct iavf_hw *hw);
53
54 extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[];
55
56 static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
57 {
58         return iavf_ptype_lookup[ptype];
59 }
60
61 void iavf_vf_parse_hw_config(struct iavf_hw *hw,
62                              struct virtchnl_vf_resource *msg);
63 enum iavf_status iavf_vf_reset(struct iavf_hw *hw);
64 enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw,
65                                         enum virtchnl_ops v_opcode,
66                                         enum iavf_status v_retval,
67                                         u8 *msg, u16 msglen,
68                                         struct i40e_asq_cmd_details *cmd_details);
69 #endif /* _IAVF_PROTOTYPE_H_ */