Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
bnx2x_main.c File Reference
#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 <net/ip.h>
#include <net/ipv6.h>
#include <net/tcp.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_dcb.h"
#include "bnx2x_sp.h"
#include <linux/firmware.h>
#include "bnx2x_fw_file_hdr.h"

Go to the source code of this file.

Data Structures

struct  pbf_pN_buf_regs
 
struct  pbf_pN_cmd_regs
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define FW_FILE_VERSION
 
#define FW_FILE_NAME_E1   "bnx2x/bnx2x-e1-" FW_FILE_VERSION ".fw"
 
#define FW_FILE_NAME_E1H   "bnx2x/bnx2x-e1h-" FW_FILE_VERSION ".fw"
 
#define FW_FILE_NAME_E2   "bnx2x/bnx2x-e2-" FW_FILE_VERSION ".fw"
 
#define MAC_LEADING_ZERO_CNT   (ALIGN(ETH_ALEN, sizeof(u32)) - ETH_ALEN)
 
#define TX_TIMEOUT   (5*HZ)
 
#define INT_MODE_INTx   1
 
#define INT_MODE_MSI   2
 
#define PCI_DEVICE_ID_NX2_57710   CHIP_NUM_57710
 
#define PCI_DEVICE_ID_NX2_57711   CHIP_NUM_57711
 
#define PCI_DEVICE_ID_NX2_57711E   CHIP_NUM_57711E
 
#define PCI_DEVICE_ID_NX2_57712   CHIP_NUM_57712
 
#define PCI_DEVICE_ID_NX2_57712_MF   CHIP_NUM_57712_MF
 
#define PCI_DEVICE_ID_NX2_57800   CHIP_NUM_57800
 
#define PCI_DEVICE_ID_NX2_57800_MF   CHIP_NUM_57800_MF
 
#define PCI_DEVICE_ID_NX2_57810   CHIP_NUM_57810
 
#define PCI_DEVICE_ID_NX2_57810_MF   CHIP_NUM_57810_MF
 
#define PCI_DEVICE_ID_NX2_57840_O   CHIP_NUM_57840_OBSOLETE
 
#define PCI_DEVICE_ID_NX2_57840_4_10   CHIP_NUM_57840_4_10
 
#define PCI_DEVICE_ID_NX2_57840_2_20   CHIP_NUM_57840_2_20
 
#define PCI_DEVICE_ID_NX2_57840_MFO   CHIP_NUM_57840_MF_OBSOLETE
 
#define PCI_DEVICE_ID_NX2_57840_MF   CHIP_NUM_57840_MF
 
#define PCI_DEVICE_ID_NX2_57811   CHIP_NUM_57811
 
#define PCI_DEVICE_ID_NX2_57811_MF   CHIP_NUM_57811_MF
 
#define BNX2X_PREV_WAIT_NEEDED   1
 
#define DMAE_DP_SRC_GRC   "grc src_addr [%08x]"
 
#define DMAE_DP_SRC_PCI   "pci src_addr [%x:%08x]"
 
#define DMAE_DP_DST_GRC   "grc dst_addr [%08x]"
 
#define DMAE_DP_DST_PCI   "pci dst_addr [%x:%08x]"
 
#define DMAE_DP_DST_NONE   "dst_addr [none]"
 
#define FLR_WAIT_USEC   10000 /* 10 miliseconds */
 
#define FLR_WAIT_INTERVAL   50 /* usec */
 
#define FLR_POLL_CNT   (FLR_WAIT_USEC/FLR_WAIT_INTERVAL) /* 200 */
 
#define OP_GEN_PARAM(param)   (((param) << SDM_OP_GEN_COMP_PARAM_SHIFT) & SDM_OP_GEN_COMP_PARAM)
 
#define OP_GEN_TYPE(type)   (((type) << SDM_OP_GEN_COMP_TYPE_SHIFT) & SDM_OP_GEN_COMP_TYPE)
 
#define OP_GEN_AGG_VECT(index)   (((index) << SDM_OP_GEN_AGG_VECT_IDX_SHIFT) & SDM_OP_GEN_AGG_VECT_IDX)
 
#define DRV_INFO_ETH_STAT_NUM_MACS_REQUIRED   3
 
#define BNX2X_DEF_SB_ATT_IDX   0x0001
 
#define BNX2X_DEF_SB_IDX   0x0002
 
#define BNX2X_RECOVERY_GLOB_REG   MISC_REG_GENERIC_POR_1
 
#define BNX2X_PATH0_LOAD_CNT_MASK   0x000000ff
 
#define BNX2X_PATH0_LOAD_CNT_SHIFT   0
 
#define BNX2X_PATH1_LOAD_CNT_MASK   0x0000ff00
 
#define BNX2X_PATH1_LOAD_CNT_SHIFT   8
 
#define BNX2X_PATH0_RST_IN_PROG_BIT   0x00010000
 
#define BNX2X_PATH1_RST_IN_PROG_BIT   0x00020000
 
#define BNX2X_GLOBAL_RESET_BIT   0x00040000
 
#define FNAME   0x8
 
#define SHARED_MF_CLP_MAGIC   0x80000000 /* `magic' bit */
 
#define MCP_TIMEOUT   5000 /* 5 seconds (in ms) */
 
#define MCP_ONE_TIMEOUT   100 /* 100 ms */
 
#define BNX2X_PREV_UNDI_PROD_ADDR(p)   (BAR_TSTRORM_INTMEM + 0x1508 + ((p) << 4))
 
#define BNX2X_PREV_UNDI_RCQ(val)   ((val) & 0xffff)
 
#define BNX2X_PREV_UNDI_BD(val)   ((val) >> 16 & 0xffff)
 
#define BNX2X_PREV_UNDI_PROD(rcq, bd)   ((bd) << 16 | (rcq))
 
#define IGU_FID(val)   GET_FIELD((val), IGU_REG_MAPPING_MEMORY_FID)
 
#define IGU_VEC(val)   GET_FIELD((val), IGU_REG_MAPPING_MEMORY_VECTOR)
 
#define BNX2X_ALLOC_AND_SET(arr, lbl, func)
 

Enumerations

enum  bnx2x_board_type {
  BCM57710 = 0, BCM57711, BCM57711E, BCM57712,
  BCM57712_MF, BCM57800, BCM57800_MF, BCM57810,
  BCM57810_MF, BCM57840_O, BCM57840_4_10, BCM57840_2_20,
  BCM57840_MFO, BCM57840_MF, BCM57811, BCM57811_MF
}
 

Functions

 MODULE_AUTHOR ("Eliezer Tamir")
 
 MODULE_DESCRIPTION ("Broadcom NetXtreme II ""BCM57710/57711/57711E/""57712/57712_MF/57800/57800_MF/57810/57810_MF/""57840/57840_MF Driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_MODULE_VERSION)
 
 MODULE_FIRMWARE (FW_FILE_NAME_E1)
 
 MODULE_FIRMWARE (FW_FILE_NAME_E1H)
 
 MODULE_FIRMWARE (FW_FILE_NAME_E2)
 
 module_param (num_queues, int, 0)
 
 MODULE_PARM_DESC (num_queues," Set number of queues (default is as a number of CPUs)")
 
 module_param (disable_tpa, int, 0)
 
 MODULE_PARM_DESC (disable_tpa," Disable the TPA (LRO) feature")
 
 module_param (int_mode, int, 0)
 
 MODULE_PARM_DESC (int_mode," Force interrupt mode other than MSI-X ""(1 INT#x; 2 MSI)")
 
 module_param (dropless_fc, int, 0)
 
 MODULE_PARM_DESC (dropless_fc," Pause on exhausted host ring")
 
 module_param (mrrs, int, 0)
 
 MODULE_PARM_DESC (mrrs," Force Max Read Req Size (0..3) (for debug)")
 
 module_param (debug, int, 0)
 
 MODULE_PARM_DESC (debug," Default debug msglevel")
 
 MODULE_DEVICE_TABLE (pci, bnx2x_pci_tbl)
 
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_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)
 
void bnx2x_fw_dump_lvl (struct bnx2x *bp, const char *lvl)
 
void bnx2x_panic_dump (struct bnx2x *bp)
 
void bnx2x_int_enable (struct bnx2x *bp)
 
void bnx2x_int_disable (struct bnx2x *bp)
 
void bnx2x_int_disable_sync (struct bnx2x *bp, int disable_hw)
 
void bnx2x_sp_event (struct bnx2x_fastpath *fp, union eth_rx_cqe *rr_cqe)
 
void bnx2x_update_rx_prod (struct bnx2x *bp, struct bnx2x_fastpath *fp, u16 bd_prod, u16 rx_comp_prod, u16 rx_sge_prod)
 
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)
 
void bnx2x_calc_fc_adv (struct bnx2x *bp)
 
u8 bnx2x_initial_phy_init (struct bnx2x *bp, int load_mode)
 
void bnx2x_link_set (struct bnx2x *bp)
 
void bnx2x_force_link_reset (struct bnx2x *bp)
 
u8 bnx2x_link_test (struct bnx2x *bp, u8 is_serdes)
 
void bnx2x_read_mf_cfg (struct bnx2x *bp)
 
void bnx2x__link_status_update (struct bnx2x *bp)
 
u32 bnx2x_fw_command (struct bnx2x *bp, u32 command, u32 param)
 
void bnx2x_func_init (struct bnx2x *bp, struct bnx2x_func_init_params *p)
 
int bnx2x_sp_post (struct bnx2x *bp, int command, int cid, u32 data_hi, u32 data_lo, int cmd_type)
 
void bnx2x_set_reset_global (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)
 
bool bnx2x_chk_parity_attn (struct bnx2x *bp, bool *global, bool print)
 
void bnx2x_igu_ack_sb (struct bnx2x *bp, u8 igu_sb_id, u8 segment, u16 index, u8 op, u8 update)
 
irqreturn_t bnx2x_msix_sp_int (int irq, void *dev_instance)
 
void bnx2x_drv_pulse (struct bnx2x *bp)
 
void bnx2x_update_coalesce (struct bnx2x *bp)
 
void 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)
 
void bnx2x_set_storm_rx_mode (struct bnx2x *bp)
 
void bnx2x_nic_init (struct bnx2x *bp, u32 load_code)
 
void bnx2x_pf_disable (struct bnx2x *bp)
 
void bnx2x_free_mem (struct bnx2x *bp)
 
int bnx2x_alloc_mem (struct bnx2x *bp)
 
int bnx2x_set_mac_one (struct bnx2x *bp, u8 *mac, struct bnx2x_vlan_mac_obj *obj, bool set, int mac_type, unsigned long *ramrod_flags)
 
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)
 
void bnx2x_set_int_mode (struct bnx2x *bp)
 
void bnx2x_ilt_set_info (struct bnx2x *bp)
 
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)
 
u32 bnx2x_send_unload_req (struct bnx2x *bp, int unload_mode)
 
void bnx2x_send_unload_done (struct bnx2x *bp, bool keep_link)
 
void bnx2x_chip_cleanup (struct bnx2x *bp, int unload_mode, bool keep_link)
 
void bnx2x_disable_close_the_gate (struct bnx2x *bp)
 
int bnx2x_leader_reset (struct bnx2x *bp)
 
void bnx2x_get_iscsi_info (struct bnx2x *bp)
 
void bnx2x_set_rx_mode (struct net_device *dev)
 
void bnx2x__init_func_obj (struct bnx2x *bp)
 
void bnx2x_notify_link_changed (struct bnx2x *bp)
 
 module_init (bnx2x_init)
 
 module_exit (bnx2x_cleanup)
 

Variables

int num_queues
 
int int_mode
 
struct workqueue_structbnx2x_wq
 

Macro Definition Documentation

#define BNX2X_ALLOC_AND_SET (   arr,
  lbl,
  func 
)
Value:
do { \
u32 len = be32_to_cpu(fw_hdr->arr.len); \
bp->arr = kmalloc(len, GFP_KERNEL); \
if (!bp->arr) \
goto lbl; \
func(bp->firmware->data + be32_to_cpu(fw_hdr->arr.offset), \
(u8 *)bp->arr, len); \
} while (0)

Definition at line 11616 of file bnx2x_main.c.

#define BNX2X_DEF_SB_ATT_IDX   0x0001

Definition at line 3462 of file bnx2x_main.c.

#define BNX2X_DEF_SB_IDX   0x0002

Definition at line 3463 of file bnx2x_main.c.

#define BNX2X_GLOBAL_RESET_BIT   0x00040000

Definition at line 3853 of file bnx2x_main.c.

#define BNX2X_PATH0_LOAD_CNT_MASK   0x000000ff

Definition at line 3847 of file bnx2x_main.c.

#define BNX2X_PATH0_LOAD_CNT_SHIFT   0

Definition at line 3848 of file bnx2x_main.c.

#define BNX2X_PATH0_RST_IN_PROG_BIT   0x00010000

Definition at line 3851 of file bnx2x_main.c.

#define BNX2X_PATH1_LOAD_CNT_MASK   0x0000ff00

Definition at line 3849 of file bnx2x_main.c.

#define BNX2X_PATH1_LOAD_CNT_SHIFT   8

Definition at line 3850 of file bnx2x_main.c.

#define BNX2X_PATH1_RST_IN_PROG_BIT   0x00020000

Definition at line 3852 of file bnx2x_main.c.

#define BNX2X_PREV_UNDI_BD (   val)    ((val) >> 16 & 0xffff)

Definition at line 9301 of file bnx2x_main.c.

#define BNX2X_PREV_UNDI_PROD (   rcq,
  bd 
)    ((bd) << 16 | (rcq))

Definition at line 9302 of file bnx2x_main.c.

#define BNX2X_PREV_UNDI_PROD_ADDR (   p)    (BAR_TSTRORM_INTMEM + 0x1508 + ((p) << 4))

Definition at line 9299 of file bnx2x_main.c.

#define BNX2X_PREV_UNDI_RCQ (   val)    ((val) & 0xffff)

Definition at line 9300 of file bnx2x_main.c.

#define BNX2X_PREV_WAIT_NEEDED   1

Definition at line 242 of file bnx2x_main.c.

#define BNX2X_RECOVERY_GLOB_REG   MISC_REG_GENERIC_POR_1

Definition at line 3845 of file bnx2x_main.c.

#define DMAE_DP_DST_GRC   "grc dst_addr [%08x]"

Definition at line 334 of file bnx2x_main.c.

#define DMAE_DP_DST_NONE   "dst_addr [none]"

Definition at line 336 of file bnx2x_main.c.

#define DMAE_DP_DST_PCI   "pci dst_addr [%x:%08x]"

Definition at line 335 of file bnx2x_main.c.

#define DMAE_DP_SRC_GRC   "grc src_addr [%08x]"

Definition at line 332 of file bnx2x_main.c.

#define DMAE_DP_SRC_PCI   "pci src_addr [%x:%08x]"

Definition at line 333 of file bnx2x_main.c.

#define DRV_INFO_ETH_STAT_NUM_MACS_REQUIRED   3

Definition at line 3048 of file bnx2x_main.c.

#define FLR_POLL_CNT   (FLR_WAIT_USEC/FLR_WAIT_INTERVAL) /* 200 */

Definition at line 937 of file bnx2x_main.c.

#define FLR_WAIT_INTERVAL   50 /* usec */

Definition at line 936 of file bnx2x_main.c.

#define FLR_WAIT_USEC   10000 /* 10 miliseconds */

Definition at line 935 of file bnx2x_main.c.

#define FNAME   0x8
#define FW_FILE_NAME_E1   "bnx2x/bnx2x-e1-" FW_FILE_VERSION ".fw"

Definition at line 73 of file bnx2x_main.c.

#define FW_FILE_NAME_E1H   "bnx2x/bnx2x-e1h-" FW_FILE_VERSION ".fw"

Definition at line 74 of file bnx2x_main.c.

#define FW_FILE_NAME_E2   "bnx2x/bnx2x-e2-" FW_FILE_VERSION ".fw"

Definition at line 75 of file bnx2x_main.c.

#define FW_FILE_VERSION
Value:

Definition at line 68 of file bnx2x_main.c.

#define IGU_FID (   val)    GET_FIELD((val), IGU_REG_MAPPING_MEMORY_FID)

Definition at line 9792 of file bnx2x_main.c.

#define IGU_VEC (   val)    GET_FIELD((val), IGU_REG_MAPPING_MEMORY_VECTOR)

Definition at line 9793 of file bnx2x_main.c.

#define INT_MODE_INTx   1

Definition at line 107 of file bnx2x_main.c.

#define INT_MODE_MSI   2

Definition at line 108 of file bnx2x_main.c.

#define MAC_LEADING_ZERO_CNT   (ALIGN(ETH_ALEN, sizeof(u32)) - ETH_ALEN)

Definition at line 77 of file bnx2x_main.c.

#define MCP_ONE_TIMEOUT   100 /* 100 ms */

Definition at line 8569 of file bnx2x_main.c.

#define MCP_TIMEOUT   5000 /* 5 seconds (in ms) */

Definition at line 8568 of file bnx2x_main.c.

#define OP_GEN_AGG_VECT (   index)    (((index) << SDM_OP_GEN_AGG_VECT_IDX_SHIFT) & SDM_OP_GEN_AGG_VECT_IDX)

Definition at line 1125 of file bnx2x_main.c.

#define OP_GEN_PARAM (   param)    (((param) << SDM_OP_GEN_COMP_PARAM_SHIFT) & SDM_OP_GEN_COMP_PARAM)

Definition at line 1119 of file bnx2x_main.c.

#define OP_GEN_TYPE (   type)    (((type) << SDM_OP_GEN_COMP_TYPE_SHIFT) & SDM_OP_GEN_COMP_TYPE)

Definition at line 1122 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57710   CHIP_NUM_57710

Definition at line 172 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57711   CHIP_NUM_57711

Definition at line 175 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57711E   CHIP_NUM_57711E

Definition at line 178 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57712   CHIP_NUM_57712

Definition at line 181 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57712_MF   CHIP_NUM_57712_MF

Definition at line 184 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57800   CHIP_NUM_57800

Definition at line 187 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57800_MF   CHIP_NUM_57800_MF

Definition at line 190 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57810   CHIP_NUM_57810

Definition at line 193 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57810_MF   CHIP_NUM_57810_MF

Definition at line 196 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57811   CHIP_NUM_57811

Definition at line 214 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57811_MF   CHIP_NUM_57811_MF

Definition at line 217 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57840_2_20   CHIP_NUM_57840_2_20

Definition at line 205 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57840_4_10   CHIP_NUM_57840_4_10

Definition at line 202 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57840_MF   CHIP_NUM_57840_MF

Definition at line 211 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57840_MFO   CHIP_NUM_57840_MF_OBSOLETE

Definition at line 208 of file bnx2x_main.c.

#define PCI_DEVICE_ID_NX2_57840_O   CHIP_NUM_57840_OBSOLETE

Definition at line 199 of file bnx2x_main.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 18 of file bnx2x_main.c.

#define SHARED_MF_CLP_MAGIC   0x80000000 /* `magic' bit */

Definition at line 8516 of file bnx2x_main.c.

#define TX_TIMEOUT   (5*HZ)

Definition at line 80 of file bnx2x_main.c.

Enumeration Type Documentation

Enumerator:
BCM57710 
BCM57711 
BCM57711E 
BCM57712 
BCM57712_MF 
BCM57800 
BCM57800_MF 
BCM57810 
BCM57810_MF 
BCM57840_O 
BCM57840_4_10 
BCM57840_2_20 
BCM57840_MFO 
BCM57840_MF 
BCM57811 
BCM57811_MF 

Definition at line 130 of file bnx2x_main.c.

Function Documentation

void bnx2x__init_func_obj ( struct bnx2x bp)

bnx2x__init_func_obj - init function object

: driver handle

Initializes the Function Object with the appropriate parameters which include a function slow path driver interface.

Definition at line 11735 of file bnx2x_main.c.

void bnx2x__link_status_update ( struct bnx2x bp)

bnx2x__link_status_update - handles link status change.

: driver handle

Definition at line 2445 of file bnx2x_main.c.

int bnx2x_acquire_hw_lock ( struct bnx2x bp,
u32  resource 
)

bnx2x_acquire_hw_lock - acquire HW lock.

: driver handle : resource bit which was locked

Definition at line 1773 of file bnx2x_main.c.

int bnx2x_alloc_mem ( struct bnx2x bp)

bnx2x_alloc_mem - allocate driver's memory.

: driver handle

Definition at line 7449 of file bnx2x_main.c.

void bnx2x_calc_fc_adv ( struct bnx2x bp)

Definition at line 2083 of file bnx2x_main.c.

void bnx2x_chip_cleanup ( struct bnx2x bp,
int  unload_mode,
bool  keep_link 
)

bnx2x_chip_cleanup - cleanup chip internals.

: driver handle : COMMON, PORT, FUNCTION : true iff link should be kept up.

  • Cleanup MAC configuration.
  • Closes clients.
  • etc.

Definition at line 8329 of file bnx2x_main.c.

bool bnx2x_chk_parity_attn ( struct bnx2x bp,
bool global,
bool  print 
)

bnx2x_chk_parity_attn - checks for parity attentions.

: driver handle : true if there was a global attention : show parity attention in syslog

Definition at line 4349 of file bnx2x_main.c.

bool bnx2x_clear_pf_load ( struct bnx2x bp)

bnx2x_clear_pf_load - clear pf load mark

: driver handle

Should be run under rtnl lock. Decrements the load counter for the current engine. Returns whether other functions are still loaded

Definition at line 3992 of file bnx2x_main.c.

int bnx2x_del_all_macs ( struct bnx2x bp,
struct bnx2x_vlan_mac_obj mac_obj,
int  mac_type,
bool  wait_for_comp 
)

bnx2x_del_all_macs - delete all MACs configured for the specific MAC object

: driver handle : MAC object handle : type of the MACs to clear (BNX2X_XXX_MAC) : if 'true' block until completion

Deletes all MACs of the specific type (e.g. ETH, UC list).

Returns zero if operation has successfully completed, a positive value if the operation has been successfully scheduled and a negative - if a requested operations has failed.

Definition at line 7574 of file bnx2x_main.c.

void bnx2x_disable_close_the_gate ( struct bnx2x bp)

Definition at line 8454 of file bnx2x_main.c.

u32 bnx2x_dmae_opcode ( struct bnx2x bp,
u8  src_type,
u8  dst_type,
bool  with_comp,
u8  comp_type 
)

Definition at line 363 of file bnx2x_main.c.

u32 bnx2x_dmae_opcode_add_comp ( u32  opcode,
u8  comp_type 
)

Definition at line 352 of file bnx2x_main.c.

u32 bnx2x_dmae_opcode_clr_src_reset ( u32  opcode)

Definition at line 358 of file bnx2x_main.c.

void bnx2x_drv_pulse ( struct bnx2x bp)

bnx2x_drv_pulse - write driver pulse to shmem

: driver handle

writes the value in bp->fw_drv_pulse_wr_seq to drv_pulse mbox in the shmem.

Definition at line 5072 of file bnx2x_main.c.

void bnx2x_force_link_reset ( struct bnx2x bp)

bnx2x_force_link_reset - Forces link reset, and put the PHY in reset as well.

: driver handle

Definition at line 2187 of file bnx2x_main.c.

void bnx2x_free_mem ( struct bnx2x bp)

bnx2x_free_mem - release driver's memory.

: driver handle

Definition at line 7346 of file bnx2x_main.c.

void bnx2x_func_init ( struct bnx2x bp,
struct bnx2x_func_init_params p 
)

Definition at line 2744 of file bnx2x_main.c.

u32 bnx2x_fw_command ( struct bnx2x bp,
u32  command,
u32  param 
)

bnx2x_fw_command - send the MCP a request

: driver handle : request

Parameters
request's parameter

block until there is a reply

Definition at line 2689 of file bnx2x_main.c.

void bnx2x_fw_dump_lvl ( struct bnx2x bp,
const char lvl 
)

Definition at line 643 of file bnx2x_main.c.

int bnx2x_get_gpio ( struct bnx2x bp,
int  gpio_num,
u8  port 
)

Definition at line 1856 of file bnx2x_main.c.

void bnx2x_get_iscsi_info ( struct bnx2x bp)

Definition at line 10227 of file bnx2x_main.c.

void bnx2x_igu_ack_sb ( struct bnx2x bp,
u8  igu_sb_id,
u8  segment,
u16  index,
u8  op,
u8  update 
)

bnx2x_igu_ack_sb - update IGU with current SB value

: driver handle : SB id : SB segment : SB index : SB operation : is HW update required

Definition at line 4559 of file bnx2x_main.c.

void bnx2x_ilt_set_info ( struct bnx2x bp)

bnx2x_ilt_set_info - prepare ILT configurations.

: driver handle

Definition at line 7666 of file bnx2x_main.c.

u8 bnx2x_initial_phy_init ( struct bnx2x bp,
int  load_mode 
)

bnx2x_initial_phy_init - initialize link parameters structure variables.

: driver handle : current mode

Definition at line 2109 of file bnx2x_main.c.

void bnx2x_int_disable ( struct bnx2x bp)

Definition at line 1486 of file bnx2x_main.c.

void bnx2x_int_disable_sync ( struct bnx2x bp,
int  disable_hw 
)

bnx2x_int_disable_sync - disable interrupts.

: driver handle : true, disable HW interrupts.

This function ensures that there are no ISRs or SP DPCs (sp_task) are running after it returns.

Definition at line 1494 of file bnx2x_main.c.

void bnx2x_int_enable ( struct bnx2x bp)

bnx2x_int_enable - enable HW interrupts.

: driver handle

Definition at line 1421 of file bnx2x_main.c.

irqreturn_t bnx2x_interrupt ( int  irq,
void dev_instance 
)

bnx2x_interrupt - non MSI-X interrupt handler

: irq number : private instance

Definition at line 1700 of file bnx2x_main.c.

int bnx2x_leader_reset ( struct bnx2x bp)

Definition at line 8853 of file bnx2x_main.c.

void bnx2x_link_set ( struct bnx2x bp)

bnx2x_link_set - configure hw according to link parameters structure.

: driver handle

Definition at line 2165 of file bnx2x_main.c.

u8 bnx2x_link_test ( struct bnx2x bp,
u8  is_serdes 
)

bnx2x_link_test - query link status.

: driver handle : bool

Returns 0 if link is UP.

Definition at line 2194 of file bnx2x_main.c.

irqreturn_t bnx2x_msix_sp_int ( int  irq,
void dev_instance 
)

bnx2x_msix_sp_int - MSI-X slowpath interrupt handler

: irq number : private instance

Definition at line 5040 of file bnx2x_main.c.

void bnx2x_nic_init ( struct bnx2x bp,
u32  load_code 
)

bnx2x_nic_init - init driver internals.

: driver handle : COMMON, PORT or FUNCTION

Initializes:

  • rings
  • status blocks
  • etc.

Definition at line 5733 of file bnx2x_main.c.

void bnx2x_notify_link_changed ( struct bnx2x bp)

Definition at line 12233 of file bnx2x_main.c.

void bnx2x_panic_dump ( struct bnx2x bp)

Definition at line 704 of file bnx2x_main.c.

void bnx2x_pf_disable ( struct bnx2x bp)

Definition at line 6246 of file bnx2x_main.c.

void bnx2x_post_dmae ( struct bnx2x bp,
struct dmae_command dmae,
int  idx 
)

Definition at line 340 of file bnx2x_main.c.

void bnx2x_read_dmae ( struct bnx2x bp,
u32  src_addr,
u32  len32 
)

Definition at line 478 of file bnx2x_main.c.

void bnx2x_read_mf_cfg ( struct bnx2x bp)

Definition at line 2292 of file bnx2x_main.c.

int bnx2x_release_hw_lock ( struct bnx2x bp,
u32  resource 
)

bnx2x_release_hw_lock - release HW lock.

: driver handle : resource bit which was locked

Definition at line 1822 of file bnx2x_main.c.

int bnx2x_release_leader_lock ( struct bnx2x bp)

bnx2x_release_leader_lock - release recovery leader lock

: driver handle

Definition at line 1817 of file bnx2x_main.c.

bool bnx2x_reset_is_done ( struct bnx2x bp,
int  engine 
)

Definition at line 3939 of file bnx2x_main.c.

void bnx2x_send_unload_done ( struct bnx2x bp,
bool  keep_link 
)

bnx2x_send_unload_done - send UNLOAD_DONE command to the MCP.

: driver handle : true iff link should be kept up

Definition at line 8254 of file bnx2x_main.c.

u32 bnx2x_send_unload_req ( struct bnx2x bp,
int  unload_mode 
)

bnx2x_send_unload_req - request unload mode from the MCP.

: driver handle : requested function's unload mode

Return unload mode returned by the MCP: COMMON, PORT or FUNC.

Definition at line 8183 of file bnx2x_main.c.

int bnx2x_set_eth_mac ( struct bnx2x bp,
bool  set 
)

bnx2x_set_eth_mac - configure eth MAC address in the HW

: driver handle : set or clear

Configures according to the value in netdev->dev_addr.

Definition at line 7595 of file bnx2x_main.c.

int bnx2x_set_gpio ( struct bnx2x bp,
int  gpio_num,
u32  mode,
u8  port 
)

Definition at line 1886 of file bnx2x_main.c.

int bnx2x_set_gpio_int ( struct bnx2x bp,
int  gpio_num,
u32  mode,
u8  port 
)

Definition at line 1989 of file bnx2x_main.c.

void bnx2x_set_int_mode ( struct bnx2x bp)

bnx2x_set_int_mode - configure interrupt mode

: driver handle

In case of MSI-X it will also try to enable MSI-X.

Definition at line 7628 of file bnx2x_main.c.

int bnx2x_set_mac_one ( struct bnx2x bp,
u8 mac,
struct bnx2x_vlan_mac_obj obj,
bool  set,
int  mac_type,
unsigned long ramrod_flags 
)

bnx2x_set_mac_one - configure a single MAC address

: driver handle : MAC to configure : MAC object handle : if 'true' add a new MAC, otherwise - delete : the type of the MAC to configure (e.g. ETH, UC list) : RAMROD_XXX flags (e.g. RAMROD_CONT, RAMROD_COMP_WAIT)

Configures one MAC according to provided parameters or continues the execution of previously scheduled commands if RAMROD_CONT is set in ramrod_flags.

Returns zero if operation has successfully completed, a positive value if the operation has been successfully scheduled and a negative - if a requested operations has failed.

Definition at line 7536 of file bnx2x_main.c.

int bnx2x_set_mult_gpio ( struct bnx2x bp,
u8  pins,
u32  mode 
)

Definition at line 1942 of file bnx2x_main.c.

void bnx2x_set_pf_load ( struct bnx2x bp)

Definition at line 3954 of file bnx2x_main.c.

void 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 
)

bnx2x_set_q_rx_mode - configures rx_mode for a single queue.

: driver handle : client id : rx mode configuration : rx accept configuration : tx accept configuration (tx switch) : ramrod configuration

Definition at line 5457 of file bnx2x_main.c.

void bnx2x_set_reset_global ( struct bnx2x bp)

Definition at line 3860 of file bnx2x_main.c.

void bnx2x_set_reset_in_progress ( struct bnx2x bp)

Definition at line 3921 of file bnx2x_main.c.

void bnx2x_set_rx_mode ( struct net_device dev)

bnx2x_set_rx_mode - set MAC filtering configurations.

: netdevice

called with netif_tx_lock from dev_mcast.c If bp->state is OPEN, should be called with netif_addr_lock_bh()

Definition at line 11143 of file bnx2x_main.c.

void bnx2x_set_storm_rx_mode ( struct bnx2x bp)

bnx2x_set_storm_rx_mode - configure MAC filtering rules in a FW.

: driver handle

If bp->state is OPEN, should be called with netif_addr_lock_bh().

Definition at line 5496 of file bnx2x_main.c.

int bnx2x_setup_leading ( struct bnx2x bp)

bnx2x_setup_leading - bring up a leading eth queue.

: driver handle

Definition at line 7616 of file bnx2x_main.c.

int bnx2x_setup_queue ( struct bnx2x bp,
struct bnx2x_fastpath fp,
bool  leading 
)

bnx2x_setup_queue - setup queue

: driver handle : pointer to fastpath : is leading

This function performs 2 steps in a Queue state machine actually: 1) RESET->INIT 2) INIT->SETUP

Definition at line 7870 of file bnx2x_main.c.

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 
)

Definition at line 7826 of file bnx2x_main.c.

void bnx2x_sp_event ( struct bnx2x_fastpath fp,
union eth_rx_cqe rr_cqe 
)

bnx2x_sp_event - handle ramrods completion.

: fastpath handle for the event : eth_rx_cqe

Definition at line 1595 of file bnx2x_main.c.

int bnx2x_sp_post ( struct bnx2x bp,
int  command,
int  cid,
u32  data_hi,
u32  data_lo,
int  cmd_type 
)

bnx2x_sp_post - place a single command on an SP ring

: driver handle : command to place (e.g. SETUP, FILTER_RULES, etc.) : SW CID the command is related to : command private data address (high 32 bits) : command private data address (low 32 bits) : command type (e.g. NONE, ETH)

SP data is handled as if it's always an address pair, thus data fields are not swapped to little endian in upper functions. Instead this function swaps data as if it's two u32 fields.

Definition at line 3361 of file bnx2x_main.c.

void bnx2x_update_coalesce ( struct bnx2x bp)

Definition at line 5413 of file bnx2x_main.c.

void bnx2x_update_rx_prod ( struct bnx2x bp,
struct bnx2x_fastpath fp,
u16  bd_prod,
u16  rx_comp_prod,
u16  rx_sge_prod 
)

Definition at line 1691 of file bnx2x_main.c.

void bnx2x_write_dmae ( struct bnx2x bp,
dma_addr_t  dma_addr,
u32  dst_addr,
u32  len32 
)

Definition at line 449 of file bnx2x_main.c.

MODULE_AUTHOR ( "Eliezer Tamir"  )
MODULE_DESCRIPTION ( "Broadcom NetXtreme II ""BCM57710/57711/57711E/""57712/57712_MF/57800/57800_MF/57810/57810_MF/""57840/57840_MF Driver"  )
MODULE_DEVICE_TABLE ( pci  ,
bnx2x_pci_tbl   
)
module_exit ( bnx2x_cleanup  )
MODULE_FIRMWARE ( FW_FILE_NAME_E1  )
MODULE_FIRMWARE ( FW_FILE_NAME_E1H  )
MODULE_FIRMWARE ( FW_FILE_NAME_E2  )
module_init ( bnx2x_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( num_queues  ,
int  ,
 
)
module_param ( disable_tpa  ,
int  ,
 
)
module_param ( int_mode  ,
int  ,
 
)
module_param ( dropless_fc  ,
int  ,
 
)
module_param ( mrrs  ,
int  ,
 
)
module_param ( debug  ,
int  ,
 
)
MODULE_PARM_DESC ( num_queues  ,
" Set number of queues (default is as a number of CPUs)"   
)
MODULE_PARM_DESC ( disable_tpa  ,
" Disable the TPA (LRO) feature  
)
MODULE_PARM_DESC ( int_mode  ,
" Force interrupt mode other than MSI-X ""(1 INT#x; 2 MSI)"   
)
MODULE_PARM_DESC ( dropless_fc  ,
" Pause on exhausted host ring  
)
MODULE_PARM_DESC ( mrrs  ,
" Force Max Read Req Size (0..3) (for debug)"   
)
MODULE_PARM_DESC ( debug  ,
" Default debug msglevel"   
)
MODULE_VERSION ( DRV_MODULE_VERSION  )

Variable Documentation

Definition at line 128 of file bnx2x_main.c.

int int_mode

Definition at line 109 of file bnx2x_main.c.

char* name

Definition at line 151 of file bnx2x_main.c.

int num_queues

Definition at line 98 of file bnx2x_main.c.