1
2
3
4
5#ifndef _IAVF_PROTOTYPE_H_
6#define _IAVF_PROTOTYPE_H_
7
8#include "iavf_type.h"
9#include "iavf_alloc.h"
10#include "virtchnl.h"
11
12
13
14
15
16
17
18
19
20__rte_internal
21enum iavf_status iavf_init_adminq(struct iavf_hw *hw);
22__rte_internal
23enum iavf_status iavf_shutdown_adminq(struct iavf_hw *hw);
24enum iavf_status iavf_init_asq(struct iavf_hw *hw);
25enum iavf_status iavf_init_arq(struct iavf_hw *hw);
26enum iavf_status iavf_alloc_adminq_asq_ring(struct iavf_hw *hw);
27enum iavf_status iavf_alloc_adminq_arq_ring(struct iavf_hw *hw);
28enum iavf_status iavf_shutdown_asq(struct iavf_hw *hw);
29enum iavf_status iavf_shutdown_arq(struct iavf_hw *hw);
30u16 iavf_clean_asq(struct iavf_hw *hw);
31void iavf_free_adminq_asq(struct iavf_hw *hw);
32void iavf_free_adminq_arq(struct iavf_hw *hw);
33enum iavf_status iavf_validate_mac_addr(u8 *mac_addr);
34void iavf_adminq_init_ring_data(struct iavf_hw *hw);
35__rte_internal
36enum iavf_status iavf_clean_arq_element(struct iavf_hw *hw,
37 struct iavf_arq_event_info *e,
38 u16 *events_pending);
39enum iavf_status iavf_asq_send_command(struct iavf_hw *hw,
40 struct iavf_aq_desc *desc,
41 void *buff,
42 u16 buff_size,
43 struct iavf_asq_cmd_details *cmd_details);
44bool iavf_asq_done(struct iavf_hw *hw);
45
46
47void iavf_debug_aq(struct iavf_hw *hw, enum iavf_debug_mask mask,
48 void *desc, void *buffer, u16 buf_len);
49
50void iavf_idle_aq(struct iavf_hw *hw);
51bool iavf_check_asq_alive(struct iavf_hw *hw);
52enum iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading);
53
54enum iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 seid,
55 bool pf_lut, u8 *lut, u16 lut_size);
56enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid,
57 bool pf_lut, u8 *lut, u16 lut_size);
58enum iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw,
59 u16 seid,
60 struct iavf_aqc_get_set_rss_key_data *key);
61enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw,
62 u16 seid,
63 struct iavf_aqc_get_set_rss_key_data *key);
64const char *iavf_aq_str(struct iavf_hw *hw, enum iavf_admin_queue_err aq_err);
65const char *iavf_stat_str(struct iavf_hw *hw, enum iavf_status stat_err);
66
67__rte_internal
68enum iavf_status iavf_set_mac_type(struct iavf_hw *hw);
69
70extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[];
71
72STATIC INLINE struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
73{
74 return iavf_ptype_lookup[ptype];
75}
76
77
78void iavf_init_spinlock(struct iavf_spinlock *sp);
79void iavf_acquire_spinlock(struct iavf_spinlock *sp);
80void iavf_release_spinlock(struct iavf_spinlock *sp);
81void iavf_destroy_spinlock(struct iavf_spinlock *sp);
82
83__rte_internal
84void iavf_vf_parse_hw_config(struct iavf_hw *hw,
85 struct virtchnl_vf_resource *msg);
86enum iavf_status iavf_vf_reset(struct iavf_hw *hw);
87__rte_internal
88enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw,
89 enum virtchnl_ops v_opcode,
90 enum iavf_status v_retval,
91 u8 *msg, u16 msglen,
92 struct iavf_asq_cmd_details *cmd_details);
93enum iavf_status iavf_aq_debug_dump(struct iavf_hw *hw, u8 cluster_id,
94 u8 table_id, u32 start_index, u16 buff_size,
95 void *buff, u16 *ret_buff_size,
96 u8 *ret_next_table, u32 *ret_next_index,
97 struct iavf_asq_cmd_details *cmd_details);
98enum iavf_status iavf_aq_clear_all_wol_filters(struct iavf_hw *hw,
99 struct iavf_asq_cmd_details *cmd_details);
100#endif
101