i40e_prototype.h revision 292095
1270631Sjfv/******************************************************************************
2270631Sjfv
3292095Ssmh  Copyright (c) 2013-2015, Intel Corporation
4270631Sjfv  All rights reserved.
5270631Sjfv
6270631Sjfv  Redistribution and use in source and binary forms, with or without
7270631Sjfv  modification, are permitted provided that the following conditions are met:
8270631Sjfv
9270631Sjfv   1. Redistributions of source code must retain the above copyright notice,
10270631Sjfv      this list of conditions and the following disclaimer.
11270631Sjfv
12270631Sjfv   2. Redistributions in binary form must reproduce the above copyright
13270631Sjfv      notice, this list of conditions and the following disclaimer in the
14270631Sjfv      documentation and/or other materials provided with the distribution.
15270631Sjfv
16270631Sjfv   3. Neither the name of the Intel Corporation nor the names of its
17270631Sjfv      contributors may be used to endorse or promote products derived from
18270631Sjfv      this software without specific prior written permission.
19270631Sjfv
20270631Sjfv  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21270631Sjfv  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22270631Sjfv  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23270631Sjfv  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24270631Sjfv  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25270631Sjfv  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26270631Sjfv  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27270631Sjfv  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28270631Sjfv  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29270631Sjfv  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30270631Sjfv  POSSIBILITY OF SUCH DAMAGE.
31270631Sjfv
32270631Sjfv******************************************************************************/
33270631Sjfv/*$FreeBSD: stable/10/sys/dev/ixl/i40e_prototype.h 292095 2015-12-11 12:20:58Z smh $*/
34270631Sjfv
35270631Sjfv#ifndef _I40E_PROTOTYPE_H_
36270631Sjfv#define _I40E_PROTOTYPE_H_
37270631Sjfv
38270631Sjfv#include "i40e_type.h"
39270631Sjfv#include "i40e_alloc.h"
40270631Sjfv#include "i40e_virtchnl.h"
41270631Sjfv
42270631Sjfv/* Prototypes for shared code functions that are not in
43270631Sjfv * the standard function pointer structures.  These are
44270631Sjfv * mostly because they are needed even before the init
45270631Sjfv * has happened and will assist in the early SW and FW
46270631Sjfv * setup.
47270631Sjfv */
48270631Sjfv
49270631Sjfv/* adminq functions */
50270631Sjfvenum i40e_status_code i40e_init_adminq(struct i40e_hw *hw);
51270631Sjfvenum i40e_status_code i40e_shutdown_adminq(struct i40e_hw *hw);
52270631Sjfvenum i40e_status_code i40e_init_asq(struct i40e_hw *hw);
53270631Sjfvenum i40e_status_code i40e_init_arq(struct i40e_hw *hw);
54270631Sjfvenum i40e_status_code i40e_alloc_adminq_asq_ring(struct i40e_hw *hw);
55270631Sjfvenum i40e_status_code i40e_alloc_adminq_arq_ring(struct i40e_hw *hw);
56270631Sjfvenum i40e_status_code i40e_shutdown_asq(struct i40e_hw *hw);
57270631Sjfvenum i40e_status_code i40e_shutdown_arq(struct i40e_hw *hw);
58270631Sjfvu16 i40e_clean_asq(struct i40e_hw *hw);
59270631Sjfvvoid i40e_free_adminq_asq(struct i40e_hw *hw);
60270631Sjfvvoid i40e_free_adminq_arq(struct i40e_hw *hw);
61291248Ssmhenum i40e_status_code i40e_validate_mac_addr(u8 *mac_addr);
62270631Sjfvvoid i40e_adminq_init_ring_data(struct i40e_hw *hw);
63270631Sjfvenum i40e_status_code i40e_clean_arq_element(struct i40e_hw *hw,
64270631Sjfv					     struct i40e_arq_event_info *e,
65270631Sjfv					     u16 *events_pending);
66270631Sjfvenum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
67270631Sjfv				struct i40e_aq_desc *desc,
68270631Sjfv				void *buff, /* can be NULL */
69270631Sjfv				u16  buff_size,
70270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
71270631Sjfvbool i40e_asq_done(struct i40e_hw *hw);
72270631Sjfv
73270631Sjfv/* debug function for adminq */
74270631Sjfvvoid i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask,
75270631Sjfv		   void *desc, void *buffer, u16 buf_len);
76270631Sjfv
77270631Sjfvvoid i40e_idle_aq(struct i40e_hw *hw);
78270631Sjfvvoid i40e_resume_aq(struct i40e_hw *hw);
79270631Sjfvbool i40e_check_asq_alive(struct i40e_hw *hw);
80270631Sjfvenum i40e_status_code i40e_aq_queue_shutdown(struct i40e_hw *hw, bool unloading);
81270631Sjfv
82270631Sjfv
83270631Sjfvu32 i40e_led_get(struct i40e_hw *hw);
84270631Sjfvvoid i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink);
85270631Sjfv
86270631Sjfv/* admin send queue commands */
87270631Sjfv
88270631Sjfvenum i40e_status_code i40e_aq_get_firmware_version(struct i40e_hw *hw,
89270631Sjfv				u16 *fw_major_version, u16 *fw_minor_version,
90291248Ssmh				u32 *fw_build,
91270631Sjfv				u16 *api_major_version, u16 *api_minor_version,
92270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
93270631Sjfvenum i40e_status_code i40e_aq_debug_write_register(struct i40e_hw *hw,
94270631Sjfv				u32 reg_addr, u64 reg_val,
95270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
96291248Ssmhenum i40e_status_code i40e_aq_debug_read_register(struct i40e_hw *hw,
97291248Ssmh				u32  reg_addr, u64 *reg_val,
98291248Ssmh				struct i40e_asq_cmd_details *cmd_details);
99270631Sjfvenum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,
100270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
101270631Sjfvenum i40e_status_code i40e_aq_set_default_vsi(struct i40e_hw *hw, u16 vsi_id,
102270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
103270631Sjfvenum i40e_status_code i40e_aq_get_phy_capabilities(struct i40e_hw *hw,
104270631Sjfv			bool qualified_modules, bool report_init,
105270631Sjfv			struct i40e_aq_get_phy_abilities_resp *abilities,
106270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
107270631Sjfvenum i40e_status_code i40e_aq_set_phy_config(struct i40e_hw *hw,
108270631Sjfv				struct i40e_aq_set_phy_config *config,
109270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
110270631Sjfvenum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,
111270631Sjfv				  bool atomic_reset);
112270631Sjfvenum i40e_status_code i40e_aq_set_phy_int_mask(struct i40e_hw *hw, u16 mask,
113270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
114270631Sjfvenum i40e_status_code i40e_aq_set_mac_config(struct i40e_hw *hw,
115270631Sjfv				u16 max_frame_size, bool crc_en, u16 pacing,
116270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
117270631Sjfvenum i40e_status_code i40e_aq_get_local_advt_reg(struct i40e_hw *hw,
118270631Sjfv				u64 *advt_reg,
119270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
120270631Sjfvenum i40e_status_code i40e_aq_get_partner_advt(struct i40e_hw *hw,
121270631Sjfv				u64 *advt_reg,
122270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
123270631Sjfvenum i40e_status_code i40e_aq_set_lb_modes(struct i40e_hw *hw, u16 lb_modes,
124270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
125270631Sjfvenum i40e_status_code i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
126270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
127270631Sjfvenum i40e_status_code i40e_aq_set_link_restart_an(struct i40e_hw *hw,
128270631Sjfv		bool enable_link, struct i40e_asq_cmd_details *cmd_details);
129270631Sjfvenum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
130270631Sjfv				bool enable_lse, struct i40e_link_status *link,
131270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
132270631Sjfvenum i40e_status_code i40e_aq_set_local_advt_reg(struct i40e_hw *hw,
133270631Sjfv				u64 advt_reg,
134270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
135270631Sjfvenum i40e_status_code i40e_aq_send_driver_version(struct i40e_hw *hw,
136270631Sjfv				struct i40e_driver_version *dv,
137270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
138270631Sjfvenum i40e_status_code i40e_aq_add_vsi(struct i40e_hw *hw,
139270631Sjfv				struct i40e_vsi_context *vsi_ctx,
140270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
141270631Sjfvenum i40e_status_code i40e_aq_set_vsi_broadcast(struct i40e_hw *hw,
142270631Sjfv				u16 vsi_id, bool set_filter,
143270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
144270631Sjfvenum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
145270631Sjfv		u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
146270631Sjfvenum i40e_status_code i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw,
147270631Sjfv		u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
148270631Sjfvenum i40e_status_code i40e_aq_get_vsi_params(struct i40e_hw *hw,
149270631Sjfv				struct i40e_vsi_context *vsi_ctx,
150270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
151270631Sjfvenum i40e_status_code i40e_aq_update_vsi_params(struct i40e_hw *hw,
152270631Sjfv				struct i40e_vsi_context *vsi_ctx,
153270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
154270631Sjfvenum i40e_status_code i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid,
155270631Sjfv				u16 downlink_seid, u8 enabled_tc,
156270631Sjfv				bool default_port, bool enable_l2_filtering,
157270631Sjfv				u16 *pveb_seid,
158270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
159270631Sjfvenum i40e_status_code i40e_aq_get_veb_parameters(struct i40e_hw *hw,
160270631Sjfv				u16 veb_seid, u16 *switch_id, bool *floating,
161270631Sjfv				u16 *statistic_index, u16 *vebs_used,
162270631Sjfv				u16 *vebs_free,
163270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
164270631Sjfvenum i40e_status_code i40e_aq_add_macvlan(struct i40e_hw *hw, u16 vsi_id,
165270631Sjfv			struct i40e_aqc_add_macvlan_element_data *mv_list,
166270631Sjfv			u16 count, struct i40e_asq_cmd_details *cmd_details);
167270631Sjfvenum i40e_status_code i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 vsi_id,
168270631Sjfv			struct i40e_aqc_remove_macvlan_element_data *mv_list,
169270631Sjfv			u16 count, struct i40e_asq_cmd_details *cmd_details);
170270631Sjfvenum i40e_status_code i40e_aq_add_vlan(struct i40e_hw *hw, u16 vsi_id,
171270631Sjfv			struct i40e_aqc_add_remove_vlan_element_data *v_list,
172270631Sjfv			u8 count, struct i40e_asq_cmd_details *cmd_details);
173270631Sjfvenum i40e_status_code i40e_aq_remove_vlan(struct i40e_hw *hw, u16 vsi_id,
174270631Sjfv			struct i40e_aqc_add_remove_vlan_element_data *v_list,
175270631Sjfv			u8 count, struct i40e_asq_cmd_details *cmd_details);
176270631Sjfvenum i40e_status_code i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid,
177270631Sjfv				u32 v_opcode, u32 v_retval, u8 *msg, u16 msglen,
178270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
179270631Sjfvenum i40e_status_code i40e_aq_get_switch_config(struct i40e_hw *hw,
180270631Sjfv				struct i40e_aqc_get_switch_config_resp *buf,
181270631Sjfv				u16 buf_size, u16 *start_seid,
182270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
183270631Sjfvenum i40e_status_code i40e_aq_request_resource(struct i40e_hw *hw,
184270631Sjfv				enum i40e_aq_resources_ids resource,
185270631Sjfv				enum i40e_aq_resource_access_type access,
186270631Sjfv				u8 sdp_number, u64 *timeout,
187270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
188270631Sjfvenum i40e_status_code i40e_aq_release_resource(struct i40e_hw *hw,
189270631Sjfv				enum i40e_aq_resources_ids resource,
190270631Sjfv				u8 sdp_number,
191270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
192270631Sjfvenum i40e_status_code i40e_aq_read_nvm(struct i40e_hw *hw, u8 module_pointer,
193270631Sjfv				u32 offset, u16 length, void *data,
194270631Sjfv				bool last_command,
195270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
196270631Sjfvenum i40e_status_code i40e_aq_erase_nvm(struct i40e_hw *hw, u8 module_pointer,
197270631Sjfv				u32 offset, u16 length, bool last_command,
198270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
199291248Ssmhenum i40e_status_code i40e_aq_read_nvm_config(struct i40e_hw *hw,
200291248Ssmh				u8 cmd_flags, u32 field_id, void *data,
201291248Ssmh				u16 buf_size, u16 *element_count,
202291248Ssmh				struct i40e_asq_cmd_details *cmd_details);
203291248Ssmhenum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw,
204291248Ssmh				u8 cmd_flags, void *data, u16 buf_size,
205291248Ssmh				u16 element_count,
206291248Ssmh				struct i40e_asq_cmd_details *cmd_details);
207270631Sjfvenum i40e_status_code i40e_aq_discover_capabilities(struct i40e_hw *hw,
208270631Sjfv				void *buff, u16 buff_size, u16 *data_size,
209270631Sjfv				enum i40e_admin_queue_opc list_type_opc,
210270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
211270631Sjfvenum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
212270631Sjfv				u32 offset, u16 length, void *data,
213270631Sjfv				bool last_command,
214270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
215270631Sjfvenum i40e_status_code i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type,
216270631Sjfv				u8 mib_type, void *buff, u16 buff_size,
217270631Sjfv				u16 *local_len, u16 *remote_len,
218270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
219291248Ssmhenum i40e_status_code i40e_aq_set_lldp_mib(struct i40e_hw *hw,
220291248Ssmh				u8 mib_type, void *buff, u16 buff_size,
221291248Ssmh				struct i40e_asq_cmd_details *cmd_details);
222270631Sjfvenum i40e_status_code i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw,
223270631Sjfv				bool enable_update,
224270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
225270631Sjfvenum i40e_status_code i40e_aq_add_lldp_tlv(struct i40e_hw *hw, u8 bridge_type,
226270631Sjfv				void *buff, u16 buff_size, u16 tlv_len,
227270631Sjfv				u16 *mib_len,
228270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
229270631Sjfvenum i40e_status_code i40e_aq_update_lldp_tlv(struct i40e_hw *hw,
230270631Sjfv				u8 bridge_type, void *buff, u16 buff_size,
231270631Sjfv				u16 old_len, u16 new_len, u16 offset,
232270631Sjfv				u16 *mib_len,
233270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
234270631Sjfvenum i40e_status_code i40e_aq_delete_lldp_tlv(struct i40e_hw *hw,
235270631Sjfv				u8 bridge_type, void *buff, u16 buff_size,
236270631Sjfv				u16 tlv_len, u16 *mib_len,
237270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
238270631Sjfvenum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent,
239270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
240270631Sjfvenum i40e_status_code i40e_aq_start_lldp(struct i40e_hw *hw,
241270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
242291248Ssmhenum i40e_status_code i40e_aq_get_cee_dcb_config(struct i40e_hw *hw,
243291248Ssmh				void *buff, u16 buff_size,
244291248Ssmh				struct i40e_asq_cmd_details *cmd_details);
245291248Ssmhenum i40e_status_code i40e_aq_start_stop_dcbx(struct i40e_hw *hw,
246291248Ssmh				bool start_agent,
247291248Ssmh				struct i40e_asq_cmd_details *cmd_details);
248270631Sjfvenum i40e_status_code i40e_aq_add_udp_tunnel(struct i40e_hw *hw,
249270631Sjfv				u16 udp_port, u8 protocol_index,
250270631Sjfv				u8 *filter_index,
251270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
252270631Sjfvenum i40e_status_code i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index,
253270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
254270631Sjfvenum i40e_status_code i40e_aq_get_switch_resource_alloc(struct i40e_hw *hw,
255270631Sjfv			u8 *num_entries,
256270631Sjfv			struct i40e_aqc_switch_resource_alloc_element_resp *buf,
257270631Sjfv			u16 count,
258270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
259270631Sjfvenum i40e_status_code i40e_aq_add_pvirt(struct i40e_hw *hw, u16 flags,
260270631Sjfv				       u16 mac_seid, u16 vsi_seid,
261270631Sjfv				       u16 *ret_seid);
262270631Sjfvenum i40e_status_code i40e_aq_add_tag(struct i40e_hw *hw, bool direct_to_queue,
263270631Sjfv				u16 vsi_seid, u16 tag, u16 queue_num,
264270631Sjfv				u16 *tags_used, u16 *tags_free,
265270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
266270631Sjfvenum i40e_status_code i40e_aq_remove_tag(struct i40e_hw *hw, u16 vsi_seid,
267270631Sjfv				u16 tag, u16 *tags_used, u16 *tags_free,
268270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
269270631Sjfvenum i40e_status_code i40e_aq_add_mcast_etag(struct i40e_hw *hw, u16 pe_seid,
270270631Sjfv				u16 etag, u8 num_tags_in_buf, void *buf,
271270631Sjfv				u16 *tags_used, u16 *tags_free,
272270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
273270631Sjfvenum i40e_status_code i40e_aq_remove_mcast_etag(struct i40e_hw *hw, u16 pe_seid,
274270631Sjfv				u16 etag, u16 *tags_used, u16 *tags_free,
275270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
276270631Sjfvenum i40e_status_code i40e_aq_update_tag(struct i40e_hw *hw, u16 vsi_seid,
277270631Sjfv				u16 old_tag, u16 new_tag, u16 *tags_used,
278270631Sjfv				u16 *tags_free,
279270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
280270631Sjfvenum i40e_status_code i40e_aq_add_statistics(struct i40e_hw *hw, u16 seid,
281270631Sjfv				u16 vlan_id, u16 *stat_index,
282270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
283270631Sjfvenum i40e_status_code i40e_aq_remove_statistics(struct i40e_hw *hw, u16 seid,
284270631Sjfv				u16 vlan_id, u16 stat_index,
285270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
286270631Sjfvenum i40e_status_code i40e_aq_set_port_parameters(struct i40e_hw *hw,
287270631Sjfv				u16 bad_frame_vsi, bool save_bad_pac,
288270631Sjfv				bool pad_short_pac, bool double_vlan,
289270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
290270631Sjfvenum i40e_status_code i40e_aq_delete_element(struct i40e_hw *hw, u16 seid,
291270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
292270631Sjfvenum i40e_status_code i40e_aq_mac_address_write(struct i40e_hw *hw,
293270631Sjfv				    u16 flags, u8 *mac_addr,
294270631Sjfv				    struct i40e_asq_cmd_details *cmd_details);
295270631Sjfvenum i40e_status_code i40e_aq_config_vsi_bw_limit(struct i40e_hw *hw,
296270631Sjfv				u16 seid, u16 credit, u8 max_credit,
297270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
298270631Sjfvenum i40e_status_code i40e_aq_dcb_ignore_pfc(struct i40e_hw *hw,
299270631Sjfv				u8 tcmap, bool request, u8 *tcmap_ret,
300270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
301270631Sjfvenum i40e_status_code i40e_aq_get_hmc_resource_profile(struct i40e_hw *hw,
302270631Sjfv				enum i40e_aq_hmc_profile *profile,
303270631Sjfv				u8 *pe_vf_enabled_count,
304270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
305270631Sjfvenum i40e_status_code i40e_aq_config_switch_comp_ets_bw_limit(
306270631Sjfv	struct i40e_hw *hw, u16 seid,
307270631Sjfv	struct i40e_aqc_configure_switching_comp_ets_bw_limit_data *bw_data,
308270631Sjfv	struct i40e_asq_cmd_details *cmd_details);
309270631Sjfvenum i40e_status_code i40e_aq_config_vsi_ets_sla_bw_limit(struct i40e_hw *hw,
310270631Sjfv			u16 seid,
311270631Sjfv			struct i40e_aqc_configure_vsi_ets_sla_bw_data *bw_data,
312270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
313270631Sjfvenum i40e_status_code i40e_aq_dcb_updated(struct i40e_hw *hw,
314270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
315270631Sjfvenum i40e_status_code i40e_aq_set_hmc_resource_profile(struct i40e_hw *hw,
316270631Sjfv				enum i40e_aq_hmc_profile profile,
317270631Sjfv				u8 pe_vf_enabled_count,
318270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
319270631Sjfvenum i40e_status_code i40e_aq_config_switch_comp_bw_limit(struct i40e_hw *hw,
320270631Sjfv				u16 seid, u16 credit, u8 max_bw,
321270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
322270631Sjfvenum i40e_status_code i40e_aq_config_vsi_tc_bw(struct i40e_hw *hw, u16 seid,
323270631Sjfv			struct i40e_aqc_configure_vsi_tc_bw_data *bw_data,
324270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
325270631Sjfvenum i40e_status_code i40e_aq_query_vsi_bw_config(struct i40e_hw *hw,
326270631Sjfv			u16 seid,
327270631Sjfv			struct i40e_aqc_query_vsi_bw_config_resp *bw_data,
328270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
329270631Sjfvenum i40e_status_code i40e_aq_query_vsi_ets_sla_config(struct i40e_hw *hw,
330270631Sjfv			u16 seid,
331270631Sjfv			struct i40e_aqc_query_vsi_ets_sla_config_resp *bw_data,
332270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
333270631Sjfvenum i40e_status_code i40e_aq_query_switch_comp_ets_config(struct i40e_hw *hw,
334270631Sjfv		u16 seid,
335270631Sjfv		struct i40e_aqc_query_switching_comp_ets_config_resp *bw_data,
336270631Sjfv		struct i40e_asq_cmd_details *cmd_details);
337270631Sjfvenum i40e_status_code i40e_aq_query_port_ets_config(struct i40e_hw *hw,
338270631Sjfv		u16 seid,
339270631Sjfv		struct i40e_aqc_query_port_ets_config_resp *bw_data,
340270631Sjfv		struct i40e_asq_cmd_details *cmd_details);
341270631Sjfvenum i40e_status_code i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw,
342270631Sjfv		u16 seid,
343270631Sjfv		struct i40e_aqc_query_switching_comp_bw_config_resp *bw_data,
344270631Sjfv		struct i40e_asq_cmd_details *cmd_details);
345270631Sjfvenum i40e_status_code i40e_aq_resume_port_tx(struct i40e_hw *hw,
346270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
347291248Ssmhenum i40e_status_code i40e_read_lldp_cfg(struct i40e_hw *hw,
348291248Ssmh					struct i40e_lldp_variables *lldp_cfg);
349270631Sjfvenum i40e_status_code i40e_aq_add_cloud_filters(struct i40e_hw *hw,
350270631Sjfv		u16 vsi,
351270631Sjfv		struct i40e_aqc_add_remove_cloud_filters_element_data *filters,
352270631Sjfv		u8 filter_count);
353270631Sjfv
354270631Sjfvenum i40e_status_code i40e_aq_remove_cloud_filters(struct i40e_hw *hw,
355270631Sjfv		u16 vsi,
356270631Sjfv		struct i40e_aqc_add_remove_cloud_filters_element_data *filters,
357270631Sjfv		u8 filter_count);
358270631Sjfv
359270631Sjfvenum i40e_status_code i40e_aq_alternate_read(struct i40e_hw *hw,
360270631Sjfv				u32 reg_addr0, u32 *reg_val0,
361270631Sjfv				u32 reg_addr1, u32 *reg_val1);
362270631Sjfvenum i40e_status_code i40e_aq_alternate_read_indirect(struct i40e_hw *hw,
363270631Sjfv				u32 addr, u32 dw_count, void *buffer);
364270631Sjfvenum i40e_status_code i40e_aq_alternate_write(struct i40e_hw *hw,
365270631Sjfv				u32 reg_addr0, u32 reg_val0,
366270631Sjfv				u32 reg_addr1, u32 reg_val1);
367270631Sjfvenum i40e_status_code i40e_aq_alternate_write_indirect(struct i40e_hw *hw,
368270631Sjfv				u32 addr, u32 dw_count, void *buffer);
369270631Sjfvenum i40e_status_code i40e_aq_alternate_clear(struct i40e_hw *hw);
370270631Sjfvenum i40e_status_code i40e_aq_alternate_write_done(struct i40e_hw *hw,
371270631Sjfv				u8 bios_mode, bool *reset_needed);
372270631Sjfvenum i40e_status_code i40e_aq_set_oem_mode(struct i40e_hw *hw,
373270631Sjfv				u8 oem_mode);
374270631Sjfv
375270631Sjfv/* i40e_common */
376270631Sjfvenum i40e_status_code i40e_init_shared_code(struct i40e_hw *hw);
377270631Sjfvenum i40e_status_code i40e_pf_reset(struct i40e_hw *hw);
378270631Sjfvvoid i40e_clear_hw(struct i40e_hw *hw);
379270631Sjfvvoid i40e_clear_pxe_mode(struct i40e_hw *hw);
380270631Sjfvbool i40e_get_link_status(struct i40e_hw *hw);
381270631Sjfvenum i40e_status_code i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr);
382270631Sjfvenum i40e_status_code i40e_read_bw_from_alt_ram(struct i40e_hw *hw,
383270631Sjfv		u32 *max_bw, u32 *min_bw, bool *min_valid, bool *max_valid);
384270631Sjfvenum i40e_status_code i40e_aq_configure_partition_bw(struct i40e_hw *hw,
385270631Sjfv			struct i40e_aqc_configure_partition_bw_data *bw_data,
386270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
387270631Sjfvenum i40e_status_code i40e_get_port_mac_addr(struct i40e_hw *hw, u8 *mac_addr);
388291248Ssmhenum i40e_status_code i40e_read_pba_string(struct i40e_hw *hw, u8 *pba_num,
389291248Ssmh					    u32 pba_num_size);
390270631Sjfvvoid i40e_pre_tx_queue_cfg(struct i40e_hw *hw, u32 queue, bool enable);
391270631Sjfvenum i40e_aq_link_speed i40e_get_link_speed(struct i40e_hw *hw);
392270631Sjfv/* prototype for functions used for NVM access */
393270631Sjfvenum i40e_status_code i40e_init_nvm(struct i40e_hw *hw);
394270631Sjfvenum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw,
395270631Sjfv				      enum i40e_aq_resource_access_type access);
396270631Sjfvvoid i40e_release_nvm(struct i40e_hw *hw);
397270631Sjfvenum i40e_status_code i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,
398270631Sjfv					 u16 *data);
399270631Sjfvenum i40e_status_code i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,
400270631Sjfv					   u16 *words, u16 *data);
401270631Sjfvenum i40e_status_code i40e_write_nvm_aq(struct i40e_hw *hw, u8 module,
402270631Sjfv					u32 offset, u16 words, void *data,
403270631Sjfv					bool last_command);
404270631Sjfvenum i40e_status_code i40e_write_nvm_word(struct i40e_hw *hw, u32 offset,
405270631Sjfv					  void *data);
406270631Sjfvenum i40e_status_code i40e_write_nvm_buffer(struct i40e_hw *hw, u8 module,
407270631Sjfv					    u32 offset, u16 words, void *data);
408270631Sjfvenum i40e_status_code i40e_calc_nvm_checksum(struct i40e_hw *hw, u16 *checksum);
409270631Sjfvenum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw);
410270631Sjfvenum i40e_status_code i40e_validate_nvm_checksum(struct i40e_hw *hw,
411270631Sjfv						 u16 *checksum);
412270631Sjfvenum i40e_status_code i40e_nvmupd_command(struct i40e_hw *hw,
413270631Sjfv					  struct i40e_nvm_access *cmd,
414270631Sjfv					  u8 *bytes, int *);
415270631Sjfvvoid i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status);
416270631Sjfv
417270631Sjfvenum i40e_status_code i40e_set_mac_type(struct i40e_hw *hw);
418270631Sjfv
419270631Sjfvextern struct i40e_rx_ptype_decoded i40e_ptype_lookup[];
420270631Sjfv
421270631Sjfvstatic INLINE struct i40e_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
422270631Sjfv{
423270631Sjfv	return i40e_ptype_lookup[ptype];
424270631Sjfv}
425270631Sjfv
426270631Sjfv/* prototype for functions used for SW spinlocks */
427270631Sjfvvoid i40e_init_spinlock(struct i40e_spinlock *sp);
428270631Sjfvvoid i40e_acquire_spinlock(struct i40e_spinlock *sp);
429270631Sjfvvoid i40e_release_spinlock(struct i40e_spinlock *sp);
430270631Sjfvvoid i40e_destroy_spinlock(struct i40e_spinlock *sp);
431270631Sjfv
432270631Sjfv/* i40e_common for VF drivers*/
433270631Sjfvvoid i40e_vf_parse_hw_config(struct i40e_hw *hw,
434270631Sjfv			     struct i40e_virtchnl_vf_resource *msg);
435270631Sjfvenum i40e_status_code i40e_vf_reset(struct i40e_hw *hw);
436270631Sjfvenum i40e_status_code i40e_aq_send_msg_to_pf(struct i40e_hw *hw,
437270631Sjfv				enum i40e_virtchnl_ops v_opcode,
438270631Sjfv				enum i40e_status_code v_retval,
439270631Sjfv				u8 *msg, u16 msglen,
440270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
441270631Sjfvenum i40e_status_code i40e_set_filter_control(struct i40e_hw *hw,
442270631Sjfv				struct i40e_filter_control_settings *settings);
443270631Sjfvenum i40e_status_code i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,
444270631Sjfv				u8 *mac_addr, u16 ethtype, u16 flags,
445270631Sjfv				u16 vsi_seid, u16 queue, bool is_add,
446270631Sjfv				struct i40e_control_filter_stats *stats,
447270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
448292095Ssmhenum i40e_status_code i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id,
449292095Ssmh				u8 table_id, u32 start_index, u16 buff_size,
450292095Ssmh				void *buff, u16 *ret_buff_size,
451292095Ssmh				u8 *ret_next_table, u32 *ret_next_index,
452292095Ssmh				struct i40e_asq_cmd_details *cmd_details);
453270631Sjfv#endif /* _I40E_PROTOTYPE_H_ */
454