summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2000-04-25 05:32:22 +0000
committerJason Wright <jason@cvs.openbsd.org>2000-04-25 05:32:22 +0000
commit0de6bc7c8618cb4744d4710b3aa37d481b01cbcb (patch)
tree34b6432c2b16a58f880745ade66b7d2a0ba413f9 /sys/dev/pci
parent49057a5bf330f04966cf6b2a747e21086f736f55 (diff)
fixing the frontend means fixing the backend too... add a countdown when
computing the length of a destination buffer in the callback since hifn always writes in multiples of 4 bytes (and AH can produce non-nice packets)
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/hifn7751.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c
index 8c6459811fa..e231ceb3f46 100644
--- a/sys/dev/pci/hifn7751.c
+++ b/sys/dev/pci/hifn7751.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hifn7751.c,v 1.35 2000/04/25 04:15:34 jason Exp $ */
+/* $OpenBSD: hifn7751.c,v 1.36 2000/04/25 05:32:21 jason Exp $ */
/*
* Invertex AEON / Hi/fn 7751 driver
@@ -94,7 +94,6 @@ int hifn_freesession __P((u_int64_t));
int hifn_process __P((struct cryptop *));
void hifn_callback __P((struct hifn_softc *, struct hifn_command *, u_int8_t *));
int hifn_crypto __P((struct hifn_softc *, hifn_command_t *));
-void hifn_show_packed __P((char *s, long *pp, int *pl, int npa, int l));
struct hifn_stats {
u_int64_t hst_ibytes;
@@ -1301,8 +1300,15 @@ hifn_callback(sc, cmd, macbuf)
}
if ((m = cmd->dst_m) != NULL) {
+ int totlen = cmd->src_l, len;
+
while (m) {
- m->m_len = dma->dstr[dma->dstk].l & HIFN_D_LENGTH;
+ len = dma->dstr[dma->dstk].l & HIFN_D_LENGTH;
+ if (len > totlen)
+ len = totlen;
+ else
+ totlen -= len;
+ m->m_len = len;
hifnstats.hst_obytes += m->m_len;
m = m->m_next;
if (++dma->dstk == HIFN_D_DST_RSIZE)