summaryrefslogtreecommitdiff
path: root/sys/dev
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
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')
-rw-r--r--sys/dev/pci/if_bge.c9
-rw-r--r--sys/dev/pci/if_bgereg.h7
2 files changed, 9 insertions, 7 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;
diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h
index 1cfaf4b4bfb..5da661f5a06 100644
--- a/sys/dev/pci/if_bgereg.h
+++ b/sys/dev/pci/if_bgereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bgereg.h,v 1.18 2004/12/26 22:48:31 brad Exp $ */
+/* $OpenBSD: if_bgereg.h,v 1.19 2005/03/04 00:55:44 krw Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2001
@@ -2234,11 +2234,6 @@ struct bge_jpool_entry {
LIST_ENTRY(bge_jpool_entry) jpool_entries;
};
-struct bge_bcom_hack {
- int reg;
- int val;
-};
-
struct bge_softc {
struct device bge_dev;
struct arpcom arpcom; /* interface info */