Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/i40e_prototype.h
/****************************************************************************** | /****************************************************************************** | ||||
Copyright (c) 2013-2015, Intel Corporation | Copyright (c) 2013-2017, Intel Corporation | ||||
All rights reserved. | All rights reserved. | ||||
Redistribution and use in source and binary forms, with or without | Redistribution and use in source and binary forms, with or without | ||||
modification, are permitted provided that the following conditions are met: | modification, are permitted provided that the following conditions are met: | ||||
1. Redistributions of source code must retain the above copyright notice, | 1. Redistributions of source code must retain the above copyright notice, | ||||
this list of conditions and the following disclaimer. | this list of conditions and the following disclaimer. | ||||
Show All 20 Lines | |||||
******************************************************************************/ | ******************************************************************************/ | ||||
/*$FreeBSD$*/ | /*$FreeBSD$*/ | ||||
#ifndef _I40E_PROTOTYPE_H_ | #ifndef _I40E_PROTOTYPE_H_ | ||||
#define _I40E_PROTOTYPE_H_ | #define _I40E_PROTOTYPE_H_ | ||||
#include "i40e_type.h" | #include "i40e_type.h" | ||||
#include "i40e_alloc.h" | #include "i40e_alloc.h" | ||||
#include "i40e_virtchnl.h" | #include "virtchnl.h" | ||||
/* Prototypes for shared code functions that are not in | /* Prototypes for shared code functions that are not in | ||||
* the standard function pointer structures. These are | * the standard function pointer structures. These are | ||||
* mostly because they are needed even before the init | * mostly because they are needed even before the init | ||||
* has happened and will assist in the early SW and FW | * has happened and will assist in the early SW and FW | ||||
* setup. | * setup. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | enum i40e_status_code i40e_aq_set_mac_config(struct i40e_hw *hw, | ||||
u16 max_frame_size, bool crc_en, u16 pacing, | u16 max_frame_size, bool crc_en, u16 pacing, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_get_local_advt_reg(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_get_local_advt_reg(struct i40e_hw *hw, | ||||
u64 *advt_reg, | u64 *advt_reg, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_get_partner_advt(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_get_partner_advt(struct i40e_hw *hw, | ||||
u64 *advt_reg, | u64 *advt_reg, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_set_lb_modes(struct i40e_hw *hw, u16 lb_modes, | enum i40e_status_code | ||||
i40e_aq_set_lb_modes(struct i40e_hw *hw, u8 lb_level, u8 lb_type, u8 speed, | |||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_clear_pxe_mode(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_clear_pxe_mode(struct i40e_hw *hw, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_set_link_restart_an(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_set_link_restart_an(struct i40e_hw *hw, | ||||
bool enable_link, struct i40e_asq_cmd_details *cmd_details); | bool enable_link, struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw, | ||||
bool enable_lse, struct i40e_link_status *link, | bool enable_lse, struct i40e_link_status *link, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_set_local_advt_reg(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_set_local_advt_reg(struct i40e_hw *hw, | ||||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | |||||
enum i40e_status_code i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid, | enum i40e_status_code i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid, | ||||
u32 v_opcode, u32 v_retval, u8 *msg, u16 msglen, | u32 v_opcode, u32 v_retval, u8 *msg, u16 msglen, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_get_switch_config(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_get_switch_config(struct i40e_hw *hw, | ||||
struct i40e_aqc_get_switch_config_resp *buf, | struct i40e_aqc_get_switch_config_resp *buf, | ||||
u16 buf_size, u16 *start_seid, | u16 buf_size, u16 *start_seid, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw, | ||||
u16 flags, u16 valid_flags, | u16 flags, u16 valid_flags, u8 mode, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_request_resource(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_request_resource(struct i40e_hw *hw, | ||||
enum i40e_aq_resources_ids resource, | enum i40e_aq_resources_ids resource, | ||||
enum i40e_aq_resource_access_type access, | enum i40e_aq_resource_access_type access, | ||||
u8 sdp_number, u64 *timeout, | u8 sdp_number, u64 *timeout, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_release_resource(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_release_resource(struct i40e_hw *hw, | ||||
enum i40e_aq_resources_ids resource, | enum i40e_aq_resources_ids resource, | ||||
Show All 18 Lines | enum i40e_status_code i40e_aq_oem_post_update(struct i40e_hw *hw, | ||||
void *buff, u16 buff_size, | void *buff, u16 buff_size, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_discover_capabilities(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_discover_capabilities(struct i40e_hw *hw, | ||||
void *buff, u16 buff_size, u16 *data_size, | void *buff, u16 buff_size, u16 *data_size, | ||||
enum i40e_admin_queue_opc list_type_opc, | enum i40e_admin_queue_opc list_type_opc, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer, | enum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer, | ||||
u32 offset, u16 length, void *data, | u32 offset, u16 length, void *data, | ||||
bool last_command, | bool last_command, u8 preservation_flags, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress, | |||||
struct i40e_asq_cmd_details *cmd_details); | |||||
enum i40e_status_code i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type, | enum i40e_status_code i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type, | ||||
u8 mib_type, void *buff, u16 buff_size, | u8 mib_type, void *buff, u16 buff_size, | ||||
u16 *local_len, u16 *remote_len, | u16 *local_len, u16 *remote_len, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_set_lldp_mib(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_set_lldp_mib(struct i40e_hw *hw, | ||||
u8 mib_type, void *buff, u16 buff_size, | u8 mib_type, void *buff, u16 buff_size, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw, | ||||
Show All 9 Lines | enum i40e_status_code i40e_aq_update_lldp_tlv(struct i40e_hw *hw, | ||||
u16 *mib_len, | u16 *mib_len, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_delete_lldp_tlv(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_delete_lldp_tlv(struct i40e_hw *hw, | ||||
u8 bridge_type, void *buff, u16 buff_size, | u8 bridge_type, void *buff, u16 buff_size, | ||||
u16 tlv_len, u16 *mib_len, | u16 tlv_len, u16 *mib_len, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent, | enum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_set_dcb_parameters(struct i40e_hw *hw, | |||||
bool dcb_enable, | |||||
struct i40e_asq_cmd_details | |||||
*cmd_details); | |||||
enum i40e_status_code i40e_aq_start_lldp(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_start_lldp(struct i40e_hw *hw, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_get_cee_dcb_config(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_get_cee_dcb_config(struct i40e_hw *hw, | ||||
void *buff, u16 buff_size, | void *buff, u16 buff_size, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_start_stop_dcbx(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_start_stop_dcbx(struct i40e_hw *hw, | ||||
bool start_agent, | bool start_agent, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
▲ Show 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | enum i40e_status_code __i40e_write_nvm_buffer(struct i40e_hw *hw, u8 module, | ||||
u32 offset, u16 words, void *data); | u32 offset, u16 words, void *data); | ||||
enum i40e_status_code i40e_calc_nvm_checksum(struct i40e_hw *hw, u16 *checksum); | enum i40e_status_code i40e_calc_nvm_checksum(struct i40e_hw *hw, u16 *checksum); | ||||
enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw); | enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw); | ||||
enum i40e_status_code i40e_validate_nvm_checksum(struct i40e_hw *hw, | enum i40e_status_code i40e_validate_nvm_checksum(struct i40e_hw *hw, | ||||
u16 *checksum); | u16 *checksum); | ||||
enum i40e_status_code i40e_nvmupd_command(struct i40e_hw *hw, | enum i40e_status_code i40e_nvmupd_command(struct i40e_hw *hw, | ||||
struct i40e_nvm_access *cmd, | struct i40e_nvm_access *cmd, | ||||
u8 *bytes, int *); | u8 *bytes, int *); | ||||
void i40e_nvmupd_check_wait_event(struct i40e_hw *hw, u16 opcode); | void i40e_nvmupd_check_wait_event(struct i40e_hw *hw, u16 opcode, | ||||
struct i40e_aq_desc *desc); | |||||
void i40e_nvmupd_clear_wait_state(struct i40e_hw *hw); | |||||
void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status); | void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status); | ||||
enum i40e_status_code i40e_set_mac_type(struct i40e_hw *hw); | enum i40e_status_code i40e_set_mac_type(struct i40e_hw *hw); | ||||
extern struct i40e_rx_ptype_decoded i40e_ptype_lookup[]; | extern struct i40e_rx_ptype_decoded i40e_ptype_lookup[]; | ||||
static INLINE struct i40e_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype) | static INLINE struct i40e_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype) | ||||
{ | { | ||||
return i40e_ptype_lookup[ptype]; | return i40e_ptype_lookup[ptype]; | ||||
} | } | ||||
/** | |||||
* i40e_virtchnl_link_speed - Convert AdminQ link_speed to virtchnl definition | |||||
* @link_speed: the speed to convert | |||||
* | |||||
* Returns the link_speed in terms of the virtchnl interface, for use in | |||||
* converting link_speed as reported by the AdminQ into the format used for | |||||
* talking to virtchnl devices. If we can't represent the link speed properly, | |||||
* report LINK_SPEED_UNKNOWN. | |||||
**/ | |||||
static INLINE enum virtchnl_link_speed | |||||
i40e_virtchnl_link_speed(enum i40e_aq_link_speed link_speed) | |||||
{ | |||||
switch (link_speed) { | |||||
case I40E_LINK_SPEED_100MB: | |||||
return VIRTCHNL_LINK_SPEED_100MB; | |||||
case I40E_LINK_SPEED_1GB: | |||||
return VIRTCHNL_LINK_SPEED_1GB; | |||||
case I40E_LINK_SPEED_10GB: | |||||
return VIRTCHNL_LINK_SPEED_10GB; | |||||
case I40E_LINK_SPEED_40GB: | |||||
return VIRTCHNL_LINK_SPEED_40GB; | |||||
case I40E_LINK_SPEED_20GB: | |||||
return VIRTCHNL_LINK_SPEED_20GB; | |||||
case I40E_LINK_SPEED_25GB: | |||||
return VIRTCHNL_LINK_SPEED_25GB; | |||||
case I40E_LINK_SPEED_UNKNOWN: | |||||
default: | |||||
return VIRTCHNL_LINK_SPEED_UNKNOWN; | |||||
} | |||||
} | |||||
/* prototype for functions used for SW spinlocks */ | /* prototype for functions used for SW spinlocks */ | ||||
void i40e_init_spinlock(struct i40e_spinlock *sp); | void i40e_init_spinlock(struct i40e_spinlock *sp); | ||||
void i40e_acquire_spinlock(struct i40e_spinlock *sp); | void i40e_acquire_spinlock(struct i40e_spinlock *sp); | ||||
void i40e_release_spinlock(struct i40e_spinlock *sp); | void i40e_release_spinlock(struct i40e_spinlock *sp); | ||||
void i40e_destroy_spinlock(struct i40e_spinlock *sp); | void i40e_destroy_spinlock(struct i40e_spinlock *sp); | ||||
/* i40e_common for VF drivers*/ | /* i40e_common for VF drivers*/ | ||||
void i40e_vf_parse_hw_config(struct i40e_hw *hw, | void i40e_vf_parse_hw_config(struct i40e_hw *hw, | ||||
struct i40e_virtchnl_vf_resource *msg); | struct virtchnl_vf_resource *msg); | ||||
enum i40e_status_code i40e_vf_reset(struct i40e_hw *hw); | enum i40e_status_code i40e_vf_reset(struct i40e_hw *hw); | ||||
enum i40e_status_code i40e_aq_send_msg_to_pf(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_send_msg_to_pf(struct i40e_hw *hw, | ||||
enum i40e_virtchnl_ops v_opcode, | enum virtchnl_ops v_opcode, | ||||
enum i40e_status_code v_retval, | enum i40e_status_code v_retval, | ||||
u8 *msg, u16 msglen, | u8 *msg, u16 msglen, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_set_filter_control(struct i40e_hw *hw, | enum i40e_status_code i40e_set_filter_control(struct i40e_hw *hw, | ||||
struct i40e_filter_control_settings *settings); | struct i40e_filter_control_settings *settings); | ||||
enum i40e_status_code i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw, | ||||
u8 *mac_addr, u16 ethtype, u16 flags, | u8 *mac_addr, u16 ethtype, u16 flags, | ||||
u16 vsi_seid, u16 queue, bool is_add, | u16 vsi_seid, u16 queue, bool is_add, | ||||
Show All 9 Lines | |||||
enum i40e_status_code i40e_aq_rx_ctl_read_register(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_rx_ctl_read_register(struct i40e_hw *hw, | ||||
u32 reg_addr, u32 *reg_val, | u32 reg_addr, u32 *reg_val, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
u32 i40e_read_rx_ctl(struct i40e_hw *hw, u32 reg_addr); | u32 i40e_read_rx_ctl(struct i40e_hw *hw, u32 reg_addr); | ||||
enum i40e_status_code i40e_aq_rx_ctl_write_register(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_rx_ctl_write_register(struct i40e_hw *hw, | ||||
u32 reg_addr, u32 reg_val, | u32 reg_addr, u32 reg_val, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
void i40e_write_rx_ctl(struct i40e_hw *hw, u32 reg_addr, u32 reg_val); | void i40e_write_rx_ctl(struct i40e_hw *hw, u32 reg_addr, u32 reg_val); | ||||
enum i40e_status_code i40e_aq_set_phy_register(struct i40e_hw *hw, | |||||
u8 phy_select, u8 dev_addr, | |||||
u32 reg_addr, u32 reg_val, | |||||
struct i40e_asq_cmd_details *cmd_details); | |||||
enum i40e_status_code i40e_aq_get_phy_register(struct i40e_hw *hw, | |||||
u8 phy_select, u8 dev_addr, | |||||
u32 reg_addr, u32 *reg_val, | |||||
struct i40e_asq_cmd_details *cmd_details); | |||||
enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw, | ||||
struct i40e_aqc_arp_proxy_data *proxy_config, | struct i40e_aqc_arp_proxy_data *proxy_config, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_set_ns_proxy_table_entry(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_set_ns_proxy_table_entry(struct i40e_hw *hw, | ||||
struct i40e_aqc_ns_proxy_data *ns_proxy_table_entry, | struct i40e_aqc_ns_proxy_data *ns_proxy_table_entry, | ||||
struct i40e_asq_cmd_details *cmd_details); | struct i40e_asq_cmd_details *cmd_details); | ||||
enum i40e_status_code i40e_aq_set_clear_wol_filter(struct i40e_hw *hw, | enum i40e_status_code i40e_aq_set_clear_wol_filter(struct i40e_hw *hw, | ||||
u8 filter_index, | u8 filter_index, | ||||
Show All 23 Lines |