Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/ixlv.h
Show All 38 Lines | |||||
#include "ixlv_vc_mgr.h" | #include "ixlv_vc_mgr.h" | ||||
#define IXLV_AQ_MAX_ERR 200 | #define IXLV_AQ_MAX_ERR 200 | ||||
#define IXLV_MAX_FILTERS 128 | #define IXLV_MAX_FILTERS 128 | ||||
#define IXLV_MAX_QUEUES 16 | #define IXLV_MAX_QUEUES 16 | ||||
#define IXLV_AQ_TIMEOUT (1 * hz) | #define IXLV_AQ_TIMEOUT (1 * hz) | ||||
#define IXLV_CALLOUT_TIMO (hz / 50) /* 20 msec */ | #define IXLV_CALLOUT_TIMO (hz / 50) /* 20 msec */ | ||||
#define IXLV_FLAG_AQ_ENABLE_QUEUES (u32)(1) | #define IXLV_FLAG_AQ_ENABLE_QUEUES (u32)(1 << 0) | ||||
#define IXLV_FLAG_AQ_DISABLE_QUEUES (u32)(1 << 1) | #define IXLV_FLAG_AQ_DISABLE_QUEUES (u32)(1 << 1) | ||||
#define IXLV_FLAG_AQ_ADD_MAC_FILTER (u32)(1 << 2) | #define IXLV_FLAG_AQ_ADD_MAC_FILTER (u32)(1 << 2) | ||||
#define IXLV_FLAG_AQ_ADD_VLAN_FILTER (u32)(1 << 3) | #define IXLV_FLAG_AQ_ADD_VLAN_FILTER (u32)(1 << 3) | ||||
#define IXLV_FLAG_AQ_DEL_MAC_FILTER (u32)(1 << 4) | #define IXLV_FLAG_AQ_DEL_MAC_FILTER (u32)(1 << 4) | ||||
#define IXLV_FLAG_AQ_DEL_VLAN_FILTER (u32)(1 << 5) | #define IXLV_FLAG_AQ_DEL_VLAN_FILTER (u32)(1 << 5) | ||||
#define IXLV_FLAG_AQ_CONFIGURE_QUEUES (u32)(1 << 6) | #define IXLV_FLAG_AQ_CONFIGURE_QUEUES (u32)(1 << 6) | ||||
#define IXLV_FLAG_AQ_MAP_VECTORS (u32)(1 << 7) | #define IXLV_FLAG_AQ_MAP_VECTORS (u32)(1 << 7) | ||||
#define IXLV_FLAG_AQ_HANDLE_RESET (u32)(1 << 8) | #define IXLV_FLAG_AQ_HANDLE_RESET (u32)(1 << 8) | ||||
#define IXLV_FLAG_AQ_CONFIGURE_PROMISC (u32)(1 << 9) | #define IXLV_FLAG_AQ_CONFIGURE_PROMISC (u32)(1 << 9) | ||||
#define IXLV_FLAG_AQ_GET_STATS (u32)(1 << 10) | #define IXLV_FLAG_AQ_GET_STATS (u32)(1 << 10) | ||||
#define IXLV_FLAG_AQ_CONFIG_RSS_KEY (u32)(1 << 11) | |||||
#define IXLV_FLAG_AQ_SET_RSS_HENA (u32)(1 << 12) | |||||
#define IXLV_FLAG_AQ_GET_RSS_HENA_CAPS (u32)(1 << 13) | |||||
#define IXLV_FLAG_AQ_CONFIG_RSS_LUT (u32)(1 << 14) | |||||
/* printf %b arg */ | /* printf %b arg */ | ||||
#define IXLV_FLAGS \ | #define IXLV_FLAGS \ | ||||
"\20\1ENABLE_QUEUES\2DISABLE_QUEUES\3ADD_MAC_FILTER" \ | "\20\1ENABLE_QUEUES\2DISABLE_QUEUES\3ADD_MAC_FILTER" \ | ||||
"\4ADD_VLAN_FILTER\5DEL_MAC_FILTER\6DEL_VLAN_FILTER" \ | "\4ADD_VLAN_FILTER\5DEL_MAC_FILTER\6DEL_VLAN_FILTER" \ | ||||
"\7CONFIGURE_QUEUES\10MAP_VECTORS\11HANDLE_RESET" \ | "\7CONFIGURE_QUEUES\10MAP_VECTORS\11HANDLE_RESET" \ | ||||
"\12CONFIGURE_PROMISC\13GET_STATS" | "\12CONFIGURE_PROMISC\13GET_STATS" | ||||
#define IXLV_PRINTF_VF_OFFLOAD_FLAGS \ | |||||
"\20\1I40E_VIRTCHNL_VF_OFFLOAD_L2" \ | |||||
"\2I40E_VIRTCHNL_VF_OFFLOAD_IWARP" \ | |||||
"\3I40E_VIRTCHNL_VF_OFFLOAD_FCOE" \ | |||||
"\4I40E_VIRTCHNL_VF_OFFLOAD_RSS_AQ" \ | |||||
"\5I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG" \ | |||||
"\6I40E_VIRTCHNL_VF_OFFLOAD_WB_ON_ITR" \ | |||||
"\21I40E_VIRTCHNL_VF_OFFLOAD_VLAN" \ | |||||
"\22I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING" \ | |||||
"\23I40E_VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2" \ | |||||
"\24I40E_VIRTCHNL_VF_OFFLOAD_RSS_PF" | |||||
/* Hack for compatibility with 1.0.x linux pf driver */ | |||||
#define I40E_VIRTCHNL_OP_EVENT 17 | |||||
/* Driver state */ | /* Driver state */ | ||||
enum ixlv_state_t { | enum ixlv_state_t { | ||||
IXLV_START, | IXLV_START, | ||||
IXLV_FAILED, | IXLV_FAILED, | ||||
IXLV_RESET_REQUIRED, | IXLV_RESET_REQUIRED, | ||||
IXLV_RESET_PENDING, | IXLV_RESET_PENDING, | ||||
IXLV_VERSION_CHECK, | IXLV_VERSION_CHECK, | ||||
IXLV_GET_RESOURCES, | IXLV_GET_RESOURCES, | ||||
IXLV_INIT_READY, | IXLV_INIT_READY, | ||||
IXLV_INIT_START, | IXLV_INIT_START, | ||||
IXLV_INIT_CONFIG, | IXLV_INIT_CONFIG, | ||||
IXLV_INIT_MAPPING, | IXLV_INIT_MAPPING, | ||||
IXLV_INIT_ENABLE, | IXLV_INIT_ENABLE, | ||||
IXLV_INIT_COMPLETE, | IXLV_INIT_COMPLETE, | ||||
IXLV_RUNNING, | IXLV_RUNNING, | ||||
}; | }; | ||||
/* Structs */ | |||||
struct ixlv_mac_filter { | struct ixlv_mac_filter { | ||||
SLIST_ENTRY(ixlv_mac_filter) next; | SLIST_ENTRY(ixlv_mac_filter) next; | ||||
u8 macaddr[ETHER_ADDR_LEN]; | u8 macaddr[ETHER_ADDR_LEN]; | ||||
u16 flags; | u16 flags; | ||||
}; | }; | ||||
SLIST_HEAD(mac_list, ixlv_mac_filter); | SLIST_HEAD(mac_list, ixlv_mac_filter); | ||||
struct ixlv_vlan_filter { | struct ixlv_vlan_filter { | ||||
SLIST_ENTRY(ixlv_vlan_filter) next; | SLIST_ENTRY(ixlv_vlan_filter) next; | ||||
u16 vlan; | u16 vlan; | ||||
u16 flags; | u16 flags; | ||||
}; | }; | ||||
SLIST_HEAD(vlan_list, ixlv_vlan_filter); | SLIST_HEAD(vlan_list, ixlv_vlan_filter); | ||||
/* Software controller structure */ | /* Software controller structure */ | ||||
struct ixlv_sc { | struct ixlv_sc { | ||||
struct i40e_hw hw; | struct i40e_hw hw; | ||||
struct i40e_osdep osdep; | struct i40e_osdep osdep; | ||||
struct device *dev; | struct device *dev; | ||||
struct resource *pci_mem; | struct resource *pci_mem; | ||||
struct resource *msix_mem; | struct resource *msix_mem; | ||||
enum ixlv_state_t init_state; | enum ixlv_state_t init_state; | ||||
int init_in_progress; | |||||
/* | /* | ||||
* Interrupt resources | * Interrupt resources | ||||
*/ | */ | ||||
void *tag; | void *tag; | ||||
struct resource *res; /* For the AQ */ | struct resource *res; /* For the AQ */ | ||||
struct ifmedia media; | struct ifmedia media; | ||||
Show All 31 Lines | struct ixlv_sc { | ||||
struct ixl_vc_cmd del_mac_cmd; | struct ixl_vc_cmd del_mac_cmd; | ||||
struct ixl_vc_cmd config_queues_cmd; | struct ixl_vc_cmd config_queues_cmd; | ||||
struct ixl_vc_cmd map_vectors_cmd; | struct ixl_vc_cmd map_vectors_cmd; | ||||
struct ixl_vc_cmd enable_queues_cmd; | struct ixl_vc_cmd enable_queues_cmd; | ||||
struct ixl_vc_cmd add_vlan_cmd; | struct ixl_vc_cmd add_vlan_cmd; | ||||
struct ixl_vc_cmd del_vlan_cmd; | struct ixl_vc_cmd del_vlan_cmd; | ||||
struct ixl_vc_cmd add_multi_cmd; | struct ixl_vc_cmd add_multi_cmd; | ||||
struct ixl_vc_cmd del_multi_cmd; | struct ixl_vc_cmd del_multi_cmd; | ||||
struct ixl_vc_cmd config_rss_key_cmd; | |||||
struct ixl_vc_cmd get_rss_hena_caps_cmd; | |||||
struct ixl_vc_cmd set_rss_hena_cmd; | |||||
struct ixl_vc_cmd config_rss_lut_cmd; | |||||
/* Virtual comm channel */ | /* Virtual comm channel */ | ||||
struct i40e_virtchnl_vf_resource *vf_res; | struct i40e_virtchnl_vf_resource *vf_res; | ||||
struct i40e_virtchnl_vsi_resource *vsi_res; | struct i40e_virtchnl_vsi_resource *vsi_res; | ||||
/* Misc stats maintained by the driver */ | /* Misc stats maintained by the driver */ | ||||
u64 watchdog_events; | u64 watchdog_events; | ||||
u64 admin_irq; | u64 admin_irq; | ||||
Show All 39 Lines | |||||
void ixlv_vc_completion(struct ixlv_sc *, | void ixlv_vc_completion(struct ixlv_sc *, | ||||
enum i40e_virtchnl_ops, i40e_status, u8 *, u16); | enum i40e_virtchnl_ops, i40e_status, u8 *, u16); | ||||
void ixlv_add_ether_filter(struct ixlv_sc *); | void ixlv_add_ether_filter(struct ixlv_sc *); | ||||
void ixlv_add_vlans(struct ixlv_sc *); | void ixlv_add_vlans(struct ixlv_sc *); | ||||
void ixlv_del_vlans(struct ixlv_sc *); | void ixlv_del_vlans(struct ixlv_sc *); | ||||
void ixlv_update_stats_counters(struct ixlv_sc *, | void ixlv_update_stats_counters(struct ixlv_sc *, | ||||
struct i40e_eth_stats *); | struct i40e_eth_stats *); | ||||
void ixlv_update_link_status(struct ixlv_sc *); | void ixlv_update_link_status(struct ixlv_sc *); | ||||
void ixlv_get_default_rss_key(u32 *, bool); | |||||
void ixlv_config_rss_key(struct ixlv_sc *); | |||||
void ixlv_set_rss_hena(struct ixlv_sc *); | |||||
void ixlv_config_rss_lut(struct ixlv_sc *); | |||||
#endif /* _IXLV_H_ */ | #endif /* _IXLV_H_ */ |