#ifndef BE_H
#define BE_H
#include <linux/pci.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
#include <net/tcp.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <linux/if_vlan.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/firmware.h>
#include <linux/slab.h>
#include <linux/u64_stats_sync.h>
#include <linux/cpumask.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include "be_hw.h"
#include "be_roce.h"
#define DRV_NAME …
#define BE_NAME …
#define BE3_NAME …
#define OC_NAME …
#define OC_NAME_BE …
#define OC_NAME_LANCER …
#define OC_NAME_SH …
#define DRV_DESC …
#define BE_VENDOR_ID …
#define EMULEX_VENDOR_ID …
#define BE_DEVICE_ID1 …
#define BE_DEVICE_ID2 …
#define OC_DEVICE_ID1 …
#define OC_DEVICE_ID2 …
#define OC_DEVICE_ID3 …
#define OC_DEVICE_ID4 …
#define OC_DEVICE_ID5 …
#define OC_DEVICE_ID6 …
#define OC_SUBSYS_DEVICE_ID1 …
#define OC_SUBSYS_DEVICE_ID2 …
#define OC_SUBSYS_DEVICE_ID3 …
#define OC_SUBSYS_DEVICE_ID4 …
#define BE_HDR_LEN …
#define BE_RX_SKB_ALLOC_SIZE …
#define BE_MAX_JUMBO_FRAME_SIZE …
#define BE_MIN_MTU …
#define BE_MAX_MTU …
#define BE_MAX_GSO_SIZE …
#define BE_NUM_VLANS_SUPPORTED …
#define BE_MAX_EQD …
#define BE_MAX_TX_FRAG_COUNT …
#define EVNT_Q_LEN …
#define TX_Q_LEN …
#define TX_CQ_LEN …
#define RX_Q_LEN …
#define RX_CQ_LEN …
#define MCC_Q_LEN …
#define MCC_CQ_LEN …
#define BE2_MAX_RSS_QS …
#define BE3_MAX_RSS_QS …
#define BE3_MAX_TX_QS …
#define BE3_MAX_EVT_QS …
#define BE3_SRIOV_MAX_EVT_QS …
#define SH_VF_MAX_NIC_EQS …
#define MAX_PORT_RSS_TABLES …
#define MAX_NIC_FUNCS …
#define MAX_RX_QS …
#define MAX_EVT_QS …
#define MAX_TX_QS …
#define MAX_ROCE_EQS …
#define MAX_MSIX_VECTORS …
#define MIN_MSIX_VECTORS …
#define MAX_RX_POST …
#define RX_FRAGS_REFILL_WM …
#define MAX_NUM_POST_ERX_DB …
#define MAX_VFS …
#define FW_VER_LEN …
#define CNTL_SERIAL_NUM_WORDS …
#define CNTL_SERIAL_NUM_WORD_SZ …
#define RSS_INDIR_TABLE_LEN …
#define RSS_HASH_KEY_LEN …
#define BE_UNKNOWN_PHY_STATE …
struct be_dma_mem { … };
struct be_queue_info { … };
static inline u32 MODULO(u32 val, u32 limit)
{ … }
static inline void index_adv(u32 *index, u32 val, u32 limit)
{ … }
static inline void index_inc(u32 *index, u32 limit)
{ … }
static inline void *queue_head_node(struct be_queue_info *q)
{ … }
static inline void *queue_tail_node(struct be_queue_info *q)
{ … }
static inline void *queue_index_node(struct be_queue_info *q, u16 index)
{ … }
static inline void queue_head_inc(struct be_queue_info *q)
{ … }
static inline void index_dec(u32 *index, u32 limit)
{ … }
static inline void queue_tail_inc(struct be_queue_info *q)
{ … }
struct be_eq_obj { … } ____cacheline_aligned_in_smp;
struct be_aic_obj { … };
struct be_mcc_obj { … };
struct be_tx_stats { … };
struct be_tx_compl_info { … };
struct be_tx_obj { … } ____cacheline_aligned_in_smp;
struct be_rx_page_info { … };
struct be_rx_stats { … };
struct be_rx_compl_info { … };
struct be_rx_obj { … } ____cacheline_aligned_in_smp;
struct be_drv_stats { … };
#define BE_RESET_VLAN_TAG_ID …
struct be_vf_cfg { … };
enum vf_state { … };
#define BE_FLAGS_LINK_STATUS_INIT …
#define BE_FLAGS_SRIOV_ENABLED …
#define BE_FLAGS_WORKER_SCHEDULED …
#define BE_FLAGS_NAPI_ENABLED …
#define BE_FLAGS_QNQ_ASYNC_EVT_RCVD …
#define BE_FLAGS_VXLAN_OFFLOADS …
#define BE_FLAGS_SETUP_DONE …
#define BE_FLAGS_PHY_MISCONFIGURED …
#define BE_FLAGS_ERR_DETECTION_SCHEDULED …
#define BE_FLAGS_OS2BMC …
#define BE_FLAGS_TRY_RECOVERY …
#define BE_UC_PMAC_COUNT …
#define BE_VF_UC_PMAC_COUNT …
#define MAX_ERR_RECOVERY_RETRY_COUNT …
#define ERR_DETECTION_DELAY …
#define LANCER_INITIATE_FW_DUMP …
#define LANCER_DELETE_FW_DUMP …
struct phy_info { … };
struct be_resources { … };
struct be_port_resources { … };
#define be_is_os2bmc_enabled(adapter) …
struct rss_info { … };
#define BE_INVALID_DIE_TEMP …
struct be_hwmon { … };
#define BE_WRB_F_BIT(name) …
#define BE_WRB_F_MASK(name) …
#define BE_WRB_F_GET(word, name) …
#define BE_WRB_F_SET(word, name, val) …
enum { … };
struct be_wrb_params { … };
struct be_eth_addr { … };
#define BE_SEC …
#define BE_MIN …
#define BE_HOUR …
#define ERR_RECOVERY_MAX_RETRY_COUNT …
#define ERR_RECOVERY_DETECTION_DELAY …
#define ERR_RECOVERY_RETRY_DELAY …
#define ERR_RECOVERY_UE_DETECT_DURATION …
#define ERR_IDLE_HR …
#define ERR_RECOVERY_IDLE_TIME …
#define ERR_INTERVAL_HR …
#define ERR_RECOVERY_INTERVAL …
enum { … };
struct be_error_recovery { … };
#define BE_DISABLE_TPE_RECOVERY …
struct be_vxlan_port { … };
struct be_adapter { … };
struct be_cmd_work { … };
#define be_physfn(adapter) …
#define be_virtfn(adapter) …
#define sriov_enabled(adapter) …
#define for_all_vfs(adapter, vf_cfg, i) …
#define ON …
#define OFF …
#define be_max_vlans(adapter) …
#define be_max_uc(adapter) …
#define be_max_mc(adapter) …
#define be_max_vfs(adapter) …
#define be_max_rss(adapter) …
#define be_max_txqs(adapter) …
#define be_max_prio_txqs(adapter) …
#define be_max_rxqs(adapter) …
#define be_max_func_eqs(adapter) …
#define be_max_nic_eqs(adapter) …
#define be_if_cap_flags(adapter) …
#define be_max_pf_pool_rss_tables(adapter) …
#define be_max_irqs(adapter) …
static inline u16 be_max_rx_irqs(struct be_adapter *adapter)
{ … }
static inline u16 be_max_tx_irqs(struct be_adapter *adapter)
{ … }
static inline u16 be_max_qp_irqs(struct be_adapter *adapter)
{ … }
static inline u16 be_max_any_irqs(struct be_adapter *adapter)
{ … }
#define be_pvid_tagging_enabled(adapter) …
#define be_is_qnq_mode(adapter) …
#ifdef CONFIG_BE2NET_LANCER
#define lancer_chip(adapter) …
#else
#define lancer_chip …
#endif
#ifdef CONFIG_BE2NET_SKYHAWK
#define skyhawk_chip(adapter) …
#else
#define skyhawk_chip …
#endif
#ifdef CONFIG_BE2NET_BE3
#define BE3_chip(adapter) …
#else
#define BE3_chip …
#endif
#ifdef CONFIG_BE2NET_BE2
#define BE2_chip(adapter) …
#else
#define BE2_chip …
#endif
#define BEx_chip(adapter) …
#define be_roce_supported(adapter) …
extern const struct ethtool_ops be_ethtool_ops;
#define msix_enabled(adapter) …
#define num_irqs(adapter) …
#define tx_stats(txo) …
#define rx_stats(rxo) …
#define default_rxo(adpt) …
#define for_all_rx_queues(adapter, rxo, i) …
#define for_all_rss_queues(adapter, rxo, i) …
#define for_all_tx_queues(adapter, txo, i) …
#define for_all_evt_queues(adapter, eqo, i) …
#define for_all_rx_queues_on_eq(adapter, eqo, rxo, i) …
#define for_all_tx_queues_on_eq(adapter, eqo, txo, i) …
#define is_mcc_eqo(eqo) …
#define mcc_eqo(adapter) …
#define PAGE_SHIFT_4K …
#define PAGE_SIZE_4K …
#define PAGES_4K_SPANNED(_address, size) …
#define AMAP_BIT_OFFSET(_struct, field) …
static inline u32 amap_mask(u32 bitsize)
{ … }
static inline void
amap_set(void *ptr, u32 dw_offset, u32 mask, u32 offset, u32 value)
{ … }
#define AMAP_SET_BITS(_struct, field, ptr, val) …
static inline u32 amap_get(void *ptr, u32 dw_offset, u32 mask, u32 offset)
{ … }
#define AMAP_GET_BITS(_struct, field, ptr) …
#define GET_RX_COMPL_V0_BITS(field, ptr) …
#define GET_RX_COMPL_V1_BITS(field, ptr) …
#define GET_TX_COMPL_BITS(field, ptr) …
#define SET_TX_WRB_HDR_BITS(field, ptr, val) …
#define be_dws_cpu_to_le(wrb, len) …
#define be_dws_le_to_cpu(wrb, len) …
static inline void swap_dws(void *wrb, int len)
{ … }
#define be_cmd_status(status) …
static inline u8 is_tcp_pkt(struct sk_buff *skb)
{ … }
static inline u8 is_udp_pkt(struct sk_buff *skb)
{ … }
static inline bool is_ipv4_pkt(struct sk_buff *skb)
{ … }
static inline bool is_ipv6_ext_hdr(struct sk_buff *skb)
{ … }
#define be_error_recovering(adapter) …
#define BE_ERROR_EEH …
#define BE_ERROR_UE …
#define BE_ERROR_FW …
#define BE_ERROR_TX …
#define BE_ERROR_HW …
#define BE_ERROR_ANY …
#define BE_CLEAR_ALL …
static inline u8 be_check_error(struct be_adapter *adapter, u32 err_type)
{ … }
static inline void be_set_error(struct be_adapter *adapter, int err_type)
{ … }
static inline void be_clear_error(struct be_adapter *adapter, int err_type)
{ … }
static inline bool be_multi_rxq(const struct be_adapter *adapter)
{ … }
void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm,
u16 num_popped);
void be_link_status_update(struct be_adapter *adapter, u8 link_status);
void be_parse_stats(struct be_adapter *adapter);
int be_load_fw(struct be_adapter *adapter, u8 *func);
bool be_is_wol_supported(struct be_adapter *adapter);
bool be_pause_supported(struct be_adapter *adapter);
u32 be_get_fw_log_level(struct be_adapter *adapter);
int be_update_queues(struct be_adapter *adapter);
int be_poll(struct napi_struct *napi, int budget);
void be_eqd_update(struct be_adapter *adapter, bool force_update);
void be_roce_dev_add(struct be_adapter *);
void be_roce_dev_remove(struct be_adapter *);
void be_roce_dev_shutdown(struct be_adapter *);
#endif