Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jun 2011 21:18:14 +0000 (UTC)
From:      David Christensen <davidch@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r222875 - head/sys/dev/bxe
Message-ID:  <201106082118.p58LIE8h047762@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davidch
Date: Wed Jun  8 21:18:14 2011
New Revision: 222875
URL: http://svn.freebsd.org/changeset/base/222875

Log:
  - Major reorganization of mbuf handling throughout the driver to
    increase robustness (no more calls to panic(9)) and simplify
    code.
  - Allocate RX/TX data structures as a single buffer rather than
    an array of 4KB pages to simplify code.
  - Fixed LRO (aka TPA) code.  Removed kernel module parameter and
    support enabling disabling LRO through ifconfig(8) command line.
    LRO is still disabled by default but should be enabled for best
    performance on an endpoint device.
  - Fixed statistcs code and removed kernel module parameter (stats
    should just work).
  - Added many software counters to help identify the cause of some
    performance issues.
  - Streamlined adapter internal init/stop code paths.
  - Fiddled with debug code (adding some here, removing some there).
  - Continued style(9) adjustments.

Modified:
  head/sys/dev/bxe/bxe_debug.h
  head/sys/dev/bxe/bxe_link.c
  head/sys/dev/bxe/if_bxe.c
  head/sys/dev/bxe/if_bxe.h

Modified: head/sys/dev/bxe/bxe_debug.h
==============================================================================
--- head/sys/dev/bxe/bxe_debug.h	Wed Jun  8 21:14:04 2011	(r222874)
+++ head/sys/dev/bxe/bxe_debug.h	Wed Jun  8 21:18:14 2011	(r222875)
@@ -41,21 +41,22 @@ extern uint32_t bxe_debug;
  * Debugging macros and definitions.
  */
 
-#define	BXE_CP_LOAD		0x00000001
-#define	BXE_CP_SEND		0x00000002
-#define	BXE_CP_RECV		0x00000004
-#define	BXE_CP_INTR		0x00000008
-#define	BXE_CP_UNLOAD		0x00000010
-#define	BXE_CP_RESET		0x00000020
-#define	BXE_CP_IOCTL		0x00000040
-#define	BXE_CP_STATS		0x00000080
-#define	BXE_CP_MISC		0x00000100
-#define	BXE_CP_PHY		0x00000200
-#define	BXE_CP_RAMROD		0x00000400
-#define	BXE_CP_NVRAM		0x00000800
-#define	BXE_CP_REGS		0x00001000
-#define	BXE_CP_ALL		0x00FFFFFF
-#define	BXE_CP_MASK		0x00FFFFFF
+#define	BXE_CP_LOAD			0x00000001
+#define	BXE_CP_SEND			0x00000002
+#define	BXE_CP_RECV			0x00000004
+#define	BXE_CP_INTR			0x00000008
+#define	BXE_CP_UNLOAD			0x00000010
+#define	BXE_CP_RESET			0x00000020
+#define	BXE_CP_IOCTL			0x00000040
+#define	BXE_CP_STATS			0x00000080
+#define	BXE_CP_MISC			0x00000100
+#define	BXE_CP_PHY			0x00000200
+#define	BXE_CP_RAMROD			0x00000400
+#define	BXE_CP_NVRAM			0x00000800
+#define	BXE_CP_REGS			0x00001000
+#define	BXE_CP_TPA			0x00002000
+#define	BXE_CP_ALL			0x00FFFFFF
+#define	BXE_CP_MASK			0x00FFFFFF
 
 #define BXE_LEVEL_FATAL			0x00000000
 #define BXE_LEVEL_WARN			0x01000000
@@ -144,12 +145,18 @@ extern uint32_t bxe_debug;
 #define BXE_EXTREME_REGS		(BXE_CP_REGS | BXE_LEVEL_EXTREME)
 #define BXE_INSANE_REGS			(BXE_CP_REGS | BXE_LEVEL_INSANE)
 
-#define BXE_FATAL				(BXE_CP_ALL | BXE_LEVEL_FATAL)
-#define BXE_WARN				(BXE_CP_ALL | BXE_LEVEL_WARN)
-#define BXE_INFO				(BXE_CP_ALL | BXE_LEVEL_INFO)
-#define BXE_VERBOSE				(BXE_CP_ALL | BXE_LEVEL_VERBOSE)
-#define BXE_EXTREME				(BXE_CP_ALL | BXE_LEVEL_EXTREME)
-#define BXE_INSANE				(BXE_CP_ALL | BXE_LEVEL_INSANE)
+#define BXE_WARN_TPA			(BXE_CP_TPA | BXE_LEVEL_WARN)
+#define BXE_INFO_TPA			(BXE_CP_TPA | BXE_LEVEL_INFO)
+#define BXE_VERBOSE_TPA			(BXE_CP_TPA | BXE_LEVEL_VERBOSE)
+#define BXE_EXTREME_TPA			(BXE_CP_TPA | BXE_LEVEL_EXTREME)
+#define BXE_INSANE_TPA			(BXE_CP_TPA | BXE_LEVEL_INSANE)
+
+#define BXE_FATAL			(BXE_CP_ALL | BXE_LEVEL_FATAL)
+#define BXE_WARN			(BXE_CP_ALL | BXE_LEVEL_WARN)
+#define BXE_INFO			(BXE_CP_ALL | BXE_LEVEL_INFO)
+#define BXE_VERBOSE			(BXE_CP_ALL | BXE_LEVEL_VERBOSE)
+#define BXE_EXTREME			(BXE_CP_ALL | BXE_LEVEL_EXTREME)
+#define BXE_INSANE			(BXE_CP_ALL | BXE_LEVEL_INSANE)
 
 #define BXE_CODE_PATH(cp)		((cp & BXE_CP_MASK) & bxe_debug)
 #define BXE_MSG_LEVEL(lv)		((lv & BXE_LEVEL_MASK) <= (bxe_debug & BXE_LEVEL_MASK))

Modified: head/sys/dev/bxe/bxe_link.c
==============================================================================
--- head/sys/dev/bxe/bxe_link.c	Wed Jun  8 21:14:04 2011	(r222874)
+++ head/sys/dev/bxe/bxe_link.c	Wed Jun  8 21:18:14 2011	(r222875)
@@ -1168,15 +1168,17 @@ bxe_set_parallel_detection(struct link_p
 		control2 |= MDIO_SERDES_DIGITAL_A_1000X_CONTROL2_PRL_DT_EN;
 	else
 		control2 &= ~MDIO_SERDES_DIGITAL_A_1000X_CONTROL2_PRL_DT_EN;
-	DBPRINT(sc, 1, "params->speed_cap_mask = 0x%x, control2 = 0x%x\n",
-	    params->speed_cap_mask, control2);
+
+	DBPRINT(sc, BXE_VERBOSE_PHY, "%s(): params->speed_cap_mask = 0x%x, "
+	    "control2 = 0x%x\n", __FUNCTION__, params->speed_cap_mask, control2);
+
 	CL45_WR_OVER_CL22(sc, params->port, params->phy_addr,
 	    MDIO_REG_BANK_SERDES_DIGITAL, MDIO_SERDES_DIGITAL_A_1000X_CONTROL2,
 	    control2);
 
 	if ((phy_flags & PHY_XGXS_FLAG) && (params->speed_cap_mask &
 	    PORT_HW_CFG_SPEED_CAPABILITY_D0_10G)) {
-		DBPRINT(sc, BXE_INFO, "XGXS\n");
+		DBPRINT(sc, BXE_VERBOSE_PHY, "%s(): XGXS\n", __FUNCTION__);
 
 		CL45_WR_OVER_CL22(sc, params->port, params->phy_addr,
 		    MDIO_REG_BANK_10G_PARALLEL_DETECT,
@@ -1688,7 +1690,9 @@ bxe_flow_ctrl_resolve(struct link_params
 		}
 		bxe_pause_resolve(vars, pause_result);
 	}
-	DBPRINT(sc, BXE_INFO, "flow_ctrl 0x%x\n", vars->flow_ctrl);
+
+	DBPRINT(sc, BXE_VERBOSE_PHY, "%s(): flow_ctrl 0x%x\n",
+	    __FUNCTION__, vars->flow_ctrl);
 }
 
 static void
@@ -1698,13 +1702,16 @@ bxe_check_fallback_to_cl37(struct link_p
 	uint16_t rx_status, ustat_val, cl37_fsm_recieved;
 
 	sc = params->sc;
-	DBPRINT(sc, BXE_INFO, "bxe_check_fallback_to_cl37\n");
+
+	DBPRINT(sc, BXE_VERBOSE_PHY, "%s(): IEEE 802.3 Clause 37 Fallback\n",
+	     __FUNCTION__);
+
 	CL45_RD_OVER_CL22(sc, params->port, params->phy_addr, MDIO_REG_BANK_RX0,
 	    MDIO_RX0_RX_STATUS, &rx_status);
 	if ((rx_status & MDIO_RX0_RX_STATUS_SIGDET) !=
 	    (MDIO_RX0_RX_STATUS_SIGDET)) {
 		DBPRINT(sc, BXE_VERBOSE_PHY,
-		    "Signal is not detected. Restoring CL73."
+		    "No signal detected. Restoring CL73."
 		    "rx_status(0x80b0) = 0x%x\n", rx_status);
 		CL45_WR_OVER_CL22(sc, params->port, params->phy_addr,
 		    MDIO_REG_BANK_CL73_IEEEB0, MDIO_CL73_IEEEB0_CL73_AN_CONTROL,
@@ -1738,7 +1745,9 @@ bxe_check_fallback_to_cl37(struct link_p
 	CL45_WR_OVER_CL22(sc, params->port, params->phy_addr,
 	    MDIO_REG_BANK_CL73_IEEEB0, MDIO_CL73_IEEEB0_CL73_AN_CONTROL, 0);
 	bxe_restart_autoneg(params, 0);
-	DBPRINT(sc, BXE_INFO, "Disabling CL73, and restarting CL37 autoneg\n");
+
+	DBPRINT(sc, BXE_INFO, "%s(): Disabling CL73 and restarting CL37 "
+	    "autoneg\n", __FUNCTION__);
 }
 
 static void
@@ -3391,7 +3400,8 @@ bxe_init_internal_phy(struct link_params
 		    ((XGXS_EXT_PHY_TYPE(params->ext_phy_config) ==
 		    PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT) &&
 		    params->loopback_mode == LOOPBACK_EXT)) {
-			DBPRINT(sc, BXE_INFO, "not SGMII, no AN\n");
+			DBPRINT(sc, BXE_VERBOSE_PHY, "%s(): Not SGMII, no AN\n",
+			    __FUNCTION__);
 
 			/* Disable autoneg. */
 			bxe_set_autoneg(params, vars, 0);
@@ -5338,9 +5348,6 @@ bxe_set_led(struct link_params *params, 
 	emac_base = port ? GRCBASE_EMAC1 : GRCBASE_EMAC0;
 	ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config);
 
-	DBPRINT(sc, BXE_INFO, "bxe_set_led: port %x, mode %d\n", port, mode);
-	DBPRINT(sc, BXE_VERBOSE_PHY, "speed 0x%x, hw_led_mode 0x%x\n", speed,
-	    hw_led_mode);
 	switch (mode) {
 	case LED_MODE_OFF:
 		REG_WR(sc, NIG_REG_LED_10G_P0 + port * 4, 0);
@@ -5382,7 +5389,7 @@ bxe_set_led(struct link_params *params, 
 	default:
 		rc = -EINVAL;
 		DBPRINT(sc, BXE_VERBOSE_PHY,
-		    "bxe_set_led: Invalid led mode %d\n", mode);
+		    "%s(): Invalid led mode (%d)!\n", __FUNCTION__, mode);
 		break;
 	}
 	return (rc);
@@ -5635,7 +5642,10 @@ bxe_link_reset(struct link_params *param
 	ext_phy_type = XGXS_EXT_PHY_TYPE(ext_phy_config);
 	val = REG_RD(sc, params->shmem_base + offsetof(struct shmem_region,
 	    dev_info.port_feature_config[params->port].config));
-	DBPRINT(sc, BXE_INFO, "Resetting the link of port %d\n", port);
+
+	DBPRINT(sc, BXE_INFO, "%s(): Resetting port %d link.\n",
+	    __FUNCTION__, port);
+
 	/* Disable attentions. */
 	vars->link_status = 0;
 	bxe_update_mng(params, vars->link_status);

Modified: head/sys/dev/bxe/if_bxe.c
==============================================================================
--- head/sys/dev/bxe/if_bxe.c	Wed Jun  8 21:14:04 2011	(r222874)
+++ head/sys/dev/bxe/if_bxe.c	Wed Jun  8 21:18:14 2011	(r222875)
@@ -70,7 +70,6 @@ __FBSDID("$FreeBSD$");
 #ifdef BXE_DEBUG
 uint32_t bxe_debug = BXE_WARN;
 
-
 /*          0 = Never              */
 /*          1 = 1 in 2,147,483,648 */
 /*        256 = 1 in     8,388,608 */
@@ -84,12 +83,9 @@ uint32_t bxe_debug = BXE_WARN;
 /* Controls how often to simulate an mbuf allocation failure. */
 int bxe_debug_mbuf_allocation_failure = 0;
 
-/* Controls how often to simulate a DMA mapping failure. */
+/* Controls how often to simulate a DMA mapping failure.  */
 int bxe_debug_dma_map_addr_failure = 0;
 
-/* Controls how often to received frame error. */
-int bxe_debug_received_frame_error = 0;
-
 /* Controls how often to simulate a bootcode failure. */
 int bxe_debug_bootcode_running_failure = 0;
 #endif
@@ -103,7 +99,7 @@ int bxe_debug_bootcode_running_failure =
 
 /* BXE Build Time Options */
 /* #define BXE_NVRAM_WRITE 1 */
-#define	USE_DMAE 1
+#define	BXE_USE_DMAE 1
 
 /*
  * PCI Device ID Table
@@ -132,14 +128,17 @@ static int  bxe_attach(device_t);
 static int  bxe_detach(device_t);
 static int  bxe_shutdown(device_t);
 
-static void bxe_set_tunables(struct bxe_softc *);
+/*
+ * Driver local functions.
+ */
+static void bxe_tunables_set(struct bxe_softc *);
 static void bxe_print_adapter_info(struct bxe_softc *);
 static void bxe_probe_pci_caps(struct bxe_softc *);
 static void bxe_link_settings_supported(struct bxe_softc *, uint32_t);
 static void bxe_link_settings_requested(struct bxe_softc *);
-static int  bxe_get_function_hwinfo(struct bxe_softc *);
-static void bxe_get_port_hwinfo(struct bxe_softc *);
-static void bxe_get_common_hwinfo(struct bxe_softc *);
+static int  bxe_hwinfo_function_get(struct bxe_softc *);
+static int  bxe_hwinfo_port_get(struct bxe_softc *);
+static int  bxe_hwinfo_common_get(struct bxe_softc *);
 static void bxe_undi_unload(struct bxe_softc *);
 static int  bxe_setup_leading(struct bxe_softc *);
 static int  bxe_stop_leading(struct bxe_softc *);
@@ -241,8 +240,8 @@ static int  bxe_tx_encap(struct bxe_fast
 static void bxe_tx_start(struct ifnet *);
 static void bxe_tx_start_locked(struct ifnet *, struct bxe_fastpath *);
 static int  bxe_tx_mq_start(struct ifnet *, struct mbuf *);
-static int  bxe_tx_mq_start_locked(struct ifnet *, struct bxe_fastpath *,
-    struct mbuf *);
+static int  bxe_tx_mq_start_locked(struct ifnet *,
+    struct bxe_fastpath *, struct mbuf *);
 static void bxe_mq_flush(struct ifnet *ifp);
 static int  bxe_ioctl(struct ifnet *, u_long, caddr_t);
 static __inline int bxe_has_rx_work(struct bxe_fastpath *);
@@ -254,33 +253,34 @@ static void bxe_intr_sp(void *);
 static void bxe_task_fp(void *, int);
 static void bxe_intr_fp(void *);
 static void bxe_zero_sb(struct bxe_softc *, int);
-static void bxe_init_sb(struct bxe_softc *, struct host_status_block *,
-	    bus_addr_t, int);
+static void bxe_init_sb(struct bxe_softc *,
+    struct host_status_block *,	bus_addr_t, int);
 static void bxe_zero_def_sb(struct bxe_softc *);
-static void bxe_init_def_sb(struct bxe_softc *, struct host_def_status_block *,
-	    bus_addr_t, int);
+static void bxe_init_def_sb(struct bxe_softc *,
+    struct host_def_status_block *, bus_addr_t, int);
 static void bxe_update_coalesce(struct bxe_softc *);
 static __inline void bxe_update_rx_prod(struct bxe_softc *,
-	    struct bxe_fastpath *, uint16_t, uint16_t, uint16_t);
+    struct bxe_fastpath *, uint16_t, uint16_t, uint16_t);
 static void bxe_clear_sge_mask_next_elems(struct bxe_fastpath *);
 static __inline void bxe_init_sge_ring_bit_mask(struct bxe_fastpath *);
-static __inline void bxe_free_tpa_pool(struct bxe_fastpath *, int);
-static __inline void bxe_free_rx_sge(struct bxe_softc *, struct bxe_fastpath *,
-	    uint16_t);
-static __inline void bxe_free_rx_sge_range(struct bxe_softc *,
-	    struct bxe_fastpath *, int);
-static struct mbuf *bxe_alloc_mbuf(struct bxe_fastpath *, int);
-static int  bxe_map_mbuf(struct bxe_fastpath *, struct mbuf *, bus_dma_tag_t,
-	    bus_dmamap_t, bus_dma_segment_t *);
-static struct mbuf *bxe_alloc_tpa_mbuf(struct bxe_fastpath *, int, int);
-static void bxe_alloc_mutexes(struct bxe_softc *);
-static void bxe_free_mutexes(struct bxe_softc *);
-static int  bxe_alloc_rx_sge(struct bxe_softc *, struct bxe_fastpath *,
-	    uint16_t);
-static void bxe_init_rx_chains(struct bxe_softc *);
+static int  bxe_alloc_tpa_mbuf(struct bxe_fastpath *, int);
+static int  bxe_fill_tpa_pool(struct bxe_fastpath *);
+static void bxe_free_tpa_pool(struct bxe_fastpath *);
+
+static int  bxe_alloc_rx_sge_mbuf(struct bxe_fastpath *, uint16_t);
+static int  bxe_fill_sg_chain(struct bxe_fastpath *);
+static void bxe_free_sg_chain(struct bxe_fastpath *);
+
+static int  bxe_alloc_rx_bd_mbuf(struct bxe_fastpath *, uint16_t);
+static int  bxe_fill_rx_bd_chain(struct bxe_fastpath *);
+static void bxe_free_rx_bd_chain(struct bxe_fastpath *);
+
+static void bxe_mutexes_alloc(struct bxe_softc *);
+static void bxe_mutexes_free(struct bxe_softc *);
+static void bxe_clear_rx_chains(struct bxe_softc *);
+static int  bxe_init_rx_chains(struct bxe_softc *);
+static void bxe_clear_tx_chains(struct bxe_softc *);
 static void bxe_init_tx_chains(struct bxe_softc *);
-static void bxe_free_rx_chains(struct bxe_softc *);
-static void bxe_free_tx_chains(struct bxe_softc *);
 static void bxe_init_sp_ring(struct bxe_softc *);
 static void bxe_init_context(struct bxe_softc *);
 static void bxe_init_ind_table(struct bxe_softc *);
@@ -291,8 +291,7 @@ static void bxe_init_internal_port(struc
 
 static void bxe_init_internal_func(struct bxe_softc *);
 static void bxe_init_internal(struct bxe_softc *, uint32_t);
-static void bxe_init_nic(struct bxe_softc *, uint32_t);
-static int  bxe_gunzip_init(struct bxe_softc *);
+static int  bxe_init_nic(struct bxe_softc *, uint32_t);
 static void bxe_lb_pckt(struct bxe_softc *);
 static int  bxe_int_mem_test(struct bxe_softc *);
 static void bxe_enable_blocks_attention (struct bxe_softc *);
@@ -304,13 +303,9 @@ static void bxe_ilt_wr(struct bxe_softc 
 static int  bxe_init_func(struct bxe_softc *);
 static int  bxe_init_hw(struct bxe_softc *, uint32_t);
 static int  bxe_fw_command(struct bxe_softc *, uint32_t);
-static void bxe_dma_free(struct bxe_softc *);
-static void bxe_dmamem_free(struct bxe_softc *, bus_dma_tag_t, caddr_t,
-	    bus_dmamap_t);
+static void bxe_host_structures_free(struct bxe_softc *);
 static void bxe_dma_map_addr(void *, bus_dma_segment_t *, int, int);
-static int  bxe_dma_alloc(device_t);
-static int  bxe_dmamem_alloc(struct bxe_softc *, bus_dma_tag_t, bus_dmamap_t,
-	    void *, uint32_t, bus_addr_t *);
+static int  bxe_host_structures_alloc(device_t);
 static void bxe_set_mac_addr_e1(struct bxe_softc *, int);
 static void bxe_set_mac_addr_e1h(struct bxe_softc *, int);
 static void bxe_set_rx_mode(struct bxe_softc *);
@@ -330,15 +325,12 @@ static void bxe_tpa_stop(struct bxe_soft
 	    int, int, union eth_rx_cqe *, uint16_t);
 static void bxe_rxeof(struct bxe_fastpath *);
 static void bxe_txeof(struct bxe_fastpath *);
-static int  bxe_get_buf(struct bxe_fastpath *, struct mbuf *, uint16_t);
 static int  bxe_watchdog(struct bxe_fastpath *fp);
-static int  bxe_change_mtu(struct bxe_softc *, int);
 static void bxe_tick(void *);
 static void bxe_add_sysctls(struct bxe_softc *);
-static void bxe_gunzip_end(struct bxe_softc *);
 
-static void bxe_write_dmae_phys_len(struct bxe_softc *, bus_addr_t, uint32_t,
-	    uint32_t);
+static void bxe_write_dmae_phys_len(struct bxe_softc *,
+    bus_addr_t, uint32_t, uint32_t);
 
 void bxe_write_dmae(struct bxe_softc *, bus_addr_t, uint32_t, uint32_t);
 void bxe_read_dmae(struct bxe_softc *, uint32_t, uint32_t);
@@ -360,32 +352,33 @@ static int bxe_sysctl_dump_rx_bd_chain(S
 static int bxe_sysctl_dump_tx_chain(SYSCTL_HANDLER_ARGS);
 static int bxe_sysctl_reg_read(SYSCTL_HANDLER_ARGS);
 static int bxe_sysctl_breakpoint(SYSCTL_HANDLER_ARGS);
-static void bxe_validate_rx_packet(struct bxe_fastpath *, uint16_t,
-	    union eth_rx_cqe *, struct mbuf *);
+static __noinline void bxe_validate_rx_packet(struct bxe_fastpath *,
+    uint16_t, union eth_rx_cqe *, struct mbuf *);
 static void bxe_grcdump(struct bxe_softc *, int);
-static void bxe_dump_enet(struct bxe_softc *,struct mbuf *);
-static void bxe_dump_mbuf (struct bxe_softc *, struct mbuf *);
-static void bxe_dump_tx_mbuf_chain(struct bxe_softc *, int, int);
-static void bxe_dump_rx_mbuf_chain(struct bxe_softc *, int, int);
-static void bxe_dump_tx_parsing_bd(struct bxe_fastpath *,int,
-	    struct eth_tx_parse_bd *);
-static void bxe_dump_txbd(struct bxe_fastpath *, int,
-	    union eth_tx_bd_types *);
-static void bxe_dump_rxbd(struct bxe_fastpath *, int,
-	    struct eth_rx_bd *);
-static void bxe_dump_cqe(struct bxe_fastpath *, int, union eth_rx_cqe *);
-static void bxe_dump_tx_chain(struct bxe_fastpath *, int, int);
-static void bxe_dump_rx_cq_chain(struct bxe_fastpath *, int, int);
-static void bxe_dump_rx_bd_chain(struct bxe_fastpath *, int, int);
-static void bxe_dump_status_block(struct bxe_softc *);
-static void bxe_dump_stats_block(struct bxe_softc *);
-static void bxe_dump_fp_state(struct bxe_fastpath *);
-static void bxe_dump_port_state_locked(struct bxe_softc *);
-static void bxe_dump_link_vars_state_locked(struct bxe_softc *);
-static void bxe_dump_link_params_state_locked(struct bxe_softc *);
-static void bxe_dump_driver_state(struct bxe_softc *);
-static void bxe_dump_hw_state(struct bxe_softc *);
-static void bxe_dump_fw(struct bxe_softc *);
+static __noinline void bxe_dump_enet(struct bxe_softc *,struct mbuf *);
+static __noinline void bxe_dump_mbuf (struct bxe_softc *, struct mbuf *);
+static __noinline void bxe_dump_tx_mbuf_chain(struct bxe_softc *, int, int);
+static __noinline void bxe_dump_rx_mbuf_chain(struct bxe_softc *, int, int);
+static __noinline void bxe_dump_tx_parsing_bd(struct bxe_fastpath *,int,
+    struct eth_tx_parse_bd *);
+static __noinline void bxe_dump_txbd(struct bxe_fastpath *, int,
+    union eth_tx_bd_types *);
+static __noinline void bxe_dump_rxbd(struct bxe_fastpath *, int,
+    struct eth_rx_bd *);
+static __noinline void bxe_dump_cqe(struct bxe_fastpath *,
+    int, union eth_rx_cqe *);
+static __noinline void bxe_dump_tx_chain(struct bxe_fastpath *, int, int);
+static __noinline void bxe_dump_rx_cq_chain(struct bxe_fastpath *, int, int);
+static __noinline void bxe_dump_rx_bd_chain(struct bxe_fastpath *, int, int);
+static __noinline void bxe_dump_status_block(struct bxe_softc *);
+static __noinline void bxe_dump_stats_block(struct bxe_softc *);
+static __noinline void bxe_dump_fp_state(struct bxe_fastpath *);
+static __noinline void bxe_dump_port_state_locked(struct bxe_softc *);
+static __noinline void bxe_dump_link_vars_state_locked(struct bxe_softc *);
+static __noinline void bxe_dump_link_params_state_locked(struct bxe_softc *);
+static __noinline void bxe_dump_driver_state(struct bxe_softc *);
+static __noinline void bxe_dump_hw_state(struct bxe_softc *);
+static __noinline void bxe_dump_fw(struct bxe_softc *);
 static void bxe_decode_mb_msgs(struct bxe_softc *, uint32_t, uint32_t);
 static void bxe_decode_ramrod_cmd(struct bxe_softc *, int);
 static void bxe_breakpoint(struct bxe_softc *);
@@ -433,11 +426,6 @@ DRIVER_MODULE(bxe, pci, bxe_driver, bxe_
 SYSCTL_NODE(_hw, OID_AUTO, bxe, CTLFLAG_RD, 0, "bxe driver parameters");
 /* Allowable values are TRUE (1) or FALSE (0). */
 
-static int bxe_stats_enable = FALSE;
-TUNABLE_INT("hw.bxe.stats_enable", &bxe_stats_enable);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, stats_enable, CTLFLAG_RDTUN, &bxe_stats_enable,
-    0, "stats Enable/Disable");
-
 static int bxe_dcc_enable = FALSE;
 TUNABLE_INT("hw.bxe.dcc_enable", &bxe_dcc_enable);
 SYSCTL_UINT(_hw_bxe, OID_AUTO, dcc_enable, CTLFLAG_RDTUN, &bxe_dcc_enable,
@@ -456,18 +444,6 @@ SYSCTL_UINT(_hw_bxe, OID_AUTO, int_mode,
     0, "Interrupt (MSI-X|MSI|INTx) mode");
 
 /*
- * Specifies whether the driver should disable Transparent Packet
- * Aggregation (TPA, also known as LRO).  By default TPA is enabled.
- *
- * Allowable values are TRUE (1) or FALSE (0).
- */
-static int bxe_tpa_enable = FALSE;
-TUNABLE_INT("hw.bxe.tpa_enable", &bxe_tpa_enable);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, tpa_enable, CTLFLAG_RDTUN, &bxe_tpa_enable,
-    0, "TPA Enable/Disable");
-
-
-/*
  * Specifies the number of queues that will be used when a multi-queue
  * RSS mode is selected  using bxe_multi_mode below.
  *
@@ -480,8 +456,8 @@ SYSCTL_UINT(_hw_bxe, OID_AUTO, queue_cou
 
 /*
  * ETH_RSS_MODE_DISABLED (0)
- * Disables all multi-queue/packet sorting algorithms.  Each
- * received frame is routed to the same receive queue.
+ * Disables all multi-queue/packet sorting algorithms.  All
+ * received frames are routed to a single receive queue.
  *
  * ETH_RSS_MODE_REGULAR (1)
  * The default mode which assigns incoming frames to receive
@@ -579,7 +555,7 @@ bxe_reg_write32(struct bxe_softc *sc, bu
 		    (uintmax_t)offset);
 	}
 
-	DBPRINT(sc, BXE_INSANE, "%s(): offset = 0x%jX, val = 0x%08X\n",
+	DBPRINT(sc, BXE_INSANE_REGS, "%s(): offset = 0x%jX, val = 0x%08X\n",
 	    __FUNCTION__, (uintmax_t)offset, val);
 
 	bus_space_write_4(sc->bxe_btag, sc->bxe_bhandle, offset, val);
@@ -602,7 +578,7 @@ bxe_reg_write16(struct bxe_softc *sc, bu
 		    (uintmax_t)offset);
 	}
 
-	DBPRINT(sc, BXE_INSANE, "%s(): offset = 0x%jX, val = 0x%04X\n",
+	DBPRINT(sc, BXE_INSANE_REGS, "%s(): offset = 0x%jX, val = 0x%04X\n",
 	    __FUNCTION__, (uintmax_t)offset, val);
 
 	bus_space_write_2(sc->bxe_btag, sc->bxe_bhandle, offset, val);
@@ -619,7 +595,7 @@ static void
 bxe_reg_write8(struct bxe_softc *sc, bus_size_t offset, uint8_t val)
 {
 
-	DBPRINT(sc, BXE_INSANE, "%s(): offset = 0x%jX, val = 0x%02X\n",
+	DBPRINT(sc, BXE_INSANE_REGS, "%s(): offset = 0x%jX, val = 0x%02X\n",
 	    __FUNCTION__, (uintmax_t)offset, val);
 
 	bus_space_write_1(sc->bxe_btag, sc->bxe_bhandle, offset, val);
@@ -645,7 +621,7 @@ bxe_reg_read32(struct bxe_softc *sc, bus
 
 	val = bus_space_read_4(sc->bxe_btag, sc->bxe_bhandle, offset);
 
-	DBPRINT(sc, BXE_INSANE, "%s(): offset = 0x%jX, val = 0x%08X\n",
+	DBPRINT(sc, BXE_INSANE_REGS, "%s(): offset = 0x%jX, val = 0x%08X\n",
 		__FUNCTION__, (uintmax_t)offset, val);
 
 	return (val);
@@ -671,7 +647,7 @@ bxe_reg_read16(struct bxe_softc *sc, bus
 
 	val = bus_space_read_2(sc->bxe_btag, sc->bxe_bhandle, offset);
 
-	DBPRINT(sc, BXE_INSANE, "%s(): offset = 0x%jX, val = 0x%08X\n",
+	DBPRINT(sc, BXE_INSANE_REGS, "%s(): offset = 0x%jX, val = 0x%08X\n",
 	    __FUNCTION__, (uintmax_t)offset, val);
 
 	return (val);
@@ -690,10 +666,10 @@ bxe_reg_read8(struct bxe_softc *sc, bus_
 {
 	uint8_t val = bus_space_read_1(sc->bxe_btag, sc->bxe_bhandle, offset);
 
-	DBPRINT(sc, BXE_INSANE, "%s(): offset = 0x%jX, val = 0x%02X\n",
+	DBPRINT(sc, BXE_INSANE_REGS, "%s(): offset = 0x%jX, val = 0x%02X\n",
 		__FUNCTION__, (uintmax_t)offset, val);
 
-	return(val);
+	return (val);
 }
 #endif
 
@@ -996,6 +972,7 @@ bxe_probe(device_t dev)
  * Returns:
  *   None.
  */
+/* ToDo: Create a sysctl for this info. */
 static void
 bxe_print_adapter_info(struct bxe_softc *sc)
 {
@@ -1025,19 +1002,14 @@ bxe_print_adapter_info(struct bxe_softc 
 	printf("); Flags (");
 
 	/* Miscellaneous flags. */
-	if (sc->bxe_flags & BXE_USING_MSI_FLAG)
+	if (sc->msi_count > 0)
 		printf("MSI");
 
-	if (sc->bxe_flags & BXE_USING_MSIX_FLAG) {
+	if (sc->msix_count > 0) {
 		if (i > 0) printf("|");
 		printf("MSI-X"); i++;
 	}
 
-	if (sc->bxe_flags & BXE_SAFC_TX_FLAG) {
-		if (i > 0) printf("|");
-		printf("SAFC"); i++;
-	}
-
 	if (TPA_ENABLED(sc)) {
 		if (i > 0) printf("|");
 		printf("TPA"); i++;
@@ -1056,6 +1028,9 @@ bxe_print_adapter_info(struct bxe_softc 
 		break;
 	}
 
+	printf("); BD's (RX:%d,TX:%d",
+	    (int) USABLE_RX_BD, (int) USABLE_TX_BD);
+
 	/* Firmware versions and device features. */
 	printf("); Firmware (%d.%d.%d); Bootcode (%d.%d.%d)\n",
 	    BCM_5710_FW_MAJOR_VERSION,
@@ -1069,6 +1044,64 @@ bxe_print_adapter_info(struct bxe_softc 
 }
 
 /*
+ * Release any interrupts allocated by the driver.
+ *
+ * Returns:
+ *   None
+ */
+static void
+bxe_interrupt_free(struct bxe_softc *sc)
+{
+	device_t dev;
+	int i;
+
+	DBENTER(BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
+
+	dev = sc->dev;
+
+	if (sc->msix_count > 0) {
+		/* Free MSI-X resources. */
+
+		for (i = 0; i < sc->msix_count; i++) {
+			DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET |
+			    BXE_VERBOSE_INTR), "%s(): Releasing MSI-X[%d] "
+			    "vector.\n", __FUNCTION__, i);
+			if (sc->bxe_msix_res[i] && sc->bxe_msix_rid[i])
+				bus_release_resource(dev, SYS_RES_IRQ,
+				    sc->bxe_msix_rid[i], sc->bxe_msix_res[i]);
+		}
+
+		pci_release_msi(dev);
+
+	} else if (sc->msi_count > 0) {
+		/* Free MSI resources. */
+
+		for (i = 0; i < sc->msi_count; i++) {
+			DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET |
+			    BXE_VERBOSE_INTR), "%s(): Releasing MSI[%d] "
+			    "vector.\n", __FUNCTION__, i);
+			if (sc->bxe_msi_res[i] && sc->bxe_msi_rid[i])
+				bus_release_resource(dev, SYS_RES_IRQ,
+				    sc->bxe_msi_rid[i], sc->bxe_msi_res[i]);
+		}
+
+		pci_release_msi(dev);
+
+	} else {
+		/* Free legacy interrupt resources. */
+
+		DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET |
+		    BXE_VERBOSE_INTR), "%s(): Releasing legacy interrupt.\n",
+		    __FUNCTION__);
+		if (sc->bxe_irq_res != NULL)
+			bus_release_resource(dev, SYS_RES_IRQ,
+			    sc->bxe_irq_rid, sc->bxe_irq_res);
+	}
+
+	DBEXIT(BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
+}
+
+/*
  * This function determines and allocates the appropriate
  * interrupt based on system capabilites and user request.
  *
@@ -1086,30 +1119,19 @@ bxe_print_adapter_info(struct bxe_softc 
  *   0 = Success, !0 = Failure.
  */
 static int
-bxe_interrupt_allocate(struct bxe_softc *sc)
+bxe_interrupt_alloc(struct bxe_softc *sc)
 {
 	device_t dev;
-	int i, rid, rc;
+	int error, i, rid, rc;
 	int msi_count, msi_required, msi_allocated;
 	int msix_count, msix_required, msix_allocated;
 
-	rc = 0;
-	dev = sc->dev;
-	msi_count = 0;
-	msi_required = 0;
-	msi_allocated = 0;
-	msix_count = 0;
-	msix_required = 0;
-	msix_allocated = 0;
-
 	DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR);
 
-	/* Assume SAFC not enabled for TX. */
-	sc->bxe_flags &= ~BXE_SAFC_TX_FLAG;
-
-	/* Clear any previous priority queue mappings. */
-	for (i = 0; i < BXE_MAX_PRIORITY; i++)
-		sc->pri_map[i] = 0;
+	rc = 0;
+	dev = sc->dev;
+	msi_count = msi_required = msi_allocated = 0;
+	msix_count = msix_required = msix_allocated = 0;
 
 	/* Get the number of available MSI/MSI-X interrupts from the OS. */
 	if (sc->int_mode > 0) {
@@ -1140,7 +1162,8 @@ bxe_interrupt_allocate(struct bxe_softc 
 
 		/* BSD resource identifier */
 		rid = 1;
-		if (pci_alloc_msix(dev, &msix_allocated) == 0) {
+		error = pci_alloc_msix(dev, &msix_allocated);
+		if (error == 0) {
 			DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR),
 		"%s(): Required/Allocated (%d/%d) MSI-X vector(s).\n",
 			    __FUNCTION__, msix_required, msix_allocated);
@@ -1148,7 +1171,6 @@ bxe_interrupt_allocate(struct bxe_softc 
 			/* Make sure we got all the interrupts we asked for. */
 			if (msix_allocated >= msix_required) {
 				sc->msix_count = msix_required;
-				sc->bxe_flags |= BXE_USING_MSIX_FLAG;
 				msi_count = 0;
 
 				/* Allocate the MSI-X vectors. */
@@ -1165,7 +1187,7 @@ bxe_interrupt_allocate(struct bxe_softc 
 				"%s(%d): Failed to map MSI-X[%d] vector!\n",
 						    __FILE__, __LINE__, (3));
 						rc = ENXIO;
-						goto bxe_interrupt_allocate_exit;
+						goto bxe_interrupt_alloc_exit;
 					}
 				}
 			} else {
@@ -1176,7 +1198,6 @@ bxe_interrupt_allocate(struct bxe_softc 
 
 				/* Release any resources acquired. */
 				pci_release_msi(dev);
-				sc->bxe_flags &= ~BXE_USING_MSIX_FLAG;
 				sc->msix_count = msix_count = 0;
 
 				/* We'll try MSI next. */
@@ -1200,7 +1221,8 @@ bxe_interrupt_allocate(struct bxe_softc 
 		    msi_required);
 
 		rid = 1;
-		if (pci_alloc_msi(dev, &msi_allocated) == 0) {
+		error = pci_alloc_msi(dev, &msi_allocated);
+		if (error == 0) {
 			DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR),
 			    "%s(): Required/Allocated (%d/%d) MSI vector(s).\n",
 			    __FUNCTION__, msi_required, msi_allocated);
@@ -1212,7 +1234,6 @@ bxe_interrupt_allocate(struct bxe_softc 
 			 */
 			if (msi_required >= msi_allocated) {
 				sc->msi_count = msi_required;
-				sc->bxe_flags |= BXE_USING_MSI_FLAG;
 				/* Allocate the MSI vectors. */
 				for (i = 0; i < msi_required; i++) {
 					sc->bxe_msi_rid[i] = i + rid;
@@ -1226,7 +1247,7 @@ bxe_interrupt_allocate(struct bxe_softc 
 				"%s(%d): Failed to map MSI vector (%d)!\n",
 						    __FILE__, __LINE__, (i));
 						rc = ENXIO;
-						goto bxe_interrupt_allocate_exit;
+						goto bxe_interrupt_alloc_exit;
 					}
 				}
 			}
@@ -1237,7 +1258,6 @@ bxe_interrupt_allocate(struct bxe_softc 
 
 			/* Release any resources acquired. */
 			pci_release_msi(dev);
-			sc->bxe_flags &= ~BXE_USING_MSI_FLAG;
 			sc->msi_count = msi_count = 0;
 
 			/* We'll try INTx next. */
@@ -1262,7 +1282,7 @@ bxe_interrupt_allocate(struct bxe_softc 
 			BXE_PRINTF("%s(%d): PCI map interrupt failed!\n",
 			    __FILE__, __LINE__);
 			rc = ENXIO;
-			goto bxe_interrupt_allocate_exit;
+			goto bxe_interrupt_alloc_exit;
 		}
 		sc->bxe_irq_rid = rid;
 	}
@@ -1271,27 +1291,55 @@ bxe_interrupt_allocate(struct bxe_softc 
 	    "%s(): Actual: int_mode = %d, multi_mode = %d, num_queues = %d\n",
 	    __FUNCTION__, sc->int_mode, sc->multi_mode, sc->num_queues);
 
-bxe_interrupt_allocate_exit:
+bxe_interrupt_alloc_exit:
 	DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR);
 	return (rc);
 }
 
+/*
+ * This function releases taskqueues.
+ *
+ * Returns:
+ *   None
+ */
 static void
 bxe_interrupt_detach(struct bxe_softc *sc)
 {
+#ifdef BXE_TASK
+	struct bxe_fastpath *fp;
+#endif
 	device_t dev;
 	int i;
 
+	DBENTER(BXE_VERBOSE_UNLOAD);
+
 	dev = sc->dev;
-	DBENTER(BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
+
+#ifdef BXE_TASK
+	/* Free the OS taskqueue resources. */
+	for (i = 0; i < sc->num_queues; i++) {
+		fp = &sc->fp[i];
+
+		if (fp->tq != NULL) {
+			taskqueue_drain(fp->tq, &fp->task);
+			taskqueue_free(fp->tq);
+		}
+	}
+
+	if (sc->tq != NULL) {
+		taskqueue_drain(sc->tq, &sc->task);
+		taskqueue_free(sc->tq);
+	}
+#endif
+
 	/* Release interrupt resources. */
-	if ((sc->bxe_flags & BXE_USING_MSIX_FLAG) && sc->msix_count) {
+	if (sc->msix_count > 0) {
 		for (i = 0; i < sc->msix_count; i++) {
 			if (sc->bxe_msix_tag[i] && sc->bxe_msix_res[i])
 				bus_teardown_intr(dev, sc->bxe_msix_res[i],
 				    sc->bxe_msix_tag[i]);
 		}
-	} else if ((sc->bxe_flags & BXE_USING_MSI_FLAG) && sc->msi_count) {
+	} else if (sc->msi_count > 0) {
 		for (i = 0; i < sc->msi_count; i++) {
 			if (sc->bxe_msi_tag[i] && sc->bxe_msi_res[i])
 				bus_teardown_intr(dev, sc->bxe_msi_res[i],
@@ -1302,6 +1350,8 @@ bxe_interrupt_detach(struct bxe_softc *s
 			bus_teardown_intr(dev, sc->bxe_irq_res,
 			    sc->bxe_irq_tag);
 	}
+
+	DBEXIT(BXE_VERBOSE_UNLOAD);
 }
 
 /*
@@ -1336,7 +1386,7 @@ bxe_interrupt_attach(struct bxe_softc *s
 #endif
 
 	/* Setup interrupt handlers. */
-	if (sc->bxe_flags & BXE_USING_MSIX_FLAG) {
+	if (sc->msix_count > 0) {
 		DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR),
 		    "%s(): Enabling slowpath MSI-X[0] vector.\n",__FUNCTION__);
 		/*
@@ -1344,13 +1394,9 @@ bxe_interrupt_attach(struct bxe_softc *s
 		 * driver instance to the interrupt handler for the
 		 * slowpath.
 		 */
-		rc = bus_setup_intr(sc->dev,
-				    sc->bxe_msix_res[0],
-				    INTR_TYPE_NET | INTR_MPSAFE,
-				    NULL,
-				    bxe_intr_sp,
-				    sc,
-				    &sc->bxe_msix_tag[0]);
+		rc = bus_setup_intr(sc->dev, sc->bxe_msix_res[0],
+		    INTR_TYPE_NET | INTR_MPSAFE, NULL, bxe_intr_sp,
+		    sc,	&sc->bxe_msix_tag[0]);
 
 		if (rc) {
 			BXE_PRINTF(
@@ -1360,10 +1406,8 @@ bxe_interrupt_attach(struct bxe_softc *s
 		}
 
 #if __FreeBSD_version >= 800504
-		bus_describe_intr(sc->dev,
-				  sc->bxe_msix_res[0],
-				  sc->bxe_msix_tag[0],
-				  "sp");
+		bus_describe_intr(sc->dev, sc->bxe_msix_res[0],
+				  sc->bxe_msix_tag[0], "sp");
 #endif
 
 		/* Now initialize the fastpath vectors. */
@@ -1377,13 +1421,9 @@ bxe_interrupt_attach(struct bxe_softc *s
 			 * fastpath context to the interrupt handler in this
 			 * case. Also the first msix_res was used by the sp.
 			 */
-			rc = bus_setup_intr(sc->dev,
-					    sc->bxe_msix_res[i + 1],
-					    INTR_TYPE_NET | INTR_MPSAFE,
-					    NULL,
-					    bxe_intr_fp,
-					    fp,
-					    &sc->bxe_msix_tag[i + 1]);
+			rc = bus_setup_intr(sc->dev, sc->bxe_msix_res[i + 1],
+			    INTR_TYPE_NET | INTR_MPSAFE, NULL, bxe_intr_fp,
+			    fp,	&sc->bxe_msix_tag[i + 1]);
 
 			if (rc) {
 			    BXE_PRINTF(
@@ -1393,11 +1433,8 @@ bxe_interrupt_attach(struct bxe_softc *s
 			}
 
 #if __FreeBSD_version >= 800504
-			bus_describe_intr(sc->dev,
-					  sc->bxe_msix_res[i + 1],
-					  sc->bxe_msix_tag[i + 1],
-					  "fp[%02d]",
-					  i);
+			bus_describe_intr(sc->dev, sc->bxe_msix_res[i + 1],
+			    sc->bxe_msix_tag[i + 1], "fp[%02d]",	i);
 #endif
 
 			/* Bind the fastpath instance to a CPU. */
@@ -1409,13 +1446,13 @@ bxe_interrupt_attach(struct bxe_softc *s
 #ifdef BXE_TASK
 			TASK_INIT(&fp->task, 0, bxe_task_fp, fp);
 			fp->tq = taskqueue_create_fast("bxe_fpq", M_NOWAIT,
-				taskqueue_thread_enqueue, &fp->tq);
+			    taskqueue_thread_enqueue, &fp->tq);
 			taskqueue_start_threads(&fp->tq, 1, PI_NET, "%s fpq",
-				device_get_nameunit(sc->dev));
+			    device_get_nameunit(sc->dev));
 #endif
 			fp->state = BXE_FP_STATE_IRQ;
 		}
-	} else if (sc->bxe_flags & BXE_USING_MSI_FLAG) {
+	} else if (sc->msi_count > 0) {
 		DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR),
 			"%s(): Enabling slowpath MSI[0] vector.\n",
 			__FUNCTION__);
@@ -1424,12 +1461,8 @@ bxe_interrupt_attach(struct bxe_softc *s
 		 * instance to the interrupt handler for the slowpath.
 		 */
 		rc = bus_setup_intr(sc->dev,sc->bxe_msi_res[0],
-				    INTR_TYPE_NET | INTR_MPSAFE,
-				    NULL,
-				    bxe_intr_sp,
-				    sc,
-				    &sc->bxe_msi_tag[0]
-				    );
+		    INTR_TYPE_NET | INTR_MPSAFE, NULL, bxe_intr_sp,
+		    sc,	&sc->bxe_msi_tag[0]);
 
 		if (rc) {
 			BXE_PRINTF(
@@ -1439,10 +1472,8 @@ bxe_interrupt_attach(struct bxe_softc *s
 		}
 
 #if __FreeBSD_version >= 800504
-		bus_describe_intr(sc->dev,
-				  sc->bxe_msi_res[0],
-				  sc->bxe_msi_tag[0],
-				  "sp");
+		bus_describe_intr(sc->dev, sc->bxe_msi_res[0],
+		    sc->bxe_msi_tag[0],	"sp");
 #endif
 
 		/* Now initialize the fastpath vectors. */
@@ -1457,14 +1488,9 @@ bxe_interrupt_attach(struct bxe_softc *s
 			 * fastpath context to the interrupt handler in this
 			 * case.
 			 */
-			rc = bus_setup_intr(sc->dev,
-					    sc->bxe_msi_res[i + 1],
-					    INTR_TYPE_NET | INTR_MPSAFE,
-					    NULL,
-					    bxe_intr_fp,
-					    fp,
-					    &sc->bxe_msi_tag[i + 1]
-					    );
+			rc = bus_setup_intr(sc->dev, sc->bxe_msi_res[i + 1],
+			    INTR_TYPE_NET | INTR_MPSAFE, NULL, bxe_intr_fp,
+			    fp,	&sc->bxe_msi_tag[i + 1]);
 
 			if (rc) {
 				BXE_PRINTF(
@@ -1474,19 +1500,16 @@ bxe_interrupt_attach(struct bxe_softc *s
 			}
 
 #if __FreeBSD_version >= 800504
-			bus_describe_intr(sc->dev,
-					  sc->bxe_msi_res[i + 1],
-					  sc->bxe_msi_tag[i + 1],
-					  "fp[%02d]",
-					  i);
+			bus_describe_intr(sc->dev, sc->bxe_msi_res[i + 1],
+			     sc->bxe_msi_tag[i + 1], "fp[%02d]", i);
 #endif
 
 #ifdef BXE_TASK
 			TASK_INIT(&fp->task, 0, bxe_task_fp, fp);
 			fp->tq = taskqueue_create_fast("bxe_fpq", M_NOWAIT,
-					taskqueue_thread_enqueue, &fp->tq);
+			    taskqueue_thread_enqueue, &fp->tq);
 			taskqueue_start_threads(&fp->tq, 1, PI_NET, "%s fpq",
-				device_get_nameunit(sc->dev));
+			    device_get_nameunit(sc->dev));
 #endif
 		}
 
@@ -1495,23 +1518,19 @@ bxe_interrupt_attach(struct bxe_softc *s
 		fp = &sc->fp[0];
 #endif
 		DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR),
-			"%s(): Enabling INTx interrupts.\n", __FUNCTION__);
+		    "%s(): Enabling INTx interrupts.\n", __FUNCTION__);
 
 		/*
 		 * Setup the interrupt handler.  Note that we pass the
 		 * driver instance to the interrupt handler which
 		 * will handle both the slowpath and fastpath.
 		 */
-		rc = bus_setup_intr(sc->dev,sc->bxe_irq_res,
-		    INTR_TYPE_NET | INTR_MPSAFE,
-		    NULL,
-		    bxe_intr_legacy,
-		    sc,
-		    &sc->bxe_irq_tag);
+		rc = bus_setup_intr(sc->dev,sc->bxe_irq_res, INTR_TYPE_NET |
+		    INTR_MPSAFE, NULL, bxe_intr_legacy,	sc, &sc->bxe_irq_tag);
 
 		if (rc) {
 			BXE_PRINTF("%s(%d): Failed to allocate interrupt!\n",
-				   __FILE__, __LINE__);
+			    __FILE__, __LINE__);
 			goto bxe_interrupt_attach_exit;
 		}
 #ifdef BXE_TASK
@@ -1616,56 +1635,78 @@ bxe_probe_pci_caps(struct bxe_softc *sc)
 	DBEXIT(BXE_EXTREME_LOAD);
 }
 
+/*
+ * Setup firmware pointers for BCM57710.
+ *
+ * Returns:
+ *   None
+ */
 static void
 bxe_init_e1_firmware(struct bxe_softc *sc)
 {
-	INIT_OPS(sc)                  = (struct raw_op *)init_ops_e1;
-	INIT_DATA(sc)                 = (const uint32_t *)init_data_e1;
-	INIT_OPS_OFFSETS(sc)          = (const uint16_t *)init_ops_offsets_e1;
-	INIT_TSEM_INT_TABLE_DATA(sc)  = tsem_int_table_data_e1;
-	INIT_TSEM_PRAM_DATA(sc)       = tsem_pram_data_e1;
-	INIT_USEM_INT_TABLE_DATA(sc)  = usem_int_table_data_e1;
-	INIT_USEM_PRAM_DATA(sc)       = usem_pram_data_e1;
-	INIT_XSEM_INT_TABLE_DATA(sc)  = xsem_int_table_data_e1;
-	INIT_XSEM_PRAM_DATA(sc)       = xsem_pram_data_e1;
-	INIT_CSEM_INT_TABLE_DATA(sc)  = csem_int_table_data_e1;
-	INIT_CSEM_PRAM_DATA(sc)       = csem_pram_data_e1;
+	INIT_OPS(sc)			= (struct raw_op *)init_ops_e1;
+	INIT_DATA(sc)			= (const uint32_t *)init_data_e1;
+	INIT_OPS_OFFSETS(sc)		= (const uint16_t *)init_ops_offsets_e1;
+	INIT_TSEM_INT_TABLE_DATA(sc)	= tsem_int_table_data_e1;
+	INIT_TSEM_PRAM_DATA(sc)		= tsem_pram_data_e1;
+	INIT_USEM_INT_TABLE_DATA(sc)	= usem_int_table_data_e1;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106082118.p58LIE8h047762>