MFC after: 2 weeks

Updated copyright date to 2007.

Tested with BCM5706 A3.

Added ID for BCM5708 B2.

Removed unused driver version string.

Modified BCE_PRINTF macro to automatically fill-in the sc pointer.

Fixed a kernel panic when the driver was loaded as a module from the
command-line because the MII bus pointer was null (i.e. the MII bus
hadn't been enumerated yet).

Added fix proposed by Vladimir Ivanov <wawa@yandex-team.ru> to prevent
driver state corruption when releasing the lock during the ISR in
bce_rx_intr() to send packets up the stack.

Added new TX chain and register read sysctl interfaces for debugging.

Cleaned up formatting for various other debug routines.

Added a new statistic maintained by firmware which tracks the number
of received packets dropped because no receive buffers are available.
This commit is contained in:
David Christensen 2007-05-04 23:14:19 +00:00
parent e1bb13cd30
commit d2b9bc428c
3 changed files with 515 additions and 312 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 2006 Broadcom Corporation
* Copyright (c) 2006-2007 Broadcom Corporation
* David Christensen <davidch@broadcom.com>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 2006 Broadcom Corporation
* Copyright (c) 2006-2007 Broadcom Corporation
* David Christensen <davidch@broadcom.com>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -96,7 +96,7 @@
/****************************************************************************/
/* Debugging macros and definitions. */
/****************************************************************************/
/****************************************************************************/
#define BCE_CP_LOAD 0x00000001
#define BCE_CP_SEND 0x00000002
#define BCE_CP_RECV 0x00000004
@ -248,9 +248,11 @@
#define BCE_CHIP_ID_5706_A0 0x57060000
#define BCE_CHIP_ID_5706_A1 0x57060010
#define BCE_CHIP_ID_5706_A2 0x57060020
#define BCE_CHIP_ID_5706_A3 0x57060030
#define BCE_CHIP_ID_5708_A0 0x57080000
#define BCE_CHIP_ID_5708_B0 0x57081000
#define BCE_CHIP_ID_5708_B1 0x57081010
#define BCE_CHIP_ID_5708_B2 0x57081020
#define BCE_CHIP_BOND_ID(sc) (((sc)->bce_chipid) & 0xf)
@ -689,7 +691,7 @@ struct flash_spec {
/****************************************************************************/
/* Convenience definitions. */
/****************************************************************************/
#define BCE_PRINTF(sc, fmt, args...) device_printf(sc->bce_dev, fmt, ##args)
#define BCE_PRINTF(fmt, args...) device_printf(sc->bce_dev, fmt, ##args)
#define BCE_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->bce_mtx, _name, MTX_NETWORK_LOCK, MTX_DEF)
#define BCE_LOCK(_sc) mtx_lock(&(_sc)->bce_mtx)
@ -4463,18 +4465,18 @@ struct l2_fhdr {
/* Use the natural page size of the host CPU. */
/* XXX: This has only been tested on amd64/i386 systems using 4KB pages. */
#define BCM_PAGE_BITS PAGE_SHIFT
#define BCM_PAGE_SIZE PAGE_SIZE
#define BCM_PAGE_BITS PAGE_SHIFT
#define BCM_PAGE_SIZE PAGE_SIZE
#define TX_PAGES 2
#define TX_PAGES 2
#define TOTAL_TX_BD_PER_PAGE (BCM_PAGE_SIZE / sizeof(struct tx_bd))
#define USABLE_TX_BD_PER_PAGE (TOTAL_TX_BD_PER_PAGE - 1)
#define TOTAL_TX_BD (TOTAL_TX_BD_PER_PAGE * TX_PAGES)
#define USABLE_TX_BD (USABLE_TX_BD_PER_PAGE * TX_PAGES)
#define MAX_TX_BD (TOTAL_TX_BD - 1)
#define BCE_TX_SLACK_SPACE 16
#define RX_PAGES 2
#define RX_PAGES 2
#define TOTAL_RX_BD_PER_PAGE (BCM_PAGE_SIZE / sizeof(struct rx_bd))
#define USABLE_RX_BD_PER_PAGE (TOTAL_RX_BD_PER_PAGE - 1)
#define TOTAL_RX_BD (TOTAL_RX_BD_PER_PAGE * RX_PAGES)
@ -4871,7 +4873,10 @@ struct bce_softc
u32 stat_CatchupInRuleCheckerDiscards;
u32 stat_CatchupInFTQDiscards;
u32 stat_CatchupInMBUFDiscards;
u32 stat_CatchupInRuleCheckerP4Hit;
u32 stat_CatchupInRuleCheckerP4Hit;
/* Provides access to certain firmware statistics. */
u32 com_no_buffers;
#ifdef BCE_DEBUG
/* Track the number of enqueued mbufs. */