aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/bce/if_bcereg.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/bce/if_bcereg.h')
-rw-r--r--sys/dev/bce/if_bcereg.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/sys/dev/bce/if_bcereg.h b/sys/dev/bce/if_bcereg.h
index 001d3411b647..83d4e80984fa 100644
--- a/sys/dev/bce/if_bcereg.h
+++ b/sys/dev/bce/if_bcereg.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2006-2008 Broadcom Corporation
+ * Copyright (c) 2006-2009 Broadcom Corporation
* David Christensen <davidch@broadcom.com>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -6206,6 +6206,7 @@ struct l2_fhdr {
#define RX_PAGE(x) (((x) & ~USABLE_RX_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4))
#define RX_IDX(x) ((x) & USABLE_RX_BD_PER_PAGE)
+#ifdef ZERO_COPY_SOCKETS
/*
* To accomodate jumbo frames, the page chain should
* be 4 times larger than the receive chain.
@@ -6226,6 +6227,8 @@ struct l2_fhdr {
#define PG_PAGE(x) (((x) & ~USABLE_PG_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4))
#define PG_IDX(x) ((x) & USABLE_PG_BD_PER_PAGE)
+#endif /* ZERO_COPY_SOCKETS */
+
/* Context size. */
#define CTX_SHIFT 7
#define CTX_SIZE (1 << CTX_SHIFT)
@@ -6499,8 +6502,11 @@ struct bce_softc
u16 tx_prod;
u16 tx_cons;
u32 tx_prod_bseq; /* Counts the bytes used. */
+
+#ifdef ZERO_COPY_SOCKETS
u16 pg_prod;
u16 pg_cons;
+#endif
int bce_link;
struct callout bce_tick_callout;
@@ -6513,7 +6519,10 @@ struct bce_softc
int rx_bd_mbuf_alloc_size;
int rx_bd_mbuf_data_len;
int rx_bd_mbuf_align_pad;
+
+#ifdef ZERO_COPY_SOCKETS
int pg_bd_mbuf_alloc_size;
+#endif
/* Receive mode settings (i.e promiscuous, multicast, etc.). */
u32 rx_mode;
@@ -6533,11 +6542,13 @@ struct bce_softc
struct rx_bd *rx_bd_chain[RX_PAGES];
bus_addr_t rx_bd_chain_paddr[RX_PAGES];
+#ifdef ZERO_COPY_SOCKETS
/* H/W maintained page buffer descriptor chain structure. */
bus_dma_tag_t pg_bd_chain_tag;
bus_dmamap_t pg_bd_chain_map[PG_PAGES];
struct rx_bd *pg_bd_chain[PG_PAGES];
bus_addr_t pg_bd_chain_paddr[PG_PAGES];
+#endif
/* H/W maintained status block. */
bus_dma_tag_t status_tag;
@@ -6567,7 +6578,10 @@ struct bce_softc
/* Bus tag for RX/TX mbufs. */
bus_dma_tag_t rx_mbuf_tag;
bus_dma_tag_t tx_mbuf_tag;
+
+#ifdef ZERO_COPY_SOCKETS
bus_dma_tag_t pg_mbuf_tag;
+#endif
/* S/W maintained mbuf TX chain structure. */
bus_dmamap_t tx_mbuf_map[TOTAL_TX_BD];
@@ -6577,17 +6591,22 @@ struct bce_softc
bus_dmamap_t rx_mbuf_map[TOTAL_RX_BD];
struct mbuf *rx_mbuf_ptr[TOTAL_RX_BD];
+#ifdef ZERO_COPY_SOCKETS
/* S/W maintained mbuf page chain structure. */
bus_dmamap_t pg_mbuf_map[TOTAL_PG_BD];
struct mbuf *pg_mbuf_ptr[TOTAL_PG_BD];
+#endif
/* Track the number of buffer descriptors in use. */
u16 free_rx_bd;
u16 max_rx_bd;
u16 used_tx_bd;
u16 max_tx_bd;
+
+#ifdef ZERO_COPY_SOCKETS
u16 free_pg_bd;
u16 max_pg_bd;
+#endif
/* Provides access to hardware statistics through sysctl. */
u64 stat_IfHCInOctets;
@@ -6661,7 +6680,10 @@ struct bce_softc
/* Track the number of enqueued mbufs. */
int debug_tx_mbuf_alloc;
int debug_rx_mbuf_alloc;
+
+#ifdef ZERO_COPY_SOCKETS
int debug_pg_mbuf_alloc;
+#endif
/* Track how many and what type of interrupts are generated. */
u32 interrupts_generated;
@@ -6676,8 +6698,10 @@ struct bce_softc
u32 rx_low_watermark; /* Lowest number of rx_bd's free. */
u32 rx_empty_count; /* Number of times the RX chain was empty. */
+#ifdef ZERO_COPY_SOCKETS
u32 pg_low_watermark; /* Lowest number of pages free. */
u32 pg_empty_count; /* Number of times the page chain was empty. */
+#endif
u32 tx_hi_watermark; /* Greatest number of tx_bd's used. */
u32 tx_full_count; /* Number of times the TX chain was full. */
@@ -6693,5 +6717,5 @@ struct bce_softc
#endif
};
-#endif /* #ifndef _BCE_H_DEFINED */
+#endif /* __BCEREG_H_DEFINED */