summaryrefslogtreecommitdiff
path: root/sys/arch/alpha/dev
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2004-11-09 19:17:02 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2004-11-09 19:17:02 +0000
commit13549a4aca80818e9052f614bf46a39784c14ce2 (patch)
treed6844077ea48e352d60450eb5749fd36dd7c9db4 /sys/arch/alpha/dev
parent2791957a5cb013272ff6f92880bc5414cfbd2538 (diff)
Do not map empty mbufs (m_len == 0) in bus_dmamap_load_mbuf() as these mappings
may disturb the dma as seen in ipw(4). Emtpy mbufs are at the beginning of the mbuf chain and are as example a "side-effect" of a previous m_adj() call. OK miod@ mickey@ jason@ markus@
Diffstat (limited to 'sys/arch/alpha/dev')
-rw-r--r--sys/arch/alpha/dev/bus_dma.c4
-rw-r--r--sys/arch/alpha/dev/sgmap_typedep.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/sys/arch/alpha/dev/bus_dma.c b/sys/arch/alpha/dev/bus_dma.c
index 4d2a2a8d4dc..f915392f560 100644
--- a/sys/arch/alpha/dev/bus_dma.c
+++ b/sys/arch/alpha/dev/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.12 2003/10/18 20:14:40 jmc Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.13 2004/11/09 19:17:00 claudio Exp $ */
/* $NetBSD: bus_dma.c,v 1.40 2000/07/17 04:47:56 thorpej Exp $ */
/*-
@@ -310,6 +310,8 @@ _bus_dmamap_load_mbuf_direct(t, map, m0, flags)
seg = 0;
error = 0;
for (m = m0; m != NULL && error == 0; m = m->m_next) {
+ if (m->m_len == 0)
+ continue;
error = _bus_dmamap_load_buffer_direct_common(t, map,
m->m_data, m->m_len, NULL, flags, &lastaddr, &seg, first);
first = 0;
diff --git a/sys/arch/alpha/dev/sgmap_typedep.c b/sys/arch/alpha/dev/sgmap_typedep.c
index cacd69661d1..b49aec8ee5b 100644
--- a/sys/arch/alpha/dev/sgmap_typedep.c
+++ b/sys/arch/alpha/dev/sgmap_typedep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sgmap_typedep.c,v 1.3 2004/01/13 00:12:15 deraadt Exp $ */
+/* $OpenBSD: sgmap_typedep.c,v 1.4 2004/11/09 19:17:01 claudio Exp $ */
/* $NetBSD: sgmap_typedep.c,v 1.17 2001/07/19 04:27:37 thorpej Exp $ */
/*-
@@ -247,9 +247,12 @@ __C(SGMAP_TYPE,_load_mbuf)(bus_dma_tag_t t, bus_dmamap_t map,
seg = 0;
error = 0;
- for (m = m0; m != NULL && error == 0; m = m->m_next, seg++)
+ for (m = m0; m != NULL && error == 0; m = m->m_next, seg++) {
+ if (m->m_len == 0)
+ continue;
error = __C(SGMAP_TYPE,_load_buffer)(t, map,
m->m_data, m->m_len, NULL, flags, &seg, sgmap);
+ }
alpha_mb();