]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/net/ethernet/intel/i40evf/i40e_prototype.h
Merge remote-tracking branch 'sound-current/for-linus'
[karo-tx-linux.git] / drivers / net / ethernet / intel / i40evf / i40e_prototype.h
1 /*******************************************************************************
2  *
3  * Intel Ethernet Controller XL710 Family Linux Virtual Function Driver
4  * Copyright(c) 2013 - 2014 Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  * The full GNU General Public License is included in this distribution in
19  * the file called "COPYING".
20  *
21  * Contact Information:
22  * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
23  * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24  *
25  ******************************************************************************/
26
27 #ifndef _I40E_PROTOTYPE_H_
28 #define _I40E_PROTOTYPE_H_
29
30 #include "i40e_type.h"
31 #include "i40e_alloc.h"
32 #include "i40e_virtchnl.h"
33
34 /* Prototypes for shared code functions that are not in
35  * the standard function pointer structures.  These are
36  * mostly because they are needed even before the init
37  * has happened and will assist in the early SW and FW
38  * setup.
39  */
40
41 /* adminq functions */
42 i40e_status i40evf_init_adminq(struct i40e_hw *hw);
43 i40e_status i40evf_shutdown_adminq(struct i40e_hw *hw);
44 void i40e_adminq_init_ring_data(struct i40e_hw *hw);
45 i40e_status i40evf_clean_arq_element(struct i40e_hw *hw,
46                                              struct i40e_arq_event_info *e,
47                                              u16 *events_pending);
48 i40e_status i40evf_asq_send_command(struct i40e_hw *hw,
49                                 struct i40e_aq_desc *desc,
50                                 void *buff, /* can be NULL */
51                                 u16  buff_size,
52                                 struct i40e_asq_cmd_details *cmd_details);
53 bool i40evf_asq_done(struct i40e_hw *hw);
54
55 /* debug function for adminq */
56 void i40evf_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask,
57                      void *desc, void *buffer, u16 buf_len);
58
59 void i40e_idle_aq(struct i40e_hw *hw);
60 void i40evf_resume_aq(struct i40e_hw *hw);
61 bool i40evf_check_asq_alive(struct i40e_hw *hw);
62 i40e_status i40evf_aq_queue_shutdown(struct i40e_hw *hw, bool unloading);
63 const char *i40evf_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err);
64 const char *i40evf_stat_str(struct i40e_hw *hw, i40e_status stat_err);
65
66 i40e_status i40evf_aq_get_rss_lut(struct i40e_hw *hw, u16 seid,
67                                   bool pf_lut, u8 *lut, u16 lut_size);
68 i40e_status i40evf_aq_set_rss_lut(struct i40e_hw *hw, u16 seid,
69                                   bool pf_lut, u8 *lut, u16 lut_size);
70 i40e_status i40evf_aq_get_rss_key(struct i40e_hw *hw,
71                                   u16 seid,
72                                   struct i40e_aqc_get_set_rss_key_data *key);
73 i40e_status i40evf_aq_set_rss_key(struct i40e_hw *hw,
74                                   u16 seid,
75                                   struct i40e_aqc_get_set_rss_key_data *key);
76
77 i40e_status i40e_set_mac_type(struct i40e_hw *hw);
78
79 extern struct i40e_rx_ptype_decoded i40evf_ptype_lookup[];
80
81 static inline struct i40e_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
82 {
83         return i40evf_ptype_lookup[ptype];
84 }
85
86 /* prototype for functions used for SW locks */
87
88 /* i40e_common for VF drivers*/
89 void i40e_vf_parse_hw_config(struct i40e_hw *hw,
90                              struct i40e_virtchnl_vf_resource *msg);
91 i40e_status i40e_vf_reset(struct i40e_hw *hw);
92 i40e_status i40e_aq_send_msg_to_pf(struct i40e_hw *hw,
93                                 enum i40e_virtchnl_ops v_opcode,
94                                 i40e_status v_retval,
95                                 u8 *msg, u16 msglen,
96                                 struct i40e_asq_cmd_details *cmd_details);
97 i40e_status i40e_set_filter_control(struct i40e_hw *hw,
98                                 struct i40e_filter_control_settings *settings);
99 i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,
100                                 u8 *mac_addr, u16 ethtype, u16 flags,
101                                 u16 vsi_seid, u16 queue, bool is_add,
102                                 struct i40e_control_filter_stats *stats,
103                                 struct i40e_asq_cmd_details *cmd_details);
104 void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw,
105                                                     u16 vsi_seid);
106 #endif /* _I40E_PROTOTYPE_H_ */