summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/hifn7751.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c
index ff725ebad0d..6880990fe43 100644
--- a/sys/dev/pci/hifn7751.c
+++ b/sys/dev/pci/hifn7751.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hifn7751.c,v 1.40 2000/06/13 02:22:50 jason Exp $ */
+/* $OpenBSD: hifn7751.c,v 1.41 2000/06/13 05:04:59 jason Exp $ */
/*
* Invertex AEON / Hi/fn 7751 driver
@@ -1361,6 +1361,7 @@ hifn_callback(sc, cmd, macbuf)
struct cryptop *crp = (struct cryptop *)cmd->private_data;
struct cryptodesc *crd;
struct mbuf *m;
+ int totlen;
if ((crp->crp_flags & CRYPTO_F_IMBUF) && (cmd->src_m != cmd->dst_m)) {
m_freem(cmd->src_m);
@@ -1368,16 +1369,15 @@ hifn_callback(sc, cmd, macbuf)
}
if ((m = cmd->dst_m) != NULL) {
- int totlen = cmd->src_l, len;
-
+ totlen = cmd->src_l;
+ hifnstats.hst_obytes += totlen;
while (m) {
- len = dma->dstr[dma->dstk].l & HIFN_D_LENGTH;
- if (len > totlen)
- len = totlen;
+ if (totlen < m->m_len) {
+ m->m_len = totlen;
+ totlen = 0;
+ }
else
- totlen -= len;
- m->m_len = len;
- hifnstats.hst_obytes += m->m_len;
+ totlen -= m->m_len;
m = m->m_next;
if (++dma->dstk == HIFN_D_DST_RSIZE)
dma->dstk = 0;