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$*/
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);
81292100Ssmh#ifdef X722_SUPPORT
82270631Sjfv
83292100Ssmhenum i40e_status_code i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 seid,
84292100Ssmh					  bool pf_lut, u8 *lut, u16 lut_size);
85292100Ssmhenum i40e_status_code i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 seid,
86292100Ssmh					  bool pf_lut, u8 *lut, u16 lut_size);
87292100Ssmhenum i40e_status_code i40e_aq_get_rss_key(struct i40e_hw *hw,
88292100Ssmh				     u16 seid,
89292100Ssmh				     struct i40e_aqc_get_set_rss_key_data *key);
90292100Ssmhenum i40e_status_code i40e_aq_set_rss_key(struct i40e_hw *hw,
91292100Ssmh				     u16 seid,
92292100Ssmh				     struct i40e_aqc_get_set_rss_key_data *key);
93292100Ssmh#endif
94292100Ssmhchar *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err);
95292100Ssmhchar *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err);
96270631Sjfv
97292100Ssmh
98270631Sjfvu32 i40e_led_get(struct i40e_hw *hw);
99270631Sjfvvoid i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink);
100270631Sjfv
101270631Sjfv/* admin send queue commands */
102270631Sjfv
103270631Sjfvenum i40e_status_code i40e_aq_get_firmware_version(struct i40e_hw *hw,
104270631Sjfv				u16 *fw_major_version, u16 *fw_minor_version,
105291248Ssmh				u32 *fw_build,
106270631Sjfv				u16 *api_major_version, u16 *api_minor_version,
107270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
108270631Sjfvenum i40e_status_code i40e_aq_debug_write_register(struct i40e_hw *hw,
109270631Sjfv				u32 reg_addr, u64 reg_val,
110270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
111291248Ssmhenum i40e_status_code i40e_aq_debug_read_register(struct i40e_hw *hw,
112291248Ssmh				u32  reg_addr, u64 *reg_val,
113291248Ssmh				struct i40e_asq_cmd_details *cmd_details);
114270631Sjfvenum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,
115270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
116270631Sjfvenum i40e_status_code i40e_aq_set_default_vsi(struct i40e_hw *hw, u16 vsi_id,
117270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
118270631Sjfvenum i40e_status_code i40e_aq_get_phy_capabilities(struct i40e_hw *hw,
119270631Sjfv			bool qualified_modules, bool report_init,
120270631Sjfv			struct i40e_aq_get_phy_abilities_resp *abilities,
121270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
122270631Sjfvenum i40e_status_code i40e_aq_set_phy_config(struct i40e_hw *hw,
123270631Sjfv				struct i40e_aq_set_phy_config *config,
124270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
125270631Sjfvenum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,
126270631Sjfv				  bool atomic_reset);
127270631Sjfvenum i40e_status_code i40e_aq_set_phy_int_mask(struct i40e_hw *hw, u16 mask,
128270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
129270631Sjfvenum i40e_status_code i40e_aq_set_mac_config(struct i40e_hw *hw,
130270631Sjfv				u16 max_frame_size, bool crc_en, u16 pacing,
131270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
132270631Sjfvenum i40e_status_code i40e_aq_get_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_get_partner_advt(struct i40e_hw *hw,
136270631Sjfv				u64 *advt_reg,
137270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
138270631Sjfvenum i40e_status_code i40e_aq_set_lb_modes(struct i40e_hw *hw, u16 lb_modes,
139270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
140270631Sjfvenum i40e_status_code i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
141270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
142270631Sjfvenum i40e_status_code i40e_aq_set_link_restart_an(struct i40e_hw *hw,
143270631Sjfv		bool enable_link, struct i40e_asq_cmd_details *cmd_details);
144270631Sjfvenum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
145270631Sjfv				bool enable_lse, struct i40e_link_status *link,
146270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
147270631Sjfvenum i40e_status_code i40e_aq_set_local_advt_reg(struct i40e_hw *hw,
148270631Sjfv				u64 advt_reg,
149270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
150270631Sjfvenum i40e_status_code i40e_aq_send_driver_version(struct i40e_hw *hw,
151270631Sjfv				struct i40e_driver_version *dv,
152270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
153270631Sjfvenum i40e_status_code i40e_aq_add_vsi(struct i40e_hw *hw,
154270631Sjfv				struct i40e_vsi_context *vsi_ctx,
155270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
156270631Sjfvenum i40e_status_code i40e_aq_set_vsi_broadcast(struct i40e_hw *hw,
157270631Sjfv				u16 vsi_id, bool set_filter,
158270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
159270631Sjfvenum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
160270631Sjfv		u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
161270631Sjfvenum i40e_status_code i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw,
162270631Sjfv		u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
163292100Ssmhenum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw,
164292100Ssmh				u16 seid, bool enable, u16 vid,
165292100Ssmh				struct i40e_asq_cmd_details *cmd_details);
166292100Ssmhenum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,
167292100Ssmh				u16 seid, bool enable, u16 vid,
168292100Ssmh				struct i40e_asq_cmd_details *cmd_details);
169270631Sjfvenum i40e_status_code i40e_aq_get_vsi_params(struct i40e_hw *hw,
170270631Sjfv				struct i40e_vsi_context *vsi_ctx,
171270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
172270631Sjfvenum i40e_status_code i40e_aq_update_vsi_params(struct i40e_hw *hw,
173270631Sjfv				struct i40e_vsi_context *vsi_ctx,
174270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
175270631Sjfvenum i40e_status_code i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid,
176270631Sjfv				u16 downlink_seid, u8 enabled_tc,
177270631Sjfv				bool default_port, bool enable_l2_filtering,
178270631Sjfv				u16 *pveb_seid,
179270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
180270631Sjfvenum i40e_status_code i40e_aq_get_veb_parameters(struct i40e_hw *hw,
181270631Sjfv				u16 veb_seid, u16 *switch_id, bool *floating,
182270631Sjfv				u16 *statistic_index, u16 *vebs_used,
183270631Sjfv				u16 *vebs_free,
184270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
185270631Sjfvenum i40e_status_code i40e_aq_add_macvlan(struct i40e_hw *hw, u16 vsi_id,
186270631Sjfv			struct i40e_aqc_add_macvlan_element_data *mv_list,
187270631Sjfv			u16 count, struct i40e_asq_cmd_details *cmd_details);
188270631Sjfvenum i40e_status_code i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 vsi_id,
189270631Sjfv			struct i40e_aqc_remove_macvlan_element_data *mv_list,
190270631Sjfv			u16 count, struct i40e_asq_cmd_details *cmd_details);
191270631Sjfvenum i40e_status_code i40e_aq_add_vlan(struct i40e_hw *hw, u16 vsi_id,
192270631Sjfv			struct i40e_aqc_add_remove_vlan_element_data *v_list,
193270631Sjfv			u8 count, struct i40e_asq_cmd_details *cmd_details);
194270631Sjfvenum i40e_status_code i40e_aq_remove_vlan(struct i40e_hw *hw, u16 vsi_id,
195270631Sjfv			struct i40e_aqc_add_remove_vlan_element_data *v_list,
196270631Sjfv			u8 count, struct i40e_asq_cmd_details *cmd_details);
197270631Sjfvenum i40e_status_code i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid,
198270631Sjfv				u32 v_opcode, u32 v_retval, u8 *msg, u16 msglen,
199270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
200270631Sjfvenum i40e_status_code i40e_aq_get_switch_config(struct i40e_hw *hw,
201270631Sjfv				struct i40e_aqc_get_switch_config_resp *buf,
202270631Sjfv				u16 buf_size, u16 *start_seid,
203270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
204270631Sjfvenum i40e_status_code i40e_aq_request_resource(struct i40e_hw *hw,
205270631Sjfv				enum i40e_aq_resources_ids resource,
206270631Sjfv				enum i40e_aq_resource_access_type access,
207270631Sjfv				u8 sdp_number, u64 *timeout,
208270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
209270631Sjfvenum i40e_status_code i40e_aq_release_resource(struct i40e_hw *hw,
210270631Sjfv				enum i40e_aq_resources_ids resource,
211270631Sjfv				u8 sdp_number,
212270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
213270631Sjfvenum i40e_status_code i40e_aq_read_nvm(struct i40e_hw *hw, u8 module_pointer,
214270631Sjfv				u32 offset, u16 length, void *data,
215270631Sjfv				bool last_command,
216270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
217270631Sjfvenum i40e_status_code i40e_aq_erase_nvm(struct i40e_hw *hw, u8 module_pointer,
218270631Sjfv				u32 offset, u16 length, bool last_command,
219270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
220291248Ssmhenum i40e_status_code i40e_aq_read_nvm_config(struct i40e_hw *hw,
221291248Ssmh				u8 cmd_flags, u32 field_id, void *data,
222291248Ssmh				u16 buf_size, u16 *element_count,
223291248Ssmh				struct i40e_asq_cmd_details *cmd_details);
224291248Ssmhenum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw,
225291248Ssmh				u8 cmd_flags, void *data, u16 buf_size,
226291248Ssmh				u16 element_count,
227291248Ssmh				struct i40e_asq_cmd_details *cmd_details);
228292100Ssmhenum i40e_status_code i40e_aq_oem_post_update(struct i40e_hw *hw,
229292100Ssmh				void *buff, u16 buff_size,
230292100Ssmh				struct i40e_asq_cmd_details *cmd_details);
231270631Sjfvenum i40e_status_code i40e_aq_discover_capabilities(struct i40e_hw *hw,
232270631Sjfv				void *buff, u16 buff_size, u16 *data_size,
233270631Sjfv				enum i40e_admin_queue_opc list_type_opc,
234270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
235270631Sjfvenum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
236270631Sjfv				u32 offset, u16 length, void *data,
237270631Sjfv				bool last_command,
238270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
239270631Sjfvenum i40e_status_code i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type,
240270631Sjfv				u8 mib_type, void *buff, u16 buff_size,
241270631Sjfv				u16 *local_len, u16 *remote_len,
242270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
243291248Ssmhenum i40e_status_code i40e_aq_set_lldp_mib(struct i40e_hw *hw,
244291248Ssmh				u8 mib_type, void *buff, u16 buff_size,
245291248Ssmh				struct i40e_asq_cmd_details *cmd_details);
246270631Sjfvenum i40e_status_code i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw,
247270631Sjfv				bool enable_update,
248270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
249270631Sjfvenum i40e_status_code i40e_aq_add_lldp_tlv(struct i40e_hw *hw, u8 bridge_type,
250270631Sjfv				void *buff, u16 buff_size, u16 tlv_len,
251270631Sjfv				u16 *mib_len,
252270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
253270631Sjfvenum i40e_status_code i40e_aq_update_lldp_tlv(struct i40e_hw *hw,
254270631Sjfv				u8 bridge_type, void *buff, u16 buff_size,
255270631Sjfv				u16 old_len, u16 new_len, u16 offset,
256270631Sjfv				u16 *mib_len,
257270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
258270631Sjfvenum i40e_status_code i40e_aq_delete_lldp_tlv(struct i40e_hw *hw,
259270631Sjfv				u8 bridge_type, void *buff, u16 buff_size,
260270631Sjfv				u16 tlv_len, u16 *mib_len,
261270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
262270631Sjfvenum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent,
263270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
264270631Sjfvenum i40e_status_code i40e_aq_start_lldp(struct i40e_hw *hw,
265270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
266291248Ssmhenum i40e_status_code i40e_aq_get_cee_dcb_config(struct i40e_hw *hw,
267291248Ssmh				void *buff, u16 buff_size,
268291248Ssmh				struct i40e_asq_cmd_details *cmd_details);
269291248Ssmhenum i40e_status_code i40e_aq_start_stop_dcbx(struct i40e_hw *hw,
270291248Ssmh				bool start_agent,
271291248Ssmh				struct i40e_asq_cmd_details *cmd_details);
272270631Sjfvenum i40e_status_code i40e_aq_add_udp_tunnel(struct i40e_hw *hw,
273270631Sjfv				u16 udp_port, u8 protocol_index,
274270631Sjfv				u8 *filter_index,
275270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
276270631Sjfvenum i40e_status_code i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index,
277270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
278270631Sjfvenum i40e_status_code i40e_aq_get_switch_resource_alloc(struct i40e_hw *hw,
279270631Sjfv			u8 *num_entries,
280270631Sjfv			struct i40e_aqc_switch_resource_alloc_element_resp *buf,
281270631Sjfv			u16 count,
282270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
283270631Sjfvenum i40e_status_code i40e_aq_add_pvirt(struct i40e_hw *hw, u16 flags,
284270631Sjfv				       u16 mac_seid, u16 vsi_seid,
285270631Sjfv				       u16 *ret_seid);
286270631Sjfvenum i40e_status_code i40e_aq_add_tag(struct i40e_hw *hw, bool direct_to_queue,
287270631Sjfv				u16 vsi_seid, u16 tag, u16 queue_num,
288270631Sjfv				u16 *tags_used, u16 *tags_free,
289270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
290270631Sjfvenum i40e_status_code i40e_aq_remove_tag(struct i40e_hw *hw, u16 vsi_seid,
291270631Sjfv				u16 tag, u16 *tags_used, u16 *tags_free,
292270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
293270631Sjfvenum i40e_status_code i40e_aq_add_mcast_etag(struct i40e_hw *hw, u16 pe_seid,
294270631Sjfv				u16 etag, u8 num_tags_in_buf, void *buf,
295270631Sjfv				u16 *tags_used, u16 *tags_free,
296270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
297270631Sjfvenum i40e_status_code i40e_aq_remove_mcast_etag(struct i40e_hw *hw, u16 pe_seid,
298270631Sjfv				u16 etag, u16 *tags_used, u16 *tags_free,
299270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
300270631Sjfvenum i40e_status_code i40e_aq_update_tag(struct i40e_hw *hw, u16 vsi_seid,
301270631Sjfv				u16 old_tag, u16 new_tag, u16 *tags_used,
302270631Sjfv				u16 *tags_free,
303270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
304270631Sjfvenum i40e_status_code i40e_aq_add_statistics(struct i40e_hw *hw, u16 seid,
305270631Sjfv				u16 vlan_id, u16 *stat_index,
306270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
307270631Sjfvenum i40e_status_code i40e_aq_remove_statistics(struct i40e_hw *hw, u16 seid,
308270631Sjfv				u16 vlan_id, u16 stat_index,
309270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
310270631Sjfvenum i40e_status_code i40e_aq_set_port_parameters(struct i40e_hw *hw,
311270631Sjfv				u16 bad_frame_vsi, bool save_bad_pac,
312270631Sjfv				bool pad_short_pac, bool double_vlan,
313270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
314270631Sjfvenum i40e_status_code i40e_aq_delete_element(struct i40e_hw *hw, u16 seid,
315270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
316270631Sjfvenum i40e_status_code i40e_aq_mac_address_write(struct i40e_hw *hw,
317270631Sjfv				    u16 flags, u8 *mac_addr,
318270631Sjfv				    struct i40e_asq_cmd_details *cmd_details);
319270631Sjfvenum i40e_status_code i40e_aq_config_vsi_bw_limit(struct i40e_hw *hw,
320270631Sjfv				u16 seid, u16 credit, u8 max_credit,
321270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
322270631Sjfvenum i40e_status_code i40e_aq_dcb_ignore_pfc(struct i40e_hw *hw,
323270631Sjfv				u8 tcmap, bool request, u8 *tcmap_ret,
324270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
325270631Sjfvenum i40e_status_code i40e_aq_get_hmc_resource_profile(struct i40e_hw *hw,
326270631Sjfv				enum i40e_aq_hmc_profile *profile,
327270631Sjfv				u8 *pe_vf_enabled_count,
328270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
329270631Sjfvenum i40e_status_code i40e_aq_config_switch_comp_ets_bw_limit(
330270631Sjfv	struct i40e_hw *hw, u16 seid,
331270631Sjfv	struct i40e_aqc_configure_switching_comp_ets_bw_limit_data *bw_data,
332270631Sjfv	struct i40e_asq_cmd_details *cmd_details);
333270631Sjfvenum i40e_status_code i40e_aq_config_vsi_ets_sla_bw_limit(struct i40e_hw *hw,
334270631Sjfv			u16 seid,
335270631Sjfv			struct i40e_aqc_configure_vsi_ets_sla_bw_data *bw_data,
336270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
337270631Sjfvenum i40e_status_code i40e_aq_dcb_updated(struct i40e_hw *hw,
338270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
339270631Sjfvenum i40e_status_code i40e_aq_set_hmc_resource_profile(struct i40e_hw *hw,
340270631Sjfv				enum i40e_aq_hmc_profile profile,
341270631Sjfv				u8 pe_vf_enabled_count,
342270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
343270631Sjfvenum i40e_status_code i40e_aq_config_switch_comp_bw_limit(struct i40e_hw *hw,
344270631Sjfv				u16 seid, u16 credit, u8 max_bw,
345270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
346270631Sjfvenum i40e_status_code i40e_aq_config_vsi_tc_bw(struct i40e_hw *hw, u16 seid,
347270631Sjfv			struct i40e_aqc_configure_vsi_tc_bw_data *bw_data,
348270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
349270631Sjfvenum i40e_status_code i40e_aq_query_vsi_bw_config(struct i40e_hw *hw,
350270631Sjfv			u16 seid,
351270631Sjfv			struct i40e_aqc_query_vsi_bw_config_resp *bw_data,
352270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
353270631Sjfvenum i40e_status_code i40e_aq_query_vsi_ets_sla_config(struct i40e_hw *hw,
354270631Sjfv			u16 seid,
355270631Sjfv			struct i40e_aqc_query_vsi_ets_sla_config_resp *bw_data,
356270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
357270631Sjfvenum i40e_status_code i40e_aq_query_switch_comp_ets_config(struct i40e_hw *hw,
358270631Sjfv		u16 seid,
359270631Sjfv		struct i40e_aqc_query_switching_comp_ets_config_resp *bw_data,
360270631Sjfv		struct i40e_asq_cmd_details *cmd_details);
361270631Sjfvenum i40e_status_code i40e_aq_query_port_ets_config(struct i40e_hw *hw,
362270631Sjfv		u16 seid,
363270631Sjfv		struct i40e_aqc_query_port_ets_config_resp *bw_data,
364270631Sjfv		struct i40e_asq_cmd_details *cmd_details);
365270631Sjfvenum i40e_status_code i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw,
366270631Sjfv		u16 seid,
367270631Sjfv		struct i40e_aqc_query_switching_comp_bw_config_resp *bw_data,
368270631Sjfv		struct i40e_asq_cmd_details *cmd_details);
369270631Sjfvenum i40e_status_code i40e_aq_resume_port_tx(struct i40e_hw *hw,
370270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
371291248Ssmhenum i40e_status_code i40e_read_lldp_cfg(struct i40e_hw *hw,
372291248Ssmh					struct i40e_lldp_variables *lldp_cfg);
373270631Sjfvenum i40e_status_code i40e_aq_add_cloud_filters(struct i40e_hw *hw,
374270631Sjfv		u16 vsi,
375270631Sjfv		struct i40e_aqc_add_remove_cloud_filters_element_data *filters,
376270631Sjfv		u8 filter_count);
377270631Sjfv
378270631Sjfvenum i40e_status_code i40e_aq_remove_cloud_filters(struct i40e_hw *hw,
379270631Sjfv		u16 vsi,
380270631Sjfv		struct i40e_aqc_add_remove_cloud_filters_element_data *filters,
381270631Sjfv		u8 filter_count);
382270631Sjfv
383270631Sjfvenum i40e_status_code i40e_aq_alternate_read(struct i40e_hw *hw,
384270631Sjfv				u32 reg_addr0, u32 *reg_val0,
385270631Sjfv				u32 reg_addr1, u32 *reg_val1);
386270631Sjfvenum i40e_status_code i40e_aq_alternate_read_indirect(struct i40e_hw *hw,
387270631Sjfv				u32 addr, u32 dw_count, void *buffer);
388270631Sjfvenum i40e_status_code i40e_aq_alternate_write(struct i40e_hw *hw,
389270631Sjfv				u32 reg_addr0, u32 reg_val0,
390270631Sjfv				u32 reg_addr1, u32 reg_val1);
391270631Sjfvenum i40e_status_code i40e_aq_alternate_write_indirect(struct i40e_hw *hw,
392270631Sjfv				u32 addr, u32 dw_count, void *buffer);
393270631Sjfvenum i40e_status_code i40e_aq_alternate_clear(struct i40e_hw *hw);
394270631Sjfvenum i40e_status_code i40e_aq_alternate_write_done(struct i40e_hw *hw,
395270631Sjfv				u8 bios_mode, bool *reset_needed);
396270631Sjfvenum i40e_status_code i40e_aq_set_oem_mode(struct i40e_hw *hw,
397270631Sjfv				u8 oem_mode);
398270631Sjfv
399270631Sjfv/* i40e_common */
400270631Sjfvenum i40e_status_code i40e_init_shared_code(struct i40e_hw *hw);
401270631Sjfvenum i40e_status_code i40e_pf_reset(struct i40e_hw *hw);
402270631Sjfvvoid i40e_clear_hw(struct i40e_hw *hw);
403270631Sjfvvoid i40e_clear_pxe_mode(struct i40e_hw *hw);
404292100Ssmhenum i40e_status_code i40e_get_link_status(struct i40e_hw *hw, bool *link_up);
405292100Ssmhenum i40e_status_code i40e_update_link_info(struct i40e_hw *hw);
406270631Sjfvenum i40e_status_code i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr);
407270631Sjfvenum i40e_status_code i40e_read_bw_from_alt_ram(struct i40e_hw *hw,
408270631Sjfv		u32 *max_bw, u32 *min_bw, bool *min_valid, bool *max_valid);
409270631Sjfvenum i40e_status_code i40e_aq_configure_partition_bw(struct i40e_hw *hw,
410270631Sjfv			struct i40e_aqc_configure_partition_bw_data *bw_data,
411270631Sjfv			struct i40e_asq_cmd_details *cmd_details);
412270631Sjfvenum i40e_status_code i40e_get_port_mac_addr(struct i40e_hw *hw, u8 *mac_addr);
413291248Ssmhenum i40e_status_code i40e_read_pba_string(struct i40e_hw *hw, u8 *pba_num,
414291248Ssmh					    u32 pba_num_size);
415270631Sjfvvoid i40e_pre_tx_queue_cfg(struct i40e_hw *hw, u32 queue, bool enable);
416270631Sjfvenum i40e_aq_link_speed i40e_get_link_speed(struct i40e_hw *hw);
417270631Sjfv/* prototype for functions used for NVM access */
418270631Sjfvenum i40e_status_code i40e_init_nvm(struct i40e_hw *hw);
419270631Sjfvenum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw,
420270631Sjfv				      enum i40e_aq_resource_access_type access);
421270631Sjfvvoid i40e_release_nvm(struct i40e_hw *hw);
422270631Sjfvenum i40e_status_code i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,
423270631Sjfv					 u16 *data);
424270631Sjfvenum i40e_status_code i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,
425270631Sjfv					   u16 *words, u16 *data);
426270631Sjfvenum i40e_status_code i40e_write_nvm_aq(struct i40e_hw *hw, u8 module,
427270631Sjfv					u32 offset, u16 words, void *data,
428270631Sjfv					bool last_command);
429270631Sjfvenum i40e_status_code i40e_write_nvm_word(struct i40e_hw *hw, u32 offset,
430270631Sjfv					  void *data);
431270631Sjfvenum i40e_status_code i40e_write_nvm_buffer(struct i40e_hw *hw, u8 module,
432270631Sjfv					    u32 offset, u16 words, void *data);
433270631Sjfvenum i40e_status_code i40e_calc_nvm_checksum(struct i40e_hw *hw, u16 *checksum);
434270631Sjfvenum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw);
435270631Sjfvenum i40e_status_code i40e_validate_nvm_checksum(struct i40e_hw *hw,
436270631Sjfv						 u16 *checksum);
437270631Sjfvenum i40e_status_code i40e_nvmupd_command(struct i40e_hw *hw,
438270631Sjfv					  struct i40e_nvm_access *cmd,
439270631Sjfv					  u8 *bytes, int *);
440270631Sjfvvoid i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status);
441270631Sjfv
442270631Sjfvenum i40e_status_code i40e_set_mac_type(struct i40e_hw *hw);
443270631Sjfv
444270631Sjfvextern struct i40e_rx_ptype_decoded i40e_ptype_lookup[];
445270631Sjfv
446270631Sjfvstatic INLINE struct i40e_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
447270631Sjfv{
448270631Sjfv	return i40e_ptype_lookup[ptype];
449270631Sjfv}
450270631Sjfv
451270631Sjfv/* prototype for functions used for SW spinlocks */
452270631Sjfvvoid i40e_init_spinlock(struct i40e_spinlock *sp);
453270631Sjfvvoid i40e_acquire_spinlock(struct i40e_spinlock *sp);
454270631Sjfvvoid i40e_release_spinlock(struct i40e_spinlock *sp);
455270631Sjfvvoid i40e_destroy_spinlock(struct i40e_spinlock *sp);
456270631Sjfv
457270631Sjfv/* i40e_common for VF drivers*/
458270631Sjfvvoid i40e_vf_parse_hw_config(struct i40e_hw *hw,
459270631Sjfv			     struct i40e_virtchnl_vf_resource *msg);
460270631Sjfvenum i40e_status_code i40e_vf_reset(struct i40e_hw *hw);
461270631Sjfvenum i40e_status_code i40e_aq_send_msg_to_pf(struct i40e_hw *hw,
462270631Sjfv				enum i40e_virtchnl_ops v_opcode,
463270631Sjfv				enum i40e_status_code v_retval,
464270631Sjfv				u8 *msg, u16 msglen,
465270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
466270631Sjfvenum i40e_status_code i40e_set_filter_control(struct i40e_hw *hw,
467270631Sjfv				struct i40e_filter_control_settings *settings);
468270631Sjfvenum i40e_status_code i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,
469270631Sjfv				u8 *mac_addr, u16 ethtype, u16 flags,
470270631Sjfv				u16 vsi_seid, u16 queue, bool is_add,
471270631Sjfv				struct i40e_control_filter_stats *stats,
472270631Sjfv				struct i40e_asq_cmd_details *cmd_details);
473292100Ssmhenum i40e_status_code i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id,
474292100Ssmh				u8 table_id, u32 start_index, u16 buff_size,
475292100Ssmh				void *buff, u16 *ret_buff_size,
476292100Ssmh				u8 *ret_next_table, u32 *ret_next_index,
477292100Ssmh				struct i40e_asq_cmd_details *cmd_details);
478270631Sjfv#endif /* _I40E_PROTOTYPE_H_ */
479