Deleted Added
full compact
if_bcereg.h (189117) if_bcereg.h (189325)
1/*-
2 * Copyright (c) 2006-2009 Broadcom Corporation
3 * David Christensen <davidch@broadcom.com>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 2006-2009 Broadcom Corporation
3 * David Christensen <davidch@broadcom.com>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/dev/bce/if_bcereg.h 189117 2009-02-27 19:25:06Z davidch $
29 * $FreeBSD: head/sys/dev/bce/if_bcereg.h 189325 2009-03-04 00:05:40Z davidch $
30 */
31
30 */
31
32#ifndef _BCE_H_DEFINED
33#define _BCE_H_DEFINED
32#ifndef _BCEREG_H_DEFINED
33#define _BCEREG_H_DEFINED
34
35#ifdef HAVE_KERNEL_OPTION_HEADERS
36#include "opt_device_polling.h"
37#endif
38
39#include <sys/param.h>
40#include <sys/endian.h>
41#include <sys/systm.h>

--- 1238 unchanged lines hidden (view full) ---

1280 u32 stat_Dot3StatsMultipleCollisionFrames;
1281 u32 stat_Dot3StatsDeferredTransmissions;
1282 u32 stat_Dot3StatsExcessiveCollisions;
1283 u32 stat_Dot3StatsLateCollisions;
1284 u32 stat_EtherStatsCollisions;
1285 u32 stat_EtherStatsFragments;
1286 u32 stat_EtherStatsJabbers;
1287 u32 stat_EtherStatsUndersizePkts;
34
35#ifdef HAVE_KERNEL_OPTION_HEADERS
36#include "opt_device_polling.h"
37#endif
38
39#include <sys/param.h>
40#include <sys/endian.h>
41#include <sys/systm.h>

--- 1238 unchanged lines hidden (view full) ---

1280 u32 stat_Dot3StatsMultipleCollisionFrames;
1281 u32 stat_Dot3StatsDeferredTransmissions;
1282 u32 stat_Dot3StatsExcessiveCollisions;
1283 u32 stat_Dot3StatsLateCollisions;
1284 u32 stat_EtherStatsCollisions;
1285 u32 stat_EtherStatsFragments;
1286 u32 stat_EtherStatsJabbers;
1287 u32 stat_EtherStatsUndersizePkts;
1288 u32 stat_EtherStatsOverrsizePkts;
1288 u32 stat_EtherStatsOversizePkts;
1289 u32 stat_EtherStatsPktsRx64Octets;
1290 u32 stat_EtherStatsPktsRx65Octetsto127Octets;
1291 u32 stat_EtherStatsPktsRx128Octetsto255Octets;
1292 u32 stat_EtherStatsPktsRx256Octetsto511Octets;
1293 u32 stat_EtherStatsPktsRx512Octetsto1023Octets;
1294 u32 stat_EtherStatsPktsRx1024Octetsto1522Octets;
1295 u32 stat_EtherStatsPktsRx1523Octetsto9022Octets;
1296 u32 stat_EtherStatsPktsTx64Octets;

--- 4875 unchanged lines hidden (view full) ---

6172 */
6173#define TX_PAGES 2
6174#define TOTAL_TX_BD_PER_PAGE (BCM_PAGE_SIZE / sizeof(struct tx_bd))
6175#define USABLE_TX_BD_PER_PAGE (TOTAL_TX_BD_PER_PAGE - 1)
6176#define TOTAL_TX_BD (TOTAL_TX_BD_PER_PAGE * TX_PAGES)
6177#define USABLE_TX_BD (USABLE_TX_BD_PER_PAGE * TX_PAGES)
6178#define MAX_TX_BD (TOTAL_TX_BD - 1)
6179
1289 u32 stat_EtherStatsPktsRx64Octets;
1290 u32 stat_EtherStatsPktsRx65Octetsto127Octets;
1291 u32 stat_EtherStatsPktsRx128Octetsto255Octets;
1292 u32 stat_EtherStatsPktsRx256Octetsto511Octets;
1293 u32 stat_EtherStatsPktsRx512Octetsto1023Octets;
1294 u32 stat_EtherStatsPktsRx1024Octetsto1522Octets;
1295 u32 stat_EtherStatsPktsRx1523Octetsto9022Octets;
1296 u32 stat_EtherStatsPktsTx64Octets;

--- 4875 unchanged lines hidden (view full) ---

6172 */
6173#define TX_PAGES 2
6174#define TOTAL_TX_BD_PER_PAGE (BCM_PAGE_SIZE / sizeof(struct tx_bd))
6175#define USABLE_TX_BD_PER_PAGE (TOTAL_TX_BD_PER_PAGE - 1)
6176#define TOTAL_TX_BD (TOTAL_TX_BD_PER_PAGE * TX_PAGES)
6177#define USABLE_TX_BD (USABLE_TX_BD_PER_PAGE * TX_PAGES)
6178#define MAX_TX_BD (TOTAL_TX_BD - 1)
6179
6180/* Advance to the next tx_bd, skipping any next page pointers. */
6180#define NEXT_TX_BD(x) (((x) & USABLE_TX_BD_PER_PAGE) == \
6181 (USABLE_TX_BD_PER_PAGE - 1)) ? \
6182 (x) + 2 : (x) + 1
6183
6184#define TX_CHAIN_IDX(x) ((x) & MAX_TX_BD)
6185
6186#define TX_PAGE(x) (((x) & ~USABLE_TX_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4))
6187#define TX_IDX(x) ((x) & USABLE_TX_BD_PER_PAGE)

--- 4 unchanged lines hidden (view full) ---

6192 */
6193#define RX_PAGES 2
6194#define TOTAL_RX_BD_PER_PAGE (BCM_PAGE_SIZE / sizeof(struct rx_bd))
6195#define USABLE_RX_BD_PER_PAGE (TOTAL_RX_BD_PER_PAGE - 1)
6196#define TOTAL_RX_BD (TOTAL_RX_BD_PER_PAGE * RX_PAGES)
6197#define USABLE_RX_BD (USABLE_RX_BD_PER_PAGE * RX_PAGES)
6198#define MAX_RX_BD (TOTAL_RX_BD - 1)
6199
6181#define NEXT_TX_BD(x) (((x) & USABLE_TX_BD_PER_PAGE) == \
6182 (USABLE_TX_BD_PER_PAGE - 1)) ? \
6183 (x) + 2 : (x) + 1
6184
6185#define TX_CHAIN_IDX(x) ((x) & MAX_TX_BD)
6186
6187#define TX_PAGE(x) (((x) & ~USABLE_TX_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4))
6188#define TX_IDX(x) ((x) & USABLE_TX_BD_PER_PAGE)

--- 4 unchanged lines hidden (view full) ---

6193 */
6194#define RX_PAGES 2
6195#define TOTAL_RX_BD_PER_PAGE (BCM_PAGE_SIZE / sizeof(struct rx_bd))
6196#define USABLE_RX_BD_PER_PAGE (TOTAL_RX_BD_PER_PAGE - 1)
6197#define TOTAL_RX_BD (TOTAL_RX_BD_PER_PAGE * RX_PAGES)
6198#define USABLE_RX_BD (USABLE_RX_BD_PER_PAGE * RX_PAGES)
6199#define MAX_RX_BD (TOTAL_RX_BD - 1)
6200
6201/* Advance to the next rx_bd, skipping any next page pointers. */
6200#define NEXT_RX_BD(x) (((x) & USABLE_RX_BD_PER_PAGE) == \
6201 (USABLE_RX_BD_PER_PAGE - 1)) ? \
6202 (x) + 2 : (x) + 1
6203
6204#define RX_CHAIN_IDX(x) ((x) & MAX_RX_BD)
6205
6206#define RX_PAGE(x) (((x) & ~USABLE_RX_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4))
6207#define RX_IDX(x) ((x) & USABLE_RX_BD_PER_PAGE)

--- 5 unchanged lines hidden (view full) ---

6213 */
6214#define PG_PAGES (RX_PAGES * 4)
6215#define TOTAL_PG_BD_PER_PAGE (BCM_PAGE_SIZE / sizeof(struct rx_bd))
6216#define USABLE_PG_BD_PER_PAGE (TOTAL_PG_BD_PER_PAGE - 1)
6217#define TOTAL_PG_BD (TOTAL_PG_BD_PER_PAGE * PG_PAGES)
6218#define USABLE_PG_BD (USABLE_PG_BD_PER_PAGE * PG_PAGES)
6219#define MAX_PG_BD (TOTAL_PG_BD - 1)
6220
6202#define NEXT_RX_BD(x) (((x) & USABLE_RX_BD_PER_PAGE) == \
6203 (USABLE_RX_BD_PER_PAGE - 1)) ? \
6204 (x) + 2 : (x) + 1
6205
6206#define RX_CHAIN_IDX(x) ((x) & MAX_RX_BD)
6207
6208#define RX_PAGE(x) (((x) & ~USABLE_RX_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4))
6209#define RX_IDX(x) ((x) & USABLE_RX_BD_PER_PAGE)

--- 5 unchanged lines hidden (view full) ---

6215 */
6216#define PG_PAGES (RX_PAGES * 4)
6217#define TOTAL_PG_BD_PER_PAGE (BCM_PAGE_SIZE / sizeof(struct rx_bd))
6218#define USABLE_PG_BD_PER_PAGE (TOTAL_PG_BD_PER_PAGE - 1)
6219#define TOTAL_PG_BD (TOTAL_PG_BD_PER_PAGE * PG_PAGES)
6220#define USABLE_PG_BD (USABLE_PG_BD_PER_PAGE * PG_PAGES)
6221#define MAX_PG_BD (TOTAL_PG_BD - 1)
6222
6223/* Advance to the next pg_bd, skipping any next page pointers. */
6221#define NEXT_PG_BD(x) (((x) & USABLE_PG_BD_PER_PAGE) == \
6222 (USABLE_PG_BD_PER_PAGE - 1)) ? \
6223 (x) + 2 : (x) + 1
6224
6225#define PG_CHAIN_IDX(x) ((x) & MAX_PG_BD)
6226
6227#define PG_PAGE(x) (((x) & ~USABLE_PG_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4))
6228#define PG_IDX(x) ((x) & USABLE_PG_BD_PER_PAGE)

--- 218 unchanged lines hidden (view full) ---

6447 u16 link_width; /* PCIe link width */
6448 u16 link_speed; /* PCIe link speed */
6449 struct flash_spec *bce_flash_info; /* Flash NVRAM settings */
6450 u32 bce_flash_size; /* Flash NVRAM size */
6451 u32 bce_shmem_base; /* Shared Memory base address */
6452 char * bce_name; /* Name string */
6453
6454 /* Tracks the version of bootcode firmware. */
6224#define NEXT_PG_BD(x) (((x) & USABLE_PG_BD_PER_PAGE) == \
6225 (USABLE_PG_BD_PER_PAGE - 1)) ? \
6226 (x) + 2 : (x) + 1
6227
6228#define PG_CHAIN_IDX(x) ((x) & MAX_PG_BD)
6229
6230#define PG_PAGE(x) (((x) & ~USABLE_PG_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4))
6231#define PG_IDX(x) ((x) & USABLE_PG_BD_PER_PAGE)

--- 218 unchanged lines hidden (view full) ---

6450 u16 link_width; /* PCIe link width */
6451 u16 link_speed; /* PCIe link speed */
6452 struct flash_spec *bce_flash_info; /* Flash NVRAM settings */
6453 u32 bce_flash_size; /* Flash NVRAM size */
6454 u32 bce_shmem_base; /* Shared Memory base address */
6455 char * bce_name; /* Name string */
6456
6457 /* Tracks the version of bootcode firmware. */
6455 u32 bce_fw_ver;
6458 u32 bce_bc_ver;
6456
6457 /* Tracks the state of the firmware. 0 = Running while any */
6458 /* other value indicates that the firmware is not responding. */
6459 u16 bce_fw_timed_out;
6460
6461 /* An incrementing sequence used to coordinate messages passed */
6462 /* from the driver to the firmware. */
6463 u16 bce_fw_wr_seq;

--- 164 unchanged lines hidden (view full) ---

6628 u32 stat_Dot3StatsMultipleCollisionFrames;
6629 u32 stat_Dot3StatsDeferredTransmissions;
6630 u32 stat_Dot3StatsExcessiveCollisions;
6631 u32 stat_Dot3StatsLateCollisions;
6632 u32 stat_EtherStatsCollisions;
6633 u32 stat_EtherStatsFragments;
6634 u32 stat_EtherStatsJabbers;
6635 u32 stat_EtherStatsUndersizePkts;
6459
6460 /* Tracks the state of the firmware. 0 = Running while any */
6461 /* other value indicates that the firmware is not responding. */
6462 u16 bce_fw_timed_out;
6463
6464 /* An incrementing sequence used to coordinate messages passed */
6465 /* from the driver to the firmware. */
6466 u16 bce_fw_wr_seq;

--- 164 unchanged lines hidden (view full) ---

6631 u32 stat_Dot3StatsMultipleCollisionFrames;
6632 u32 stat_Dot3StatsDeferredTransmissions;
6633 u32 stat_Dot3StatsExcessiveCollisions;
6634 u32 stat_Dot3StatsLateCollisions;
6635 u32 stat_EtherStatsCollisions;
6636 u32 stat_EtherStatsFragments;
6637 u32 stat_EtherStatsJabbers;
6638 u32 stat_EtherStatsUndersizePkts;
6636 u32 stat_EtherStatsOverrsizePkts;
6639 u32 stat_EtherStatsOversizePkts;
6637 u32 stat_EtherStatsPktsRx64Octets;
6638 u32 stat_EtherStatsPktsRx65Octetsto127Octets;
6639 u32 stat_EtherStatsPktsRx128Octetsto255Octets;
6640 u32 stat_EtherStatsPktsRx256Octetsto511Octets;
6641 u32 stat_EtherStatsPktsRx512Octetsto1023Octets;
6642 u32 stat_EtherStatsPktsRx1024Octetsto1522Octets;
6643 u32 stat_EtherStatsPktsRx1523Octetsto9022Octets;
6644 u32 stat_EtherStatsPktsTx64Octets;

--- 18 unchanged lines hidden (view full) ---

6663 u32 stat_CatchupInRuleCheckerDiscards;
6664 u32 stat_CatchupInFTQDiscards;
6665 u32 stat_CatchupInMBUFDiscards;
6666 u32 stat_CatchupInRuleCheckerP4Hit;
6667
6668 /* Provides access to certain firmware statistics. */
6669 u32 com_no_buffers;
6670
6640 u32 stat_EtherStatsPktsRx64Octets;
6641 u32 stat_EtherStatsPktsRx65Octetsto127Octets;
6642 u32 stat_EtherStatsPktsRx128Octetsto255Octets;
6643 u32 stat_EtherStatsPktsRx256Octetsto511Octets;
6644 u32 stat_EtherStatsPktsRx512Octetsto1023Octets;
6645 u32 stat_EtherStatsPktsRx1024Octetsto1522Octets;
6646 u32 stat_EtherStatsPktsRx1523Octetsto9022Octets;
6647 u32 stat_EtherStatsPktsTx64Octets;

--- 18 unchanged lines hidden (view full) ---

6666 u32 stat_CatchupInRuleCheckerDiscards;
6667 u32 stat_CatchupInFTQDiscards;
6668 u32 stat_CatchupInMBUFDiscards;
6669 u32 stat_CatchupInRuleCheckerP4Hit;
6670
6671 /* Provides access to certain firmware statistics. */
6672 u32 com_no_buffers;
6673
6671 /* Mbuf allocation failure counter. */
6672 u32 mbuf_alloc_failed;
6674 /* Recoverable failure counters. */
6675 u32 mbuf_alloc_failed_count;
6676 u32 fragmented_mbuf_count;
6677 u32 unexpected_attention_count;
6678 u32 l2fhdr_error_count;
6679 u32 dma_map_addr_tx_failed_count;
6680 u32 dma_map_addr_rx_failed_count;
6673
6681
6674 /* TX DMA mapping failure counter. */
6675 u32 tx_dma_map_failures;
6682#ifdef BCE_DEBUG
6683 /* Simulated recoverable failure counters. */
6684 u32 mbuf_alloc_failed_sim_count;
6685 u32 unexpected_attention_sim_count;
6686 u32 l2fhdr_error_sim_count;
6687 u32 dma_map_addr_failed_sim_count;
6688#endif
6676
6677 u32 hc_command;
6678
6679#ifdef BCE_DEBUG
6680 /* Track the number of enqueued mbufs. */
6681 int debug_tx_mbuf_alloc;
6682 int debug_rx_mbuf_alloc;
6683

--- 17 unchanged lines hidden (view full) ---

6701#ifdef ZERO_COPY_SOCKETS
6702 u32 pg_low_watermark; /* Lowest number of pages free. */
6703 u32 pg_empty_count; /* Number of times the page chain was empty. */
6704#endif
6705
6706 u32 tx_hi_watermark; /* Greatest number of tx_bd's used. */
6707 u32 tx_full_count; /* Number of times the TX chain was full. */
6708
6689
6690 u32 hc_command;
6691
6692#ifdef BCE_DEBUG
6693 /* Track the number of enqueued mbufs. */
6694 int debug_tx_mbuf_alloc;
6695 int debug_rx_mbuf_alloc;
6696

--- 17 unchanged lines hidden (view full) ---

6714#ifdef ZERO_COPY_SOCKETS
6715 u32 pg_low_watermark; /* Lowest number of pages free. */
6716 u32 pg_empty_count; /* Number of times the page chain was empty. */
6717#endif
6718
6719 u32 tx_hi_watermark; /* Greatest number of tx_bd's used. */
6720 u32 tx_full_count; /* Number of times the TX chain was full. */
6721
6709 /* Simulated mbuf allocation failure counter. */
6710 u32 debug_mbuf_sim_alloc_failed;
6711
6712 u32 l2fhdr_status_errors;
6713 u32 unexpected_attentions;
6714 u32 lost_status_block_updates;
6715
6716 u32 requested_tso_frames; /* Number of TSO frames enqueued. */
6717#endif
6718};
6719
6720#endif /* __BCEREG_H_DEFINED */
6721
6722 u32 requested_tso_frames; /* Number of TSO frames enqueued. */
6723#endif
6724};
6725
6726#endif /* __BCEREG_H_DEFINED */
6727