Linux Kernel
3.7.1
|
#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 |
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 } |
Variables | |
int | num_queues |
int | int_mode |
struct workqueue_struct * | bnx2x_wq |
#define BNX2X_ALLOC_AND_SET | ( | arr, | |
lbl, | |||
func | |||
) |
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.
Definition at line 9301 of file bnx2x_main.c.
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.
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 |
Definition at line 73 of file bnx2x_main.c.
Definition at line 74 of file bnx2x_main.c.
Definition at line 75 of file bnx2x_main.c.
#define FW_FILE_VERSION |
Definition at line 68 of file bnx2x_main.c.
Definition at line 9792 of file bnx2x_main.c.
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.
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.
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.
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.
enum bnx2x_board_type |
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.
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.
bnx2x__link_status_update - handles link status change.
: driver handle
Definition at line 2445 of file bnx2x_main.c.
bnx2x_acquire_hw_lock - acquire HW lock.
: driver handle : resource bit which was locked
Definition at line 1773 of file bnx2x_main.c.
bnx2x_alloc_mem - allocate driver's memory.
: driver handle
Definition at line 7449 of file bnx2x_main.c.
Definition at line 2083 of file bnx2x_main.c.
bnx2x_chip_cleanup - cleanup chip internals.
: driver handle : COMMON, PORT, FUNCTION : true iff link should be kept up.
Definition at line 8329 of file bnx2x_main.c.
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.
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.
Definition at line 8454 of file bnx2x_main.c.
Definition at line 363 of file bnx2x_main.c.
Definition at line 352 of file bnx2x_main.c.
Definition at line 358 of file bnx2x_main.c.
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.
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.
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.
bnx2x_fw_command - send the MCP a request
: driver handle : request
request's parameter |
block until there is a reply
Definition at line 2689 of file bnx2x_main.c.
Definition at line 643 of file bnx2x_main.c.
Definition at line 1856 of file bnx2x_main.c.
Definition at line 10227 of file bnx2x_main.c.
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.
bnx2x_ilt_set_info - prepare ILT configurations.
: driver handle
Definition at line 7666 of file bnx2x_main.c.
bnx2x_initial_phy_init - initialize link parameters structure variables.
: driver handle : current mode
Definition at line 2109 of file bnx2x_main.c.
Definition at line 1486 of file bnx2x_main.c.
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.
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.
Definition at line 8853 of file bnx2x_main.c.
bnx2x_link_set - configure hw according to link parameters structure.
: driver handle
Definition at line 2165 of file bnx2x_main.c.
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.
bnx2x_nic_init - init driver internals.
: driver handle : COMMON, PORT or FUNCTION
Initializes:
Definition at line 5733 of file bnx2x_main.c.
Definition at line 12233 of file bnx2x_main.c.
Definition at line 704 of file bnx2x_main.c.
Definition at line 6246 of file bnx2x_main.c.
Definition at line 340 of file bnx2x_main.c.
Definition at line 478 of file bnx2x_main.c.
Definition at line 2292 of file bnx2x_main.c.
bnx2x_release_hw_lock - release HW lock.
: driver handle : resource bit which was locked
Definition at line 1822 of file bnx2x_main.c.
bnx2x_release_leader_lock - release recovery leader lock
: driver handle
Definition at line 1817 of file bnx2x_main.c.
Definition at line 3939 of file bnx2x_main.c.
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.
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.
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.
Definition at line 1886 of file bnx2x_main.c.
Definition at line 1989 of file bnx2x_main.c.
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.
Definition at line 1942 of file bnx2x_main.c.
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.
Definition at line 3860 of file bnx2x_main.c.
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.
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.
bnx2x_setup_leading - bring up a leading eth queue.
: driver handle
Definition at line 7616 of file bnx2x_main.c.
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.
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.
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 | , | ||
0 | |||
) |
module_param | ( | disable_tpa | , |
int | , | ||
0 | |||
) |
module_param | ( | dropless_fc | , |
int | , | ||
0 | |||
) |
module_param | ( | mrrs | , |
int | , | ||
0 | |||
) |
MODULE_VERSION | ( | DRV_MODULE_VERSION | ) |
struct workqueue_struct* bnx2x_wq |
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.