summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_bge.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-03-04 00:55:45 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-03-04 00:55:45 +0000
commit639162dfdc0864741929bf185208e7404aa342a7 (patch)
tree40bfe2977b1c8728e90b9e230ee7fb08455f514c /sys/dev/pci/if_bge.c
parentfc5c686a6cd2b6c4254ec21b540767aca79e684a (diff)
Put the dmamap for a transmission at the correct array index. Fixes a
crash on sparc64. From FreeBSD.
Diffstat (limited to 'sys/dev/pci/if_bge.c')
-rw-r--r--sys/dev/pci/if_bge.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index d16b201061b..88a673467d4 100644
--- a/sys/dev/pci/if_bge.c
+++ b/sys/dev/pci/if_bge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bge.c,v 1.51 2005/01/17 03:00:27 brad Exp $ */
+/* $OpenBSD: if_bge.c,v 1.52 2005/03/04 00:55:44 krw Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2001
@@ -2666,6 +2666,13 @@ bge_encap(sc, m_head, txidx)
if (frag == sc->bge_tx_saved_considx)
return(ENOBUFS);
+ /*
+ * Put the dmamap for this transmission at the same array index as the
+ * last descriptor in this chain. That's where bge_txeof() expects to
+ * find it.
+ */
+ sc->bge_cdata.bge_tx_map[*txidx] = sc->bge_cdata.bge_tx_map[cur];
+ sc->bge_cdata.bge_tx_map[cur] = txmap;
sc->bge_rdata->bge_tx_ring[cur].bge_flags |= BGE_TXBDFLAG_END;
sc->bge_cdata.bge_tx_chain[cur] = m_head;
sc->bge_txcnt += cnt;