#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/dma-mapping.h>
#include <linux/bitops.h>
#include <linux/irq.h>
#include <linux/delay.h>
#include <asm/byteorder.h>
#include <linux/time.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
#include <linux/if_vlan.h>
#include <linux/crash_dump.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/tcp.h>
#include <net/vxlan.h>
#include <net/checksum.h>
#include <net/ip6_checksum.h>
#include <linux/workqueue.h>
#include <linux/crc32.h>
#include <linux/crc32c.h>
#include <linux/prefetch.h>
#include <linux/zlib.h>
#include <linux/io.h>
#include <linux/semaphore.h>
#include <linux/stringify.h>
#include <linux/vmalloc.h>
#include "bnx2x.h"
#include "bnx2x_init.h"
#include "bnx2x_init_ops.h"
#include "bnx2x_cmn.h"
#include "bnx2x_vfpf.h"
#include "bnx2x_dcb.h"
#include "bnx2x_sp.h"
#include <linux/firmware.h>
#include "bnx2x_fw_file_hdr.h"
#define FW_FILE_VERSION …
#define FW_FILE_VERSION_V15 …
#define FW_FILE_NAME_E1 …
#define FW_FILE_NAME_E1H …
#define FW_FILE_NAME_E2 …
#define FW_FILE_NAME_E1_V15 …
#define FW_FILE_NAME_E1H_V15 …
#define FW_FILE_NAME_E2_V15 …
#define TX_TIMEOUT …
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_FIRMWARE(…);
MODULE_FIRMWARE(…);
MODULE_FIRMWARE(…);
MODULE_FIRMWARE(…);
MODULE_FIRMWARE(…);
MODULE_FIRMWARE(…);
int bnx2x_num_queues;
module_param_named(num_queues, bnx2x_num_queues, int, 0444);
MODULE_PARM_DESC(…) …;
static int disable_tpa;
module_param(disable_tpa, int, 0444);
MODULE_PARM_DESC(…) …;
static int int_mode;
module_param(int_mode, int, 0444);
MODULE_PARM_DESC(…) …;
static int dropless_fc;
module_param(dropless_fc, int, 0444);
MODULE_PARM_DESC(…) …;
static int mrrs = …;
module_param(mrrs, int, 0444);
MODULE_PARM_DESC(…) …;
static int debug;
module_param(debug, int, 0444);
MODULE_PARM_DESC(…) …;
static struct workqueue_struct *bnx2x_wq;
struct workqueue_struct *bnx2x_iov_wq;
struct bnx2x_mac_vals { … };
enum bnx2x_board_type { … };
static struct { … } board_info[] = …;
#ifndef PCI_DEVICE_ID_NX2_57710
#define PCI_DEVICE_ID_NX2_57710 …
#endif
#ifndef PCI_DEVICE_ID_NX2_57711
#define PCI_DEVICE_ID_NX2_57711 …
#endif
#ifndef PCI_DEVICE_ID_NX2_57711E
#define PCI_DEVICE_ID_NX2_57711E …
#endif
#ifndef PCI_DEVICE_ID_NX2_57712
#define PCI_DEVICE_ID_NX2_57712 …
#endif
#ifndef PCI_DEVICE_ID_NX2_57712_MF
#define PCI_DEVICE_ID_NX2_57712_MF …
#endif
#ifndef PCI_DEVICE_ID_NX2_57712_VF
#define PCI_DEVICE_ID_NX2_57712_VF …
#endif
#ifndef PCI_DEVICE_ID_NX2_57800
#define PCI_DEVICE_ID_NX2_57800 …
#endif
#ifndef PCI_DEVICE_ID_NX2_57800_MF
#define PCI_DEVICE_ID_NX2_57800_MF …
#endif
#ifndef PCI_DEVICE_ID_NX2_57800_VF
#define PCI_DEVICE_ID_NX2_57800_VF …
#endif
#ifndef PCI_DEVICE_ID_NX2_57810
#define PCI_DEVICE_ID_NX2_57810 …
#endif
#ifndef PCI_DEVICE_ID_NX2_57810_MF
#define PCI_DEVICE_ID_NX2_57810_MF …
#endif
#ifndef PCI_DEVICE_ID_NX2_57840_O
#define PCI_DEVICE_ID_NX2_57840_O …
#endif
#ifndef PCI_DEVICE_ID_NX2_57810_VF
#define PCI_DEVICE_ID_NX2_57810_VF …
#endif
#ifndef PCI_DEVICE_ID_NX2_57840_4_10
#define PCI_DEVICE_ID_NX2_57840_4_10 …
#endif
#ifndef PCI_DEVICE_ID_NX2_57840_2_20
#define PCI_DEVICE_ID_NX2_57840_2_20 …
#endif
#ifndef PCI_DEVICE_ID_NX2_57840_MFO
#define PCI_DEVICE_ID_NX2_57840_MFO …
#endif
#ifndef PCI_DEVICE_ID_NX2_57840_MF
#define PCI_DEVICE_ID_NX2_57840_MF …
#endif
#ifndef PCI_DEVICE_ID_NX2_57840_VF
#define PCI_DEVICE_ID_NX2_57840_VF …
#endif
#ifndef PCI_DEVICE_ID_NX2_57811
#define PCI_DEVICE_ID_NX2_57811 …
#endif
#ifndef PCI_DEVICE_ID_NX2_57811_MF
#define PCI_DEVICE_ID_NX2_57811_MF …
#endif
#ifndef PCI_DEVICE_ID_NX2_57811_VF
#define PCI_DEVICE_ID_NX2_57811_VF …
#endif
static const struct pci_device_id bnx2x_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, bnx2x_pci_tbl);
const u32 dmae_reg_go_c[] = …;
#define BNX2X_PREV_WAIT_NEEDED …
static DEFINE_SEMAPHORE(bnx2x_prev_sem, 1);
static LIST_HEAD(bnx2x_prev_list);
static struct cnic_eth_dev *bnx2x_cnic_probe(struct net_device *dev);
static u32 bnx2x_rx_ustorm_prods_offset(struct bnx2x_fastpath *fp);
static int bnx2x_set_storm_rx_mode(struct bnx2x *bp);
static int bnx2x_hwtstamp_ioctl(struct bnx2x *bp, struct ifreq *ifr);
static void __storm_memset_dma_mapping(struct bnx2x *bp,
u32 addr, dma_addr_t mapping)
{ … }
static void storm_memset_spq_addr(struct bnx2x *bp,
dma_addr_t mapping, u16 abs_fid)
{ … }
static void storm_memset_vf_to_pf(struct bnx2x *bp, u16 abs_fid,
u16 pf_id)
{ … }
static void storm_memset_func_en(struct bnx2x *bp, u16 abs_fid,
u8 enable)
{ … }
static void storm_memset_eq_data(struct bnx2x *bp,
struct event_ring_data *eq_data,
u16 pfid)
{ … }
static void storm_memset_eq_prod(struct bnx2x *bp, u16 eq_prod,
u16 pfid)
{ … }
static void bnx2x_reg_wr_ind(struct bnx2x *bp, u32 addr, u32 val)
{ … }
static u32 bnx2x_reg_rd_ind(struct bnx2x *bp, u32 addr)
{ … }
#define DMAE_DP_SRC_GRC …
#define DMAE_DP_SRC_PCI …
#define DMAE_DP_DST_GRC …
#define DMAE_DP_DST_PCI …
#define DMAE_DP_DST_NONE …
static void bnx2x_dp_dmae(struct bnx2x *bp,
struct dmae_command *dmae, int msglvl)
{ … }
void bnx2x_post_dmae(struct bnx2x *bp, struct dmae_command *dmae, int idx)
{ … }
u32 bnx2x_dmae_opcode_add_comp(u32 opcode, u8 comp_type)
{ … }
u32 bnx2x_dmae_opcode_clr_src_reset(u32 opcode)
{ … }
u32 bnx2x_dmae_opcode(struct bnx2x *bp, u8 src_type, u8 dst_type,
bool with_comp, u8 comp_type)
{ … }
void bnx2x_prep_dmae_with_comp(struct bnx2x *bp,
struct dmae_command *dmae,
u8 src_type, u8 dst_type)
{ … }
int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae,
u32 *comp)
{ … }
void bnx2x_write_dmae(struct bnx2x *bp, dma_addr_t dma_addr, u32 dst_addr,
u32 len32)
{ … }
void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32)
{ … }
static void bnx2x_write_dmae_phys_len(struct bnx2x *bp, dma_addr_t phys_addr,
u32 addr, u32 len)
{ … }
enum storms { … };
#define STORMS_NUM …
#define REGS_IN_ENTRY …
static inline int bnx2x_get_assert_list_entry(struct bnx2x *bp,
enum storms storm,
int entry)
{ … }
static int bnx2x_mc_assert(struct bnx2x *bp)
{ … }
#define MCPR_TRACE_BUFFER_SIZE …
#define SCRATCH_BUFFER_SIZE(bp) …
void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl)
{ … }
static void bnx2x_fw_dump(struct bnx2x *bp)
{ … }
static void bnx2x_hc_int_disable(struct bnx2x *bp)
{ … }
static void bnx2x_igu_int_disable(struct bnx2x *bp)
{ … }
static void bnx2x_int_disable(struct bnx2x *bp)
{ … }
void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int)
{ … }
#define FLR_WAIT_USEC …
#define FLR_WAIT_INTERVAL …
#define FLR_POLL_CNT …
struct pbf_pN_buf_regs { … };
struct pbf_pN_cmd_regs { … };
static void bnx2x_pbf_pN_buf_flushed(struct bnx2x *bp,
struct pbf_pN_buf_regs *regs,
u32 poll_count)
{ … }
static void bnx2x_pbf_pN_cmd_flushed(struct bnx2x *bp,
struct pbf_pN_cmd_regs *regs,
u32 poll_count)
{ … }
static u32 bnx2x_flr_clnup_reg_poll(struct bnx2x *bp, u32 reg,
u32 expected, u32 poll_count)
{ … }
int bnx2x_flr_clnup_poll_hw_counter(struct bnx2x *bp, u32 reg,
char *msg, u32 poll_cnt)
{ … }
u32 bnx2x_flr_clnup_poll_count(struct bnx2x *bp)
{ … }
void bnx2x_tx_hw_flushed(struct bnx2x *bp, u32 poll_count)
{ … }
#define OP_GEN_PARAM(param) …
#define OP_GEN_TYPE(type) …
#define OP_GEN_AGG_VECT(index) …
int bnx2x_send_final_clnup(struct bnx2x *bp, u8 clnup_func, u32 poll_cnt)
{ … }
u8 bnx2x_is_pcie_pending(struct pci_dev *dev)
{ … }
static int bnx2x_poll_hw_usage_counters(struct bnx2x *bp, u32 poll_cnt)
{ … }
static void bnx2x_hw_enable_status(struct bnx2x *bp)
{ … }
static int bnx2x_pf_flr_clnup(struct bnx2x *bp)
{ … }
static void bnx2x_hc_int_enable(struct bnx2x *bp)
{ … }
static void bnx2x_igu_int_enable(struct bnx2x *bp)
{ … }
void bnx2x_int_enable(struct bnx2x *bp)
{ … }
void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw)
{ … }
static bool bnx2x_trylock_hw_lock(struct bnx2x *bp, u32 resource)
{ … }
static int bnx2x_get_leader_lock_resource(struct bnx2x *bp)
{ … }
static bool bnx2x_trylock_leader_lock(struct bnx2x *bp)
{ … }
static void bnx2x_cnic_cfc_comp(struct bnx2x *bp, int cid, u8 err);
static int bnx2x_schedule_sp_task(struct bnx2x *bp)
{ … }
void bnx2x_sp_event(struct bnx2x_fastpath *fp, union eth_rx_cqe *rr_cqe)
{ … }
irqreturn_t bnx2x_interrupt(int irq, void *dev_instance)
{ … }
int bnx2x_acquire_hw_lock(struct bnx2x *bp, u32 resource)
{ … }
int bnx2x_release_leader_lock(struct bnx2x *bp)
{ … }
int bnx2x_release_hw_lock(struct bnx2x *bp, u32 resource)
{ … }
int bnx2x_get_gpio(struct bnx2x *bp, int gpio_num, u8 port)
{ … }
int bnx2x_set_gpio(struct bnx2x *bp, int gpio_num, u32 mode, u8 port)
{ … }
int bnx2x_set_mult_gpio(struct bnx2x *bp, u8 pins, u32 mode)
{ … }
int bnx2x_set_gpio_int(struct bnx2x *bp, int gpio_num, u32 mode, u8 port)
{ … }
static int bnx2x_set_spio(struct bnx2x *bp, int spio, u32 mode)
{ … }
void bnx2x_calc_fc_adv(struct bnx2x *bp)
{ … }
static void bnx2x_set_requested_fc(struct bnx2x *bp)
{ … }
static void bnx2x_init_dropless_fc(struct bnx2x *bp)
{ … }
int bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode)
{ … }
void bnx2x_link_set(struct bnx2x *bp)
{ … }
static void bnx2x__link_reset(struct bnx2x *bp)
{ … }
void bnx2x_force_link_reset(struct bnx2x *bp)
{ … }
u8 bnx2x_link_test(struct bnx2x *bp, u8 is_serdes)
{ … }
static void bnx2x_calc_vn_min(struct bnx2x *bp,
struct cmng_init_input *input)
{ … }
static void bnx2x_calc_vn_max(struct bnx2x *bp, int vn,
struct cmng_init_input *input)
{ … }
static int bnx2x_get_cmng_fns_mode(struct bnx2x *bp)
{ … }
void bnx2x_read_mf_cfg(struct bnx2x *bp)
{ … }
static void bnx2x_cmng_fns_init(struct bnx2x *bp, u8 read_cfg, u8 cmng_type)
{ … }
static void storm_memset_cmng(struct bnx2x *bp,
struct cmng_init *cmng,
u8 port)
{ … }
void bnx2x_set_local_cmng(struct bnx2x *bp)
{ … }
static void bnx2x_link_attn(struct bnx2x *bp)
{ … }
void bnx2x__link_status_update(struct bnx2x *bp)
{ … }
static int bnx2x_afex_func_update(struct bnx2x *bp, u16 vifid,
u16 vlan_val, u8 allowed_prio)
{ … }
static int bnx2x_afex_handle_vif_list_cmd(struct bnx2x *bp, u8 cmd_type,
u16 vif_index, u8 func_bit_map)
{ … }
static void bnx2x_handle_afex_cmd(struct bnx2x *bp, u32 cmd)
{ … }
static void bnx2x_handle_update_svid_cmd(struct bnx2x *bp)
{ … }
static void bnx2x_pmf_update(struct bnx2x *bp)
{ … }
u32 bnx2x_fw_command(struct bnx2x *bp, u32 command, u32 param)
{ … }
static void storm_memset_func_cfg(struct bnx2x *bp,
struct tstorm_eth_function_common_config *tcfg,
u16 abs_fid)
{ … }
void bnx2x_func_init(struct bnx2x *bp, struct bnx2x_func_init_params *p)
{ … }
static unsigned long bnx2x_get_common_flags(struct bnx2x *bp,
struct bnx2x_fastpath *fp,
bool zero_stats)
{ … }
static unsigned long bnx2x_get_q_flags(struct bnx2x *bp,
struct bnx2x_fastpath *fp,
bool leading)
{ … }
static void bnx2x_pf_q_prep_general(struct bnx2x *bp,
struct bnx2x_fastpath *fp, struct bnx2x_general_setup_params *gen_init,
u8 cos)
{ … }
static void bnx2x_pf_rx_q_prep(struct bnx2x *bp,
struct bnx2x_fastpath *fp, struct rxq_pause_params *pause,
struct bnx2x_rxq_setup_params *rxq_init)
{ … }
static void bnx2x_pf_tx_q_prep(struct bnx2x *bp,
struct bnx2x_fastpath *fp, struct bnx2x_txq_setup_params *txq_init,
u8 cos)
{ … }
static void bnx2x_pf_init(struct bnx2x *bp)
{ … }
static void bnx2x_e1h_disable(struct bnx2x *bp)
{ … }
static void bnx2x_e1h_enable(struct bnx2x *bp)
{ … }
#define DRV_INFO_ETH_STAT_NUM_MACS_REQUIRED …
static void bnx2x_drv_info_ether_stat(struct bnx2x *bp)
{ … }
static void bnx2x_drv_info_fcoe_stat(struct bnx2x *bp)
{ … }
static void bnx2x_drv_info_iscsi_stat(struct bnx2x *bp)
{ … }
static void bnx2x_config_mf_bw(struct bnx2x *bp)
{ … }
static void bnx2x_set_mf_bw(struct bnx2x *bp)
{ … }
static void bnx2x_handle_eee_event(struct bnx2x *bp)
{ … }
#define BNX2X_UPDATE_DRV_INFO_IND_LENGTH …
#define BNX2X_UPDATE_DRV_INFO_IND_COUNT …
static void bnx2x_handle_drv_info_req(struct bnx2x *bp)
{ … }
static u32 bnx2x_update_mng_version_utility(u8 *version, bool bnx2x_format)
{ … }
void bnx2x_update_mng_version(struct bnx2x *bp)
{ … }
void bnx2x_update_mfw_dump(struct bnx2x *bp)
{ … }
static void bnx2x_oem_event(struct bnx2x *bp, u32 event)
{ … }
static struct eth_spe *bnx2x_sp_get_next(struct bnx2x *bp)
{ … }
static void bnx2x_sp_prod_update(struct bnx2x *bp)
{ … }
static bool bnx2x_is_contextless_ramrod(int cmd, int cmd_type)
{ … }
int bnx2x_sp_post(struct bnx2x *bp, int command, int cid,
u32 data_hi, u32 data_lo, int cmd_type)
{ … }
static int bnx2x_acquire_alr(struct bnx2x *bp)
{ … }
static void bnx2x_release_alr(struct bnx2x *bp)
{ … }
#define BNX2X_DEF_SB_ATT_IDX …
#define BNX2X_DEF_SB_IDX …
static u16 bnx2x_update_dsb_idx(struct bnx2x *bp)
{ … }
static void bnx2x_attn_int_asserted(struct bnx2x *bp, u32 asserted)
{ … }
static void bnx2x_fan_failure(struct bnx2x *bp)
{ … }
static void bnx2x_attn_int_deasserted0(struct bnx2x *bp, u32 attn)
{ … }
static void bnx2x_attn_int_deasserted1(struct bnx2x *bp, u32 attn)
{ … }
static void bnx2x_attn_int_deasserted2(struct bnx2x *bp, u32 attn)
{ … }
static void bnx2x_attn_int_deasserted3(struct bnx2x *bp, u32 attn)
{ … }
#define BNX2X_RECOVERY_GLOB_REG …
#define BNX2X_PATH0_LOAD_CNT_MASK …
#define BNX2X_PATH0_LOAD_CNT_SHIFT …
#define BNX2X_PATH1_LOAD_CNT_MASK …
#define BNX2X_PATH1_LOAD_CNT_SHIFT …
#define BNX2X_PATH0_RST_IN_PROG_BIT …
#define BNX2X_PATH1_RST_IN_PROG_BIT …
#define BNX2X_GLOBAL_RESET_BIT …
void bnx2x_set_reset_global(struct bnx2x *bp)
{ … }
static void bnx2x_clear_reset_global(struct bnx2x *bp)
{ … }
static bool bnx2x_reset_is_global(struct bnx2x *bp)
{ … }
static void bnx2x_set_reset_done(struct bnx2x *bp)
{ … }
void bnx2x_set_reset_in_progress(struct bnx2x *bp)
{ … }
bool bnx2x_reset_is_done(struct bnx2x *bp, int engine)
{ … }
void bnx2x_set_pf_load(struct bnx2x *bp)
{ … }
bool bnx2x_clear_pf_load(struct bnx2x *bp)
{ … }
static bool bnx2x_get_load_status(struct bnx2x *bp, int engine)
{ … }
static void _print_parity(struct bnx2x *bp, u32 reg)
{ … }
static void _print_next_block(int idx, const char *blk)
{ … }
static bool bnx2x_check_blocks_with_parity0(struct bnx2x *bp, u32 sig,
int *par_num, bool print)
{ … }
static bool bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig,
int *par_num, bool *global,
bool print)
{ … }
static bool bnx2x_check_blocks_with_parity2(struct bnx2x *bp, u32 sig,
int *par_num, bool print)
{ … }
static bool bnx2x_check_blocks_with_parity3(struct bnx2x *bp, u32 sig,
int *par_num, bool *global,
bool print)
{ … }
static bool bnx2x_check_blocks_with_parity4(struct bnx2x *bp, u32 sig,
int *par_num, bool print)
{ … }
static bool bnx2x_parity_attn(struct bnx2x *bp, bool *global, bool print,
u32 *sig)
{ … }
bool bnx2x_chk_parity_attn(struct bnx2x *bp, bool *global, bool print)
{ … }
static void bnx2x_attn_int_deasserted4(struct bnx2x *bp, u32 attn)
{ … }
static void bnx2x_attn_int_deasserted(struct bnx2x *bp, u32 deasserted)
{ … }
static void bnx2x_attn_int(struct bnx2x *bp)
{ … }
void bnx2x_igu_ack_sb(struct bnx2x *bp, u8 igu_sb_id, u8 segment,
u16 index, u8 op, u8 update)
{ … }
static void bnx2x_update_eq_prod(struct bnx2x *bp, u16 prod)
{ … }
static int bnx2x_cnic_handle_cfc_del(struct bnx2x *bp, u32 cid,
union event_ring_elem *elem)
{ … }
static void bnx2x_handle_mcast_eqe(struct bnx2x *bp)
{ … }
static void bnx2x_handle_classification_eqe(struct bnx2x *bp,
union event_ring_elem *elem)
{ … }
static void bnx2x_set_iscsi_eth_rx_mode(struct bnx2x *bp, bool start);
static void bnx2x_handle_rx_mode_eqe(struct bnx2x *bp)
{ … }
static void bnx2x_after_afex_vif_lists(struct bnx2x *bp,
union event_ring_elem *elem)
{ … }
static void bnx2x_after_function_update(struct bnx2x *bp)
{ … }
static struct bnx2x_queue_sp_obj *bnx2x_cid_to_q_obj(
struct bnx2x *bp, u32 cid)
{ … }
static void bnx2x_eq_int(struct bnx2x *bp)
{ … }
static void bnx2x_sp_task(struct work_struct *work)
{ … }
irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
{ … }
void bnx2x_drv_pulse(struct bnx2x *bp)
{ … }
static void bnx2x_timer(struct timer_list *t)
{ … }
static void bnx2x_fill(struct bnx2x *bp, u32 addr, int fill, u32 len)
{ … }
static void bnx2x_wr_fp_sb_data(struct bnx2x *bp,
int fw_sb_id,
u32 *sb_data_p,
u32 data_size)
{ … }
static void bnx2x_zero_fp_sb(struct bnx2x *bp, int fw_sb_id)
{ … }
static void bnx2x_wr_sp_sb_data(struct bnx2x *bp,
struct hc_sp_status_block_data *sp_sb_data)
{ … }
static void bnx2x_zero_sp_sb(struct bnx2x *bp)
{ … }
static void bnx2x_setup_ndsb_state_machine(struct hc_status_block_sm *hc_sm,
int igu_sb_id, int igu_seg_id)
{ … }
static void bnx2x_map_sb_state_machines(struct hc_index_data *index_data)
{ … }
void bnx2x_init_sb(struct bnx2x *bp, dma_addr_t mapping, int vfid,
u8 vf_valid, int fw_sb_id, int igu_sb_id)
{ … }
static void bnx2x_update_coalesce_sb(struct bnx2x *bp, u8 fw_sb_id,
u16 tx_usec, u16 rx_usec)
{ … }
static void bnx2x_init_def_sb(struct bnx2x *bp)
{ … }
void bnx2x_update_coalesce(struct bnx2x *bp)
{ … }
static void bnx2x_init_sp_ring(struct bnx2x *bp)
{ … }
static void bnx2x_init_eq_ring(struct bnx2x *bp)
{ … }
static int bnx2x_set_q_rx_mode(struct bnx2x *bp, u8 cl_id,
unsigned long rx_mode_flags,
unsigned long rx_accept_flags,
unsigned long tx_accept_flags,
unsigned long ramrod_flags)
{ … }
static int bnx2x_fill_accept_flags(struct bnx2x *bp, u32 rx_mode,
unsigned long *rx_accept_flags,
unsigned long *tx_accept_flags)
{ … }
static int bnx2x_set_storm_rx_mode(struct bnx2x *bp)
{ … }
static void bnx2x_init_internal_common(struct bnx2x *bp)
{ … }
static void bnx2x_init_internal(struct bnx2x *bp, u32 load_code)
{ … }
static inline u8 bnx2x_fp_igu_sb_id(struct bnx2x_fastpath *fp)
{ … }
static inline u8 bnx2x_fp_fw_sb_id(struct bnx2x_fastpath *fp)
{ … }
static u8 bnx2x_fp_cl_id(struct bnx2x_fastpath *fp)
{ … }
static void bnx2x_init_eth_fp(struct bnx2x *bp, int fp_idx)
{ … }
static void bnx2x_init_tx_ring_one(struct bnx2x_fp_txdata *txdata)
{ … }
static void bnx2x_init_tx_rings_cnic(struct bnx2x *bp)
{ … }
static void bnx2x_init_tx_rings(struct bnx2x *bp)
{ … }
static void bnx2x_init_fcoe_fp(struct bnx2x *bp)
{ … }
void bnx2x_nic_init_cnic(struct bnx2x *bp)
{ … }
void bnx2x_pre_irq_nic_init(struct bnx2x *bp)
{ … }
void bnx2x_post_irq_nic_init(struct bnx2x *bp, u32 load_code)
{ … }
static int bnx2x_gunzip_init(struct bnx2x *bp)
{ … }
static void bnx2x_gunzip_end(struct bnx2x *bp)
{ … }
static int bnx2x_gunzip(struct bnx2x *bp, const u8 *zbuf, int len)
{ … }
static void bnx2x_lb_pckt(struct bnx2x *bp)
{ … }
static int bnx2x_int_mem_test(struct bnx2x *bp)
{ … }
static void bnx2x_enable_blocks_attention(struct bnx2x *bp)
{ … }
static void bnx2x_reset_common(struct bnx2x *bp)
{ … }
static void bnx2x_setup_dmae(struct bnx2x *bp)
{ … }
static void bnx2x_init_pxp(struct bnx2x *bp)
{ … }
static void bnx2x_setup_fan_failure_detection(struct bnx2x *bp)
{ … }
void bnx2x_pf_disable(struct bnx2x *bp)
{ … }
static void bnx2x__common_init_phy(struct bnx2x *bp)
{ … }
static void bnx2x_config_endianity(struct bnx2x *bp, u32 val)
{ … }
static void bnx2x_set_endianity(struct bnx2x *bp)
{ … }
static void bnx2x_reset_endianity(struct bnx2x *bp)
{ … }
static int bnx2x_init_hw_common(struct bnx2x *bp)
{ … }
static int bnx2x_init_hw_common_chip(struct bnx2x *bp)
{ … }
static int bnx2x_init_hw_port(struct bnx2x *bp)
{ … }
static void bnx2x_ilt_wr(struct bnx2x *bp, u32 index, dma_addr_t addr)
{ … }
void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id, bool is_pf)
{ … }
static void bnx2x_igu_clear_sb(struct bnx2x *bp, u8 idu_sb_id)
{ … }
static void bnx2x_clear_func_ilt(struct bnx2x *bp, u32 func)
{ … }
static void bnx2x_init_searcher(struct bnx2x *bp)
{ … }
static inline int bnx2x_func_switch_update(struct bnx2x *bp, int suspend)
{ … }
static int bnx2x_reset_nic_mode(struct bnx2x *bp)
{ … }
int bnx2x_init_hw_func_cnic(struct bnx2x *bp)
{ … }
static void bnx2x_clean_pglue_errors(struct bnx2x *bp)
{ … }
static int bnx2x_init_hw_func(struct bnx2x *bp)
{ … }
void bnx2x_free_mem_cnic(struct bnx2x *bp)
{ … }
void bnx2x_free_mem(struct bnx2x *bp)
{ … }
int bnx2x_alloc_mem_cnic(struct bnx2x *bp)
{ … }
int bnx2x_alloc_mem(struct bnx2x *bp)
{ … }
int bnx2x_set_mac_one(struct bnx2x *bp, const u8 *mac,
struct bnx2x_vlan_mac_obj *obj, bool set,
int mac_type, unsigned long *ramrod_flags)
{ … }
int bnx2x_set_vlan_one(struct bnx2x *bp, u16 vlan,
struct bnx2x_vlan_mac_obj *obj, bool set,
unsigned long *ramrod_flags)
{ … }
void bnx2x_clear_vlan_info(struct bnx2x *bp)
{ … }
static int bnx2x_del_all_vlans(struct bnx2x *bp)
{ … }
int bnx2x_del_all_macs(struct bnx2x *bp,
struct bnx2x_vlan_mac_obj *mac_obj,
int mac_type, bool wait_for_comp)
{ … }
int bnx2x_set_eth_mac(struct bnx2x *bp, bool set)
{ … }
int bnx2x_setup_leading(struct bnx2x *bp)
{ … }
int bnx2x_set_int_mode(struct bnx2x *bp)
{ … }
static inline u16 bnx2x_cid_ilt_lines(struct bnx2x *bp)
{ … }
void bnx2x_ilt_set_info(struct bnx2x *bp)
{ … }
static void bnx2x_pf_q_prep_init(struct bnx2x *bp,
struct bnx2x_fastpath *fp, struct bnx2x_queue_init_params *init_params)
{ … }
static int bnx2x_setup_tx_only(struct bnx2x *bp, struct bnx2x_fastpath *fp,
struct bnx2x_queue_state_params *q_params,
struct bnx2x_queue_setup_tx_only_params *tx_only_params,
int tx_index, bool leading)
{ … }
int bnx2x_setup_queue(struct bnx2x *bp, struct bnx2x_fastpath *fp,
bool leading)
{ … }
static int bnx2x_stop_queue(struct bnx2x *bp, int index)
{ … }
static void bnx2x_reset_func(struct bnx2x *bp)
{ … }
static void bnx2x_reset_port(struct bnx2x *bp)
{ … }
static int bnx2x_reset_hw(struct bnx2x *bp, u32 load_code)
{ … }
static int bnx2x_func_stop(struct bnx2x *bp)
{ … }
u32 bnx2x_send_unload_req(struct bnx2x *bp, int unload_mode)
{ … }
void bnx2x_send_unload_done(struct bnx2x *bp, bool keep_link)
{ … }
static int bnx2x_func_wait_started(struct bnx2x *bp)
{ … }
static void bnx2x_disable_ptp(struct bnx2x *bp)
{ … }
static void bnx2x_stop_ptp(struct bnx2x *bp)
{ … }
void bnx2x_chip_cleanup(struct bnx2x *bp, int unload_mode, bool keep_link)
{ … }
void bnx2x_disable_close_the_gate(struct bnx2x *bp)
{ … }
static void bnx2x_set_234_gates(struct bnx2x *bp, bool close)
{ … }
#define SHARED_MF_CLP_MAGIC …
static void bnx2x_clp_reset_prep(struct bnx2x *bp, u32 *magic_val)
{ … }
static void bnx2x_clp_reset_done(struct bnx2x *bp, u32 magic_val)
{ … }
static void bnx2x_reset_mcp_prep(struct bnx2x *bp, u32 *magic_val)
{ … }
#define MCP_TIMEOUT …
#define MCP_ONE_TIMEOUT …
static void bnx2x_mcp_wait_one(struct bnx2x *bp)
{ … }
static int bnx2x_init_shmem(struct bnx2x *bp)
{ … }
static int bnx2x_reset_mcp_comp(struct bnx2x *bp, u32 magic_val)
{ … }
static void bnx2x_pxp_prep(struct bnx2x *bp)
{ … }
static void bnx2x_process_kill_chip_reset(struct bnx2x *bp, bool global)
{ … }
static int bnx2x_er_poll_igu_vq(struct bnx2x *bp)
{ … }
static int bnx2x_process_kill(struct bnx2x *bp, bool global)
{ … }
static int bnx2x_leader_reset(struct bnx2x *bp)
{ … }
static void bnx2x_recovery_failed(struct bnx2x *bp)
{ … }
static void bnx2x_parity_recover(struct bnx2x *bp)
{ … }
static int bnx2x_udp_port_update(struct bnx2x *bp)
{ … }
static int bnx2x_udp_tunnel_sync(struct net_device *netdev, unsigned int table)
{ … }
static const struct udp_tunnel_nic_info bnx2x_udp_tunnels = …;
static int bnx2x_close(struct net_device *dev);
static void bnx2x_sp_rtnl_task(struct work_struct *work)
{ … }
static void bnx2x_period_task(struct work_struct *work)
{ … }
static u32 bnx2x_get_pretend_reg(struct bnx2x *bp)
{ … }
static bool bnx2x_prev_unload_close_umac(struct bnx2x *bp,
u8 port, u32 reset_reg,
struct bnx2x_mac_vals *vals)
{ … }
static void bnx2x_prev_unload_close_mac(struct bnx2x *bp,
struct bnx2x_mac_vals *vals)
{ … }
#define BNX2X_PREV_UNDI_PROD_ADDR(p) …
#define BNX2X_PREV_UNDI_PROD_ADDR_H(f) …
#define BNX2X_PREV_UNDI_RCQ(val) …
#define BNX2X_PREV_UNDI_BD(val) …
#define BNX2X_PREV_UNDI_PROD(rcq, bd) …
#define BCM_5710_UNDI_FW_MF_MAJOR …
#define BCM_5710_UNDI_FW_MF_MINOR …
#define BCM_5710_UNDI_FW_MF_VERS …
static bool bnx2x_prev_is_after_undi(struct bnx2x *bp)
{ … }
static void bnx2x_prev_unload_undi_inc(struct bnx2x *bp, u8 inc)
{ … }
static int bnx2x_prev_mcp_done(struct bnx2x *bp)
{ … }
static struct bnx2x_prev_path_list *
bnx2x_prev_path_get_entry(struct bnx2x *bp)
{ … }
static int bnx2x_prev_path_mark_eeh(struct bnx2x *bp)
{ … }
static bool bnx2x_prev_is_path_marked(struct bnx2x *bp)
{ … }
bool bnx2x_port_after_undi(struct bnx2x *bp)
{ … }
static int bnx2x_prev_mark_path(struct bnx2x *bp, bool after_undi)
{ … }
static int bnx2x_do_flr(struct bnx2x *bp)
{ … }
static int bnx2x_prev_unload_uncommon(struct bnx2x *bp)
{ … }
static int bnx2x_prev_unload_common(struct bnx2x *bp)
{ … }
static int bnx2x_prev_unload(struct bnx2x *bp)
{ … }
static void bnx2x_get_common_hwinfo(struct bnx2x *bp)
{ … }
#define IGU_FID(val) …
#define IGU_VEC(val) …
static int bnx2x_get_igu_cam_info(struct bnx2x *bp)
{ … }
static void bnx2x_link_settings_supported(struct bnx2x *bp, u32 switch_cfg)
{ … }
static void bnx2x_link_settings_requested(struct bnx2x *bp)
{ … }
static void bnx2x_set_mac_buf(u8 *mac_buf, u32 mac_lo, u16 mac_hi)
{ … }
static void bnx2x_get_port_hwinfo(struct bnx2x *bp)
{ … }
void bnx2x_get_iscsi_info(struct bnx2x *bp)
{ … }
static void bnx2x_get_ext_wwn_info(struct bnx2x *bp, int func)
{ … }
static int bnx2x_shared_fcoe_funcs(struct bnx2x *bp)
{ … }
static void bnx2x_get_fcoe_info(struct bnx2x *bp)
{ … }
static void bnx2x_get_cnic_info(struct bnx2x *bp)
{ … }
static void bnx2x_get_cnic_mac_hwinfo(struct bnx2x *bp)
{ … }
static void bnx2x_get_mac_hwinfo(struct bnx2x *bp)
{ … }
static bool bnx2x_get_dropless_info(struct bnx2x *bp)
{ … }
static void validate_set_si_mode(struct bnx2x *bp)
{ … }
static int bnx2x_get_hwinfo(struct bnx2x *bp)
{ … }
static void bnx2x_read_fwinfo(struct bnx2x *bp)
{ … }
static void bnx2x_set_modes_bitmap(struct bnx2x *bp)
{ … }
static int bnx2x_init_bp(struct bnx2x *bp)
{ … }
static int bnx2x_open(struct net_device *dev)
{ … }
static int bnx2x_close(struct net_device *dev)
{ … }
struct bnx2x_mcast_list_elem_group
{ … };
#define MCAST_ELEMS_PER_PG …
static void bnx2x_free_mcast_macs_list(struct list_head *mcast_group_list)
{ … }
static int bnx2x_init_mcast_macs_list(struct bnx2x *bp,
struct bnx2x_mcast_ramrod_params *p,
struct list_head *mcast_group_list)
{ … }
static int bnx2x_set_uc_list(struct bnx2x *bp)
{ … }
static int bnx2x_set_mc_list_e1x(struct bnx2x *bp)
{ … }
static int bnx2x_set_mc_list(struct bnx2x *bp)
{ … }
static void bnx2x_set_rx_mode(struct net_device *dev)
{ … }
void bnx2x_set_rx_mode_inner(struct bnx2x *bp)
{ … }
static int bnx2x_mdio_read(struct net_device *netdev, int prtad,
int devad, u16 addr)
{ … }
static int bnx2x_mdio_write(struct net_device *netdev, int prtad, int devad,
u16 addr, u16 value)
{ … }
static int bnx2x_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{ … }
static int bnx2x_validate_addr(struct net_device *dev)
{ … }
static int bnx2x_get_phys_port_id(struct net_device *netdev,
struct netdev_phys_item_id *ppid)
{ … }
static netdev_features_t bnx2x_features_check(struct sk_buff *skb,
struct net_device *dev,
netdev_features_t features)
{ … }
static int __bnx2x_vlan_configure_vid(struct bnx2x *bp, u16 vid, bool add)
{ … }
static int bnx2x_vlan_configure_vid_list(struct bnx2x *bp)
{ … }
static void bnx2x_vlan_configure(struct bnx2x *bp, bool set_rx_mode)
{ … }
int bnx2x_vlan_reconfigure_vid(struct bnx2x *bp)
{ … }
static int bnx2x_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
{ … }
static int bnx2x_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
{ … }
static const struct net_device_ops bnx2x_netdev_ops = …;
static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
struct net_device *dev, unsigned long board_type)
{ … }
static int bnx2x_check_firmware(struct bnx2x *bp)
{ … }
static void be32_to_cpu_n(const u8 *_source, u8 *_target, u32 n)
{ … }
static void bnx2x_prep_ops(const u8 *_source, u8 *_target, u32 n)
{ … }
static void bnx2x_prep_iro(const u8 *_source, u8 *_target, u32 n)
{ … }
static void be16_to_cpu_n(const u8 *_source, u8 *_target, u32 n)
{ … }
#define BNX2X_ALLOC_AND_SET(arr, lbl, func) …
static int bnx2x_init_firmware(struct bnx2x *bp)
{ … }
static void bnx2x_release_firmware(struct bnx2x *bp)
{ … }
static struct bnx2x_func_sp_drv_ops bnx2x_func_sp_drv = …;
void bnx2x__init_func_obj(struct bnx2x *bp)
{ … }
static int bnx2x_set_qm_cid_count(struct bnx2x *bp)
{ … }
static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev, int cnic_cnt)
{ … }
static int set_max_cos_est(int chip_id)
{ … }
static int set_is_vf(int chip_id)
{ … }
#define tsgen_ctrl …
#define tsgen_freecount …
#define tsgen_synctime_t0 …
#define tsgen_offset_t0 …
#define tsgen_drift_t0 …
#define tsgen_synctime_t1 …
#define tsgen_offset_t1 …
#define tsgen_drift_t1 …
static int bnx2x_send_update_drift_ramrod(struct bnx2x *bp, int drift_dir,
int best_val, int best_period)
{ … }
static int bnx2x_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
{ … }
static int bnx2x_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
{ … }
static int bnx2x_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
{ … }
static int bnx2x_ptp_settime(struct ptp_clock_info *ptp,
const struct timespec64 *ts)
{ … }
static int bnx2x_ptp_enable(struct ptp_clock_info *ptp,
struct ptp_clock_request *rq, int on)
{ … }
void bnx2x_register_phc(struct bnx2x *bp)
{ … }
static int bnx2x_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{ … }
static void __bnx2x_remove(struct pci_dev *pdev,
struct net_device *dev,
struct bnx2x *bp,
bool remove_netdev)
{ … }
static void bnx2x_remove_one(struct pci_dev *pdev)
{ … }
static int bnx2x_eeh_nic_unload(struct bnx2x *bp)
{ … }
static pci_ers_result_t bnx2x_io_error_detected(struct pci_dev *pdev,
pci_channel_state_t state)
{ … }
static pci_ers_result_t bnx2x_io_slot_reset(struct pci_dev *pdev)
{ … }
static void bnx2x_io_resume(struct pci_dev *pdev)
{ … }
static const struct pci_error_handlers bnx2x_err_handler = …;
static void bnx2x_shutdown(struct pci_dev *pdev)
{ … }
static struct pci_driver bnx2x_pci_driver = …;
static int __init bnx2x_init(void)
{ … }
static void __exit bnx2x_cleanup(void)
{ … }
void bnx2x_notify_link_changed(struct bnx2x *bp)
{ … }
module_init(…) …;
module_exit(bnx2x_cleanup);
static int bnx2x_set_iscsi_eth_mac_addr(struct bnx2x *bp)
{ … }
static void bnx2x_cnic_sp_post(struct bnx2x *bp, int count)
{ … }
static int bnx2x_cnic_sp_queue(struct net_device *dev,
struct kwqe_16 *kwqes[], u32 count)
{ … }
static int bnx2x_cnic_ctl_send(struct bnx2x *bp, struct cnic_ctl_info *ctl)
{ … }
static int bnx2x_cnic_ctl_send_bh(struct bnx2x *bp, struct cnic_ctl_info *ctl)
{ … }
int bnx2x_cnic_notify(struct bnx2x *bp, int cmd)
{ … }
static void bnx2x_cnic_cfc_comp(struct bnx2x *bp, int cid, u8 err)
{ … }
static void bnx2x_set_iscsi_eth_rx_mode(struct bnx2x *bp, bool start)
{ … }
static int bnx2x_drv_ctl(struct net_device *dev, struct drv_ctl_info *ctl)
{ … }
static int bnx2x_get_fc_npiv(struct net_device *dev,
struct cnic_fc_npiv_tbl *cnic_tbl)
{ … }
void bnx2x_setup_cnic_irq_info(struct bnx2x *bp)
{ … }
void bnx2x_setup_cnic_info(struct bnx2x *bp)
{ … }
static int bnx2x_register_cnic(struct net_device *dev, struct cnic_ops *ops,
void *data)
{ … }
static int bnx2x_unregister_cnic(struct net_device *dev)
{ … }
static struct cnic_eth_dev *bnx2x_cnic_probe(struct net_device *dev)
{ … }
static u32 bnx2x_rx_ustorm_prods_offset(struct bnx2x_fastpath *fp)
{ … }
int bnx2x_pretend_func(struct bnx2x *bp, u16 pretend_func_val)
{ … }
static void bnx2x_ptp_task(struct work_struct *work)
{ … }
void bnx2x_set_rx_ts(struct bnx2x *bp, struct sk_buff *skb)
{ … }
static u64 bnx2x_cyclecounter_read(const struct cyclecounter *cc)
{ … }
static void bnx2x_init_cyclecounter(struct bnx2x *bp)
{ … }
static int bnx2x_send_reset_timesync_ramrod(struct bnx2x *bp)
{ … }
static int bnx2x_enable_ptp_packets(struct bnx2x *bp)
{ … }
#define BNX2X_P2P_DETECT_PARAM_MASK …
#define BNX2X_P2P_DETECT_RULE_MASK …
#define BNX2X_PTP_TX_ON_PARAM_MASK …
#define BNX2X_PTP_TX_ON_RULE_MASK …
#define BNX2X_PTP_V1_L4_PARAM_MASK …
#define BNX2X_PTP_V1_L4_RULE_MASK …
#define BNX2X_PTP_V2_L4_PARAM_MASK …
#define BNX2X_PTP_V2_L4_RULE_MASK …
#define BNX2X_PTP_V2_L2_PARAM_MASK …
#define BNX2X_PTP_V2_L2_RULE_MASK …
#define BNX2X_PTP_V2_PARAM_MASK …
#define BNX2X_PTP_V2_RULE_MASK …
int bnx2x_configure_ptp_filters(struct bnx2x *bp)
{ … }
static int bnx2x_hwtstamp_ioctl(struct bnx2x *bp, struct ifreq *ifr)
{ … }
static int bnx2x_configure_ptp(struct bnx2x *bp)
{ … }
void bnx2x_init_ptp(struct bnx2x *bp)
{ … }