aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>2001-06-06 22:16:23 +0000
committerBill Paul <wpaul@FreeBSD.org>2001-06-06 22:16:23 +0000
commit23d3a203adf35f629acbd392b7579f2658b11886 (patch)
treee0e2588ed8b088c788e910c8a39524be192930a5 /sys
parentdafc44644b237fbb60a3483b29482943a21ee307 (diff)
downloadsrc-23d3a203adf35f629acbd392b7579f2658b11886.tar.gz
src-23d3a203adf35f629acbd392b7579f2658b11886.zip
- Remember to set the 'extsts enable' bit in the CFG register to enable the
use of the extsts field in DMA descriptors. We need this to tell the chip to calculate TCP/IP checksums in hardware on a per-packet basis. - Fix the unions in DMA descriptor structures. Breakage on alpha led me to realize I'd done it wrong the first time.
Notes
Notes: svn path=/head/; revision=77842
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/nge/if_nge.c6
-rw-r--r--sys/dev/nge/if_ngereg.h26
2 files changed, 16 insertions, 16 deletions
diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c
index 1530a4c59c20..861edd28a9c4 100644
--- a/sys/dev/nge/if_nge.c
+++ b/sys/dev/nge/if_nge.c
@@ -1767,10 +1767,12 @@ static void nge_init(xsc)
/*
* Enable the delivery of PHY interrupts based on
- * link/speed/duplex status changes.
+ * link/speed/duplex status changes. Also enable the
+ * extsts field in the DMA descriptors (needed for
+ * TCP/IP checksum offload on transmit).
*/
NGE_SETBIT(sc, NGE_CFG, NGE_CFG_PHYINTR_SPD|NGE_CFG_MODE_1000|
- NGE_CFG_PHYINTR_LNK|NGE_CFG_PHYINTR_DUP);
+ NGE_CFG_PHYINTR_LNK|NGE_CFG_PHYINTR_DUP|NGE_CFG_EXTSTS_ENB);
/*
* Enable interrupts.
diff --git a/sys/dev/nge/if_ngereg.h b/sys/dev/nge/if_ngereg.h
index c7157b955609..56c141cfade3 100644
--- a/sys/dev/nge/if_ngereg.h
+++ b/sys/dev/nge/if_ngereg.h
@@ -258,14 +258,6 @@
#define NGE_TXDMA_256BYTES 0x00600000
#define NGE_TXDMA_512BYTES 0x00700000
-#define NGE_TXCFG_100 \
- (NGE_TXDMA_64BYTES|NGE_TXCFG_AUTOPAD|\
- NGE_TXCFG_FILL(64)|NGE_TXCFG_DRAIN(1536))
-
-#define NGE_TXCFG_10 \
- (NGE_TXDMA_32BYTES|NGE_TXCFG_AUTOPAD|\
- NGE_TXCFG_FILL(64)|NGE_TXCFG_DRAIN(1536))
-
#define NGE_TXCFG \
(NGE_TXDMA_512BYTES|NGE_TXCFG_AUTOPAD|\
NGE_TXCFG_FILL(64)|NGE_TXCFG_DRAIN(6400))
@@ -486,9 +478,12 @@ struct nge_desc_64 {
/* Driver software section */
union {
struct mbuf *nge_mbuf;
+ u_int64_t nge_dummy;
+ } nge_mb_u;
+ union {
struct nge_desc_64 *nge_nextdesc;
- u_int64_t nge_dummy[2];
- } nge_u;
+ u_int64_t nge_dummy;
+ } nge_nd_u;
};
struct nge_desc_32 {
@@ -503,14 +498,17 @@ struct nge_desc_32 {
/* Driver software section */
union {
struct mbuf *nge_mbuf;
+ u_int64_t nge_dummy;
+ } nge_mb_u;
+ union {
struct nge_desc_32 *nge_nextdesc;
- u_int64_t nge_dummy[2];
- } nge_u;
+ u_int64_t nge_dummy;
+ } nge_nd_u;
};
#define nge_desc nge_desc_32
-#define nge_mbuf nge_u.nge_mbuf
-#define nge_nextdesc nge_u.nge_nextdesc
+#define nge_mbuf nge_mb_u.nge_mbuf
+#define nge_nextdesc nge_nd_u.nge_nextdesc
#define NGE_CMDSTS_BUFLEN 0x0000FFFF
#define NGE_CMDSTS_PKT_OK 0x08000000