Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/ixl_pf.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 29 Lines | |||||
#define VF_FLAG_ENABLED 0x01 | #define VF_FLAG_ENABLED 0x01 | ||||
#define VF_FLAG_SET_MAC_CAP 0x02 | #define VF_FLAG_SET_MAC_CAP 0x02 | ||||
#define VF_FLAG_VLAN_CAP 0x04 | #define VF_FLAG_VLAN_CAP 0x04 | ||||
#define VF_FLAG_PROMISC_CAP 0x08 | #define VF_FLAG_PROMISC_CAP 0x08 | ||||
#define VF_FLAG_MAC_ANTI_SPOOF 0x10 | #define VF_FLAG_MAC_ANTI_SPOOF 0x10 | ||||
#define IXL_PF_STATE_EMPR_RESETTING (1 << 0) | #define IXL_PF_STATE_EMPR_RESETTING (1 << 0) | ||||
#define IXL_PF_STATE_FW_LLDP_DISABLED (1 << 1) | |||||
struct ixl_vf { | struct ixl_vf { | ||||
struct ixl_vsi vsi; | struct ixl_vsi vsi; | ||||
uint32_t vf_flags; | uint32_t vf_flags; | ||||
uint8_t mac[ETHER_ADDR_LEN]; | uint8_t mac[ETHER_ADDR_LEN]; | ||||
uint16_t vf_num; | uint16_t vf_num; | ||||
uint32_t version; | uint32_t version; | ||||
Show All 32 Lines | #endif | ||||
u8 supported_speeds; | u8 supported_speeds; | ||||
struct ixl_pf_qmgr qmgr; | struct ixl_pf_qmgr qmgr; | ||||
struct ixl_pf_qtag qtag; | struct ixl_pf_qtag qtag; | ||||
/* Tunable values */ | /* Tunable values */ | ||||
bool enable_msix; | bool enable_msix; | ||||
int max_queues; | int max_queues; | ||||
int ringsz; | |||||
bool enable_tx_fc_filter; | bool enable_tx_fc_filter; | ||||
int dynamic_rx_itr; | int dynamic_rx_itr; | ||||
int dynamic_tx_itr; | int dynamic_tx_itr; | ||||
int tx_itr; | int tx_itr; | ||||
int rx_itr; | int rx_itr; | ||||
struct mtx pf_mtx; | struct mtx pf_mtx; | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
"\t 0x2 - advertise 1G\n" \ | "\t 0x2 - advertise 1G\n" \ | ||||
"\t 0x4 - advertise 10G\n" \ | "\t 0x4 - advertise 10G\n" \ | ||||
"\t 0x8 - advertise 20G\n" \ | "\t 0x8 - advertise 20G\n" \ | ||||
"\t0x10 - advertise 25G\n" \ | "\t0x10 - advertise 25G\n" \ | ||||
"\t0x20 - advertise 40G\n\n" \ | "\t0x20 - advertise 40G\n\n" \ | ||||
"Set to 0 to disable link.\n" \ | "Set to 0 to disable link.\n" \ | ||||
"Use \"sysctl -x\" to view flags properly." | "Use \"sysctl -x\" to view flags properly." | ||||
#define IXL_SYSCTL_HELP_SUPPORTED_SPEED \ | |||||
"\nSupported link speeds.\n" \ | |||||
"Flags:\n" \ | |||||
"\t 0x1 - 100M\n" \ | |||||
"\t 0x2 - 1G\n" \ | |||||
"\t 0x4 - 10G\n" \ | |||||
"\t 0x8 - 20G\n" \ | |||||
"\t0x10 - 25G\n" \ | |||||
"\t0x20 - 40G\n\n" \ | |||||
"Use \"sysctl -x\" to view flags properly." | |||||
#define IXL_SYSCTL_HELP_FC \ | #define IXL_SYSCTL_HELP_FC \ | ||||
"\nSet flow control mode using the values below.\n" \ | "\nSet flow control mode using the values below.\n" \ | ||||
"\t0 - off\n" \ | "\t0 - off\n" \ | ||||
"\t1 - rx pause\n" \ | "\t1 - rx pause\n" \ | ||||
"\t2 - tx pause\n" \ | "\t2 - tx pause\n" \ | ||||
"\t3 - tx and rx pause" | "\t3 - tx and rx pause" | ||||
#define IXL_SYSCTL_HELP_LINK_STATUS \ | #define IXL_SYSCTL_HELP_LINK_STATUS \ | ||||
"\nExecutes a \"Get Link Status\" command on the Admin Queue, and displays" \ | "\nExecutes a \"Get Link Status\" command on the Admin Queue, and displays" \ | ||||
" the response." \ | " the response." \ | ||||
#define IXL_SYSCTL_HELP_FW_LLDP \ | |||||
"\nFW LLDP engine:\n" \ | |||||
"\t0 - disable\n" \ | |||||
"\t1 - enable\n" | |||||
extern const char * const ixl_fc_string[6]; | extern const char * const ixl_fc_string[6]; | ||||
MALLOC_DECLARE(M_IXL); | MALLOC_DECLARE(M_IXL); | ||||
/*** Functions / Macros ***/ | /*** Functions / Macros ***/ | ||||
/* Adjust the level here to 10 or over to print stats messages */ | /* Adjust the level here to 10 or over to print stats messages */ | ||||
#define I40E_VC_DEBUG(p, level, ...) \ | #define I40E_VC_DEBUG(p, level, ...) \ | ||||
do { \ | do { \ | ||||
Show All 20 Lines | |||||
/* For netmap(4) compatibility */ | /* For netmap(4) compatibility */ | ||||
#define ixl_disable_intr(vsi) ixl_disable_rings_intr(vsi) | #define ixl_disable_intr(vsi) ixl_disable_rings_intr(vsi) | ||||
/* | /* | ||||
* PF-only function declarations | * PF-only function declarations | ||||
*/ | */ | ||||
void ixl_set_busmaster(device_t); | |||||
void ixl_set_msix_enable(device_t); | |||||
int ixl_setup_interface(device_t, struct ixl_vsi *); | int ixl_setup_interface(device_t, struct ixl_vsi *); | ||||
void ixl_print_nvm_cmd(device_t, struct i40e_nvm_access *); | void ixl_print_nvm_cmd(device_t, struct i40e_nvm_access *); | ||||
char * ixl_aq_speed_to_str(enum i40e_aq_link_speed); | char * ixl_aq_speed_to_str(enum i40e_aq_link_speed); | ||||
void ixl_handle_que(void *context, int pending); | void ixl_handle_que(void *context, int pending); | ||||
void ixl_init(void *); | void ixl_init(void *); | ||||
void ixl_local_timer(void *); | void ixl_local_timer(void *); | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
void ixl_free_adminq_tq(struct ixl_pf *); | void ixl_free_adminq_tq(struct ixl_pf *); | ||||
int ixl_setup_legacy(struct ixl_pf *); | int ixl_setup_legacy(struct ixl_pf *); | ||||
int ixl_init_msix(struct ixl_pf *); | int ixl_init_msix(struct ixl_pf *); | ||||
void ixl_configure_itr(struct ixl_pf *); | void ixl_configure_itr(struct ixl_pf *); | ||||
void ixl_configure_legacy(struct ixl_pf *); | void ixl_configure_legacy(struct ixl_pf *); | ||||
void ixl_free_pci_resources(struct ixl_pf *); | void ixl_free_pci_resources(struct ixl_pf *); | ||||
void ixl_link_event(struct ixl_pf *, struct i40e_arq_event_info *); | void ixl_link_event(struct ixl_pf *, struct i40e_arq_event_info *); | ||||
void ixl_config_rss(struct ixl_pf *); | void ixl_config_rss(struct ixl_pf *); | ||||
int ixl_set_advertised_speeds(struct ixl_pf *, int); | int ixl_set_advertised_speeds(struct ixl_pf *, int, bool); | ||||
void ixl_get_initial_advertised_speeds(struct ixl_pf *); | void ixl_set_initial_advertised_speeds(struct ixl_pf *); | ||||
void ixl_print_nvm_version(struct ixl_pf *pf); | void ixl_print_nvm_version(struct ixl_pf *pf); | ||||
void ixl_add_device_sysctls(struct ixl_pf *); | void ixl_add_device_sysctls(struct ixl_pf *); | ||||
void ixl_handle_mdd_event(struct ixl_pf *); | void ixl_handle_mdd_event(struct ixl_pf *); | ||||
void ixl_add_hw_stats(struct ixl_pf *); | void ixl_add_hw_stats(struct ixl_pf *); | ||||
void ixl_update_stats_counters(struct ixl_pf *); | void ixl_update_stats_counters(struct ixl_pf *); | ||||
void ixl_pf_reset_stats(struct ixl_pf *); | void ixl_pf_reset_stats(struct ixl_pf *); | ||||
void ixl_get_bus_info(struct ixl_pf *pf); | void ixl_get_bus_info(struct ixl_pf *pf); | ||||
int ixl_aq_get_link_status(struct ixl_pf *, | int ixl_aq_get_link_status(struct ixl_pf *, | ||||
struct i40e_aqc_get_link_status *); | struct i40e_aqc_get_link_status *); | ||||
int ixl_handle_nvmupd_cmd(struct ixl_pf *, struct ifdrv *); | int ixl_handle_nvmupd_cmd(struct ixl_pf *, struct ifdrv *); | ||||
void ixl_handle_empr_reset(struct ixl_pf *); | void ixl_handle_empr_reset(struct ixl_pf *); | ||||
int ixl_rebuild_hw_structs_after_reset(struct ixl_pf *); | int ixl_prepare_for_reset(struct ixl_pf *pf, bool is_up); | ||||
int ixl_rebuild_hw_structs_after_reset(struct ixl_pf *, bool is_up); | |||||
void ixl_set_queue_rx_itr(struct ixl_queue *); | void ixl_set_queue_rx_itr(struct ixl_queue *); | ||||
void ixl_set_queue_tx_itr(struct ixl_queue *); | void ixl_set_queue_tx_itr(struct ixl_queue *); | ||||
void ixl_add_filter(struct ixl_vsi *, const u8 *, s16 vlan); | void ixl_add_filter(struct ixl_vsi *, const u8 *, s16 vlan); | ||||
void ixl_del_filter(struct ixl_vsi *, const u8 *, s16 vlan); | void ixl_del_filter(struct ixl_vsi *, const u8 *, s16 vlan); | ||||
void ixl_reconfigure_filters(struct ixl_vsi *vsi); | void ixl_reconfigure_filters(struct ixl_vsi *vsi); | ||||
Show All 26 Lines | |||||
void ixl_del_hw_filters(struct ixl_vsi *, int); | void ixl_del_hw_filters(struct ixl_vsi *, int); | ||||
struct ixl_mac_filter * | struct ixl_mac_filter * | ||||
ixl_find_filter(struct ixl_vsi *, const u8 *, s16); | ixl_find_filter(struct ixl_vsi *, const u8 *, s16); | ||||
void ixl_add_mc_filter(struct ixl_vsi *, u8 *); | void ixl_add_mc_filter(struct ixl_vsi *, u8 *); | ||||
void ixl_free_mac_filters(struct ixl_vsi *vsi); | void ixl_free_mac_filters(struct ixl_vsi *vsi); | ||||
void ixl_update_vsi_stats(struct ixl_vsi *); | void ixl_update_vsi_stats(struct ixl_vsi *); | ||||
void ixl_vsi_reset_stats(struct ixl_vsi *); | void ixl_vsi_reset_stats(struct ixl_vsi *); | ||||
int ixl_vsi_setup_queues(struct ixl_vsi *vsi); | |||||
void ixl_vsi_free_queues(struct ixl_vsi *vsi); | |||||
/* | /* | ||||
* I2C Function prototypes | * I2C Function prototypes | ||||
*/ | */ | ||||
int ixl_find_i2c_interface(struct ixl_pf *); | int ixl_find_i2c_interface(struct ixl_pf *); | ||||
s32 ixl_read_i2c_byte(struct ixl_pf *pf, u8 byte_offset, | s32 ixl_read_i2c_byte(struct ixl_pf *pf, u8 byte_offset, | ||||
u8 dev_addr, u8 *data); | u8 dev_addr, u8 *data); | ||||
s32 ixl_write_i2c_byte(struct ixl_pf *pf, u8 byte_offset, | s32 ixl_write_i2c_byte(struct ixl_pf *pf, u8 byte_offset, | ||||
u8 dev_addr, u8 data); | u8 dev_addr, u8 data); | ||||
int ixl_get_fw_lldp_status(struct ixl_pf *pf); | |||||
int ixl_attach_get_link_status(struct ixl_pf *); | |||||
#endif /* _IXL_PF_H_ */ | #endif /* _IXL_PF_H_ */ |