Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions
bnx2.c File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/stringify.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/vmalloc.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 <asm/io.h>
#include <asm/irq.h>
#include <linux/delay.h>
#include <asm/byteorder.h>
#include <asm/page.h>
#include <linux/time.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
#include <linux/if.h>
#include <linux/if_vlan.h>
#include <net/ip.h>
#include <net/tcp.h>
#include <net/checksum.h>
#include <linux/workqueue.h>
#include <linux/crc32.h>
#include <linux/prefetch.h>
#include <linux/cache.h>
#include <linux/firmware.h>
#include <linux/log2.h>
#include <linux/aer.h>
#include "bnx2.h"
#include "bnx2_fw.h"

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRV_MODULE_NAME   "bnx2"
 
#define DRV_MODULE_VERSION   "2.2.3"
 
#define DRV_MODULE_RELDATE   "June 27, 2012"
 
#define FW_MIPS_FILE_06   "bnx2/bnx2-mips-06-6.2.3.fw"
 
#define FW_RV2P_FILE_06   "bnx2/bnx2-rv2p-06-6.0.15.fw"
 
#define FW_MIPS_FILE_09   "bnx2/bnx2-mips-09-6.2.1b.fw"
 
#define FW_RV2P_FILE_09_Ax   "bnx2/bnx2-rv2p-09ax-6.0.17.fw"
 
#define FW_RV2P_FILE_09   "bnx2/bnx2-rv2p-09-6.0.17.fw"
 
#define RUN_AT(x)   (jiffies + (x))
 
#define TX_TIMEOUT   (5*HZ)
 
#define BUFFERED_FLAGS   (BNX2_NV_BUFFERED | BNX2_NV_TRANSLATE)
 
#define NONBUFFERED_FLAGS   (BNX2_NV_WREN)
 
#define PHY_RESET_MAX_WAIT   100
 
#define ETHTOOL_ALL_FIBRE_SPEED
 
#define ETHTOOL_ALL_COPPER_SPEED
 
#define PHY_ALL_10_100_SPEED
 
#define PHY_ALL_1000_SPEED   (ADVERTISE_1000HALF | ADVERTISE_1000FULL)
 
#define STATUS_ATTN_EVENTS
 
#define BNX2_FL_NOT_5709   1
 
#define BNX2_MAC_LOOPBACK   0
 
#define BNX2_PHY_LOOPBACK   1
 
#define BNX2_MAC_LOOPBACK_FAILED   1
 
#define BNX2_PHY_LOOPBACK_FAILED   2
 
#define BNX2_LOOPBACK_FAILED
 
#define NVRAM_SIZE   0x200
 
#define CRC32_RESIDUAL   0xdebb20e3
 
#define BNX2_FTQ_ENTRY(ftq)   { __stringify(ftq##FTQ_CTL), BNX2_##ftq##FTQ_CTL }
 
#define GET_64BIT_NET_STATS64(ctr)   (((u64) (ctr##_hi) << 32) + (u64) (ctr##_lo))
 
#define GET_64BIT_NET_STATS(ctr)
 
#define GET_32BIT_NET_STATS(ctr)
 
#define BNX2_REGDUMP_LEN   (32 * 1024)
 
#define BNX2_NUM_STATS   ARRAY_SIZE(bnx2_stats_str_arr)
 
#define STATS_OFFSET32(offset_name)   (offsetof(struct statistics_block, offset_name) / 4)
 
#define BNX2_NUM_TESTS   6
 
#define BNX2_VPD_NVRAM_OFFSET   0x300
 
#define BNX2_VPD_LEN   128
 
#define BNX2_MAX_VER_SLEN   30
 

Enumerations

enum  board_t {
  BCM5706 = 0, NC370T, NC370I, BCM5706S,
  NC370F, BCM5708, BCM5708S, BCM5709,
  BCM5709S, BCM5716, BCM5716S, RTL8139 = 0,
  RTL8129, PXG2BPFI, PXG2BPFIL, PXG2BPFILX,
  PXG2BPFILLX, PXGBPI, PXGBPIG, PXG2TBFI,
  PXG4BPI, PXG4BPFI, PEG4BPI, PEG2BPI,
  PEG4BPIN, PEG2BPFI, PEG2BPFILX, PMCXG2BPFI,
  PMCXG2BPFIN, PEG4BPII, PEG4BPFII, PXG4BPFILX,
  PMCXG2BPIN, PMCXG4BPIN, PXG2BISC1, PEG2TBFI,
  PXG2TBI, PXG4BPFID, PEG4BPFI, PEG4BPIPT,
  PXG6BPI, PEG4BPIL, PMCXG2BPIN2, PMCXG4BPIN2,
  PMCX2BPI, PEG2BPFID, PEG2BPFIDLX, PMCX4BPI,
  MEG2BPFILN, MEG2BPFINX, PEG4BPFILX, PE10G2BPISR,
  PE10G2BPILR, MHIO8AD, PE10G2BPICX4, PEG2BPI5,
  PEG6BPI, PEG4BPFI5, PEG4BPFI5LX, MEG2BPFILXLN,
  PEG2BPIX1, MEG2BPFILXNX, XE10G2BPIT, XE10G2BPICX4,
  XE10G2BPISR, XE10G2BPILR, PEG4BPIIO, XE10G2BPIXR,
  PE10GDBISR, PE10GDBILR, PEG2BISC6, PEG6BPIFC,
  PE10G2BPTCX4, PE10G2BPTSR, PE10G2BPTLR, PE10G2BPTT,
  PEG4BPI6, PEG4BPFI6, PEG4BPFI6LX, PEG4BPFI6ZX,
  PEG2BPI6, PEG2BPFI6, PEG2BPFI6LX, PEG2BPFI6ZX,
  PEG2BPFI6FLXM, PEG4BPI6FC, PEG4BPFI6FC, PEG4BPFI6FCLX,
  PEG4BPFI6FCZX, PEG6BPI6, PEG2BPI6SC6, MEG2BPI6,
  XEG2BPI6, MEG4BPI6, PEG2BPFI5, PEG2BPFI5LX,
  PXEG4BPFI, M1EG2BPI6, M1EG2BPFI6, M1EG2BPFI6LX,
  M1EG2BPFI6ZX, M1EG4BPI6, M1EG4BPFI6, M1EG4BPFI6LX,
  M1EG4BPFI6ZX, M1EG6BPI6, M1E2G4BPi80, M1E2G4BPFi80,
  M1E2G4BPFi80LX, M1E2G4BPFi80ZX, PE210G2SPI9, M1E10G2BPI9CX4,
  M1E10G2BPI9SR, M1E10G2BPI9LR, M1E10G2BPI9T, PE210G2BPI9CX4,
  PE210G2BPI9SR, PE210G2BPI9LR, PE210G2BPI9T, M2EG2BPFI6,
  M2EG2BPFI6LX, M2EG2BPFI6ZX, M2EG4BPI6, M2EG4BPFI6,
  M2EG4BPFI6LX, M2EG4BPFI6ZX, M2EG6BPI6, PEG2DBI6,
  PEG2DBFI6, PEG2DBFI6LX, PEG2DBFI6ZX, PE2G4BPi80,
  PE2G4BPFi80, PE2G4BPFi80LX, PE2G4BPFi80ZX, PE2G4BPi80L,
  M6E2G8BPi80A, PE2G2BPi35, PAC1200BPi35, PE2G2BPFi35,
  PE2G2BPFi35LX, PE2G2BPFi35ZX, PE2G4BPi35, PE2G4BPi35L,
  PE2G4BPFi35, PE2G4BPFi35LX, PE2G4BPFi35ZX, PE2G6BPi35,
  PE2G6BPi35CX, PE2G2BPi80, PE2G2BPFi80, PE2G2BPFi80LX,
  PE2G2BPFi80ZX, M2E10G2BPI9CX4, M2E10G2BPI9SR, M2E10G2BPI9LR,
  M2E10G2BPI9T, M6E2G8BPi80, PE210G2DBi9SR, PE210G2DBi9SRRB,
  PE210G2DBi9LR, PE210G2DBi9LRRB, PE310G4DBi940SR, PE310G4BPi9T,
  PE310G4BPi9SR, PE310G4BPi9LR, PE210G2BPi40
}
 

Functions

 MODULE_AUTHOR ("Michael Chan <[email protected]>")
 
 MODULE_DESCRIPTION ("Broadcom NetXtreme II BCM5706/5708/5709/5716 Driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_MODULE_VERSION)
 
 MODULE_FIRMWARE (FW_MIPS_FILE_06)
 
 MODULE_FIRMWARE (FW_RV2P_FILE_06)
 
 MODULE_FIRMWARE (FW_MIPS_FILE_09)
 
 MODULE_FIRMWARE (FW_RV2P_FILE_09)
 
 MODULE_FIRMWARE (FW_RV2P_FILE_09_Ax)
 
 module_param (disable_msi, int, 0)
 
 MODULE_PARM_DESC (disable_msi,"Disable Message Signaled Interrupt (MSI)")
 
 MODULE_DEVICE_TABLE (pci, bnx2_pci_tbl)
 
 module_init (bnx2_init)
 
 module_exit (bnx2_cleanup)
 

Macro Definition Documentation

#define BNX2_FL_NOT_5709   1
#define BNX2_FTQ_ENTRY (   ftq)    { __stringify(ftq##FTQ_CTL), BNX2_##ftq##FTQ_CTL }

Definition at line 6421 of file bnx2.c.

#define BNX2_LOOPBACK_FAILED
Value:
BNX2_PHY_LOOPBACK_FAILED)

Definition at line 5870 of file bnx2.c.

#define BNX2_MAC_LOOPBACK   0

Definition at line 5732 of file bnx2.c.

#define BNX2_MAC_LOOPBACK_FAILED   1

Definition at line 5868 of file bnx2.c.

#define BNX2_MAX_VER_SLEN   30
#define BNX2_NUM_STATS   ARRAY_SIZE(bnx2_stats_str_arr)

Definition at line 7429 of file bnx2.c.

#define BNX2_NUM_TESTS   6

Definition at line 7502 of file bnx2.c.

#define BNX2_PHY_LOOPBACK   1

Definition at line 5733 of file bnx2.c.

#define BNX2_PHY_LOOPBACK_FAILED   2

Definition at line 5869 of file bnx2.c.

#define BNX2_REGDUMP_LEN   (32 * 1024)

Definition at line 6983 of file bnx2.c.

#define BNX2_VPD_LEN   128
#define BNX2_VPD_NVRAM_OFFSET   0x300
#define BUFFERED_FLAGS   (BNX2_NV_BUFFERED | BNX2_NV_TRANSLATE)
#define CRC32_RESIDUAL   0xdebb20e3

Definition at line 5893 of file bnx2.c.

#define DRV_MODULE_NAME   "bnx2"

Definition at line 60 of file bnx2.c.

#define DRV_MODULE_RELDATE   "June 27, 2012"

Definition at line 62 of file bnx2.c.

#define DRV_MODULE_VERSION   "2.2.3"

Definition at line 61 of file bnx2.c.

#define ETHTOOL_ALL_COPPER_SPEED
Value:
ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full | \
ADVERTISED_1000baseT_Full)

Definition at line 1853 of file bnx2.c.

#define ETHTOOL_ALL_FIBRE_SPEED
#define FW_MIPS_FILE_06   "bnx2/bnx2-mips-06-6.2.3.fw"

Definition at line 63 of file bnx2.c.

#define FW_MIPS_FILE_09   "bnx2/bnx2-mips-09-6.2.1b.fw"

Definition at line 65 of file bnx2.c.

#define FW_RV2P_FILE_06   "bnx2/bnx2-rv2p-06-6.0.15.fw"

Definition at line 64 of file bnx2.c.

#define FW_RV2P_FILE_09   "bnx2/bnx2-rv2p-09-6.0.17.fw"

Definition at line 67 of file bnx2.c.

#define FW_RV2P_FILE_09_Ax   "bnx2/bnx2-rv2p-09ax-6.0.17.fw"

Definition at line 66 of file bnx2.c.

#define GET_32BIT_NET_STATS (   ctr)
Value:
(unsigned long) (bp->stats_blk->ctr + \
bp->temp_stats_blk->ctr)

Definition at line 6757 of file bnx2.c.

#define GET_64BIT_NET_STATS (   ctr)
Value:
GET_64BIT_NET_STATS64(bp->stats_blk->ctr) + \
GET_64BIT_NET_STATS64(bp->temp_stats_blk->ctr)

Definition at line 6753 of file bnx2.c.

#define GET_64BIT_NET_STATS64 (   ctr)    (((u64) (ctr##_hi) << 32) + (u64) (ctr##_lo))

Definition at line 6750 of file bnx2.c.

#define NONBUFFERED_FLAGS   (BNX2_NV_WREN)
#define NVRAM_SIZE   0x200

Definition at line 5892 of file bnx2.c.

#define PHY_ALL_1000_SPEED   (ADVERTISE_1000HALF | ADVERTISE_1000FULL)

Definition at line 1861 of file bnx2.c.

#define PHY_ALL_10_100_SPEED
Value:

Definition at line 1858 of file bnx2.c.

#define PHY_RESET_MAX_WAIT   100
#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 12 of file bnx2.c.

#define RUN_AT (   x)    (jiffies + (x))

Definition at line 69 of file bnx2.c.

#define STATS_OFFSET32 (   offset_name)    (offsetof(struct statistics_block, offset_name) / 4)

Definition at line 7431 of file bnx2.c.

#define STATUS_ATTN_EVENTS
Value:
STATUS_ATTN_BITS_TIMER_ABORT)

Definition at line 3361 of file bnx2.c.

#define TX_TIMEOUT   (5*HZ)

Definition at line 72 of file bnx2.c.

Enumeration Type Documentation

enum board_t
Enumerator:
BCM5706 
NC370T 
NC370I 
BCM5706S 
NC370F 
BCM5708 
BCM5708S 
BCM5709 
BCM5709S 
BCM5716 
B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FI6 
M1EG4BPFI6LX 
M1EG4BPFI6ZX 
M1EG6BPI6 
M1E2G4BPi80 
M1E2G4BPFi80 
M1E2G4BPFi80LX 
M1E2G4BPFi80ZX 
PE210G2SPI9 
M1E10G2BPI9CX4 
M1E10G2BPI9SR 
M1E10G2BPI9LR 
M1E10G2BPI9T 
PE210G2BPI9CX4 
PE210G2BPI9SR 
PE210G2BPI9LR 
PE210G2BPI9T 
M2EG2BPFI6 
M2EG2BPFI6LX 
M2EG2BPFI6ZX 
M2EG4BPI6 
M2EG4BPFI6 
M2EG4BPFI6LX 
M2EG4BPFI6ZX 
M2EG6BPI6 
PEG2DBI6 
PEG2DBFI6 
PEG2DBFI6LX 
PEG2DBFI6ZX 
PE2G4BPi80 
PE2G4BPFi80 
PE2G4BPFi80LX 
PE2G4BPFi80ZX 
PE2G4BPi80L 
M6E2G8BPi80A 
PE2G2BPi35 
PAC1200BPi35 
PE2G2BPFi35 
PE2G2BPFi35LX 
PE2G2BPFi35ZX 
PE2G4BPi35 
PE2G4BPi35L 
PE2G4BPFi35 
PE2G4BPFi35LX 
PE2G4BPFi35ZX 
PE2G6BPi35 
PE2G6BPi35CX 
PE2G2BPi80 
PE2G2BPFi80 
PE2G2BPFi80LX 
PE2G2BPFi80ZX 
M2E10G2BPI9CX4 
M2E10G2BPI9SR 
M2E10G2BPI9LR 
M2E10G2BPI9T 
M6E2G8BPi80 
PE210G2DBi9SR 
PE210G2DBi9SRRB 
PE210G2DBi9LR 
PE210G2DBi9LRRB 
PE310G4DBi940SR 
PE310G4BPi9T 
PE310G4BPi9SR 
PE310G4BPi9LR 
PE210G2BPi40 

Definition at line 92 of file bnx2.c.

Function Documentation

MODULE_AUTHOR ( "Michael Chan <[email protected]>"  )
MODULE_DESCRIPTION ( "Broadcom NetXtreme II BCM5706/5708/5709/5716 Driver"  )
MODULE_DEVICE_TABLE ( pci  ,
bnx2_pci_tbl   
)
module_exit ( bnx2_cleanup  )
MODULE_FIRMWARE ( FW_MIPS_FILE_06  )
MODULE_FIRMWARE ( FW_RV2P_FILE_06  )
MODULE_FIRMWARE ( FW_MIPS_FILE_09  )
MODULE_FIRMWARE ( FW_RV2P_FILE_09  )
MODULE_FIRMWARE ( FW_RV2P_FILE_09_Ax  )
module_init ( bnx2_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( disable_msi  ,
int  ,
 
)
MODULE_PARM_DESC ( disable_msi  ,
"Disable Message Signaled Interrupt (MSI)"   
)
MODULE_VERSION ( DRV_MODULE_VERSION  )

Variable Documentation

char* name

Definition at line 108 of file bnx2.c.

Definition at line 7378 of file bnx2.c.